Gas sensor calibration method and equipment

By constructing physical branching and migration branch models, combining temperature gradient compensation and signal-to-noise ratio, the problem of low calibration efficiency and accuracy of NDIR carbon dioxide sensors is solved, and efficient and high-precision calibration effect is achieved.

CN120404635AActive Publication Date: 2025-08-01GUANGZHOU GERUAN INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510368996.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-08-01
Estimated Expiration
2045-03-27

AI Technical Summary

Technical Problem

The existing NDIR carbon dioxide sensor calibration method has low efficiency and low accuracy. The traditional polynomial model consumes a long time and has a high error accumulation rate when temperature fluctuates. Deep learning methods require a large amount of training data and are difficult to diagnose faults.

Method used

A physical branch model and migration branch model are constructed, combined with temperature gradient compensation coefficient and signal-to-noise ratio, the polynomial coefficient matrix is fitted through the least squares method, and the GRU network is used for dynamic prediction, and the model weight is dynamically adjusted to adapt to environmental changes.

Benefits of technology

While reducing the amount of training data, the calibration efficiency and accuracy are improved, and the calibration results can be maintained under changes in temperature and noise environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120404635A_ABST
    Figure CN120404635A_ABST
Patent Text Reader

Abstract

The invention discloses a gas sensor calibration method and equipment. The method comprises the following steps: determining a calibration matrix set, a temperature gradient compensation coefficient and a signal-to-noise ratio of a sensor to be calibrated; according to the calibration matrix set and the temperature gradient compensation coefficient, constructing a physical branch model for performing static prediction on a calibration result of the sensor to be calibrated; according to the calibration matrix set and the signal-to-noise ratio, constructing a migration branch model for dynamically predicting the calibration result of the sensor to be calibrated; constructing a dynamic branch model used for distributing weights corresponding to the physical branch model and the migration branch model respectively; the physical branch model, the migration branch model and the dynamic branch model form a calibration model of the sensor to be calibrated; and calibrating the to-be-calibrated sensor according to the calibration model to obtain a calibration result. According to the calibration model, while the training data volume is reduced, static and dynamic prediction can be carried out on the calibration result of the gas sensor at the same time, so that the calibration efficiency and the calibration precision are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of gas sensors, and in particular to a gas sensor calibration method and device. Background Art

[0002] Carbon dioxide molecules have a strong absorption characteristic for infrared light of a specific wavelength. Therefore, a non-dispersive infrared (NDIR) carbon dioxide sensor is based on this characteristic. By measuring the change in light intensity and combining with the Lambert-Beer Law, the carbon dioxide concentration can be calculated.

[0003] Most of the existing calibration methods for NDIR carbon dioxide sensors adopt the following two methods:

[0004] 1) The traditional polynomial model (such as poly55) needs to collect 36 calibration points in the full temperature range (0 - 48°C), and the calibration takes up to 2 hours. Moreover, when the temperature fluctuation > 2°C / min, the error accumulation rate is as high as 15 ppm / min;

[0005] 2) The deep learning method requires more than 2000 sets of training data, and the black box characteristic of the model makes it difficult for fault diagnosis.

[0006] Therefore, the existing calibration methods for NDIR carbon dioxide sensors have problems of low efficiency and low accuracy. Summary of the Invention

[0007] In order to overcome the deficiencies of the prior art, the purpose of the present invention is to provide a gas sensor calibration method and device, which can improve the calibration efficiency and calibration accuracy of the gas sensor.

[0008] To solve the above problems, the present invention is implemented according to the following solutions:

[0009] A gas sensor calibration method is provided, including:

[0010] Determine the calibration matrix set, temperature gradient compensation coefficient, and signal-to-noise ratio of the sensor to be calibrated;

[0011] According to the calibration matrix set and the temperature gradient compensation coefficient, construct a physical branch model for static prediction of the calibration result of the sensor to be calibrated;

[0012] According to the calibration matrix set and the signal-to-noise ratio, construct a migration branch model for dynamic prediction of the calibration result of the sensor to be calibrated;

[0013] Construct a dynamic branch model for allocating the respective weights corresponding to the physical branch model and the migration branch model;

[0014] The physical branch model, the migration branch model, and the dynamic branch model constitute the calibration model of the sensor to be calibrated;

[0015] Calibrate the sensor to be calibrated according to the calibration model to obtain a calibration result used to indicate the output after calibration of the sensor to be calibrated.

[0016] Compared with the prior art, the beneficial effects of a gas sensor calibration method of the present invention are as follows: By constructing a calibration model with the physical branch model and the migration branch model, compared with a single traditional polynomial model or deep learning method, while reducing the amount of training data, it can also perform static and dynamic predictions on the calibration results of gas sensors, thereby improving the calibration efficiency and calibration accuracy.

[0017] Optionally, the calibration matrix set includes multiple groups of calibration matrices; determining the calibration matrix set of the sensor to be calibrated includes:

[0018] Determine the calibration points of the sensor to be calibrated, where the calibration points include a temperature set of the lowest temperature value, the intermediate temperature value, and the highest temperature value of the environment temperature where the sensor to be calibrated is located, and a concentration set of the lowest gas concentration value and the highest gas concentration value monitored by the sensor to be calibrated;

[0019] Randomly select a temperature value from the temperature set and combine it with any concentration value in the concentration set to obtain a set of test conditions;

[0020] Traverse all temperature values in the temperature set to determine multiple sets of test conditions formed by each temperature value and the concentration value combined with it;

[0021] Test the output voltage of the sensor to be calibrated under each set of test conditions;

[0022] Respectively use each set of test conditions and its corresponding output voltage as a group of calibration matrices.

[0023] Optionally, determining the temperature gradient compensation coefficient of the sensor to be calibrated includes:

[0024] Determine the mutation temperature value according to the intermediate temperature value and the preset temperature change value;

[0025] Use the output voltage of the sensor to be calibrated at the intermediate temperature value as the voltage before mutation;

[0026] Use the output voltage of the sensor to be calibrated after mutating from the intermediate temperature value to the mutation temperature value as the voltage after mutation;

[0027] Determine the voltage change value according to the voltage before mutation and the voltage after mutation;

[0028] Repeat the above steps multiple times to obtain multiple voltage change values;

[0029] By using the least squares method, fit the preset temperature change value and multiple voltage change values to determine the temperature gradient compensation coefficient.

[0030] Optionally, determining the signal-to-noise ratio of the sensor to be calibrated includes:

[0031] Irradiate the gas used to calibrate the sensor to be calibrated with the light intensity of the first preset band to obtain the light intensity signal power;

[0032] Irradiate the gas used to calibrate the sensor to be calibrated with the light intensity of the second preset band to obtain the background noise power;

[0033] Determine the signal-to-noise ratio according to the light intensity signal power and the background noise power.

[0034] Optionally, according to the calibration matrix set and the temperature gradient compensation coefficient, construct a physical branch model for static prediction of the calibration result of the sensor to be calibrated, including:

[0035] Obtain the polynomial coefficient matrix according to the calibration matrix set;

[0036] Obtain the temperature change value of the sensor to be calibrated after a preset time step;

[0037] Obtain the physical branch model according to the polynomial coefficient matrix, the temperature gradient compensation coefficient and the temperature change value.

[0038] Optionally, according to the calibration matrix set and the signal-to-noise ratio, construct a migration branch model for dynamic prediction of the calibration result of the sensor to be calibrated, including:

[0039] Determine the source domain training data of the cross-gas data set, and perform source domain training on the training network according to the source domain training data to obtain an initial training network;

[0040] According to the polynomial coefficient matrix and the temperature gradient compensation coefficient of the physical branch model, perform target domain fine-tuning on the initial training network to obtain a migration branch model; when a preset time sliding window is reached, perform dynamic adjustment on the migration branch model.

[0041] Optionally, the cross-gas data set includes the output voltages of multiple gas sensors at different gas concentrations and different temperatures;

[0042] Determining the source domain training data of the cross-gas data set includes:

[0043] Determine the signal-to-noise ratio of the sensor to be calibrated in each gas environment;

[0044] The signal-to-noise ratio and the cross-gas data set constitute the source domain training data.

[0045] Optionally, performing source domain training on a training network according to the source domain training data to obtain an initial training network, including:

[0046] Determining network parameters and a training parameter matrix of the training network according to the source domain training data; the network parameters include the number of network layers and the number of nodes;

[0047] Obtaining the initial training network according to the network parameters and the training parameter matrix.

[0048] Optionally, the dynamic branch model assigns weights to the physical branch model and the migration branch model respectively, including:

[0049] Obtaining the temperature change value of the sensor to be calibrated after a preset time step;

[0050] Determining an environmental stability index according to the temperature change value and the signal-to-noise ratio;

[0051] Determining the weights corresponding to the physical branch model and the migration branch model respectively according to the environmental stability index.

[0052] A computer device is also provided, including a processor and a memory. At least one instruction, at least one program, a code set or an instruction set is stored in the memory, and at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the described gas sensor calibration method. Description of the Drawings

[0053] Figure 1 It is a flowchart of the calibration method of the present invention;

[0054] Figure 2 It is a flowchart of constructing the migration branch model of the present invention;

[0055] Figure 3 It is an architecture diagram of the calibration model of the present invention. Detailed Embodiments

[0056] The following describes the preferred embodiments of the present invention with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0057] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific circumstances.

[0058] See Figure 1 As shown, a gas sensor calibration method of the present invention includes:

[0059] S1: Determine the calibration matrix set, temperature gradient compensation coefficient, and signal-to-noise ratio of the sensor to be calibrated, including:

[0060] The calibration matrix set includes multiple groups of calibration matrices; each group of calibration matrices consists of a temperature value, a concentration value, and an output voltage; in the actual application process, the emission intensity of the infrared light source will change with temperature. For example, in a high-temperature environment, the light source will decay, directly affecting the light intensity received by the internal detector of the NDIR carbon dioxide sensor (gas sensor), that is, the sensitivity of the detector may drift with temperature, resulting in an output voltage deviation; and the absorption rate of carbon dioxide molecules to infrared light will change with temperature. For example, an increase in temperature may cause the absorption peak to broaden.

[0061] For the NDIR carbon dioxide sensor (gas sensor), determining the calibration matrix set of the sensor to be calibrated includes:

[0062] First, determine the calibration points of the sensor to be calibrated. The calibration points include the temperature set of the lowest temperature value, the intermediate temperature value, and the highest temperature value of the environment temperature where the sensor to be calibrated is located, and the concentration set of the lowest gas concentration value and the highest gas concentration value monitored by the sensor to be calibrated.

[0063] In one embodiment of the present invention, to ensure that the calibrated model constructed can cover the full temperature range of the environment where the sensor to be calibrated may be located, and cover the full gas concentration range that the sensor to be calibrated can detect, and at the same time to ensure the reliability of the gas concentration detection of the sensor to be calibrated, it should be ensured that the sensor to be calibrated can work reliably within the temperature range of the temperature set. And to reduce the calibration data, when determining the calibration points in the present invention, the lowest temperature value and the highest temperature value should be the upper and lower limits of the full temperature range, and the intermediate temperature value should be the ambient temperature at which the sensor to be calibrated is most often located, that is, the lowest temperature value is -10 °C, the intermediate temperature value is 25 °C, and the highest temperature value is 60 °C, so as to cover the full temperature range; when determining the lowest gas concentration value, the average carbon dioxide concentration in the atmospheric environment should be considered to ensure that the sensor to be calibrated can detect the carbon dioxide concentration in the common environment, that is, the lowest gas concentration value is 400 ppm, and when the carbon dioxide concentration reaches a certain value, it will cause harm to the human body. Therefore, the highest gas concentration value needs to cover the risk warning threshold for harm to the human body, that is, the highest gas concentration value is 2000 ppm.

[0064] Next, randomly select a temperature value from the temperature set and combine it with any concentration value in the concentration set to obtain a set of test conditions. When the temperature set includes the lowest temperature value T1, the intermediate temperature value T2, and the highest temperature value T3, and the concentration set includes the lowest gas concentration value C1 and the highest gas concentration value C2, assuming that the intermediate temperature value T2 is randomly selected and combined with the lowest gas concentration value C1 in the concentration set, then the set of test conditions is [T2, C1]. Traverse all the temperature values in the temperature set to determine multiple sets of test conditions composed of each temperature value and the concentration value combined with it; when the temperature set includes 3 temperature values and the concentration set includes 2 gas concentration values, there are a total of 6 sets of test conditions.

[0065] Finally, test the output voltage of the sensor to be calibrated under each set of test conditions. Specifically, set the ambient temperature of the sensor to be calibrated to the temperature value in the test conditions, and set the gas concentration environment it is in to the concentration value in the test conditions to determine the voltage level output after detecting the gas concentration value when the sensor to be calibrated is at this temperature value; respectively take each set of test conditions and its corresponding output voltage as a set of calibration matrices, and this calibration matrix is used to represent the corresponding relationship between the environmental parameters (temperature, concentration) and the output voltage of the sensor to be calibrated, forming a mapping relationship from environmental parameters to electrical signals (output voltage).

[0066] Among the intermediate temperature values included in the above temperature set is the ambient temperature at which the sensor to be calibrated is most frequently located. The operating state of the sensor to be calibrated is relatively more stable at this temperature than at other temperatures. Therefore, after determining the calibration matrix set of the sensor to be calibrated, according to the intermediate temperature value of the temperature set, the temperature gradient compensation coefficient of the sensor to be calibrated is determined, including:

[0067] First, according to the intermediate temperature value and the preset temperature change value, the mutation temperature value is determined to conduct a temperature mutation experiment on the ambient temperature of the sensor to be calibrated to determine the influence of the temperature mutation on the detection of the gas concentration value by the sensor to be calibrated; in an embodiment of the present invention, taking the intermediate temperature value of 25 °C as the starting point of the temperature mutation experiment can ensure that the experimental conditions are consistent with the conventional use scenario of the sensor to be calibrated, providing a repeatable reference point for determining the temperature gradient compensation coefficient.

[0068] In an embodiment of the present invention, the preset temperature change value is 15 °C and the mutation temperature value is 40 °C; by setting the preset temperature change value to 15 °C, it can ensure that this temperature change can cause a change in the output voltage of the sensor to be calibrated, and at the same time ensure that the sensor to be calibrated will not be damaged due to excessive temperature mutation.

[0069] Next, a temperature mutation experiment is conducted on the sensor to be calibrated. Specifically, the output voltage of the sensor to be calibrated at the intermediate temperature value is used as the pre-mutation voltage; the output voltage of the sensor to be calibrated after mutating from the intermediate temperature value to the mutation temperature value is used as the post-mutation voltage; according to the pre-mutation voltage and the post-mutation voltage, the voltage change value is determined; the temperature mutation experiment is repeated on the sensor to be calibrated multiple times to ensure the accuracy of the finally determined temperature gradient compensation coefficient. Specifically, the above steps are repeated multiple times to obtain multiple voltage change values; a single voltage change value is used to indicate the influence of each temperature mutation on the output voltage of the sensor to be calibrated, that is, the deviation that the output voltage will show.

[0070] Finally, by using the least squares method, the preset temperature change value and multiple voltage change values are fitted to determine the temperature gradient compensation coefficient. By using the least squares method, a non-linear mapping relationship between the temperature gradient compensation coefficient and the temperature change value is established, and the voltage deviation data of multiple temperature mutation experiments can be determined to determine the temperature gradient compensation coefficient (optimal value) for compensating the voltage deviation data. Finally, the value of the temperature gradient compensation coefficient is obtained as 0.05 ± 0.005.

[0071] The NDIR carbon dioxide sensor detects the carbon dioxide concentration in its environment based on the absorption characteristics of carbon dioxide molecules for infrared light of a specific wavelength (4.26μm band). When the carbon dioxide concentration in the environment of the NDIR carbon dioxide sensor increases, the carbon dioxide molecules absorb more infrared light, and the light intensity received by the detector inside the sensor will decrease, resulting in a decrease in signal power. In other words, the signal power is nonlinearly negatively correlated with the carbon dioxide concentration.

[0072] In actual measurements, noise (such as detector thermal noise and ambient light interference) will mask the true signal and cause sensor detection errors. Therefore, for NDIR carbon dioxide sensors (gas sensors), the ratio of signal power to noise power is quantified by determining the signal-to-noise ratio to determine the impact of signal power / noise power (SNR) at different concentrations on the sensor output voltage.

[0073] In one embodiment of the present invention, determining the signal-to-noise ratio of the sensor to be calibrated includes:

[0074] First, the light intensity of the first preset band is used to irradiate the gas used to calibrate the sensor to be calibrated to obtain the light intensity signal power, where the light intensity of the first preset band is the light intensity of the 4.26μm band. This light intensity is the carbon dioxide absorption peak, which can directly reflect the absorption characteristics of carbon dioxide and obtain the light intensity signal power received by the detector inside the sensor.

[0075] Next, the light intensity of the second preset band is used to irradiate the gas used to calibrate the sensor to be calibrated to obtain the background noise power, where the light intensity of the second preset band is the light intensity of the 3.9-4.5μm band. Carbon dioxide does not absorb the light intensity in this band, and can directly reflect the light intensity changes caused by noise to obtain the local noise power.

[0076] Finally, the signal-to-noise ratio is determined based on the light intensity signal power and the background noise power. The calculation formula is as follows:

[0077]

[0078] Among them, SNR is the signal-to-noise ratio, P signal is the light intensity signal power, P noise is the local noise power; by determining the signal-to-noise ratio, the influence of environmental interference (noise) on the detection results can be avoided when the calibration model is subsequently constructed.

[0079] S2: Based on the calibration matrix set and the temperature gradient compensation coefficient, a physical branch model is constructed for statically predicting the calibration results of the sensor to be calibrated, including:

[0080] First, according to the set of calibration matrices, the polynomial coefficient matrix is obtained. Specifically, six groups of calibration matrices in the set of calibration matrices are substituted into the polynomial model. The expression of this polynomial model is as follows:

[0081]

[0082] Among them, U i represents the output voltage in six groups of calibration matrices, T j represents the temperature value in six groups of calibration matrices, and C is the actual concentration. By substituting all data points, an equation is generated for each data point. In this model, there are a total of 36 unknowns, and these 36 unknowns constitute the polynomial coefficient matrix A. For example, six calibration points are collected, and time series data of 60 seconds are collected for each calibration point (such as 60 seconds × 10 Hz = 600 points / group), that is, six groups of calibration matrices can generate 3600 (6 × 60 × 10 = 3600) equations, which are sufficient to support the least squares fitting of 36 coefficients.

[0083] In an embodiment of the present invention, since the number of equations (3600 equations) is much larger than the number of unknowns (36 unknowns), the Levenberg - Marquardt algorithm is used for non - linear least squares fitting. This algorithm is iteratively optimized through the following steps:

[0084] Initialization: Randomly generate the initial coefficient matrix A0;

[0085] Iterative update: Calculate the predicted concentration C pred under the current unknowns and the sum of squared residuals (RSS) with the actual concentration C ref . Adjust the coefficients according to the residuals, and its expression is as follows:

[0086] A k+1 = A k -(J T J + λI0 -1 J T r

[0087] Among them, J is the Jacobian matrix of the residuals with respect to the coefficients, r is the residual vector, and λ is the damping factor (dynamically adjusted to balance gradient descent and Newton's method).

[0088] Convergence judgment: Stop when the residual RSS < 1e - 6 (i.e., the error is less than 0.001%) or the number of iterations reaches 100 times.

[0089] After the above optimization, the final polynomial coefficient matrix A is obtained, and its expression is as follows:

[0090]

[0091] Wherein, the subscripts i and j respectively represent the polynomial orders of the output voltage and temperature. Among them, i ∈ [0, 5] corresponds to the sixth-order nonlinear characteristic of the voltage, and j ∈ [0, 5] corresponds to the sixth-order compensation term of the temperature. This polynomial coefficient matrix can be used to represent the nonlinear mapping weights of the voltage and temperature to the concentration, improve the calibration accuracy of the calibration model for the gas sensor, and further improve the accuracy of the detection result of the gas sensor.

[0092] Next, obtain the temperature change value of the sensor to be calibrated after a preset time step. When collecting data for each calibration point, the temperature of the sensor to be calibrated also changes at different times, and the collection time step is the preset time step. Then, in the temperature change value ΔT = |T t -T t-1 |, the time interval for collecting the temperature T t-1 and the temperature T t is the preset time step.

[0093] Finally, according to the polynomial coefficient matrix, the temperature gradient compensation coefficient, and the temperature change value, obtain the physical branch model. The expression of this physical branch model is as follows:

[0094]

[0095] Wherein, C poly is the prediction result of the carbon dioxide concentration by the physical branch model, γ is the temperature gradient compensation coefficient, ΔT is the temperature change value, U is the actual voltage, and U J is the reference voltage, which is the output voltage of the sensor to be calibrated when it is at the intermediate temperature value.

[0096] S3: According to the calibration matrix set and the signal-to-noise ratio, construct a migration branch model for dynamically predicting the calibration result of the sensor to be calibrated, including:

[0097] See Figure 2As shown in the figure, it is a flowchart for constructing a migration branch model. First, determine the source domain training data for the cross-gas dataset, and perform source domain training on the training network according to the source domain training data to obtain an initial training network. Among them, the cross-gas dataset includes the output voltages of various gas sensors at different gas concentrations and different temperatures. Specifically, the cross-gas dataset is generated by a tunable laser spectrometer, including 500 groups of data for each of the three gases, carbon dioxide, methane, and nitrous oxide. After determining the cross-gas dataset, determine the source domain training data of the cross-gas dataset, including: determining the signal-to-noise ratio of the sensor to be calibrated in each gas environment, which can be determined by the method of determining the signal-to-noise ratio of the sensor to be calibrated mentioned above, and will not be elaborated here. After obtaining the signal-to-noise ratio, the source domain training data is composed of the signal-to-noise ratio and the cross-gas dataset. Each group of data in the source domain training data includes output voltage, temperature, temperature change value, and signal-to-noise ratio. The determination method of the temperature change value is the same as the above process and will not be elaborated here.

[0098] Next, perform source domain training on the training network according to the source domain training data to obtain an initial training network, including:

[0099] According to the source domain training data, determine the network parameters and training parameter matrix of the training network. Among them, the training network is a GRU network. When the source domain training data is used as the input data of the training network, the output data is the gas concentration, that is, the input layer is four-dimensional features.

[0100] In an embodiment of the present invention, the network parameters include the number of network layers and the number of nodes. The number of network layers is the number of hidden layers, and the number of nodes is the number of hidden layer nodes. The network parameters are determined by comparative experiments. When the number of network layers increases from 2 layers to 3 layers, the validation set drops by 18.7% (from 42 ppm to 34 ppm). When continuing to increase to 4 layers, only a 2.3% improvement is achieved, but it brings a 37% increase in inference time. The number of nodes is selected and optimized by the golden section method. The 32-16-8 structure can achieve the best accuracy balance while keeping the number of parameters <5k. Therefore, the number of network layers of the present invention is 3 layers, and the number of nodes is 32.

[0101] After inputting the source domain training data into the GRU network (training network), the GRU network with 3 layers and 32 nodes learns the relationship between these four-dimensional features to obtain a training parameter matrix including input gate weights, reset gate weights, and update gate weights. Finally, according to the network parameters and the training parameter matrix, an initial training network is obtained.

[0102] Next, perform target domain fine-tuning on the initial training network, specifically, perform target domain fine-tuning on the initial training network according to the polynomial coefficient matrix and temperature gradient compensation coefficient of the physical branch model to obtain a migration branch model. When the preset time sliding window is reached, perform dynamic adjustment on the migration branch model.

[0103] In an embodiment of the present invention, the initial training network is fine-tuned for the target domain. Specifically, according to the polynomial coefficient matrix and temperature gradient compensation coefficient of the physical branch model, the physical branch and the migration branch are jointly optimized. A dynamic parameter freezing strategy is adopted, and the underlying parameters of the migration branch are frozen every 100 steps, and only the top-layer parameters are allowed to be updated, preventing overfitting and retaining the general features learned from the source domain, thereby obtaining the migration branch model.

[0104] When the preset time sliding window (e.g., 24 hours) is reached, the model parameters are continuously updated through the sliding window mechanism, and its loss function is:

[0105] L online = 0.7(C pred - C ref ) 2 + 0.3|C t - C t-1 | 2

[0106] where C pred is the predicted concentration value of the model, C ref is the reference standard gas concentration value, C t and C t-1 respectively represent the concentration prediction values at the current moment and the previous time series window; the coefficients 0.7 and 0.3 are jointly determined through grid search and Bayesian optimization. It is verified in 100 groups of parameter combinations that this ratio can optimally balance the relationship between immediate accuracy (the former term) and temporal stability (the latter term).

[0107] When the latter term coefficient (0.3 in the formula) exceeds 0.35, it will cause the model to be overly smooth, and when it is lower than 0.25, there will be concentration jumps. This loss function acts on the GRU network weight matrix of the migration branch model and the temperature gradient compensation coefficient of the physical branch model through backpropagation. Among them, the polynomial coefficient A of the physical branch model remains frozen during the online stage to ensure the stability of the basic model.

[0108] After setting up the sliding window mechanism, three-point calibration (e.g., 400 / 1000 / 2000 ppm) is performed every 8 hours. If the error exceeds 5%, the migration branch fine-tuning is triggered, and the RMSProp optimizer is used to incrementally train the GRU network (training network). The input gate and forget gate parameters (accounting for 70% of the total number of parameters) are frozen, and only 30% of the parameters of the output gate and the fully connected layer are updated. Experiments show that full parameter update will cause model oscillation (error fluctuation ±15 ppm), while the 10% update strategy reduces the fluctuation range to ±5 ppm. Therefore, the present invention selects the top 10% of highly sensitive neurons for update through importance sampling, enabling the model to quickly adapt to environmental changes while maintaining overall robustness and realizing dynamic adjustment of the model.

[0109] S4: Construct a dynamic branch model for assigning the respective weights of the physical branch model and the migration branch model. Specifically, first determine the environmental stability index, and its expression is as follows:

[0110]

[0111] where ESI is the environmental stability index, ΔT is the temperature change value, and SNR is the signal-to-noise ratio. By determining the environmental stability index, factors such as the temperature change rate, signal-to-noise ratio, output voltage, and environmental temperature are comprehensively considered. According to the environmental stability index, determine the respective weights of the physical branch model and the migration branch model, and the expression is as follows:

[0112]

[0113] where α is the weight corresponding to the physical branch model, (1 - α) is the weight corresponding to the migration branch model, ESI is the environmental stability index, and k is the slope adjustment factor of the Sigmoid function. The optimal value is determined on the validation set through grid search, and the typical value range is 8 - 12 (when k = 10, the minimum error is obtained under the critical working condition of ΔT = 2°C / min and SNR = 15 dB).

[0114] Experiments show that when k = 10, the optimal balance can be achieved in scenarios of temperature fluctuations (±5°C) and signal interference (SNR = 15 - 25 dB). Its numerical value determines the steepness of the weight switching: too large a k value will cause the model output to oscillate violently when the environment changes slightly (e.g., when k > 15, a change in ESI of 0.1 will cause a fluctuation in α value > 0.4), and too small a k value will reduce the response speed of the model to environmental mutations (e.g., when k < 5, a change in ESI > 0.3 is required to trigger the dominant mode switch). ESI is a comprehensive index for quantifying the environmental stability degree.

[0115] When ΔT > 2°C / min and ESI > 0.7, automatically switch to the physical branch model (α ≥ 0.8), that is, the output proportion of the physical branch model exceeds 80% in this working state. In this state, preferentially rely on the compensation model with clear physical meaning (physical branch model).

[0116] When ΔT > 2°C / min and ESI < 0.7, the environmental mutation weakens the temporal correlation of the data-driven model (migration branch model), while the temperature gradient compensation term in the physical branch model can respond to temperature changes immediately and avoid error accumulation.

[0117] When SNR < 15 (ESI < 0.3), the sensor signal is severely contaminated by environmental noise (the signal-to-noise ratio drops by more than 32%). At this time, the voltage-temperature polynomial of the physical branch model is vulnerable to outliers. However, the noise-robust features (enhanced by cross-gas datasets) obtained through pre-training in the migration branch model can effectively suppress pulse interference, and the gating mechanism of its GRU network can adaptively filter abnormal fluctuations. Therefore, when SNR < 15 (ESI < 0.3), the output of the migration branch model is preferentially adopted.

[0118] In an embodiment of the present invention, when the ESI value is different, the weight ratios of the physical branch model and the migration branch model will change. For example, when the temperature change value is large, the weight of the physical branch model will increase because its temperature gradient compensation coefficient can effectively suppress mutation errors; when the signal-to-noise ratio is low, the weight of the migration branch model will increase, and its noise-robust features obtained through pre-training can effectively suppress pulse interference. In this way, the dynamic branch model can adaptively adjust the weights of the two branch models according to the actual environmental conditions, thereby optimizing the output results of the model.

[0119] S5: The physical branch model, the migration branch model, and the dynamic branch model constitute the calibration model of the sensor to be calibrated; see Figure 3 As shown, it is the architecture diagram of the calibration model of the present invention; the dynamic branch model assigns the respective weights to the physical branch model and the migration branch model, including: obtaining the temperature change value of the sensor to be calibrated after a preset time step; determining the environmental stability index according to the temperature change value and the signal-to-noise ratio; and determining the respective weights of the physical branch model and the migration branch model according to the environmental stability index.

[0120] Among them, the physical branch model is based on an improved polynomial model and can perform basic non-linear fitting and temperature compensation on the output of the gas sensor; the migration branch model uses a pre-trained GRU network and can further optimize the output of the gas sensor by using the characteristics of time-series data; the dynamic branch model then allocates the weights of the two in real time according to the environmental stability index to achieve adaptive fusion; the three work together, enabling the calibration model to have both the stability of the physical model and the flexibility of the data-driven model, and being able to adapt to the calibration requirements of gas sensors in different environments, improving the calibration accuracy and reliability.

[0121] S6: Calibrate the sensor to be calibrated according to the calibration model to obtain a calibration result indicating the output after calibration of the sensor to be calibrated. Based on the established calibration model, carry out the calibration operation on the NDIR carbon dioxide gas sensor to be calibrated. During the calibration process, place the sensor under different conditions such as temperature and concentration to collect data, and input the collected data into the calibration model. Through the collaborative processing of the physical branch model, the migration branch model, and the dynamic branch model, the calibration model outputs the corresponding standard concentration value, thereby determining the relationship between the output of the sensor under different working conditions and the standard concentration. The finally obtained calibration result can accurately indicate the output situation of the sensor to be calibrated during actual detection after calibration, ensuring that its measurement accuracy meets the requirements of high-precision detection.

[0122] Next, conduct a verification experiment on the performance of the sensor to be calibrated according to the calibration method provided by the present invention. Specifically:

[0123] Extreme temperature change test: Use a rapid temperature change chamber (ESPEC TDB-2L) to simulate a temperature mutation of 25°C → 40°C / min. The traditional polynomial model has an instantaneous error of 214 ppm, while our calibration model controls the error within 67 ppm through dynamic weight adjustment (α decreases from 0.8 to 0.2).

[0124] 30-day long-term test: Continuously operate in a constant temperature and humidity chamber (25°C ± 1°C, 60% RH ± 5%). The traditional method generates a drift error of 89 ppm, and our online migration mechanism reduces the error to 31 ppm, with a daily average increase ≤ 1.0 ppm.

[0125] As shown in Table 1, it is a comparison of the results of the calibration model of the present invention and the traditional polynomial model.

[0126] Table 1

[0127] Test scenario Index Traditional polynomial The present invention (calibration model) Temperature mutation (25 → 40 °C) Maximum instantaneous error (ppm) 214 67 Low concentration (400 ppm) RMSE (ppm) 52 28 30-day long-term operation Drift error (ppm) 89 31 Humidity > 90% RH Error increase (ppm) +38 +19

[0128] Through the above implementation methods, an efficient and high-precision NDIR gas sensor calibration method has been successfully realized, significantly improving the environmental adaptability and long-term stability of the sensor.

[0129] The present invention also provides a computer device, including a processor and a memory. At least one instruction, at least one program, a code set, or an instruction set is stored in the memory, and the at least one instruction, at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the above-mentioned calibration method.

[0130] The processor can be a Central Processing Unit (CPU), or can also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0131] The memory can be used to store the computer programs or modules. The processor realizes various functions of the calibration method by running or executing the computer programs or modules stored in the memory, and by calling the data stored in the memory. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as hard disks, memory, plug-in hard disks, Smart Media Cards (SMCs), Secure Digital (SD) cards, Flash Cards, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.

[0132] The above are only the preferred embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.

Claims

1. A method for calibrating a gas sensor, characterized in that, Including: Determine the calibration matrix set, temperature gradient compensation coefficient, and signal-to-noise ratio of the sensor to be calibrated; Construct a physical branch model for static prediction of the calibration result of the sensor to be calibrated according to the calibration matrix set and the temperature gradient compensation coefficient; Construct a migration branch model for dynamic prediction of the calibration result of the sensor to be calibrated according to the calibration matrix set and the signal-to-noise ratio; Construct a dynamic branch model for allocating the respective weights corresponding to the physical branch model and the migration branch model; The physical branch model, the migration branch model, and the dynamic branch model constitute the calibration model of the sensor to be calibrated; Calibrate the sensor to be calibrated according to the calibration model to obtain a calibration result for indicating the output after calibration of the sensor to be calibrated.

2. A gas sensor calibration method according to claim 1, wherein The calibration matrix set includes multiple groups of calibration matrices; Determining the calibration matrix set of the sensor to be calibrated includes: Determine the calibration points of the sensor to be calibrated, where the calibration points include a temperature set of the lowest temperature value, intermediate temperature value, and highest temperature value of the environment temperature where the sensor to be calibrated is located, and a concentration set of the lowest gas concentration value and highest gas concentration value monitored by the sensor to be calibrated; Randomly select a temperature value from the temperature set and combine it with any concentration value in the concentration set to obtain a set of test conditions; Traverse all temperature values in the temperature set to determine multiple sets of test conditions formed by each temperature value and the concentration value combined with it; Test the output voltage of the sensor to be calibrated under each set of test conditions; Respectively use each set of test conditions and its corresponding output voltage as a group of calibration matrices.

3. A gas sensor calibration method according to claim 2, characterized in that, Determining the temperature gradient compensation coefficient of the sensor to be calibrated includes: Determine the mutation temperature value according to the intermediate temperature value and the preset temperature change value; Use the output voltage of the sensor to be calibrated at the intermediate temperature value as the voltage before mutation; Use the output voltage of the sensor to be calibrated after mutating from the intermediate temperature value to the mutation temperature value as the voltage after mutation; Determine the voltage change value according to the voltage before mutation and the voltage after mutation; Repeat the above steps multiple times to obtain multiple voltage change values; By the least squares method, fit the preset temperature change value and multiple voltage change values to determine the temperature gradient compensation coefficient.

4. A gas sensor calibration method according to claim 2, wherein Determining the signal-to-noise ratio of the sensor to be calibrated includes: Irradiate the gas used to calibrate the sensor to be calibrated with the light intensity of the first preset band to obtain the light intensity signal power; Irradiate the gas used to calibrate the sensor to be calibrated with the light intensity of the second preset band to obtain the background noise power; Determine the signal-to-noise ratio according to the light intensity signal power and the background noise power.

5. A gas sensor calibration method according to claim 3, characterized in that, Constructing a physical branch model for static prediction of the calibration result of the sensor to be calibrated according to the calibration matrix set and the temperature gradient compensation coefficient includes: Obtain the polynomial coefficient matrix according to the calibration matrix set; Obtain the temperature change value of the sensor to be calibrated after a preset time step; Obtain the physical branch model according to the polynomial coefficient matrix, the temperature gradient compensation coefficient, and the temperature change value.

6. A gas sensor calibration method according to claim 4, characterized in that, Construct a migration branch model for dynamically predicting the calibration result of the sensor to be calibrated according to the calibration matrix set and the signal-to-noise ratio, including: Determine the source domain training data of the cross-gas data set, and perform source domain training on the training network according to the source domain training data to obtain an initial training network; Fine-tune the initial training network according to the polynomial coefficient matrix and the temperature gradient compensation coefficient of the physical branch model to obtain a migration branch model; when the preset time sliding window is reached, dynamically adjust the migration branch model.

7. A gas sensor calibration method according to claim 6, characterized in that, The cross-gas data set includes the output voltages of multiple gas sensors at different gas concentrations and different temperatures; Determine the source domain training data of the cross-gas data set, including: Determine the signal-to-noise ratio of the sensor to be calibrated in each gas environment; The signal-to-noise ratio and the cross-gas data set constitute the source domain training data.

8. A gas sensor calibration method according to claim 7, characterized in that, Perform source domain training on the training network according to the source domain training data to obtain an initial training network, including: Determine the network parameters and the training parameter matrix of the training network according to the source domain training data; the network parameters include the number of network layers and the number of nodes; Obtain the initial training network according to the network parameters and the training parameter matrix.

9. A gas sensor calibration method according to claim 4, characterized in that, The dynamic branch model assigns weights corresponding to the physical branch model and the migration branch model respectively, including: Obtain the temperature change value of the sensor to be calibrated after a preset time step; Determine the environmental stability index according to the temperature change value and the signal-to-noise ratio; Determine the weights corresponding to the physical branch model and the migration branch model respectively according to the environmental stability index.

10. A computer device, characterized in that, The computer device includes a processor and a memory. At least one instruction, at least one program, a code set or an instruction set is stored in the memory. The at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement a gas sensor calibration method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Carbon dioxide sensor calibration method and system based on BP neural network

    CN112683836A

  • Remote calibration method and system for gas sensor

    CN113358732A

  • Hydrogen sensor off-line calibration method based on deep learning

    CN116720421A

  • Target calibration method, electronic equipment and computer readable medium

    CN117809106A

  • Electrochemical sensor calibration method and device

    CN120609883A