A compound of formula, an optical isomer or a pharmaceutically acceptable salt thereof, wherein, R 1 is selected from the group consisting of CN, C 1-6 alkyl and 3-6 membered heterocycloalkyl, wherein the C 1-6 alkyl and 3-6 membered heterocycloalkyl are optionally substituted with 1, 2 or 3 R a; R 2 is selected from the group consisting of C 1-6 alkyl and 3-6 membered heterocycloalkyl, wherein the C 1-6 alkyl and 3-6 membered heterocycloalkyl are optionally substituted with 1, 2 or 3 R b; R 3 is selected from the group consisting of H, F, Cl, Br, I, OH, NH 2, CN, C 1-6 alkyl, -C(=O)-O-C 1-6 alkyl, -C(=O)-C 1-6 alkyl and C 3-6 cycloalkyl, wherein the C 1-6 alkyl, -C(=O)-O-C 1-6 alkyl, -C(=O)-C 1-6 alkyl and C 3-6 cycloalkyl are optionally substituted with 1, 2 or 3 R c; ring A is selected from the group consisting of 3-10 membered heterocycloalkyl, and the 3-10 membered heterocycloalkyl is optionally substituted with 1, 2 or 3 R d; L 1 is selected from the group consisting of O and N(R 4); L 2 is selected from the group consisting of a single bond, CH 2 and CH 2 CH 2; R 4 is selected from the group consisting of H and Me; each R a is independently selected from the group consisting of F, Cl, Br, I, OH, NH 2, CN and COOH; each R b is independently selected from the group consisting of F, Cl, Br, I, OH, NH 2, COOH and Me; each R c is independently selected from the group consisting of F, Cl, Br, I, OH, NH 2 and CN; each R a is independently selected from the group consisting of F, Cl, Br, I, OH, NH 2 and CN; the 3-6 membered heterocycloalkyl contains 1, 2 or 3 heteroatoms or heteroatom groups independently selected from the group consisting of -O-, -S-, -NH- and N; and the 3-10 membered heterocycloalkyl contains 1, 2 or 3 heteroatoms or heteroatom groups independently selected from the group consisting of -O-, -S-, -NH-, N, and -C(=O)NH-. R 1 is selected from the group consisting of CN, C 1-6 alkyl and 3-6 membered heterocycloalkyl, wherein the C 1-6 alkyl and 3-6 membered heterocycloalkyl are optionally substituted with 1, 2 or 3 R a; R 2 is selected from the group consisting of C 1-6 alkyl and 3-6 membered heterocycloalkyl, wherein the C 1-6 alkyl and 3-6 membered heterocycloalkyl are optionally substituted with 1, 2 or 3 R b; R 3 is selected from the group consisting of H, F, Cl, Br, I, OH, NH 2, CN, C 1-6 alkyl, -C(=O)-O-C 1-6 alkyl, -C(=O)-C 1-6 alkyl and C 3-6 cycloalkyl, wherein the C 1-6 alkyl, -C(=O)-O-C 1-6 alkyl, -C(=O)-C 1-6 alkyl and C 3-6 cycloalkyl are optionally substituted with 1, 2 or 3 R c; ring A is selected from the group consisting of 3-10 membered heterocycloalkyl, and the 3-10 membered heterocycloalkyl is optionally substituted with 1, 2 or 3 R d; L 1 is selected from the group consisting of O and N(R 4); L 2 is selected from the group consisting of a single bond, CH 2 and CH 2 CH 2; R 4 is selected from the group consisting of H and Me; each R a is independently selected from the group consisting of F, Cl, Br, I, OH, NH 2, CN and COOH; each R b is independently selected from the group consisting of F, Cl, Br, I, OH, NH 2, COOH and Me; each R c is independently selected from the group consisting of F, Cl, Br, I, OH, NH 2 and CN; each R a is independently selected from the group consisting of F, Cl, Br, I, OH, NH 2 and CN; the 3-6 membered heterocycloalkyl contains 1, 2 or 3 heteroatoms or heteroatom groups independently selected from the group consisting of -O-, -S-, -NH- and N; and the 3-10 membered heterocycloalkyl contains 1, 2 or 3 heteroatoms or heteroatom groups independently selected from the group consisting of -O-, -S-, -NH-, N, and -C(=O)NH-.