Batch soil sensor calibration method and system based on multiple calibration algorithm library
Patent Information
- Application Number
- CN202610414673.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-31
- Publication Date
- 2026-08-18
AI Technical Summary
[0003]目前存在线性回归算法、多项式拟合算法、BP神经网络和高斯过程回归算法等多种标定算法,然而,不同的标定算法,其解释性、非线性拟合程度和泛化能力等的表现不同,影响标定计算效率和标定精度等,传统标定方法不能根据土壤传感器的特征选择合适的标定算法,导致在批量土壤传感器标定时,不能兼顾计算效率和标定精度
本发明首先根据传感器型号、规格和历史标定数据,确定非线性度;以及根据传感器型号和规格对非线性度进行微调,得到调整后的非线性度;然后,根据调整后的非线性度,在预设的多标定算法库中确定标定算法;最后,根据确定的标定算法进行土壤传感器标定;实现了在多种标定算法中进行优选的目的,解决了在批量土壤传感器标定时兼顾计算效率和标定精度的问题。
Smart Images

Figure CN122590958A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of metrology and testing technology, and in particular relates to a batch soil sensor calibration method and system based on multiple calibration algorithm libraries. Background Technology
[0002] With the development of intelligent agriculture, the demand for soil parameter sensors such as soil moisture sensors, temperature sensors, nutrient sensors, and pH sensors has increased dramatically. These sensors must be precisely calibrated during mass production to ensure measurement accuracy.
[0003] Currently, there are various calibration algorithms, such as linear regression, polynomial fitting, BP neural network, and Gaussian process regression. However, different calibration algorithms have different performances in terms of interpretability, nonlinear fitting degree, and generalization ability, which affect the calibration calculation efficiency and calibration accuracy. Traditional calibration methods cannot select a suitable calibration algorithm based on the characteristics of soil sensors, resulting in a failure to balance calculation efficiency and calibration accuracy when calibrating batches of soil sensors. Summary of the Invention
[0004] To address the aforementioned problems, this invention proposes a batch soil sensor calibration method and system based on a multi-calibration algorithm library. First, the nonlinearity is determined based on the sensor model, specifications, and historical calibration data. Then, based on the adjusted nonlinearity, a calibration algorithm is selected from a pre-defined multi-calibration algorithm library. Finally, the soil sensor is calibrated using the selected algorithm. This achieves the goal of selecting the optimal calibration algorithm from multiple options, solving the problem of balancing computational efficiency and calibration accuracy during batch soil sensor calibration.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solution: In a first aspect, the present invention provides a batch soil sensor calibration method based on multiple calibration algorithm libraries, including: Obtain soil sensor model, specifications, and historical calibration data; The nonlinearity is determined based on the sensor model, specifications, and historical calibration data; The nonlinearity is fine-tuned according to the sensor model and specifications to obtain the adjusted nonlinearity. Based on the adjusted nonlinearity, a calibration algorithm is determined from a pre-set multi-calibration algorithm library; wherein, when determining the calibration algorithm, the type of calibration algorithm is determined based on the pre-set range of the nonlinearity and the number of samples. Soil sensors are calibrated according to the established calibration algorithm.
[0006] Furthermore, the nonlinearity for: ; in, Sensor at input value The actual output below; This is the ideal straight line fitted using the endpoint method; This represents the full-scale output range of the sensor.
[0007] Furthermore, the adjusted nonlinearity for: ; in, For sensor type fine-tuning factor; As a regional environmental correction factor; These are environmental disturbance factors.
[0008] Furthermore, for time-domain reflectometry sensors, if the factory-specified linearity is greater than or equal to the preset nominal linearity value, the nonlinearity calculation threshold will be lowered by a preset percentage; for capacitive sensors, if the operating environment conductivity is greater than the preset conductivity value or the temperature fluctuation is greater than the preset temperature fluctuation value, the nonlinearity calculation result should be increased within the preset range; for quartz crystal resistive sensors, the output voltage will be preprocessed by logarithmic normalization before calculation; for multi-parameter integrated sensors, the standard formula will only be used for the moisture channel.
[0009] Furthermore, the calibration algorithm library includes linear regression, multinomial fitting, BP neural network, and support vector machine.
[0010] Furthermore, the determination of the calibration algorithm includes: if the nonlinearity is less than a first preset nonlinearity value, then a linear regression algorithm is selected; if the nonlinearity is within the range of the first and second preset nonlinearity values, and the number of samples is greater than the second preset sample value, then a polynomial fitting algorithm is selected; if the nonlinearity is within the range of the second and third preset nonlinearity values, and the number of samples is between the first and second preset sample values, then a backpropagation (BP) neural network is selected; if the nonlinearity is greater than or equal to the third preset nonlinearity value, and the number of samples is less than the first preset sample value, then a Gaussian process regression algorithm is selected; wherein, the first preset nonlinearity value is less than the second preset nonlinearity value, the second preset nonlinearity value is less than the third preset nonlinearity value, and the first preset sample value is less than the second preset sample value.
[0011] Secondly, the present invention also provides a batch soil sensor calibration system based on multiple calibration algorithm libraries, comprising: The data acquisition module is configured to acquire soil sensor model, specifications, and historical calibration data. The nonlinearity determination module is configured to determine the nonlinearity based on the sensor model, specifications, and historical calibration data. The adjustment module is configured to fine-tune the nonlinearity according to the sensor model and specifications to obtain the adjusted nonlinearity. The calibration algorithm determination module is configured to: determine a calibration algorithm from a preset multi-calibration algorithm library based on the adjusted nonlinearity; wherein, when determining the calibration algorithm, the calibration algorithm type is determined based on the preset range of the nonlinearity and the number of samples. The calibration module is configured to calibrate the soil sensor according to a determined calibration algorithm.
[0012] Thirdly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the batch soil sensor calibration method based on multiple calibration algorithm libraries described in the first aspect.
[0013] Fourthly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the program to implement the steps of the batch soil sensor calibration method based on multiple calibration algorithm libraries described in the first aspect.
[0014] Fifthly, the present invention also provides a computer program product, the computer program product comprising a computer program, which, when executed by a processor, implements the steps of the batch soil sensor calibration method based on multiple calibration algorithm libraries described in the first aspect.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention first determines the nonlinearity based on the sensor model, specifications, and historical calibration data; then, it fine-tunes the nonlinearity based on the sensor model and specifications to obtain the adjusted nonlinearity; next, it determines a calibration algorithm from a pre-set multi-calibration algorithm library based on the adjusted nonlinearity; finally, it calibrates the soil sensor according to the determined calibration algorithm; thus achieving the goal of selecting the best calibration algorithm from multiple options and solving the problem of balancing computational efficiency and calibration accuracy when calibrating batches of soil sensors. Attached Figure Description
[0016] The accompanying drawings, which form part of this embodiment, are used to provide a further understanding of this embodiment. The illustrative embodiments and their descriptions are used to explain this embodiment and do not constitute an improper limitation of this embodiment.
[0017] Figure 1 This is a flowchart of the method in Embodiment 1 of the present invention. Detailed Implementation
[0018] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0019] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, 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 pertains.
[0020] Example 1: This embodiment provides a batch soil sensor calibration method based on multiple calibration algorithm libraries, including: S1. Multi-vision collaborative perception and sensor recognition: Optionally, stereo vision technology can be used to acquire the precise position and orientation of the sensor in three-dimensional space, providing a basis for the robot to grasp the sensor. High-resolution industrial cameras and image processing methods can be employed to identify sensor models, read QR codes, and detect surface defects. The industrial camera parameters can be selected as 5 megapixels and 30fps.
[0021] The X-axis and Y-axis cameras are orthogonally set to monitor the placement of the sensor on the testing stage and the contact status of the electrodes in real time. For example, the X-axis camera is used to detect whether the sensor is completely attached to the surface of the testing stage, and the Y-axis camera is used to detect the alignment of the sensor electrodes with the pins of the testing stage.
[0022] The Kalman filter algorithm is used to fuse multiple visual data streams to improve pose determination accuracy. The Kalman filter state update formula is as follows:
[0023] in, For posterior state estimation; For prior state estimation; Kalman gain; These are the observed values; The observation matrix; Let be the posterior error covariance.
[0024] Establish a unified transformation relationship between the world coordinate system, robot base coordinate system, camera coordinate system, and inspection platform coordinate system. Obtain the transformation matrix between each coordinate system through visual calibration to achieve accurate registration of the coordinate systems.
[0025] S2, Embodied Intelligent Decision-Making and Adaptive Control: Intelligent decision-making and adaptive control are performed based on visual perception results and historical calibration data.
[0026] S2.1 Adaptive adjustment of grasping posture: Optionally, an impedance control algorithm can be used to achieve flexible grasping of the sensor by the robot, avoiding sensor damage. The impedance control equation is as follows: ; in, Joint torque; It is a Jacobian matrix; For the power of expectation; For positional stiffness; This is for positional deviation; For velocity damping; For speed.
[0027] S2.2 Automatic selection of calibration scheme: S2.2.1 The system has a built-in library of various calibration algorithms, including linear regression, polynomial fitting, BP neural network and Gaussian process regression.
[0028] S2.2.2 Based on the sensor model, specifications, and historical calibration data, automatically select the optimal calibration algorithm. For new sensors, automatically perform preliminary calibration, evaluate the performance of each algorithm, and select the best algorithm.
[0029] like Figure 1 The image shows a decision tree for selecting a calibration scheme: First, the nonlinearity is determined based on the sensor model, specifications, and historical calibration data. Then, based on the nonlinearity, the corresponding calibration algorithm is selected from linear regression, polynomial fitting, BP neural network, and Gaussian process regression algorithms. Specifically: Different models of soil sensors have different design characteristics and factory specifications, which can be used as a preliminary basis for judgment. For example, the TDR-350 is a time-domain reflectometry moisture sensor, while the pH-202 is a glass electrode pH sensor. Different types of sensors naturally have different nonlinear trends. Extract the soil sensor's measurement range (e.g., moisture: 0–100%, pH: 3–9), output signal format (4–20mA, 0–5V, digital I²C, etc.), and factory-rated linearity (e.g., ±2%FS).
[0030] The actual nonlinearity is determined using historical calibration data. Calculations should be based on actual calibration experimental data: ; in, Sensor at input value The actual output can be obtained by averaging multiple measurements; To find the ideal straight line fitted by the endpoint method, connect the minimum and maximum inputs to find the corresponding outputs. This represents the full-scale output range of the sensor.
[0031] For example, a soil moisture sensor measured output voltages of 0.02V, 0.81V, 1.58V, 2.32V, 3.01V, and 3.65V in standard soil samples at 0%, 20%, 40%, 60%, 80%, and 100% moisture content, respectively, with a full-scale range of 4V. The ideal straight line is determined by (0, 0) and (100, 4), i.e. =0.04 The maximum absolute value of the deviation at each point is calculated to be 0.18V, and the nonlinearity is calculated as 0.18 ÷ 4 × 100% = 4.5%.
[0032] Determine the nonlinearity Then, the nonlinearity was determined according to the sensor model and specifications. Fine-tuning was performed to better align it with the sensor; ; in, For sensor type fine-tuning factor; The regional environmental correction factor is set at 1.15 when the temperature fluctuation is >10℃ and at 1.20 when the salinity is >3 g / kg. This represents the environmental disturbance factor. Optionally, the fine-tuning factor should be based on localized calibration using historical calibration data. For example, in clay regions, the nonlinearity of capacitive sensors is generally 8%–12% higher than the factory specification due to the soil clay particle adsorption effect; a regional correction coefficient needs to be introduced into the formula. =1.08~1.12.
[0033] For time-domain reflectometry (TDRS) sensors, if the factory-specified linearity is ≥97%, the nonlinearity calculation threshold can be lowered by 10%, i.e., actual nonlinearity = calculated value × 0.9. For capacitive sensors, if the operating environment conductivity is >5 mS / cm or the temperature fluctuation is >15℃, the nonlinearity calculation result should be increased by 15%–25%. For quartz crystal resistive sensors, the output voltage needs to be logarithmically normalized before calculation and then substituted into the nonlinearity formula to avoid underestimating the true deviation. For multi-parameter integrated sensors, only the standard formula should be used for the moisture channel; the pH and EC channels require independent nonlinearity evaluations.
[0034] The dielectric constant measurement of capacitive sensors is affected by both soil ion concentration and temperature. High conductivity enhances polarization, and temperature fluctuations alter the dipole orientation of water molecules. Both factors combined lead to an underestimation of output nonlinearity. A 15%–25% correction is an empirical compensation threshold for this coupled interference, effectively preventing systematic shifts in the calibrated model under salinized or temperature-changing environments. In the clay region of Jinan, where conductivity often exceeds 6 mS / cm and annual temperature fluctuations reach 20℃, this strategy improved the calibration pass rate of capacitive sensors in scenarios with nonlinearity >4% from 62% to 89%. This correction makes the moisture inversion results closer to the actual soil moisture, avoiding false drought misjudgments caused by underestimating nonlinearity, thus preventing insufficient or excessive irrigation and improving water-saving efficiency by approximately 15%. The output voltage of quartz crystal resistive pH sensors has a logarithmic relationship with hydrogen ion activity. Directly calculating the linear nonlinearity of the original voltage will severely underestimate the true deviation.
[0035] During logarithmic normalization preprocessing, the output voltage V is first transformed using V′=log(V), which converts the nonlinear S-curve into an approximately linear range. This ensures that subsequent nonlinearity calculations (based on the maximum deviation method) accurately reflect the inherent nonlinearity error of the sensor, rather than artificially distorted mathematical distortions. Since the pH and EC sensors share the same probe structure, changes in the ion concentration (EC) in the soil solution alter the electrode interface potential, thus affecting the reference potential of the pH electrode and causing false pH drift. An independent evaluation mechanism forcibly separates the calibration model and data processing path of the two channels, avoiding parameter coupling. In saline-alkali soil environments, when EC > 8 mS / cm, without independent evaluation, pH reading deviations can reach 0.8–1.2 units; after independent evaluation, this deviation is reduced to ≤0.3 units, significantly improving the accuracy of nutrient management decisions. Independent data provides reliable input for EC-pH joint diagnosis, such as distinguishing between salinization (high EC + high pH) and acidification (low EC + low pH), guiding lime or sulfur application, and avoiding soil degradation caused by misjudgment.
[0036] For example, a capacitive sensor (XR61-FDR) in a clay region with a conductivity of 6.2 mS / cm had a maximum measured deviation of 0.21V and a full-scale range of 4V. The initial nonlinearity was 0.214 × 100% = 5.25%. After fine-tuning, the nonlinearity was 5.25% × 1.20 × 1.10 × 1.15 = 7.98%.
[0037] Combining the nonlinearity value with the application scenario requirements, and balancing accuracy and efficiency, a calibration algorithm selection strategy is formulated: If nonlinearity Linear regression is chosen because it has small errors, fast computation, and strong interpretability, making it suitable for highly linear sensors, such as some temperature sensors; however, if the nonlinearity is... If the sample size is greater than 50, then the polynomial fitting algorithm is selected, which can effectively compensate for mild nonlinearity and avoid overfitting, making it suitable for most NPK or humidity sensors; if the nonlinearity is... If the sample size is between 20 and 50, then a backpropagation (BP) neural network is chosen because it can model strong nonlinear relationships, has strong generalization ability, and is suitable for environmentally sensitive sensors; if the nonlinearity is... If the sample size is less than 20, the Gaussian process regression algorithm is selected to provide uncertainty estimation, which is suitable for small sample and high-precision calibration scenarios, such as scientific research-grade soil pH sensors.
[0038] In some embodiments, a calibration history database is maintained for each sensor model to record the algorithm used each time and its results; the average performance of each algorithm on similar sensors is periodically analyzed, and the recommendation weights are adjusted accordingly.
[0039] When the nonlinearity of a new batch of sensors deviates significantly from the historical average, manual verification or increasing the density of calibration points can be used.
[0040] Example 2: This embodiment provides a batch soil sensor calibration system based on multiple calibration algorithm libraries, including: The data acquisition module is configured to acquire soil sensor model, specifications, and historical calibration data. The nonlinearity determination module is configured to determine the nonlinearity based on the sensor model, specifications, and historical calibration data. The adjustment module is configured to fine-tune the nonlinearity according to the sensor model and specifications to obtain the adjusted nonlinearity. The calibration algorithm determination module is configured to: determine a calibration algorithm from a preset multi-calibration algorithm library based on the adjusted nonlinearity; wherein, when determining the calibration algorithm, the calibration algorithm type is determined based on the preset range of the nonlinearity and the number of samples. The calibration module is configured to calibrate the soil sensor according to a determined calibration algorithm.
[0041] The working method of the system is the same as that of the batch soil sensor calibration method based on multiple calibration algorithm libraries in Example 1, and will not be repeated here.
[0042] Example 3: This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the batch soil sensor calibration method based on multiple calibration algorithm libraries described in Embodiment 1.
[0043] Example 4: This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the program, it implements the steps of the batch soil sensor calibration method based on multiple calibration algorithm libraries described in Embodiment 1.
[0044] Example 5: This embodiment provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the batch soil sensor calibration method based on multiple calibration algorithm libraries described in Embodiment 1.
[0045] The above description is merely a preferred embodiment of this practice and is not intended to limit the scope of this practice. Various modifications and variations can be made to this practice by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this practice should be included within the protection scope of this practice.
Claims
1. A batch soil sensor calibration method based on multiple calibration algorithm libraries, characterized in that, include: Obtain soil sensor model, specifications, and historical calibration data; The nonlinearity is determined based on the sensor model, specifications, and historical calibration data; The nonlinearity is fine-tuned according to the sensor model and specifications to obtain the adjusted nonlinearity. Based on the adjusted nonlinearity, a calibration algorithm is determined from a pre-set multi-calibration algorithm library; wherein, when determining the calibration algorithm, the type of calibration algorithm is determined based on the pre-set range of the nonlinearity and the number of samples. Soil sensors are calibrated according to the established calibration algorithm.
2. The batch soil sensor calibration method based on multiple calibration algorithm libraries as described in claim 1, characterized in that, The nonlinearity for: ; in, Sensor at input value The actual output below; This is the ideal straight line fitted using the endpoint method; This represents the full-scale output range of the sensor.
3. The batch soil sensor calibration method based on multiple calibration algorithm libraries as described in claim 2, characterized in that, The adjusted nonlinearity for: ; in, For sensor type fine-tuning factor; As a regional environmental correction factor; These are environmental disturbance factors.
4. The batch soil sensor calibration method based on multiple calibration algorithm libraries as described in claim 3, characterized in that, For time-domain reflectometry sensors, if the factory-specified linearity is greater than or equal to the preset nominal linearity value, the nonlinearity calculation threshold will be lowered by a preset percentage. For capacitive sensors, if the conductivity of the operating environment is greater than the preset conductivity value or the temperature fluctuation is greater than the preset temperature fluctuation value, the nonlinearity calculation result should be increased within the preset range. For quartz crystal resistive sensors, the output voltage is preprocessed by logarithmic normalization before calculation; for multi-parameter integrated sensors, the standard formula is used only for the moisture channel.
5. The batch soil sensor calibration method based on multiple calibration algorithm libraries as described in claim 1, characterized in that, The calibration algorithm library includes linear regression, multinomial fitting, BP neural network, and support vector machine.
6. The batch soil sensor calibration method based on multiple calibration algorithm libraries as described in claim 5, characterized in that, The determination of the calibration algorithm includes: if the nonlinearity is less than a first preset nonlinearity value, then a linear regression algorithm is selected; if the nonlinearity is within the range of the first and second preset nonlinearity values, and the number of samples is greater than the second preset sample value, then a polynomial fitting algorithm is selected; if the nonlinearity is within the range of the second and third preset nonlinearity values, and the number of samples is between the first and second preset sample values, then a backpropagation (BP) neural network is selected; if the nonlinearity is greater than or equal to the third preset nonlinearity value, and the number of samples is less than the first preset sample value, then a Gaussian process regression algorithm is selected; wherein, the first preset nonlinearity value is less than the second preset nonlinearity value, the second preset nonlinearity value is less than the third preset nonlinearity value, and the first preset sample value is less than the second preset sample value.
7. A batch soil sensor calibration system based on multiple calibration algorithm libraries, characterized in that, include: The data acquisition module is configured to acquire soil sensor model, specifications, and historical calibration data. The nonlinearity determination module is configured to determine the nonlinearity based on the sensor model, specifications, and historical calibration data. The adjustment module is configured to fine-tune the nonlinearity according to the sensor model and specifications to obtain the adjusted nonlinearity. The calibration algorithm determination module is configured to: determine a calibration algorithm from a preset multi-calibration algorithm library based on the adjusted nonlinearity; wherein, when determining the calibration algorithm, the calibration algorithm type is determined based on the preset range of the nonlinearity and the number of samples. The calibration module is configured to calibrate the soil sensor according to a determined calibration algorithm.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the steps of the batch soil sensor calibration method based on a variety of calibration algorithm libraries as described in any one of claims 1-6.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, When the processor executes the program, it implements the steps of the batch soil sensor calibration method based on multiple calibration algorithm libraries as described in any one of claims 1-6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the batch soil sensor calibration method based on a multi-calibration algorithm library as described in any one of claims 1-6.