Disclosed are a pyrazolo-heteroaryl derivative, a preparation method and medical use thereof. In particular, the present invention relates to a new pyrazolo-heteroaryl derivative as shown in the general formula (I), a preparation method thereof and a pharmaceutical composition containing the derivative and the use thereof as a therapeutic agent, in particular as a TLR7 agonist, wherein each substituent in the general formula (I) is defined in the description.