Huai Yam (Dioscoreae Rhizoma) contains many active ingredients such as flavonoids, saponins, and amino acids. In this study, an efficient method for the classification and rapid identification of yam components was established based on UPLC-Q-Exactive-MS and data post-processing techniques. First, the mass spectrometry information including the characteristic fragmentations (CFs) and neutral losses (NLs) of yam reported in the literature were summarized and a database of compounds was established. Then, the mass spectrometry data detected by the yam sample are compared with those described in database for rapid identification of target compounds. Finally, 60 compounds were identified, including 18 flavones, 2 saponins, 10 amino acids, 7 organic acids, 3 carbohydrates, 8 fatty acids and 12 others. A new strategy for identifying target constituents based on CFs and NLs was successfully established, laying the foundation for further research on yam and promoting the development of composition analysis of Traditional Chinese Medicine (TCM).