A compound as shown in formula or a pharmaceutically acceptable salt thereof, wherein, X is selected from O, N(R 3), -CH(R 3)-; R 3 is selected from H, F, Cl, Br, I, OH, CN, NH 2, COOH, R 4 -L 1 -, or selected from the group consisting of C 1-6 alkyl, C 1-6 heteroalkyl, C 3-6 cycloalkyl, 3-6 membered heterocycloalkyl, phenyl and 5-6 membered heteroaryl, each of which is optionally substituted by 1, 2 or 3 R; R 4 is selected from the group consisting of C 3-6 cycloalkyl, 3-6 membered heterocycloalkyl, phenyl and 5-6 membered heteroaryl, each of which is optionally substituted by 1, 2 or 3 R; L 1 is selected from -CH 2 -, -CH 2 CH 2 -, O, S, NH, -C(=O)-; R 1 and R 2 are each independently selected from H, F, Cl, Br, I, OH, CN, NH 2, R 5 -L 2 -, or selected from the group consisting of C 1-6 alkyl, C 6 alkoxy, C 1-6 alkylthio, C 1-6 alkylamino, C 2-6 alkenyl, C 3-6 cycloalkenyl, 3-6 membered heterocycloalkenyl, C 3-6 cycloalkyl, 3-6 membered heterocycloalkyl, phenyl and 5-6 membered heteroaryl, each of which is optionally substituted by 1, 2 or 3 R; R 5 is selected from the group consisting of C 3-6 cycloalkyl, 3-6 membered heterocycloalkyl, 3-6 membered heterocycloalkenyl, phenyl and 5-6 membered heteroaryl, each of which is optionally substituted by 1, 2 or 3 R; L 2 is selected from -CH 2 -, -CH 2 CH 2 -, O, S, NH; R 6 is selected from C 1-3 alkyl, which is optionally substituted by 1, 2 or 3 R; R is selected from H, halogen, OH, NH 2, CN, CN, or selected from the group consisting of N,N'-di(C 1-3 alkyl)amino, C 1-6 alkyl and C 1-6 heteroalkyl, each of which is optionally substituted by 1, 2 or 3 R'; R' is selected from H, F, Cl, Br, I, OH, NH 2, Me, Et, CF 3, CHF 2, CH 2 F, NHCH 3, N(CH 3) 2; the "hetero" in the C 1-6 heteroalkyl, 3-6 membered heterocycloalkyl, 5-6 membered heteroaryl and 3-6 membered heterocycloalkenyl is selected from -C(=O)NH-, -NH-, - C(=NH)-, -S(=O) 2 NH-, -S(=O)NH-, -O-, -S-, =O, =S, -O-N=, -C(=O)O-, -C(=O)-, - C(=S)-, -S(=O)-, -S(=O) 2 - and -NHC(=O)NH-; in any of the above cases, the number of the heteroatom or the heteroatom group is independently selected from 1, 2, 3. X is selected from O, N(R 3), -CH(R 3)-; R 3 is selected from H, F, Cl, Br, I, OH, CN, NH 2, COOH, R 4 -L 1 -, or selected from the group consisting of C 1-6 alkyl, C 1-6 heteroalkyl, C 3-6 cycloalkyl, 3-6 membered heterocycloalkyl, phenyl and 5-6 membered heteroaryl, each of which is optionally substituted by 1, 2 or 3 R; R 4 is selected from the group consisting of C 3-6 cycloalkyl, 3-6 membered heterocycloalkyl, phenyl and 5-6 membered heteroaryl, each of which is optionally substituted by 1, 2 or 3 R; L 1 is selected from -CH 2 -, -CH 2 CH 2 -, O, S, NH, -C(=O)-; R 1 and R 2 are each independently selected from H, F, Cl, Br, I, OH, CN, NH 2, R 5 -L 2 -, or selected from the group consisting of C 1-6 alkyl, C 6 alkoxy, C 1-6 alkylthio, C 1-6 alkylamino, C 2-6 alkenyl, C 3-6 cycloalkenyl, 3-6 membered heterocycloalkenyl, C 3-6 cycloalkyl, 3-6 membered heterocycloalkyl, phenyl and 5-6 membered heteroaryl, each of which is optionally substituted by 1, 2 or 3 R; R 5 is selected from the group consisting of C 3-6 cycloalkyl, 3-6 membered heterocycloalkyl, 3-6 membered heterocycloalkenyl, phenyl and 5-6 membered heteroaryl, each of which is optionally substituted by 1, 2 or 3 R; L 2 is selected from -CH 2 -, -CH 2 CH 2 -, O, S, NH; R 6 is selected from C 1-3 alkyl, which is optionally substituted by 1, 2 or 3 R; R is selected from H, halogen, OH, NH 2, CN, CN, or selected from the group consisting of N,N'-di(C 1-3 alkyl)amino, C 1-6 alkyl and C 1-6 heteroalkyl, each of which is optionally substituted by 1, 2 or 3 R'; R' is selected from H, F, Cl, Br, I, OH, NH 2, Me, Et, CF 3, CHF 2, CH 2 F, NHCH 3, N(CH 3) 2; the "hetero" in the C 1-6 heteroalkyl, 3-6 membered heterocycloalkyl, 5-6 membered heteroaryl and 3-6 membered heterocycloalkenyl is selected from -C(=O)NH-, -NH-, - C(=NH)-, -S(=O) 2 NH-, -S(=O)NH-, -O-, -S-, =O, =S, -O-N=, -C(=O)O-, -C(=O)-, - C(=S)-, -S(=O)-, -S(=O) 2 - and -NHC(=O)NH-; in any of the above cases, the number of the heteroatom or the heteroatom group is independently selected from 1, 2, 3.