Gas sensor environment anti-interference drift compensation method, system and equipment
By coordinating the processing of electromagnetic interference and gas response signals and dynamically optimizing the compensation coefficient, the problem of signal distortion in traditional gas sensors in complex environments is solved, achieving high-precision target gas concentration detection and improved stability.
Patent Information
- Application Number
- CN202511726882.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-02-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional gas sensors struggle to effectively handle signal distortion caused by cross-sensitivity of multiple gases and electromagnetic interference in complex industrial environments, leading to decreased measurement accuracy and stability.
By co-processing electromagnetic interference signals and gas response signals, the drift compensation coefficient is dynamically optimized. Signals are collected using a gas sensor array and a miniature electromagnetic interference monitoring unit. Feature identification and compensation are performed by combining the interference-response co-processing model and the interaction influence model.
It achieves high-precision target gas concentration detection in complex industrial environments, suppresses time-varying sensor drift, improves the stability of long-term monitoring, and reduces upgrade costs.
Smart Images

Figure CN121558982A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gas sensor detection technology, and in particular to a method, system and device for compensating for environmental disturbance drift of gas sensors. Background Technology
[0002] Gas sensors are key components in environmental monitoring, industrial safety, and process control, and their detection accuracy and reliability are of paramount importance. However, in complex industrial applications, sensor performance is generally constrained by two major challenges: first, the cross-sensitivity problem caused by the coexistence of multiple gases in the environment makes it difficult to accurately separate the target gas signal; second, the complex electromagnetic environment introduces strong noise interference, and the time drift and temperature drift inherent in the sensors themselves contribute to signal distortion and long-term stability degradation. Traditional compensation methods often focus on correcting single factors or rely on frequent manual calibration, making it difficult to achieve coordinated processing of cross-interference from mixed gases, multi-mode electromagnetic interference, and drift. This results in insufficient reliability of real-time monitoring data from sensors in high-end industrial scenarios such as petroleum, chemical, and metallurgical industries, posing potential risks to safe production and environmental compliance. Summary of the Invention
[0003] The main objective of this invention is to provide a method, system, and device for environmental interference immunity and drift compensation of gas sensors. By coordinating the processing of electromagnetic interference signals and gas response signals, the drift compensation coefficient is dynamically optimized to achieve the goal of outputting high-precision target gas concentration detection results.
[0004] To achieve the above objectives, the present invention provides a gas sensor environmental disturbance immunity drift compensation method, comprising the following steps: Collect the response signal of the mixed gas in the environment and obtain the electromagnetic interference signal at the same time stamp; Threshold truncation is performed on the spike pulses in the mixed gas response signal to obtain the trend waveform signal caused by the change in gas concentration. The electromagnetic interference signal is then denoised to obtain effective electromagnetic interference parameters. The effective electromagnetic interference parameters are characterized by feature identification to determine the interference mode and interference intensity level through a preset interference-response collaborative processing model. The trend waveform signal is analyzed simultaneously to obtain the response characteristic curves of the target gas and the interfering gas. The drift compensation coefficient of the target gas is matched through a preset drift compensation database. The drift compensation coefficients are collaboratively optimized using a pre-defined interaction influence model to obtain the final compensation result.
[0005] Further, the step of acquiring the mixed gas response signal in the environment and obtaining the electromagnetic interference signal at the same time stamp is characterized by including: Gas response signals in the environment are collected by a gas sensor array. The mixed gas response signals include target monitoring gas signals, interfering gas signals, and background gas signals. Electromagnetic interference signals at the same timestamp are obtained by a miniature electromagnetic interference monitoring unit integrated inside the sensor housing.
[0006] Further, the step of threshold truncation of the spike pulses in the mixed gas response signal to obtain a trend waveform signal caused by changes in gas concentration, and denoising the electromagnetic interference signal to obtain effective electromagnetic interference parameters, is characterized by including: High-frequency random noise in the mixed gas response signal is eliminated by moving average filtering, and the spike pulses in the mixed gas response signal after high-frequency random noise elimination are truncated by thresholding to obtain the trend waveform signal caused by gas concentration changes. By filtering out ultra-high frequency noise in electromagnetic signals using a low-pass filter and shaping the waveform of pulse-type interference signals, effective electromagnetic interference parameters can be obtained.
[0007] Furthermore, the effective electromagnetic interference parameters are characterized by feature identification to determine the interference mode and interference intensity level through a preset interference-response collaborative processing model, and the trend waveform signal is analyzed simultaneously to distinguish the response characteristic curves of the target gas and the interfering gas. The drift compensation coefficient of the target gas is matched through a preset drift compensation database. The feature is that it includes: feature identification of the effective electromagnetic interference parameters through a preset multimodal interference-response collaborative processing model to determine the specific mode and interference intensity level of the current electromagnetic interference. Based on the identified interference patterns, the trend waveform signal is subjected to secondary purification, and a dynamic window smoothing algorithm is used to suppress pulse residues in the trend fluctuations. The trend waveform signal is analyzed, and combined with the electromagnetic interference mode characteristics at the same time stamp, the response characteristic curves of the target gas and the interfering gas are obtained through feature difference analysis. The difference between the response characteristic curve of the target gas and the standard response value obtained by the sensor in a pure target gas environment without electromagnetic interference is calculated, and the resulting deviation value is the target gas response offset. Establish a correlation identification mechanism between electromagnetic interference mode and target gas response offset. Based on the interference intensity level and the target gas response characteristic offset, call the corresponding drift compensation coefficient in the preset drift compensation database.
[0008] Furthermore, the step of constructing the interference-response co-processing model is characterized by including: A collaborative processing framework is built around the interference identification module and the response feature analysis module. Collect effective electromagnetic interference parameters under common electromagnetic interference scenarios, classify the parameters through clustering algorithms, extract typical features of each type of interference, and form an interference mode template library containing feature parameter ranges, mode labels and corresponding signal purification strategies. Embed a target gas response offset calculation submodule in the response feature parsing module. Target gas response offset data under different electromagnetic interference modes were collected to construct an association dataset of "interference mode-intensity level-offset". A multivariate regression analysis algorithm was used to calculate the quantitative relationship between interference intensity level and offset to determine the correlation coefficient between interference intensity level and offset under different modes. A decision tree model was trained based on the association dataset to establish a mapping rule from "interference mode + intensity level" to "correction coefficient". Based on the typical characteristics in the interference mode template library, the corresponding signal purification strategy parameters are bound to each type of interference mode, and the center frequency and bandwidth of the notch filter are preset for the power frequency interference mode. A model self-updating unit is configured to receive the interaction effect parameters output by the compensation result optimization step.
[0009] Furthermore, the step of collaboratively optimizing the drift compensation coefficients through a preset interaction influence model to obtain the final compensation result is characterized by including: The target gas response characteristic curve and the electromagnetic interference mode are input into a pre-trained interaction model for collaborative optimization. Output the compensation results after collaborative optimization.
[0010] Furthermore, the step of training the interaction influence model is characterized by including: Based on historical data and combined with laboratory-simulated interference scenarios, the generated simulation data is used to construct a training sample pool; Sample augmentation of the sample pool is achieved by using time-series flipping and random fragment insertion to expand the sample size and generate synthetic samples that conform to physical laws. A dual-branch collaborative architecture design model of "interference feature analysis branch - response feature prediction branch" is adopted; Layered training and dynamic loss adjustment are implemented. The interference feature parsing branch and the response feature prediction branch are trained separately. After the two branches converge, the collaborative fusion layer is trained together. The dynamic loss function adopts the improved Huber loss function. The accuracy is optimized by using mean square error. When the error is large, it automatically switches to mean absolute error to reduce the impact of extreme values. At the same time, a scene adaptation factor is introduced.
[0011] The present invention also provides a gas sensor environmental disturbance rejection drift compensation system, comprising: The data acquisition module is used to collect the response signals of the mixed gas in the environment and to acquire the electromagnetic interference signals at the same timestamp. The data preprocessing module is used to threshold-truncate the spike pulses in the mixed gas response signal to obtain the trend waveform signal caused by the change in gas concentration, and to perform noise reduction processing on the electromagnetic interference signal to obtain effective electromagnetic interference parameters. The drift compensation module is used to identify the characteristics of the effective electromagnetic interference parameters to determine the interference mode and interference intensity level through a preset interference-response collaborative processing model, and simultaneously analyze the trend waveform signal to obtain the response characteristic curves of the target gas and the interfering gas, and obtain the drift compensation coefficient of the target gas from the preset drift compensation database. The collaborative optimization module is used to collaboratively optimize the drift compensation coefficients through a preset interaction influence model to obtain the final compensation result.
[0012] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described gas sensor environmental anti-disturbance drift compensation method.
[0013] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described gas sensor environmental disturbance rejection drift compensation method.
[0014] The gas sensor environmental interference immunity drift compensation method, system, and device provided by this invention have the following beneficial effects: This invention overcomes the impact of cross-interference and electromagnetic noise on measurement accuracy by intelligently identifying electromagnetic interference patterns and effectively separating mixed gas response signals; by dynamically acquiring and optimizing drift compensation coefficients, it suppresses the time-varying drift of the sensor itself, ensuring the stability of long-term monitoring; This invention has strong scene adaptability, and interference templates and compensation strategies can be set according to different industrial environments, and it can be deployed without modifying existing hardware facilities, reducing upgrade costs and complexity. Attached Figure Description
[0015] Figure 1 This is a flowchart illustrating a gas sensor environmental disturbance rejection drift compensation method in one embodiment of the present invention; Figure 2 This is a structural block diagram of a gas sensor environmental disturbance rejection and drift compensation system according to an embodiment of the present invention; Figure 3 This is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.
[0016] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0018] Reference Figure 1 The diagram below illustrates a flow chart of a gas sensor environmental disturbance rejection drift compensation method proposed in this invention, comprising the following steps: S1, collect the mixed gas response signal in the environment and obtain the electromagnetic interference signal at the same time stamp; S2, threshold truncation is performed on the spike pulses in the mixed gas response signal to obtain the trend waveform signal caused by the change in gas concentration, and the electromagnetic interference signal is denoised to obtain effective electromagnetic interference parameters; S3, through a preset interference-response collaborative processing model, the effective electromagnetic interference parameters are characterized to determine the interference mode and interference intensity level, and the trend waveform signal is analyzed simultaneously to obtain the response characteristic curves of the target gas and the interfering gas. The drift compensation coefficient of the target gas is matched through a preset drift compensation database. S4. The drift compensation coefficient is collaboratively optimized using a preset interaction influence model to obtain the final compensation result.
[0019] In one embodiment, for step S1, Gas response signals in the environment are collected by a gas sensor array. The mixed gas response signals include target monitoring gas signals, interfering gas signals, and background gas signals. Electromagnetic interference signals at the same timestamp are obtained by a miniature electromagnetic interference monitoring unit integrated inside the sensor housing.
[0020] In practical implementation, a multi-component gas sensor array is used to collect the response signals of the mixed gas, including: target monitoring gas signal: the sensor's specific response to the preset monitoring gas; interfering gas signal: the sensor's cross-response to non-target gases; and background gas signal: the sensor's baseline response to clean air (without target / interfering gases). An integrated miniature electromagnetic interference monitoring unit is used, which is synchronously triggered for acquisition with the gas sensor array via the same clock module to ensure the timestamp error of the two types of signals. This meets the accuracy requirements of the "interference-response" time series correlation analysis; the mixed gas response signal is stored in the "timestamp (t) - response value (V / R)" array, and the electromagnetic interference signal is stored in the "timestamp (t) - field strength (V / m) - frequency spectrum (Hz)" array.
[0021] In one embodiment, for step S2, High-frequency random noise in the mixed gas response signal is eliminated by moving average filtering, and the spike pulses in the mixed gas response signal after high-frequency random noise elimination are truncated by thresholding to obtain the trend waveform signal caused by gas concentration changes. By filtering out ultra-high frequency noise in electromagnetic signals using a low-pass filter and shaping the waveform of pulse-type interference signals, effective electromagnetic interference parameters can be obtained.
[0022] In practice, high-frequency random noise in the mixed gas response signal is eliminated by moving average filtering. The filtering formula is as follows:
[0023] in, ) represents the filtered mixed gas response value at time t (unit: V); N is the sliding window size, which is set according to the rate of change of gas concentration, and is usually 5-10 in industrial scenarios. The original response values for the i sampling periods prior to time t; The sampling period is in seconds. Abnormal spikes caused by electromagnetic pulses and transient sensor malfunctions (not caused by changes in gas concentration) are excluded. The threshold setting formula is as follows: ,in, The peak pulse truncation threshold (unit: V). The baseline response value of the sensor in clean air (no target / interfering gas) (obtained through factory calibration and daily zero-point calibration, such as 0.5V). This is the standard deviation of the baseline response value. When the filtered response value... or When a spike pulse is detected, the response value at that moment is replaced with... (Filtered value from the previous moment), ultimately yielding a trend waveform signal reflecting changes in gas concentration (horizontal axis: time t, vertical axis: filtered response value). An RC low-pass filter is used to remove ultra-high frequency noise above 1 GHz from the electromagnetic signal. The transfer function is as follows: ,in, : Filter transfer function, R: Resistance value (choose 1kΩ), C: Capacitor value (choose 100pF), s: Complex frequency variable, cutoff frequency of the filter. It can effectively preserve signals in the main interference frequency bands (10kHz-1MHz) in industrial scenarios. For the low-pass filtered signal, the effective parameters of pulse interference (rise time) are extracted. Peak amplitude Duration After removing waveform oscillations (such as noise at the pulse trailing edge), the effective electromagnetic interference parameters (including the main interference frequency) are finally obtained. Average field strength Pulse parameters .
[0024] In one embodiment, for step S3, By using a pre-defined multi-modal interference-response collaborative processing model, the effective electromagnetic interference parameters are characterized to determine the specific mode and interference intensity level of the current electromagnetic interference. Based on the identified interference patterns, the trend waveform signal is subjected to secondary purification, and a dynamic window smoothing algorithm is used to suppress pulse residues in the trend fluctuations. The trend waveform signal is analyzed, and combined with the electromagnetic interference mode characteristics at the same time stamp, the response characteristic curves of the target gas and the interfering gas are obtained through feature difference analysis. The difference between the response characteristic curve of the target gas and the standard response value obtained by the sensor in a pure target gas environment without electromagnetic interference is calculated, and the resulting deviation value is the target gas response offset. Establish a correlation identification mechanism between electromagnetic interference mode and target gas response offset. Based on the interference intensity level and the target gas response characteristic offset, call the corresponding drift compensation coefficient in the preset drift compensation database.
[0025] In practical implementation, effective electromagnetic interference parameters are input into a multimodal interference-response collaborative processing model. The model identifies interference modes through "template matching + feature comparison" and calls a preset interference mode template library. The template information includes: power frequency interference (typical main frequency range 50 / 60Hz±2Hz, field strength fluctuation ≤5%, no pulse parameters), high frequency interference (typical main frequency range 10kHz-1MHz, field strength fluctuation 10%-20%, no pulse parameters), and pulse interference (typical main frequency range 100MHz-1GHz, field strength is sudden, pulse parameters are...). ), calculate the matching degree between effective parameters and each template (such as the main frequency deviation rate). (Field strength level consistency), when the matching degree is >85%, the current interference mode is determined. The typical frequency of a certain type of interference mode preset in the interference mode template library, based on the average field strength. Intensity level classification: weak interference ( ), medium interference ( ), strong interference ( Secondary purification of the mixed gas trend waveform signal is performed. Specifically, based on the identified interference pattern, the corresponding signal purification strategy is invoked to eliminate the impact of residual interference on the trend waveform signal: 1. Power frequency interference: A notch filter is activated (center frequency consistent with the power grid frequency, such as 50Hz in China and 60Hz in Europe and America; bandwidth ±2Hz) to filter out co-frequency interference components in the trend waveform signal (power frequency interference will cause the response signal to exhibit a 50Hz periodic fluctuation with an amplitude of 0.05-0.1V); 2. Pulse interference: A dynamic window smoothing algorithm is adopted, with the window size... Through feature difference analysis, the trend waveform signal after secondary purification is compared with the preset "single gas response baseline curve" formula as follows:
[0026] in, : The response voltage of the target gas at time t (unit: V), i.e., the vertical axis of the target gas response characteristic curve; : The trend waveform signal response voltage (unit: V) after secondary purification at time t; : The response voltage (in V) of the interfering gas at time t, calculated based on a reference curve of the interfering gas (e.g., the reference curve of HCl). (where c is the HCl concentration, in ppm). Baseline response voltage of the background gas (unit: V), i.e. Draw them separately. , The curves are the response characteristic curves of the target gas and the interfering gas. The response values of the standard gas are collected. Generate real-time reference response curves ,in: (Sensitivity coefficient after real-time calibration, unit: V / ppm); (Zero offset after real-time calibration, unit: V), where, This refers to the standard gas concentration (e.g., 100 ppm). (Zero offset after real-time calibration, unit: V). Based on the real-time generated reference response curve, combined with the currently analyzed target gas response characteristic values. Back-calculation of real-time concentration ; Then calculate the corresponding curve based on the real-time baseline curve. Standard response value ; Final offset This directly reflects the deviation caused by electromagnetic interference and drift. Among them: Real-time concentration (unit: ppm) derived from the current target gas response value, reflecting the "apparent concentration" currently detected by the sensor; Based on the real-time baseline curve, corresponding The standard response value (unit: V), i.e., the "response value under ideal drift-free conditions"; Target gas response offset (unit: V) directly reflects the deviation between the current response value and the ideal state. This deviation is caused by both electromagnetic interference and sensor drift. It is generated in real time through "basic coefficient + dynamic correction": 1. Basic coefficient Acquisition: Preset "Interference Mode - Intensity Level - Base Coefficient" mapping relationship (trained based on industry experimental data), such as interference in power frequency. High-frequency interference Strong pulse interference Matching based on the current interference mode and intensity level 2. Dynamic correction coefficient Calculation: Two real-time impact factors were introduced for correction. —— Interference intensity fluctuation factor ( The reference field strength for the corresponding mode-level is adjusted within the range of 0.95-1.05. Interference gas concentration factor ( To adjust the interfering gas reference concentration (adjustment range: 0.98-1.02), 3. Final compensation coefficient. And set the value range to 0.95-1.15 to avoid abnormal correction.
[0027] Example: Interference at power frequency in a metallurgical setting ,current but HCl concentration ( )but Finally, K≈1.024.
[0028] In one embodiment, for the step of constructing the interference-response co-processing model, A collaborative processing framework is built around the interference identification module and the response feature analysis module. Collect effective electromagnetic interference parameters under common electromagnetic interference scenarios, classify the parameters through clustering algorithms, extract typical features of each type of interference, and form an interference mode template library containing feature parameter ranges, mode labels and corresponding signal purification strategies. Embed a target gas response offset calculation submodule in the response feature parsing module. Target gas response offset data under different electromagnetic interference modes were collected to construct an association dataset of "interference mode-intensity level-offset". A multivariate regression analysis algorithm was used to calculate the quantitative relationship between interference intensity level and offset to determine the correlation coefficient between interference intensity level and offset under different modes. A decision tree model was trained based on the association dataset to establish a mapping rule from "interference mode + intensity level" to "correction coefficient". Based on the typical characteristics in the interference mode template library, the corresponding signal purification strategy parameters are bound to each type of interference mode, and the center frequency and bandwidth of the notch filter are preset for the power frequency interference mode. A model self-updating unit is configured to receive the interaction effect parameters output by the compensation result optimization step.
[0029] In practical implementation, the "interference identification module" and "response feature analysis module" are the core components, and the framework is built using NVIDIA Jetson Nano. The interference identification module contains three functional sub-units: 1. Feature input sub-unit: receives valid electromagnetic interference parameters ( ); 2. Pattern Classification Subunit: Based on the Support Vector Machine (SVM) algorithm, it inputs effective parameters and outputs the interference pattern and intensity level (SVM model training accuracy ≥ 92%); 3. Result Output Subunit: Outputs the interference pattern and intensity level in JSON format to the response feature parsing module. The response feature parsing module contains 4 functional subunits: 1. Signal Purification Subunit: Receives the interference pattern and calls the corresponding purification strategy; 2. Response Separation Subunit: Implements feature difference analysis to separate the target / interference gas response; 3. Offset Calculation Subunit: Embeds the response offset calculation formula and outputs 4. Compensation Coefficient Matching Subunit: Calls the drift compensation database and outputs the initial compensation coefficient K. Constructs an interference mode template library and an offset calculation submodule. Selects 10 typical chemical plant workshops (organic synthesis, acid-base neutralization, and petroleum refining), and continuously collects electromagnetic interference data for each workshop for one month (24 hours daily, sampling frequency 10Hz), obtaining approximately 26,000 valid electromagnetic interference parameters. Uses the K-means clustering algorithm (K=3, corresponding to 3 typical interference types) to determine the "dominant frequency" clustering pattern. Field strength fluctuation coefficient Clustering features are defined by "presence or absence of pulses," and the clustering results are matched with interference sources in industrial scenarios to form a template library. Templates are stored in XML format, with each template containing "mode name, dominant frequency range, field strength fluctuation range, pulse parameter range, and recommended purification strategy." An offset calculation submodule is embedded: Compile into a C language function, integrate it into the response feature parsing module, and the function input is... and The output is The calculation time is ≤1ms. In a laboratory environment, five target gas concentrations (50, 100, 150, 200, 250ppm) are generated using a gas generator. Three interference modes and three intensity levels are simulated using an electromagnetic interference generator. Three sets of data are collected for each condition, resulting in 3×3×5×3=135 sets of "interference mode-intensity level-offset" correlation data. Linear regression is performed on the correlation data to establish the interference intensity level (L, 1 = weak, 2 = medium, 3 = strong) and target gas concentration ( ) and offset The quantitative relationship is expressed by the following formula: Where: a, b, and d are regression coefficients (e.g., under power frequency interference, a=0.02, b=0.0001, d=0.01; this formula can be used to initially predict the offset and assist in matching the compensation coefficients); the CART decision tree algorithm is adopted, with "interference mode (coded as 1-3) + intensity level (1-3)" as the input feature and "compensation coefficient K" as the output label. The training dataset and the test dataset are divided in a 7:3 ratio. The model test accuracy is ≥90%. The trained model is stored as a binary file for easy access by the embedded platform. Preset purification strategy parameters for each type of interference mode (stored in the configuration file config.ini). The parameters can be modified through the host computer to adapt to different industrial scenarios. Use a low-pass filter to filter out ultra-high frequency noise. For example: power frequency interference: notch filter center frequency = 50Hz, bandwidth = 2Hz, attenuation ≥40dB; high frequency interference: 2nd order RC Low-pass filter, R1=2kΩ, C1=22pF, R2=2kΩ, C2=22pF, cutoff frequency = 3.6MHz; Impulse interference: initial dynamic window size N=5, step size adjustment range 3-10 (depending on...) (Automatic adjustment).
[0030] In one embodiment, for step S4, The target gas response characteristic curve and the electromagnetic interference mode are input into a pre-trained interaction model for collaborative optimization. Output the compensation results after collaborative optimization.
[0031] In practice, the target gas response characteristic curve is input as an array, containing 100 consecutive sampling points. Input the electromagnetic interference mode as a string (corresponding to a 10-second duration, covering the short-term trend of gas concentration changes); input the initial drift compensation coefficient K as a floating-point number. The model outputs the co-optimized compensation coefficient in floating-point form. Optimize the confidence level with integers from 0 to 100; calculate the final target gas concentration.
[0032] In one embodiment, for the step of training the interaction influence model, Based on historical data and combined with laboratory-simulated interference scenarios, the generated simulation data is used to construct a training sample pool; Sample augmentation of the sample pool is achieved by using time-series flipping and random fragment insertion to expand the sample size and generate synthetic samples that conform to physical laws. A dual-branch collaborative architecture design model of "interference feature analysis branch - response feature prediction branch" is adopted; Layered training and dynamic loss adjustment are implemented. The interference feature parsing branch and the response feature prediction branch are trained separately. After the two branches converge, the collaborative fusion layer is trained together. The dynamic loss function adopts the improved Huber loss function. The accuracy is optimized by using mean square error. When the error is large, it automatically switches to mean absolute error to reduce the impact of extreme values. At the same time, a scene adaptation factor is introduced.
[0033] In practice, six months of "interference-response-compensation" data were collected from three different types of chemical plants (organic synthesis plant, oil refinery, and metallurgical plant), totaling 100,000 data points. Each data point included "interference mode, intensity level, target gas response curve, initial K, and actual K value." (Based on offline detection concentration back-calculation); Five extreme scenarios (such as strong pulse interference + high concentration of interfering gas, power frequency interference + sensor aging) are simulated using a gas mixing system and an electromagnetic interference generator, generating 20,000 simulation data points to supplement the training sample library. The optimal compensation coefficient is calculated back-calculated using the concentration measured by the offline gas chromatograph as the standard. (formula , The gas chromatograph detects the concentration of the gas and uses this as the output label for the sample. Simultaneously, scene labels (e.g., "Organic Synthesis Workshop - High Load") and equipment status codes (e.g., "Sensor Aging Level 1", levels 1-5, level 5 requiring replacement) are added. The time-series data of the target gas response curve are reversed (e.g., the response values of t1-t100 are changed to t100-t1) to simulate a gas concentration decrease scenario, expanding the sample size by 2 times. 10-50ms segments are extracted from interference signals of different scenarios and randomly inserted into normal response curves to simulate interference superposition scenarios, generating 5000 mixed scenario samples. A generative adversarial network (GAN) is used, with scarce samples of "strong interference + high concentration of interfering gas" as training data, to generate synthetic samples that conform to physical laws (ensuring that the synthesized response curve satisfies the physical relationship of "concentration increase - response voltage increase"), supplementing the scarce scenario samples. The model is implemented using a dual-branch collaborative framework with the following parameters: A 1D-CNN network is set up to extract the local frequency and intensity features of electromagnetic interference signals—1. Input layer: Receives the time sequence of effective electromagnetic interference parameters (100 sampling points, corresponding to 10 seconds); 2. Convolutional layer 1: 32 1×3 convolutional kernels, ReLU activation function, stride 1, padding=1; 3. Pooling layer 1: 1×2 max pooling, stride 2; 4. Convolutional layer 2: 64 1×3 convolutional kernels, ReLU activation function, stride 1, padding=1; 5. Pooling layer 2: 1×2 max pooling, stride 2; 6. Global average pooling layer: Outputs a 64-dimensional interference feature vector. A GRU network is configured to handle the temporal dependence of the target gas response curve: 1. Input layer: receives the temporal sequence of the target gas response voltage (100 sampling points); 2. GRU layer 1: 64 hidden layer nodes, dropout rate 0.2; 3. GRU layer 2: 64 hidden layer nodes, dropout rate 0.2; 4. Fully connected layer: outputs a 64-dimensional response feature vector. The feature vectors output from the two branches are dynamically weighted and fused using an attention weight matrix (64×64), with the weights adaptively adjusted according to the scene label (e.g., in the "Organic Synthesis Workshop" scene, interference feature weight = 0.6, response feature weight = 0.4; in the "Metallurgical Workshop" scene, interference feature weight = 0.5, response feature weight = 0.5); 2 fully connected layers (128 nodes → 32 nodes) output... Predicted values (linear activation function) and optimized confidence scores (Sigmoid activation function mapped to 0-100); the final target gas concentration calculation formula is as follows: .
[0034] Reference Figure 2Here is a structural block diagram of a gas sensor environmental disturbance rejection and drift compensation system according to an embodiment of the present invention, comprising: The data acquisition module is used to collect the response signals of the mixed gas in the environment and to acquire the electromagnetic interference signals at the same timestamp. The data preprocessing module is used to threshold-truncate the spike pulses in the mixed gas response signal to obtain the trend waveform signal caused by the change in gas concentration, and to perform noise reduction processing on the electromagnetic interference signal to obtain effective electromagnetic interference parameters. The drift compensation module is used to identify the characteristics of the effective electromagnetic interference parameters to determine the interference mode and interference intensity level through a preset interference-response collaborative processing model, and simultaneously analyze the trend waveform signal to obtain the response characteristic curves of the target gas and the interfering gas, and obtain the drift compensation coefficient of the target gas from the preset drift compensation database. The collaborative optimization module is used to collaboratively optimize the drift compensation coefficients through a preset interaction influence model to obtain the final compensation result.
[0035] For the specific implementation of each unit in the above device example, please refer to the method embodiments described above, and will not be repeated here.
[0036] Reference Figure 3 This invention also provides a computer device, which can be a server, and its internal structure can be as follows: Figure 3 As shown, the computer device includes a processor, memory, display screen, input device, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores the data corresponding to this embodiment. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the above-described method.
[0037] Those skilled in the art will understand that Figure 3 The structures shown are merely block diagrams of some structures related to the present invention and do not constitute a limitation on the computer devices on which the present invention is applied.
[0038] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0039] In summary, this invention acquires the response signal of a mixed gas in the environment and obtains the electromagnetic interference signal at the same time stamp; it truncates the spike pulses in the mixed gas response signal to obtain the trend waveform signal caused by changes in gas concentration; it denoises the electromagnetic interference signal to obtain effective electromagnetic interference parameters; it uses a preset interference-response collaborative processing model to identify the interference mode and interference intensity level of the effective electromagnetic interference parameters; it simultaneously analyzes the trend waveform signal to obtain the response characteristic curves of the target gas and the interfering gas; it matches the drift compensation coefficient of the target gas using a preset drift compensation database; and it uses a preset interaction influence model to collaboratively optimize the drift compensation coefficient to obtain the final compensation result, thereby achieving the goal of outputting high-precision target gas concentration detection results.
[0040] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the present invention and embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM, etc.
[0041] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0042] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for environmental disturbance rejection and drift compensation of a gas sensor, characterized in that, Includes the following steps: Collect the response signal of the mixed gas in the environment and obtain the electromagnetic interference signal at the same time stamp; Threshold truncation is performed on the spike pulses in the mixed gas response signal to obtain the trend waveform signal caused by the change in gas concentration. The electromagnetic interference signal is then denoised to obtain effective electromagnetic interference parameters. The effective electromagnetic interference parameters are characterized by feature identification to determine the interference mode and interference intensity level through a preset interference-response collaborative processing model. The trend waveform signal is analyzed simultaneously to obtain the response characteristic curves of the target gas and the interfering gas. The drift compensation coefficient of the target gas is matched through a preset drift compensation database. The drift compensation coefficients are collaboratively optimized using a pre-defined interaction influence model to obtain the final compensation result.
2. The gas sensor environmental anti-interference drift compensation method according to claim 1, characterized in that, the step of acquiring the mixed gas response signal in the environment and obtaining the electromagnetic interference signal at the same time stamp, is as follows: include: Gas response signals in the environment are collected by a gas sensor array. The mixed gas response signals include target monitoring gas signals, interfering gas signals, and background gas signals. Electromagnetic interference signals at the same timestamp are obtained by a miniature electromagnetic interference monitoring unit integrated inside the sensor housing.
3. The gas sensor environmental interference immunity drift compensation method according to claim 1, characterized in that, the peak pulses in the mixed gas response signal are truncated to obtain a trend waveform signal caused by changes in gas concentration, and the electromagnetic interference signal is denoised to obtain effective electromagnetic interference parameters, wherein... include: High-frequency random noise in the mixed gas response signal is eliminated by moving average filtering, and the spike pulses in the mixed gas response signal after high-frequency random noise elimination are truncated by thresholding to obtain the trend waveform signal caused by gas concentration changes. By filtering out ultra-high frequency noise in electromagnetic signals using a low-pass filter and shaping the waveform of pulse-type interference signals, effective electromagnetic interference parameters can be obtained.
4. The gas sensor environmental anti-interference drift compensation method according to claim 1, characterized in that, through a preset interference-response collaborative processing model, the effective electromagnetic interference parameters are characterized to determine the interference mode and interference intensity level; the trend waveform signal is analyzed simultaneously to distinguish the response characteristic curves of the target gas and the interfering gas; and the drift compensation coefficient of the target gas is matched through a preset drift compensation database. include: By using a pre-defined multi-modal interference-response collaborative processing model, the effective electromagnetic interference parameters are characterized to determine the specific mode and interference intensity level of the current electromagnetic interference. Based on the identified interference patterns, the trend waveform signal is subjected to secondary purification, and a dynamic window smoothing algorithm is used to suppress pulse residues in the trend fluctuations. The trend waveform signal is analyzed, and combined with the electromagnetic interference mode characteristics at the same time stamp, the response characteristic curves of the target gas and the interfering gas are obtained through feature difference analysis. The difference between the response characteristic curve of the target gas and the standard response value obtained by the sensor in a pure target gas environment without electromagnetic interference is calculated, and the resulting deviation value is the target gas response offset. Establish a correlation identification mechanism between electromagnetic interference mode and target gas response offset. Based on the interference intensity level and the target gas response characteristic offset, call the corresponding drift compensation coefficient in the preset drift compensation database.
5. The gas sensor environmental disturbance rejection drift compensation method according to claim 4, wherein the step of constructing the disturbance-response collaborative processing model is characterized in that, include: A collaborative processing framework is built around the interference identification module and the response feature analysis module. Collect effective electromagnetic interference parameters under common electromagnetic interference scenarios, classify the parameters through clustering algorithms, extract typical features of each type of interference, and form an interference mode template library containing feature parameter ranges, mode labels and corresponding signal purification strategies. Embed a target gas response offset calculation submodule in the response feature parsing module. Target gas response offset data under different electromagnetic interference modes were collected to construct an "interference mode-intensity level-offset" associated dataset. A multivariate regression analysis algorithm was used to calculate the quantitative relationship between interference intensity level and offset to determine the correlation coefficient between interference intensity level and offset under different modes. A decision tree model was trained based on the associated dataset to establish a mapping rule from "interference mode + intensity level" to "correction coefficient". Based on the typical characteristics in the interference mode template library, the corresponding signal purification strategy parameters are bound to each type of interference mode, and the center frequency and bandwidth of the notch filter are preset for the power frequency interference mode. A model self-updating unit is configured to receive the interaction effect parameters output by the compensation result optimization step.
6. The gas sensor environmental disturbance rejection drift compensation method according to claim 1, characterized in that, the step of co-optimizing the drift compensation coefficient through a preset interaction influence model to obtain the final compensation result, is as follows: include: The target gas response characteristic curve and the electromagnetic interference mode are input into a pre-trained interaction model for collaborative optimization. Output the compensation results after collaborative optimization.
7. The gas sensor environmental disturbance immunity drift compensation method according to claim 6, wherein the step of training the interaction influence model is characterized in that, include: Based on historical data and combined with laboratory-simulated interference scenarios, the generated simulation data is used to construct a training sample pool; Sample augmentation of the sample pool is achieved by using time-series flipping and random fragment insertion to expand the sample size and generate synthetic samples that conform to physical laws. A dual-branch collaborative architecture design model of "interference feature analysis branch - response feature prediction branch" is adopted; Layered training and dynamic loss adjustment are implemented. The interference feature parsing branch and the response feature prediction branch are trained separately. After the two branches converge, the collaborative fusion layer is trained together. The dynamic loss function adopts the improved Huber loss function. The accuracy is optimized by using mean square error. When the error is large, it automatically switches to mean absolute error to reduce the impact of extreme values. At the same time, a scene adaptation factor is introduced.
8. A gas sensor environmental disturbance rejection drift compensation system, characterized in that, include: The data acquisition module is used to collect the response signals of the mixed gas in the environment and to acquire the electromagnetic interference signals at the same timestamp. The data preprocessing module is used to threshold-truncate the spike pulses in the mixed gas response signal to obtain the trend waveform signal caused by the change in gas concentration, and to perform noise reduction processing on the electromagnetic interference signal to obtain effective electromagnetic interference parameters. The drift compensation module is used to identify the characteristics of the effective electromagnetic interference parameters to determine the interference mode and interference intensity level through a preset interference-response collaborative processing model, and simultaneously analyze the trend waveform signal to obtain the response characteristic curves of the target gas and the interfering gas, and match the drift compensation coefficient of the target gas through a preset drift compensation database. The collaborative optimization module is used to collaboratively optimize the drift compensation coefficients through a preset interaction influence model to obtain the final compensation result.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the gas sensor environmental disturbance rejection drift compensation method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the gas sensor environmental disturbance immunity drift compensation method according to any one of claims 1 to 7.
Citation Information
Cited By
Odor and greenhouse gas in-situ synchronous rapid determination method
CN121917723A
In-situ simultaneous rapid determination method for odor and greenhouse gases
CN121917723B
Dust environment concentration monitoring method and system
CN122193033A
A thermo-electric-gas multi-physical field coupling optimized gas sensor and response system
CN122430412A