The invention provides triazole compounds and a preparation method and application thereof. The provided triazole compounds or pharmaceutically acceptable salts thereof have the structure shown as a formula (I), wherein R1, R2 and R3 are respectively and independently selected from -SO2R4, -SO2R5, COR6, H, and halogen; R4, R5 and R6 are respectively and independently selected from an aryl group, a heteroaryl group, a linear or branched alkyl group, an alkenyl group and a cycloalkyl group, wherein the aryl group, the heteroaryl group, the linear or branched alkyl group, the alkenyl group and the cycloalkyl group are unsubstituted or substituted by R7; R7 is selected from halogen, a C1-5 straight or branched alkyl group, a haloalkyl group, a C1-5 straight or branched alkoxy group and a nitro group. The compounds have good inhibitory activity against BRD4, HIV latent virus infection activation activity, low toxicity, high druggability and a more potential clinical application value.