Disclosed is a BRD4 inhibitor as shown in formula I, belonging to the field of compound drugs. The compound provided has a good inhibitory effect on prostate cancer cell proliferation, and can be used for preparing a drug combatting tumors, autoimmune or inflammatory diseases and viral infection, and in particular an anti-prostate cancer drug.