The invention relates to the technical field of bioinformatics, in particular to an effective heat treatment method for identifying and quarantine fruit flies and application thereof. The method comprises the following steps: identifying quarantine fruit flies and non-quarantine fruit flies according to the difference of the content of metabolites; the metabolite comprises tyrosine, 3-hydroxykynurenine, 4-hydroxyhippuric acid, adenylic acid, dopa, trehalose, malic acid, homoserine, glucose, fumaric acid, yellow uric acid, mannitol, succinic acid, inositol, threonic acid, pinocembriose, uric acid, methionine, serine, oleic acid, stearic acid, palmitoleic acid, glycolic acid, glycine, palmitic acid, putrescine, lactic acid and aminomalonic acid. The compound is one or more of beta-hydroxybutyric acid, alpha-hydroxyglutaric acid, sedoheptulose-7-phosphoric acid or adenosine. The invention provides a plurality of markers which can be used for identifying and quarantine the fruit flies and can effectively distinguish whether the fruit flies are subjected to heat treatment or not.