Method for detecting total heavy metal content in medicinal materials

CN123012644APending Publication Date: 2026-10-30ANHUI XINSHENG TRADITIONAL CHINESE MEDICINE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611094726.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0003]仅输出单一检测数值,无法结合产地土壤基底、种植环境、大气沉降环境数据综合判定重金属污染风险等级,单纯数值易出现误判;

Benefits of technology

[0036]本发明融合药材检测数据、产地土壤、污染源环境多维数据构建重金属参照值计算模型,区别于传统单一仪器数值判定,可综合产地本底污染预判药材重金属富集风险,预判能力更强;采用K均值聚类算法构建三分类重金属污染模型,自动划分轻、中、重三级污染等级,分级逻辑标准化,降低人工主观判断误差;针对不同污染等级配套标准化、场景化处置指引,通过短信同步推送至质检人员,无需人工查阅规范,快速落实药材管控措施,杜绝超标药材流入市场;可对接土壤环境监管平台复核校验,动态更新模型阈值,适配不同产区、不同品种中药材检测场景,中药材质量安全管控效果显著提升。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012644A_ABST
    Figure CN123012644A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of traditional Chinese medicine quality detection, and discloses a method for detecting total heavy metal content in medicinal materials; medicinal material detection data sets and production environment data sets are collected and pretreated; the medicinal material detection data sets comprise total heavy metal measured content data and medicinal material matrix stability data, and the production environment data sets comprise production soil heavy metal base height data and production surface pollution source roughness data; the application fuses medicinal material detection data, production soil and pollution source environment multidimensional data to construct a heavy metal reference value calculation model, which is different from traditional single instrument numerical determination, can comprehensively predict the heavy metal enrichment risk of medicinal materials according to the background pollution of the production place, and has stronger prediction ability; a three-class heavy metal pollution model is constructed by using a K-means clustering algorithm, light, medium and heavy three pollution grades are automatically divided, grading logic is standardized, and artificial subjective judgment errors are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quality testing technology for Chinese medicinal materials, and more specifically, to a method for detecting the total heavy metal content in medicinal materials. Background Technology

[0002] Traditional Chinese medicinal herbs are highly susceptible to accumulating heavy metals such as lead, cadmium, mercury, arsenic, and copper during planting, processing, soil irrigation, and atmospheric deposition. Excessive heavy metal levels can severely damage the liver, kidneys, and nervous system, representing a core risk point in the safety management of traditional Chinese medicinal herbs. Currently, heavy metal detection in traditional Chinese medicinal herbs primarily employs single-point detection methods such as atomic absorption spectrometry and inductively coupled plasma mass spectrometry, which can only determine the heavy metal content of a single batch of samples, presenting two major limitations:

[0003] Outputting only a single detection value cannot comprehensively determine the risk level of heavy metal pollution by combining data on soil substrate, planting environment, and atmospheric deposition environment of the place of origin. Simple numerical values ​​are prone to misjudgment.

[0004] After the testing is completed, only a test report is issued without a corresponding standardized disposal guideline based on the grade. When faced with medicinal materials with different levels of heavy metal contamination, the testing personnel and pharmaceutical quality inspectors lack standardized disposal procedures, which delays the sorting, destruction, and rework processes of medicinal materials and easily leads to unqualified medicinal materials entering the market.

[0005] Existing technologies rely solely on instrument detection data to determine whether heavy metal content exceeds standards, without integrating environmental baseline data for modeling and classification, nor matching it with classification and treatment guidelines, making it difficult to achieve integrated detection of risk prediction and classification management. To address these shortcomings, this invention proposes a method for detecting the total heavy metal content in medicinal materials. Summary of the Invention

[0006] To overcome the aforementioned deficiencies of the prior art and to achieve the above objectives, the present invention provides the following technical solution: a method for detecting the total heavy metal content in medicinal materials, comprising the following steps:

[0007] S1: Collect medicinal herb testing dataset and production area environment dataset, and perform preprocessing; the medicinal herb testing dataset includes the measured total heavy metal content data and medicinal herb matrix stability data, and the production area environment dataset includes the heavy metal baseline height data of the production area soil and the coarse data of the production area surface pollution sources;

[0008] S2: The medicinal material testing dataset and the production environment dataset are fused to obtain the basic reference values ​​for heavy metals. Then, the heavy metal prediction reference values ​​are obtained through clustering model processing. The heavy metal prediction reference values ​​are classified and graded to obtain the heavy metal pollution prediction results.

[0009] S3: Perform hierarchical analysis on the heavy metal pollution prediction results and generate decision-making results for the disposal of heavy metals in medicinal materials;

[0010] S4: Visualize the decision-making results for the disposal of heavy metals in medicinal materials, and connect with the soil environment supervision platform of the place of origin to query the background information of heavy metals in the soil of the entire medicinal material planting area to complete the verification.

[0011] Furthermore, the specific methods for collecting the medicinal herb testing dataset and the origin environment dataset in S1 include:

[0012] Inductively coupled plasma mass spectrometry was used to analyze the total heavy metal content of medicinal materials by layer digestion. The total heavy metal content of medicinal materials was collected at different digestion depths to obtain the measured data of total heavy metal content of medicinal materials.

[0013] By connecting to the Chinese medicinal materials testing platform, the rate of change of organic matter, pH value, and cellulose content of medicinal materials with digestion time was collected to obtain the stability data of the medicinal material matrix;

[0014] Using a laser soil profiling rangefinder, the background content of heavy metals at different soil depths in medicinal herb planting plots was collected to obtain data on the baseline height of heavy metals in the soil of the production area.

[0015] A laser topographic scanner was used to scan the distribution density of pollution sources around the planting area, and a surface pollution source roughness index was generated to obtain surface pollution source roughness data of the production area.

[0016] The preprocessing methods include data cleaning, data denoising, and data normalization.

[0017] Furthermore, the steps in S2 for fusion computation and modeling of the medicinal herb testing dataset and the origin environment dataset include:

[0018] Q1: Substitute the values ​​into the calculation formula to find the basic reference values ​​for heavy metals: In the formula: This serves as a basic reference value for heavy metals; The heavy metal vertical enrichment coefficient is obtained by weighted multiplication of stable data of medicinal material matrix and rough data of surface pollution sources; For reference, the measured total heavy metal content of medicinal materials at the digestion depth; This is a reference soil layer depth. The comprehensive correction factor was calculated by combining the digestion time, soil pH, medicinal herb variety, soil heavy metal baseline height, and rough data of surface pollution sources.

[0019] Q2: Collect K sets of historical heavy metal baseline reference values ​​for medicinal materials to construct a sample set, and divide the sample set into a 70%K training set, a 15%K test set, and a 15%K validation set;

[0020] Q3: Construct a heavy metal pollution level classification model based on the training set; extract all historical heavy metal baseline reference values ​​from the training set, and pre-define a light pollution data cluster N1, a moderate pollution data cluster N2, and a heavy pollution data cluster N3; randomly select three sets of data points in the training set as the initial cluster centers, corresponding to N1, N2, and N3 respectively;

[0021] Q4: Use the Euclidean distance formula Calculate the distance between a single detection data point and the centers of the three clusters, and assign the data to the nearest cluster center to generate three intermediate clusters; where Let xi be the distance between the data item and the cluster center, yi be the value of the i-th indicator in the detected data, yi be the value of the i-th indicator in the cluster center, and n be the total number of indicators.

[0022] Q5: Calculate the mean of all data within the three intermediate clusters respectively, and use the mean as the new initial cluster center;

[0023] Q6: Repeat Q4 and Q5 until the preset number of iterations is reached, and the heavy metal pollution degree classification model is converged.

[0024] Q7: Input the basic reference values ​​of heavy metals obtained from Q1 into the heavy metal pollution level classification model, and output the standardized heavy metal prediction reference values.

[0025] Furthermore, the method for classifying and generating heavy metal pollution prediction results in S2 includes: presetting two levels of heavy metal pollution threshold intervals (T1, T2).

[0026] When the predicted reference value for heavy metals is less than T1, a light pollution warning signal is generated; when the predicted reference value for heavy metals is greater than T1 and less than or equal to T2, a moderate pollution warning signal is generated.

[0027] When the predicted reference value for heavy metals is greater than T2, an emergency warning signal for severe pollution is generated; a warning signal for light pollution is bound to the light pollution identifier field, a warning signal for moderate pollution is bound to the moderate pollution identifier field, and an emergency warning signal for severe pollution is bound to the severe pollution identifier field; the corresponding signals and identifier fields are packaged together to obtain the prediction result for heavy metal pollution.

[0028] Furthermore, the methods used in S3 to analyze heavy metal pollution prediction results and generate heavy metal disposal decision results for medicinal materials include:

[0029] The quality inspection terminal communication unit pushes graded disposal text messages to the equipment of quality inspectors, and the text message content is packaged to obtain the decision results on the disposal of heavy metals in medicinal materials.

[0030] When the prediction result is a mild pollution warning signal, a mild treatment text message will be sent: The batch of medicinal materials has a slight excess of heavy metals. The quality inspectors are advised to retest parallel samples, retrieve the soil background data of the production area at the same time, narrow the scope of medicinal material harvesting and screening, and temporarily restrict the processing of this batch of medicinal materials.

[0031] When the forecast result is a moderate pollution warning signal, a moderate disposal text message will be sent: This batch of medicinal materials has moderately exceeded the standard for heavy metals; Medicinal material processing: Large-scale feeding is prohibited, and heavy metal adsorption processing technology should be used for pretreatment; Medicinal material purchasing: Purchasing of medicinal materials from this production area is suspended, and soil sampling and testing of surrounding plots are expanded.

[0032] When the forecast result is a severe pollution emergency warning signal, a severe disposal text message will be sent: This batch of medicinal materials has severely exceeded the heavy metal standard; Medicinal material processing: All materials must be isolated and sealed, and any processing or circulation is prohibited; Medicinal material acquisition: The harvesting of medicinal materials in this plot of land will be permanently terminated, and the market supervision department will be notified simultaneously to initiate a source tracing investigation.

[0033] Furthermore, the specific operations of S4 include:

[0034] The quality inspection visualization terminal screen displays the decision-making results for heavy metal disposal of medicinal materials, the predicted reference values ​​for heavy metals, the pollution level, and the batch number of medicinal materials; at the same time, it connects to the soil environment supervision platform of the production area, inputs the coordinates of the production area of ​​medicinal materials and the harvest batch, retrieves the background data of heavy metals in the soil of the whole area, verifies the test and classification results, and dynamically corrects the thresholds T1 and T2.

[0035] The technical effects and advantages of the method for detecting total heavy metal content in medicinal materials according to the present invention are as follows:

[0036] This invention integrates multi-dimensional data from medicinal herb testing, soil samples from the production area, and environmental data from pollution sources to construct a heavy metal reference value calculation model. Unlike traditional single-instrument numerical judgments, this model comprehensively assesses the risk of heavy metal enrichment in medicinal herbs based on background pollution levels, resulting in stronger predictive capabilities. It employs a K-means clustering algorithm to construct a three-category heavy metal pollution model, automatically classifying pollution levels into light, moderate, and heavy levels. The standardized classification logic reduces errors from subjective human judgment. Standardized and scenario-based treatment guidelines are provided for different pollution levels and simultaneously pushed to quality inspectors via SMS, eliminating the need for manual review of regulations and enabling rapid implementation of medicinal herb control measures to prevent substandard herbs from entering the market. The model can be connected to a soil environmental monitoring platform for verification and validation, dynamically updating model thresholds to adapt to different production areas and varieties of medicinal herbs, significantly improving the effectiveness of medicinal herb quality and safety control. Attached Figure Description

[0037] Figure 1 This is a schematic diagram of a method for detecting the total heavy metal content in medicinal materials according to the present invention. Detailed Implementation

[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0039] A method for detecting the total heavy metal content in medicinal materials includes the following steps:

[0040] S1: Collect the medicinal herb testing dataset and the production area environment dataset, and perform preprocessing; the medicinal herb testing dataset includes the measured total heavy metal content data and the medicinal herb matrix stability data, and the production area environment dataset includes the heavy metal baseline height data of the production area soil and the coarse data of surface pollution sources in the production area; the specific methods for collecting the medicinal herb testing dataset and the production area environment dataset include:

[0041] Inductively coupled plasma mass spectrometry was used to analyze the total heavy metal content of medicinal materials by layer digestion. The total heavy metal content of medicinal materials was collected at different digestion depths to obtain the measured data of total heavy metal content of medicinal materials.

[0042] By connecting to the Chinese medicinal materials testing platform, the rate of change of organic matter, pH value, and cellulose content of medicinal materials with digestion time was collected to obtain the stability data of the medicinal material matrix;

[0043] Using a laser soil profiling rangefinder, the background content of heavy metals at different soil depths in medicinal herb planting plots was collected to obtain data on the baseline height of heavy metals in the soil of the production area.

[0044] A laser topographic scanner was used to scan the distribution density of pollution sources around the planting area, and a surface pollution source roughness index was generated to obtain surface pollution source roughness data of the production area.

[0045] The preprocessing methods include data cleaning, data denoising, and data normalization.

[0046] S2: The medicinal herb testing dataset and the production environment dataset are fused to obtain basic reference values ​​for heavy metals. Then, a clustering model is used to obtain predicted reference values ​​for heavy metals. These predicted reference values ​​are then classified and categorized to obtain the heavy metal pollution prediction results. The steps for fusion, computation, and modeling of the medicinal herb testing dataset and the production environment dataset include:

[0047] Q1: Substitute the values ​​into the calculation formula to find the basic reference values ​​for heavy metals: In the formula: This serves as a basic reference value for heavy metals; The heavy metal vertical enrichment coefficient is obtained by weighted multiplication of stable data of medicinal material matrix and rough data of surface pollution sources; For reference, the measured total heavy metal content of medicinal materials at the digestion depth; This is a reference soil layer depth. The comprehensive correction factor was calculated by combining the digestion time, soil pH, medicinal herb variety, soil heavy metal baseline height, and rough data of surface pollution sources.

[0048] Q2: Collect K sets of historical heavy metal baseline reference values ​​for medicinal materials to construct a sample set, and divide the sample set into a 70%K training set, a 15%K test set, and a 15%K validation set;

[0049] Q3: Construct a heavy metal pollution level classification model based on the training set; extract all historical heavy metal baseline reference values ​​from the training set, and pre-define a light pollution data cluster N1, a moderate pollution data cluster N2, and a heavy pollution data cluster N3; randomly select three sets of data points in the training set as the initial cluster centers, corresponding to N1, N2, and N3 respectively;

[0050] Q4: Use the Euclidean distance formula Calculate the distance between a single detection data point and the centers of the three clusters, and assign the data to the nearest cluster center to generate three intermediate clusters; where Let xi be the distance between the data item and the cluster center, yi be the value of the i-th indicator in the detected data, yi be the value of the i-th indicator in the cluster center, and n be the total number of indicators.

[0051] Q5: Calculate the mean of all data within the three intermediate clusters respectively, and use the mean as the new initial cluster center;

[0052] Q6: Repeat Q4 and Q5 until the preset number of iterations is reached, and the heavy metal pollution degree classification model is converged.

[0053] Q7: Input the basic reference values ​​of heavy metals obtained from Q1 into the heavy metal pollution level classification model, and output the standardized heavy metal prediction reference values.

[0054] The methods for classifying and generating heavy metal pollution prediction results in S2 include: presetting two levels of heavy metal pollution threshold intervals (T1, T2).

[0055] When the predicted reference value for heavy metals is less than T1, a light pollution warning signal is generated; when the predicted reference value for heavy metals is greater than T1 and less than or equal to T2, a moderate pollution warning signal is generated.

[0056] When the predicted reference value for heavy metals is greater than T2, an emergency warning signal for severe pollution is generated; a warning signal for light pollution is bound to the light pollution identifier field, a warning signal for moderate pollution is bound to the moderate pollution identifier field, and an emergency warning signal for severe pollution is bound to the severe pollution identifier field; the corresponding signals and identifier fields are packaged together to obtain the prediction result for heavy metal pollution.

[0057] S3: The heavy metal pollution prediction results are analyzed in a hierarchical manner to generate decision-making results for the disposal of heavy metals in medicinal materials. The methods for analyzing the heavy metal pollution prediction results and generating decision-making results for the disposal of heavy metals in medicinal materials in S3 include:

[0058] The quality inspection terminal communication unit pushes graded disposal text messages to the equipment of quality inspectors, and the text message content is packaged to obtain the decision results on the disposal of heavy metals in medicinal materials.

[0059] When the prediction result is a mild pollution warning signal, a mild treatment text message will be sent: The batch of medicinal materials has a slight excess of heavy metals. The quality inspectors are advised to retest parallel samples, retrieve the soil background data of the production area at the same time, narrow the scope of medicinal material harvesting and screening, and temporarily restrict the processing of this batch of medicinal materials.

[0060] When the forecast result is a moderate pollution warning signal, a moderate disposal text message will be sent: This batch of medicinal materials has moderately exceeded the standard for heavy metals; Medicinal material processing: Large-scale feeding is prohibited, and heavy metal adsorption processing technology should be used for pretreatment; Medicinal material purchasing: Purchasing of medicinal materials from this production area is suspended, and soil sampling and testing of surrounding plots are expanded.

[0061] When the forecast result is a severe pollution emergency warning signal, a severe disposal text message will be sent: This batch of medicinal materials has severely exceeded the heavy metal standard; Medicinal material processing: All materials must be isolated and sealed, and any processing or circulation is prohibited; Medicinal material acquisition: The harvesting of medicinal materials in this plot of land will be permanently terminated, and the market supervision department will be notified simultaneously to initiate a source tracing investigation.

[0062] S4: Visualize the decision-making results regarding heavy metal treatment of medicinal herbs, and connect with the soil environment monitoring platform in the production area to query the background information of heavy metals in the soil of the entire medicinal herb planting area for verification. Specific operations include:

[0063] The quality inspection visualization terminal screen displays the decision-making results for heavy metal disposal of medicinal materials, the predicted reference values ​​for heavy metals, the pollution level, and the batch number of medicinal materials; at the same time, it connects to the soil environment supervision platform of the production area, inputs the coordinates of the production area of ​​medicinal materials and the harvest batch, retrieves the background data of heavy metals in the soil of the whole area, verifies the test and classification results, and dynamically corrects the thresholds T1 and T2.

[0064] Example 1

[0065] This embodiment provides a method for detecting the total heavy metal content in medicinal materials, the steps of which are as follows: S1: Collect medicinal material detection dataset and production environment dataset, and complete data preprocessing; the medicinal material detection dataset includes the measured total heavy metal content data of medicinal materials and the stability data of medicinal material matrix; the production environment dataset includes the heavy metal baseline height data of the soil in the production area and the coarse data of surface pollution sources in the production area.

[0066] Data acquisition operations:

[0067] Total heavy metal content measured: Angelica sinensis samples were crushed and microwave digested. The total heavy metal content of the digestion solution at depths of 0cm, 2cm and 5cm was detected by ICP-MS instrument to obtain the measured content data.

[0068] Medicinal herb matrix stability data: By connecting with the provincial public platform for testing Chinese medicinal herbs, the rate of change of organic matter and pH value of Angelica sinensis over digestion time was obtained;

[0069] Soil heavy metal baseline height data: The background content of arsenic, lead, and cadmium in the 0-60cm soil layer of the planting plot was collected using a laser soil rangefinder;

[0070] Roughness data of surface pollution sources: Laser scanners scan the distribution density of industrial and mining areas and highways around the planting area to generate pollution source roughness index;

[0071] Preprocessing: Clean and eliminate failed and abnormal data, remove instrument noise by moving average filtering, and normalize all indicators to the 0-1 range.

[0072] S2: Merge datasets to calculate and model grading, obtaining heavy metal pollution prediction results; Q1: Substitute into the formula to calculate the basic reference value R of heavy metals in Angelica sinensis samples; where α is calculated by weighting the stable data of Angelica sinensis matrix and the coarse data of pollution sources, and β is corrected by soil depth, pH, and Angelica sinensis variety; Q2: Retrieve 3000 sets of local historical heavy metal data of Angelica sinensis as a sample set, and divide it into 2100 training sets, 450 test sets, and 450 validation sets; Q3: Establish a three-cluster classification model, and randomly select 3 sets of historical data as the initial cluster centers of N1 light, N2 moderate, and N3 severe; Q4: Calculate the distance between each data point and the three cluster centers using Euclidean distance, and generate intermediate clusters based on proximity; Q5: Calculate the mean of each cluster to update the cluster centers; Q6: After 200 iterations, the model converges, obtaining a heavy metal pollution classification model specific to Angelica sinensis; Q7: Input the R value of the current Angelica sinensis sample into the model, and output the heavy metal prediction reference value.

[0073] The preset thresholds are T1=0.35 and T2=0.70. The predicted reference value for this sample is 0.48, which is between T1 and T2. A moderate pollution warning signal is generated, which is then bound to the moderate pollution field and packaged as a heavy metal pollution prediction result.

[0074] S3: Analyze the prediction results and generate disposal decision results; The communication unit pushes a moderate disposal text message to the quality inspector's mobile phone: This batch of Angelica sinensis has moderately exceeded the heavy metal standard; In the medicinal material processing stage: Large-scale feeding is prohibited, and heavy metal adsorption processing technology is adopted for pretreatment; In the medicinal material purchasing stage: The purchasing of medicinal materials in this production area is suspended, and soil sampling and testing of surrounding plots are expanded; The text message is packaged as the disposal decision result.

[0075] S4: The quality inspection terminal screen displays the batch number, predicted reference value of 0.48, moderate pollution level, and corresponding treatment plan; it connects to the local soil environmental supervision platform, inputs the coordinates of the angelica production area to retrieve the soil heavy metal background data, verifies the grading results, and confirms that thresholds T1 and T2 do not need to be adjusted.

[0076] Compared with traditional single-instrument detection, this embodiment integrates multi-dimensional data classification of soil and pollution sources, and directly provides standardized treatment plans. Quality inspectors can quickly implement control measures, significantly reducing the risk of circulation of medicinal materials with excessive heavy metals.

[0077] Example 2

[0078] In this embodiment, the operation steps for detecting Astragalus membranaceus are completely consistent with those in Example 1. The only difference is that the model thresholds T1=0.30 and T2=0.65. The predicted reference value for heavy metals in the sample is 0.22<T1, which generates a mild pollution warning signal and sends a mild treatment text message. Quality inspectors retest parallel samples to narrow down the harvesting and screening range and limit short-term feeding.

[0079] Example 3

[0080] In this embodiment, the model thresholds for testing honeysuckle medicinal materials were T1=0.40 and T2=0.75. The predicted reference value for heavy metals in the sample was 0.82>T2, which generated an emergency warning signal for severe pollution. A severe disposal text message was sent, and all medicinal materials were sealed and isolated and reported to the regulatory authorities.

[0081] Since the electronic device described in this embodiment is the electronic device used to implement the method for detecting the total heavy metal content in a medicinal material according to the embodiments of this application, those skilled in the art can understand the specific implementation and various variations of the electronic device in this embodiment based on the method for detecting the total heavy metal content in a medicinal material described in the embodiments of this application. Therefore, how the electronic device implements the method in the embodiments of this application will not be described in detail here. Any electronic device used by those skilled in the art to implement the method for detecting the total heavy metal content in a medicinal material according to the embodiments of this application falls within the scope of protection of this application.

[0082] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters and thresholds in the formulas are set by those skilled in the art according to the actual situation.

[0083] The above description is merely a preferred embodiment of the present invention, and the scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for users of ordinary technical skills, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A method for detecting the total heavy metal content in medicinal materials, characterized in that, Includes the following steps: S1: Collect medicinal herb testing dataset and production area environment dataset, and perform preprocessing; the medicinal herb testing dataset includes the measured total heavy metal content data and medicinal herb matrix stability data, and the production area environment dataset includes the heavy metal baseline height data of the production area soil and the coarse data of the production area surface pollution sources; S2: The medicinal material testing dataset and the production environment dataset are fused to obtain the basic reference values ​​for heavy metals. Then, the heavy metal prediction reference values ​​are obtained through clustering model processing. The heavy metal prediction reference values ​​are classified and graded to obtain the heavy metal pollution prediction results. S3: Perform hierarchical analysis on the heavy metal pollution prediction results and generate decision-making results for the disposal of heavy metals in medicinal materials; S4: Visualize the decision-making results for the disposal of heavy metals in medicinal materials, and connect with the soil environment supervision platform of the place of origin to query the background information of heavy metals in the soil of the entire medicinal material planting area to complete the verification.

2. The method for detecting total heavy metal content in medicinal materials according to claim 1, characterized in that, The specific methods for collecting the medicinal herb testing dataset and the origin environment dataset in S1 include: Inductively coupled plasma mass spectrometry was used to analyze the total heavy metal content of medicinal materials by layer digestion. The total heavy metal content of medicinal materials was collected at different digestion depths to obtain the measured data of total heavy metal content of medicinal materials. By connecting to the Chinese medicinal materials testing platform, the rate of change of organic matter, pH value, and cellulose content of medicinal materials with digestion time was collected to obtain the stability data of the medicinal material matrix; Using a laser soil profiling rangefinder, the background content of heavy metals at different soil depths in medicinal herb planting plots was collected to obtain data on the baseline height of heavy metals in the soil of the production area. A laser topographic scanner was used to scan the distribution density of pollution sources around the planting area, and a surface pollution source roughness index was generated to obtain surface pollution source roughness data of the production area. The preprocessing methods include data cleaning, data denoising, and data normalization.

3. The method for detecting total heavy metal content in medicinal materials according to claim 2, characterized in that, The steps in S2 for fusing and modeling the medicinal herb testing dataset and the origin environment dataset include: Q1: Substitute the values ​​into the calculation formula to find the basic reference values ​​for heavy metals: In the formula: This serves as a basic reference value for heavy metals; The heavy metal vertical enrichment coefficient is obtained by weighted multiplication of stable data of medicinal material matrix and rough data of surface pollution sources; For reference, the measured total heavy metal content of medicinal materials at the digestion depth; This is a reference soil layer depth. The comprehensive correction factor was calculated by combining the digestion time, soil pH, medicinal herb variety, soil heavy metal baseline height, and rough data of surface pollution sources. Q2: Collect K sets of historical heavy metal baseline reference values ​​for medicinal materials to construct a sample set, and divide the sample set into a 70%K training set, a 15%K test set, and a 15%K validation set; Q3: Construct a heavy metal pollution level classification model based on the training set; extract all historical heavy metal baseline reference values ​​from the training set, and pre-define a light pollution data cluster N1, a moderate pollution data cluster N2, and a heavy pollution data cluster N3; randomly select three sets of data points in the training set as the initial cluster centers, corresponding to N1, N2, and N3 respectively; Q4: Use the Euclidean distance formula Calculate the distance between a single detection data point and the centers of the three clusters, and assign the data to the nearest cluster center to generate three intermediate clusters; where Let xi be the distance between the data item and the cluster center, yi be the value of the i-th indicator in the detected data, yi be the value of the i-th indicator in the cluster center, and n be the total number of indicators. Q5: Calculate the mean of all data within the three intermediate clusters respectively, and use the mean as the new initial cluster center; Q6: Repeat Q4 and Q5 until the preset number of iterations is reached, and the heavy metal pollution degree classification model is converged. Q7: Input the basic reference values ​​of heavy metals obtained from Q1 into the heavy metal pollution level classification model, and output the standardized heavy metal prediction reference values.

4. The method for detecting total heavy metal content in medicinal materials according to claim 3, characterized in that, The methods for classifying and generating heavy metal pollution prediction results in S2 include: presetting two levels of heavy metal pollution threshold intervals (T1, T2). When the predicted reference value for heavy metals is less than T1, a light pollution warning signal is generated; when the predicted reference value for heavy metals is greater than T1 and less than or equal to T2, a moderate pollution warning signal is generated. When the predicted reference value for heavy metals is greater than T2, an emergency warning signal for severe pollution is generated; a warning signal for light pollution is bound to the light pollution identifier field, a warning signal for moderate pollution is bound to the moderate pollution identifier field, and an emergency warning signal for severe pollution is bound to the severe pollution identifier field; the corresponding signals and identifier fields are packaged together to obtain the prediction result for heavy metal pollution.

5. The method for detecting total heavy metal content in medicinal materials according to claim 4, characterized in that, The methods used in S3 to analyze heavy metal pollution prediction results and generate heavy metal disposal decision results for medicinal materials include: The quality inspection terminal communication unit pushes graded disposal text messages to the equipment of quality inspectors, and the text message content is packaged to obtain the decision results on the disposal of heavy metals in medicinal materials. When the prediction result is a mild pollution warning signal, a mild treatment text message will be sent: The batch of medicinal materials has a slight excess of heavy metals. The quality inspectors are advised to retest parallel samples, retrieve the soil background data of the production area at the same time, narrow the scope of medicinal material harvesting and screening, and temporarily restrict the processing of this batch of medicinal materials. When the forecast result is a moderate pollution warning signal, a moderate disposal text message will be sent: This batch of medicinal materials has moderately exceeded the standard for heavy metals; Medicinal material processing: Large-scale feeding is prohibited, and heavy metal adsorption processing technology should be used for pretreatment; Medicinal material purchasing: Purchasing of medicinal materials from this production area is suspended, and soil sampling and testing of surrounding plots are expanded. When the forecast result is a severe pollution emergency warning signal, a severe disposal text message will be sent: This batch of medicinal materials has severely exceeded the heavy metal standard; Medicinal material processing: All materials must be isolated and sealed, and any processing or circulation is prohibited; Medicinal material acquisition: The harvesting of medicinal materials in this plot of land will be permanently terminated, and the market supervision department will be notified simultaneously to initiate a source tracing investigation.

6. The method for detecting total heavy metal content in medicinal materials according to claim 1, characterized in that, S4 specific operations include: The quality inspection visualization terminal screen displays the decision-making results for heavy metal disposal of medicinal materials, the predicted reference values ​​for heavy metals, the pollution level, and the batch number of medicinal materials; at the same time, it connects to the soil environment supervision platform of the production area, inputs the coordinates of the production area of ​​medicinal materials and the harvest batch, retrieves the background data of heavy metals in the soil of the whole area, verifies the test and classification results, and dynamically corrects the thresholds T1 and T2.