A compound of formula, or a pharmaceutically acceptable salt thereof, wherein, E is selected from the group consisting of C 1-6 alkyl, and a 3- to 10- membered cyclohydrocarbyl or heterocyclohydrocarbyl, optionally substituted with 1, 2 or 3 R 3; one of L and Q is selected from the group consisting of -C(R 3)(R 3)-, -C(=O)N(R a)-, -N(R a)-,-C(=NR a)-, -S(=O) 2 N(R a)-, -S(=O)N(R a)-, -O-, -S-, -C(=O)O-, -C(=O)-, -C(=S)-, -S(=O)-, - S(=O) 2 -, and -N(R a)C(=O)N(R a)-, and the other is selected from a single bond or -C(R 3)(R 3)-; A is N or C(R 3); zero or one of X, Y, and Z is selected from N, and the others are selected from C(R 3); the heteroatom or heteroatom group is independently selected from the group consisting of-C(=O)N(R a)-, -N(R a)-, -C(=NR a)-, -S(=O) 2 N(R a)-, -S(=O)N(R a)-, -O-, -S-, -C(=O)O-, -C(=O) -,-C(=S)-, -S(=O)-, -S(=O) 2 - and -N(R a)C(=O)N(R a)-; each m 1 is independently selected from 0, 1, 2 or 3; R 1-3 are independently selected from the group consisting of H, F, Cl, Br, I, CN, OR a, N(R b)(R c), C 1-3 alkyl optionally substituted by R d, D 1 is selected from the group consisting of a single bond, -C(R e)(R e)-, -C(=O)N(R a)-, -N(R a)-, -C(=NR a)-, -S(=O) 2 N(R a)-, -S(=O)N(R a)-, -O-, -S-, -C(=O)O-, -C(=O) -, -C(=S)-, -S(=O)-,-S(=O) 2 -, and -N(R a)C(=O)N(R a)-; D 2 is selected from -C(R a)(R a)-; n is selected from 1, 2, 3, 4, 5, or 6; R a, R b, and R c are independently selected the group consisting of H, C 3-6 cycloalkyl or C 1-6 alkyl optionally substituted by R d; R e is selected from the group consisting of H, C 1-6 alkyl or alkoxy optionally substituted by R d, C 3-6 cycloalkyl or cycloalkyloxy optionally substituted by R d; R d is selected from the group consisting of F, Cl, Br, I, CN, OH, CHO, COOH, CH 3, CF 3, CH 3 O, and CH 3 CH 2 O, and the number of R d is selected from 0, 1, 2, or 3; optionally, any two R 1, R a and R a in the same D 2, two D 2, or R a and one D 2, together with the same carbon atom or oxygen atom to which they both attach, form one or two 3-, 4-, 5- or 6-membered carbocyclic rings or oxygen-containing heterocyclic rings, wherein the number of oxygen atom is 1 or 2. E is selected from the group consisting of C 1-6 alkyl, and a 3- to 10- membered cyclohydrocarbyl or heterocyclohydrocarbyl, optionally substituted with 1, 2 or 3 R 3; one of L and Q is selected from the group consisting of -C(R 3)(R 3)-, -C(=O)N(R a)-, -N(R a)-,-C(=NR a)-, -S(=O) 2 N(R a)-, -S(=O)N(R a)-, -O-, -S-, -C(=O)O-, -C(=O)-, -C(=S)-, -S(=O)-, - S(=O) 2 -, and -N(R a)C(=O)N(R a)-, and the other is selected from a single bond or -C(R 3)(R 3)-; A is N or C(R 3); zero or one of X, Y, and Z is selected from N, and the others are selected from C(R 3); the heteroatom or heteroatom group is independently selected from the group consisting of-C(=O)N(R a)-, -N(R a)-, -C(=NR a)-, -S(=O) 2 N(R a)-, -S(=O)N(R a)-, -O-, -S-, -C(=O)O-, -C(=O) -,-C(=S)-, -S(=O)-, -S(=O) 2 - and -N(R a)C(=O)N(R a)-; each m 1 is independently selected from 0, 1, 2 or 3; R 1-3 are independently selected from the group consisting of H, F, Cl, Br, I, CN, OR a, N(R b)(R c), C 1-3 alkyl optionally substituted by R d, D 1 is selected from the group consisting of a single bond, -C(R e)(R e)-, -C(=O)N(R a)-, -N(R a)-, -C(=NR a)-, -S(=O) 2 N(R a)-, -S(=O)N(R a)-, -O-, -S-, -C(=O)O-, -C(=O) -, -C(=S)-, -S(=O)-,-S(=O) 2 -, and -N(R a)C(=O)N(R a)-; D 2 is selected from -C(R a)(R a)-; n is selected from 1, 2, 3, 4, 5, or 6; R a, R b, and R c are independently selected the group consisting of H, C 3-6 cycloalkyl or C 1-6 alkyl optionally substituted by R d; R e is selected from the group consisting of H, C 1-6 alkyl or alkoxy optionally substituted by R d, C 3-6 cycloalkyl or cycloalkyloxy optionally substituted by R d; R d is selected from the group consisting of F, Cl, Br, I, CN, OH, CHO, COOH, CH 3, CF 3, CH 3 O, and CH 3 CH 2 O, and the number of R d is selected from 0, 1, 2, or 3; optionally, any two R 1, R a and R a in the same D 2, two D 2, or R a and one D 2, together with the same carbon atom or oxygen atom to which they both attach, form one or two 3-, 4-, 5- or 6-membered carbocyclic rings or oxygen-containing heterocyclic rings, wherein the number of oxygen atom is 1 or 2.