The present invention relates to a 7-(thiazol-5-yl)pyrrolopyrimidine compound as a TLR7 agonist, and particularly relates to a compound shown in formula (I), pharmaceutically acceptable salt and preparation method thereof, a pharmaceutical composition containing such a compound, and usage thereof in preparing an antiviral drug.