The present invention discloses a compound for regulating protein kinase activity and used for treating or preventing diseases associated with protein kinases. Specifically, the present invention relates to a benzofuran pyrazole amine protein kinase inhibitor which belongs to compounds that regulate anaplastic lymphoma kinase (ALK), and provides a method of preparing such a compound and a pharmaceutical use of such a compound in the treatment or prevention of diseases associated with ALK. The inhibitor can solve the problem of the drug resistance of the first generation and the second generation of ALK inhibitors.