A sample pretreatment method and system for soil detection
By monitoring the temperature, pressure, and pH data during the soil microwave digestion process in real time, a model was constructed to dynamically adjust the parameters, solving the problems of incomplete microwave digestion and inconsistent detection results, and achieving accuracy and consistency in the detection of soil heavy metal ion concentration.
Patent Information
- Application Number
- CN202511706853.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-03-17
- Estimated Expiration
- 2045-11-20
AI Technical Summary
Existing microwave digestion methods for soil testing suffer from problems such as incomplete digestion, inconsistent recovery rates, and a lack of uniformity and comparability in test results. Furthermore, they lack real-time perception of sample characteristics and dynamic response capabilities to parameters.
By collecting real-time data on temperature, pressure, and pH in the digestion vessel, a random forest model and intelligent optimization algorithm are constructed to dynamically adjust microwave digestion parameters. Combined with a multivariate logistic regression model, the soil sample pretreatment process is optimized.
It improves the adequacy of soil microwave digestion and the accuracy of heavy metal ion concentration detection, enhances the reliability and accuracy of microwave digestion parameters, quantifies the differences between soil samples, and improves the comparability of test results.
Smart Images

Figure CN121164006B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of soil testing technology, specifically to a sample pretreatment method and system for soil testing. Background Technology
[0002] With the acceleration of industrialization and urbanization, and the widespread implementation of intensive agricultural production, soil pollution, especially heavy metal pollution, has become an increasingly serious global environmental challenge. Heavy metals are difficult to degrade, easily accumulate, and migrate in soil, not only damaging soil ecological functions but also threatening human health through the food chain. Therefore, establishing an efficient and accurate soil heavy metal detection system is crucial. In the detection process, sample pretreatment is a key step, transforming the complex and heterogeneous soil matrix into a clear solution suitable for instrumental analysis, releasing the target elements, and eliminating matrix interference.
[0003] However, while the widely used microwave digestion method has advantages such as speed, efficiency, and good sealing, it still has significant technical limitations. Specifically: the limited volume of the digestion vessel prevents the addition of sufficient digestion acid at once, easily leading to incomplete digestion and affecting the dissolution efficiency of target elements; the occurrence forms and chemical stability of various metal elements in different soils vary significantly, and even under the same digestion conditions, the degree of digestion of metal elements is not entirely consistent, resulting in inconsistent recovery rates and a lack of uniformity and comparability in the detection results. Existing technologies generally rely on preset fixed digestion programs during microwave digestion, lacking real-time perception of sample characteristics and dynamic response capabilities to parameters, making it difficult to effectively solve the above problems and resulting in insufficient accuracy in subsequent soil testing. Summary of the Invention
[0004] In view of the above, it is necessary to provide a sample pretreatment method and system for soil testing. Compared with traditional sample pretreatment methods and systems for soil testing, this method and system enhances the quality of dynamic adjustment of microwave digestion parameters, thereby improving the sufficiency of microwave digestion of unknown soil samples and also helping to improve the accuracy of subsequent detection of various heavy metal ion concentrations in the soil.
[0005] In a first aspect, embodiments of this application provide a sample pretreatment method for soil testing, the method comprising the following steps:
[0006] During the microwave digestion process of soil sample pretreatment, temperature data, pressure data and pH value of the solution in the digestion vessel are collected in real time. After digestion, the concentration values of various heavy metal ions in the solution are obtained.
[0007] By analyzing the changes in temperature data during a single digestion process, as well as the changes in the correlation between pressure data and temperature and pH values, the digestion process coefficient for a single digestion process is obtained. For a single standard soil sample, by comparing the detected values of various heavy metal ion concentrations after a single digestion process with their standard values, and the digestion process coefficients of different digestion processes, the influence weight of a single digestion process is obtained. This weight is used to construct a random forest model and combined with an intelligent optimization algorithm to obtain the optimal microwave digestion parameters for a single standard soil sample.
[0008] A pre-trained multivariate logistic regression model is used to obtain the probability that the soil sample to be tested belongs to each standard soil sample based on the digestion process coefficient of the initial digestion process of the soil sample to be tested and the deviation of the microwave digestion parameters in the initial digestion process compared with the optimal microwave digestion parameters of each standard soil sample. Then, combined with the deviation, the comprehensive deviation of various microwave digestion parameters in the initial digestion process is obtained to adjust the microwave digestion parameters of the soil sample to be tested.
[0009] In one embodiment, the process of obtaining the digestion process coefficients is as follows:
[0010] For a single digestion process, the time interval of the microwave digestion process is divided into several time periods. The trend coefficient of temperature within each time period is obtained by analyzing the temperature data changes within that time period. Specifically, the mean value of all temperature data within each time period is obtained; the time-series fitting curve of the mean value across all time periods in the single digestion process is denoted as the temperature fitting curve; the derivative of the temperature fitting curve at each time period is obtained; based on the mean value, the acceleration measure of temperature data change within each time period is obtained; the average value of the acceleration measure of change within each time period and preceding time periods is obtained; the trend coefficient is positively correlated with the derivative and the average value, respectively.
[0011] Each time period is divided into different temperature stages. Then, by combining the temperature change trend within each time period, as well as the changes in the correlation coefficients between pressure data and temperature data, and between pressure data and pH value at each time period, the digestion process coefficients for a single digestion process are obtained.
[0012] In one embodiment, the process of dividing each time period into different temperature stages is as follows:
[0013] The temperature phase includes a heating period, a stabilization period, and a cooling period;
[0014] Obtain the first and second segmentation thresholds of the temperature trend coefficients for all time periods during a single digestion process. If the first segmentation threshold is greater than the second segmentation threshold, the time periods with trend coefficients greater than the first segmentation threshold are designated as the heating period, the time periods with trend coefficients less than the second segmentation threshold are designated as the cooling period, and the remaining time periods are designated as the stabilization period.
[0015] In one embodiment, the process of obtaining the digestion process coefficients is as follows:
[0016] The time-series correlation coefficients between pressure data and temperature data and pH value in each time period are respectively denoted as the first correlation coefficient and the second correlation coefficient; the time-series fitting curves of the first correlation coefficient and the second correlation coefficient in all time periods of a single digestion process are denoted as the temperature-pressure fitting curve and the acidity fitting curve.
[0017] By analyzing the temperature trend of temperature data within each time period and the temperature stage to which each time period belongs, we can obtain a temperature trend measurement for each time period.
[0018] Calculate the product of the derivatives of the temperature-pressure fitting curve and the acid fitting curve at each time period, and calculate the direct proportional mapping result of the product;
[0019] The digestion process coefficient is the average of the ratios of the temperature trend measurement to the proportional mapping result over all time periods in a single digestion process.
[0020] In one embodiment, the method for obtaining the temperature trend measurement is as follows:
[0021] If each time period is a warming period or a cooling period, then the temperature trend measure is the normalized value of the absolute value of the product of the acceleration of change measure and the derivative of the temperature fitting curve at each time period.
[0022] If each time period is a stable period, then the temperature trend measure is the normalized value of the dispersion of all temperature data within each time period.
[0023] In one embodiment, the process of obtaining the influence weight is as follows:
[0024] The dissolution coefficient of heavy metal ions after a single digestion is obtained by comparing the concentrations of various heavy metal ions after a single digestion with their standard concentrations.
[0025] The proportion of the digestion process coefficient of a single digestion process for a single soil sample in the total digestion process coefficients is calculated, and the influence weight is the sum of the proportion and the heavy metal ion dissolution coefficient.
[0026] In one embodiment, the process for obtaining the heavy metal ion dissolution coefficient is as follows:
[0027] Calculate the difference between the detected values of various heavy metal ion concentrations after a single digestion and their standard values; the ratio of the difference value to the standard values of various heavy metal ion concentrations after a single digestion is denoted as the concentration ratio.
[0028] Calculate the difference between 1 and the concentration ratio, where the heavy metal ion dissolution coefficient is the average of the differences among all heavy metal ions after a single digestion.
[0029] In one embodiment, the construction of the random forest algorithm model and the combination of intelligent optimization algorithm to obtain the optimal microwave digestion parameters for a single standard soil sample includes:
[0030] The microwave digestion parameters of a single standard soil sample after a single digestion are used as a microwave digestion parameter sample. The microwave digestion sample and the corresponding detection values of various heavy metal ion concentrations after digestion are combined into a training sample. When training the random forest model, the weight of each training sample is the influence weight of its corresponding single digestion. The predicted values of various heavy metal ion concentrations after digestion using the new microwave digestion parameter sample are obtained through the random forest model.
[0031] Treating each microwave digestion parameter sample as a particle, the fitness function of the intelligent optimization algorithm is:
[0032] In the formula, Represents the fitness function; Indicates the number of different types of heavy metal ions; This represents the predicted concentrations of various heavy metal ions obtained by substituting a single particle into the random forest model during the iteration process of the intelligent optimization algorithm. Standard values representing the concentrations of various heavy metal ions.
[0033] In one embodiment, the calculation process for the overall deviation is as follows:
[0034] In the formula, This indicates the first soil sample to be tested. The overall deviation of various microwave digestion parameters; This indicates the total number of standard soil samples; This indicates that the soil sample to be tested belongs to the first category. The probability of a standard soil sample; This indicates the first soil sample to be tested during the initial digestion. Microwave digestion parameters and the first The optimal particle in the standard soil sample is the th The difference between the microwave digestion parameters.
[0035] Secondly, embodiments of this application also provide a sample pretreatment system for soil testing, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any of the above-described sample pretreatment methods for soil testing.
[0036] This application has at least the following beneficial effects:
[0037] This application calculates digestion process coefficients based on changes in monitoring data during microwave digestion, enabling dynamic evaluation of the digestion process. It quantifies the sufficiency of soil sample digestion and the quality of microwave digestion parameters, providing a basis for subsequent optimization of these parameters and enhancing their accuracy. Furthermore, by considering the proximity of the detected heavy metal ion concentration after digestion to standard values, the application calculates the influence weight of each digestion step, thereby improving the construction quality of the subsequent sample digestion prediction model and increasing its prediction accuracy. This ultimately enhances the reliability and accuracy of the optimal microwave digestion parameters. A multivariate logistic regression model is used to assess the probability that the soil sample to be tested belongs to each standard soil sample. Based on the differences in microwave digestion parameters between the soil sample to be tested and each standard soil sample, the microwave digestion parameters of the soil sample to be tested are adjusted. Through these methods, the differences between different soil samples are quantified, and the quantification results enhance the quality of dynamic adjustment of microwave digestion parameters, thereby improving the sufficiency of microwave digestion of unknown soil samples and contributing to the improvement of the accuracy of subsequent detection of various heavy metal ion concentrations in the soil. Attached Figure Description
[0038] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 A flowchart illustrating the steps of a sample pretreatment method for soil testing, provided as an embodiment of this application;
[0040] Figure 2 This is a schematic diagram illustrating the process of obtaining the influence weights;
[0041] Figure 3 This is a schematic diagram of the process for obtaining the optimal microwave digestion parameters. Detailed Implementation
[0042] In the description of the embodiments in this application, the words "exemplary," "or," and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary," "or," and "for example" is intended to present the relevant concepts in a specific manner.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It should be understood that, unless otherwise stated, " / " in this application means "or".
[0044] It should also be noted that the terms "first" and "second" in this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0045] The following description, in conjunction with the accompanying drawings, details a specific scheme for a sample pretreatment method and system for soil testing provided in this application.
[0046] Please see Figure 1 The diagram illustrates a step-by-step flowchart of a sample pretreatment method for soil testing according to an embodiment of this application. The method includes the following steps:
[0047] Step 1: During the microwave digestion process of soil sample pretreatment, temperature data, pressure data, and pH value of the solution in the digestion vessel are collected in real time. After digestion is completed, the concentration values of various heavy metal ions in the solution are obtained.
[0048] During the microwave digestion process of soil sample pretreatment, a fiber optic temperature sensor was used to collect real-time temperature data in the digestion vessel, a pressure sensor was used to collect real-time pressure data in the digestion vessel, and a pH electrode was used to collect real-time pH values of the solution during digestion. After the microwave digestion of the soil samples was completed, atomic absorption spectroscopy was used to obtain the concentration values of various heavy metal ions in the post-microwave digestion solution.
[0049] In this embodiment, the acquisition frequency of temperature data, pressure data, and pH value is 1Hz. The acquisition frequency is preset by the user and can be set by the implementer according to the actual situation. This application does not impose any special restrictions.
[0050] Furthermore, to avoid the impact of different dimensions on subsequent analysis, the collected temperature data, pressure data, and pH values were normalized respectively.
[0051] In this embodiment, the Min-Max normalization method is used to normalize the collected temperature data, pressure data, and pH value respectively. The Min-Max normalization method is a well-known technology and will not be described in detail in this application.
[0052] Step 2: Obtain the digestion process coefficients for a single digestion process; construct a random forest model and combine it with an intelligent optimization algorithm to obtain the optimal microwave digestion parameters for a single standard soil sample.
[0053] Soil testing is a crucial step in modern pollution monitoring, early warning, and remediation. However, due to the complexity of the soil matrix, pretreatment methods are needed to dissolve target elements to improve the accuracy of pollution detection. Microwave digestion has become a commonly used technique in soil pretreatment due to its speed and efficiency, but it also has its limitations. During microwave digestion, differences exist between different soil samples, such as easily digestible and difficult-to-digest soil samples. This necessitates adjustments to microwave digestion parameters to enhance the digestion effect. Existing methods for adjusting microwave digestion parameters often involve fixed adjustments for different soil samples. This approach does not fully consider the variations in different soil samples during digestion, resulting in limited flexibility in parameter adjustment and significant errors in the digestion process.
[0054] Step 2.1: Obtain the digestion process coefficient for a single digestion process by analyzing the changes in temperature data during a single digestion process, as well as the changes in the correlation between pressure data, temperature data, and pH value.
[0055] In fact, microwave digestion achieves the dissolution of heavy metal elements through numerous chemical reactions. These reactions cause fluctuations in monitoring parameters such as temperature and pressure during the digestion process. Under normal circumstances, when digestion is complete, the temperature of the entire digestion process shows an increasing trend, and the rate of temperature increase varies as digestion progresses. Specifically, in the initial stage of digestion, the temperature rises rapidly, and the acid solution begins to react, but the reaction is relatively mild. As the temperature rises, the organic matter in the soil solution continues to oxidize, and heavy metals and minerals gradually disintegrate. At this point, the rate of temperature increase decreases, but the acid reaction gradually intensifies. Until the temperature rises to near the set value, the temperature gradually stabilizes, and the acid reaction reaches its peak. After a period of time, as digestion is complete, the cooling stage begins. At this point, the temperature gradually decreases, the solution state gradually stabilizes, and the acid reaction essentially stops.
[0056] Furthermore, pressure changes during the digestion process are generally synchronized with changes in temperature and acid consumption, and the pressure change trend is relatively smooth, without significant abnormal increases or decreases. Specifically, in the initial stage of digestion, due to the relatively mild acid reaction, pressure changes are mainly caused by temperature. As the temperature gradually increases, the chemical reactions during digestion gradually intensify, and the amount of gas produced gradually increases, making the correlation between pressure changes and chemical reactions gradually stronger, while the correlation with temperature gradually weakens. When the temperature gradually stabilizes, the correlation between pressure and temperature is weak or even non-existent, and pressure changes at this time are mainly caused by chemical reactions. When entering the cooling stage, digestion is basically complete, and pressure changes at this time are mainly related to temperature, with little correlation to chemical reactions. However, if the microwave digestion parameters are not set properly during the digestion process, it can lead to drastic fluctuations in temperature and pressure. Additionally, because the soil is difficult to completely digest at different stages, and heavy metal elements are not completely dissolved, the trend of chemical reactions at different stages will also change, leading to differences in the correlation between pressure changes and temperature and chemical reactions, and causing significant errors in subsequent detection.
[0057] Since soil digestion is a chemical reaction process, using a gradient heating method helps soil samples to digest more thoroughly. Therefore, the temperature change trend is consistent over a period of time.
[0058] Based on the above analysis, for a single digestion process, the time interval of the digestion process is divided into several time periods. By analyzing the correlation between pressure and temperature within each time period, a pressure-temperature fitting curve is obtained. Specifically, all time periods are numbered sequentially, with the number as the x-axis and the correlation coefficient between pressure and temperature data within each time period as the y-axis. Curve fitting is then performed, and the resulting curve is used as the pressure-temperature fitting curve. Similarly, by analyzing the correlation between pressure and pH value within each time period, an acidity fitting curve is obtained. This is done by using the time period number as the x-axis and the correlation coefficient between pressure and pH value within each time period as the y-axis, performing curve fitting, and using the resulting curve as the acidity fitting curve. Simultaneously, the time period number is used as the x-axis, and the mean temperature data within each time period is used as the y-axis, and the resulting curve is used as the temperature fitting curve. The correlation coefficients between pressure and temperature data, and between pH value, within each time period are respectively denoted as the first correlation coefficient and the second correlation coefficient.
[0059] In this embodiment, the correlation coefficients between pressure data and temperature data over time, and between pressure data and pH value over time, are both Pearson correlation coefficients. Pearson correlation coefficients are well-known technologies and will not be described in detail here. As other implementation methods, based on the ability to measure the correlation between pressure data and temperature data over time, and the correlation between pressure data and pH value over time, implementers may use other existing technologies, such as Spearman correlation coefficients, etc. This application does not impose any special restrictions.
[0060] In this embodiment, the least squares method is used to obtain the temperature-pressure fitting curve, the acidity fitting curve, and the temperature fitting curve. The least squares method is a well-known technique and will not be described in detail in this application. As other implementation methods, based on the ability to obtain the temperature-pressure fitting curve, the acidity fitting curve, and the temperature fitting curve, the implementer may use other existing techniques, such as local weighted regression, K-nearest neighbor regression, etc. This application does not impose any special restrictions.
[0061] Furthermore, by analyzing the changes in temperature data within each time period, the trend coefficient of temperature within each time period is obtained, expressed as:
[0062] In the formula, Indicates the first The trend coefficient of temperature within a time period; Indicates the first The rate of temperature change over a given time period is measured, specifically by the temperature fitting curve on the horizontal axis. The derivative at point; Indicates the first A measure of the acceleration of temperature change over a given time period; This represents the total number of time periods. In this embodiment, the central difference method is used to approximate the acceleration, specifically: ,in, , , They represent the first The, the The, the The mean of temperature data over a given period. The central difference method is a well-known technique and will not be described further in this application.
[0063] Furthermore, each time period is divided into different temperature phases, including warming period, stable period, and cooling period. The specific process is as follows: obtain the first segmentation threshold and the second segmentation threshold of the temperature trend coefficient for all time periods. Where the first segmentation threshold is greater than the second segmentation threshold, the time period with the trend coefficient greater than the first segmentation threshold is designated as the warming period, the time period with the trend coefficient less than the second segmentation threshold is designated as the cooling period, and the remaining time periods are designated as the stable period.
[0064] In this embodiment, a multi-threshold segmentation algorithm based on Otsu's method is used to obtain the first segmentation threshold and the second segmentation threshold. The multi-threshold segmentation algorithm based on Otsu's method is a well-known technology and will not be described in detail in this application. As other implementation methods, based on the ability to obtain the first segmentation threshold and the second segmentation threshold, implementers may use other existing feasible technologies, and this application does not impose any special restrictions.
[0065] Furthermore, by analyzing the temperature change trends over different time periods, and combining the changes in the correlation coefficients between pressure and temperature data, and between pressure and pH values, the digestion process coefficients for a single digestion process are obtained. The expression is as follows:
[0066] In the formula, The digestion process coefficient represents the digestion process coefficient for a single digestion process; Indicates the total number of time periods; Indicates the first Temperature trend measurement within a time period; Represents an exponential function with the natural constant as its base, used to... Mapped to positive numbers; This indicates a normalization operation; , The temperature-pressure fitting curve and the acidity fitting curve are respectively represented on the x-axis. The derivative at point ; where, since the temperature change trends are different at different temperature stages, in this embodiment, if the derivative at point is ; If the first period is a warming period or a cooling period, then the second period... The temperature trend measurement within the time period is the [number]th [period]. The normalized value of the absolute value of the product of the rate of temperature change and the acceleration of temperature change over a given time period, if the... If the period is a stable period, then the period is... The temperature trend measurement within the time period is the [number]th [period]. The normalized value of the dispersion of all temperature data within a given time period.
[0067] In this embodiment, the Min-Max normalization method is used to... Normalization is performed; the Min-Max normalization method is used to obtain the normalized value of the absolute value of the product of the rate of change and the acceleration of change; the Min-Max normalization method is used to obtain the normalized value of the dispersion of the temperature data.
[0068] In this embodiment, the dispersion of temperature data is the standard deviation. As other implementation methods, based on the ability to measure the unevenness of temperature data distribution, implementers may use other existing technologies, such as variance, coefficient of variation, etc. This application does not impose any special restrictions.
[0069] It should be noted that: under normal circumstances, when soil samples are digested sufficiently, temperature changes increase rapidly in the initial stage, and the rate of temperature increase varies; as the temperature gradually approaches the stabilization period, it also gradually stabilizes; during the cooling period, the temperature gradually decreases, and the rate of temperature decrease also varies, resulting in a relatively large temperature trend measurement; secondly, at different stages, the degree of influence of temperature and chemical reaction on pressure changes shows opposite trends, so under normal circumstances, the more thoroughly the soil sample is digested, the larger the calculated digestion process coefficient; conversely, when the microwave digestion parameters are set inappropriately, and the soil sample digestion is insufficient, the trends of temperature, pressure, and pH value changes during the digestion process become more abnormal, and the calculated digestion process coefficient becomes smaller.
[0070] Step 2.2: For a single standard soil sample, the influence weight of a single digestion is obtained by comparing the detected values of various heavy metal ion concentrations after a single digestion with their standard values, as well as the digestion process coefficients of different digestion processes. This weight is used to construct a random forest model and combined with an intelligent optimization algorithm to obtain the optimal microwave digestion parameters for a single standard soil sample.
[0071] When performing microwave digestion on soil samples, the content of various substances varies among different soil samples. Current techniques often rely on empirically adjusted, fixed microwave digestion parameters for different soil samples. However, this approach lacks quantification of the differences between soil samples, leading to significant errors in parameter adjustment. This makes it difficult to guarantee the digestion quality during soil pretreatment and consequently, the accuracy of subsequent soil testing. Digestion process coefficients quantify the pressure fluctuations caused by chemical reactions and temperature changes during digestion, as well as the temperature trend, thus indirectly measuring digestion quality. Therefore, further optimization analysis can be conducted using digestion process coefficients to quantify the differences between different soil samples.
[0072] To determine the optimal microwave digestion parameters for soil samples, it is necessary to predict the digestion results based on these parameters. When predicting the microwave digestion results, since the errors of different digestion results vary among different soil samples, it is necessary to assign different weights to different digestion processes to improve the prediction quality of the digestion results for each soil sample, thereby enhancing the quality of the subsequent optimal microwave digestion parameters.
[0073] Based on the above analysis, for a single soil sample, the leaching coefficient of heavy metal ions after a single digestion is obtained by comparing the concentrations of various heavy metal ions after a single digestion with their standard concentrations. The expression is as follows:
[0074] In the formula, Indicates the first The dissolution coefficient of heavy metal ions after secondary digestion; Indicates the number of different types of heavy metal ions; Indicates the first After the first elimination is completed, the first The detected values of the concentration of various heavy metal ions; Indicates the first After the first elimination is completed, the first Standard values for the concentration of various heavy metal ions; This indicates the absolute value operation. This is denoted as the concentration ratio. The standard values for the concentrations of various heavy metal ions are the measured values of the concentrations of various heavy metal ions after complete digestion of a single soil sample.
[0075] Furthermore, by comparing the digestion process coefficients of different digestion processes for a single soil sample, and combining them with the heavy metal ion dissolution coefficient of a single digestion, the influence weight of a single digestion is obtained, expressed as:
[0076] In the formula, Indicates the first The weight of the impact of the secondary resolution; , They represent the first sequence The digestion process coefficient for each digestion process; M represents the total number of digestion processes for a single soil sample; Indicates the first The dissolution coefficient of heavy metal ions after secondary digestion.
[0077] It should be noted that: the first The closer the detected value of heavy metal ion concentration after the first digestion is to the standard value, the greater the dissolution coefficient of heavy metal ions, and the higher the concentration after the second digestion. The higher the proportion of the digestion process coefficient in the total digestion process coefficients of the first digestion process, the higher the proportion of the total digestion process coefficients of the second digestion process. The more thorough the elimination, the better. The greater the weight of the subsequent resolution, the higher the impact weight. A diagram illustrating the process of obtaining the impact weight is shown below. Figure 2 As shown.
[0078] For a single standard soil sample, the microwave digestion parameters of a single digestion of that sample are considered as a microwave digestion parameter sample. A predetermined number of microwave digestion parameter samples are divided into a training set and a test set according to a predetermined ratio. All microwave digestion parameter samples in the training set are combined into a training matrix. Each row of the training matrix corresponds to a microwave digestion parameter sample, and each column corresponds to a microwave digestion parameter or the detection value of a heavy metal ion concentration in the solution after digestion. The microwave digestion parameters include the amount of various acids used, the set digestion vessel temperature, and the digestion vessel pressure. Using the training matrix, the number of decision trees, and the depth of each decision tree as input, a random forest algorithm is used to randomly and with replacement draw f rows from the training matrix for each iteration to train the decision trees. The weight of each row is the influence weight of its corresponding single digestion. Each row is considered a training sample. The random forest algorithm is a well-known technique and will not be described further in this application. A standard soil sample refers to a soil sample that has undergone rigorous screening, processing, and certification, and whose physical, chemical, and biological characteristics are known and stable.
[0079] In this embodiment, the preset quantity is 100. The preset quantity is preset by a person and the implementer can set it according to the actual situation. This application does not impose any special restrictions.
[0080] In this embodiment, the preset ratio is 7:3. The preset ratio is set manually, and the implementer can set it according to the actual situation. This application does not impose any special restrictions.
[0081] In this embodiment, the value of f is 35. The value of f is preset by the user and can be set by the implementer according to the actual situation. This application does not impose any special restrictions.
[0082] In this embodiment, the number of decision trees is 100, the depth of a single decision tree is 10, the standard for node classification is the Gini index, and the other parameters are all set to default values. The number of decision trees and the depth of a single decision tree are preset by the user and can be set by the implementer according to the actual situation. This application does not impose any special restrictions.
[0083] Using a trained random forest model, new microwave digestion parameter samples are input, and the predicted concentrations of various heavy metal ions after digestion using the new microwave digestion parameter samples are output.
[0084] A random forest model was constructed for a predetermined number of standard soil samples. Each microwave digestion parameter sample of a single standard soil sample was treated as a particle, and a predetermined number of microwave digestion parameter samples were grouped into a particle swarm. An intelligent optimization algorithm was used to obtain the optimal particle for a single standard soil sample, i.e., the optimal microwave digestion parameter for that single standard soil sample. The fitness function of the intelligent optimization algorithm is:
[0085] In the formula, Represents the fitness function; Indicates the number of different types of heavy metal ions; This represents the predicted concentrations of various heavy metal ions obtained by substituting a single particle into the random forest model during the iteration process of the intelligent optimization algorithm. Standard values representing the concentrations of various heavy metal ions.
[0086] In this embodiment, the preset number is 30. The preset number is preset by the user and the implementer can set it according to the actual situation. This application does not impose any special restrictions.
[0087] In this embodiment, the intelligent optimization algorithm is specifically the particle swarm optimization algorithm. The maximum number of iterations of the particle swarm optimization algorithm is 100, the inertia weight is 0.5, and the initial learning factor is 1.5. The values of the maximum number of iterations, the inertia weight, and the initial learning factor are all preset by the user. The implementer can set them according to the actual situation. This application does not impose any special restrictions.
[0088] After iterative optimization, the particle with the smallest fitness function value is selected as the optimal particle for a single standard soil sample. A schematic diagram of the process for obtaining the optimal microwave digestion parameters is shown below. Figure 3 As shown.
[0089] Step 3: Using a pre-trained multivariate logistic regression model, based on the digestion process coefficient of the initial digestion process of the soil sample to be tested, and the deviation of the microwave digestion parameters in the initial digestion process compared with the optimal microwave digestion parameters of each standard soil sample, the probability of the soil sample to be tested belonging to each standard soil sample is obtained. Then, combined with the deviation, the comprehensive deviation of various microwave digestion parameters in the initial digestion process is obtained, so as to adjust the microwave digestion parameters of the soil sample to be tested.
[0090] For any standard soil sample, the digestion process coefficients corresponding to all particles are used as independent variables, and the differences between various microwave digestion parameters of each particle and the optimal particle are used as dependent variables. Curve fitting is performed to obtain a fitting function. Then, the digestion process coefficients corresponding to each particle are substituted into the fitting function to obtain the fitted values of the differences between various microwave digestion parameters of each particle and the optimal particle, which are recorded as the deviation values of various microwave digestion parameters. This operation can avoid the influence of factors such as experimental conditions and equipment accuracy, and provide a more reliable deviation estimate.
[0091] In this embodiment, the least squares method is used to obtain the fitting function. The least squares method is a well-known technique and will not be described in detail here. As other implementation methods, based on the ability to obtain the fitting function, the implementer may use other existing feasible techniques, which will not be described in detail here.
[0092] Furthermore, a data matrix is constructed by combining the digestion process coefficients and deviation values of various microwave digestion parameters for all particles from all standard soil samples. Each row of the data matrix corresponds to one particle, and each column corresponds to the digestion process coefficient or deviation value of various microwave digestion parameters. Each particle is assigned a label indicating which standard soil sample it belongs to. The data matrix and the labels of each particle are used as training data to train a multivariate logistic regression model. During iteration, parameters are updated using a quasi-Newton method to obtain the trained multivariate logistic regression model. The training process of the multivariate logistic regression model is a well-known technique and will not be described in detail here.
[0093] In subsequent testing of the soil samples, a set of microwave digestion parameters is first selected for preliminary digestion. Based on the temperature, pressure, and pH data during the digestion process, digestion process coefficients are calculated. These coefficients are then substituted into a fitting function to obtain the deviation values of various microwave digestion parameters during preliminary digestion. Using the digestion process coefficients and the deviation values of various microwave digestion parameters as inputs, a trained multivariate logistic regression model is used to output the probability that the soil sample belongs to each standard soil sample. Finally, combined with the deviation values of various microwave digestion parameters during preliminary digestion, the comprehensive deviation of various microwave digestion parameters during preliminary digestion is obtained, expressed as:
[0094] In the formula, This indicates the first soil sample to be tested. The overall deviation of various microwave digestion parameters; This indicates the total number of standard soil samples; This indicates that the soil sample to be tested belongs to the first category. The probability of a standard soil sample; This indicates the first soil sample to be tested during the initial digestion. Microwave digestion parameters and the first The optimal particle in the standard soil sample is the th The difference between the microwave digestion parameters.
[0095] Furthermore, by adjusting the microwave digestion parameters through comprehensive deviation, the microwave digestion parameters of the soil sample to be tested can be precisely adjusted, which helps to enhance the quality of microwave digestion in the soil sample pretreatment process, thereby improving the detection accuracy of heavy metal ion concentration in the subsequent process.
[0096] Based on the same inventive concept as the above methods, this application also provides a sample pretreatment system for soil testing, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above-described sample pretreatment methods for soil testing.
[0097] In summary, this application calculates digestion process coefficients based on changes in monitoring data during microwave digestion, enabling dynamic evaluation of the digestion process. It quantifies the sufficiency of soil sample digestion and the quality of microwave digestion parameters, providing a basis for subsequent optimization of these parameters and enhancing their accuracy. Furthermore, by considering the proximity of the detected heavy metal ion concentration after digestion to standard values, the application calculates the influence weight of each digestion step, thereby improving the construction quality of the subsequent sample digestion prediction model and increasing its prediction accuracy. This ultimately enhances the reliability and accuracy of the optimal microwave digestion parameters. The application also uses a multivariate logistic regression model to assess the probability that the tested soil sample belongs to each standard soil sample, and adjusts the microwave digestion parameters of the tested soil sample based on the differences between the tested soil sample and each standard soil sample. This method quantifies the differences between different soil samples and enhances the quality of dynamic adjustment of microwave digestion parameters, thereby improving the sufficiency of microwave digestion of unknown soil samples and contributing to improved accuracy in subsequent detection of various heavy metal ion concentrations in the soil.
[0098] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0099] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from its essential characteristics. Therefore, the embodiments described above should be considered exemplary and non-limiting in all respects.
Claims
1. A sample pre-treatment method for soil testing, characterized by, The method comprises the following steps: During the microwave digestion process of the soil sample pretreatment, temperature data, pressure data and PH value of the solution in the digestion tank are collected in real time, and detection values of concentrations of various heavy metal ions in the solution are obtained after the digestion is completed; By the change of the temperature data in the single digestion process and the change of the correlation between the pressure data, the temperature data and the PH value, a digestion process coefficient of the single digestion process is obtained; for a single standard soil sample, by comparing the detection values of the concentrations of various heavy metal ions after the single digestion is completed with the standard values thereof and the digestion process coefficients of different digestion processes, an influence weight of the single digestion is obtained, which is used to construct a random forest model and obtain optimal microwave digestion parameters of the single standard soil sample in combination with an intelligent optimization algorithm; A pre-trained multiple logistic regression model is used to obtain a probability that the to-be-detected soil sample belongs to each standard soil sample according to the digestion process coefficient of the initial digestion process of the to-be-detected soil sample and a deviation of the microwave digestion parameters in the initial digestion process compared with the optimal microwave digestion parameters of each standard soil sample, and then a comprehensive deviation of various microwave digestion parameters in the initial digestion process is obtained in combination with the deviation, so as to adjust the microwave digestion parameters of the to-be-detected soil sample; The digestion process coefficient is obtained by: The correlation coefficients between the pressure data and the temperature data, the pH value in each period are respectively denoted as a first correlation coefficient and a second correlation coefficient; fitting curves of the first correlation coefficients and the second correlation coefficients in all periods in the single digestion process are denoted as a temperature-pressure fitting curve and an acidity fitting curve; The temperature trend of each period is obtained according to the change trend of the temperature data in each period and the temperature stage to which each period belongs; The product of the derivatives of the temperature-pressure fitting curve and the acidity fitting curve at each period is calculated, and a positive proportional mapping result of the product is calculated; The digestion process coefficient is the average value of the ratio of the temperature trend to the positive proportional mapping result in all periods in the single digestion process; The influence weight is obtained by: A heavy metal ion dissolution coefficient of the single digestion is obtained by comparing the concentrations of various heavy metal ions after the single digestion is completed with the standard concentrations thereof; The proportion of the digestion process coefficient of the single digestion process of the single soil sample in the digestion process coefficients of all digestion processes is calculated, and the influence weight is the sum of the proportion and the heavy metal ion dissolution coefficient; The heavy metal ion dissolution coefficient is obtained by The difference between the detection values of the concentrations of various heavy metal ions after the single digestion is completed and the standard values thereof is calculated; the ratio of the difference to the standard values of the concentrations of various heavy metal ions after the single digestion is completed is denoted as a concentration ratio; The difference between the number 1 and the concentration ratio is calculated, and the heavy metal ion dissolution coefficient is the average value of the differences of all heavy metal ions after the single digestion is completed; The comprehensive deviation is calculated by: In the formula, This indicates the first soil sample to be tested. The overall deviation of various microwave digestion parameters; This indicates the total number of standard soil samples; This indicates that the soil sample to be tested belongs to the first category. The probability of a standard soil sample; This indicates the first soil sample to be tested during the initial digestion. Microwave digestion parameters and the first The optimal particle in the standard soil sample is the th The difference between the microwave digestion parameters.
2. A sample pre-treatment method for soil testing as claimed in claim 1, wherein, The digestion process coefficient is obtained by: For a single digestion process, the time interval of the microwave digestion process is divided into time periods, and the trend coefficient of the temperature in each time period is obtained by the change of the temperature data in each time period. Specifically, the mean of all temperature data in each time period is obtained, and the fitting curve of the mean in time sequence in all time periods in a single digestion process is denoted as a temperature fitting curve, and the derivative of the temperature fitting curve at each time period is obtained; According to the mean, the change acceleration measure of the temperature data in each time period is obtained, and the average of the change acceleration measure in each time period and the previous time period is obtained; the trend coefficient is positively correlated with the derivative and the average, respectively; Each time period is divided into temperature stages, and then the digestion process coefficient of the single digestion process is obtained by combining the temperature change trend in each time period, and the change of the correlation coefficient between the pressure data and the temperature data and the correlation coefficient between the pressure data and the pH value at each time period.
3. A sample pre-treatment method for soil testing as claimed in claim 2, wherein, The process of dividing each time period into temperature stages is: The temperature stages include a warming period, a stable period, and a cooling period; The first segmentation threshold and the second segmentation threshold of the trend coefficient of the temperature in all time periods in a single digestion process are obtained, wherein the first segmentation threshold is greater than the second segmentation threshold, the time period with a trend coefficient greater than the first segmentation threshold is regarded as a warming period, the time period with a trend coefficient less than the second segmentation threshold is regarded as a cooling period, and the remaining time period is regarded as a stable period.
4. A sample pre-treatment method for soil testing as claimed in claim 1, wherein, The temperature trend measure is obtained by: If the time period is a warming period or a cooling period, the temperature trend measure is the normalized value of the absolute value of the product of the change acceleration measure and the derivative of the temperature fitting curve at each time period; If the time period is a stable period, the temperature trend measure is the normalized value of the dispersion of all temperature data in the time period.
5. A sample pre-treatment method for soil testing as claimed in claim 1 wherein, The random forest algorithm model is constructed, and the optimal microwave digestion parameters of a single standard soil sample are obtained by combining an intelligent optimization algorithm, including: The microwave digestion parameters of a single digestion of a single standard soil sample are regarded as a microwave digestion parameter sample, and the microwave digestion sample and the detection value of the concentration of various heavy metal ions after digestion are combined to form a training sample. When training the random forest model, the weight of each training sample is the influence weight of its corresponding single digestion; the prediction value of the concentration of various heavy metal ions after digestion by using a new microwave digestion parameter sample is obtained by the random forest model; Each microwave digestion parameter sample is regarded as a particle, and the fitness function of the intelligent optimization algorithm is: ; wherein, represents a fitness function; represents the number of heavy metal ion species; represents the predicted value of the concentration of each heavy metal ion obtained after a single particle in the iteration process of the intelligent optimization algorithm is substituted into the random forest model; represents the standard value of the concentration of each heavy metal ion.
6. A sample pre-treatment system for soil detection, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, The processor executes the computer program to realize the steps of the sample pretreatment method for soil detection in any one of claims 1-5.
Citation Information
Patent Citations
Toxic element pollution ecological risk evaluation method based on soil nematode ecological index
CN119721706A
Microwave digestion-liquid flash spectrometer strontium isotope rapid detection system for multiple types of samples
CN120275653A