The present invention relates to pyrazole fused-ring derivatives, their preparation methods, and use thereof in medicine. In particular, the present invention relates to a novel derivative 5 represented by formula (I), and a pharmaceutically acceptable salt thereof or a pharmaceutical composition comprising the same and a method for preparing the same. The present invention also relates to use of the derivatives and the pharmaceutically acceptable salt thereof or the pharmaceutical composition comprising the same in the preparation of therapeutic agents, in particular Bruton tyrosine kinase inhibitors, and preparing a medicament for treating and/or 10 preventing tumors and inflammatory associated diseases. The substituents on formula (I) are defined same as in the specification. B i- `B- Li ., P -----L , A3 R 4 N, 1 A v A .1 "-A2 - --L2 - - ^ . R2 (I) 15