Compensation correction method and system for gas concentration infrared sensor
By constructing a time-series network graph and using a dynamic programming algorithm, the problem of misjudgment caused by light intensity attenuation due to gas residue was solved, enabling the sensor to perform high-precision and stable measurements under harsh conditions and updating the reference light intensity to eliminate negative concentration output.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING LONGZHIYUAN TECH DEV CO LTD
- Filing Date
- 2026-05-11
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, light intensity attenuation caused by long-term gas residue is misjudged as hardware aging, leading to baseline miscalibration and negative concentration measurement errors, which affect the long-term measurement accuracy and stability of the sensor.
By constructing a time-series network graph, the differences in light intensity distribution patterns and daily average deviations of candidate baseline values are calculated. Node penalty weights and constraint weights are generated, and a dynamic programming algorithm is used to find the connected path with the minimum cumulative cost. The baseline light intensity is then updated, and the gas concentration value is calculated by inversion.
It effectively eliminates interference from residual gas, avoids misjudging light intensity reduction as hardware aging, improves the measurement accuracy and stability of the sensor under harsh operating conditions, and ensures accuracy during long-term operation.
Smart Images

Figure CN122171480A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gas concentration detection and sensor calibration technology, specifically to a compensation and calibration method and system for a gas concentration infrared sensor. Background Technology
[0002] Gas concentration sensors based on non-dispersive infrared technology can measure gas concentration by the degree of absorption and attenuation of infrared light at a specific wavelength. During long-term operation of the sensor, aging of the infrared emitting element can cause baseline drift in the transmitted light intensity, requiring compensation and correction.
[0003] In existing technologies, conventional automatic baseline calibration algorithms update the benchmark by extracting the highest value from historical transmitted light intensity to compensate for drift caused by aging. However, in real-world operating scenarios, especially in enclosed or poorly ventilated environments, gases may remain for extended periods and continue to absorb infrared light, resulting in persistently low transmitted light intensity. Therefore, updating the baseline solely based on the highest light intensity value can misinterpret low light intensity caused by gas residue as hardware aging, leading to an erroneous downward adjustment of the benchmark light intensity. Ultimately, this results in severe negative concentration measurement errors after the gas dissipates, impacting the long-term measurement accuracy and stability of the sensor. Summary of the Invention
[0004] To address the technical problem that conventional baseline calibration algorithms often misinterpret light intensity attenuation caused by gas residue as hardware aging under harsh operating conditions with long-term gas residue, leading to baseline miscalibration and subsequent errors in negative concentration measurement, the present invention aims to provide a compensation and correction method and system for a gas concentration infrared sensor. The specific technical solution adopted is as follows: This invention proposes a compensation and calibration method for a gas concentration infrared sensor, the method comprising: The transmitted light intensity is continuously collected by the infrared sensor during operation; daily candidate baseline values are extracted from the historical data of the transmitted light intensity, and a network graph containing candidate baseline values for multiple consecutive days is constructed. Based on the time point corresponding to the candidate baseline value, a preset number of transmitted light intensities are extracted from historical data to generate a local measured light intensity array. After zero-mean processing is performed on the array and the factory-calibrated light intensity array, the difference value of light intensity distribution pattern is calculated. According to the deviation of the difference value of light intensity distribution pattern from the candidate baseline value from the daily average value of transmitted light intensity, the node penalty weight is calculated. The degree of jump in candidate baseline values between adjacent days in the network graph is evaluated, and constraint weights are assigned to the connections between adjacent nodes. Based on the node penalty weights and constraint weights, an accumulated cost is generated. The value of the endpoint of the connected path with the minimum accumulated cost is found in the network graph and used as the updated reference light intensity. Based on the real-time collected transmitted light intensity and the updated reference light intensity, the compensated gas concentration value is calculated by inversion.
[0005] Furthermore, the method for continuously acquiring transmitted light intensity includes: The original light intensity signal output by the infrared sensor and the ambient temperature signal of the sensor housing are collected simultaneously; the original light intensity signal is mapped and corrected according to the factory-preset temperature compensation curve and the ambient temperature signal to obtain the transmitted light intensity.
[0006] Furthermore, the method for obtaining the network graph includes: The daily timeline is divided into multiple time blocks of equal length according to a preset time interval. Within each time block, the maximum preset number of transmitted light intensities are extracted as candidate baseline values for each time block of that day. The currently effective reference light intensity is used as the starting point of the time series and linked with the candidate baseline values extracted over multiple consecutive days to form the network graph. The candidate baseline data of the previous day and the candidate baseline values of the next day are connected by a one-way line.
[0007] Furthermore, the method for obtaining the node penalty weight includes: For each candidate baseline value in the network graph, the difference between the candidate baseline value and the average transmitted light intensity of the corresponding date is calculated to obtain the daily average deviation. Based on the time point corresponding to the candidate baseline value, within the historical evaluation time window starting from that time point, a preset number of transmitted light intensities are extracted at equal time intervals to generate a local measured light intensity array. After the local measured light intensity array and the factory-calibrated light intensity array are respectively zero-mean processed, the difference value of light intensity distribution pattern is calculated. Using the difference in light intensity distribution as the numerator and the sum of the daily average deviation and the preset noise constant as the denominator, the node penalty weight corresponding to the candidate baseline value is calculated.
[0008] Furthermore, the method for obtaining the constraint weights for assigning connections between adjacent nodes includes: For any given day, the candidate baseline value for a time block corresponds to a node in the network graph; The difference value is calculated by subtracting the candidate baseline values of different time blocks of the previous day from the candidate baseline values of different time blocks of the next day. The corresponding constraint weights between adjacent nodes are then assigned based on whether the difference value exceeds the jump range defined by the preset maximum allowable attenuation constant and the maximum allowable noise drift lower limit.
[0009] Further, the step of allocating corresponding constraint weights based on whether the difference value exceeds the jump range defined by the preset maximum allowable attenuation constant and the minimum allowable noise drift limit includes: If the difference value is less than the lower limit of the maximum allowable noise drift, then a maximum penalty value is assigned as a constraint weight to the corresponding connection. If the difference value is greater than the maximum allowable attenuation constant, then a positive penalty value calculated based on the excess of the difference value is assigned as a constraint weight to the corresponding connection. If the difference value is greater than or equal to the lower limit of the maximum allowable noise drift and less than or equal to the maximum allowable attenuation constant, then zero values are assigned as constraint weights to the corresponding connection.
[0010] Furthermore, the method for finding the connected path with the minimum cumulative cost includes: Using a dynamic programming algorithm, starting from the temporal starting point of the network graph, the penalty weight and constraint weight of the node reaching each candidate baseline value are accumulated day by day to calculate the accumulated cost. At the end of the evaluation window, the node with the minimum accumulated cost is selected, and the connected path formed by the node corresponding to the minimum accumulated cost is determined by backtracking.
[0011] Furthermore, after the method for finding the connected path with the minimum cumulative cost, the method further includes: determining whether the cumulative cost to reach the destination exceeds a preset global tolerance cost threshold; if it does not exceed the threshold, then performing an update operation; if it exceeds the threshold, then abandoning the update and maintaining the original reference light intensity unchanged.
[0012] Furthermore, the inversion calculation yields the compensated gas concentration value, including: When the real-time acquired transmitted light intensity is less than the updated reference light intensity, the transmitted light intensity and the updated reference light intensity are substituted into the concentration inversion formula to obtain the compensated gas concentration value; when the real-time acquired transmitted light intensity is greater than or equal to the updated reference light intensity, the gas concentration value is output as zero.
[0013] The present invention also proposes a compensation and correction system for a gas concentration infrared sensor, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of any one of the compensation and correction methods for a gas concentration infrared sensor.
[0014] The present invention has the following beneficial effects: This invention extracts daily transmitted light intensity data into discrete candidate baseline values and constructs a time-series network graph during sensor operation. Gas residue interference is quantified by calculating the difference in light intensity distribution patterns corresponding to the candidate baseline values and the deviation from the daily average. Simultaneously, the degree of jumps between nodes is evaluated based on the physical law of unidirectional attenuation of infrared emitting elements. Node penalty weights and constraint weights are used to assign weights to the network graph, and a global optimization algorithm extracts the connected path with the minimum cumulative cost. Finally, the value at the endpoint of this connected path is synchronized as the updated reference light intensity for inversion calculation, effectively eliminating interference from long-term gas residues in the concentration measurement process. The correction results avoid misjudging light intensity decreases caused by high-concentration gas obstruction as hardware aging, thereby eliminating baseline miscalibration and the resulting negative concentration output problem, and improving the long-term measurement accuracy and stability of the sensor under harsh operating conditions. Attached Figure Description
[0015] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 A flowchart illustrating a compensation and calibration method for a gas concentration infrared sensor, provided in one embodiment of the present invention; Figure 2 This is a flowchart illustrating a method for obtaining node penalty weights according to an embodiment of the present invention. Detailed Implementation
[0017] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a compensation and correction method and system for a gas concentration infrared sensor proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0019] The following description, in conjunction with the accompanying drawings, details the specific scheme of the compensation and calibration method and system for a gas concentration infrared sensor provided by the present invention.
[0020] This invention proposes a compensation and calibration method for a gas concentration infrared sensor. Please refer to [link / reference]. Figure 1 The diagram illustrates a method flowchart for compensating and correcting a gas concentration infrared sensor according to an embodiment of the present invention. The method includes: Step S101: Obtain the transmitted light intensity continuously collected by the infrared sensor during operation; extract the daily candidate baseline values from the historical data of the transmitted light intensity, and construct a network graph containing candidate baseline values for multiple consecutive days.
[0021] During sensor operation, the system continuously acquires and processes signals to obtain transmitted light intensity after eliminating the physical effects of temperature fluctuations. Subsequently, candidate baseline values are selected from the accumulated historical transmitted light intensities on a daily basis. Finally, these candidate baseline values from multiple consecutive days are organized into a time-series network graph structure, providing a basic framework for subsequent evaluation and correction. Each candidate baseline value corresponds to a node in the time-series network graph structure.
[0022] Step S102: Based on the time point corresponding to the candidate baseline value, extract a preset number of transmitted light intensities from historical data to generate a local measured light intensity array, and perform zero-mean processing on the array and the factory-calibrated light intensity array respectively, and calculate the light intensity distribution pattern difference value; calculate the node penalty weight according to the daily average deviation of the light intensity distribution pattern difference value from the candidate baseline value from the daily average transmitted light intensity.
[0023] For candidate baseline values in the network graph, the system extracts a preset number of transmitted light intensities from historical data time periods to generate a local measured light intensity array. This means obtaining a preset number of historical transmitted light intensities adjacent to the transmitted light intensity at the current moment, and constructing the local measured light intensity array using the corresponding preset number of historical transmitted light intensities and the transmitted light intensity at the current moment. The local measured light intensity array and the factory-calibrated light intensity array are then both zero-mean processed. By comparing the two arrays, the interference degree of residual gas is quantified, and the difference value of light intensity distribution pattern is obtained. The daily average deviation of the candidate baseline value from the daily light intensity average is calculated to characterize the extent to which it deviates from the background of turbid gas on that day. Combining the light intensity distribution pattern difference value and the daily average deviation value, the system evaluates the extent to which a candidate baseline value both exhibits the distribution distortion unique to residual gas and avoids being significantly higher than the average light intensity level lowered by gas on that day. This embodiment of the invention combines the above-mentioned light intensity distribution pattern difference value and daily average deviation value to calculate the node penalty weight. The larger the node penalty weight value calculated in this way, the higher the possibility that the node corresponding to the candidate baseline value is affected by residual gas interference. In subsequent optimization, a greater penalty should be imposed to prevent it from being selected as the baseline.
[0024] Step S103: Evaluate the degree of jump in candidate baseline values between adjacent days in the network graph and assign constraint weights to the connections between adjacent nodes.
[0025] Infrared sensors exhibit an irreversible, unidirectional aging process during long-term operation. If a jump in candidate baseline values between adjacent days violates this objective physical law, it indicates that the jump is not caused by actual hardware aging, but rather by drastic fluctuations in gas concentration, momentary obstruction, or other interference factors, creating an illusion. By analyzing the candidate baseline values of the previous day and the following day, it can be determined whether the jump falls within a suitable range of hardware decay, thus allowing for the allocation of appropriate weights to adjacent nodes.
[0026] Step S104: Generate a cumulative cost based on the node penalty weight and the constraint weight, find the value of the endpoint of the connected path with the minimum cumulative cost in the network graph as the updated reference light intensity; calculate the compensated gas concentration value based on the real-time collected transmitted light intensity and the updated reference light intensity.
[0027] By combining the penalty weights and constraint weights of the nodes, the connected path with the minimum cumulative cost is determined through an optimization algorithm. The candidate baseline value corresponding to the end point of the path is used as the updated reference light intensity to represent the reference state that is least disturbed and best matches the actual aging state of the hardware within the historical data period used when constructing the network graph.
[0028] After obtaining the updated reference light intensity, the latest collected transmitted light intensity is compared with the updated reference light intensity to calculate the gas concentration value after compensation and correction, ensuring the accuracy and stability of the sensor readings during long-term operation.
[0029] After steps S101 to S104, this embodiment of the invention completes a full calibration closed loop from data preparation and feature extraction to final output. The process first continuously collects transmitted light intensity during operation. Then, by constructing a time-series network graph and calculating the node penalty weights to quantify the possibility of gas residue interference and the connection constraint weights to evaluate whether the hardware conforms to the unidirectional attenuation law, a basis for subsequent decisions is provided. Finally, through a global optimization algorithm, the connected path with the minimum cumulative cost combining node penalty weights and constraint weights is found, and the candidate baseline value corresponding to the endpoint of this path is used as the updated reference light intensity. Essentially, this process uses weights to select the reference path that best matches the actual aging state of the hardware and is least affected by gas residue interference from the candidate paths. Based on this updated reference light intensity, concentration inversion calculation is performed, forming a closed-loop self-consistent process. This enables the sensor to operate stably for a long time under harsh conditions lacking clean air, automatically avoids baseline miscalibration, completely eliminates the negative concentration output problem, and significantly improves the reliability and accuracy of the measurement.
[0030] Preferably, in some possible implementations of the embodiments of the present invention, the method for continuously acquiring transmitted light intensity includes: synchronously acquiring the original light intensity signal output by the infrared sensor and the ambient temperature signal of the sensor housing; mapping and correcting the original light intensity signal according to the factory-preset temperature compensation curve and the ambient temperature signal to obtain the transmitted light intensity, thereby providing a stable data foundation for subsequent algorithms.
[0031] In some specific implementations of this invention, the factory-preset temperature compensation curve is pre-stored in the sensor's non-volatile memory, and the core is the corresponding functional relationship between the temperature signal and the compensation coefficient. During the sensor factory calibration phase, multiple standard temperature points are selected within the full-range operating temperature of the controlled environment chamber, and the original light intensity signal corresponding to each temperature point is measured. At this time, the original light intensity signal is kept unchanged, and only the operating temperature is adjusted to obtain the original light intensity signal corresponding to each temperature point. That is, when obtaining the original light intensity signal corresponding to each temperature point, only the temperature is used as a variable, while other external environmental conditions remain unchanged. Using the reference light intensity of the factory-calibrated light intensity array as the numerator and the original light intensity signal of each temperature point as the denominator, the ratio is calculated, which is the compensation coefficient at the corresponding temperature, forming multiple sets of temperature-compensation coefficient sample points. Using the temperature signal as the independent variable and the compensation coefficient as the dependent variable, polynomial fitting or piecewise linear interpolation is performed on the multiple sets of temperature-compensation coefficient sample points to construct a continuous temperature-compensation coefficient function relationship, thereby solidifying the factory-preset temperature compensation curve for real-time use. The original light intensity signal is collected and the compensation coefficient at the current temperature is obtained by querying the temperature compensation curve. The compensation coefficient is then multiplied by the read original light intensity signal to finally calculate the mapped and corrected transmitted light intensity.
[0032] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the network graph includes: dividing the daily time axis into multiple time blocks of equal length according to a preset time interval; extracting a preset number of transmitted light intensities with the largest values in each time block as candidate baseline values for each time block of the day, for example, obtaining the maximum values from the 1st time block, the 7th time block, the 13th time block, and the 19th time block respectively as candidate baseline values; using the currently effective reference light intensity as the starting point of the time sequence, and linking it with the candidate baseline values extracted over multiple consecutive days to form the network graph; connecting all nodes corresponding to the candidate baseline values of the previous day with all nodes corresponding to the candidate baseline values of the next day through unidirectional connections to form a fully linked relationship.
[0033] In one specific implementation of this invention, the preset time interval is set to 1 hour.
[0034] In one specific implementation of this invention, the preset quantity is set to 4; wherein the preset quantity ranges from 3 to 5.
[0035] Preferably, in some implementations of this invention, the average value of a preset factory-calibrated light intensity array is calculated as the factory-calibrated reference light intensity; during the initial power-on initialization of the device, the factory-calibrated reference light intensity is forcibly used as the currently effective reference light intensity; the reference light intensity is continuously iteratively updated in subsequent steps. The currently effective reference light intensity is set as the unique root node of the time axis, and candidate baseline values extracted over multiple consecutive days are sequentially concatenated in memory to output a multi-day candidate baseline value network diagram arranged hierarchically from left to right along the time axis, serving as the underlying carrier for subsequent evaluation of gas interference and hardware attenuation weights.
[0036] Preferably, in a specific implementation of the present invention, the method for obtaining the factory calibration light intensity array includes: in the factory calibration process, acquiring K transmitted light intensity values at a fixed sampling frequency under a pure reference gas; performing an ascending sorting operation from smallest to largest on these transmitted light intensity values to obtain the factory calibration light intensity array; wherein, the number of data points K of the factory calibration light intensity array is set to 256.
[0037] In one specific implementation of this invention, the pure reference gas is set as nitrogen; wherein, nitrogen, under infrared conditions, has an inherent physical property that its characteristic absorption cross section is 0, and therefore does not interfere with the subsequent calculation of gas concentration values.
[0038] Preferably, in some implementations of the embodiments of the present invention, the method for obtaining the node penalty weight is described in [reference needed]. Figure 2 The diagram illustrates a flowchart of a method for obtaining node penalty weights according to an embodiment of the present invention. The method includes: Step S201: For each candidate baseline value in the network graph, calculate the difference between the candidate baseline value and the average transmitted light intensity of its corresponding date to obtain the daily average deviation.
[0039] High concentrations of residual gases can cause an overall decrease in light intensity throughout the day. The absolute value of the difference between the candidate baseline value and the average light intensity of the corresponding date, i.e., the daily average deviation, can characterize the degree to which the candidate baseline value deviates from the turbid background of the day, serving as an important basis for assessing the degree of gas interference.
[0040] Step S202: Based on the time point corresponding to the candidate baseline value, within the historical evaluation time window starting from that time point, a preset number of transmitted light intensities are extracted at equal time intervals to generate a local measured light intensity array. After the local measured light intensity array and the factory-calibrated light intensity array are respectively zero-mean processed, the difference value of light intensity distribution pattern is calculated.
[0041] Even slight fluctuations in gas concentration can cause asymmetric distortion in the probability distribution of transmitted light intensity. To accurately extract this morphological distortion caused by gas residue, before comparing factory data with measured data, the locally measured light intensity array and the factory-calibrated light intensity array must be zero-mean processed to eliminate the mean deviation caused by the overall decrease in light intensity due to hardware aging, thus reflecting the differences in distribution morphology.
[0042] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the difference value of light intensity distribution pattern specifically includes: for the time point corresponding to the candidate baseline value, within the evaluation time window that traces back in the historical direction with the time point as the endpoint, uniformly extracting K temperature-normalized transmitted light intensity values at equal time intervals to generate a local measured light intensity array; wherein, when extracting the local measured light intensity array, its sampling frequency must be consistent with the sampling frequency of the factory-calibrated light intensity array, and K is strictly consistent with the factory-calibrated quantity.
[0043] Next, the arithmetic mean of the locally measured light intensity array and the factory-calibrated light intensity array are calculated respectively. Then, the locally measured light intensity array is zero-mean processed; each element in the locally measured light intensity array is subtracted from its corresponding arithmetic mean to obtain a zero-mean measured array. The same zero-mean processing is performed on the factory-calibrated light intensity array, subtracting its corresponding arithmetic mean from each element to obtain a zero-mean factory-calibrated array. After zero-mean alignment, the morphological differences between the zero-mean measured array and the zero-mean factory-calibrated array are analyzed to determine the light intensity distribution morphological difference.
[0044] In one embodiment of the present invention, the formula for the difference value of light intensity distribution morphology is expressed as: .in, This represents the first element in the measured array after zero-mean normalization. One element; This indicates the first element in the zero-mean factory output array. One element; It represents the absolute value of the local compensation value between the measured distribution pattern and the factory-exposed pure symmetrical distribution pattern at the same sorting position; Indicates that the system is from to Calculate the absolute value of each of the above steps and continuously accumulate them into a register. When the upper limit is reached... At the end, the system extracts the final sum value from the accumulator register and defines it as the difference value of light intensity distribution morphology. .
[0045] Step S203: Using the difference value of light intensity distribution pattern as the numerator and the sum of the daily average deviation and the preset noise constant as the denominator, calculate the node penalty weight corresponding to the candidate baseline value.
[0046] The node penalty weight is used to quantify the degree to which candidate baseline values are affected by residual gas. The larger the value, the higher the probability that the node corresponding to the candidate baseline value is blocked by gas. In the subsequent global optimization algorithm, it should be penalized more to avoid it being wrongly selected as the reference light intensity that reflects the actual aging state of the hardware.
[0047] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the node penalty weight includes: for the same candidate baseline value, using the sum of the daily average deviation and the preset noise constant as the denominator, the difference value of light intensity distribution pattern as the numerator, and the corresponding ratio as the node penalty weight corresponding to the candidate baseline value.
[0048] As a preferred embodiment of the present invention, node penalty weight The calculation formula is expressed as: .in, This represents the difference in the distribution pattern of light intensity; Indicates the deviation of the daily average; This represents a preset noise constant, which is always greater than 0; This indicates the preset scaling factor.
[0049] In the formula for calculating node penalty weights, a larger difference in light intensity distribution reflects stronger nonlinear gas absorption interference; a smaller daily average deviation reflects that the node corresponding to the candidate baseline value is less likely to escape the high-concentration gas background throughout the day; a larger daily average deviation reflects that the candidate baseline value is more significantly separated from the turbid background throughout the day, indicating that the node corresponding to the candidate baseline is less affected by residual gas interference and better represents the true aging state of the hardware. The preset noise constant represents the normal white noise fluctuation amplitude of the hardware; The result is multiplied by a preset scaling factor to scale the final node penalty weight to a safe range that prevents overflow of microprocessor integer or floating-point numbers.
[0050] In one implementation of this invention, a preset noise constant is used. The setting is 30 quantization units; The specific value is determined based on the resolution of the sensor's analog-to-digital converter (ADC). For example, for a 16-bit ADC system, The preferred value range is 10 to 50 quantization units. Implementers need to adapt the value based on the specific hardware requirements.
[0051] It should be noted that the quantization unit refers to the smallest scale (ADCCount) of the digital quantity output by the analog-to-digital converter. In this embodiment of the invention, the quantization unit represents the original digital base obtained after the analog electrical signal output by the sensor is sampled by the ADC. For example, if the sensor uses a 16-bit ADC with an output range of 0 to 65535, and the current transmitted light intensity signal is sampled by the hardware as a value of 40000, then 40000 is the specific value scaled in quantization units. Setting the noise constant to 30 quantization units means that the integer reading of the underlying ADC fluctuates by 30 units.
[0052] In one implementation of the present invention, the present invention will... The value is set to ;in, The value can be set to a constant between 1.0 and 10.0; here, the implementer needs to make an adaptive value based on the specific hardware.
[0053] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the constraint weights for connection allocation includes: for any day, the candidate baseline value of a time block corresponds to a node in the network graph; the candidate baseline values of different time blocks on the previous day are subtracted from the candidate baseline values of different time blocks on the next day to calculate the difference value, and the corresponding constraint weights are allocated according to whether the difference value exceeds the jump range defined by the preset maximum allowable attenuation constant and the lower limit of the maximum allowable noise drift; after the above comparison, the system can identify abnormal variables that violate hardware common sense or drastic drops that exceed the normal aging limit, and allocate corresponding constraint weights to the corresponding node connections to ensure that the subsequent optimization path conforms to the real hardware attenuation process.
[0054] Preferably, in some possible implementations of the embodiments of the present invention, the corresponding constraint weights are assigned based on whether the difference value exceeds the jump range defined by the preset maximum allowable attenuation constant and the minimum allowable noise drift limit, including: After obtaining the difference value of the adjacent daily baselines, the system retrieves the preset maximum allowable attenuation constant and the maximum allowable noise drift lower limit from the memory; If the difference value is less than the lower limit of the maximum allowable noise drift, it means that the light intensity of the next day is significantly brighter than that of the previous day, exceeding the normal tolerance limit of white noise. In order to completely prevent the subsequent optimization algorithm from selecting this fake attenuation trajectory, this embodiment of the invention will assign a maximum penalty value as a constraint weight to the corresponding connection. If the difference value is greater than the maximum allowable attenuation constant, it indicates that the light intensity on the following day is significantly lower than that on the previous day, exceeding the rate of natural aging of the semiconductor material. Subsequently, the maximum allowable attenuation constant is subtracted from the difference value to obtain the portion exceeding the reasonable limit, which is defined as the drop exceedance difference. The drop exceedance difference is multiplied by a preset multiplier coefficient to obtain a value that increases linearly with the drop magnitude, denoted as the constraint weight for baseline attenuation on adjacent days. Here, the preset multiplier coefficient is used to adjust the magnitude matching between the node penalty weight and the constraint penalty.
[0055] The purpose of allocating a maximum penalty value is to create a global path barrier. Hardware aging does not cause a sharp increase in light intensity. If a combination of nodes shows an increase in light intensity, it indicates that the preceding nodes are experiencing a false trough caused by gas pollution. The maximum penalty value forces dynamic programming to avoid the polluted node in advance during global calculation, ensuring that the path always conforms to the actual unidirectional decay curve of the hardware.
[0056] Preferably, in one specific implementation of the present invention, the preset multiplier is configured as 2.0. This preset multiplier is set by long-term observation of historical data. In other embodiments, the implementer may adjust the value according to the actual situation.
[0057] If the difference value is greater than or equal to the lower limit of the maximum allowable noise drift and less than or equal to the maximum allowable attenuation constant, it means that there is no abnormal brightening of the extreme value jump between two adjacent days and it is completely within the range allowed by the natural aging of the infrared sensor. Since the connection is completely in line with common sense, the system does not impose any penalty and assigns a zero value as a constraint weight to the corresponding connection.
[0058] Preferably, in a specific implementation of the present invention, the maximum allowable decay constant represents a reasonable upper limit of drop, which is set to 20 quantization units per day; wherein the value range is configured to be 10 to 30 quantization units per day, and the implementer needs to make adaptive values in combination with specific sensor hardware.
[0059] Preferably, in a specific implementation of the present invention, the maximum allowable noise drift lower limit characterizes the normal circuit drift amplitude and is set to -5 quantization units; wherein, the value range is configured to be -5 to -10 quantization units, and the implementer needs to make adaptive values in combination with specific sensor hardware.
[0060] Preferably, in some possible implementations of the embodiments of the present invention, the method for finding the connected path with the minimum cumulative cost includes: employing a dynamic programming algorithm, starting from the temporal starting point of the network graph, accumulating the node penalty weight and the constraint weight that reach each candidate baseline value day by day, calculating the cumulative cost, and selecting the node with the minimum cumulative cost at the end of the evaluation window period, and determining the connected path formed by the node corresponding to the minimum cumulative cost through backtracking. It should be noted that the temporal starting point of the network graph is the node whose first candidate baseline value in the temporal sequence within the evaluation window is equal to the baseline light intensity.
[0061] This invention employs an optimization algorithm to find the connected path with the minimum cumulative cost. Specifically, the cumulative cost of the starting node is initialized to zero, and daily calculations are initiated, increasing daily. Then, for any candidate baseline value on day d, all preceding nodes connected to it on day d-1 are traversed to calculate the total transition cost. The total transition cost is the sum of the minimum historical cumulative cost of the preceding node, the constraint weight, and the penalty weight of the current node. The total transition cost with the minimum value is selected and updated to the minimum historical cumulative cost to reach the node corresponding to that candidate baseline value, and the corresponding preceding node index is recorded simultaneously.
[0062] Subsequently, the above calculation is repeated until the end of the evaluation window. Among all the candidate baseline values on the last day, the node with the smallest historical cumulative cost is selected and established as the endpoint node. Based on the saved preceding node index, the time sequence is traced back from the endpoint node to the starting point day by day, and the extracted trajectory is the connected path with the smallest cumulative cost.
[0063] Preferably, in some possible implementations of the embodiments of the present invention, after finding the connected path with the minimum cumulative cost, the method further includes: determining whether the cumulative cost to reach the destination exceeds a preset global tolerance cost threshold; if it does not exceed the threshold, the extracted trajectory is determined to be reliable and an update operation is performed; if it exceeds the threshold, the system determines that there is a complete lack of effective gas-free clean data in the entire multi-day evaluation window, and that a forced update would cause the benchmark to be contaminated, so the update is abandoned and the original benchmark light intensity remains unchanged.
[0064] Preferably, in a specific implementation of this invention, a preset global tolerance cost threshold characterizes the maximum tolerance limit of the system under long-term high-concentration closed conditions. The specific range of the preset global tolerance cost threshold is determined based on the product of the sensor's maximum expected error per day and the total number of days in the evaluation window; wherein, the maximum expected error per day is based on the sensor's factory-calibrated allowable measurement error baseline; for example, when the total number of days in the evaluation window is 7 days and the maximum expected error per day is 150, the preferred value of the global tolerance cost threshold is 1050, and its reasonable value range can be configured to be from 700 to 2100; here, the implementer needs to adapt the value according to the specific hardware.
[0065] Preferably, in some possible implementations of this invention, the inversion calculation to obtain the compensated gas concentration value includes: when the real-time acquired transmitted light intensity is less than the updated reference light intensity, substituting the transmitted light intensity and the updated reference light intensity into the concentration inversion formula to obtain the compensated gas concentration value; when the real-time acquired transmitted light intensity is greater than or equal to the updated reference light intensity, outputting the gas concentration measurement value as zero. Specifically, in real-time detection mode, the system continuously retrieves the temperature-normalized transmitted light intensity at the latest moment and compares it with the updated reference light intensity: If the transmitted light intensity is greater than or equal to the updated reference light intensity, the system determines that it is currently in a state of no target gas absorption. In order to prevent the subsequent logarithmic calculation from outputting a negative concentration that has no physical meaning, the gas concentration measurement value is directly truncated and output as 0. If the transmitted light intensity is less than the updated reference light intensity, the system determines that there is effective optical absorption attenuation, and performs a concentration inversion calculation based on the Beer-Lambert law to obtain the compensated gas concentration value. The formula for calculating the compensated gas concentration value is as follows: This formula is also known as the concentration inversion formula. Wherein, This represents the real-time normalized transmitted light intensity. This indicates the updated reference light intensity; Indicates the characteristic absorption cross section of the target gas; Indicates the effective optical path length inside the sensor's air chamber; Item This reflects the attenuation rate of real-time transmitted light intensity compared to a gas-free reference; Item This indicates that the natural logarithm of the attenuation ratio is taken. Because The ratio is less than Therefore, the result of the natural logarithm calculation must be negative. If the transmitted light intensity normalized to the real-time temperature is less than or equal to a preset infinitesimal constant, the transmitted light intensity is forcibly assigned to this preset infinitesimal constant before being substituted into the calculation.
[0066] In one specific implementation of this invention, This value is usually determined by the physicochemical properties of the target gas itself. For a specific gas, this value is a known physical constant; for example, the nitrogen gas used in the embodiments of this invention has a characteristic absorption cross section of 0 in an infrared environment.
[0067] In one specific implementation of this invention, The values are determined by the sensor hardware and are inherent physical parameters of the air chamber structure; therefore, the implementer needs to adapt the values according to the specific sensor hardware.
[0068] In one specific implementation of this invention, the preset micro constant is set to 0.000001.
[0069] As the formula shows, an increase in the target gas concentration will decrease the real-time transmitted light intensity. After logarithmic calculation and sign reversal, the correct positive concentration can be output. Using the updated reference light intensity in the calculation can avoid the inversion of the numerator and denominator caused by baseline contamination and eliminate the problem of negative concentration output.
[0070] Furthermore, after the calculation is completed, the system outputs the compensated and corrected gas concentration measurement value to the external monitoring master station through an external communication interface. After completing the optimization output for the current cycle, the system removes the earliest day's data within the evaluation window and stores the optimal candidate baseline value for day d determined in this optimization into non-volatile memory, serving as the starting root node when constructing the network graph for the next evaluation window. Subsequently, the system slides in the sampling data for the new day and restarts path optimization based on the new root node. This constitutes a closed-loop data flow for sensor compensation and correction that is cyclically autonomous and requires no manual intervention.
[0071] In summary, this invention proposes a compensation and correction method for a gas concentration infrared sensor. By constructing a multi-day baseline candidate network graph, and calculating node penalty weights and connection constraint weights based on differences in light intensity distribution and physical laws of hardware attenuation, the method finally extracts the baseline path with the least interference through global optimization and updates the benchmark. This achieves effective removal of long-term gas residual interference and accurate compensation for hardware aging drift, significantly improving the long-term measurement stability and reliability of the sensor under harsh operating conditions.
[0072] Based on the same inventive concept, the present invention also proposes a compensation and correction system for a gas concentration infrared sensor, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of any one of the compensation and correction methods for a gas concentration infrared sensor.
[0073] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0074] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A compensation and calibration method for a gas concentration infrared sensor, characterized in that, The method includes: The transmitted light intensity is continuously collected by the infrared sensor during operation; daily candidate baseline values are extracted from the historical data of the transmitted light intensity, and a network graph containing candidate baseline values for multiple consecutive days is constructed. Based on the time point corresponding to the candidate baseline value, a preset number of transmitted light intensities are extracted from historical data to generate a local measured light intensity array. After zero-mean processing is performed on the array and the factory-calibrated light intensity array, the difference value of light intensity distribution pattern is calculated. According to the deviation of the difference value of light intensity distribution pattern from the candidate baseline value from the daily average value of transmitted light intensity, the node penalty weight is calculated. The degree of jump in candidate baseline values between adjacent days in the network graph is evaluated, and constraint weights are assigned to the connections between adjacent nodes. Based on the node penalty weights and constraint weights, an accumulated cost is generated. The value of the endpoint of the connected path with the minimum accumulated cost is found in the network graph and used as the updated reference light intensity. Based on the real-time collected transmitted light intensity and the updated reference light intensity, the compensated gas concentration value is calculated by inversion.
2. The compensation and calibration method for a gas concentration infrared sensor according to claim 1, characterized in that, Methods for continuously acquiring transmitted light intensity include: The original light intensity signal output by the infrared sensor and the ambient temperature signal of the sensor housing are collected simultaneously; the original light intensity signal is mapped and corrected according to the factory-preset temperature compensation curve and the ambient temperature signal to obtain the transmitted light intensity.
3. The compensation and calibration method for a gas concentration infrared sensor according to claim 1, characterized in that, The method for obtaining the network graph includes: The daily timeline is divided into multiple time blocks of equal length according to a preset time interval. Within each time block, the maximum preset number of transmitted light intensities are extracted as candidate baseline values for each time block of that day. The currently effective reference light intensity is used as the starting point of the time series and linked with the candidate baseline values extracted over multiple consecutive days to form the network graph. The candidate baseline data of the previous day and the candidate baseline values of the next day are connected by a one-way line.
4. The compensation and calibration method for a gas concentration infrared sensor according to claim 1, characterized in that, The method for obtaining the node penalty weight includes: For each candidate baseline value in the network graph, the difference between the candidate baseline value and the average transmitted light intensity of the corresponding date is calculated to obtain the daily average deviation. Based on the time point corresponding to the candidate baseline value, within the historical evaluation time window starting from that time point, a preset number of transmitted light intensities are extracted at equal time intervals to generate a local measured light intensity array. After the local measured light intensity array and the factory-calibrated light intensity array are respectively zero-mean processed, the difference value of light intensity distribution pattern is calculated. Using the difference in light intensity distribution as the numerator and the sum of the daily average deviation and the preset noise constant as the denominator, the node penalty weight corresponding to the candidate baseline value is calculated.
5. The compensation and calibration method for a gas concentration infrared sensor according to claim 1, characterized in that, The method for assigning constraint weights to connections between adjacent nodes includes: For any given day, the candidate baseline value for a time block corresponds to a node in the network graph; The difference value is calculated by subtracting the candidate baseline values of different time blocks of the previous day from the candidate baseline values of different time blocks of the next day. The corresponding constraint weights between adjacent nodes are then assigned based on whether the difference value exceeds the jump range defined by the preset maximum allowable attenuation constant and the maximum allowable noise drift lower limit.
6. The compensation and calibration method for a gas concentration infrared sensor according to claim 5, characterized in that, The step of assigning corresponding constraint weights based on whether the difference value exceeds the jump range defined by the preset maximum allowable attenuation constant and the minimum allowable noise drift limit includes: If the difference value is less than the lower limit of the maximum allowable noise drift, then a maximum penalty value is assigned as a constraint weight to the corresponding connection. If the difference value is greater than the maximum allowable attenuation constant, then a positive penalty value calculated based on the excess of the difference value is assigned as a constraint weight to the corresponding connection. If the difference value is greater than or equal to the lower limit of the maximum allowable noise drift and less than or equal to the maximum allowable attenuation constant, then zero values are assigned as constraint weights to the corresponding connection.
7. The compensation and calibration method for a gas concentration infrared sensor according to claim 1, characterized in that, The method for finding the connected path with the minimum cumulative cost includes: Using a dynamic programming algorithm, starting from the temporal starting point of the network graph, the penalty weight and constraint weight of the node reaching each candidate baseline value are accumulated day by day to calculate the accumulated cost. At the end of the evaluation window, the node with the minimum accumulated cost is selected, and the connected path formed by the node corresponding to the minimum accumulated cost is determined by backtracking.
8. The compensation and calibration method for a gas concentration infrared sensor according to claim 7, characterized in that, Following the method for finding the connected path with the minimum cumulative cost, the method further includes: determining whether the cumulative cost to reach the destination exceeds a preset global tolerance cost threshold; if it does not exceed the threshold, then performing an update operation; if it does exceed the threshold, then abandoning the update and maintaining the original reference light intensity unchanged.
9. The compensation and calibration method for a gas concentration infrared sensor according to claim 1, characterized in that, The inversion calculation yields the compensated gas concentration value, including: When the real-time acquired transmitted light intensity is less than the updated reference light intensity, the transmitted light intensity and the updated reference light intensity are substituted into the concentration inversion formula to obtain the compensated gas concentration value; when the real-time acquired transmitted light intensity is greater than or equal to the updated reference light intensity, the gas concentration value is output as zero.
10. A compensation and correction system for a gas concentration infrared sensor, characterized in that, The system includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method as described in any one of claims 1 to 9.