Gas detection method and device based on cantilever microphone, computer device, storage medium and computer program product
By using a cantilever microphone and feature extraction technology, combined with a gas detection model, the problem of low sensitivity in traditional gas detection methods has been solved, achieving higher-precision gas identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTHERN POWER GRID SENSING TECHNOLOGY (GUANGDONG) CO LTD
- Filing Date
- 2024-12-14
- Publication Date
- 2026-06-23
Smart Images

Figure CN119666755B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power grid technology, and in particular to a gas detection method, apparatus, computer equipment, computer-readable storage medium, and computer program product based on a cantilever microphone. Background Technology
[0002] Currently, in order to ensure the reliability of power supply, it is crucial to detect gases in the power system.
[0003] In traditional techniques, gas detection typically involves a chemical reaction with a specific reagent to produce a color change, which is then compared to a standard colorimetric card. However, this method is susceptible to interference, resulting in low sensitivity in gas detection. Summary of the Invention
[0004] Therefore, it is necessary to provide a gas detection method, apparatus, computer equipment, computer-readable storage medium, and computer program product based on a cantilever microphone that can improve the sensitivity of gas detection, addressing the aforementioned technical problems.
[0005] In a first aspect, this application provides a gas detection method based on a cantilever microphone, comprising:
[0006] Acquire the photoacoustic signal of the gas to be detected;
[0007] The displacement response information corresponding to the photoacoustic signal is determined by the cantilever microphone;
[0008] The displacement response information is converted and processed to obtain the electrical signal corresponding to the gas to be detected;
[0009] The electrical signal is preprocessed to obtain a preprocessed electrical signal;
[0010] The preprocessed electrical signal is subjected to feature extraction processing to obtain multiple feature vectors corresponding to the preprocessed electrical signal;
[0011] The multiple feature vectors corresponding to the preprocessed electrical signal are fused to obtain the target feature vector corresponding to the gas to be detected.
[0012] The target feature vector is input into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected.
[0013] In one embodiment, the cantilever microphone includes a cantilever beam with a reflector mounted on its free end; the cantilever beam is made of silicon and has a length of 4 mm, a width of 2 mm, and a thickness of 5 micrometers.
[0014] The step of determining the displacement response information corresponding to the photoacoustic signal using a cantilever microphone includes:
[0015] The displacement response information corresponding to the photoacoustic signal is measured by using a Michelson interferometer corresponding to the reflector mounted on the free end of the cantilever beam in the cantilever microphone.
[0016] In one embodiment, the preprocessing of the electrical signal to obtain a preprocessed electrical signal includes:
[0017] Obtain the phase information of the electrical signal;
[0018] The phase information is input into the trained phase detection model to obtain the abnormal probability of the phase information;
[0019] If the anomaly probability is greater than a preset probability, the phase information is determined to be an abnormal phase information;
[0020] If the phase information is determined to be abnormal phase information, the electrical signal is filtered to obtain a filtered electrical signal, which is used as the preprocessed electrical signal.
[0021] In one embodiment, the feature extraction process performed on the preprocessed electrical signal to obtain multiple feature vectors corresponding to the preprocessed electrical signal includes:
[0022] Extract the time-domain information corresponding to the preprocessed electrical signal;
[0023] The time-domain information is subjected to Fourier transform processing to obtain the frequency-domain information corresponding to the preprocessed electrical signal;
[0024] The time-domain information is subjected to feature extraction processing to obtain a first feature vector corresponding to the time-domain information, and the frequency-domain information is subjected to feature extraction processing to obtain a second feature vector corresponding to the frequency-domain information;
[0025] Both the first feature vector and the second feature vector are used as multiple feature vectors corresponding to the preprocessed electrical signal.
[0026] In one embodiment, the step of fusing multiple feature vectors corresponding to the preprocessed electrical signal to obtain the target feature vector corresponding to the gas to be detected includes:
[0027] The correlation coefficients among the multiple feature vectors corresponding to the preprocessed electrical signal are determined.
[0028] The initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal are determined based on the correlation coefficients among them.
[0029] The initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal are normalized to obtain the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal.
[0030] Based on the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal, the multiple feature vectors corresponding to the preprocessed electrical signal are fused to obtain the target feature vector.
[0031] In one embodiment, the trained gas detection model is obtained by training in the following manner:
[0032] Acquire the photoacoustic signal of the sample gas;
[0033] The sample displacement response information corresponding to the sample photoacoustic signal is determined by the cantilever microphone.
[0034] The sample displacement response information is converted and processed to obtain the sample electrical signal corresponding to the sample gas;
[0035] The sample electrical signal is preprocessed to obtain the preprocessed sample electrical signal;
[0036] The preprocessed sample electrical signal is subjected to feature extraction processing to obtain multiple sample feature vectors corresponding to the preprocessed sample electrical signal;
[0037] The multiple sample feature vectors corresponding to the preprocessed sample electrical signal are fused to obtain the sample target feature vector corresponding to the sample gas.
[0038] The sample target feature vector is input into the gas detection model to be trained to obtain the predicted gas detection result corresponding to the sample gas;
[0039] Obtain the actual gas detection result corresponding to the sample gas, and iteratively train the gas detection model to be trained based on the difference between the predicted gas detection result and the actual gas detection result to obtain the trained gas detection model.
[0040] Secondly, this application also provides a gas detection device based on a cantilever microphone, comprising:
[0041] The signal acquisition module is used to acquire the photoacoustic signal of the gas to be detected.
[0042] The information determination module is used to determine the displacement response information corresponding to the photoacoustic signal through the cantilever microphone;
[0043] The information conversion module is used to convert and process the displacement response information to obtain the electrical signal corresponding to the gas to be detected;
[0044] The signal processing module is used to preprocess the electrical signal to obtain a preprocessed electrical signal;
[0045] The feature extraction module is used to perform feature extraction processing on the preprocessed electrical signal to obtain multiple feature vectors corresponding to the preprocessed electrical signal;
[0046] The feature fusion module is used to fuse multiple feature vectors corresponding to the preprocessed electrical signal to obtain the target feature vector corresponding to the gas to be detected.
[0047] The result determination module is used to input the target feature vector into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected.
[0048] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0049] Acquire the photoacoustic signal of the gas to be detected;
[0050] The displacement response information corresponding to the photoacoustic signal is determined by the cantilever microphone;
[0051] The displacement response information is converted and processed to obtain the electrical signal corresponding to the gas to be detected;
[0052] The electrical signal is preprocessed to obtain a preprocessed electrical signal;
[0053] The preprocessed electrical signal is subjected to feature extraction processing to obtain multiple feature vectors corresponding to the preprocessed electrical signal;
[0054] The multiple feature vectors corresponding to the preprocessed electrical signal are fused to obtain the target feature vector corresponding to the gas to be detected.
[0055] The target feature vector is input into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected.
[0056] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0057] Acquire the photoacoustic signal of the gas to be detected;
[0058] The displacement response information corresponding to the photoacoustic signal is determined by the cantilever microphone;
[0059] The displacement response information is converted and processed to obtain the electrical signal corresponding to the gas to be detected;
[0060] The electrical signal is preprocessed to obtain a preprocessed electrical signal;
[0061] The preprocessed electrical signal is subjected to feature extraction processing to obtain multiple feature vectors corresponding to the preprocessed electrical signal;
[0062] The multiple feature vectors corresponding to the preprocessed electrical signal are fused to obtain the target feature vector corresponding to the gas to be detected.
[0063] The target feature vector is input into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected.
[0064] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0065] Acquire the photoacoustic signal of the gas to be detected;
[0066] The displacement response information corresponding to the photoacoustic signal is determined by the cantilever microphone;
[0067] The displacement response information is converted and processed to obtain the electrical signal corresponding to the gas to be detected;
[0068] The electrical signal is preprocessed to obtain a preprocessed electrical signal;
[0069] The preprocessed electrical signal is subjected to feature extraction processing to obtain multiple feature vectors corresponding to the preprocessed electrical signal;
[0070] The multiple feature vectors corresponding to the preprocessed electrical signal are fused to obtain the target feature vector corresponding to the gas to be detected.
[0071] The target feature vector is input into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected.
[0072] The aforementioned gas detection method, apparatus, computer equipment, storage medium, and computer program product based on a cantilever microphone first acquires the photoacoustic signal of the gas to be detected, and then determines the displacement response information corresponding to the photoacoustic signal through the cantilever microphone. Next, the displacement response information is converted to obtain the electrical signal corresponding to the gas to be detected, and the electrical signal is preprocessed to obtain a preprocessed electrical signal. Then, feature extraction processing is performed on the preprocessed electrical signal to obtain multiple feature vectors corresponding to the preprocessed electrical signal. These multiple feature vectors are then fused to obtain the target feature vector corresponding to the gas to be detected. Finally, the target feature vector is input into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected. In this way, by using a cantilever microphone during gas detection, the photoacoustic signal of the gas to be detected can be effectively converted into measurable displacement response information. Through a series of processing steps such as preprocessing, feature processing, and model processing, the target gas detection result corresponding to the gas to be detected can be accurately identified, which helps to improve the sensitivity of gas detection. Moreover, this method avoids the shortcomings of using chemical reactions with specific reagents to produce color changes and comparing with standard color charts, which are easily affected by interfering substances and result in low gas detection sensitivity. This method further improves the sensitivity of gas detection. Attached Figure Description
[0073] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0074] Figure 1 This is a flowchart illustrating a gas detection method based on a cantilever microphone in one embodiment;
[0075] Figure 2 This is a schematic diagram of a cantilever microphone in one embodiment;
[0076] Figure 3 This is a flowchart illustrating a gas detection method based on a cantilever microphone in another embodiment;
[0077] Figure 4 This is a structural block diagram of a gas detection device based on a cantilever microphone in one embodiment;
[0078] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0079] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0080] 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, data stored, data displayed, 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 the relevant data must comply with relevant regulations.
[0081] In one exemplary embodiment, such as Figure 1 As shown, a gas detection method based on a cantilever microphone is provided. This embodiment illustrates the application of this method to a server; it is understood that this method can also be applied to a terminal, or to a system including a terminal and a server, and is implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, and tablets; the server can be a standalone server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps:
[0082] Step S101: Acquire the photoacoustic signal of the gas to be detected.
[0083] Among them, the gas to be detected refers to the gas that needs to be detected.
[0084] Among them, photoacoustic signal refers to the signal generated by the gas to be detected based on the photoacoustic effect.
[0085] For example, the server introduces the gas to be detected into the photoacoustic cell and determines the light source corresponding to the gas to be detected based on the absorption spectrum characteristics of the gas to be detected; then, the server illuminates the gas to be detected in the photoacoustic cell with the light source according to the preset light path to obtain the photoacoustic signal corresponding to the gas to be detected.
[0086] Step S102: The displacement response information corresponding to the photoacoustic signal is determined by the cantilever microphone.
[0087] Among them, the cantilever microphone refers to a microphone that uses a cantilever beam structure, also known as an optical cantilever microphone.
[0088] Among them, displacement response information refers to the information contained in the displacement change of an object (such as the cantilever beam of a cantilever microphone) relative to its initial state when it is subjected to external excitation (such as photoacoustic signal).
[0089] For example, the server preprocesses the photoacoustic signal to obtain a preprocessed photoacoustic signal; then, the server uses a cantilever microphone to determine the displacement response information corresponding to the preprocessed photoacoustic signal, which is used as the displacement response information corresponding to the photoacoustic signal.
[0090] Step S103: The displacement response information is converted and processed to obtain the electrical signal corresponding to the gas to be detected.
[0091] Electrical signals refer to signals that represent information in electrical form.
[0092] For example, the server preprocesses the displacement response information to obtain preprocessed displacement response information; then, the server performs conversion processing on the preprocessed displacement response information to obtain the electrical signal corresponding to the preprocessed displacement response information, which serves as the electrical signal corresponding to the gas to be detected.
[0093] Step S104: Preprocess the electrical signal to obtain the preprocessed electrical signal.
[0094] Among them, the preprocessed electrical signal refers to the electrical signal after preprocessing.
[0095] For example, the server filters the electrical signal to obtain a filtered electrical signal, which is then used as a preprocessed electrical signal.
[0096] Step S105: Perform feature extraction processing on the preprocessed electrical signal to obtain multiple feature vectors corresponding to the preprocessed electrical signal.
[0097] Among them, the feature vector is used to represent the representation vector corresponding to the preprocessed electrical signal.
[0098] For example, the server inputs the preprocessed electrical signal into the feature extraction model, and the feature extraction model performs feature extraction processing on the preprocessed electrical signal to obtain multiple feature vectors corresponding to the preprocessed electrical signal.
[0099] Step S106: The multiple feature vectors corresponding to the preprocessed electrical signal are fused to obtain the target feature vector corresponding to the gas to be detected.
[0100] Among them, fusion processing can refer to weighted summation processing.
[0101] The target feature vector refers to the feature vector obtained by fusing multiple feature vectors corresponding to the preprocessed electrical signal.
[0102] For example, the server performs fusion processing on multiple feature vectors corresponding to the preprocessed electrical signal according to the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal to obtain the target feature vector corresponding to the gas to be detected; for example, the server performs weighted summation processing on multiple feature vectors corresponding to the preprocessed electrical signal according to the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal to obtain the target feature vector corresponding to the gas to be detected.
[0103] Step S107: Input the target feature vector into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected.
[0104] Among them, the gas detection model refers to the network model that can obtain the target gas detection result by using the target feature vector corresponding to the gas to be detected, such as the convolutional neural network model.
[0105] Among them, the target gas detection result refers to the gas detection result corresponding to the gas to be detected, including the gas type, gas content, etc.
[0106] For example, the server inputs the target feature vector into the trained gas detection model to obtain multiple preset gas detection results corresponding to the gas to be detected, as well as the prediction probability of each preset gas detection result; then, the server selects the preset gas detection result with the highest prediction probability from each preset gas detection result as the target gas detection result corresponding to the gas to be detected.
[0107] In the above-mentioned gas detection method based on a cantilever microphone, the photoacoustic signal of the gas to be detected is first acquired, and the displacement response information corresponding to the photoacoustic signal is determined by the cantilever microphone. Then, the displacement response information is converted to obtain the electrical signal corresponding to the gas to be detected. The electrical signal is then preprocessed to obtain a preprocessed electrical signal. Next, feature extraction processing is performed on the preprocessed electrical signal to obtain multiple feature vectors corresponding to the preprocessed electrical signal. Then, the multiple feature vectors corresponding to the preprocessed electrical signal are fused to obtain the target feature vector corresponding to the gas to be detected. Finally, the target feature vector is input into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected. In this way, by using a cantilever microphone during gas detection, the photoacoustic signal of the gas to be detected can be effectively converted into measurable displacement response information. Through a series of processing steps such as preprocessing, feature processing, and model processing, the target gas detection result corresponding to the gas to be detected can be accurately identified, which helps to improve the sensitivity of gas detection. Moreover, this method avoids the shortcomings of using chemical reactions with specific reagents to produce color changes and comparing with standard color charts, which are easily affected by interfering substances and result in low gas detection sensitivity. This method further improves the sensitivity of gas detection.
[0108] In one exemplary embodiment, the cantilever microphone includes a cantilever beam with a reflector mounted on its free end; the cantilever beam is made of silicon and has a length of 4 mm, a width of 2 mm, and a thickness of 5 micrometers.
[0109] Therefore, in step S102 above, the displacement response information corresponding to the photoacoustic signal is determined by the cantilever microphone. Specifically, the displacement response information corresponding to the photoacoustic signal is measured by the Michelson interferometer corresponding to the reflector installed on the free end of the cantilever beam in the cantilever microphone.
[0110] A cantilever beam is a type of beam structure where one end is fixed and the other end is suspended in the air. For example... Figure 2 As shown, the cantilever beam has a length L of 4 mm, a width h of 2 mm, and a thickness d of 5 micrometers.
[0111] A mirror is an optical element used to reflect light.
[0112] Among them, the Michelson interferometer is a precision optical instrument used to measure the displacement response information corresponding to photoacoustic signals.
[0113] For example, the server preprocesses the photoacoustic signal to obtain a preprocessed photoacoustic signal; then, the server measures the displacement response information corresponding to the preprocessed photoacoustic signal using a Michelson interferometer corresponding to the reflector installed on the free end of the cantilever beam in the cantilever microphone, and uses this as the displacement response information corresponding to the photoacoustic signal.
[0114] In this embodiment, the Michelson interferometer corresponding to the reflector installed on the free end of the cantilever beam in the cantilever microphone can accurately capture the minute displacement response information of the cantilever beam caused by photoacoustic signals, which is beneficial to improve the sensitivity and accuracy of detection and provides reliable basic data for subsequent accurate analysis.
[0115] In an exemplary embodiment, step S104 above, which preprocesses the electrical signal to obtain a preprocessed electrical signal, specifically includes the following: acquiring the phase information of the electrical signal; inputting the phase information into a trained phase detection model to obtain the abnormal probability of the phase information; determining that the phase information is abnormal phase information when the abnormal probability is greater than a preset probability; and filtering the electrical signal to obtain a filtered electrical signal, which is used as the preprocessed electrical signal.
[0116] Phase information refers to the phase value corresponding to the electrical signal.
[0117] Among them, the phase detection model refers to the network model that can use phase information to obtain the probability of anomalies in phase information, such as the recurrent neural network model.
[0118] The anomaly probability refers to the likelihood that the phase detection model determines the phase information to be abnormal.
[0119] The preset probability refers to a pre-defined probability threshold used to judge the probability of anomalies. It should be noted that the preset probability depends on the circumstances.
[0120] Among them, abnormal phase information refers to phase information whose corresponding abnormal probability is greater than the preset probability.
[0121] Here, the filtered electrical signal refers to the electrical signal after filtering.
[0122] For example, the server uses a time-domain analysis method to extract the phase information of the electrical signal; then, the server preprocesses the phase information to obtain preprocessed phase information; next, the server inputs the preprocessed phase information into a trained phase detection model, and obtains the anomalous probability of the phase information through the phase detection model; if the anomalous probability is greater than a preset probability, the server determines that the phase information is anomalous phase information; if the phase information is determined to be anomalous phase information, the server filters the electrical signal to obtain a filtered electrical signal, which is used as the filtered electrical signal; finally, the server performs signal enhancement processing on the filtered electrical signal and uses the enhanced filtered electrical signal as the preprocessed electrical signal.
[0123] In this embodiment, by inputting the acquired electrical signal phase information into the trained phase detection model, the model's analytical capabilities can be used to accurately determine whether the phase information is abnormal. Moreover, after determining that the phase information is abnormal, the electrical signal is filtered to remove or reduce these adverse factors, which helps to improve the quality of the electrical signal.
[0124] In an exemplary embodiment, step S105 above, which involves performing feature extraction processing on the preprocessed electrical signal to obtain multiple feature vectors corresponding to the preprocessed electrical signal, specifically includes the following: extracting time-domain information corresponding to the preprocessed electrical signal; performing Fourier transform processing on the time-domain information to obtain frequency-domain information corresponding to the preprocessed electrical signal; performing feature extraction processing on the time-domain information to obtain a first feature vector corresponding to the time-domain information, and performing feature extraction processing on the frequency-domain information to obtain a second feature vector corresponding to the frequency-domain information; and using both the first feature vector and the second feature vector as multiple feature vectors corresponding to the preprocessed electrical signal.
[0125] Among them, time-domain information refers to the characteristic description of the preprocessed electrical signal in the time domain.
[0126] Frequency domain information refers to the characteristic description of the preprocessed electrical signal in the frequency domain.
[0127] Here, the first feature vector refers to the feature vector corresponding to the time-domain information.
[0128] The second eigenvector refers to the eigenvector corresponding to the frequency domain information.
[0129] For example, the server extracts the time-domain information corresponding to the preprocessed electrical signal using an oscilloscope; then, the server performs Fourier transform processing on the time-domain information to obtain the corresponding frequency-domain information, which is used as the frequency-domain information corresponding to the preprocessed electrical signal; next, the server inputs the time-domain information into a feature extraction model, and performs feature extraction processing on the time-domain information to obtain the corresponding feature vector, which is used as the first feature vector; then, the server inputs the frequency-domain information into the feature extraction model, and performs feature extraction processing on the frequency-domain information to obtain the corresponding feature vector, which is used as the second feature vector; finally, the server uses both the first and second feature vectors as multiple feature vectors corresponding to the preprocessed electrical signal.
[0130] In this embodiment, by extracting the time-domain and frequency-domain information corresponding to the preprocessed electrical signal respectively, the characteristics of the electrical signal can be comprehensively described from different perspectives, avoiding the one-sidedness that may be caused by analyzing the electrical signal from only a single dimension. Moreover, by performing feature extraction processing on the time-domain and frequency-domain information respectively, the key features of the electrical signal in different dimensions can be quantified, which facilitates subsequent data processing.
[0131] In an exemplary embodiment, step S106 above, which fuses multiple feature vectors corresponding to the preprocessed electrical signal to obtain a target feature vector corresponding to the gas to be detected, specifically includes the following: determining the correlation coefficient between the multiple feature vectors corresponding to the preprocessed electrical signal; determining the initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal based on the correlation coefficient; normalizing the initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal to obtain the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal; and fusing the multiple feature vectors corresponding to the preprocessed electrical signal based on the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal to obtain the target feature vector.
[0132] The correlation coefficient is used to represent the degree of correlation between multiple feature vectors corresponding to the preprocessed electrical signal.
[0133] The initial weight refers to the weight initially assigned.
[0134] The target weight refers to the final weight assigned to the target.
[0135] For example, the server inputs multiple feature vectors corresponding to the preprocessed electrical signal into the correlation coefficient prediction model to obtain the correlation coefficients among the multiple feature vectors corresponding to the preprocessed electrical signal. Then, based on the correlation coefficients among the multiple feature vectors corresponding to the preprocessed electrical signal, the server queries the correspondence between the correlation coefficients and weights to obtain the weights of the multiple feature vectors corresponding to the preprocessed electrical signal, which serve as the initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal. Finally, the server normalizes the initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal to obtain the final weights of the multiple feature vectors corresponding to the preprocessed electrical signal. Target weights; for example, the initial weights of the feature vectors corresponding to the preprocessed electrical signal are 0.8, 0.6, and 0.6, respectively. After normalization, the target weights of the feature vectors corresponding to the preprocessed electrical signal are 0.4, 0.3, and 0.3, respectively. Then, the server performs a fusion process on the multiple feature vectors corresponding to the preprocessed electrical signal according to the target weights of the multiple feature vectors, to obtain the target feature vector; for example, the server performs a weighted summation process on the multiple feature vectors corresponding to the preprocessed electrical signal according to the target weights of the multiple feature vectors, to obtain the target feature vector.
[0136] In this embodiment, the initial weights are determined based on the correlation coefficient between feature vectors, so that the weight allocation is more in line with the actual relationship between features, avoiding overweighting of highly correlated features, and thus making the feature vector of each feature more accurate, which is conducive to improving the accuracy of the determination of the target feature vector.
[0137] In an exemplary embodiment, the gas detection method based on a cantilever microphone provided in this application further includes a training step for a trained gas detection model, specifically including the following: acquiring the sample photoacoustic signal of the sample gas; determining the sample displacement response information corresponding to the sample photoacoustic signal using a cantilever microphone; converting the sample displacement response information to obtain the sample electrical signal corresponding to the sample gas; preprocessing the sample electrical signal to obtain a preprocessed sample electrical signal; performing feature extraction processing on the preprocessed sample electrical signal to obtain multiple sample feature vectors corresponding to the preprocessed sample electrical signal; fusing the multiple sample feature vectors corresponding to the preprocessed sample electrical signal to obtain a sample target feature vector corresponding to the sample gas; inputting the sample target feature vector into the gas detection model to be trained to obtain the predicted gas detection result corresponding to the sample gas; acquiring the actual gas detection result corresponding to the sample gas, and iteratively training the gas detection model to be trained based on the difference between the predicted gas detection result and the actual gas detection result to obtain a trained gas detection model.
[0138] The sample gas refers to the gas used to train the gas detection model to be trained.
[0139] Among them, the sample photoacoustic signal refers to the signal generated by the sample gas based on the photoacoustic effect.
[0140] Among them, sample displacement response information refers to the displacement response information corresponding to the sample photoacoustic signal.
[0141] Among them, the sample electrical signal refers to the electrical signal corresponding to the sample gas.
[0142] Among them, the preprocessed sample electrical signal refers to the sample electrical signal after preprocessing.
[0143] Here, the sample feature vector refers to the feature vector corresponding to the sample electrical signal after preprocessing.
[0144] Among them, the sample target feature vector refers to the feature vector obtained by fusing multiple sample feature vectors corresponding to the preprocessed sample electrical signal.
[0145] Among them, the predicted gas detection result refers to the predicted value corresponding to the gas detection result of the sample gas.
[0146] The actual gas detection result refers to the actual value corresponding to the gas detection result of the sample gas.
[0147] For example, in response to a model training instruction for a gas detection model to be trained, the server retrieves the sample photoacoustic signal of the sample gas from the database; then, the server uses a cantilever microphone to determine the sample displacement response information corresponding to the sample photoacoustic signal; next, the server performs conversion processing on the sample displacement response information to obtain the sample electrical signal corresponding to the sample gas; then, the server preprocesses the sample electrical signal to obtain a preprocessed sample electrical signal; then, the server performs feature extraction processing on the preprocessed sample electrical signal to obtain multiple sample feature vectors corresponding to the preprocessed sample electrical signal; finally, the server fuses the multiple sample feature vectors corresponding to the preprocessed sample electrical signal to obtain the sample... The server first generates a sample target feature vector corresponding to the gas. Then, it inputs the sample target feature vector into the gas detection model to be trained to obtain the predicted gas detection result corresponding to the sample gas. Next, the server obtains the actual gas detection result corresponding to the sample gas and obtains the loss value based on the difference between the predicted gas detection result and the actual gas detection result. Then, the server adjusts the model parameters of the gas detection model to be trained based on the loss value. Then, the server retrains the gas detection model with adjusted model parameters until the loss value obtained by the trained gas detection model is less than the loss value threshold. At this point, training stops, and the trained gas detection model is taken as the completed gas detection model.
[0148] In this embodiment, by pre-training the gas detection model, it is convenient to predict the target gas detection result after obtaining the target feature vector corresponding to the gas to be detected in practical applications. Moreover, the gas detection model receives new data in each iteration, and performs internal model improvement and optimization, which makes it easier to make predictions more effectively and improves the prediction accuracy of the gas detection model.
[0149] In one exemplary embodiment, such as Figure 3 As shown, another gas detection method based on a cantilever microphone is provided. Taking the application of this method to a server as an example, the method includes the following steps:
[0150] Step S301: Acquire the photoacoustic signal of the gas to be detected.
[0151] In step S302, the displacement response information corresponding to the photoacoustic signal is measured using the Michelson interferometer corresponding to the reflector installed on the free end of the cantilever beam in the cantilever microphone.
[0152] Step S303: The displacement response information is converted and processed to obtain the electrical signal corresponding to the gas to be detected.
[0153] Step S304: Obtain the phase information of the electrical signal; input the phase information into the trained phase detection model to obtain the abnormal probability of the phase information; if the abnormal probability is greater than the preset probability, determine the phase information as abnormal phase information.
[0154] Step S305: If the phase information is determined to be abnormal phase information, the electrical signal is filtered to obtain a filtered electrical signal, which is used as the preprocessed electrical signal.
[0155] Step S306: Extract the time-domain information corresponding to the preprocessed electrical signal; perform Fourier transform processing on the time-domain information to obtain the frequency-domain information corresponding to the preprocessed electrical signal.
[0156] Step S307: Perform feature extraction processing on the time domain information to obtain the first feature vector corresponding to the time domain information, and perform feature extraction processing on the frequency domain information to obtain the second feature vector corresponding to the frequency domain information; use both the first feature vector and the second feature vector as multiple feature vectors corresponding to the preprocessed electrical signal.
[0157] Step S308: Determine the correlation coefficient between multiple feature vectors corresponding to the preprocessed electrical signal; determine the initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal based on the correlation coefficient between them.
[0158] Step S309: Normalize the initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal to obtain the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal.
[0159] Step S310: Based on the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal, perform fusion processing on the multiple feature vectors corresponding to the preprocessed electrical signal to obtain the target feature vector.
[0160] Step S311: Input the target feature vector into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected.
[0161] In the aforementioned gas detection method based on a cantilever microphone, the photoacoustic signal of the gas to be detected is effectively converted into measurable displacement response information by using a cantilever microphone during the gas detection process. Through a series of processing steps, including preprocessing, feature processing, and model processing, the target gas detection result corresponding to the gas to be detected can be accurately identified, which helps to improve the sensitivity of gas detection. Moreover, this method avoids the shortcomings of using chemical reactions with specific reagents to produce color changes and comparing with standard color charts, which are easily affected by interfering substances and result in low gas detection sensitivity. This method further improves the sensitivity of gas detection.
[0162] In an exemplary embodiment, to more clearly illustrate the gas detection method based on a cantilever microphone provided in this application, the following specific embodiment will be used to describe the gas detection method based on a cantilever microphone. In one embodiment, this application also provides a method for optimizing the performance of a microphone in photoacoustic spectroscopy. During gas detection, the photoacoustic signal of the gas to be detected is first acquired, and the displacement response information corresponding to the photoacoustic signal is determined using a cantilever microphone. Then, the displacement response information is converted to obtain the electrical signal corresponding to the gas to be detected. The electrical signal is then preprocessed to obtain a preprocessed electrical signal. Next, feature extraction processing is performed on the preprocessed electrical signal to obtain multiple feature vectors corresponding to the preprocessed electrical signal. Then, the multiple feature vectors corresponding to the preprocessed electrical signal are fused to obtain the target feature vector corresponding to the gas to be detected. Finally, the target feature vector is input into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected. Specifically, the following content is included:
[0163] 1. Microphone optimization theoretical model:
[0164] The optimization theoretical model for microphones in photoacoustic spectroscopy is based on the point mass model of a harmonic oscillator. When a sound wave acts on the vibrating element of the microphone, it produces a corresponding displacement, which is related to the intensity and frequency of the sound wave. To improve the detection sensitivity of the photoacoustic signal, it is necessary to maximize the displacement response of the vibrating element. This can be achieved by adjusting the physical parameters of the vibrating element, such as its mass, damping constant, and elastic constant. The equation of motion for the vibrating element is as follows:
[0165] Equation (1)
[0166] Where m is the mass of the vibrating element;
[0167] R is the damping constant;
[0168] k is the elastic constant of the vibrating element;
[0169] It is an external force generated by photoacoustic signals.
[0170] To optimize microphone performance, we focus on reducing the resonant frequency of the vibrating element. This can be achieved by adjusting the values of m, R, and k. Resonant frequency. The relationship with m and k is as follows:
[0171] Equation (2)
[0172] In practical applications, we reduce the mass m of the vibrating element by selecting lightweight materials and designing appropriate structures, while keeping the elastic constant k within a suitable range, in order to reduce the resonant frequency.
[0173] The damping constant R affects the response speed and steady-state response of a vibrating element. Appropriate damping can reduce oscillations and improve response speed, but excessive damping will reduce sensitivity. The frequency response of the microphone can be optimized by adjusting the above parameters to achieve the maximum displacement response within the frequency range of the photoacoustic signal.
[0174] 2. Design of the optical cantilever microphone:
[0175] The optical cantilever microphone is designed to achieve the goal proposed in the theoretical model above: maximizing the detection sensitivity of the photoacoustic signal in non-resonant mode. The cantilever beam is the core component of the microphone, and its design directly affects its performance. The material of the cantilever beam needs to have high Young's modulus and low density to achieve a low resonant frequency and high sensitivity. The dimensions of the cantilever beam need to be optimized according to the theoretical model. The selection of length, width, and thickness needs to balance resonant frequency, stiffness, and mass.
[0176] The cantilever beam of the optical cantilever microphone is made of silicon. Silicon has a high Young's modulus and low density, which helps to reduce the resonant frequency while maintaining structural strength. In terms of dimensions, the length L = 4mm, the width h = 2mm, and the thickness d = 5μm. Figure 1 As shown.
[0177] According to the formula for the resonant frequency of a cantilever beam:
[0178] Equation (3)
[0179] Where E is the Young's modulus of silicon, and ρ is the density of silicon. The resonant frequency of the cantilever beam can be calculated to be 330 Hz.
[0180] Optical cantilever microphones use optical methods to measure the displacement of a cantilever beam. This typically involves mounting a mirror at the free end of the cantilever beam and measuring the displacement using a Michelson interferometer. This non-contact measurement method provides high-precision displacement readings and does not affect the natural vibrations of the cantilever beam. The fabrication of optical cantilever microphones involves high-precision micromachining techniques. It should be noted that MEMS (Micro-Electro-Mechanical Systems) technology allows for the fabrication of complex structures at the microscale and enables mass production. Strict control over dimensions and shape is required during manufacturing to ensure consistent performance for each microphone.
[0181] In the above embodiments, during gas detection, a cantilever microphone is used to effectively convert the photoacoustic signal of the gas to be detected into measurable displacement response information. Through a series of processing steps, including preprocessing, feature processing, and model processing, the target gas detection result corresponding to the gas to be detected can be accurately identified, which helps to improve the sensitivity of gas detection. Moreover, this method avoids the shortcomings of using chemical reactions with specific reagents to produce color changes and comparing with standard color charts, which are easily affected by interfering substances and result in low gas detection sensitivity. This method improves the sensitivity of gas detection.
[0182] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0183] Based on the same inventive concept, this application also provides a gas detection device based on a cantilever microphone for implementing the gas detection method based on a cantilever microphone described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more embodiments of the gas detection device based on a cantilever microphone provided below can be found in the limitations of the gas detection method based on a cantilever microphone described above, and will not be repeated here.
[0184] In one exemplary embodiment, such as Figure 4 As shown, a gas detection device based on a cantilever microphone is provided, comprising: a signal acquisition module 401, an information determination module 402, an information conversion module 403, a signal processing module 404, a feature extraction module 405, a feature fusion module 406, and a result determination module 407, wherein:
[0185] The signal acquisition module 401 is used to acquire the photoacoustic signal of the gas to be detected.
[0186] The information determination module 402 is used to determine the displacement response information corresponding to the photoacoustic signal through the cantilever microphone.
[0187] The information conversion module 403 is used to convert and process the displacement response information to obtain the electrical signal corresponding to the gas to be detected.
[0188] The signal processing module 404 is used to preprocess the electrical signal to obtain the preprocessed electrical signal.
[0189] The feature extraction module 405 is used to perform feature extraction processing on the preprocessed electrical signal to obtain multiple feature vectors corresponding to the preprocessed electrical signal.
[0190] The feature fusion module 406 is used to fuse multiple feature vectors corresponding to the preprocessed electrical signal to obtain the target feature vector corresponding to the gas to be detected.
[0191] The result determination module 407 is used to input the target feature vector into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected.
[0192] In an exemplary embodiment, the information determination module 402 is further configured to measure the displacement response information corresponding to the photoacoustic signal using a Michelson interferometer corresponding to a reflector mounted on the free end of the cantilever beam in the cantilever microphone.
[0193] In an exemplary embodiment, the signal processing module 404 is further configured to acquire phase information of an electrical signal; input the phase information into a trained phase detection model to obtain the abnormal probability of the phase information; determine that the phase information is abnormal phase information if the abnormal probability is greater than a preset probability; and filter the electrical signal to obtain a filtered electrical signal as a preprocessed electrical signal.
[0194] In an exemplary embodiment, the feature extraction module 405 is further configured to extract time-domain information corresponding to the preprocessed electrical signal; perform Fourier transform processing on the time-domain information to obtain frequency-domain information corresponding to the preprocessed electrical signal; perform feature extraction processing on the time-domain information to obtain a first feature vector corresponding to the time-domain information, and perform feature extraction processing on the frequency-domain information to obtain a second feature vector corresponding to the frequency-domain information; and use both the first feature vector and the second feature vector as multiple feature vectors corresponding to the preprocessed electrical signal.
[0195] In an exemplary embodiment, the feature fusion module 406 is further configured to: determine the correlation coefficient among multiple feature vectors corresponding to the preprocessed electrical signal; determine the initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal based on the correlation coefficient; normalize the initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal to obtain the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal; and fuse the multiple feature vectors corresponding to the preprocessed electrical signal based on the target weights to obtain the target feature vector.
[0196] In an exemplary embodiment, the gas detection device based on a cantilever microphone further includes a model training module for acquiring the photoacoustic signal of a sample gas; determining the sample displacement response information corresponding to the photoacoustic signal using the cantilever microphone; converting the sample displacement response information to obtain the sample electrical signal corresponding to the sample gas; preprocessing the sample electrical signal to obtain a preprocessed sample electrical signal; performing feature extraction on the preprocessed sample electrical signal to obtain multiple sample feature vectors corresponding to the preprocessed sample electrical signal; fusing the multiple sample feature vectors corresponding to the preprocessed sample electrical signal to obtain a sample target feature vector corresponding to the sample gas; inputting the sample target feature vector into the gas detection model to be trained to obtain the predicted gas detection result corresponding to the sample gas; acquiring the actual gas detection result corresponding to the sample gas; and iteratively training the gas detection model to be trained based on the difference between the predicted gas detection result and the actual gas detection result to obtain the trained gas detection model.
[0197] The various modules in the aforementioned gas detection device based on cantilever microphones can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0198] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores displacement response information, electrical signals, and other data. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a gas detection method based on a cantilever microphone.
[0199] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0200] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0201] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.
[0202] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0203] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0204] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 specification.
[0205] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A gas detection method based on a cantilever microphone, characterized in that, The method includes: Acquire the photoacoustic signal of the gas to be detected; The displacement response information corresponding to the photoacoustic signal is measured by a Michelson interferometer corresponding to a mirror mounted on the free end of the cantilever beam in the cantilever microphone; the material of the cantilever beam is silicon, and the length of the cantilever beam is 4 mm, the width is 2 mm, the thickness is 5 micrometers, and the resonant frequency is 330 Hz. The displacement response information is converted and processed to obtain the electrical signal corresponding to the gas to be detected; A time-domain analysis method is used to extract the phase information of the electrical signal; the phase information is input into a trained phase detection model to obtain the abnormal probability of the phase information; if the abnormal probability is greater than a preset probability, the phase information is determined to be abnormal phase information; if the phase information is determined to be abnormal phase information, the electrical signal is filtered to obtain a filtered electrical signal; the filtered electrical signal is then enhanced, and the enhanced filtered electrical signal is used as the preprocessed electrical signal. The preprocessed electrical signal is subjected to feature extraction processing to obtain multiple feature vectors corresponding to the preprocessed electrical signal; Multiple feature vectors corresponding to the preprocessed electrical signal are input into a correlation coefficient prediction model to obtain the correlation coefficients among the multiple feature vectors corresponding to the preprocessed electrical signal. Based on the correlation coefficients among the multiple feature vectors corresponding to the preprocessed electrical signal, the correspondence between the correlation coefficients and weights is queried to obtain the initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal. The initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal are normalized to obtain the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal. Based on the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal, the multiple feature vectors corresponding to the preprocessed electrical signal are fused to obtain the target feature vector corresponding to the gas to be detected. The target feature vector is input into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected; the target gas detection result is used to represent the gas type and gas content corresponding to the gas to be detected.
2. The method according to claim 1, characterized in that, The cantilever microphone includes the cantilever beam, and a reflector is mounted on the free end of the cantilever beam.
3. The method according to claim 1, characterized in that, The step of performing feature extraction processing on the preprocessed electrical signal to obtain multiple feature vectors corresponding to the preprocessed electrical signal includes: Extract the time-domain information corresponding to the preprocessed electrical signal; The time-domain information is subjected to Fourier transform processing to obtain the frequency-domain information corresponding to the preprocessed electrical signal; The time-domain information is subjected to feature extraction processing to obtain a first feature vector corresponding to the time-domain information, and the frequency-domain information is subjected to feature extraction processing to obtain a second feature vector corresponding to the frequency-domain information; Both the first feature vector and the second feature vector are used as multiple feature vectors corresponding to the preprocessed electrical signal.
4. The method according to any one of claims 1 to 3, characterized in that, The trained gas detection model was obtained through the following method: Acquire the photoacoustic signal of the sample gas; The sample displacement response information corresponding to the sample photoacoustic signal is determined by the cantilever microphone. The sample displacement response information is converted and processed to obtain the sample electrical signal corresponding to the sample gas; The sample electrical signal is preprocessed to obtain the preprocessed sample electrical signal; The preprocessed sample electrical signal is subjected to feature extraction processing to obtain multiple sample feature vectors corresponding to the preprocessed sample electrical signal; The multiple sample feature vectors corresponding to the preprocessed sample electrical signal are fused to obtain the sample target feature vector corresponding to the sample gas. The sample target feature vector is input into the gas detection model to be trained to obtain the predicted gas detection result corresponding to the sample gas; Obtain the actual gas detection result corresponding to the sample gas, and iteratively train the gas detection model to be trained based on the difference between the predicted gas detection result and the actual gas detection result to obtain the trained gas detection model.
5. A gas detection device based on a cantilever microphone, characterized in that, The device includes: The signal acquisition module is used to acquire the photoacoustic signal of the gas to be detected. The information determination module is used to measure the displacement response information corresponding to the photoacoustic signal by using a Michelson interferometer corresponding to the reflector mounted on the free end of the cantilever beam in the cantilever microphone; the material of the cantilever beam is silicon, and the length of the cantilever beam is 4 mm, the width is 2 mm, the thickness is 5 micrometers, and the resonant frequency is 330 Hz. The information conversion module is used to convert and process the displacement response information to obtain the electrical signal corresponding to the gas to be detected; The signal processing module is used to extract the phase information of the electrical signal using a time-domain analysis method; input the phase information into a trained phase detection model to obtain the abnormal probability of the phase information; if the abnormal probability is greater than a preset probability, determine that the phase information is abnormal phase information; if the phase information is determined to be abnormal phase information, filter the electrical signal to obtain a filtered electrical signal; perform signal enhancement processing on the filtered electrical signal, and use the enhanced filtered electrical signal as a preprocessed electrical signal. The feature extraction module is used to perform feature extraction processing on the preprocessed electrical signal to obtain multiple feature vectors corresponding to the preprocessed electrical signal; The feature fusion module is used to input multiple feature vectors corresponding to the preprocessed electrical signal into a correlation coefficient prediction model to obtain the correlation coefficients among the multiple feature vectors corresponding to the preprocessed electrical signal; based on the correlation coefficients among the multiple feature vectors corresponding to the preprocessed electrical signal, query the correspondence between the correlation coefficients and weights to obtain the initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal; normalize the initial weights of the multiple feature vectors corresponding to the preprocessed electrical signal to obtain the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal; and fuse the multiple feature vectors corresponding to the preprocessed electrical signal based on the target weights of the multiple feature vectors corresponding to the preprocessed electrical signal to obtain the target feature vector corresponding to the gas to be detected. The result determination module is used to input the target feature vector into the trained gas detection model to obtain the target gas detection result corresponding to the gas to be detected; the target gas detection result is used to represent the gas type and gas content corresponding to the gas to be detected.
6. The apparatus according to claim 5, characterized in that, The signal processing module is further configured to extract time-domain information corresponding to the preprocessed electrical signal; perform Fourier transform processing on the time-domain information to obtain frequency-domain information corresponding to the preprocessed electrical signal; perform feature extraction processing on the time-domain information to obtain a first feature vector corresponding to the time-domain information, and perform feature extraction processing on the frequency-domain information to obtain a second feature vector corresponding to the frequency-domain information; and use both the first feature vector and the second feature vector as multiple feature vectors corresponding to the preprocessed electrical signal.
7. The apparatus according to any one of claims 5 to 6, characterized in that, The device further includes a model training module for acquiring the photoacoustic signal of the sample gas; determining the sample displacement response information corresponding to the photoacoustic signal of the sample gas through the cantilever microphone; and converting the sample displacement response information to obtain the sample electrical signal corresponding to the sample gas. The sample electrical signal is preprocessed to obtain the preprocessed sample electrical signal; The preprocessed sample electrical signal is subjected to feature extraction processing to obtain multiple sample feature vectors corresponding to the preprocessed sample electrical signal; Multiple sample feature vectors corresponding to the preprocessed sample electrical signal are fused to obtain the sample target feature vector corresponding to the sample gas; the sample target feature vector is input into the gas detection model to be trained to obtain the predicted gas detection result corresponding to the sample gas; the actual gas detection result corresponding to the sample gas is obtained, and the gas detection model to be trained is iteratively trained according to the difference between the predicted gas detection result and the actual gas detection result to obtain the trained gas detection model.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.