The present invention relates to a purine derivative and use thereof in medicine, and in particular to a pyrimidine derivative shown as general formula (I) or a stereoisomer, solvate, metabolite, prodrug, deuteride, pharmaceutically acceptable salt or cocrystal thereof, a pharmaceutical composition comprising the same, and use of the compound or composition of the present invention in the field of preparation of a DNA-PK inhibitor, wherein the substituents in general formula (I) are defined in the same way as in the specification