The present invention relates to a sulfuryl-substituted benzoheterocyclic derivative, a preparation method and medical use thereof. Particularly, disclosed is a compound of formula (I) or a pharmaceutically acceptable salt, stereoisomer, solvate, or prodrug thereof, and a preparation method and application thereof. The definition of each group in the formula can be found in the specification and the claims.