This paper presents a rapid and real-time method for identifying wild Astragali Radix (WAR) and cultivated Astragali Radix (CAR) using a combination of rapid evaporative ionization mass spectrometry (REIMS) and two-dimensional liquid chromatography mass spectrometry (2DLC-MS). The method avoids time-consuming sample preparation and utilizes phenotypic data to create a real-time recognition model. 2DLC-MS was used to characterize compounds, identifying 45 different compounds that were further analyzed using UHPLC-QTRAP-MS for semi-quantitative analysis. The study found that WAR generally had higher relative content of most compounds compared to CAR, demonstrating the method's effectiveness in distinguishing between the two.