Gas detection method, device, computer equipment, readable storage medium and product

By applying the signal extraction and identification model of the response signal output by the gas sensor, the problem that gas detection results are affected by environmental factors is solved, and higher detection accuracy and efficiency are achieved.

CN119044417BActive Publication Date: 2025-03-04SOUTHERN POWER GRID DIGITAL GRID RESEARCH INSTITUTE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411498757.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-03-04
Estimated Expiration
2044-10-25

AI Technical Summary

Technical Problem

Existing gas sensors are susceptible to environmental factors, resulting in inaccurate detection results.

Method used

By extracting the response signals output by the gas sensor, the envelope signal and the detailed signal are obtained respectively. The gas type identification model and the gas concentration identification model are used. The gas type and concentration identification model are identified based on these signals, and the ambient temperature is considered to improve detection accuracy.

Benefits of technology

It improves the accuracy and efficiency of gas detection, reduces the impact on external factors, and enhances the reliability of gas type and concentration recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119044417B_ABST
    Figure CN119044417B_ABST
Patent Text Reader

Abstract

The present application relates to a gas detection method, device, computer equipment, readable storage medium and product, and relates to the field of gas detection technology. The method includes: in response to a gas detection instruction, a gas sensor is used to detect gas in the target environment to obtain a response signal output by the gas sensor; the response signal is extracted to obtain an envelope signal reflecting the overall change trend of the response signal and a detail signal containing high-frequency information of the response signal; the gas type of the ambient gas is identified based on the envelope signal through a gas type recognition model; the gas concentration of the ambient gas is identified based on the detail signal and the ambient temperature of the target environment through a gas concentration recognition model; the gas concentration recognition model is obtained by transfer learning on the gas type recognition model; the gas type and gas concentration of the ambient gas are used together as the gas detection result of the target environment. The use of this method can improve the accuracy of gas detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of gas detection technology, and in particular to a gas detection method, device, computer equipment, readable storage medium and product. Background Art

[0002] As society pays more and more attention to environmental quality and safety, gas detection has begun to be widely used in environmental monitoring, industrial safety, automobile emission detection, household appliances and air quality monitoring.

[0003] At present, gas detection is usually performed using a gas sensor, which is a converter that converts information such as the composition and concentration of a gas into a corresponding electrical signal. However, existing gas sensors are easily affected by environmental factors, resulting in inaccurate detection results. Summary of the invention

[0004] Based on this, it is necessary to provide a gas detection method, device, computer equipment, computer-readable storage medium and computer program product that can improve the accuracy of gas detection in response to the above technical problems.

[0005] In a first aspect, the present application provides a gas detection method, comprising: in response to a gas detection instruction for a target environment, performing gas detection on the target environment through a gas sensor, and obtaining a response signal for the ambient gas in the target environment output by the gas sensor; performing signal extraction on the response signal to obtain an envelope signal and a detail signal respectively; the envelope signal refers to a signal reflecting the overall change trend of the response signal; the detail signal refers to a signal containing high-frequency information of the response signal; through a gas type recognition model, based on the envelope signal, performing type recognition on the ambient gas to obtain the gas type of the ambient gas; through a gas concentration recognition model, based on the detail signal and the ambient temperature of the target environment, performing concentration recognition on the ambient gas to obtain the gas concentration of the ambient gas; the gas concentration recognition model is obtained by performing transfer learning on the gas type recognition model; and the gas type and gas concentration of the ambient gas are used together as the gas detection result of the target environment.

[0006] In one of the embodiments, signal extraction is performed on the response signal to obtain an envelope signal and a detail signal respectively, including: smoothing the response signal to obtain a smoothed signal; extracting a gas detection requirement from a gas detection instruction, and determining a signal extraction method that matches the gas detection requirement based on the gas detection requirement; the signal extraction method includes a first extraction method for the envelope signal and a second extraction method for the detail signal; according to the first extraction method, signal extraction is performed on the smoothed signal to obtain an envelope signal; according to the second extraction method, signal extraction is performed on the smoothed signal to obtain a detail signal.

[0007] In one of the embodiments, the method further includes: reconstructing the response signal through an automatic encoder to obtain a reconstructed target signal; identifying the response signal as an abnormal signal based on the reconstruction error between the target signal and the response signal to obtain an abnormal signal identification result of the response signal; when the abnormal signal identification result indicates that the response signal is an abnormal signal, compensating the response signal to obtain a compensated signal; updating the response signal according to the compensated signal, executing the step of: extracting the response signal to obtain an envelope signal and a detail signal, respectively.

[0008] In one of the embodiments, the method also includes: for different types of sample gases in different sample environments, obtaining a sample response signal of the gas sensor for each type of sample gas; based on the sample response signal, training a first initial model for identifying the gas type until the recognition error of the first initial model is lower than a first error threshold, thereby obtaining a gas type recognition model; extracting model parameters of the gas type recognition model, and generating a second initial model for identifying the gas concentration based on the model parameters; based on the sample response signal, training the second initial model until the recognition error of the second initial model is lower than a second error threshold, thereby obtaining a gas concentration recognition model.

[0009] In one of the embodiments, for different types of sample gases in different sample environments, a sample response signal of a gas sensor for each type of sample gas is obtained, including: constructing sample environments with different temperatures by periodic pulse heating; for different types of sample gases in each sample environment, performing gas detection by a gas sensor to obtain a sample response signal for each type of sample gas.

[0010] In one of the embodiments, the method also includes: constructing an abnormal response signal for a gas detection process of a gas sensor; extracting output features of an output layer of a gas type recognition model, and training an initial encoder based on the output features and the abnormal response signal until a reconstruction error of the initial encoder is lower than a reconstruction error threshold, thereby obtaining an automatic encoder.

[0011] In the second aspect, the present application also provides a gas detection device, including: a signal acquisition module, which is used to respond to a gas detection instruction for a target environment, perform gas detection on the target environment through a gas sensor, and obtain a response signal for the ambient gas in the target environment output by the gas sensor; a signal extraction module, which is used to extract the response signal and obtain an envelope signal and a detail signal respectively; the envelope signal refers to a signal reflecting the overall change trend of the response signal; the detail signal refers to a signal containing high-frequency information of the response signal; a gas type identification module, which is used to identify the type of ambient gas based on the envelope signal through a gas type identification model to obtain the gas type of the ambient gas; a gas concentration identification module, which is used to identify the concentration of ambient gas based on the detail signal and the ambient temperature of the target environment through a gas concentration identification model to obtain the gas concentration of the ambient gas; the gas concentration identification model is obtained by performing transfer learning on the gas type identification model; a detection result generation module, which is used to use the gas type and gas concentration of the ambient gas as the gas detection result of the target environment.

[0012] In a third aspect, the present application also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: in response to a gas detection instruction for a target environment, gas detection is performed on the target environment through a gas sensor, and a response signal for the ambient gas in the target environment output by the gas sensor is obtained; signal extraction is performed on the response signal to obtain an envelope signal and a detail signal respectively; the envelope signal refers to a signal reflecting the overall change trend of the response signal; the detail signal refers to a signal containing high-frequency information of the response signal; through a gas type recognition model, based on the envelope signal, the type of the ambient gas is recognized to obtain the gas type of the ambient gas; through a gas concentration recognition model, based on the detail signal and the ambient temperature of the target environment, the concentration of the ambient gas is recognized to obtain the gas concentration of the ambient gas; the gas concentration recognition model is obtained by performing transfer learning on the gas type recognition model; the gas type and gas concentration of the ambient gas are used together as the gas detection result of the target environment.

[0013] In a fourth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the following steps when the computer program is executed by a processor: in response to a gas detection instruction for a target environment, gas detection is performed on the target environment through a gas sensor, and a response signal for the ambient gas in the target environment output by the gas sensor is obtained; signal extraction is performed on the response signal to obtain an envelope signal and a detail signal respectively; the envelope signal refers to a signal reflecting the overall change trend of the response signal; the detail signal refers to a signal containing high-frequency information of the response signal; through a gas type recognition model, based on the envelope signal, the type of the ambient gas is recognized to obtain the gas type of the ambient gas; through a gas concentration recognition model, based on the detail signal and the ambient temperature of the target environment, the concentration of the ambient gas is recognized to obtain the gas concentration of the ambient gas; the gas concentration recognition model is obtained by performing transfer learning on the gas type recognition model; the gas type and gas concentration of the ambient gas are used together as the gas detection result of the target environment.

[0014] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which implements the following steps when executed by a processor: in response to a gas detection instruction for a target environment, performing gas detection on the target environment through a gas sensor, and obtaining a response signal for the ambient gas in the target environment output by the gas sensor; performing signal extraction on the response signal to obtain an envelope signal and a detail signal respectively; the envelope signal refers to a signal reflecting the overall change trend of the response signal; the detail signal refers to a signal containing high-frequency information of the response signal; through a gas type recognition model, based on the envelope signal, the type of the ambient gas is recognized to obtain the gas type of the ambient gas; through a gas concentration recognition model, based on the detail signal and the ambient temperature of the target environment, the concentration of the ambient gas is recognized to obtain the gas concentration of the ambient gas; the gas concentration recognition model is obtained by performing transfer learning on the gas type recognition model; the gas type and gas concentration of the ambient gas are used together as the gas detection result of the target environment.

[0015] The above-mentioned gas detection method, device, computer equipment, computer-readable storage medium and computer program product. In response to the gas detection instruction for the target environment, the target environment is first detected by a gas sensor to obtain a response signal for the ambient gas in the target environment output by the gas sensor. Then, the response signal is extracted to obtain an envelope signal and a detail signal respectively. The envelope signal refers to a signal reflecting the overall change trend of the response signal. This change trend is usually closely related to the type of gas. Therefore, the present application inputs the envelope signal into the gas type recognition model to identify the type of the ambient gas and obtain the gas type of the ambient gas. The detail signal refers to a signal containing high-frequency information of the response signal. These high-frequency information are usually closely related to the concentration change of the gas. Therefore, the present application uses a gas concentration recognition model to identify the concentration of the ambient gas based on the detail signal and the ambient temperature of the target environment to obtain the gas concentration of the ambient gas. In this way, the advantages of different signals can be fully utilized to improve the detection accuracy of gas type and gas concentration. In addition, the present application also takes into account the influence of ambient temperature on gas concentration. It can be understood that the concentration of a gas at different temperatures will be different. Therefore, this application also introduces the parameter of ambient temperature when identifying gas concentration, which can effectively avoid the influence of external factors on the detection results, thereby further improving the accuracy of gas detection results. Moreover, the gas concentration recognition model in this application is obtained by transfer learning on the gas type recognition model, which can effectively reduce the dependence of the gas concentration recognition model on signal data, thereby speeding up the model recognition speed and further improving the gas detection speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0017] FIG1 is a diagram showing an application environment of a gas detection method according to an embodiment;

[0018] FIG2 is a schematic diagram of a flow chart of a gas detection method in one embodiment;

[0019] FIG3 is a schematic diagram of a gas type recognition model in one embodiment;

[0020] FIG4 is a schematic diagram of a gas concentration identification model in one embodiment;

[0021] FIG5 is a schematic diagram of a signal extraction process in one embodiment;

[0022] FIG6 is a schematic diagram of a process of smoothing a response signal and extracting a signal in another embodiment;

[0023] FIG7 is a schematic diagram of a flow chart of signal compensation in one embodiment;

[0024] FIG8 is a schematic diagram of a flow chart of signal reconstruction and signal compensation in another embodiment;

[0025] FIG9 is a schematic diagram of a process of model training in one embodiment;

[0026] FIG10 is a schematic diagram of a flow chart of sample environment construction in one embodiment;

[0027] FIG11 is a schematic diagram of a training process of an automatic encoder in one embodiment;

[0028] FIG12 is a schematic diagram of a normal sample response signal and various abnormal response signals in one embodiment;

[0029] FIG13 is a schematic diagram of training of each model in a specific embodiment;

[0030] FIG14 is a block diagram of a gas detection device in one embodiment;

[0031] FIG. 15 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0033] The gas detection method provided in the embodiment of the present application can be applied in the application environment as shown in Figure 1. It includes a server 102, a gas sensor 104 and a terminal 106, wherein the server 102 communicates with the gas sensor 104 and the terminal 106 respectively through a network. The server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The gas sensor 104 is a converter that converts information such as the composition and concentration of a certain gas into a corresponding electrical signal, and its working principle is mainly based on the interaction between its internal sensing element and the gas. It can include but is not limited to any one of a metal oxide gas sensor, a semiconductor gas sensor, an electrochemical gas sensor, a catalytic combustion gas sensor, a thermal conductivity gas sensor, an infrared gas sensor, a solid electrolyte gas sensor, and the like. It should be noted that the metal oxide gas sensor is used in the embodiment of the present application. The metal oxide gas sensor is a sensor that uses the chemical reaction between metal oxide and gas to detect gas characteristics. Its working principle involves adsorbing gas molecules onto the surface of metal oxide (such as tin dioxide, zirconium dioxide, etc.) elements. The adsorbed gas molecules interact with the surface of the metal oxide element and capture one or more conduction electrons, thereby adjusting the resistance of the metal oxide element. This change in resistance is related to the gas characteristics, so the gas characteristics can be inferred by measuring the resistance. Terminal 106 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and IoT devices.

[0034] It is understandable that even metal oxide gas sensors with high sensitivity to gas may be affected by external environmental factors such as ambient temperature during practical application, resulting in inaccurate detection results. Therefore, in this application, gas types and gas concentrations are detected respectively, and the response signal of the metal oxide gas sensor to the ambient gas is further analyzed to extract the envelope signal closely related to the gas type and the detail signal closely related to the gas concentration. Thus, based on the envelope signal and the detail signal, the gas type detection and gas concentration detection of the ambient gas are realized through the pre-trained gas type recognition model and gas concentration recognition model. Moreover, in the process of gas concentration recognition, the factor of ambient temperature is also considered. In other words, through the technical solution of this application, the influence of environmental factors on the gas detection results can be avoided, and the accuracy of gas detection can be effectively improved. In addition, the gas concentration recognition model is obtained by transfer learning on the gas type recognition model, so this application can further improve the efficiency of gas detection.

[0035] Specifically, when the server 102 receives the gas detection instruction for the target environment initiated by the terminal 106, it can first instruct the gas sensor 104 to perform gas detection on the target environment, and receive the response signal for the ambient gas in the target environment fed back by the gas sensor 104. Then, the response signal is extracted to obtain an envelope signal reflecting the overall change trend of the response signal and a detail signal containing high-frequency information of the response signal. The server 102 further uses a gas type recognition model to identify the type of the ambient gas based on the envelope signal to obtain the gas type of the ambient gas. And the gas concentration recognition model obtained by transfer learning on the gas type recognition model identifies the concentration of the ambient gas based on the detail signal and the ambient temperature of the target environment to obtain the gas concentration of the ambient gas. Finally, the gas type and gas concentration of the ambient gas are used together as the gas detection result of the target environment.

[0036] In one example, the gas type identification model and the gas concentration identification model can be configured in the gas sensor in addition to being configured in the server 102. That is, in actual application, the gas sensor can perform the entire process of gas detection, gas type identification, and gas concentration identification.

[0037] In an exemplary embodiment, as shown in FIG2 , a gas detection method is provided, which is described by taking the method applied to the server 102 in FIG1 as an example, and includes the following steps S202 to S210. Among them:

[0038] Step S202 , in response to a gas detection instruction for a target environment, gas detection is performed on the target environment through a gas sensor to obtain a response signal output by the gas sensor for the ambient gas in the target environment.

[0039] Among them, the target environment may refer to an environment where gas detection is required, which may be an indoor space or an outdoor space. A gas detection instruction may refer to an instruction for detecting ambient gas in the target environment, which may specifically include a gas type detection instruction and a gas concentration detection instruction. The gas type detection instruction may refer to an instruction for detecting the type of ambient gas, while the gas concentration detection instruction may refer to an instruction for detecting the concentration of ambient gas. A gas sensor is a converter that converts information such as the composition and concentration of a certain gas into a corresponding measurable or processable electrical signal. In this embodiment, a metal oxide gas sensor is used. Gas detection may refer to the process of detecting ambient gas in the target environment using a gas sensor. Ambient gas may refer to a gas present in the target environment, which may be one or more. A response signal refers to an electrical signal such as a current signal and / or a voltage signal output by the gas sensor after the gas sensor completes the detection of the ambient gas.

[0040] For example, when the server receives a gas detection instruction for the target environment initiated by the terminal, it can first instruct the metal oxide gas sensor to detect the ambient gas in the target environment. The detection process can be understood as the process in which the gas molecules of the ambient gas are adsorbed onto the surface of the metal oxide element in the metal oxide gas sensor, interact with the surface of the metal oxide element, and cause the resistance of the metal oxide element to change. After completing the detection, the gas sensor feeds back the output response signal to the server so that the server can identify the gas type and gas concentration of the ambient gas based on the response signal.

[0041] It should be noted that, in order to improve the accuracy of gas detection, some prior arts use a gas sensor array (including multiple gas sensors) for gas detection. However, this method has the disadvantage of high cost. Therefore, the gas sensor in this embodiment is a single metal oxide gas sensor, which can improve the accuracy and efficiency of gas detection while reducing the cost of gas detection.

[0042] Step S204: extract the response signal to obtain an envelope signal and a detail signal.

[0043] The envelope signal can be understood as a curve showing the amplitude of the response signal changing over time, which reflects the overall change trend of the response signal. The detail signal refers to a signal containing high-frequency information of the response signal. High-frequency information can be understood as detailed information of the response signal, such as edges or rapidly changing information. Signal extraction refers to the process of extracting the envelope signal and detail signal from the response signal.

[0044] For example, after receiving the response signal fed back by the gas sensor, the server can further process the response signal, i.e., extract the signal, and extract the envelope signal reflecting the overall change trend of the response signal, and the detail signal containing the high-frequency information of the response signal, so as to facilitate the subsequent targeted gas type detection and gas concentration detection based on the envelope signal and the detail signal.

[0045] In one example, the server may select a suitable signal extraction method to extract the envelope signal and the detail signal, and the signal extraction method may be determined according to gas detection requirements.

[0046] Step S206: Using a gas type recognition model, based on the envelope signal, the type of the ambient gas is recognized to obtain the gas type of the ambient gas.

[0047] Among them, the gas type recognition model may refer to a pre-trained mathematical model for identifying gas types. Gas type refers to the type of ambient gas, such as acetone, butanol, ethanol, methanol, propanol, etc. It can be understood that the envelope signal reflects the overall change trend of the response signal, and the response signals generated by different types of gases often have different overall shapes or patterns. Therefore, based on the envelope signal, different types of gases can be identified more quickly and accurately.

[0048] In one example, the gas type recognition model can be a hybrid model based on time series and signal features, which can make full use of the features of the input signal and improve the gas type recognition effect. Refer to Figure 3, which shows a schematic diagram of the gas type recognition model. Specifically, the envelope signal is input into the time series layer, processed by the one-dimensional convolution layer, and convolution kernels of different sizes (1*1, 3*3, 5*5) are used to capture time features of different scales, and down-sampled and dimension reduced by the maximum pooling layer. Subsequently, after a flattening operation (not shown in the figure), the features of the time series are extracted. The flattening operation is an operation that converts the features output by the maximum pooling layer into a one-dimensional array to facilitate merging with subsequent signal features. And the envelope signal is input into the signal processing layer, and the response signal is first reshaped. The reshaped signal input passes through the two-dimensional convolution layer, and convolution kernels of different sizes (2*2, 4*4, 3*3) are used to extract the local features and global features of the signal, and finally the signal features are obtained after the flattening operation. The time features and signal features are merged through the fully connected layer, and then further processed through the Dropout layer, and finally the gas type of the ambient gas is output by the output layer. It can be understood that the Dropout layer is a regularization technique used to prevent the neural network from overfitting during the training process. During the training phase, the Dropout layer randomly discards the feature vectors output by certain neurons in the neural network to reduce the complex co-adaptation relationship between neurons, thereby improving the generalization ability of the model.

[0049] Exemplarily, the server inputs the extracted envelope signal into a pre-trained gas type recognition model, i.e., a hybrid model based on time series and signal features. The time series layer and signal processing layer in the hybrid model extract and process the envelope signal. After the time features and signal features are merged through the fully connected layer, the Dropout layer performs anti-overfitting processing. The processed features are used as the input of the output layer, and the output layer can finally output the gas type of the ambient gas.

[0050] Step S208 , using a gas concentration identification model, based on the detail signal and the ambient temperature of the target environment, the concentration of the ambient gas is identified to obtain the gas concentration of the ambient gas.

[0051] Among them, the gas concentration recognition model is obtained by transfer learning on the gas type recognition model. Transfer learning refers to a machine learning method that uses the similarities between data, tasks or models to apply the model learned in the old field to the new field. The detail signal refers to a signal that contains high-frequency information of the response signal, and the high-frequency information is related to the local characteristics or slight changes of the signal. Considering that the change in gas concentration will cause the details in the response signal to change. Therefore, this embodiment can more sensitively capture the detail changes in the signal based on the detail signal, thereby more accurately detecting the gas concentration of the ambient gas. Moreover, the high-frequency component of the detail signal makes it have a higher resolution and can capture slight differences in the signal, which further improves the accuracy and efficiency of gas concentration detection.

[0052] Exemplarily, the server inputs the extracted detail signal and the ambient temperature of the target environment into a pre-trained gas concentration recognition model, that is, a model obtained by transfer learning on the gas type recognition model in advance, to detect the concentration of the ambient gas in the target environment. Please refer to Figure 4, which shows a schematic diagram of the gas concentration recognition model. Finally, the gas concentration of the ambient gas in the target environment at the ambient temperature can be output.

[0053] Step S210: taking the gas type and gas concentration of the ambient gas as the gas detection result of the target environment.

[0054] Among them, the gas detection result refers to the detection result of the current gas detection of the target environment. In addition to the gas type and gas concentration of the environmental gas, the gas detection result may also include the detection time, number of detections, detection personnel, and safety assessment of the environmental gas.

[0055] Exemplarily, the server obtains the gas type of the ambient gas output by the gas type recognition model and the gas concentration of the ambient gas output by the gas concentration recognition model, and summarizes the gas type and gas concentration of the ambient gas as the detection result of the current gas detection of the target environment. This can be used as data support for subsequent gas monitoring and gas analysis of the target environment.

[0056] In this embodiment, the server responds to the gas detection instruction for the target environment initiated by the terminal, first instructs the gas sensor to detect the gas in the target environment, and obtains the response signal output by the gas sensor for the ambient gas in the target environment. Then, the response signal is extracted to obtain the envelope signal and the detail signal respectively. The envelope signal refers to the signal reflecting the overall change trend of the response signal. This change trend is usually closely related to the type of gas. Therefore, in this embodiment, the envelope signal is input into the gas type recognition model to identify the type of the ambient gas and obtain the gas type of the ambient gas. The detail signal refers to the signal containing the high-frequency information of the response signal. This high-frequency information is usually closely related to the concentration change of the gas. Therefore, in this embodiment, the concentration of the ambient gas is identified based on the detail signal and the ambient temperature of the target environment through the gas concentration recognition model to obtain the gas concentration of the ambient gas. In this way, the advantages of different signals can be fully utilized to improve the detection accuracy of gas type and gas concentration. In addition, this embodiment also takes into account the influence of ambient temperature on gas concentration. It can be understood that the concentration of a gas at different temperatures will be different. Therefore, this application also introduces the parameter of ambient temperature when identifying gas concentration, which can effectively avoid the influence of external factors on the detection results, thereby further improving the accuracy of gas detection results. Moreover, the gas concentration recognition model in this embodiment is obtained by transfer learning on the gas type recognition model, which can effectively reduce the dependence of the gas concentration recognition model on signal data, thereby accelerating the model recognition speed and further improving the gas detection speed.

[0057] In an exemplary embodiment, as shown in FIG5 , performing signal extraction on the response signal to obtain an envelope signal and a detail signal respectively includes:

[0058] Step S502: Smoothing the response signal to obtain a smoothed signal.

[0059] Among them, smoothing is actually the process of reducing noise and eliminating mutations to make the signal smoother. It can improve the signal quality of the response signal and make the signal clearer and more accurate. The smoothed signal refers to the signal generated after smoothing the response signal.

[0060] Exemplarily, when extracting a response signal, the server may first perform signal processing, that is, smoothing, on the response signal to reduce signal noise and mutations in the response signal, thereby improving the quality of the response signal and further improving the accuracy of subsequent signal extraction.

[0061] In one example, a filter can be used for smoothing, such as a normalized filter, a Gaussian filter, etc. In this example, a Savitzky-Golay filter is selected, usually referred to as an SG filter. Specifically, the Savitzky-Golay filter selects a sliding window of a fixed size on the signal and fits the data using a polynomial (usually a low-order polynomial) in each window. The value of the polynomial obtained by the calculation of the fitting at the center point of the window is used as the filtering result of the point. By moving the window and repeating the above process, the entire signal is smoothed. Compared with the normalized filter and the Gaussian filter, the Savitzky-Golay filter can avoid the edge blurring problem that may be caused by the normalized filter and the Gaussian filter, that is, the Savitzky-Golay filter can effectively retain the details of the signal while reducing noise interference, ensuring that the signal is smoother. After signal extraction processing, a curve containing the signal envelope and detail information, namely the envelope signal and the detail signal, is obtained. Reference may be made to FIG. 6 , which shows a schematic diagram of a process of smoothing a response signal and extracting a signal, wherein R represents resistance, KΩ represents a unit of resistance, namely, kilo-ohm, T represents time, and s represents seconds.

[0062] Step S504, extracting the gas detection requirement from the gas detection instruction, and determining a signal extraction method matching the gas detection requirement based on the gas detection requirement; the signal extraction method includes a first extraction method for the envelope signal and a second extraction method for the detail signal.

[0063] Step S506: extract the smoothed signal according to the first extraction method to obtain an envelope signal.

[0064] Step S508: extract the smoothed signal according to the second extraction method to obtain a detail signal.

[0065] The gas detection requirement may refer to the current requirements for gas detection in the target environment, including but not limited to detection time, detection efficiency, detection accuracy, detection error, etc. The signal extraction method may refer to a method for extracting a response signal, or a method for extracting a smooth signal corresponding to the response signal. The first extraction method may refer to a method for extracting an envelope signal from a smooth signal, and the second extraction method may refer to a method for extracting a detail signal from a smooth signal.

[0066] In one example, the first extraction method may include but is not limited to Hilbert transform, detection method, high-pass filtering combined with low-pass filtering, etc. Among them, Hilbert transform is an effective method for extracting signal envelope. By performing Hilbert transform on the signal, the analytical signal of the signal can be obtained. The module of the analytical signal is the envelope of the signal. The Hilbert transform has the advantage of not being limited by Fourier analysis, and can reflect the time-frequency diagram, amplitude diagram and time-frequency diagram of the response signal, and has good local adaptability. The detection method is a method for extracting the envelope by detecting the amplitude change of the signal. The combination of high-pass filtering and low-pass filtering refers to removing the low-frequency components in the signal through a high-pass filter, and then removing the high-frequency noise through a low-pass filter. Finally, the processed signal is squared and squared to obtain the envelope of the signal. This method is suitable for situations where the response signal contains more low-frequency noise and high-frequency interference.

[0067] In one example, the second extraction method may include but is not limited to bandpass filtering, wavelet transform, differential method, etc. Among them, bandpass filtering is a method of retaining signal components within a specific frequency range. By selecting appropriate filter parameters, the detail components in the response signal can be extracted. Wavelet transform is a multi-scale refinement analysis method. It performs multi-scale analysis on the signal through two processes, scaling and translation. Wavelet transform can extract the detail components of the signal at different scales and is suitable for processing non-stationary signals and mutation signals. The differential method is a method of extracting detail components by calculating the difference between adjacent signal samples. The differential method is suitable for situations where there are many mutations and edges in the signal, and can extract the detail characteristics of the signal.

[0068] Exemplarily, after the server smoothes the response signal, it can perform signal extraction. First, the relevant requirements for gas detection in the target environment can be extracted from the gas detection instruction, and then the appropriate first extraction method and second extraction method are matched according to these requirements. Finally, the envelope signal is extracted from the response signal according to the first extraction method, and the detail signal is extracted from the response signal according to the second extraction method.

[0069] In this embodiment, by smoothing the response signal, the accuracy of the signal can be ensured, laying the foundation for subsequent signal extraction. Then, in combination with the actual gas detection needs, a suitable signal extraction method is matched, so that the envelope signal and detail signal are extracted from the smoothed signal according to the signal extraction method, thereby improving the accuracy of signal extraction and thus improving the accuracy of the entire gas detection.

[0070] It should be noted that in actual applications, gas sensors may have baseline drift. Baseline drift refers to the phenomenon that the response signal of a gas sensor deviates from the initial baseline value when it works for a long time or is affected by environmental factors. This offset may be upward (i.e., the signal value increases) or downward (i.e., the signal value decreases), and may gradually increase over time. Baseline drift has a negative impact on the measurement accuracy and stability of the gas sensor. At present, calibration or manual processing of abnormal signals is usually relied on to solve this problem, but these methods are frequent and complicated, which not only increases the maintenance cost and difficulty, but also fails to achieve the expected results in extreme environments or long-term operation. Based on this, this embodiment introduces a signal compensation operation to automatically compensate for abnormal response signals, thereby improving the accuracy of the response signal and reducing the impact of abnormal signals on gas detection results.

[0071] In an exemplary embodiment, as shown in FIG7 , the signal compensation process includes:

[0072] Step S702: reconstruct the response signal through an automatic encoder to obtain a reconstructed target signal.

[0073] Among them, the autoencoder is a neural network model that can learn the low-dimensional representation of the input signal and reconstruct the original signal as much as possible. The autoencoder consists of two parts: the encoder and the decoder. The encoder maps the input signal to a low-dimensional hidden layer. The compressed signal is completely different from the original signal, but it captures the important features of the input signal and discards irrelevant features. The decoder maps the representation of the low-dimensional hidden layer back to the original input space and reconstructs the original signal. Therefore, signal reconstruction refers to the process of recovering the complete signal or the original signal from the known partial data. The target signal refers to the reconstructed signal.

[0074] Exemplarily, after receiving the response signal fed back by the gas sensor, the server may first input the response signal into an autoencoder to reconstruct the response signal through the autoencoder, thereby obtaining a reconstructed target signal.

[0075] Step S704: Based on the reconstruction error between the target signal and the response signal, abnormal signal recognition is performed on the response signal to obtain an abnormal signal recognition result of the response signal.

[0076] The reconstruction error may refer to the mean square error between the target signal and the response signal. The abnormal signal recognition result may be used to characterize whether the response signal is an abnormal signal.

[0077] Exemplarily, the server obtains the target signal reconstructed by the autoencoder, and calculates the mean square error between the target signal and the response signal input to the autoencoder. In this process, an error threshold can be predefined. The error threshold can be a reference value defined based on the reconstruction error distribution of the normal response signal. If the error threshold is exceeded, the response signal is considered to be an abnormal signal, and if the error threshold is not exceeded, the response signal is considered to be a normal signal. Thus, the abnormal signal recognition result of the response signal is obtained.

[0078] Step S706: When the abnormal signal identification result indicates that the response signal is an abnormal signal, the response signal is compensated to obtain a compensated signal.

[0079] The signal compensation may refer to the process of correcting an abnormal signal. The compensation signal may refer to a signal generated after the signal compensation operation is completed on the response signal.

[0080] Exemplarily, when the server determines that the response signal is an abnormal signal, the corresponding neural network model can be used for signal compensation, such as a recurrent neural network, a convolutional neural network, a long short-term memory neural network, etc. Referring to FIG8, FIG8 shows a schematic diagram of the process of signal reconstruction and signal compensation. The response signal X1 enters the input layer of the autoencoder, and is processed by the encoder of the autoencoder to obtain a signal C, and then the decoder of the autoencoder reconstructs the signal C and outputs the signal X2. When it is determined that the response signal is an abnormal signal, signal compensation is performed, that is, the response signal is input into the neural network model, and features are extracted through hidden layer 1. The features are processed by hidden layer 2 (pooling layer and fully connected layer), that is, the feature dimension is reduced by global average pooling, and the fully connected layer is responsible for mapping the features to the output space, that is, the corrected data sequence, so as to effectively restore the baseline of the signal and complete the signal compensation. Finally, the gas state and the compensation signal can also be output. The gas state indicates whether the ambient gas is normal, or whether the response signal corresponding to the ambient gas is normal.

[0081] Step S708, updating the response signal according to the compensation signal, and executing the steps: performing signal extraction on the response signal to obtain an envelope signal and a detail signal respectively.

[0082] Exemplarily, after receiving the compensation signal, the server may update the original response signal and execute step S204.

[0083] In this embodiment, through abnormal signal detection and signal compensation operations, the abnormal signal can be calibrated and compensated in a timely manner to ensure the accuracy of the response signal, reduce the impact of the abnormal signal on the gas detection result, and thus improve the accuracy of gas detection.

[0084] In an exemplary embodiment, as shown in FIG9 , the training process of the gas type recognition model and the gas concentration recognition model includes:

[0085] Step S902 : for different types of sample gases in different sample environments, obtain a sample response signal of the gas sensor for each type of sample gas.

[0086] The different sample environments may refer to environments with different temperatures. The sample gas may refer to sample gas used for model training. The sample response signal may refer to a response signal generated by a gas sensor detecting the sample gas.

[0087] Exemplarily, the server first constructs different sample environments, and uses a gas sensor to perform gas detection for different types of sample gases in each sample environment to obtain a sample response signal output by the gas sensor.

[0088] Step S904: Based on the sample response signal, a first initial model for identifying the gas type is trained until the recognition error of the first initial model is lower than a first error threshold, thereby obtaining a gas type recognition model.

[0089] Among them, the first initial model can be understood as the initialization model of the gas type recognition model. The recognition error can refer to the error of the first initial model in recognizing the gas type. The first error threshold can refer to a pre-set error reference value. If it is not lower than the first error threshold, it is considered that the detection accuracy of the first initial model is insufficient and further training is required. When it is lower than the first error threshold, it is considered that the detection accuracy of the first initial model is high and training can be stopped. Of course, in practical applications, a suitable number of iterations can also be set. When the number of model training reaches the number of iterations, training is stopped and the gas type recognition model is output.

[0090] Exemplarily, after the server obtains each sample response signal, it can perform signal processing, i.e., smoothing processing and signal extraction operations. For the specific processes of these two operations, please refer to steps S502 to S508, which will not be described in detail here. After obtaining the sample envelope signal and sample detail signal extracted from each sample response signal, the server can input these sample envelope signals into the first initial model for model training, and output a gas type recognition model when the recognition errors of the gas types of each type of sample gas in the first initial model are all lower than the first error threshold.

[0091] Step S906: extract model parameters of the gas type recognition model, and generate a second initial model for identifying gas concentration based on the model parameters.

[0092] It is understandable that, due to the different temperatures of the sample environments, the gas concentrations of various sample gases in each sample environment are naturally different, and the gas type recognition model has a higher detection accuracy. Therefore, in order to improve the training rate of the gas concentration recognition model, the present embodiment adopts a transfer learning method to generate a second initial model for identifying gas concentrations, so as to reduce the model's dependence on data, thereby improving the training rate. In addition, transfer learning helps to improve the performance of the gas concentration recognition model, enabling it to better capture features when processing signals, further enhancing its reliability and accuracy in practical applications.

[0093] The second initial model can be understood as a model parameter based on a gas type recognition model, and the model is obtained after initializing a pre-trained model for identifying gas concentrations. The pre-trained model can be understood as an initial model of the gas concentration recognition model. Model parameters can refer to weight parameters of some layers in the gas type recognition model. Of course, in practical applications, other model parameters can also be selected for transfer learning according to actual needs.

[0094] Exemplarily, the server extracts some layer weights of the gas type recognition model and adjusts the model structure of the pre-trained model for identifying gas concentration, which may include changing the weights of the input layer, output layer or intermediate layer of the pre-trained model. Then, for the gas concentration recognition task, fine-tune the high-level features of the pre-trained model, which may be to adjust the weights and bias items of the high-level features. It should be noted that high-level features may refer to features extracted from neurons at deeper levels of the network. These features are often more abstract and advanced, and can capture complex relationships in the data. For the gas concentration recognition task, high-level features may include but are not limited to abstract information such as the chemical properties, physical state, and concentration gradient of the gas. By fine-tuning the high-level features, the model can be able to more accurately identify the gas concentration. At this time, the second initial model can be output.

[0095] Step S908: Based on the sample response signal, the second initial model is trained until the recognition error of the second initial model is lower than the second error threshold, thereby obtaining a gas concentration recognition model.

[0096] Among them, the second error threshold may refer to a pre-set error reference value. If it is not lower than the second error threshold, it is considered that the concentration detection accuracy of the second initial model is insufficient and further training is required. If it is lower than the second error threshold, it is considered that the detection accuracy of the second initial model is high and training can be stopped. Of course, in practical applications, a suitable number of iterations can also be set. When the number of model training reaches the number of iterations, training is stopped and the gas concentration recognition model is output. It can be understood that the first error threshold and the second error threshold can be the same or different.

[0097] Exemplarily, the server inputs the sample detail signal into the second initial model to perform model training, and outputs a gas concentration recognition model when the recognition errors of the second initial model for the gas concentrations of various types of sample gases are all lower than a second error threshold.

[0098] In this embodiment, the sample response signals of different types of sample gases under different sample environments are used to train a gas type recognition model, thereby improving the detection accuracy of the gas type recognition model. In addition, by using the transfer learning method, a gas concentration recognition model is trained on the basis of the trained gas type recognition model, which can effectively improve the training efficiency of the gas concentration recognition model. In addition, by configuring sample environments with different temperatures, the influence of the ambient temperature on the detection results is taken into account, which can further improve the accuracy of gas concentration recognition.

[0099] In an exemplary embodiment, as shown in FIG10 , for different types of sample gases in different sample environments, obtaining a sample response signal of a gas sensor for each type of sample gas includes:

[0100] Step S1002, constructing sample environments with different temperatures by periodic pulse heating.

[0101] Step S1004 , for different types of sample gases in each sample environment, gas detection is performed using a gas sensor to obtain a sample response signal for each type of sample gas.

[0102] Among them, pulse heating refers to the process of heating by using the Joule heat generated when a pulse current passes through a metal oxide element. It should be noted that in this embodiment, the gas sensor is heated by periodic pulse heating to simulate the real environment of various temperatures. In other words, the different sample environments in the model training process can be understood as the internal working environment of the gas sensor. For example, the gas sensor is operated at a low voltage of 1500mV (millivolts) for 3 seconds and a high voltage of 2500mV (millivolts) for 2 seconds, with a cycle length of 5 seconds. In this scenario, the sample response signals of the gas sensor are measured for different types of sample gases in different concentration ranges, such as 10-50ppm (parts per million).

[0103] Exemplarily, the server uses a periodic pulse heating method to construct sample environments at different temperatures, and instructs the gas sensor to detect sample response signals of various sample gases within different concentration ranges under each sample environment.

[0104] In this embodiment, pulse heating is used to construct sample environments with different temperatures, thereby improving the accuracy of gas concentration detection.

[0105] In an exemplary embodiment, as shown in FIG11 , the training process of the autoencoder further includes:

[0106] Step S1102, constructing an abnormal response signal for the gas detection process of the gas sensor.

[0107] Among them, the abnormal response signal may refer to an abnormal sample response signal. It may include but is not limited to a drift signal, a missing value signal, an abnormal value signal and a cross-sensitive signal. Figure 12 shows a schematic diagram of a normal sample response signal and each abnormal response signal. From top to bottom, they are: a normal sample response signal, a drift signal, a missing value signal, an abnormal value signal and a cross-sensitive signal. Among them, the drift signal may be generated by adding a random resistance drift of 0-20KΩ to the normal sample response signal. The missing value signal may be generated by randomly setting part of the signal data to the null type. The abnormal value signal may be generated by randomly generating extreme signal values. The cross-sensitive signal may be generated by adding a sinusoidal signal interference to the normal sample response signal to simulate the cross-sensitivity phenomenon between different gases.

[0108] Exemplarily, the server may construct different abnormal response signals for the gas detection process of the gas sensor for use in subsequent encoder training.

[0109] Step S1104, extracting the output features of the output layer of the gas type recognition model, and training the initial encoder based on the output features and the abnormal response signal until the reconstruction error of the initial encoder is lower than the reconstruction error threshold, thereby obtaining an automatic encoder.

[0110] The output feature may refer to the feature output by the output layer of the gas type recognition model, which can be used to train the autoencoder. The initial encoder may be understood as the initial state of the autoencoder. The reconstruction error threshold may refer to a pre-set reference value for the reconstruction error.

[0111] Exemplarily, since the features output by the output layer of the gas type recognition model contain key information of the sample gas, the server can train the initial encoder based on the output features. And use the pre-constructed abnormal response signal to verify the reconstruction error of the initial encoder. When the reconstruction error of the initial encoder is lower than the reconstruction error threshold, the automatic encoder is output.

[0112] In this embodiment, the automatic encoder is trained based on the output features of the output layer of the gas type recognition model and the constructed abnormal response signal, which improves the accuracy of the automatic encoder in recognizing abnormal signals, thereby improving the accuracy of the entire gas detection.

[0113] In a specific embodiment, referring to FIG. 13, FIG. 13 shows a training schematic diagram of each model. In combination with the figure, the specific process of the gas detection method includes: the server responds to the gas detection instruction for the target environment, firstly, through a single metal oxide gas sensor, performs gas detection on the target environment, and obtains the response signal for the ambient gas in the target environment output by the metal oxide gas sensor. Then, the response signal is smoothed to obtain a smoothed signal, and the gas detection requirement is extracted from the gas detection instruction. Based on the gas detection requirement, a first extraction method for the envelope signal and a second extraction method for the detail signal that match the gas detection requirement are determined. According to the first extraction method, the smoothed signal is extracted to obtain an envelope signal, and according to the second extraction method, the smoothed signal is extracted to obtain a detail signal. Then, based on the envelope signal, the type of the ambient gas is identified through the gas type recognition model to obtain the gas type of the ambient gas. Based on the detail signal and the ambient temperature of the target environment, the concentration of the ambient gas is identified through the gas concentration recognition model to obtain the gas concentration of the ambient gas. The gas concentration recognition model is obtained by transfer learning on the gas type recognition model. The gas type and gas concentration of the ambient gas are taken together as the gas detection result of the target environment. In addition, the autoencoder can be used for abnormal processing, that is, the response signal is reconstructed to obtain the reconstructed target signal. Based on the reconstruction error between the target signal and the response signal, the response signal is identified as an abnormal signal. When the response signal is an abnormal signal, the response signal is compensated to obtain a compensated signal. According to the compensated signal, the response signal is updated, and the steps are executed: the response signal is extracted to obtain an envelope signal and a detail signal respectively.

[0114] In addition, this embodiment also obtained the results of cross-validation that the gas type recognition model and the gas concentration recognition model have an accuracy of 99.73% and 81.89% in gas type and concentration recognition, respectively. At the same time, the application of transfer learning significantly improves the training rate of the gas concentration recognition model.

[0115] In this embodiment, the server responds to the gas detection instruction for the target environment, firstly detects the gas in the target environment through the gas sensor, and obtains the response signal of the ambient gas in the target environment output by the gas sensor. Then, the response signal is extracted to obtain the envelope signal and the detail signal respectively. The envelope signal refers to the signal reflecting the overall change trend of the response signal, which is usually closely related to the type of gas. Therefore, in this embodiment, the envelope signal is input into the gas type recognition model to identify the type of the ambient gas and obtain the gas type of the ambient gas. The detail signal refers to the signal containing the high-frequency information of the response signal, which is usually closely related to the concentration change of the gas. Therefore, in this embodiment, the concentration of the ambient gas is identified based on the detail signal and the ambient temperature of the target environment through the gas concentration recognition model to obtain the gas concentration of the ambient gas. In this way, the advantages of different signals can be fully utilized to improve the detection accuracy of gas type and gas concentration. In addition, this embodiment also takes into account the influence of ambient temperature on gas concentration. It can be understood that the concentration of a gas at different temperatures will be different. Therefore, this application also introduces the parameter of ambient temperature when identifying gas concentration, which can effectively avoid the influence of external factors on the detection results, thereby further improving the accuracy of gas detection results. Moreover, the gas concentration recognition model in this embodiment is obtained by transfer learning on the gas type recognition model, which can effectively reduce the dependence of the gas concentration recognition model on signal data, thereby accelerating the model recognition speed and further improving the gas detection speed.

[0116] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0117] Based on the same inventive concept, the embodiment of the present application also provides a gas detection device for implementing the gas detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more gas detection device embodiments provided below can refer to the limitations on the gas detection method above, and will not be repeated here.

[0118] In an exemplary embodiment, as shown in FIG. 14 , a gas detection device is provided, including: a signal acquisition module 1402, for responding to a gas detection instruction for a target environment, performing gas detection on the target environment through a gas sensor, and obtaining a response signal for the ambient gas in the target environment output by the gas sensor; a signal extraction module 1404, for performing signal extraction on the response signal, and obtaining an envelope signal and a detail signal respectively; the envelope signal refers to a signal reflecting the overall change trend of the response signal; the detail signal refers to a signal containing high-frequency information of the response signal; a gas type recognition module 1406, for performing type recognition on the ambient gas based on the envelope signal through a gas type recognition model, and obtaining the gas type of the ambient gas; a gas concentration recognition module 1408, for performing concentration recognition on the ambient gas based on the detail signal and the ambient temperature of the target environment through a gas concentration recognition model, and obtaining the gas concentration of the ambient gas; the gas concentration recognition model is obtained by performing transfer learning on the gas type recognition model; and a detection result generation module 1410, for taking the gas type and gas concentration of the ambient gas as the gas detection result of the target environment.

[0119] In one embodiment, the signal extraction module 1404 is also used to: smooth the response signal to obtain a smoothed signal; extract the gas detection requirement from the gas detection instruction, and determine the signal extraction method that matches the gas detection requirement based on the gas detection requirement; the signal extraction method includes a first extraction method for the envelope signal and a second extraction method for the detail signal; according to the first extraction method, the smoothed signal is extracted to obtain the envelope signal; according to the second extraction method, the smoothed signal is extracted to obtain the detail signal.

[0120] In one of the embodiments, the device is also used to: reconstruct the response signal through an automatic encoder to obtain a reconstructed target signal; identify the response signal as an abnormal signal based on the reconstruction error between the target signal and the response signal to obtain an abnormal signal identification result of the response signal; when the abnormal signal identification result indicates that the response signal is an abnormal signal, perform signal compensation on the response signal to obtain a compensated signal; update the response signal according to the compensated signal, and execute the steps of: extracting the response signal to obtain an envelope signal and a detail signal, respectively.

[0121] In one of the embodiments, the device is also used to: obtain a sample response signal of the gas sensor for each type of sample gas for different types of sample gases in different sample environments; train a first initial model for identifying the gas type based on the sample response signal until the recognition error of the first initial model is lower than a first error threshold, thereby obtaining a gas type recognition model; extract model parameters of the gas type recognition model, and generate a second initial model for identifying gas concentration based on the model parameters; and train the second initial model based on the sample response signal until the recognition error of the second initial model is lower than a second error threshold, thereby obtaining a gas concentration recognition model.

[0122] In one of the embodiments, the device is also used to: construct sample environments with different temperatures through periodic pulse heating; perform gas detection on different types of sample gases in each sample environment through a gas sensor to obtain a sample response signal for each type of sample gas.

[0123] In one of the embodiments, the device is also used to: construct an abnormal response signal for the gas detection process of the gas sensor; extract the output features of the output layer of the gas type recognition model, and train the initial encoder based on the output features and the abnormal response signal until the reconstruction error of the initial encoder is lower than the reconstruction error threshold, thereby obtaining an automatic encoder.

[0124] Each module in the above-mentioned gas detection device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0125] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG15. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store gas detection data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a gas detection method is implemented.

[0126] Those skilled in the art will understand that the structure shown in FIG. 15 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0127] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: in response to a gas detection instruction for a target environment, gas detection is performed on the target environment through a gas sensor to obtain a response signal for the ambient gas in the target environment output by the gas sensor; signal extraction is performed on the response signal to obtain an envelope signal and a detail signal respectively; the envelope signal refers to a signal reflecting the overall change trend of the response signal; the detail signal refers to a signal containing high-frequency information of the response signal; based on the envelope signal, the type of the ambient gas is identified through a gas type recognition model to obtain the gas type of the ambient gas; based on the detail signal and the ambient temperature of the target environment, the concentration of the ambient gas is identified through a gas concentration recognition model to obtain the gas concentration of the ambient gas; the gas concentration recognition model is obtained by performing transfer learning on the gas type recognition model; the gas type and gas concentration of the ambient gas are used together as the gas detection result of the target environment.

[0128] In one embodiment, when the processor executes the computer program, the following steps are also implemented: smoothing the response signal to obtain a smoothed signal; extracting the gas detection requirement from the gas detection instruction, and determining a signal extraction method that matches the gas detection requirement based on the gas detection requirement; the signal extraction method includes a first extraction method for the envelope signal and a second extraction method for the detail signal; according to the first extraction method, signal extraction is performed on the smoothed signal to obtain an envelope signal; according to the second extraction method, signal extraction is performed on the smoothed signal to obtain a detail signal.

[0129] In one embodiment, when the processor executes the computer program, the following steps are also implemented: reconstructing the response signal through an automatic encoder to obtain a reconstructed target signal; based on the reconstruction error between the target signal and the response signal, identifying the abnormal signal of the response signal to obtain an abnormal signal identification result of the response signal; when the abnormal signal identification result indicates that the response signal is an abnormal signal, compensating the response signal to obtain a compensated signal; updating the response signal according to the compensated signal, executing the steps: extracting the response signal to obtain an envelope signal and a detail signal respectively.

[0130] In one embodiment, when the processor executes the computer program, the following steps are also implemented: for different types of sample gases in different sample environments, a sample response signal of the gas sensor for each type of sample gas is obtained; based on the sample response signal, a first initial model for identifying the gas type is trained until the recognition error of the first initial model is lower than a first error threshold, thereby obtaining a gas type recognition model; model parameters of the gas type recognition model are extracted, and based on the model parameters, a second initial model for identifying the gas concentration is generated; based on the sample response signal, a second initial model is trained until the recognition error of the second initial model is lower than a second error threshold, thereby obtaining a gas concentration recognition model.

[0131] In one embodiment, when the processor executes the computer program, the following steps are also implemented: constructing sample environments with different temperatures through periodic pulse heating; performing gas detection on different types of sample gases in each sample environment through a gas sensor to obtain a sample response signal for each type of sample gas.

[0132] In one embodiment, when the processor executes the computer program, the following steps are also implemented: constructing an abnormal response signal for the gas detection process of the gas sensor; extracting the output features of the output layer of the gas type recognition model, and training the initial encoder based on the output features and the abnormal response signal until the reconstruction error of the initial encoder is lower than the reconstruction error threshold, thereby obtaining an automatic encoder.

[0133] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program implements the following steps when executed by a processor: in response to a gas detection instruction for a target environment, gas detection is performed on the target environment through a gas sensor to obtain a response signal for the ambient gas in the target environment output by the gas sensor; signal extraction is performed on the response signal to obtain an envelope signal and a detail signal respectively; the envelope signal refers to a signal reflecting the overall change trend of the response signal; the detail signal refers to a signal containing high-frequency information of the response signal; based on the envelope signal, the type of the ambient gas is identified through a gas type recognition model to obtain the gas type of the ambient gas; based on the detail signal and the ambient temperature of the target environment, the concentration of the ambient gas is identified through a gas concentration recognition model to obtain the gas concentration of the ambient gas; the gas concentration recognition model is obtained by performing transfer learning on the gas type recognition model; the gas type and gas concentration of the ambient gas are used together as the gas detection result of the target environment.

[0134] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: smoothing the response signal to obtain a smoothed signal; extracting the gas detection requirement from the gas detection instruction, and determining a signal extraction method that matches the gas detection requirement based on the gas detection requirement; the signal extraction method includes a first extraction method for the envelope signal and a second extraction method for the detail signal; according to the first extraction method, signal extraction is performed on the smoothed signal to obtain an envelope signal; according to the second extraction method, signal extraction is performed on the smoothed signal to obtain a detail signal.

[0135] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: reconstructing the response signal through an automatic encoder to obtain a reconstructed target signal; identifying the abnormal signal of the response signal based on the reconstruction error between the target signal and the response signal to obtain an abnormal signal identification result of the response signal; when the abnormal signal identification result indicates that the response signal belongs to an abnormal signal, compensating the response signal to obtain a compensated signal; updating the response signal according to the compensated signal, executing the steps: extracting the response signal to obtain an envelope signal and a detail signal respectively.

[0136] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for different types of sample gases in different sample environments, a sample response signal of the gas sensor for each type of sample gas is obtained; based on the sample response signal, a first initial model for identifying the gas type is trained until the recognition error of the first initial model is lower than a first error threshold, thereby obtaining a gas type recognition model; model parameters of the gas type recognition model are extracted, and based on the model parameters, a second initial model for identifying the gas concentration is generated; based on the sample response signal, a second initial model is trained until the recognition error of the second initial model is lower than a second error threshold, thereby obtaining a gas concentration recognition model.

[0137] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: constructing sample environments with different temperatures through periodic pulse heating; performing gas detection on different types of sample gases in each sample environment through a gas sensor to obtain a sample response signal for each type of sample gas.

[0138] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: constructing an abnormal response signal for the gas detection process of the gas sensor; extracting the output features of the output layer of the gas type recognition model, and training the initial encoder based on the output features and the abnormal response signal until the reconstruction error of the initial encoder is lower than the reconstruction error threshold, thereby obtaining an automatic encoder.

[0139] In one embodiment, a computer program product is provided, including a computer program, which implements the following steps when executed by a processor: in response to a gas detection instruction for a target environment, gas detection is performed on the target environment through a gas sensor to obtain a response signal for the ambient gas in the target environment output by the gas sensor; signal extraction is performed on the response signal to obtain an envelope signal and a detail signal respectively; the envelope signal refers to a signal reflecting the overall change trend of the response signal; the detail signal refers to a signal containing high-frequency information of the response signal; based on the envelope signal, the type of the ambient gas is identified through a gas type recognition model to obtain the gas type of the ambient gas; based on the detail signal and the ambient temperature of the target environment, the concentration of the ambient gas is identified through a gas concentration recognition model to obtain the gas concentration of the ambient gas; the gas concentration recognition model is obtained by performing transfer learning on the gas type recognition model; and the gas type and gas concentration of the ambient gas are used together as the gas detection result of the target environment.

[0140] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: smoothing the response signal to obtain a smoothed signal; extracting the gas detection requirement from the gas detection instruction, and determining a signal extraction method that matches the gas detection requirement based on the gas detection requirement; the signal extraction method includes a first extraction method for the envelope signal and a second extraction method for the detail signal; according to the first extraction method, signal extraction is performed on the smoothed signal to obtain an envelope signal; according to the second extraction method, signal extraction is performed on the smoothed signal to obtain a detail signal.

[0141] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: reconstructing the response signal through an automatic encoder to obtain a reconstructed target signal; identifying the abnormal signal of the response signal based on the reconstruction error between the target signal and the response signal to obtain an abnormal signal identification result of the response signal; when the abnormal signal identification result indicates that the response signal belongs to an abnormal signal, compensating the response signal to obtain a compensated signal; updating the response signal according to the compensated signal, executing the steps: extracting the response signal to obtain an envelope signal and a detail signal respectively.

[0142] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for different types of sample gases in different sample environments, a sample response signal of the gas sensor for each type of sample gas is obtained; based on the sample response signal, a first initial model for identifying the gas type is trained until the recognition error of the first initial model is lower than a first error threshold, thereby obtaining a gas type recognition model; model parameters of the gas type recognition model are extracted, and based on the model parameters, a second initial model for identifying the gas concentration is generated; based on the sample response signal, a second initial model is trained until the recognition error of the second initial model is lower than a second error threshold, thereby obtaining a gas concentration recognition model.

[0143] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: constructing sample environments with different temperatures through periodic pulse heating; performing gas detection on different types of sample gases in each sample environment through a gas sensor to obtain a sample response signal for each type of sample gas.

[0144] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: constructing an abnormal response signal for the gas detection process of the gas sensor; extracting the output features of the output layer of the gas type recognition model, and training the initial encoder based on the output features and the abnormal response signal until the reconstruction error of the initial encoder is lower than the reconstruction error threshold, thereby obtaining an automatic encoder.

[0145] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0146] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0147] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0148] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A gas detection method, characterized in that: The method comprises: In response to a gas detection instruction for a target environment, gas detection is performed on the target environment by a gas sensor to obtain a response signal output by the gas sensor for the ambient gas in the target environment; Performing smoothing on the response signal to obtain a smoothed signal; Extracting a gas detection requirement from the gas detection instruction, and determining a signal extraction method matching the gas detection requirement based on the gas detection requirement; the signal extraction method includes a first extraction method for an envelope signal and a second extraction method for a detail signal; According to the first extraction method, performing signal extraction on the smoothed signal to obtain an envelope signal; According to the second extraction method, the smooth signal is subjected to signal extraction to obtain a detail signal; the envelope signal refers to a signal reflecting the overall change trend of the response signal; the detail signal refers to a signal containing high-frequency information of the response signal; Using a gas type recognition model, based on the envelope signal, the type of the ambient gas is recognized to obtain the gas type of the ambient gas; The concentration of the ambient gas is identified based on the detail signal and the ambient temperature of the target environment by a gas concentration identification model to obtain the gas concentration of the ambient gas; the gas concentration identification model is obtained by performing transfer learning on the gas type identification model; The gas type and gas concentration of the ambient gas are taken together as the gas detection result of the target environment.

2. The method according to claim 1, characterized in that The method further comprises: Reconstructing the response signal through an automatic encoder to obtain a reconstructed target signal; Based on a reconstruction error between the target signal and the response signal, performing abnormal signal recognition on the response signal to obtain an abnormal signal recognition result of the response signal; When the abnormal signal identification result indicates that the response signal is an abnormal signal, performing signal compensation on the response signal to obtain a compensated signal; According to the compensation signal, the response signal is updated, and the steps are performed: signal extraction is performed on the response signal to obtain an envelope signal and a detail signal respectively.

3. The method according to claim 1, characterized in that The method further comprises: For different types of sample gases in different sample environments, obtaining a sample response signal of the gas sensor for each type of sample gas; Based on the sample response signal, a first initial model for identifying the gas type is trained until the recognition error of the first initial model is lower than a first error threshold, thereby obtaining a gas type recognition model; Extracting model parameters of the gas type identification model, and generating a second initial model for identifying gas concentration based on the model parameters; Based on the sample response signal, the second initial model is trained until the recognition error of the second initial model is lower than a second error threshold, thereby obtaining a gas concentration recognition model.

4. The method according to claim 3, characterized in that The step of obtaining a sample response signal of a gas sensor for each type of sample gas in different sample environments includes: Through periodic pulse heating, sample environments with different temperatures are constructed; For different types of sample gases in each of the sample environments, gas detection is performed using a gas sensor to obtain a sample response signal for each type of sample gas.

5. The method according to claim 3, characterized in that: The method further comprises: Constructing an abnormal response signal for a gas detection process of the gas sensor; The output features of the output layer of the gas type recognition model are extracted, and the initial encoder is trained based on the output features and the abnormal response signal until the reconstruction error of the initial encoder is lower than the reconstruction error threshold, thereby obtaining an automatic encoder.

6. A gas detection device, characterized in that: The device comprises: A signal acquisition module, configured to respond to a gas detection instruction for a target environment, detect gas in the target environment through a gas sensor, and obtain a response signal output by the gas sensor for the ambient gas in the target environment; A signal extraction module, used for smoothing the response signal to obtain a smoothed signal; extracting a gas detection requirement from the gas detection instruction, and determining a signal extraction method matching the gas detection requirement based on the gas detection requirement; the signal extraction method includes a first extraction method for an envelope signal and a second extraction method for a detail signal; according to the first extraction method, performing signal extraction on the smoothed signal to obtain an envelope signal; according to the second extraction method, performing signal extraction on the smoothed signal to obtain a detail signal; the envelope signal refers to a signal reflecting the overall change trend of the response signal; the detail signal refers to a signal containing high-frequency information of the response signal; A gas type identification module, used to identify the type of the ambient gas based on the envelope signal through a gas type identification model to obtain the gas type of the ambient gas; A gas concentration identification module, used to identify the concentration of the ambient gas based on the detail signal and the ambient temperature of the target environment through a gas concentration identification model to obtain the gas concentration of the ambient gas; the gas concentration identification model is obtained by performing transfer learning on the gas type identification model; The detection result generating module is used to use the gas type and gas concentration of the ambient gas as the gas detection result of the target environment.

7. The device according to claim 6, characterized in that The device is also used to: perform signal reconstruction on the response signal through an automatic encoder to obtain a reconstructed target signal; perform abnormal signal recognition on the response signal based on a reconstruction error between the target signal and the response signal to obtain an abnormal signal recognition result of the response signal; When the abnormal signal identification result indicates that the response signal is an abnormal signal, the response signal is compensated to obtain a compensated signal; based on the compensated signal, the response signal is updated, and the steps of: performing signal extraction on the response signal to obtain an envelope signal and a detail signal respectively.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Livestock and poultry house breeding environment harmful gas detection system

    CN113281465A

  • Optimization method of gas recognition neural network model and related equipment

    CN114358283A