The present invention provides a Bruton's tyrosine kinase inhibitor, which is a compound represented by formula (I) or a pharmaceutically acceptable salt, solvate, ester, acid, metabolite or prodrug thereof. The present invention also provides a pharmaceutical composition comprising the compound. The present invention also provides a method and use of using the Bruton's tyrosine kinase inhibitor to inhibit the tyrosine kinase activity or treat diseases, disorders or symptoms benefiting from the inhibition of the Bruton's tyrosine kinase (Btk) activity.