The yanhusuo herb used in our study is derived from the yanhusuo's dried tubers, which belong to the Poppy Corydalis genus, and it is one of the traditional Chinese medicines (TCM) for relieving pain and promoting the circulation of blood and qi. The main components of yanhusuo include tetrahydroprotoberberine alkaloids, protoberberine alkaloids, protopine alkaloids and aporphine alkaloids. In this study, we aimed to realise the classification and identification of the alkaloid components in the yanhusuo herb by characteristic fragments and neutral losses using UPLC-Q-TOF/MS technology. After extensive review of the literature and some reference experiments, we found the fragmentation pattern of several alkaloids and the information of their corresponding fragment ions. Then, we determined the type of compound according to the type of fragment ions and the fragmentation pattern; thus we identified the compounds. Finally, we obtained 19 kinds of alkaloid compositions, including 12 kinds of tetrahydroprotoberberine alkaloids, 4 kinds of protoberberine alkaloids, 2 kinds of protopine alkaloids and 1 kind of aporphine alkaloid. In addition, analysis of the composition of yanhusuo was performed, which effectively solved the technical difficulties in the fingerprint analysis of TCM. This accurate and reliable method can provide a foundation for controlling the quality of different batches of the original ingredients.