Gas detection method

By combining physical model and data-driven collaborative pressure compensation method, using air pressure sensors and models to drive the backpropagation network, the problem of gas detection accuracy in high-pressure environments is solved, and high-precision carbon dioxide and oxygen detection is achieved.

CN120064191AActive Publication Date: 2025-05-30HONGMAI ENVIRONMENTAL TECH (SHANGHAI) CO LTD

Patent Information

Application Number
CN202510528301.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-05-30
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

Traditional gas detection methods have accuracy problems in detecting carbon dioxide and oxygen under high pressure environments. The existing pressure compensation methods are insufficient in accuracy and ignore the relationship between the two.

Method used

The coordinated pressure compensation method combining physical model-driven and data-driven is adopted to obtain the denoised air pressure through the air pressure sensor and Kalman filtering algorithm, and a correction model is constructed based on Bill Lambert's law and Nernst equation to synergize the concentration correction result.

Benefits of technology

It improves the gas detection accuracy in high-pressure environments, realizes accurate detection of carbon dioxide and oxygen, and improves pressure correction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120064191A_ABST
    Figure CN120064191A_ABST
Patent Text Reader

Abstract

The invention discloses a gas detection method, which relates to the field of gas detection, and comprises the following steps: measuring and obtaining the initial concentration of carbon dioxide and oxygen at the current moment and the de-noised air pressure processed by a Kalman filtering algorithm, adopting a model to drive a back propagation network, and constructing an air pressure correction model based on the Beer-Lambert law and a Nernst equation; and substituting the denoised air pressure at the current moment into the correction model, cooperatively generating a primary correction expression by combining the nonlinear mapping of the initial concentration at the current moment, generating a second hidden expression based on the primary correction expression, the measurement equipment parameters and the nonlinear correlation mapping of the denoised air pressure at the current moment, and obtaining the concentration at the current moment through linear modulation. Through cooperative pressure compensation combining physical model driving and data driving, the pressure correction precision is improved, and accurate detection of carbon dioxide and oxygen in a high-pressure environment is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of gas detection, and specifically to a gas detection method. Background Art

[0002] Traditional gas detection means have frequent problems in detecting carbon dioxide and oxygen in a high-pressure environment. The physical properties of the gas change due to high pressure, interfering with the detection principle and resulting in large deviations in the detection results. There is an urgent need for innovative detection methods to improve accuracy.

[0003] However, in the existing pressure compensation methods for carbon dioxide and oxygen detection, unidirectional compensation is carried out through the fitting of a physical model or through a neural network based on data-driven for correction, ignoring the association between the two and having insufficient pressure compensation accuracy. Summary of the Invention

[0004] In view of the deficiencies of the existing technology, the present invention proposes a gas detection method to provide a collaborative pressure compensation scheme combining physical model-driven and data-driven, improve the pressure correction accuracy, and achieve accurate gas detection in a high-pressure environment.

[0005] The technical solution to achieve the object of the present invention is as follows: A gas detection method, comprising the following specific steps: The air pressure at the current moment is converted into voltage through the cooperation of the thin film, flexible resistor and constant current source circuit in the air pressure sensor and the digital signal at the current moment is obtained through analog-to-digital conversion and the state transition equation and observation equation based on the working principle of the air pressure sensor are established by using the Kalman filtering algorithm. Combining with the digital observation value at the current moment the Kalman filter gain is calculated to update and obtain the denoised air pressure at the current moment wherein the digital observation value is the observation result of the digital signal ; The spectral absorption characteristics related to carbon dioxide are fitted by using multiple linear regression to obtain the preliminary concentration of carbon dioxide at the current moment and the loop current generated by the oxidation-reduction reaction at the current moment is measured by using an electrochemical oxygen sensor to obtain the preliminary concentration of oxygen at the current moment ; Design a model-driven backpropagation network, and respectively construct a model-driven backpropagation network based on the Beer-Lambert law and the Nernst equation with respect to the air pressure ; ​​​​​​​ Correction model , a double hidden layer structure is designed, where the first hidden layer takes the denoised air pressure at the current moment and substitutes it into the correction model , and combines it with the preliminary concentration at the current moment to perform a primary pressure correction through a non - linear mapping. The second hidden layer learns the potential correlation between the primary pressure correction result, the measurement device parameters and the denoised air pressure to perform a secondary pressure correction, and obtains the concentration at the current moment through linear modulation . The correction model includes an absorption rate correction model and a diffusion rate correction model . The preliminary concentration at the current moment includes the preliminary concentration of carbon dioxide and the preliminary concentration of oxygen . The concentration at the current moment includes the concentration of carbon dioxide and the concentration of oxygen .

[0006] Furthermore, the air pressure at the current moment is converted into a digital signal at the current moment by an air pressure sensor , and the specific steps are as follows: Based on Hooke's law, the film deformation amount at the current moment is equal to the product of the air pressure at the current moment and the film area divided by the film stiffness coefficient ; The film deformation drives the displacement of the thimble, causing a change in resistance. The thimble displacement amount is equal to the film deformation amount . The resistance change amount at the current moment is equal to the product of the thimble displacement amount and the displacement - resistance conversion coefficient ; Based on Ohm's law, the change in resistance causes a change in the voltage of the constant - current source circuit. The voltage of the constant - current source circuit at the current moment becomes the product of the built - in resistance value and the resistance change amount ... Multiply the sum by a constant current ; At the current moment of the voltage Generate a digital signal at the current moment through analog-to-digital conversion of .

[0007] Furthermore, obtain the denoised air pressure at the current moment through the Kalman filter algorithm , including the following specific steps: Define the air pressure state vector at the current moment At the current moment including the air pressure at the current moment At the current moment of the air pressure and the air pressure change rate ; Construct the state transition equation of the air pressure at the current moment. The air pressure change from the previous moment of the air pressure to the current moment of the air pressure to the current moment of the air pressure is equal to the first process noise at the current moment plus the product of the air pressure change rate at the previous moment and the elapsed time. The air pressure change rate at the current moment is equal to the air pressure change rate at the previous moment plus the second process noise at the current moment of the air pressure change rate is equal to the air pressure change rate at the previous moment of the air pressure change rate plus the second process noise at the current moment , and extract the state transition matrix at the current moment and the process noise covariance matrix at the current moment based on the matrix form of the state transition equation and at the current moment ; ; Obtain the digital signal with respect to the air pressure based on the working principle of the air pressure sensor, that is, the digital signal is equal to the constant bias plus the product of the first air-sensing parameter and the air pressure . Introduce the observation noise and the air pressure change rate for the linear influence on the digital signal , and construct the observation equation of the digital observation value with respect to the air pressure , that is, the digital observation value equals the first air-sensing parameter multiplied by the air pressure plus the second air-sensing parameter multiplied by the air pressure change rate plus the observation noise , extract the observation matrix based on the matrix form of the observation equation and the observation noise covariance matrix at the current moment ; ; Superimpose the process noise covariance matrix on the generalized congruence transformation of the estimated covariance matrix at the previous moment and the state transition matrix at the current moment to obtain the prior estimated covariance matrix at the current moment , the prior estimated covariance matrix reflects the estimated uncertainty considering the process noise under the prior condition of the known estimated covariance matrix at the previous moment , where the generalized congruence transformation of the first matrix and the second matrix is defined as the product of the second matrix, the first matrix, and the transpose of the second matrix; Multiply the sum of the generalized congruence transformation of the prior estimated covariance matrix at the current moment and the observation matrix by the transpose of the observation matrix at the current moment to obtain the Kalman gain at the current moment , the Kalman gain at the current moment determines the confidence level of the digital observation value at the current moment ; Use the product of the Kalman gain at the current moment and the observation residual at the current moment to correct the air pressure state estimation vector at the previous moment to obtain the air pressure state estimation vector at the current moment , the air pressure state estimation vector at the current moment includes the denoised air pressure and the air pressure estimation change rate at the current moment , where, at the current moment ; Multiply the Kalman gain at the current moment by the observation residual at the current moment to correct the air pressure state estimation vector at the previous moment to obtain the air pressure state estimation vector at the current moment , the air pressure state estimation vector at the current moment includes the denoised air pressure and the air pressure estimation change rate at the current moment and the air pressure estimation change rate at the current moment and the air pressure estimation change rate at the current moment Observation residuals is the current moment digital observation value of subtracted by the observation matrix and the air pressure state estimation vector at the previous moment the product of; By the identity matrix and the current moment Kalman gain of and the observation matrix the difference product of the prior estimated covariance matrix is corrected to obtain the estimated covariance matrix at the current moment .

[0008] Specifically, at the current moment infrared light is emitted to the gas to be measured and the infrared spectrum of the gas to be measured is obtained through a spectrometer, and the intensities of characteristic absorption peaks related to carbon dioxide are identified. Through multiple linear regression, the intensities of characteristic absorption peaks are multiplied by the corresponding regression coefficients and superimposed with the intercept reflecting the measurement error of the spectrometer and environmental factors not taken into account to generate the initial carbon dioxide concentration at the current moment , and the regression coefficients are pre-obtained by least squares fitting.

[0009] Specifically, at the current moment an electrochemical oxygen sensor is used to measure the preliminary oxygen concentration . In the electrochemical oxygen sensor, oxidation and reduction reactions occur between the anode and cathode and oxygen respectively to promote the flow of electrons, generating the loop current at the current moment , and the preliminary oxygen concentration is the initial value of the oxygen concentration plus the loop current at the current moment and the difference between the initial value of the loop current multiplied by the sensor sensitivity .

[0010] Furthermore, the Beer-Lambert law is used to establish an absorption rate correction model . The absorption rate correction model has a positive correlation with the standard absorption rate , and the positive correlation coefficient is in the form of a power function of the ratio of the air pressure to the standard air pressure . The exponent of the power function is the pressure sensitivity index , and the standard absorption rate ​Is the standard atmospheric pressure The absorption rate of carbon dioxide for infrared light under the standard atmospheric pressure, and the absorption rate correction model Describes the change in the absorption rate of carbon dioxide with the same concentration for the same infrared light under different atmospheric pressures The higher the absorption rate, the more accurate the measurement of the spectrometer

[0011] Furthermore, the Nernst equation is used to establish the diffusion rate correction model The diffusion rate correction model Is positively correlated with the standard diffusion rate And the positive correlation coefficient is in the form of a linear function of the difference between the atmospheric pressure And the standard atmospheric pressure The linear coefficient of the linear function is the pressure sensitivity coefficient The standard diffusion rate Is the diffusion rate of oxygen under the standard atmospheric pressure The diffusion rate correction model Describes the diffusion ability of oxygen with the same concentration under different atmospheric pressures The stronger the diffusion ability, the more sufficient the oxidation-reduction reaction of oxygen in the electrochemical oxygen sensor, and the more accurate the measurement of the electrochemical oxygen sensor

[0012] Furthermore, the model-driven backpropagation network includes a first hidden layer, a second hidden layer, and an output layer; The first hidden layer substitutes the denoised atmospheric pressure At the current moment Into the correction model To obtain the physical correction coefficient At the current moment The denoised atmospheric pressure At the current moment And the preliminary concentration Are combined into the first superimposed input The linear modulation of the first superimposed input Is mapped through the ReLU activation function to analyze the non-linear correlation between the preliminary concentration And the denoised atmospheric pressure To generate the first hidden representation At the current moment The first hidden representation And the physical correction coefficient Are multiplied to generate the first corrected representation ; The second hidden layer obtains the measurement device parameters And combines them with the first corrected representation At the current moment And the denoised atmospheric pressure To construct the second superimposed input , through the ReLU activation function to the second superposition input The linear modulation of the With denoising pressure The nonlinear association of The second hidden representation of , where the measurement equipment parameters are Including the initial light intensity of the spectrometer and initial value of loop current of electrochemical oxygen sensor ; The output layer converts the current moment The second hidden representation of Perform linear modulation to generate the current moment Concentration .

[0013] Specifically, the model-driven back propagation network needs to collect multiple sets of gas samples with known concentrations to obtain preliminary concentrations during the pre-training phase. , De-noised air pressure during measurement and measuring device parameters And construct a training set, the loss function is defined as the concentration of the model-driven back propagation network output The error with the known concentration of the gas sample is back-propagated based on the gradient of the loss function with respect to the network parameters involved in the model-driven back-propagation network, and iterative training is performed using stochastic gradient descent or Adam optimizer.

[0014] Furthermore, as an improvement, an improved particle swarm algorithm is used to replace the traditional pre-training method, including the following specific steps: Set the maximum number of iterations , randomly generated The position and velocity vector of each particle in round 0, each particle's position and velocity vector represent a set of network parameters and forward direction, respectively. is the total number of particles; The initial round The particles are trained as network parameters respectively, and the loss of each particle in the initial round is obtained, and the global optimal position and the global optimal loss Update the position and loss of the particle with the smallest loss in the initial round respectively; Start a new round of iteration, in the In round, Particles By inertia weight Partially reserved Wheel velocity vector , through the learning factor Reference global optimal position With the error of the position of the n-th round, update and obtain the velocity vector of the n-th round, and superimpose it with the position of the n-th round to obtain the position of the n-th round; Use the position of the particle at the n-th round as network parameters for training, and obtain the loss of the particle at the n-th round. Consider the top particles with the smallest loss in the n-th round and the remaining particles as the advanced particles and backward particles of the n-th round respectively; Randomly pair pairs of advanced particles in the n-th round. For the first advanced particle and the second advanced particle in the p-th pair of advanced particles, distribute genetic weights inversely proportional to the losses of the advanced particle and the advanced particle at the n-th round. Weight and sum the positions and velocity vectors of the advanced particle and the advanced particle at the n-th round according to the genetic weights to obtain the position and velocity vector of the high-quality offspring particle of the p-th pair of advanced particles at the n-th round, ; Randomly pair q pairs of backward particles in the n-th round. For the first backward particle and the second backward particle in the q-th pair of backward particles, randomly extract and recombine the positions and velocity vectors of the backward particle and the backward particle at the n-th round to obtain the position and velocity vector of the mutated offspring particle of the q-th pair of backward particles at the n-th round, ; Adopt and ; and at the n-th round to obtain the position and velocity vector of the mutated offspring particle of the q-th pair of backward particles at the n-th round, ; Adopt The descendant particles of the round replace the lagging particles of the round, and take the positions of the descendant particles of the round as network parameters respectively and perform training to obtain the loss of each descendant particle in the round, where the descendant particles of the round include the high-quality descendant particles of the round and the mutated descendant particles of the round; Update the global optimal position and the global optimal loss to the position and loss corresponding to the particle with the minimum loss among the particles and descendant particles in the round, and calculate the mean square error of the loss in the round; When the mean square error of the loss in the round is less than the minimum value or the number of rounds is equal to the maximum number of iteration rounds at this time, stop the iteration and fix the updated global optimal position in the round as the network parameter, and in other cases, jump to start a new round of iteration.

[0015] Compared with the prior art, the present invention adopts a model-driven backpropagation network, constructs a correction model of the infrared light absorption rate of carbon dioxide with respect to air pressure based on the Beer-Lambert law, constructs a correction model of the diffusion rate of oxygen with respect to air pressure based on the Nernst equation, multiplies the denoised air pressure at the current moment by the non-linear mapping of the correction model and the preliminary concentration at the current moment, generates a primary correction representation through physical model-constrained data driving, further analyzes the potential correlation among the primary correction representation, the measurement device parameters, and the denoised air pressure at the current moment through non-linear mapping, generates a second hidden representation and increases the stability through linear modulation to obtain the concentration at the current moment, effectively combines the physical model and data driving, improves the pressure correction accuracy, and realizes the accurate detection of carbon dioxide and oxygen in a high-pressure environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flowchart of the gas detection method in the present invention; Figure 2 is a working schematic diagram of the air pressure sensor in the present invention; Figure 3 is a schematic diagram of the model-driven backpropagation network in the present invention; Figure 4Flow chart of the improved particle swarm optimization algorithm in the present invention.

[0017] Reference numerals: 1, thin film; 2, thimble; 3, flexible resistor; 4, constant current source; 5, built-in resistor; 6, voltage measuring device; 7, analog-to-digital converter. Detailed implementation manner

[0018] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0019] Embodiment 1

[0020] As Figure 1 shown, a specific embodiment of the present invention discloses a gas detection method, including the following specific steps: Using a barometric pressure sensor based on Hooke's law and Ohm's law, the barometric pressure at the current moment is converted into an observable voltage through the cooperation of a thin film, a flexible resistor and a constant current source circuit, and the digital signal at the current moment is obtained through analog-to-digital conversion. The Kalman filtering algorithm is introduced, and the state transition equation and the observation equation are established based on the working principle of the barometric pressure sensor. The Kalman filtering gain is calculated by using probability statistics and recursive filtering in combination with the digital observation value at the current moment to update and obtain the denoised barometric pressure at the current moment, where the digital observation value is the observation result of the digital signal; The barometric pressure is converted into an observable voltage , and the digital signal at the current moment is obtained through analog-to-digital conversion . The Kalman filtering algorithm is introduced, and the state transition equation and the observation equation are established based on the working principle of the barometric pressure sensor. The Kalman filtering gain is calculated by using probability statistics and recursive filtering in combination with the digital observation value at the current moment to update and obtain the denoised barometric pressure at the current moment , where the digital observation value is the observation result of the digital signal ; Among them, the digital observation value is the observation result of the digital signal ; At the current moment , the spectral absorption characteristics related to carbon dioxide in the infrared spectrum obtained by the spectrometer are obtained by using multiple linear regression analysis to obtain the preliminary concentration of carbon dioxide at the current moment . At the current moment , an electrochemical oxygen sensor is used to measure the loop current formed by the oxidation-reduction reaction at the current moment to obtain the preliminary concentration of oxygen at the current moment ; At the current moment ; ; Design a model-driven backpropagation network, and respectively construct a correction model for the barometric pressure based on Beer-Lambert's law and Nernst equation , and design a double hidden layer structure. Among them, the first hidden layer substitutes the denoised barometric pressure at the current moment into the correction model , and combines the current moment and substitutes it into the correction model , and combines the current moment Initial concentration Perform a pressure correction on the non - linear mapping of . The second hidden layer learns the pressure correction result and measurement device parameters through the non - linear mapping and the denoised air pressure to perform a secondary pressure correction for the potential association of , and obtain the concentration at the current moment through linear modulation of , the correction model includes an absorption rate correction model and a diffusion rate correction model , the concentration at the current moment of includes the initial concentration of carbon dioxide and the initial concentration of oxygen , the measurement device parameters include the initial light intensity of the spectrometer and the initial loop current value of the electrochemical oxygen sensor , the concentration at the current moment of includes the carbon dioxide concentration and the oxygen concentration .

[0021] As Figure 2 shown, further, use a barometric sensor based on Hooke's law and Ohm's law to convert the air pressure at the current moment of into a digital signal at the current moment of , including the following specific steps: When the air pressure at the current moment of acts on the thin film 1, based on Hooke's law, the force on the thin film at the current moment of is the product of the air pressure and the thin film area , and the deformation of the thin film at the current moment of is equal to the force on the thin film divided by the stiffness coefficient of the thin film , specifically as follows: ; The deformation of the thin film drives the thimble 2 to displace the same distance, that is, the displacement of the thimble is equal to the deformation of the thin film . The thimble 2 is connected to the flexible resistor 3. The displacement of the thimble 2 causes a change in the resistance of the flexible resistor 3 at the current moment of , and the change in resistance is related to the displacement of the thimble Is directly proportional as follows: , Wherein, Is the displacement-resistance conversion coefficient of the flexible resistor 3; The constant current source circuit composed of the constant current source 4 is connected to the flexible resistor 3. When the resistance change of the flexible resistor 3 is , the voltage Of the constant current source circuit at the current moment Changes based on Ohm's law as follows: , Wherein, And Are respectively the constant current of the constant current source circuit and the internal resistance value of the internal resistor 5; The voltage Is measured by the voltage measuring device 6 and converted into the digital signal At the current moment As follows: , Wherein, And Are respectively the analog-to-digital conversion coefficient and the analog-to-digital conversion bias.

[0022] Furthermore, although the digital observation value Obtained by combining the working principle of the pressure sensor and observing the digital signal at the current moment Can directly obtain the air pressure At the current moment By reverse calculation, there will be a large error in reverse calculating the air pressure In actual measurement of the pressure sensor. The Kalman filter algorithm is introduced. Based on the working principle of the pressure sensor, the state transition equation and the observation equation are established. The Kalman filter gain is calculated by combining probability statistics and recursive filtering with the digital observation value And the denoised air pressure At the current moment Is obtained, including the following specific steps: Define the air pressure state vector At the current moment , wherein, And Are respectively the air pressure and the air pressure change rate at the current moment . Ideally, the air pressure changes uniformly with time. Considering the environmental volatility, the process noise is introduced to construct the state transition equation of the air pressure . The state transition equation of the air pressure Describes the air pressure From the previous moment To the current moment The law of air pressure change is as follows: , Among them, and are the air pressure and air pressure change rate at the previous moment respectively, and are the first process noise and the second process noise at the current moment respectively, and they follow Gaussian distribution; Define the state transition matrix at the current moment to describe the law of air pressure change from the previous moment to the current moment when there is no process noise, as follows: ; Define the process noise covariance matrix at the current moment to describe the first process noise and the second process noise introduced at the current moment , as follows: ; Ideally, according to the working principle of the air pressure sensor, the digital signal at any moment is inversely deduced with respect to the air pressure conversion equation, as follows: , Among them, is the first air-sensing parameter, is the constant bias. Considering the influence of the observation noise and the fluctuation of the air pressure change rate on the observation of the digital signal , according to the state transition equation, it can be known that the influence of the air pressure change rate on the digital observation value is a linear superposition. Then the observation equation of the digital observation value with respect to the air pressure is specifically: , Among them, is the second air-sensing parameter, is the observation noise and follows Gaussian distribution, replaces the constant bias introducing a certain volatility; Define the observation matrix to describe the air pressure and the air pressure change rate For digital observations Define the observation noise covariance matrix at the current moment to describe the observation noise introduced at the current moment ; Obtain the estimated covariance matrix at the previous moment and calculate the prior estimated covariance matrix at the current moment based on the conditional probability and the state transition matrix at the current moment as follows: , where is the transpose of the state transition matrix at the current moment , and the prior estimated covariance matrix describes the estimation uncertainty considering process noise under the prior condition of knowing the estimated covariance matrix at the previous moment Based on the observation matrix and the observation noise covariance matrix at the current moment calculate the Kalman gain at the current moment , where is the transpose of the observation matrix, and the Kalman gain at the current moment further considers the estimation uncertainty with observation noise. The Kalman gain determines the confidence level of the digital observations when updating to obtain the barometric state estimation vector at the current moment ; According to the Kalman gain at the current moment and combining with the digital observations at the current moment update the barometric state estimation vector at the previous moment to obtain the barometric state estimation vector at the current moment specifically as: , that is, weight the observation residual by the Kalman gain at the current moment to remove noise, and the barometric state estimation vector , where and are the denoised air pressure and the rate of change of air pressure estimation at the current moment, respectively; According to the Kalman gain at the current moment and combined with the prior estimation covariance matrix to update and obtain the estimation covariance matrix at the current moment , where is the identity matrix, and the uncertainty of the prior estimation covariance matrix is adjusted through the Kalman gain such that each time the Kalman filtering algorithm is executed, the estimation covariance matrix will gradually converge and the estimation uncertainty of the air pressure state vector will gradually decrease. Specifically, at the current moment infrared light with an initial light intensity and a continuous wavelength range is emitted to the gas to be measured. At the other end of the optical path, the infrared light passing through the gas to be measured is collected by a spectrometer and dispersed according to the wavelength to obtain the infrared spectrum of the gas to be measured, and the intensity of

[0023] characteristic absorption peaks related to carbon dioxide is identified. The intensity of the characteristic absorption peaks related to carbon dioxide is obtained. Through multiple linear regression, the intensity of the characteristic absorption peaks related to carbon dioxide is linearly summed to obtain the initial carbon dioxide concentration at the current moment , specifically as follows: , where is the intercept, resulting from the measurement error of the spectrometer and environmental factors not taken into account, including the constant offset caused by temperature and air pressure, and is the regression coefficient of the intensity of the th characteristic absorption peak . The regression coefficient is obtained by pre-measuring multiple groups of carbon dioxide gas samples with different concentrations and fitting them using the least squares method.

[0024] Specifically, at the current moment , an electrochemistry oxygen sensor is used to measure the preliminary oxygen concentration . In the electrochemistry oxygen sensor, the anode and the cathode on the electrode surface are connected through an electrolyte. Oxygen undergoes an oxidation reaction with the metal material at the anode and releases electrons, and the electrons are transferred to the cathode through an external circuit. Oxygen obtains electrons at the cathode and undergoes a reduction reaction, thereby generating the loop current at the current moment , the sensor sensitivity based on the electrochemical oxygen sensor Calculate the initial oxygen concentration , specifically: , Among them, and are the initial oxygen concentration value and the initial loop current value respectively, is the sensor sensitivity, which is equal to the change in loop current and the change in oxygen concentration The ratio of, at the current moment The change in loop current and the change in oxygen concentration are respectively equal to the loop current at the current moment minus the initial loop current and the initial oxygen concentration at the current moment and the current moment minus the initial oxygen concentration . .

[0025] Specifically, whether the model-driven backpropagation network corrects to obtain the carbon dioxide concentration or corrects to obtain the oxygen concentration , it has the same network structure and similar processing methods. The difference is that: When the model-driven backpropagation network corrects the initial carbon dioxide concentration at the current moment , the correction model selects the absorption rate correction model , and the measurement device parameter is the initial light intensity , and the output is the carbon dioxide concentration ; ; When the model-driven backpropagation network corrects the initial oxygen concentration at the current moment , the correction model selects the diffusion rate correction model , and the measurement device parameter is the initial loop current , and the output is the oxygen concentration .

[0026] Furthermore, the Beer-Lambert law is used to establish the absorption rate correction model , and the absorption rate correction model is positively correlated with the standard absorption rate , and the positive correlation coefficient is the air pressure and the standard air pressure Power function form of ratio, absorption rate correction model Specifically as follows: , Among them, the standard absorption rate is the absorption rate of carbon dioxide for infrared light under standard air pressure , is the pressure sensitivity index, which is determined during the pre-training of the model-driven backpropagation network. The absorption rate correction model describes the change in the absorption rate of carbon dioxide with the same concentration for the same infrared light under different air pressures . The higher the absorption rate, the more accurate the measurement of the spectrometer.

[0027] Furthermore, the Nernst equation is used to establish the diffusion rate correction model , and the diffusion rate correction model shows a positive correlation with the standard diffusion rate , and the positive correlation coefficient is in the form of a linear function of the difference between the air pressure and the standard air pressure . The diffusion rate correction model is specifically as follows: , Among them, the standard diffusion rate is the diffusion rate of oxygen under standard air pressure , is the pressure sensitivity coefficient, which is determined during the pre-training of the model-driven backpropagation network. The diffusion rate correction model describes the diffusion ability of oxygen with the same concentration under different air pressures . The stronger the diffusion ability, the more sufficient the oxidation-reduction reaction of oxygen in the electrochemical oxygen sensor, and the more accurate the measurement of the electrochemical oxygen sensor.

[0028] As Figure 3 shown, furthermore, the model-driven backpropagation network includes a first hidden layer, a second hidden layer, and an output layer; The first hidden layer substitutes the denoised air pressure at the current moment into the correction model to obtain the physical correction coefficient at the current moment . Combine the denoised air pressure at the current moment with the preliminary concentration to form the first superimposed input . Map the linear modulation of the first superimposed input through the ReLU activation function to analyze the preliminary concentration and the denoised air pressure The non - linear association generates the first hidden representation at the current moment as follows: , specifically as follows: , Among them, and are the first weight matrix and the first bias of the first hidden layer respectively. The product of the first hidden representation and the physical correction coefficient is used as the first - stage corrected representation of the first hidden layer . Among them, the first hidden representation is obtained based on a data - driven neural network, and the physical correction coefficient is driven based on a correction model. Multiplying the physical correction coefficient by the first hidden representation can, when calculating the gradient in the pre - training stage, use the correction model to constrain the learning of the first hidden representation , while enhancing the non - linear expression ability of the first hidden representation and also satisfying the physical laws or equations corresponding to the correction model; The second hidden layer obtains the measurement device parameters , combines them with the first - stage corrected representation at the current moment and the denoised air pressure to construct the second superimposed input . Through the ReLU activation function, the linear modulation of the second superimposed input is mapped to analyze the non - linear association between the measurement device parameters and the denoised air pressure and act on the first - stage corrected representation to generate the second hidden representation at the current moment , specifically as follows: , Among them, and are the second weight matrix and the second bias of the second hidden layer respectively; The output layer then performs a linear modulation once to stabilize the output of the model - driven back - propagation network, generating the concentration at the current moment , where and are the output weight matrix and the output bias of the output layer respectively.

[0029] Specifically, in the pre - training stage, the model - driven back - propagation network needs to collect multiple groups of gas samples with known measured concentrations to obtain the preliminary concentration 、Denoising air pressure during measurement and measurement device parameters and construct a training set, where the loss function is defined as the concentration output by the model-driven backpropagation network The error from the known concentration of the gas sample. Based on the gradient of the loss function with respect to the network parameters involved in the model-driven backpropagation network, backpropagation is performed, and iterative training is carried out using stochastic gradient descent or the Adam optimizer. By continuously adjusting the network parameters along the negative gradient direction to reduce the loss, when the loss converges, the pre-training of the model-driven backpropagation network is completed and the network parameters are fixed. The network parameters include the pressure sensitivity index in the absorption rate correction model and the pressure sensitivity coefficient in the diffusion rate correction model the first weight matrix of the first hidden layer and the first bias the second weight matrix of the second hidden layer and the second bias the output weight matrix of the output layer and the output bias .

[0030] As Figure 4 shown, further, considering that the traditional stochastic gradient descent or Adam optimizer has an initial value sensitivity problem for the pre-training of the model-driven backpropagation network, that is, improper selection of the initial values of the network parameters will greatly affect the effect of the model-driven backpropagation network, and the initial value setting has strong empiricism and requires a large number of experiments for adjustment and attempt. At the same time, the traditional pre-training method of the model-driven backpropagation network is prone to falling into the local optimum problem. Therefore, an improved particle swarm optimization algorithm is used to replace the traditional pre-training method. The improved particle swarm optimization algorithm introduces genetic mutation operations into the traditional particle swarm optimization algorithm, including the following specific steps: Set the maximum number of iteration rounds , and randomly generate particle position and velocity vectors at the initial round (round 0) in the solution space. The position of each particle represents a set of network parameters, the velocity vector of each particle represents the forward direction of the particle in the solution space, and the magnitude of the velocity vector is the forward distance of the particle in the solution space. The dimension of the position is equal to the dimension of the velocity vector is equal to the dimension of the solution space is equal to the total number of network parameters of the model-driven backpropagation network, where is the total number of particles and is a multiple of 4; Take the particles in the initial round as the network parameters of the model-driven backpropagation network respectively and perform single-round training using the training set to obtain the loss of each particle in the initial round, and take the global optimal position Update them separately to the position and loss corresponding to the particle with the minimum loss among the Start a new round of iteration. In the th round, for the th particle In the th round, based on the velocity vector and referring to the global optimal position and combining with the inertia weight update to obtain the velocity vector in the th round, specifically as follows: , where is the position of particle in the th round, and are the learning factor and the random coefficient in the th round respectively. The random coefficient is between 0 and 1, ; Particle starting from the position in the th round, updates to obtain the position of particle in the th round according to the velocity vector in the th round; Take the position of particle in the th round as the network parameters of the model-driven backpropagation network and perform a single-round training using the training set to obtain the loss of particle in the th round; Regard the particles with the smallest losses among the particles in the th round as the advanced particles in the th round and the remaining particles as the backward particles in the th round; Regard the advanced particles in the th round as randomly paired to generate groups of advanced particle pairs. For the th group of advanced particle pairs , where and They are respectively the first and second advanced particles in the -th group of advanced particle pairs. According to the loss of the advanced particles in the -th round and the reciprocal of the ratio of the loss of the advanced particles in the -th round, the -th group of genetic weight pairs is generated. Among them, and are respectively the genetic weights of the advanced particles in the -th group of genetic weight pairs. The positions and velocity vectors of the advanced particles in the -th round are weighted and summed according to the corresponding genetic weights respectively to generate the positions and velocity vectors of the high-quality offspring particles of the -th group of advanced particle pairs in the -th round. A total of positions and velocity vectors of the high-quality offspring particles in the -th round are obtained. Among them, ; The -th round of lagging particles are randomly paired to generate groups of lagging particle pairs. For the -th group of lagging particle pairs, among them, and are respectively the first and second lagging particles in the -th group of lagging particle pairs. The corresponding elements in the positions and velocity vectors of the lagging particles in the -th round are randomly selected and recombined to form the positions and velocity vectors of the mutant offspring particles of the -th group of lagging particle pairs in the -th round. A total of positions and velocity vectors of the mutant offspring particles in the -th round are obtained. Among them, ; Adopt offspring particles in the -th round to replace lagging particles in the -th round, and offspring particles in the -th round to replace lagging particles in the -th round, and offspring particles in the -th round to replace lagging particles in the ; Use offspring particles in the -th round to replace lagging particles in the -th round, and offspring particles in the The positions of the offspring particles of the round are used as the network parameters of the model-driven backpropagation network respectively, and a single round of training is carried out using the training set to obtain the loss of each offspring particle in the round, where the offspring particles in the round include high-quality offspring particles of the round and mutated offspring particles of the round. Since the high-quality offspring particles are generated by genetic inheritance of the advanced particles with good training effects in the round, compared with the backward particles in the round, they are closer to the globally optimal network parameters, effectively improving the training efficiency of the model-driven backpropagation network. At the same time, the mutated offspring particles are randomly generated based on the backward particles with poor training effects in the round, which can effectively expand the search range of the particles in the solution space and avoid falling into the local optimum problem; The globally optimal position and the globally optimal loss are updated to the positions and losses corresponding to the particles with the minimum loss among the particles and offspring particles in the round respectively. According to the losses of all particles and offspring particles in the round, the mean squared error of the loss in the round is calculated; When the mean squared error of the loss in the round is less than the minimum value or the number of rounds is equal to the maximum number of iteration rounds , the iteration of the improved particle swarm algorithm is stopped, and the globally optimal position updated in the round is used as the network parameters of the pre-trained model-driven backpropagation network and fixed; When the mean squared error of the loss in the round is greater than the minimum value and the number of rounds is less than the maximum number of iteration rounds , jump to start a new round of iteration.

[0031] The present invention discloses a gas detection method, which measures and obtains the preliminary concentrations of carbon dioxide and oxygen at the current moment and the denoised air pressure processed by the Kalman filtering algorithm. A model-driven backpropagation network is adopted to construct a correction model for air pressure based on the Beer-Lambert law and the Nernst equation. The denoised air pressure at the current moment is substituted into the correction model, and a first correction representation is jointly generated through the non-linear mapping of the preliminary concentrations at the current moment. A second hidden representation is generated through the non-linear correlation mapping of the first correction representation, the measurement device parameters, and the denoised air pressure at the current moment. The concentration at the current moment is obtained through linear modulation. Through the collaborative pressure compensation combining physical model drive and data drive, the pressure correction accuracy is improved, and the accurate detection of carbon dioxide and oxygen in a high-pressure environment is realized.

[0032] The above is only the preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions falling within the idea of the present invention belong to the protection scope of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, several improvements and refinements made without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A gas detection method, characterized in that: The specific steps include: Measure the current preliminary concentration of carbon dioxide and oxygen, and obtain the denoised air pressure at the current moment by combining the air pressure sensor and Kalman filter algorithm; A model-driven back propagation network with a double hidden layer structure is designed, and correction models for air pressure are constructed based on Beer-Lambert's law and Nernst equation respectively. The denoised air pressure at the current moment is substituted into the correction model through the first hidden layer and multiplied with the nonlinear mapping of the preliminary concentration at the current moment. A correction representation is generated collaboratively based on model-driven and data-driven. The nonlinear relationship between the correction representation, measurement equipment parameters and the denoised air pressure at the current moment is learned through the second hidden layer to generate a second hidden representation. The linear modulation of the second hidden representation is used as the concentration at the current moment. The correction model includes an absorption rate correction model and a diffusion rate correction model. The preliminary concentration includes a preliminary concentration of carbon dioxide and a preliminary concentration of oxygen. The concentration at the current moment includes a carbon dioxide concentration and an oxygen concentration.

2. The gas detection method according to claim 1, characterized in that: The Beer-Lambert law is used to construct an absorptivity correction model. The absorptivity correction model is positively correlated with the standard absorptivity and the positive correlation coefficient is in the form of a power function of the ratio of air pressure to standard air pressure. The exponent of the power function is the pressure sensitivity index. The standard absorptivity is the absorptivity of carbon dioxide to infrared light under standard air pressure. The absorptivity correction model describes the relationship between the absorptivity of carbon dioxide to infrared light and the change in air pressure. The absorptivity affects the measurement accuracy of carbon dioxide concentration.

3. The gas detection method according to claim 1, characterized in that: The Nernst equation is used to establish a diffusion rate correction model. The diffusion rate correction model is positively correlated with the standard diffusion rate, and the positive correlation coefficient is in the form of a linear function of the difference between the air pressure and the standard air pressure. The linear coefficient of the linear function is the pressure sensitivity coefficient. The standard diffusion rate is the diffusion rate of oxygen under standard air pressure. The diffusion rate correction model describes the diffusion capacity of oxygen of the same concentration under different air pressures, and the diffusion capacity affects the measurement accuracy of oxygen concentration.

4. The gas detection method according to claim 1, characterized in that: The model-driven back propagation network includes a first hidden layer, a second hidden layer and an output layer; The first hidden layer substitutes the denoised air pressure at the current moment into the correction model to obtain the physical correction coefficient at the current moment, combines the denoised air pressure at the current moment with the preliminary concentration as a first superposition input, maps the linear modulation of the first superposition input through the ReLU activation function to analyze the nonlinear correlation between the preliminary concentration and the denoised air pressure, generates a first hidden representation at the current moment, and multiplies the first hidden representation with the physical correction coefficient to generate a correction representation; The second hidden layer obtains the measurement device parameters, combines them with the primary correction representation and the denoised air pressure at the current moment to construct a second superposition input, maps the linear modulation of the second superposition input through the ReLU activation function to analyze the nonlinear correlation between the measurement device parameters and the denoised air pressure, and generates the second hidden representation at the current moment, wherein the measurement device parameters include the initial light intensity and the initial value of the loop current; The output layer linearly modulates the second hidden representation at the current moment to generate the concentration at the current moment.

5. The gas detection method according to claim 1 or 4, characterized in that: The model-driven back propagation network is pre-trained based on the improved particle swarm algorithm, including the following specific steps: initialization The position and velocity vector of each particle. The position and velocity vectors are a set of network parameters and the forward direction, respectively. is the total number of particles; Obtain the loss based on the initialization position of each particle and determine the global optimal position and global optimal loss; In each round, each particle updates the velocity vector and position of this round based on the velocity vector of the previous round, combined with the global optimal position and the position of the previous round; According to the position of each particle updated in this round, the loss is obtained and the advanced particles and backward particles of this round are divided. The advanced particles of this round are paired and the weighted sum of the two paired advanced particles is used to generate the corresponding high-quality offspring particles. The backward particles of this round are paired and the two paired backward particles are randomly recombined to generate the corresponding mutant offspring particles. Replace the lagging particles in this round with the offspring particles in this round, obtain the loss according to the position of each offspring particle in this round, re-determine the global optimal position and global optimal loss of this round, and calculate the mean square error of the loss of this round. The offspring particles include high-quality offspring particles and mutant offspring particles; When the mean square error of the loss in this round is less than the minimum value or the number of rounds in this round is equal to the maximum number of iterations, the iteration is stopped and the global optimal position updated in this round is used as the network parameter. In other cases, a new round of iteration is started.

6. The gas detection method according to claim 1, characterized in that: The method of measuring the preliminary concentration of carbon dioxide and the preliminary concentration of oxygen at the current moment, and obtaining the denoised air pressure at the current moment by combining the air pressure sensor and the Kalman filter algorithm, includes the following specific steps: Multiple linear regression is used to fit the spectral absorption characteristics related to carbon dioxide to obtain the preliminary concentration of carbon dioxide at the current moment; An electrochemical oxygen sensor is used to measure the loop current generated by the redox reaction at the current moment to obtain the initial oxygen concentration at the current moment; The current air pressure is converted into voltage through the cooperation of thin film, flexible resistor and constant current source circuit in the air pressure sensor, and the digital signal at the current moment is obtained through analog-to-digital conversion. The Kalman filter algorithm is used to establish the state transfer equation and observation equation based on the working principle of the air pressure sensor. The Kalman filter gain is calculated in combination with the digital observation value at the current moment to update the denoised air pressure at the current moment, where the digital observation value is the observation result of the digital signal.

7. The gas detection method according to claim 1 or 6, characterized in that: The Kalman filter algorithm is used to obtain the denoised air pressure at the current moment, and includes the following specific steps: Construct the state transfer equation of the current air pressure, and sort out and extract the current state transfer matrix and the current process noise covariance matrix. The state transfer equation is used to describe the changing trend of air pressure and air pressure change rate over time. Based on the working principle of the air pressure sensor, the influence of observation noise and air pressure change rate on the digital signal is comprehensively considered, and the observation equation is constructed to describe the linear correlation between the digital observation value and the air pressure and the air pressure change rate. The observation matrix and the observation noise covariance matrix at the current moment are sorted and extracted. Combine the estimated covariance matrix of the previous moment with the state transfer matrix of the current moment to obtain the prior estimated covariance matrix of the current moment, and combine the observation matrix and the observation noise covariance matrix to calculate the Kalman gain of the current moment; The pressure state estimation vector at the current moment is obtained by correcting the product of the Kalman gain at the current moment and the observation residual at the current moment. The pressure state estimation vector at the current moment includes the denoised air pressure at the current moment. The prior estimated covariance matrix is ​​corrected by the difference between the unit matrix and the product of the Kalman gain and the observation matrix at the current moment to obtain the estimated covariance matrix at the current moment.

8. The gas detection method according to claim 6, characterized in that: The method converts the current air pressure into voltage by cooperating with the film, the flexible resistor and the constant current source circuit in the air pressure sensor and obtains the digital signal at the current moment through analog-to-digital conversion, including the following specific steps: Based on Hooke's law, the film deformation at the current moment is equal to the product of the air pressure at the current moment and the film area divided by the film stiffness coefficient; The deformation of the film drives the displacement of the ejector pin, which causes the resistance change. The displacement of the ejector pin is equal to the deformation of the film. The resistance change at the current moment is equal to the product of the displacement of the ejector pin and the displacement-resistance conversion coefficient. Based on Ohm's law, the change in resistance causes the voltage of the constant current source circuit to change. The voltage of the constant current source circuit at the current moment becomes the sum of the built-in resistance value and the resistance change multiplied by the constant current. The voltage at the current moment is converted into a digital signal at the current moment.

9. The gas detection method according to claim 6, characterized in that: The obtaining of the preliminary concentration of carbon dioxide at the current moment includes: At the current moment, infrared light is emitted to the gas to be tested, and the infrared spectrum of the gas to be tested is obtained through a spectrometer. The characteristic absorption peak intensity related to carbon dioxide is identified, and all relevant characteristic absorption peak intensities are multiplied by the corresponding regression coefficients through multivariate linear regression and superimposed with the intercept reflecting the measurement error of the spectrometer and environmental factors to generate the initial concentration of carbon dioxide at the current moment. The regression coefficient is obtained in advance by least squares fitting.

10. The gas detection method according to claim 6, characterized in that: The electrochemical oxygen sensor includes an anode and a cathode, which respectively undergo oxidation reaction and reduction reaction with oxygen at the current moment to promote the flow of electrons and generate a loop current at the current moment. The initial oxygen concentration is the initial value of the oxygen concentration plus the difference between the loop current at the current moment and the initial value of the loop current multiplied by the sensor sensitivity.

Citation Information

Patent Citations

  • Method and sensor for detecting gas concentration based on data physical double-drive model

    CN118655187A

  • Intelligent induction type cable quick connector plugging method

    CN119249658A

  • Apparatus and computer-implemented method for determining at least one solver-based estimate, and apparatus and computer-implemented method for training a deep neural network

    EP3772021A1

  • Method for producing high purity N-hydroxy succinimide using succinic anhydride

    KR1020230027520A

  • Method for correcting spectral data for data due to the spectral measurement process itself and estimating unknown property and / or composition data of a sample using such method

    US5121337A

Cited By

  • Inspection robot safety early warning method and system based on multi-modal data fusion

    CN120526530A

  • Gas detection alarm method

    CN120629055A

  • Gas detection alarm method

    CN120629055B