6 - amino quinazoline or 3 - cyano quinoline derivatives , preparation methods and pharmaceutical uses thereof are disclosed . specifically , the present disclosure discloses novel 6 - amino quinazoline or 3 - cyano quinoline derivatives presented by general formula , or tautomers , enantiomers , diastereomers , racemates or pharmaceutically acceptable salts thereof , or metabolites , metabolic precursors or prodrugs thereof , and their uses as treatment agents especially as protein kinase inhibitors , in which each substitutent group of general formula is as defined in the specification .