Provided are certain compounds or pharmaceutically acceptable salts thereof which can inhibit kinase activity of Bruton's tyrosine kinase (BTK) and may be useful for the treatment of diseases like cancer, immunological disease and inflammation.本發明是有關於一種可抑制布魯頓酪胺酸激酶(BTK)活性的化合物或其藥學可接受的鹽,以及作爲藥物治療疾病,如癌症、免疫疾病和炎症。