The present invention relates to the field of medicinal chemistry, and in particular relates to 4-(five-membered heterocyclic pyrimidine/pyridine substituted) amino-1H-3-pyrazolecarboxamide derivatives, the preparation method thereof, pharmaceutical compositions containing these compounds and the medicinal use thereof, especially as protein kinase inhibitors for anti-tumour use.