Objective:To compare the difference of volatile components in Eleusine coracana(L.)Gaertn.before and after stir-frying and explore the pharmacological substance in fried sample for treating diarrhea.Methods:The technology of headspace solid-phase microextraction combined with gas chromatography-mass spectrometry(HS-SPME-GC-MS)was used to detect the types and relative percentage content of volatile components in raw and fried samples,and the common and unique components were compared and analyzed.Results:A total of 123 volatile components were detected in the raw and stir-fried products,including 20 common components.There were 27 unique components in the raw products and 76 unique components in the stir-fried products.After stir-frying,the content of alkanes in the raw seeds decreased,and some olefins,esters,aldehydes and phenols were generated.The first three components with the highest content were caryophyllene(12.79% ),thymol(12.65% ),and isobutyric acid thymol(10.06% )after stir-frying.Conclusion:The reason for the good effect on various diarrhea treatments of E.coracana after stir-frying may be related to the volatile components generated after frying.