Zero drift calibration method and device for sensor, and computer readable storage medium
By obtaining the environmental information data of the sensor, using the weighted environment algorithm model or Pearson correlation coefficient, determining whether the sensor needs zero-drift calibration, and calculating the zero-drift reference value for calibration, solving the problem that the sensor cannot automatically calibrate in the working state, achieving high-precision automatic calibration.
Patent Information
- Application Number
- CN202510222684.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the sensor cannot realize automatic zero-drift calibration in the operating state, resulting in a decrease in accuracy.
By obtaining the sensor's environmental information data, including gas concentration, ambient temperature and humidity, and light intensity, the weighted environmental algorithm model or Pearson correlation coefficient is used to determine whether the zero-drift calibration is performed, and the zero-drift reference value is calculated for calibration.
It realizes automatic calibration of the sensor in operation, improves the reliability and accuracy of calibration, and ensures calibration accuracy.
Smart Images

Figure CN120254170A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of sensor calibration, for example, to a zero-drift calibration method and device for a sensor, and a computer-readable storage medium. Background Art
[0002] As a civil fuel, natural gas is incorporated into pipelines after production and then enters households for residents' daily use. Although natural gas is non-toxic and not likely to accumulate into an explosive gas, due to improper use or pipeline damage caused by third-party construction, natural gas leakage and explosion incidents still occur from time to time. Therefore, the detection of natural gas leakage is very important. Currently, the more widely used natural gas alarm is a catalytic combustion or electro-chemical sensor. Due to the characteristics of the sensor itself, zero drift will inevitably occur. As the use time lengthens, the drift becomes more significant, resulting in a decrease in the accuracy of the sensor.
[0003] The related technology discloses an optimization method for a calibration scheme suitable for a low-cost CO2 sensor, which consists of sensor calibration and calibration scheme optimization. The calibration scheme optimization includes the optimization of the training set of the calibration equation and the optimization of the interval time between two calibrations. Taking the data of the last 30 days in the training set as the test set, and taking the root mean square error between the calibration value of the low-cost CO2 sensor in the test set and the reference instrument as the standard, select the one with the shortest time length in the training set that meets the user's requirements as the basis for the best training set duration. When the root mean square error continuously exceeds the observation requirement, it indicates that the reliability of the low-cost CO2 sensor can no longer meet the needs, that is, the test set data has exceeded the generalization ability of the calibration model, and the low-cost CO2 sensor needs to be calibrated again. The interval time between two calibrations is the best calibration interval period of the low-cost CO2 sensor.
[0004] In the process of implementing the embodiments of the present disclosure, it is found that there are at least the following problems in the related technology:
[0005] In the related technology, zero calibration requires setting the sensor in a self-developed calibration device, which is not applicable to sensors in a working state, that is, automatic calibration of the sensor cannot be achieved.
[0006] It should be noted that the information disclosed in the above background art section is only used to strengthen the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0007] To have a basic understanding of some aspects of the disclosed embodiments, a simple summary is given below. The summary is not a general review, nor is it intended to identify key / important elements or delineate the protection scope of these embodiments, but rather serves as a preface to the subsequent detailed description.
[0008] Embodiments of the present disclosure provide a zero - drift calibration method and device for a sensor, and a computer - readable storage medium, to achieve automatic calibration when the sensor is in an operating state.
[0009] In some embodiments, the method includes: obtaining environmental information data of a target sensor; wherein, the environmental information data includes gas concentration, environmental temperature and humidity, and light intensity; determining whether to perform zero - drift calibration on the target sensor according to the obtained environmental information data; and in the case of determining to perform zero - drift calibration on the target sensor, calculating a zero - drift reference value according to the real - time gas concentration of the target sensor to calibrate the measured value of the calibrated target sensor.
[0010] In some embodiments, the device includes: a processor and a memory storing program instructions, and the processor is configured to execute the zero - drift calibration method for a sensor as described above when running the program instructions.
[0011] In some embodiments, the computer - readable storage medium stores program instructions, and when the program instructions are running, they are used to cause a computer to execute the zero - drift calibration method for a sensor as described above.
[0012] The zero - drift calibration method and device for a sensor, and the computer - readable storage medium provided by the embodiments of the present disclosure can achieve the following technical effects:
[0013] Based on the environmental information data of the environment where the target sensor is located, determine whether to perform zero - drift calibration on the target sensor. Using the environmental information data as the basis for judging calibration can improve the credibility of calibration. When the credibility of the environmental information data is relatively high, perform zero - drift calibration based on the real - time gas concentration to ensure the accuracy of calibration. In this way, the sensor can achieve automatic calibration and ensure the accuracy of calibration.
[0014] The above general description and the following description are only exemplary and explanatory, and are not used to limit this application. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] One or more embodiments are exemplarily illustrated by corresponding drawings. These exemplary illustrations and the drawings do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements. The drawings do not constitute a proportional limitation, and among them:
[0016] Figure 1 is a schematic diagram of a zero - drift calibration method for a sensor provided by an embodiment of the present disclosure;
[0017] Figure 2 is a schematic diagram of determining whether to perform zero - drift calibration on a target sensor in the method provided by an embodiment of the present disclosure;
[0018] Figure 3 is a schematic diagram of another zero - point drift calibration method for a sensor provided by an embodiment of the present disclosure;
[0019] Figure 4 is a schematic diagram of another zero - point drift calibration method for a sensor provided by an embodiment of the present disclosure;
[0020] Figure 5 is a schematic diagram of another zero - point drift calibration method for a sensor provided by an embodiment of the present disclosure;
[0021] Figure 6 is a schematic diagram of a zero - point drift calibration device for a sensor provided by an embodiment of the present disclosure. Detailed implementation manners
[0022] In order to more thoroughly understand the features and technical content of the embodiments of the present disclosure, the implementation of the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. The attached drawings are for reference and illustration only and are not intended to limit the embodiments of the present disclosure. In the following technical description, for the sake of explanation, numerous details are provided to give a full understanding of the disclosed embodiments. However, one or more embodiments can still be implemented without these details. In other cases, well - known structures and devices may be shown in a simplified manner.
[0023] In the embodiments of the present disclosure, terms such as "first", "second", etc. in the specification, claims and the above - mentioned drawings are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so as to implement the embodiments of the present disclosure described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non - exclusive inclusion.
[0024] Unless otherwise specified, the term "plural" means two or more.
[0025] In the embodiments of the present disclosure, the character " / " indicates that the objects before and after are in an "or" relationship. For example, A / B means: A or B.
[0026] The term "and / or" is a description of the associated relationship of objects, indicating that there can be three relationships. For example, A and / or B means: A or B, or, the three relationships of A and B.
[0027] The term "correspond" can refer to an associated relationship or a binding relationship. A corresponding to B means that there is an associated relationship or a binding relationship between A and B.
[0028] Combined with Figure 1As shown in the figure, an embodiment of the present disclosure provides a zero - drift calibration method for a sensor, including:
[0029] S101, the controller obtains the environmental information data of the target sensor; wherein, the environmental information data includes gas concentration, ambient temperature and humidity, and light intensity.
[0030] S102, the controller determines whether to perform zero - drift calibration on the target sensor according to the obtained environmental information data.
[0031] S103, in the case of determining to perform zero - drift calibration on the target sensor, the controller calculates a zero - drift reference value according to the real - time gas concentration of the target sensor to calibrate the measured value of the calibrated target sensor.
[0032] In the embodiment of the present disclosure, the target sensor is mainly a gas sensor, and the gas sensor is installed in a gas pipeline to detect the gas concentration around the gas pipeline. Because the environment of the gas sensor in this scenario is relatively complex, when correcting the zero - drift amount based on a stable concentration, it is difficult to capture the ideal situation where there is no actual gas concentration during zero - drift, and it is impossible to distinguish the zero - drift amount from the actual gas concentration value, resulting in ineffective calibration.
[0033] Here, in order to achieve automatic calibration of the sensor zero - drift, the environmental information data of the environment where the target sensor is in the working state is obtained. The environmental information data includes gas concentration, ambient temperature, ambient humidity, and light intensity. Among them, the gas concentration is detected by the target sensor, the ambient temperature is obtained by a temperature sensor, the ambient humidity is obtained by a humidity sensor, and the light intensity is obtained by a light sensor.
[0034] Based on the obtained environmental information data, it is determined whether zero - drift calibration is required for the target sensor. It can be understood that the environment affects the diffusion of gas concentration, and whether the gas concentration diffusion is uniform affects the calibration accuracy. Therefore, compared with calibrating based solely on gas concentration, adding temperature, humidity, and light intensity in the environmental information data as the basis for judging whether the gas concentration is calibrated can improve the calibration accuracy. Specifically, an environmental algorithm model can be based on, that is, an environmental algorithm model is obtained by fitting the environmental information data, and it is judged whether zero - drift calibration is required for the target sensor based on the model. Or, the Pearson correlation coefficient can be calculated based on the obtained gas concentration (variable y) and ambient temperature, ambient humidity, and light intensity (variables x), and it is determined whether zero - drift calibration is required for the target sensor according to the magnitude of the Pearson correlation coefficient.
[0035] When it is determined that the credibility of the environmental information data is relatively high, zero-drift calibration is performed on the target sensor. Specifically, based on the real-time gas concentration of the target sensor, a zero-drift reference value is calculated. In detail, the real-time gas concentration is continuously collected, and after the number of samples reaches the requirement, the average value is calculated to obtain the zero-drift reference value. The measured value of the target sensor is calibrated using this zero-drift reference value.
[0036] By using the zero-drift calibration method for sensors provided in the embodiments of the present disclosure, it is determined whether to perform zero-drift calibration on the target sensor based on the environmental information data of the environment where the target sensor is located. Using the environmental information data as the basis for judging calibration can improve the credibility of calibration. When the credibility of the environmental data is relatively high, zero-drift calibration is performed based on the real-time gas concentration to ensure the accuracy of calibration. In this way, the sensor can achieve automatic calibration and ensure the accuracy of calibration.
[0037] Optionally, as shown in Figure 2 Step S102, the controller determines whether to perform zero-drift calibration on the target sensor according to the acquired environmental information data, including:
[0038] S121, the controller uses the acquired environmental information data to construct a weighted environmental algorithm model and iteratively updates the constructed model.
[0039] S122, when the credibility of the iteratively updated weighted environmental algorithm model meets the requirements, the controller uses the weighted environmental algorithm model to determine whether to perform zero-drift calibration on the target sensor.
[0040] Here, it is determined whether to perform zero-drift calibration on the target sensor using the weighted environmental algorithm model. Among them, the weighted environmental algorithm model is constructed using the acquired environmental information data. The weighted environmental algorithm model (hereinafter referred to as the model) is constructed by fitting the environmental information data to obtain an equation between the gas concentration and the environmental temperature, environmental humidity, and light intensity. After obtaining the constructed model, the acquired environmental information data is continuously used to iteratively update the model so that each parameter of the model reaches the optimal value. Among them, the environmental information data is continuously sampled. It can be understood that as time goes by, the more data input into the model, which enables the model to fully capture the characteristics and laws between the data to improve the accuracy of the model.
[0041] During the model iteration and update process, if the credibility of the weighted environment algorithm model meets the requirements, it indicates that the performance of the weighted environment model is relatively good. In this case, the weighted environment algorithm model can be used to measure the possibility of zero-point drift to determine whether to perform zero-point calibration on the target sensor. For example, when the model credibility is high, if the result output by the model deviates greatly from the actual detected gas concentration value, it is determined that zero-point drift calibration is required for the target sensor. In this way, the weighted environment algorithm model is constructed and iteratively updated through the environmental information data of the environment where the target sensor is located. Using this mode to achieve automatic judgment and calibration of zero-point drift calibration helps to improve the effectiveness of calibration.
[0042] In addition, determining zero-point drift calibration for the target sensor includes determining the data for zero-point drift calibration and the corresponding calibration time period. To better determine the data basis and calibration time period for zero-point drift calibration, the sampled environmental information data is divided according to a period. The possibility of drift of the environmental information data in each period is judged, and when drift occurs and within the most suitable period, that is, the calibration time period, the sensor is calibrated using the real-time gas concentration. In this way, it is avoided that calibration at a time when the possibility of zero-point drift is low will reduce the calibration accuracy. As an example, the environmental information data is divided into periods in hours, such as every three hours as a sampling period. Then there are 8 sampling periods in a day. Determine which time period in a day has the highest probability of zero-point drift, use this time period with the highest probability as the calibration time period, and use the real-time gas concentration collected within this calibration time period as the data basis for calibration.
[0043] Optionally, when the number of iterations of the weighted environment algorithm model reaches a preset number, the controller determines that the credibility of the weighted environment algorithm model meets the requirements. The preset number can be set based on requirements, such as taking values of 8 times, 10 times, etc. In addition, after the credibility of the weighted algorithm model meets the requirements, the weighted algorithm model can be iteratively updated regularly or irregularly to ensure the reliability of the model.
[0044] Optionally, in step S121, the controller constructs a weighted environment algorithm model using the acquired environmental information data, including:
[0045] Based on the gas concentration, environmental temperature, environmental humidity, and light intensity, the controller establishes a multiple non-linear regression equation to construct the weighted environment algorithm model.
[0046] The controller uses the sum of squared residuals to fit the parameters of the weighted environment algorithm model to obtain the optimal parameters.
[0047] Here, using the environmental information data, a multiple non-linear regression equation is established to construct a regression model (where the regression model serves as a weighted environmental algorithm model). Taking the gas concentration as the dependent variable y, and the environmental temperature, environmental humidity, and light intensity as independent variables x, the obtained environmental information data is (y1, x t1 , x h1 , x l1 ), (y2, x t2 , x h2 , x l2 )... (y n , x tn , x hn , x ln ). Then the multiple non-linear regression equation is:
[0048]
[0049] Among them, y is the gas concentration, x t is the environmental temperature, x h is the environmental humidity, x l is the light intensity, and α0, α1, α2, β1, β2, λ1, λ2 are parameters.
[0050] Based on the above equation, a regression model is constructed to obtain a weighted environmental algorithm model. The parameters are calculated using the principle of the minimum sum of squared residuals to make the fitting effect of the data optimal, so as to obtain the optimal parameters. Among them, the sum of squared residuals Sr is:
[0051]
[0052] Repeat this process until the performance of the data iterative update model reaches the best. Thus, the credibility and effectiveness of zero drift calibration are determined using this model.
[0053] Optionally, in step S122, the controller uses the weighted environmental algorithm model to determine whether to perform zero drift calibration on the target sensor, including:
[0054] The controller takes the partial derivative of the weighted environmental algorithm model to obtain a fluctuation model.
[0055] In the case where the difference between the output value and the expected value of the fluctuation model exceeds the preset range, the controller determines to perform zero drift calibration on the target sensor.
[0056] Here, a fluctuation model is obtained by taking the partial derivative according to the weighted environment algorithm model, and the possibility of zero-point drift is measured by the fluctuation model. The input data of the weighted environment algorithm model is the environmental data information collected in real time, and the input data is data that changes over time. Therefore, the output of the fluctuation model is also time-related. Specifically, by comparing the difference between the output value of the fluctuation model and the expected value, if the difference exceeds the preset range, it indicates that the output value deviates from the expected value. At this time, it is determined that zero-point drift has occurred, and it is determined to perform zero-point drift calibration on the target sensor. Compared with comparing the actual output value of the weighted environment algorithm model and the collected gas concentration, the fluctuation model can more quickly reflect the change of the gas concentration.
[0057] Combined with Figure 3 As shown, the embodiment of the present disclosure provides another zero-point drift calibration method for a sensor, including:
[0058] S101, the controller obtains the environmental information data of the target sensor; wherein, the environmental information data includes gas concentration, environmental temperature and humidity, and light intensity.
[0059] S121, the controller uses the obtained environmental information data to construct a weighted environment algorithm model and iteratively updates the constructed model.
[0060] S122, when the credibility of the iteratively updated weighted environment algorithm model meets the requirements, the controller uses the weighted environment algorithm model to determine whether to perform zero-point drift calibration on the target sensor.
[0061] S123, when the credibility of the iteratively updated weighted environment algorithm model does not meet the requirements, the controller obtains the Pearson coefficient by using the obtained environmental data information.
[0062] S124, the controller determines whether to perform zero-point drift calibration on the target sensor according to the Pearson coefficient.
[0063] S103, when it is determined to perform zero-point drift calibration on the target sensor, the controller calculates a zero-point drift reference value according to the real-time gas concentration of the target sensor to calibrate the measured value of the calibration target sensor.
[0064] Here, when the credibility of the weighted environment algorithm model does not meet the requirements, if the weighted environment algorithm model is used to judge zero-point drift calibration, the credibility of the obtained zero-point drift calibration is relatively low. Furthermore, it is very likely that this calibration is invalid. Therefore, in this case, the Pearson coefficient is calculated by using the obtained environmental data information. Among them, the gas concentration in the environmental data information is a variable y, and the environmental temperature, environmental humidity and light intensity are another variable x. Then the Pearson coefficient r is:
[0065]
[0066] where n is the number of times of the collected environmental information data, and x i , y i are respectively the i-th sampling values of variable x and variable y, are respectively the average values of variable x and variable y.
[0067] Based on the calculated Pearson coefficient, it is determined whether to perform zero-drift calibration on the target sensor. Specifically, if the Pearson coefficient is large, it indicates that the correlation of the environmental information data is higher and the data credibility is high, so it is determined to perform zero-drift calibration on the target sensor. If the Pearson coefficient is small, it indicates that the correlation of the environmental information data is low and the data credibility is relatively low, so zero-drift calibration is not performed on the target sensor. In this way, before the weighted environment algorithm model reaches better performance, the Pearson coefficient is used to determine whether to perform zero-drift calibration on the target sensor.
[0068] Optionally, when the zero-drift calibration determined by the iteratively updated weighted environment algorithm model is consistent with the zero-drift calibration determined based on the Pearson coefficient, the controller determines that the credibility of the weighted environment algorithm model meets the requirements.
[0069] Here, during the iterative update process of the weighted environment algorithm model, if the data of the zero-drift calibration determined by the model and the corresponding calibration time period are consistent, it indicates that the credibility of the model meets the requirements. At this time, the calibration can be determined based on the model. As an example, the weighted environment algorithm model determines that the data credibility of the time period from 6:00 to 8:00 on November 30 is high, and the Pearson coefficient of the data of the time period from 6:00 to 8:00 on November 30 indicates high data credibility. Then the credibility of the model meets the requirements.
[0070] Optionally, in step S124, the controller determines whether to perform zero-drift calibration on the target sensor according to the Pearson coefficient, including:
[0071] When the Pearson coefficient is greater than a preset threshold, the controller determines to perform zero-drift calibration on the target sensor. Or, when the Pearson coefficient is less than or equal to the preset threshold, the controller determines not to perform zero-drift calibration on the target sensor.
[0072] Here, the value range of the preset threshold is [0.7, 0.9]. When the calculated Pearson coefficient is greater than this preset threshold, zero-drift calibration will be performed. Thus, the effectiveness of the calibration is ensured.
[0073] Combined with Figure 4 as shown, another zero-drift calibration method for a sensor provided by an embodiment of the present disclosure includes:
[0074] S101, the controller obtains the environmental information data of the target sensor; among them, the environmental information data includes gas concentration, environmental temperature and humidity, and light intensity.
[0075] S102, the controller determines whether to perform zero-drift calibration on the target sensor according to the obtained environmental information data.
[0076] S131, in the case of determining to perform zero-drift calibration on the target sensor, the controller recursively calculates the average value of multiple sample means; each sample includes the real-time gas concentration of consecutive multiple samplings, and the sampling data of each sample is stable.
[0077] S132, the controller uses the recursively calculated average value as the zero-drift reference value to calibrate the measured value of the calibrated target sensor.
[0078] Here, after determining to perform zero-drift calibration on the target sensor based on the environmental information data, the real-time gas concentration is obtained by continuous sampling, and the sample data composed of multiple sampling data is recursively calculated. Calculate the average value of multiple sample means, and the sampling data of each sample for calculating the average value is stable. Among them, when the data of each sampling sample is stable, the obtained zero-drift reference value is accurate. Therefore, before recursive calculation, first determine whether the data of the sampling sample is stable. If the data is unstable, discard the corresponding sample and do not perform recursive calculation on this sample. In this way, after recursive calculation multiple times, the zero-drift reference value is obtained.
[0079] As an example, each sample contains 120 sampling data, and the number of samples is 60. Then after the first sample is collected, first determine whether the data of the first sample is stable. If the data is stable, calculate the mean value of the first sample data. Sample again to obtain the second sample. In the case where the data of the second sample is stable, calculate the mean value of the second sample data. And calculate the average value of the two sample means, and so on, until the number of samples for calculating the average value reaches 60. The average value of the means of 60 sample data is the zero-drift reference value.
[0080] Optionally, whether each sample data is stable can be determined by the following method: calculate the average value of each sample data, and calculate the difference between each data in the sample and the average value; in the case where all the differences are within the preset range, determine that the data of this sample is stable.
[0081] Here, the average value of each sample data is obtained, and then the difference between each data in the sample and the average value is compared one by one. If all the differences are within the preset range, it indicates that the difference between each data and the average value is not significant, and the data of this sample is stable. If there is one / some data whose difference from the average value exceeds the preset range, it indicates that these data deviate seriously from the average value, and the data of this sample is unstable. In this way, samples are screened to obtain samples with stable data for calculating the zero-drift reference value.
[0082] Optionally, in step S132, the stability of the sampling data of each sample is determined in the following manner:
[0083] The controller calculates the variance of the sampling data of each sample.
[0084] When the variance is less than the variance threshold, the controller determines that the sampling data of the current sample is stable.
[0085] Here, by calculating the variance of each sample data, it is judged whether the sampling data of this sample is stable. Among them, the larger the variance, the higher the degree of data dispersion and the poorer the data stability. The smaller the variance, the lower the degree of data dispersion and the more stable the data. Compared with comparing the size of data and sample mean one by one, variance calculation is more convenient and can also characterize whether the data is stable.
[0086] Optionally, in step S131, the number of samples is determined based on the sampling frequency of the sensor and the determined zero-drift calibration time period.
[0087] Previously, when determining whether to perform zero-drift calibration on the target sensor, it was determined periodically. As an example, the cycle duration is 2 hours, so there are 12 cycles per day. The environmental information data within two hours is collected in each cycle, and the weighted environment algorithm model or Pearson coefficient is used for judgment to determine the data credibility of this cycle. That is, it is determined whether to perform zero-drift calibration on the target sensor. If it is determined to calibrate, calibration will be performed when the corresponding time period of this cycle comes again. For example, when the current time period is 10:00 - 12:00 and the data of this cycle indicates that the target sensor needs to be calibrated, real-time gas concentration will be collected for calibration at the next 10:00 - 12:00.
[0088] After determining the zero-drift calibration period, the number of samples is determined based on the sampling period and sampling frequency. As an example, the sampling data volume of each sample is 80 to 150. Here, it is assumed that the sampling data volume of each sample is 120, the sampling frequency of the sensor is 1 Hz, and the calibration period is from 10:00 to 12:00. Then the sampling duration required for each sample is 2 minutes, and 60 samples are generated during this calibration period. In this way, when performing recursive calculation, the average value of the means of 60 samples is calculated to obtain the zero-drift reference value. Thus, frequent calibration is prevented and the influence of the environment on the gas concentration can be eliminated (the settings of the sampling period and sampling frequency help the gas to diffuse in the environmental space, avoiding errors caused by uneven gas concentration).
[0089] In addition, it should be noted that the zero-drift calibration period is not fixed and is determined based on historical data. For example, based on the sampling data of the previous day, the time period with the highest credibility is determined as the calibration period.
[0090] Combined with Figure 5 As shown, an embodiment of the present disclosure provides another zero-drift calibration method for a sensor, including:
[0091] S101, the controller obtains the environmental information data of the target sensor; wherein, the environmental information data includes gas concentration, environmental temperature and humidity, and light intensity.
[0092] S102, the controller determines whether to perform zero-drift calibration on the target sensor according to the obtained environmental information data.
[0093] S131, in the case of determining to perform zero-drift calibration on the target sensor, the controller recursively calculates the average value of multiple sample means; each sample includes the real-time gas concentration of continuous multiple samplings, and the sampling data of each sample is stable.
[0094] S132, the controller takes the average value calculated recursively as the zero-drift reference value.
[0095] S133, the controller calculates the difference between the measured value and the zero-drift reference value, and takes the difference as the actual measured value after calibration of the target sensor.
[0096] Here, after obtaining the zero-drift reference value, the measured value of the target sensor is calibrated based on the zero-drift reference value. That is, the difference between the measured quantity and the zero-drift reference value is calculated, and the difference is taken as the actual measured value after calibration. In this way, the drift generated by the target sensor is eliminated, and the detection accuracy is improved.
[0097] Combined with Figure 6As shown in the figure, an embodiment of the present disclosure provides a zero - drift calibration device 100 for a sensor, which includes a processor 101 and a memory 102. Optionally, the device may further include a communication interface 103 and a bus 104. Among them, the processor 101, the communication interface 103, and the memory 102 can complete mutual communication through the bus 104. The communication interface 103 can be used for information transmission. The processor 101 can call the logical instructions in the memory 102 to execute the zero - drift calibration method for the sensor in the above - mentioned embodiment.
[0098] In addition, when the logical instructions in the above - mentioned memory 102 are implemented in the form of a software functional unit and sold or used as an independent product, they can be stored in a computer - readable storage medium.
[0099] The memory 102, as a computer - readable storage medium, can be used to store software programs and computer - executable programs, such as the program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 101 executes functional applications and data processing by running the program instructions / modules stored in the memory 102, that is, implements the zero - drift calibration method for the sensor in the above - mentioned embodiment.
[0100] The memory 102 may include a program - storage area and a data - storage area. Among them, the program - storage area can store an operating system and application programs required for at least one function; the data - storage area can store data created according to the use of the terminal device, etc. In addition, the memory 102 may include a high - speed random - access memory and may also include a non - volatile memory.
[0101] An embodiment of the present disclosure provides a natural - gas detection system, which includes: a sensor for detecting the gas concentration in the environment where the gas pipeline is located; a controller connected to the sensor for receiving the sampling data of the sensor; and the above - mentioned zero - drift calibration device 100 for the sensor. The zero - drift calibration device 100 for the sensor is installed in the controller and is used to calibrate the zero - drift of the sensor. The installation relationship described here is not limited to being placed inside the controller, but also includes installation connections with other components of the controller, including but not limited to physical connections, electrical connections, or signal - transmission connections, etc. Those skilled in the art can understand that the zero - drift calibration device 100 for the sensor can be adapted to a feasible product body, and then other feasible embodiments can be realized.
[0102] An embodiment of the present disclosure provides a computer - readable storage medium storing computer - executable instructions, and the computer - executable instructions are set to execute the above - mentioned zero - drift calibration method for the sensor.
[0103] The technical solutions of the embodiments of the present disclosure may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present disclosure. The aforementioned storage medium may be a non-transitory storage medium, such as: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc., which are various media that can store program codes.
[0104] The above description and the drawings fully illustrate the embodiments of the present disclosure, enabling those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, process, and other changes. The embodiments only represent possible variations. Unless explicitly required, the individual components and functions are optional, and the order of operations may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terms used in this application are only for describing the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to also include the plural forms. Similarly, as used in this application, the term "and / or" refers to any and all possible combinations including one or more of the associated listed items. Additionally, when used in this application, the term "comprise" and its variants "comprises" and / or "comprising" etc. mean the presence of the stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or groups of these. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, or device comprising the element. In this document, each embodiment may focus on the differences from other embodiments, and the same or similar parts among the embodiments may be referred to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method parts disclosed in the embodiments, the relevant parts may refer to the description of the method parts.
[0105] Those skilled in the art will appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software can depend on the specific application and design constraints of the technical solution. The skilled person can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the embodiments of the present disclosure. The skilled person can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0106] In the embodiments disclosed herein, the disclosed methods, products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units can be merely a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Additionally, the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to implement this embodiment. Additionally, in the embodiments of the present disclosure, the various functional units can be integrated in one processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit.
[0107] 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 the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of code, or a portion thereof that contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two consecutive blocks may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending upon the functionality involved. In the description corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur out of the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending upon the functionality involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A zero-drift calibration method for a sensor, characterized in that, Including: Obtain the environmental information data of the target sensor; wherein, the environmental information data includes gas concentration, environmental temperature and humidity, and light intensity; Determine whether to perform zero-drift calibration on the target sensor according to the obtained environmental information data; In the case of determining to perform zero-drift calibration on the target sensor, calculate the zero-drift reference value according to the real-time gas concentration of the target sensor, so as to calibrate the measured value of the calibrated target sensor.
2. The method according to claim 1, characterized in that, Determine whether to perform zero-drift calibration on the target sensor according to the obtained environmental information data, including: Use the obtained environmental information data to construct a weighted environmental algorithm model, and iteratively update the constructed model; In the case where the credibility of the iteratively updated weighted environmental algorithm model meets the requirements, use the weighted environmental algorithm model to determine whether to perform zero-drift calibration on the target sensor.
3. The method according to claim 2, wherein Use the obtained environmental information data to construct a weighted environmental algorithm model, including: Based on gas concentration, environmental temperature, environmental humidity and light intensity, establish a multiple nonlinear regression equation to construct a weighted environmental algorithm model; Use the sum of squared residuals to fit the parameters of the weighted environmental algorithm model to obtain the optimal parameters.
4. The method according to claim 2, wherein Use the weighted environmental algorithm model to determine whether to perform zero-drift calibration on the target sensor, including: Take the partial derivative of the weighted environmental algorithm model to obtain a fluctuation model; In the case where the difference between the output value and the expected value of the fluctuation model exceeds the preset range, determine to perform zero-drift calibration on the target sensor.
5. The method according to claim 2, wherein Determine whether to perform zero-drift calibration on the target sensor according to the collected environmental information data, and further include: In the case where the credibility of the iteratively updated weighted environmental algorithm model does not meet the requirements, obtain the Pearson coefficient by using the obtained environmental data information; Determine whether to perform zero-drift calibration on the target sensor according to the Pearson coefficient.
6. The method according to any one of claims 1 to 5, characterized in that Calculate the zero-drift reference value according to the real-time gas concentration of the target sensor, including: Recursively calculate the average value of multiple sample means; each sample includes the real-time gas concentration of continuous multiple samplings, and the sampling data of each sample is stable; Take the recursively calculated average value as the zero-drift reference value.
7. The method according to claim 6, wherein The sampling data of each sample is determined to be stable in the following way: Calculate the variance of the sampling data of each sample; In the case where the variance is less than the variance threshold, determine that the sampling data of the current sample is stable.
8. The method according to any one of claims 1 to 5, characterized in that, Calibrate the measured value of the calibrated target sensor, including: Calculate the difference between the measured value and the zero-drift reference value, and take the difference as the actual measured value after calibration of the target sensor.
9. A zero-drift calibration device for a sensor, comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to execute the zero-drift calibration method for the sensor according to any one of claims 1 to 8 when running the program instructions.
10. A computer-readable storage medium storing program instructions, characterized in that, When running, the program instructions are used to cause the computer to execute the zero-drift calibration method for the sensor according to any one of claims 1 to 8.
Citation Information
Cited By
Gas concentration correction method, gas detection equipment and computer readable storage medium
CN120778980A
Drifting data processing method and system for electronic scale and storage medium
CN120970790A
Zero-point self-adaptive calibration method, device and equipment for refrigerant gas sensor
CN121141955A
Zero-point self-adapting calibration method, device and equipment for refrigerant gas sensor
CN121141955B
Gas detection device calibration method, system and equipment and storage medium
CN121431761A