The present invention belongs to the technical field of chemical pharmaceuticals, and relates to a compound represented by general formula (I) or formula (II) and a preparation method thereof. The compounds are biaryl derivatives with RORγt activation activity. The biaryl derivatives disclosed in this invention can effectively activate the RORγt protein receptor, and thereby promote the differentiation of Th17 cells and increasing the production of IL-17, which can be used as an immune modulator for the treatment of various cancers or viral infection-related diseases.