Method for rapidly detecting nitrogen oxide content in air

By acquiring and processing nitrogen oxide sensor data in real time, and combining signal drift compensation and concentration prediction algorithms, standardized concentration data is generated and detection reports are automatically generated. This solves the problems of automation and flexibility in existing detection methods and achieves efficient detection of nitrogen oxides in the air.

CN120908378APending Publication Date: 2025-11-07朱甜
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510996998.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing methods for detecting nitrogen oxides in the air cannot achieve automatic detection, data analysis, and result judgment, resulting in poor detection flexibility and difficulty in adapting to complex and ever-changing detection environments and real-time monitoring needs.

Method used

Raw signal data is collected in real time by multiple nitrogen oxide sensors. After noise reduction and filtering, signal drift compensation is performed using a preset sensor calibration model. Combined with a nitrogen oxide concentration prediction algorithm model and a fuzzy logic judgment algorithm, a detection report is automatically generated.

Benefits of technology

It achieves intelligent processing of the entire process from data acquisition to report generation, significantly improving the flexibility and efficiency of detection, eliminating differences between sensors and the environment, and generating unified and standardized concentration data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120908378A_ABST
    Figure CN120908378A_ABST
Patent Text Reader

Abstract

The invention provides a method for rapidly detecting the content of nitrogen oxides in air. The method comprises the following steps: acquiring original signal data of nitrogen oxides in air in a target detection area in real time through a plurality of nitrogen oxide sensors; performing noise reduction filtering processing on the original signal data to generate target signal data; performing signal drift compensation correction on the target signal data based on a preset sensor calibration model to generate standardized concentration data; performing space-time correlation analysis on the standardized concentration data through a nitrogen oxide concentration prediction algorithm model in combination with environment parameter data collected in real time to generate a target prediction concentration value; and comparing the target predicted concentration value with a preset concentration standard threshold value based on a fuzzy logic judgment algorithm, and constructing a detection report. The whole process from data acquisition to report generation is intelligent, and the detection flexibility is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of environmental monitoring, and in particular to a method for rapidly detecting the content of nitrogen oxides in air. BACKGROUND

[0002] Nitrogen oxides not only harm human health and cause respiratory diseases and other problems, but also have a negative impact on the atmospheric environment, such as causing acid rain, photochemical smog and other environmental problems. At present, there are many methods for detecting the content of nitrogen oxides in air. Some traditional detection methods use chemical absorption combined with spectrophotometry, such as using a specific absorbent to absorb nitrogen oxides, and then measuring the absorbance by a spectrophotometer to calculate the content. For example, a mixed solution with a mass fraction of 0.9% hydrogen peroxide is used as an absorbent to absorb nitrogen oxides in the air and convert them into nitrate, which is then measured by ion chromatography. However, such methods require manual sample collection, absorbent addition, instrument operation and a series of tedious steps in actual operation, and cannot achieve automatic detection, consuming a lot of manpower and time cost, and having low detection efficiency. Moreover, the analysis of data and the judgment of results also depend on manual completion, which is prone to errors due to human factors, resulting in poor detection flexibility and difficulty in adapting to complex and variable detection environments and real-time monitoring requirements.

[0003] There are also some detection methods based on sensors, such as using a nitrogen oxide sensor composed of oxygen ion conductive solid electrolyte. By applying a voltage between specific electrodes, the current generated by gas decomposition is used to detect the concentration of nitrogen oxides. However, such sensors are sensitive to environmental conditions in actual application, have poor stability, and also lack the functions of automatic detection, data analysis and result judgment, which cannot meet the requirements of rapid, accurate and flexible detection. In addition, the method of using a portable infrared spectrometer to detect nitrogen monoxide and nitrogen dioxide in air can achieve a certain degree of rapid detection, but still has deficiencies in automation, and cannot automatically complete the entire detection process and subsequent data processing and result judgment. SUMMARY

[0004] In view of this, the present application provides a method for rapidly detecting the content of nitrogen oxides in air, which solves the technical problem that the existing methods for detecting the content of nitrogen oxides in air cannot achieve automatic detection, data analysis and result judgment, resulting in poor detection flexibility.

[0005] The technical solution of the present application is as follows:

[0006] A method for rapidly detecting the content of nitrogen oxides in air, comprising the following steps:

[0007] Step S1, real-time acquisition of original signal data of nitrogen oxides in air in a target detection area by a plurality of nitrogen oxide sensors;

[0008] Step S2, the original signal data is denoising filtering processing, generating target signal data;

[0009] Step S3, based on the preset sensor calibration model to the target signal data signal drift compensation correction, generating standardized concentration data;

[0010] Step S4, through the nitrogen oxide concentration prediction algorithm model, combined with the real-time acquisition of environmental parameter data on the standardized concentration data space correlation analysis, generating target prediction concentration value;

[0011] Step S5, based on fuzzy logic judgment algorithm the target prediction concentration value and the preset concentration standard threshold value are compared, and the detection report is constructed.

[0012] Optionally, the specific steps of the step S2 are:

[0013] Step S21, using approximate symmetric wavelet as the base function of wavelet transform, the original signal data is discrete wavelet transform, generating low frequency approximation coefficient and high frequency detail coefficient;

[0014] Step S22, using the low frequency approximation coefficient and the high frequency detail coefficient, the initial wavelet coefficient is constructed;

[0015] Step S23, the statistical characteristics of the high frequency detail coefficient in the wavelet domain are calculated to determine the threshold value, and the initial wavelet coefficient is threshold processed by using hard threshold function or soft threshold function, generating target wavelet coefficient;

[0016] Step S24, the target wavelet coefficient is inverse discrete wavelet transform, generating initial signal data;

[0017] Step S25, using adaptive Kalman filter algorithm combined with sensor noise covariance matrix to the initial signal data denoising, generating target signal data.

[0018] Optionally, the specific steps of the step S25 are:

[0019] Step S251, the history time series data of the initial signal data is extracted, and the mean, standard deviation and autocorrelation coefficient are calculated;

[0020] Step S252, using the mean, the standard deviation and the autocorrelation coefficient, the state vector and the prediction error covariance matrix of the adaptive Kalman filter are initialized;

[0021] Step S253, the initialized state vector and prediction error covariance matrix are substituted into the preset update formula, generating process noise covariance matrix and measurement noise covariance matrix;

[0022] Step S254, predicting the signal state at the current time by using the process noise covariance matrix and the preset system state transition matrix to generate a state prediction value and a covariance prediction value;

[0023] Step S255, calculating a gain by substituting the covariance prediction value, the measurement value at the current time, and the measurement noise covariance matrix into a Kalman gain formula;

[0024] Step S256, calculating the target signal data by substituting the gain, the measurement value, and the state prediction value into a preset weighted fusion formula.

[0025] Optionally, the specific steps of step S3 are:

[0026] Step S31, dynamically matching the target signal data with a nitrogen oxide absorption peak in a preset reference spectrum library by using a spectral similarity analysis algorithm, and calculating a Jacard similarity coefficient;

[0027] Step S32, when the Jacard similarity coefficient is lower than a preset coefficient threshold, triggering a domain adversarial neural network-based transfer learning mechanism to extract a feature representation of the target signal data and generate a domain-invariant feature;

[0028] Step S33, performing parameter optimization on the domain-invariant feature by using a quantum particle swarm optimization algorithm to generate an optimized feature;

[0029] Step S34, performing signal drift compensation correction on the optimized feature by using a time-varying compensation model in combination with a sensor use time length, a zero-point drift coefficient, and a sensitivity attenuation coefficient to generate a target compensation feature;

[0030] Step S35, calculating a Kullback-Leibler divergence by aggregating target domain data from edge nodes in an encrypted manner through a federated learning framework;

[0031] Step S36, performing standardization processing on the target compensation feature by using the Kullback-Leibler divergence to generate standardized concentration data.

[0032] Optionally, the specific steps of step S32 are:

[0033] Step S321, constructing a domain adversarial neural network model containing a gradient reversal layer;

[0034] Step S322, when the Jacard similarity coefficient is lower than a preset coefficient threshold, performing feature extraction on the target signal data by using the domain adversarial neural network model to generate a target feature representation;

[0035] Step S323, performing domain discrimination on the target feature representation by using the domain adversarial neural network model to generate a domain label prediction value.

[0036] Step S324, concentration prediction is performed on the target feature representation by the domain adversarial neural network model to generate a concentration prediction value;

[0037] Step S325, weighted mean square error calculation is performed using the concentration prediction value to generate a concentration regression loss;

[0038] Step S326, domain classification adversarial loss calculation is performed using the domain label prediction value by the gradient inversion layer to generate a domain classification adversarial loss;

[0039] Step S327, the concentration regression loss and the domain classification adversarial loss are used to construct a joint loss function;

[0040] Step S328, based on the joint loss function, an adaptive learning rate strategy is used to update the domain adversarial neural network model to determine the domain-invariant feature.

[0041] Optionally, the specific steps of step S328 are:

[0042] Step S3281, forward propagation and back propagation are performed using the joint loss function to calculate the gradients of the feature extractor, the domain classifier, and the concentration regressor;

[0043] Step S3282, a two-parameter adaptive learning rate strategy is used to dynamically adjust the learning rate of each network layer in the domain adversarial neural network model to generate learning rate data;

[0044] Step S3283, the learning rate data is used to update the parameters of the feature extractor, the domain classifier, and the concentration regressor to generate component update parameters;

[0045] Step S3284, when the component update parameters satisfy a preset convergence condition, the domain-invariant feature generated by the feature extractor is output.

[0046] Optionally, the specific steps of step S34 are:

[0047] Step S341, the cumulative use time length, the initial sensitivity parameter, and the initial zero point parameter of the nitrogen oxide sensor are obtained;

[0048] Step S342, the cumulative use time length, the initial sensitivity parameter, and the initial zero point parameter are used to calculate a time-varying sensitivity parameter and a time-varying zero point parameter;

[0049] Step S343, the time-varying sensitivity parameter and the time-varying zero point parameter are used to perform drift compensation correction on the optimized feature to generate an initial compensation feature;

[0050] Step S344, a sensor digital twin model is constructed, and a preset interference mode is injected in a model virtual environment to verify the robustness of the initial compensation feature, and verification data is generated.

[0051] Step S345, when the verification data does not meet a preset verification standard, an adaptive adjustment mechanism is triggered to dynamically update time-varying sensitivity parameters and time-varying zero-point parameters.

[0052] Step S346, when the verification data meets the preset verification standard, the initial compensation feature at the current time is taken as a target compensation feature.

[0053] Optionally, the specific steps of the step S4 are:

[0054] Step S41, a nitrogen oxide concentration prediction algorithm model based on a spatio-temporal graph convolution network and a long short-term memory network is constructed, and the nitrogen oxide concentration prediction algorithm model comprises a spatio-temporal feature extraction layer, an environmental parameter embedding layer and a concentration prediction layer.

[0055] Step S42, the standardized concentration data is divided into a fixed time window according to a time sequence to generate concentration sequence data.

[0056] Step S43, the real-time collected environmental parameter data is normalized to generate normalized environmental parameters.

[0057] Step S44, the concentration sequence data is input into the spatio-temporal feature extraction layer, spatial correlation features of each monitoring point in a monitoring area are extracted through graph convolution operation, and time sequence features are extracted through a long short-term memory unit to generate spatio-temporal joint features.

[0058] Step S45, the normalized environmental parameters are input into the environmental parameter embedding layer, and the spatio-temporal joint features are fused to generate fusion features.

[0059] Step S46, the fusion features are input into the concentration prediction layer, and a target predicted concentration value is generated through calculation of a full connection neural network.

[0060] Optionally, the specific steps of the step S46 are:

[0061] Step S461, the fusion features are input into the full connection neural network of the concentration prediction layer to generate an initial predicted concentration value.

[0062] Step S462, an initial state vector is set as the initial predicted concentration value, and an initial prediction error covariance matrix is set as a preset diagonal matrix to construct an initial Kalman filter.

[0063] Step S463, dynamically adjusting the state transition matrix of the initial Kalman filter according to the spatial correlation feature of the spatio-temporal graph convolution network, to generate a target Kalman filter;

[0064] Step S464, filtering the initial predicted concentration value through the target Kalman filter to generate an optimized predicted concentration value;

[0065] Step S465, performing forward propagation on the fully connected neural network a preset number of times by using a Monte Carlo dropout method, and inputting the optimized predicted concentration value each time to generate predicted sample data;

[0066] Step S466, calculating the mean and variance of the predicted concentration by using the predicted sample data to generate an initial predicted concentration value and a confidence interval thereof;

[0067] Step S467, when the width of the confidence interval exceeds a preset width threshold, triggering a model reconstruction mechanism and jumping to execute the step S41;

[0068] Step S468, when the width of the confidence interval does not exceed the preset width threshold, taking the initial predicted concentration value at the current time as a target predicted concentration value.

[0069] Optionally, the specific steps of the step S5 are:

[0070] Step S51, constructing a multi-level fuzzy membership function library, including nitrogen oxide concentration membership functions of five levels of excellent, good, light pollution, moderate pollution and severe pollution;

[0071] Step S52, inputting the target predicted concentration value into the fuzzy membership function library to calculate the membership degree vector between the target predicted concentration value and each pollution level;

[0072] Step S53, performing weighted processing on temperature, humidity, wind speed and atmospheric pressure by using a preset environmental parameter weight matrix to generate an environmental influence factor;

[0073] Step S54, combining the membership degree vector and the environmental influence factor, and performing logical judgment through a fuzzy rule reasoning system to generate a pollution level determination result;

[0074] Step S55, calling a preset report template according to the pollution level determination result to automatically fill in detection data, pollution levels and trend analysis to generate a detection report.

[0075] Compared with the prior art, the present application has the following advantages:

[0076] This invention utilizes multiple nitrogen oxide sensors to collect raw signal data of nitrogen oxides in the air of a target detection area in real time. The raw signal data undergoes noise reduction and filtering to generate target signal data, achieving high-quality signal preprocessing without manual intervention. Based on a preset sensor calibration model, signal drift compensation is applied to the target signal data to eliminate signal differences between different sensors / environments, generating unified standardized concentration data. A nitrogen oxide concentration prediction algorithm model, combined with real-time collected environmental parameter data, performs spatiotemporal correlation analysis on the standardized concentration data to generate a target predicted concentration value. Using fuzzy logic, the target predicted concentration value is compared with a preset concentration standard threshold to intelligently determine the pollution level and automatically generate a detection report. This achieves fully automated processing from data acquisition to report generation, significantly improving detection flexibility. Attached Figure Description

[0077] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only preferred embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0078] Figure 1 This is a flowchart of a rapid detection method for nitrogen oxide content in air according to the present invention;

[0079] Figure 2 This is a flowchart of step S2 of a rapid detection method for nitrogen oxide content in air according to the present invention;

[0080] Figure 3 This is a flowchart of step S3 of a rapid detection method for nitrogen oxide content in air according to the present invention;

[0081] Figure 4 This is a flowchart of step S4 of a rapid detection method for nitrogen oxide content in air according to the present invention;

[0082] Figure 5 This is a flowchart of step S5 of a rapid detection method for nitrogen oxide content in air according to the present invention. Detailed Implementation

[0083] To better understand the technical content of this invention, a specific embodiment is provided below, and the invention will be further described in conjunction with the accompanying drawings.

[0084] like Figure 1 The diagram shows a flowchart of a rapid detection method for nitrogen oxide content in air.

[0085] In the embodiments of the present application, the present application is applied to a data processing terminal, which uses an industrial-grade data processing terminal (such as an RTU device, for example, an APAX-5000 series of Advantech), which is built-in with a multi-channel analog input interface (AI) and a digital input interface (DI), and can be directly connected to a plurality of nitrogen oxide sensors (such as an electrochemical sensor NO2-A43F). At least three sensors are installed in a grid-like distribution in a target detection area (with a spacing of ≤10 meters), and the data processing terminal device collects the current signals of the sensors in real time through an RS485 or CAN bus protocol.

[0086] The microcontroller of the data processing terminal terminal device synchronously collects sensor data at a sampling frequency of 10 Hz, ensuring timestamp consistency. The original signal data is stored in binary form in the local storage unit of the terminal, and is uploaded to the cloud server in real time through the MQTT protocol, in the JSON format, including the timestamp, sensor ID and original current value.

[0087] The data processing terminal is built-in with an embedded GPU (such as NVIDIA Jetson Nano) or DSP (digital signal processor), which supports real-time wavelet transform calculation. The approximate symmetric wavelet is used as the base function of the wavelet transform, and the original signal data is subjected to discrete wavelet transform to generate low-frequency approximation coefficients and high-frequency detail coefficients; the low-frequency approximation coefficients and high-frequency detail coefficients are used to construct initial wavelet coefficients; the statistical properties of the high-frequency detail coefficients in the wavelet domain are calculated to determine the threshold, and the initial wavelet coefficients are subjected to threshold processing using a hard threshold function or a soft threshold function to generate target wavelet coefficients; the target wavelet coefficients are subjected to inverse discrete wavelet transform to generate initial signal data; the initial signal data is denoised using an adaptive Kalman filter algorithm combined with a sensor noise covariance matrix to generate target signal data.

[0088] The data processing terminal is preloaded with a domain adversarial neural network (DANN) model, which includes a feature extractor, a gradient reversal layer (GRL) and a concentration regressor, and the model weights are stored in a Flash memory. The target signal data is dynamically matched with the nitrogen oxide absorption peaks in the preset reference spectrum library using a spectral similarity analysis algorithm, and the Jaccard similarity coefficient is calculated; when the Jaccard similarity coefficient is lower than a preset coefficient threshold, a transfer learning mechanism based on the domain adversarial neural network is triggered to extract the feature representation of the target signal data, generating a domain-invariant feature; the quantum particle swarm optimization algorithm is used to optimize the parameters of the domain-invariant feature to generate an optimized feature; the time-varying compensation model is used to compensate and correct the optimized feature for signal drift, generating a target compensation feature, by combining the length of time the sensor is used, the zero-point drift coefficient and the sensitivity attenuation coefficient; the target domain data is aggregated from the edge nodes through a federated learning framework, and the Kullback-Leibler divergence is calculated; the Kullback-Leibler divergence is used to standardize the target compensation feature to generate standardized concentration data.

[0089] The data processing terminal runs a nitrogen oxide concentration prediction algorithm model based on the fusion of spatiotemporal graph convolutional network and long short-term memory network through an edge AI accelerator (such as NVIDIA Jetson AGX Xavier). The adjacency matrix is ​​dynamically generated based on the sensor deployment distance (≤10 meters). A nitrogen oxide concentration prediction algorithm model based on the fusion of spatiotemporal graph convolutional network and long short-term memory network is constructed. The nitrogen oxide concentration prediction algorithm model includes a spatiotemporal feature extraction layer, an environmental parameter embedding layer, and a concentration prediction layer. Standardized concentration data is divided into fixed time windows according to time series to generate concentration sequence data. Real-time collected environmental parameter data is normalized to generate normalized environmental parameters, including temperature, humidity, wind speed, and atmospheric pressure. The concentration sequence data is input into the spatiotemporal feature extraction layer, and spatial correlation features of each monitoring point in the monitoring area are extracted through graph convolution operation, and time series features are extracted through long short-term memory units to generate spatiotemporal joint features. The normalized environmental parameters are input into the environmental parameter embedding layer and fused with the spatiotemporal joint features to generate fused features. The fused features are input into the concentration prediction layer and calculated through a fully connected neural network to generate the target predicted concentration value.

[0090] The data processing terminal stores a multi-level fuzzy membership function library (excellent, good, lightly polluted, etc.) in ROM. The pollution level classification is based on triangular and trapezoidal functions. A multi-level fuzzy membership function library is constructed, containing membership functions for nitrogen oxide concentrations at five levels: excellent, good, lightly polluted, moderately polluted, and heavily polluted. The target predicted concentration value is input into the fuzzy membership function library, and the membership degree vector between it and each pollution level is calculated. A preset environmental parameter weight matrix is ​​used to weight temperature, humidity, wind speed, and atmospheric pressure to generate environmental impact factors. Combining the membership degree vector and environmental impact factors, a fuzzy rule reasoning system performs logical judgment to generate a pollution level determination result. Based on the pollution level determination result, a preset report template is called, automatically filling in the detection data, pollution level, and trend analysis to generate a detection report.

[0091] Preferred, such as Figure 2 The flowchart shown is a step S2 of a rapid detection method for nitrogen oxide content in air.

[0092] In this embodiment of the invention, the approximate symmetric wavelet, namely the Symlet wavelet (Sym8), is used as the basis function for wavelet transform. Due to its approximate symmetry and good time-frequency localization capability, it is suitable for noise reduction of non-stationary signals (such as sensor noise). The data processing terminal has a built-in GPU acceleration library (such as CUDA cuDWT) that supports fast discrete transform of the Sym8 wavelet.

[0093] The original signal data is sampled by ADC (analog-to-digital converter) and stored as a 16-bit floating-point array. The signal is decomposed by three-level discrete wavelet to generate low-frequency approximation coefficients (cA3) and high-frequency detail coefficients (cD1, cD2, cD3).

[0094] The wavelet coefficient construction rule is to retain the low-frequency approximation coefficient: directly retain cA3, which is used for the trend part of the subsequent reconstructed signal. The high-frequency detail coefficient is retained: cD1-cD3 are preliminarily screened (such as removing the coefficients with absolute value less than the absolute value threshold = 1e-4, to reduce redundancy). The low-frequency approximation coefficient cA3 and the high-frequency detail coefficient cD1-cD3 are combined into a multi-dimensional array to obtain the initial wavelet coefficient, which is stored in the Flash memory (such as QSPINOR Flash) of the terminal. The initial wavelet coefficient also includes an index mapping table, which records the starting position and length of each level coefficient, facilitating subsequent threshold processing and inverse transform.

[0095] The determination process of the statistical characteristics of the high-frequency detail coefficient in the wavelet domain to determine the threshold is: based on Stein unbiased risk estimation (SURE) to calculate the noise standard deviation The corresponding calculation formula is:

[0096]

[0097] Then, the wavelet domain threshold is calculated by using the general threshold formula, which is:

[0098]

[0099] wherein, is the noise standard deviation, which is the noise intensity of the sensor original signal in the high-frequency detail coefficient cD1; v1 is the high-frequency detail coefficient of the first-level wavelet decomposition; λ is the wavelet domain threshold; N is the signal length, i.e. the number of original signal sampling points (such as N=1024).

[0100] Hard threshold function:

[0101]

[0102] Soft threshold function:

[0103] Soft(x, λ) = sign(x) · max(|x|-λ, 0);

[0104] Wherein, λ is the wavelet domain threshold value; x is the input signal or data point, indicating the wavelet coefficient that needs to be processed by threshold; Hard(x, λ) is a hard threshold function, which performs binary processing on the input x, retains the signal details greater than the threshold, and directly truncates the noise components less than the threshold; Soft(x, λ) is a soft threshold function, which performs smooth shrinkage processing on the input x, suppresses noise, and reduces signal mutation through linear shrinkage, which is suitable for strong noise scenes.

[0105] According to the signal-to-noise ratio (SNR) dynamic switching function: if SNR> 10dB, the hard threshold function (retaining signal details) is adopted; if SNR≤10dB, the soft threshold function (suppressing strong noise) is adopted. The specific implementation is to run the threshold processing code (such as C / C++) on the DSP (digital signal processor) of the terminal, and use the SIMD instruction to speed up.

[0106] The target wavelet coefficient is reversely combined according to the decomposition level. The cuDWT library function (such as cuDWT_inverse()) of the terminal GPU is called, the target coefficient and the Sym8 base function are input, and the denoised signal is output, so as to obtain the initial signal data. When performing inverse discrete wavelet transform, zero-padding or mirroring is performed on both ends of the signal to reduce truncation error. The mean square error (MSE) of the reconstructed signal and the original signal is calculated, and if MSE> 0.1%, the re-decomposition process is triggered to realize error correction. The output initial signal data is stored in a 16-bit floating point array, and the timestamp is synchronized to the RTC (real-time clock).

[0107] Then, the adaptive Kalman filter algorithm is combined with the sensor noise covariance matrix to further filter and denoise the initial signal data to obtain the target signal data.

[0108] Preferably, the specific steps of step S25 are as follows:

[0109] Step S251, extract the historical time series data of the initial signal data, and calculate the mean, standard deviation and autocorrelation coefficient;

[0110] Step S252, using the mean, standard deviation and autocorrelation coefficient, initializing the state vector and prediction error covariance matrix of the adaptive Kalman filter;

[0111] Step S253, substituting the initialized state vector and prediction error covariance matrix into the preset update formula to generate the process noise covariance matrix and the measurement noise covariance matrix;

[0112] Step S254, using the process noise covariance matrix and the preset system state transition matrix to predict the signal state at the current time to generate the state prediction value and the covariance prediction value;

[0113] Step S255, the covariance prediction value, the measurement value at the current moment and the measurement noise covariance matrix are substituted into the Kalman gain formula to calculate the gain;

[0114] Step S256, the gain, the measurement value and the state prediction value are substituted into the preset weighted fusion formula to calculate the target signal data.

[0115] In the embodiment of the application, N' consecutive samples (such as the first 100 sampling points) before the current moment t are extracted from the initial signal data collected from the sensor or system to obtain historical time series data {x t-N' , x t-N'+1 ,..., x t-1}, which are used to estimate the statistical characteristics of the signal. The mean, standard deviation and autocorrelation coefficient are calculated using the historical time series data. The mean μ x reflects the central tendency of the signal, and the calculation formula is as follows:

[0116]

[0117] The standard deviation σ x reflects the fluctuation range of the signal, and the calculation formula is as follows:

[0118]

[0119] Where N' is the total number of observation values in the data set. x i is the i-th data point, representing a single sample in a group of measurement values. σ x is the standard deviation, measuring the deviation of the data point from the mean μ x , reflecting the fluctuation range of the data; μ x is the mean, reflecting the central position of the data set, i.e. the central tendency of the data.

[0120] The autocorrelation coefficient ρ x (τ) measures the correlation of the signal over time, which is used to model the state transition characteristics.

[0121] The mean μ x , the standard deviation σ x and the autocorrelation coefficient ρ x (τ) are used to initialize the state vector x and the prediction error covariance matrix P t of the adaptive Kalman filter, which converts the statistical characteristics into the initial state of the filter and improves the accuracy of the starting point of the filter. For the nitrogen oxide sensor signal, the state vector can be designed as where s t is the signal value; is the signal change rate; the initial value is s t = μ x , (assuming the initial signal rate of change is zero). The prediction error covariance matrix The diagonal elements are based on the standard deviation σ x The off-diagonal elements reflect the correlation ρ x (1).

[0122] The initialized state vector and the prediction error covariance matrix p t are substituted into the preset update formula to generate the process noise covariance matrix Q t and the measurement noise covariance matrix R t . The process noise covariance matrix Q t reflects the uncertainty of the system state transition, which is related to the signal rate of change. The corresponding update formula is wherein, α is the first adjustable parameter (such as 0.01); σ x is the standard deviation; is the signal rate of change. The measurement noise covariance matrix R t reflects the uncertainty of the sensor measurement, which is related to the signal fluctuation degree. The corresponding update formula is R t = β·σ x 2 wherein, β is the second adjustable parameter (such as 0.01); σ x is the standard deviation.

[0123] The preset system state transition matrix A is used to predict the signal state at the current time t to generate the state prediction value and the covariance prediction value P t|t-1 , which is based on the system dynamic model to predict the current state and provide a priori estimate for the fused measurement. For a linear system, the preset system state transition matrix wherein, Δt is the sampling time interval. The specific prediction process includes: (1) state prediction: (2) covariance prediction: P t|t-1 = A·P t ·A T + Q t , wherein, is the state prediction value; A is the preset system state transition matrix; is the initialized state vector; P t|t-1 is the covariance prediction value; Q t is the process noise covariance matrix; the measurement noise covariance matrix R t

[0124] The covariance prediction value P t|t-1 , the measurement value z at the current time, and the target noise covariance matrix R tThe gain K is calculated using the Kalman gain formula, and the optimal fusion weights are determined by balancing the reliability of the predicted and measured values. Here, the measured value z is the actual sampled value from the sensor. The Kalman gain formula is:

[0125] K = P t|t-1 ·C T ·(C·P t|t-1 ·C T +R) -1 ;

[0126] Where K is the gain; P t|t-1 is the predicted covariance value; z is the measured value at the current time; R is the target noise covariance matrix; C is the observation matrix (e.g., C =

[01] , representing the directly observed signal value).

[0127] The gain K, the measured value z, and the state prediction value Substituting the values ​​into the preset weighted fusion formula, the target signal data (including the target state vector and the target covariance matrix) is calculated. Through optimal weighted fusion, the noise-suppressed target signal data is obtained, improving detection accuracy. The preset weighted fusion formula includes a state update formula and a covariance update formula.

[0128] The state update formula is: in, The target state vector; This refers to the residual (the difference between the measured value and the predicted value).

[0129] The covariance update formula is: P tn = (1-K) t ·C)·P t|t-1 This reflects the updated state estimation error, where P tn Let be the target covariance matrix.

[0130] Preferred, such as Figure 3 The flowchart shown is a step S3 of a rapid detection method for nitrogen oxide content in air.

[0131] In this embodiment of the invention, a spectral similarity analysis algorithm is used to compare the spectral signal output by the sensor corresponding to the target signal data with the nitrogen oxide (NO) in a preset reference spectral library. x The characteristic absorption peaks are dynamically matched, and the Jakarta similarity coefficient is calculated to quantify the degree of matching. A preset reference spectral library contains NO at different concentrations. x Standard absorption spectral data within a specific wavelength range (e.g., the 200-400 nm ultraviolet band) are used to record the wavelength position (λ) and absorbance (B) for each spectral data point, forming a feature set. Wherein M is the number of spectral sampling points. The construction method of the preset reference spectrum library is to collect spectral data in a laboratory environment by using a standard gas (such as a NO2 standard gas), and then store the spectral data in a database after baseline correction and noise filtering.

[0132] The dynamic matching process is: the target signal data is preprocessed (such as interpolation to unify the sampling interval), and the absorption peak position and the corresponding absorbance peak value are extracted as feature points. The feature points of the target signal data are spatially aligned with the feature points of the feature set (allowing a wavelength deviation of ±0.5 nm), and the intersection and union of the matched feature points are calculated. The ratio between the absolute value of the intersection and the absolute value of the union of the feature points is calculated to obtain the Jaccard similarity coefficient J, which has a value range of [0, 1], and the higher the value, the higher the spectral matching degree.

[0133] When the Jaccard similarity coefficient J is lower than a preset coefficient threshold (such as 0.7), a transfer learning mechanism is triggered, and a domain-invariant feature is extracted using a domain adversarial neural network (DANN) to eliminate the domain difference under different sensors or environments. The preset coefficient threshold is determined through experiments, for example, in cross-sensor testing, when J<0.7, it is determined that there is a significant distribution difference between the target domain (current sensor) and the source domain (reference spectrum library).

[0134] The domain adversarial neural network includes: (1) The feature extractor adopts a convolutional neural network (CNN), and the input is the target signal data (spectral sequence), and the output is the target feature representation. (2) The domain classifier: a binary classifier, which judges whether the target feature representation comes from the source domain (reference spectrum library) or the target domain (current sensor), and outputs a domain label prediction value. (3) The gradient reversal layer (GRL) multiplies the gradient by a negative coefficient when backpropagating, forcing the feature extractor to generate domain-invariant features that confuse the domain classifier. (4) The concentration regressor outputs a concentration prediction value, which is used to calculate the concentration regression loss (consistent with step S325).

[0135] Through adversarial training, the target feature extracted by the feature extractor not only maintains the NO x concentration information (supervised by the concentration regressor), but also cannot be distinguished by the domain classifier. Finally, a universal feature that is independent of the sensor / environment, i.e., a domain-invariant feature, is output.

[0136] The quantum particle swarm optimization algorithm (QPSO) is used to optimize the domain-invariant feature f inv , and generate an optimized feature f opt with stronger anti-interference ability. The specific optimization process is as follows:

[0137] Particle coding: The feature parameters (such as CNN output layer weights, feature dimensions) are coded as particle positions X i =[x i1 , x i2 ,..., xiD ], where D is the feature dimension.

[0138] Objective function: classification accuracy F(x) of features in different noise environments as the optimization goal, where M' is the number of test samples; is the predicted class of the kth sample (model output); y k is the true class; (·) is the indicator function (1 for correct classification, otherwise 0).

[0139] Quantum behavior update: global optimal position P g and individual optimal position P i Guiding particle movement, calculating the new position of the particle through the quantum potential well model: x id = P gd ± ω·|C id -x id |ln(1 / μ), where ω is the contraction and expansion coefficient; μ, C id = [0, 1] = uniformly distributed random number; x id is the new position of the particle. After Q iterations (such as Q = 100), select the feature parameter combination that makes Acc maximum to generate the optimized feature f opt .

[0140] Combined with the usage time, zero drift and sensitivity decay of the sensor, the signal drift is corrected through the time-varying compensation model to generate the target compensation feature f com , and the robustness is verified through the digital twin model.

[0141] The sensor usage time records the cumulative working time (such as days) of the sensor from the first use to the present, denoted as s. The zero drift coefficient: through long-term monitoring of the output of the sensor in the absence of nitrogen oxides environment (zero point signal), the zero drift function Z(s) = Z0 + τ's is fitted, where Z0 is the initial zero point (factory calibration value), τ' is the zero drift rate (zero point change per unit time, experimentally calibrated).

[0142] The sensitivity decay coefficient is based on the response decay data of the sensor to standard nitrogen oxide gas, and the function of the sensitivity change over time is fitted. The optimized feature f opt generated in step S33 (including multi-dimensional feature data related to spectral absorbance and concentration) is input. For each feature dimension d, the compensated feature value is calculated: The physical meaning of this formula is: f opt,d- Z(s): remove zero-point drift, get net signal (signal part reflecting actual nitrogen oxide concentration, excluding the influence of sensor's own zero-point offset). The denominator S(s) restores the decayed sensitivity to the initial state (equivalent to "sensitivity normalization" of the signal, making the sensor output of different use lengths comparable, eliminating signal distortion caused by sensitivity decay).

[0143] In the sensor digital twin model, changes in actual environmental factors such as temperature, humidity, electromagnetic interference, etc. (such as preset interference patterns, such as temperature ±10℃ fluctuation, humidity ±20%RH change) are simulated, and the compensated feature f com is input into the model to generate a virtual signal. Calculate the signal-to-noise ratio (SNR), mean square error (MSE), etc. of the virtual signal, if it meets the preset verification standard (such as SNR≥15dB, MSE≤0.01), it is confirmed that the compensation is effective; if not, trigger the adaptive adjustment mechanism. After drift compensation (and optional digital twin verification), the feature data f com obtained is the target compensation feature. This feature has eliminated the influence of sensor zero-point drift and sensitivity decay, and through virtual verification to ensure robustness to environmental interference, it can be directly used for subsequent Kolmogorov-Liebauer divergence calculation (step S35) and standardization processing (step S36).

[0144] Through the federated learning framework, the target domain data is encrypted and aggregated from the edge nodes (such as distributed sensor terminals), and the Kolmogorov-Liebauer (KL) divergence is calculated to measure the distribution difference between the target domain and the global data. The federated learning process is as follows:

[0145] (1) Data encryption: each edge node uses homomorphic encryption technology to process local data, and only uploads the encrypted model parameters (such as mean, variance) to the central server.

[0146] (2) Global aggregation: the central server fuses the parameters of each node to generate a global feature distribution P global (f), and the target domain distribution P target (f) is obtained from the current sensor data statistics.

[0147] The KL divergence calculation formula is:

[0148] Its physical meaning is to measure the deviation degree of the target domain feature distribution from the global distribution, and the smaller the value, the closer the distribution. Where D KL (P target ||P global ) is the Kolmogorov-Liebauer divergence.

[0149] Based on the KL divergence, the target compensation feature is standardized to eliminate distribution differences and generate the final standardized concentration data Cstd The standardized method used includes: (1) distribution alignment: aligning P target (f) mapping to P global (f), so that:

[0150]

[0151] wherein μ global , σ global is the mean and standard deviation of the global features; f com is the target domain feature; f std is the standardized feature data.

[0152] (2) using the absorbance-concentration mapping relationship established in the reference spectrum library (such as Lambert-Beer's law C std =k'·B, k' is a calibration coefficient, and B is absorbance), converting the standardized features into concentration values C std , thereby obtaining standardized concentration data.

[0153] Preferably, the specific steps of step S32 are as follows:

[0154] Step S321, constructing a domain adversarial neural network model comprising a gradient reversal layer;

[0155] Step S322, when the Jaccard similarity coefficient is lower than the preset coefficient threshold, performing feature extraction on the target signal data by the domain adversarial neural network model to generate a target feature representation;

[0156] Step S323, performing domain discrimination on the target feature representation by the domain adversarial neural network model to generate a domain label prediction value;

[0157] Step S324, performing concentration prediction on the target feature representation by the domain adversarial neural network model to generate a concentration prediction value;

[0158] Step S325, performing weighted mean square error calculation on the concentration prediction value to generate a concentration regression loss;

[0159] Step S326, performing domain classification adversarial loss calculation on the domain label prediction value by the gradient reversal layer to generate a domain classification adversarial loss;

[0160] Step S327, using the concentration regression loss and the domain classification adversarial loss to construct a joint loss function;

[0161] Step S328, updating the domain adversarial neural network model based on the joint loss function using an adaptive learning rate strategy to determine the domain-invariant features.

[0162] In the embodiment of the present application, a domain adversarial neural network (DANN) model containing a gradient reversal layer (GRL) is constructed, and the model comprises a feature extractor, a domain classifier, a gradient reversal layer, and a concentration regressor:

[0163] (1) Feature extractor: a convolutional neural network (CNN) is adopted, such as 3 layers of convolution + 2 layers of full connection, the input is target signal data (spectral sequence), and the output is target feature representation. It is used to extract the essential features related to the concentration of nitrogen oxides and suppress the differences between domains.

[0164] (2) Domain classifier: a 2-layer full connection network, the input is target feature representation, and the output is domain label prediction value. It is used to determine whether the feature comes from the reference spectrum library (source domain) or the current sensor (target domain).

[0165] (3) Gradient reversal layer: located between the feature extractor and the domain classifier. In the forward propagation, the input is kept unchanged, and in the backward propagation, the gradient is multiplied by a negative coefficient to force the feature extractor to generate features that confuse the domain classifier.

[0166] (4) Concentration regressor: a 2-layer full connection network, the input is target feature representation, and the output is concentration prediction value. Its role is to regress the concentration of nitrogen oxides from the features, and supervise the feature extractor to retain the concentration information.

[0167] When the Jaccard similarity coefficient is lower than the preset coefficient threshold, it is determined that the source domain and the target domain are significantly different, and the DANN model is triggered. The target signal data is input into the feature extractor for feature extraction to generate target feature representation. The target feature representation is input into the domain classifier, and the domain label probability distribution is output through the softmax function. The label corresponding to the maximum probability is taken as the domain label prediction value. The target feature representation is input into the concentration regressor, and the concentration prediction value is generated through linear transformation. The weighted mean square error (WMSE) is used to calculate the difference between the concentration prediction value and the true value, and the concentration regression loss is generated. Through the gradient reversal layer, the domain label prediction value is compared with the true domain label to calculate the cross-entropy loss and generate the domain classification adversarial loss. The concentration regression loss and the domain classification adversarial loss are weighted and summed to construct a joint loss function. Based on the joint loss function, the model parameters are updated using a double-parameter adaptive learning rate strategy until the convergence condition is met, and the domain-invariant features are output.

[0168] Preferably, the specific steps of step S328 are as follows:

[0169] Step S3281, forward propagation and backward propagation are performed using the joint loss function, and the gradients of the feature extractor, the domain classifier, and the concentration regressor are calculated;

[0170] Step S3282, a double-parameter adaptive learning rate strategy is used to dynamically adjust the learning rate of each network layer in the domain adversarial neural network model to generate learning rate data.

[0171] Step S3283, update the parameters of the feature extractor, the domain classifier and the concentration regressor using the learning rate data to generate component update parameters;

[0172] Step S3284, when the component update parameters meet the preset convergence condition, output the domain-invariant features generated by the feature extractor.

[0173] In the embodiments of the present application, the joint loss function L total reg -h·L adv , wherein L reg is the concentration regression loss; h is a hyperparameter; L adv is the domain classification adversarial loss. The gradients of each component are calculated by forward propagation and back propagation to obtain the gradients of the feature extractor, the domain classifier and the concentration regressor. A double-parameter adaptive strategy is used to dynamically adjust the learning rate of each component:

[0174] (1) Learning rate of the feature extractor: η F (e)=η0·(1+γ·e) -u″ , wherein η F (e) is the learning rate of the feature extractor; η0 is the initial learning rate (such as 0.001); γ is the decay coefficient (such as 0.001); u” is the decay index (such as 0.75); e is the current training iteration number.

[0175] (2) Learning rate of the domain classifier and the regressor: η D =η R =η0, keep the fixed initial learning rate to avoid unstable adversarial training.

[0176] The parameters of the feature extractor, the domain classifier and the concentration regressor are updated using the learning rate data to generate component update parameters. The preset convergence condition is that when the continuous Q' iterations (such as Q' = 10) meet: where ε is the convergence threshold (such as 10 -4 ), then the convergence is determined. After convergence, the output of the feature extractor to the target signal data is extracted as the domain-invariant features.

[0177] Preferably, the specific steps of step S34 are:

[0178] Step S341, obtain the cumulative use time length, the initial sensitivity parameter and the initial zero point parameter of the nitrogen oxide sensor;

[0179] Step S342, calculate the time-varying sensitivity parameter and the time-varying zero point parameter from the cumulative use time length, the initial sensitivity parameter and the initial zero point parameter; ​

[0180] Step S343, drift compensation correction is performed on the optimized feature using the time-varying sensitivity parameter and the time-varying zero point parameter to generate an initial compensation feature;

[0181] Step S344, a sensor digital twin model is constructed, and a preset interference mode is injected into the model virtual environment to verify the robustness of the initial compensation feature and generate verification data;

[0182] Step S345, when the verification data does not meet the preset verification standard, an adaptive adjustment mechanism is triggered to dynamically update the time-varying sensitivity parameter and the time-varying zero point parameter.

[0183] Step S346, when the verification data meets the preset verification standard, the initial compensation feature at the current time is taken as the target compensation feature.

[0184] In the embodiment of the present application, the cumulative use time length of the nitrogen oxide sensor is accumulated from the first activation of the sensor and stored in the log system of the data processing terminal. The initial sensitivity parameter is the factory calibration value, which is stored in the sensor electronic tag or the device database. The initial zero point parameter is the output value in the nitrogen oxide-free environment, which is the factory calibration value, and the storage path is the same as above.

[0185] The calculation formula corresponding to the time-varying sensitivity parameter is: S(t) = S0·e -λ't” ; wherein S(t) is the time-varying sensitivity parameter; S0 is the initial sensitivity parameter, with a unit of mV / ppm, determined by factory calibration and is a fixed value. λ' is the sensitivity decay coefficient, with a unit of h -1 . t" is the cumulative use time length of the sensor, with a unit of hours.

[0186] The calculation formula corresponding to the time-varying zero point parameter is: Z(t) = Z0 + β drift t"; wherein Z0 is the initial zero point parameter, with a unit of mV, representing the initial output signal value of the sensor in the nitrogen oxide-free environment. β drift is the zero point drift coefficient, with a unit of mV / h, describing the rate of drift of the sensor zero point over time. t" is the cumulative use time length of the sensor, with a unit of hours, counted from the first activation of the sensor, updated in real time, and reflecting the aging degree of the sensor.

[0187] The drift compensation correction is performed on the optimized feature f opt using the time-varying sensitivity parameter S(t) and the time-varying zero point parameter Z(t) to generate an initial compensation feature f Based on the simulation model established based on the physical characteristics of the sensor, the input is the environmental parameters (temperature T, humidity H, and pressure P) and the compensation feature f com . The injected preset interference mode includes temperature fluctuation: T ± 10℃; humidity fluctuation: H ± 20℃; electromagnetic interference: superimposed Gaussian white noise (standard deviation σx =0.05). Calculate the signal-to-noise ratio (SNR) and mean square error (MSE) of the output signal to obtain the verification data.

[0188] When the verification data does not meet the preset standards (e.g., SNR < 15dB or MSE > 0.01): an adaptive adjustment mechanism is triggered, dynamically updating the time-varying sensitivity parameter and the time-varying zero-point parameter using the parameter update formula. The parameter update formula is:

[0189] λ′=λ q ·(1+δ λ ), α′=α q ·(1+δ α );

[0190] Where, δ λ δ α λ is the adjustment factor (e.g., 0.05); λ' is the new sensitivity attenuation factor; λ q α' is the sensitivity attenuation coefficient; α' is the new zero-point drift coefficient; α q The zero-point drift coefficient is defined. The time-varying sensitivity parameter S(t) and the time-varying zero-point parameter Z(t) are recalculated using the new parameters α' and λ', and the process returns to step S343. When the verification data meets the preset verification criteria, the initial supplementary feature at the current time is used as the target supplementary feature. The preset verification criteria refer to standard values ​​set in advance based on the actual situation. When the verification data does not meet the preset verification criteria, the process returns to step S342.

[0191] Preferred, such as Figure 4 The flowchart shown is a step S4 of a rapid detection method for nitrogen oxide content in air.

[0192] In this embodiment of the invention, a nitrogen oxide concentration prediction algorithm model is constructed by fusing a spatiotemporal graph convolutional network (STGCN) and a long short-term memory network (LSTM). The nitrogen oxide concentration prediction algorithm model includes a spatiotemporal feature extraction layer, an environmental parameter embedding layer, and a concentration prediction layer. The spatiotemporal feature extraction layer extracts spatial correlation features (e.g., concentration correlation between adjacent monitoring points) by constructing a graph structure (such as an adjacency matrix) between monitoring points through graph convolutional operations (GCN). The LSTM unit processes time-series data (such as historical concentration values) to extract time dependencies (such as the trend of concentration change over time). The output generates a joint feature combining spatial and temporal information (spatiotemporal joint feature). The environmental parameter embedding layer maps normalized environmental parameters (temperature, humidity, etc.) into a low-dimensional vector through an embedding layer (such as a fully connected layer) and fuses it with the spatiotemporal joint feature. The concentration prediction layer uses a fully connected neural network (Dense Layer) to perform a nonlinear mapping on the fused features to generate an initial predicted concentration value.

[0193] The fixed time window, for example, divides the continuous monitoring data into multiple time series with a length of T (e.g., T = 24 represents 24-hour historical data) with a time step of 1 hour. The normalized concentration data: eliminate the dimensional difference by the formula (wherein μ x is the mean, and σ x is the standard deviation). Then, the real-time collected environmental parameter data, including temperature, humidity, wind speed and atmospheric pressure, are normalized to obtain normalized environmental parameters.

[0194] The concentration sequence data are input into the spatio-temporal feature extraction layer, the spatial correlation features of each monitoring point in the monitoring area are extracted through the graph convolution formula, and the time sequence features are extracted through the long short-term memory unit. The spatial correlation features output by the graph convolution are spliced with the time sequence features output by the long short-term memory unit to generate spatio-temporal joint features. The graph convolution formula is:

[0195]

[0196] wherein, (self-loop); is a degree matrix; W (l) is a weight matrix; σ is an activation function; X is a feature matrix; A' is an adjacency matrix; is a spatial correlation feature.

[0197] The normalized environmental parameters are input into the environmental parameter embedding layer, and the normalized environmental parameters and the spatio-temporal joint features are spliced into fusion features. Among them, the importance of different features is dynamically weighted through the attention mechanism.

[0198] The fully connected neural network includes an input layer, a hidden layer and an output layer. The number of nodes of the input layer is equal to the dimension of the fusion features; the hidden layer adopts a multilayer perceptron (MLP), and the number of nodes of each layer is d→d / 2→1, and the activation function is ReLU. The output layer is a single node, which outputs the target predicted concentration value. The loss function used is mean square error (MSE). The high-dimensional fusion features are mapped to the final prediction result, the model training and reasoning are completed, and the target predicted concentration value is obtained.

[0199] Preferably, the specific steps of step S46 are:

[0200] Step S461, input the fusion features into the fully connected neural network of the concentration prediction layer to generate an initial predicted concentration value;

[0201] Step S462, set the initial state vector as the initial predicted concentration value, and set the initial prediction error covariance matrix as a preset diagonal matrix to construct an initial Kalman filter;

[0202] Step S463, dynamically adjust the state transition matrix of the initial Kalman filter according to the spatial correlation feature of the spatio-temporal graph convolution network, and generate a target Kalman filter;

[0203] Step S464, filtering processing is performed on the initial predicted concentration value by using the target Kalman filter, and an optimized predicted concentration value is generated.

[0204] Step S465, the Monte Carlo dropout method is used to perform forward propagation on the fully connected neural network for a preset number of times, and the input of each forward propagation is the optimized predicted concentration value, and a prediction sample data is generated.

[0205] Step S466, the mean and variance of the predicted concentration are calculated by using the prediction sample data, and the initial predicted concentration value and its confidence interval are generated.

[0206] Step S467, when the width of the confidence interval exceeds a preset width threshold, a model reconstruction mechanism is triggered, and step S41 is jumped to execute.

[0207] Step S468, when the width of the confidence interval does not exceed the preset width threshold, the initial predicted concentration value at the current time is taken as the target predicted concentration value.

[0208] In the embodiment of the application, the fusion feature is input into the fully connected neural network of the concentration prediction layer, and the initial predicted concentration value is generated by the fully connected neural network. The initial state vector is set as the initial predicted concentration value, and the prediction error covariance matrix is initialized as a preset diagonal matrix (assuming that the initial error is independent). An initial Kalman filter is constructed, including a state transition matrix, an observation matrix, a process noise covariance and an observation noise covariance.

[0209] According to the spatial correlation feature (such as the correlation strength between monitoring points) extracted by the STGCN, the state transition matrix of the Kalman filter is dynamically updated, and a target Kalman filter is obtained to make the filter adapt to the dynamically changing environment. The prediction value is filtered using the target Kalman filter to suppress noise and correct errors, and an optimized predicted concentration value is obtained. The Monte Carlo dropout method is used to perform forward propagation on the fully connected neural network for a preset number of times, and the input of each forward propagation is the optimized predicted concentration value. The fully connected neural network is forward propagated multiple times, and each time a part of neurons is randomly discarded to generate multiple prediction samples, construct prediction sample data, and estimate the uncertainty of prediction. The mean (as the final prediction value) and variance (reflecting the uncertainty) of the predicted concentration are calculated by using the prediction sample data, and the initial predicted concentration value and its confidence interval are generated. If the width of the confidence interval exceeds a preset width threshold (such as 0.1 ppm), it means that the prediction uncertainty is too large. The model reconstruction mechanism is triggered, and the model is retrained in step S41. When the width of the confidence interval does not exceed the preset width threshold, the initial predicted concentration value at the current time is taken as the target predicted concentration value.

[0210] A preferred flow chart of step S5 of a method for rapid detection of nitrogen oxides content in air is shown in FIG. 5. Figure 5

[0211] In the embodiment of the present application, a multi-level fuzzy membership function library is constructed, which includes five pollution levels (excellent, good, light pollution, moderate pollution, and severe pollution) divided according to the concentration of nitrogen oxides, and a membership function is designed for each level. According to actual needs, the concentration threshold of each level is set. For example: excellent: 0-50 μg / m 3 ; good: 50-100 μg / m 3 ; light pollution: 100-150 μg / m 3 ; moderate pollution: 150-200 μg / m 3 ; severe pollution: >200 μg / m 3 . The membership functions are respectively composed of the following functions: a triangular function suitable for clear boundaries (such as the clear threshold between “excellent” and “good”); a trapezoidal function suitable for fuzzy transition areas (such as the overlap between “good” and “light pollution”); and a Gaussian function suitable for continuously distributed concentration data (such as natural diffusion scenarios).

[0212] The target predicted concentration value is substituted into the membership functions of all five levels to calculate the membership degree of each level. The membership degree vector of the five levels is output, representing the fuzzy result of the current concentration. The preset environmental parameter weight matrix is determined according to expert experience or historical data analysis, and each environmental parameter is assigned a weight. For example: wind speed (a key factor for diffusion): weight 0.4; temperature (affects chemical reaction rate): weight 0.3; humidity (affects particulate matter settlement): weight 0.2; atmospheric pressure (affects vertical diffusion of pollutants): weight 0.1. Environmental impact factor = (wind speed × 0.4) + (temperature × 0.3) + (humidity × 0.2) + (atmospheric pressure × 0.1).

[0213] The fuzzy rules are based on expert knowledge or historical data to formulate IF-THEN rules. For example: rule 1: if “environmental impact factor is high” and “light pollution membership degree ≥ 0.7”, then determine as “light pollution”. Rule 2: if “environmental impact factor is low” and “good membership degree ≥ 0.6”, then determine as “good”. Rule 3: if “severe pollution membership degree ≥ 0.8” and “wind speed < 10 km / h”, then determine as “severe pollution”.

[0214] ​The logical judgment process by the fuzzy rule inference system is: using Mamdani or Sugeno method, combining membership and rules, calculating the fuzzy output of the final pollution level; generating specific pollution level by defuzzification (such as center of gravity method) to obtain the pollution level judgment result. Using the preset report template, including fixed structure: title, detection time, data table, pollution level, trend analysis, suggestion. The detection data is filled in the predicted concentration value, environmental parameter value; the pollution level is filled in the judgment result (such as "light pollution"); the trend analysis is based on historical data or model prediction, generating short-term trend, generating a complete detection report, supporting export or printing.

[0215] The above only is the preferred embodiment of the present application, and does not limit the present application, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method for rapid detection of the nitrogen oxide content of air, characterized in that, The method comprises the following steps: Step S1, collecting original signal data of nitrogen oxides in the air of a target detection area in real time through a plurality of nitrogen oxide sensors; Step S2, performing noise reduction filtering processing on the original signal data to generate target signal data; Step S3, performing signal drift compensation correction on the target signal data based on a preset sensor calibration model to generate standardized concentration data; Step S4, performing spatio-temporal correlation analysis on the standardized concentration data by combining environmental parameter data collected in real time through a nitrogen oxide concentration prediction algorithm model to generate a target predicted concentration value; Step S5, comparing the target predicted concentration value with a preset concentration standard threshold value based on a fuzzy logic judgment algorithm to construct a detection report.

2. The method of claim 1, wherein, The specific steps of step S2 are as follows: Step S21, using an approximately symmetric wavelet as a base function of wavelet transform to perform discrete wavelet transform on the original signal data to generate low-frequency approximation coefficients and high-frequency detail coefficients; Step S22, using the low-frequency approximation coefficients and the high-frequency detail coefficients to construct initial wavelet coefficients; Step S23, calculating statistical characteristics of the high-frequency detail coefficients in a wavelet domain to determine a threshold value, and using a hard threshold function or a soft threshold function to perform threshold processing on the initial wavelet coefficients to generate target wavelet coefficients; Step S24, performing inverse discrete wavelet transform on the target wavelet coefficients to generate initial signal data; Step S25, using an adaptive Kalman filter algorithm in combination with a sensor noise covariance matrix to perform noise reduction on the initial signal data to generate target signal data.

3. The method of claim 2, wherein, The specific steps of step S25 are as follows: Step S251, extracting historical time series data of the initial signal data, and calculating a mean value, a standard deviation and an autocorrelation coefficient; Step S252, using the mean value, the standard deviation and the autocorrelation coefficient to initialize a state vector and a prediction error covariance matrix of an adaptive Kalman filter; Step S253, substituting the initialized state vector and the prediction error covariance matrix into a preset update formula to generate a process noise covariance matrix and a measurement noise covariance matrix; Step S254, using the process noise covariance matrix and a preset system state transition matrix to predict a signal state at a current time to generate a state prediction value and a covariance prediction value; Step S255, substituting the covariance prediction value, a measurement value at the current time and the measurement noise covariance matrix into a Kalman gain formula to calculate a gain; Step S256, substituting the gain, the measurement value and the state prediction value into a preset weighted fusion formula to calculate target signal data.

4. The method of claim 1, wherein, The specific steps of step S3 are as follows: Step S31, using a spectral similarity analysis algorithm to dynamically match the target signal data with nitrogen oxide absorption peaks in a preset reference spectrum library, and calculating a Jacard similarity coefficient; Step S32, when the Jacard similarity coefficient is lower than a preset coefficient threshold value, triggering a transfer learning mechanism based on a domain adversarial neural network to extract a feature representation of the target signal data to generate a domain-invariant feature; Step S33, parameters of the field-invariant feature are optimized by using a quantum particle swarm optimization algorithm to generate an optimized feature; Step S34, signal drift compensation correction is performed on the optimized feature by using a time-varying compensation model in combination with a sensor use time length, a zero-point drift coefficient and a sensitivity attenuation coefficient to generate a target compensation feature; Step S35, target domain data is aggregated from edge nodes by using a federated learning framework to calculate a Kullback-Leibler divergence; Step S36, the target compensation feature is standardized by using the Kullback-Leibler divergence to generate standardized concentration data.

5. The method of claim 4, wherein, The specific steps of the step S32 are as follows: Step S321, a domain adversarial neural network model containing a gradient reversal layer is constructed; Step S322, when the Yakar similarity coefficient is lower than a preset coefficient threshold, feature extraction is performed on the target signal data by using the domain adversarial neural network model to generate a target feature representation; Step S323, domain discrimination is performed on the target feature representation by using the domain adversarial neural network model to generate a domain label prediction value; Step S324, concentration prediction is performed on the target feature representation by using the domain adversarial neural network model to generate a concentration prediction value; Step S325, weighted mean square error calculation is performed by using the concentration prediction value to generate a concentration regression loss; Step S326, domain classification adversarial loss calculation is performed by using the domain label prediction value through the gradient reversal layer to generate a domain classification adversarial loss; Step S327, a joint loss function is constructed by using the concentration regression loss and the domain classification adversarial loss; Step S328, based on the joint loss function, an adaptive learning rate strategy is used to update the domain adversarial neural network model to determine a field-invariant feature.

6. The method of claim 5, wherein, The specific steps of the step S328 are as follows: Step S3281, forward propagation and back propagation are performed by using the joint loss function to calculate the gradients of the feature extractor, the domain classifier and the concentration regressor; Step S3282, a double-parameter adaptive learning rate strategy is used to dynamically adjust the learning rates of each network layer in the domain adversarial neural network model to generate learning rate data; Step S3283, the parameters of the feature extractor, the domain classifier and the concentration regressor are updated by using the learning rate data to generate component update parameters; Step S3284, when the component update parameters meet a preset convergence condition, the field-invariant feature generated by the feature extractor is output.

7. The method of claim 4, wherein, The specific steps of the step S34 are as follows: Step S341, the cumulative use time length, the initial sensitivity parameter and the initial zero-point parameter of the nitrogen oxide sensor are obtained; Step S342, the cumulative use time length, the initial sensitivity parameter and the initial zero-point parameter are used to calculate a time-varying sensitivity parameter and a time-varying zero-point parameter; Step S343, drift compensation correction is performed on the optimized feature by using the time-varying sensitivity parameter and the time-varying zero-point parameter to generate an initial compensation feature; Step S344, a sensor digital twin model is constructed, and a preset interference mode is injected in a model virtual environment to verify the robustness of the initial compensation feature, and verification data is generated; Step S345, when the verification data does not meet a preset verification standard, an adaptive adjustment mechanism is triggered to dynamically update time-varying sensitivity parameters and time-varying zero-point parameters; Step S346, when the verification data meets the preset verification standard, the initial compensation feature at the current time is taken as a target compensation feature.

8. The method of claim 1, wherein, The specific steps of the step S4 are: Step S41, a nitrogen oxide concentration prediction algorithm model based on a fusion of a spatio-temporal graph convolution network and a long short-term memory network is constructed, and the nitrogen oxide concentration prediction algorithm model comprises a spatio-temporal feature extraction layer, an environmental parameter embedding layer and a concentration prediction layer; Step S42, the standardized concentration data is divided into fixed time windows according to a time sequence to generate concentration sequence data; Step S43, real-time collected environmental parameter data is normalized to generate normalized environmental parameters; Step S44, the concentration sequence data is input into the spatio-temporal feature extraction layer, spatial correlation features of each monitoring point in a monitoring area are extracted through graph convolution operation, and time sequence features are extracted through a long short-term memory unit to generate spatio-temporal joint features; Step S45, the normalized environmental parameters are input into the environmental parameter embedding layer, and the spatio-temporal joint features are fused to generate fusion features; Step S46, the fusion features are input into the concentration prediction layer, and a target prediction concentration value is generated through calculation of a fully connected neural network.

9. The method of claim 8, wherein, The specific steps of the step S46 are: Step S461, the fusion features are input into the fully connected neural network of the concentration prediction layer to generate an initial prediction concentration value; Step S462, an initialization state vector is set as the initial prediction concentration value, and an initialization prediction error covariance matrix is set as a preset diagonal matrix to construct an initial Kalman filter; Step S463, a state transition matrix of the initial Kalman filter is dynamically adjusted according to the spatial correlation features of the spatio-temporal graph convolution network to generate a target Kalman filter; Step S464, the initial prediction concentration value is filtered through the target Kalman filter to generate an optimized prediction concentration value; Step S465, a Monte Carlo dropout method is used to perform forward propagation of the fully connected neural network for a preset number of times, and the input of each forward propagation is the optimized prediction concentration value to generate prediction sample data; Step S466, the mean and variance of the prediction concentration are calculated using the prediction sample data to generate an initial prediction concentration value and a confidence interval thereof; Step S467, when the width of the confidence interval exceeds a preset width threshold, a model reconstruction mechanism is triggered, and the step S41 is executed; Step S468, when the width of the confidence interval does not exceed the preset width threshold, the initial prediction concentration value at the current time is taken as a target prediction concentration value.

10. The method of claim 1, wherein, The specific steps of the step S5 are: Step S51, a multi-level fuzzy membership function library is constructed, containing nitrogen oxide concentration membership functions of five levels of excellent, good, light pollution, moderate pollution and heavy pollution; Step S52, input the target predicted concentration value into the fuzzy membership function library, calculate the membership degree vector between it and each pollution level; Step S53, the temperature, humidity, wind speed and atmospheric pressure are weighted processed by using a preset environmental parameter weight matrix to generate an environmental impact factor; Step S54, combining the membership degree vector and the environmental impact factor, logical judgment is performed through a fuzzy rule inference system to generate a pollution level judgment result; Step S55, according to the pollution level judgment result, a preset report template is called to automatically fill in the detection data, pollution level and trend analysis to generate a detection report.

Citation Information

Cited By

  • Gas analysis method and system for gas source purification process

    CN121253775A

  • Water quality suspended matter detection system and method based on sensing data

    CN121476068A

  • Water quality suspended matter detection system and method based on sensing data

    CN121476068B