Gas concentration detection method, gas concentration detection device and electronic equipment
Through matrix reconstruction and filtering processing of quantum cascade lasers, combined with the periodic alignment partial least squares analysis model, the problems of signal stability and response speed in nitrous oxide detection were solved, and high-sensitivity and fast-response gas concentration detection was achieved.
Patent Information
- Application Number
- CN202510736269.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-09-23
AI Technical Summary
Existing nitrous oxide detection technology has shortcomings in detection efficiency and sensitivity, especially in low-concentration detection, where the accuracy is poor and it is difficult to meet the requirements of rapid response and high sensitivity. In addition, existing signal processing methods cannot effectively separate noise and target signals, resulting in unstable detection results.
Quantum cascade laser is used for gas detection. Matrix reconstruction and filtering are used to remove redundant information of spectral signals. A period-aligned partial least squares analysis model is constructed to accurately predict the target harmonic signal and improve the signal-to-noise ratio.
It improves the accuracy and efficiency of nitrous oxide detection, can achieve high-sensitivity detection within milliseconds, is suitable for on-site and mobile detection scenarios, and meets the needs of fast response and high precision.
Smart Images

Figure CN120685577A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of gas detection and data processing, and more specifically, to a gas concentration detection method, a gas concentration detection device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] Gas detection technology involves the quantitative or qualitative analysis of various gas components in the air using specialized instruments and methods. For example, it can detect toxic and combustible gases in ambient air. Gas detection technology is widely used in the petrochemical, chemical, metallurgical, mining, medical, and aviation industries to ensure workplace safety and prevent accidents.
[0003] For example, laughing gas ( ) is a colorless, odorless gas with unique chemical properties that has led to its widespread use in medicine, industry, and agriculture. In medicine, nitrous oxide is a common anesthetic, widely used in surgery and dental treatments due to its significant analgesic effects and high safety profile. In industry, nitrous oxide is used as a rocket propellant and a foaming agent in food processing. In agriculture, the use of nitrogen fertilizers and soil microbial activity release large amounts of nitrous oxide, making it an unavoidable byproduct of agricultural production.
[0004] However, the widespread use of nitrous oxide has also created serious environmental problems. As a potent greenhouse gas, nitrous oxide has a global warming potential 300 times greater than carbon dioxide and a lifetime in the atmosphere of over a century, making its long-term impact on climate change particularly significant. Furthermore, nitrous oxide participates in chemical reactions in the atmosphere, contributing to ozone depletion and further exacerbating environmental issues. However, related technologies for detecting the concentration of gases like nitrous oxide have poor accuracy. Summary of the Invention
[0005] In view of this, the present application provides a gas concentration detection method, a gas concentration detection device, an electronic device, a computer-readable storage medium, and a computer program product.
[0006] One aspect of the present application provides a gas concentration detection method, comprising:
[0007] Acquiring a spectral signal obtained by detecting the gas to be detected in the gas cell using a quantum cascade laser under preset sampling parameters;
[0008] Calculating search direction information and search distance information based on the spectral signal and the initial matrix, wherein the initial matrix includes an initial search direction solution and an initial search distance solution, and the initial search direction solution and the initial search distance solution are constructed based on instrument parameters of the quantum cascade laser, gas parameters of the gas to be detected, and the spectral signal; calculating a transition matrix based on the spectral signal, the search direction information, and the search distance information; and determining the transition matrix corresponding to the change value as a target matrix when a change value between the transition matrix and the initial matrix meets a preset threshold, wherein the matrix dimension of the target matrix is determined based on preset sampling parameters;
[0009] Calculating and filtering the target matrix and the preset reference signal to obtain a DC filtered signal related to the DC signal, and performing signal conversion processing on the DC filtered signal to obtain a target harmonic signal;
[0010] According to the characteristics of the target harmonic signal, a period-aligned partial least squares analysis model is constructed as a gas concentration prediction model. The target harmonic signal is input into the gas concentration prediction model, and the gas concentration information of the gas to be detected is output.
[0011] Another aspect of the present application provides a gas concentration detection device, comprising:
[0012] An acquisition module is used to acquire a spectral signal obtained by detecting the gas to be detected in the gas pool by a quantum cascade laser under preset sampling parameters;
[0013] The first processing module is configured to:
[0014] Calculating search direction information and search distance information based on the spectral signal and the initial matrix, wherein the initial matrix includes an initial search direction solution and an initial search distance solution, and the initial search direction solution and the initial search distance solution are constructed based on instrument parameters of the quantum cascade laser, gas parameters of the gas to be detected, and the spectral signal; calculating a transition matrix based on the spectral signal, the search direction information, and the search distance information; and determining the transition matrix corresponding to the change value as a target matrix when a change value between the transition matrix and the initial matrix meets a preset threshold, wherein the matrix dimension of the target matrix is determined based on preset sampling parameters;
[0015] The second processing module is used to calculate and filter the target matrix and the preset reference signal to obtain a DC filtered signal related to the DC signal, and perform signal conversion processing on the DC filtered signal to obtain a target harmonic signal;
[0016] The prediction module is used to construct a period-aligned partial least squares analysis model based on the characteristics of the target harmonic signal as a gas concentration prediction model. The target harmonic signal is input into the gas concentration prediction model to output the gas concentration information of the gas to be detected.
[0017] Another aspect of the present application provides an electronic device, comprising:
[0018] one or more processors;
[0019] a memory for storing one or more programs,
[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.
[0021] Another aspect of the present application provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method described above when executed.
[0022] Another aspect of the present application provides a computer program product, which includes computer-executable instructions. When the instructions are executed, the instructions are used to implement the method described above.
[0023] According to an embodiment of the present application, a spectral signal obtained by detecting a gas to be detected in a gas pool by a quantum cascade laser under preset sampling parameters is reconstructed based on an initial matrix to remove redundant information in the spectral signal and obtain a target matrix. The target matrix and a preset reference signal are calculated and filtered to obtain a DC filtered signal related to the DC signal. The DC filtered signal is subjected to signal conversion processing to obtain a target harmonic signal. The target harmonic signal is input into a gas concentration prediction model to output gas concentration information of the gas to be detected. The spectral signal is reconstructed based on the initial matrix to remove redundant information in the spectral signal and obtain a target matrix. The preset reference signal is used for processing. Since the initial search direction solution and the initial search distance solution constructed based on the instrument parameters of the quantum cascade laser, the gas parameters of the gas to be detected, and the spectral signal are used during the matrix conversion, the signal-to-noise ratio can be improved, thereby improving the detection accuracy and efficiency of the gas concentration. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and other objects, features and advantages of the present application will become more apparent through the following description of the embodiments of the present application with reference to the accompanying drawings, in which:
[0025] Figure 1 An exemplary system architecture to which a gas detection method according to an embodiment of the present application can be applied is shown;
[0026] Figure 2 A flow chart of a gas concentration detection method according to an embodiment of the present application is shown;
[0027] Figure 3A schematic diagram of a target harmonic signal according to an embodiment of the present application is shown;
[0028] Figure 4 A training flow chart of a gas concentration prediction model according to an embodiment of the present application is shown;
[0029] Figure 5 A block diagram showing a gas concentration detection device according to an embodiment of the present application; and
[0030] Figure 6 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0031] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present application. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present application. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present application.
[0032] The terms used herein are only for describing specific embodiments and are not intended to limit the present application. The terms "comprise," "include," etc. used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0033] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0034] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0035] Existing nitrous oxide detection technologies are still unable to meet the requirements in terms of detection efficiency and sensitivity. Taking the medical field as an example, the concentration of nitrous oxide in human exhaled breath is extremely low (usually less than 50 ppb), and the detection time of existing technologies is too long (usually more than 5 minutes), which cannot meet the needs of rapid screening. Especially in large-scale physical examinations or emergency scenarios, low detection efficiency may lead to delayed diagnosis. In the field of industrial safety, nitrous oxide leaks in chemical plants and laboratories may cause serious safety accidents. Existing detection technologies are limited by signal processing speed and cannot achieve a response in seconds, which increases safety risks. These diverse application scenarios pose multiple challenges to nitrous oxide detection technology, including high sensitivity, rapid response, and anti-interference capabilities, and also highlight the urgency of developing new detection technologies.
[0036] As a mid-infrared light source, quantum cascade laser (QCL) exhibits unique advantages in the field of gas detection. Its wavelength range covers the strong absorption peaks of a variety of gases, enabling high-sensitivity gas detection. However, QCL technology still faces many challenges in practical applications. First, the high-frequency noise in the laser modulation process (such as detector thermal noise and environmental vibration noise) overlaps with the target signal frequency band, making it difficult to effectively separate them using traditional filtering methods, resulting in insufficient signal stability during low-concentration detection. Second, existing signal analysis algorithms (such as wavelet transform and Kalman filtering) have high computational complexity when processing high-dimensional data, making it difficult to achieve real-time detection, limiting their application in rapid response scenarios. In addition, existing technologies often exhibit large fluctuations and poor repeatability in multiple detections of the same sample, and cannot meet the reliability requirements of quantitative analysis.
[0037] Although some researchers have attempted to improve the performance of QCL detection in recent years, there are still significant limitations. For example, multi-channel phase-locked amplification technology, although it has improved the signal extraction efficiency to a certain extent, has failed to solve the problem of noise frequency band overlap, and the low-concentration detection error is still higher than 10%. The use of deep learning denoising methods has improved the signal-to-noise ratio, but model training relies on a large amount of labeled data, and the real-time computing resource consumption is too large, making it difficult to promote and apply in actual scenarios. Therefore, the existing technology has not yet broken through the balance between high sensitivity, fast response and anti-interference ability. A new method that takes into account both signal reconstruction efficiency and noise suppression capabilities is urgently needed to meet the stringent requirements of trace nitrous oxide detection.
[0038] In view of this, an embodiment of the present application provides a gas concentration detection method, a gas concentration detection device and an electronic device, the method including obtaining a spectral signal obtained by a quantum cascade laser detecting a gas to be detected in a gas pool under preset sampling parameters; performing matrix reconstruction on the spectral signal and an initial matrix to remove redundant information in the spectral signal to obtain a target matrix, wherein the matrix dimension of the target matrix is determined according to the preset sampling parameters; calculating and filtering the target matrix and a preset reference signal to obtain a DC filtered signal related to the DC signal; performing signal conversion processing on the DC filtered signal to obtain a target harmonic signal; inputting the target harmonic signal into a gas concentration prediction model to output gas concentration information of the gas to be detected.
[0039] In the embodiments of this application, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of all data involved (including, but not limited to, user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and maintain the security of user personal information and network security.
[0040] Figure 1 FIG. 1 shows an exemplary system architecture 100 to which a gas detection method according to an embodiment of the present application can be applied. It should be noted that, Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present application can be applied, to help those skilled in the art understand the technical content of the present application, but does not mean that the embodiments of the present application cannot be used in other devices, systems, environments or scenarios.
[0041] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, a server 105, and a quantum cascade laser 106. The network 104 is used as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, the server 105, and the quantum cascade laser 106. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0042] A user may use a first terminal device 101, a second terminal device 102, or a third terminal device 103 to interact with a server 105 via a network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, or the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software (for example only).
[0043] The first terminal device 101 , the second terminal device 102 , and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0044] The server 105 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process received data such as user requests, and feed back processing results (e.g., web pages, information, or data obtained or generated based on user requests) to the terminal devices.
[0045] The quantum cascade laser (QCL) 106 is a laser based on a semiconductor quantum well structure. Its operating wavelength spans the mid-infrared to far-infrared range, perfectly matching the characteristic absorption lines of many gases. This characteristic gives the QCL high sensitivity and selectivity, enabling precise identification and concentration measurement of specific gases. Furthermore, the QCL offers the advantage of fast response, enabling real-time monitoring of gas concentrations within milliseconds, meeting the needs of online testing. Furthermore, the QCL's compact size and low power consumption make it easy to integrate into portable detection equipment, making it suitable for scenarios such as on-site testing and mobile monitoring. The quantum cascade laser 106 can detect mixed gases in a gas pool to obtain spectral signals.
[0046] It should be noted that the gas concentration detection method provided in the embodiment of the present application can generally be executed by the server 105. Accordingly, the gas concentration detection device provided in the embodiment of the present application can generally be set in the server 105. The gas concentration detection method provided in the embodiment of the present application can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the gas concentration detection device provided in the embodiment of the present application can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Alternatively, the gas concentration detection method provided in the embodiment of the present application can also be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103, or can also be executed by other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103. Correspondingly, the gas concentration detection device provided in the embodiment of the present application can also be set in the first terminal device 101, the second terminal device 102 or the third terminal device 103, or in other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103.
[0047] It should be understood that Figure 1 The number of terminal devices, networks, servers, and quantum cascade lasers in the embodiment is merely illustrative. Any number of terminal devices, networks, servers, and quantum cascade lasers may be provided as required.
[0048] Figure 2 A flow chart of a gas concentration detection method according to an embodiment of the present application is shown.
[0049] like Figure 2 As shown, the gas concentration detection method includes operations S201 to S205.
[0050] In operation S201, a spectral signal is obtained by detecting a gas to be detected in a gas cell using a quantum cascade laser under preset sampling parameters.
[0051] In operation S202, search direction information and search distance information are calculated based on the spectral signal and the initial matrix, wherein the initial matrix includes an initial search direction solution and an initial search distance solution, and the initial search direction solution and the initial search distance solution are constructed based on instrument parameters of the quantum cascade laser, gas parameters of the gas to be detected, and the spectral signal;
[0052] In operation S203, a transition matrix is calculated according to the spectral signal, the search direction information, and the search distance information;
[0053] In operation S204, when a change value between the transition matrix and the initial matrix satisfies a preset threshold, the transition matrix corresponding to the change value is determined as a target matrix, wherein a matrix dimension of the target matrix is determined according to a preset sampling parameter;
[0054] In operation S205, the target matrix and the preset reference signal are calculated and filtered to obtain a DC filtered signal related to the DC signal, and the DC filtered signal is converted to obtain a target harmonic signal.
[0055] In operation S206 , a period-aligned partial least squares analysis model is constructed based on the characteristics of the target harmonic signal as a gas concentration prediction model. The target harmonic signal is input into the gas concentration prediction model to output gas concentration information of the gas to be detected.
[0056] According to an embodiment of the present application, the gas to be detected may be nitrous oxide ( ), methane, carbon monoxide, etc. The initial matrix can be a matrix with elements of 0 or other values.
[0057] According to the embodiment of the present application, the preset threshold can be set according to actual needs, for example, it can be 10 −6 .
[0058] In a specific embodiment, using nitrous oxide as an example, a mass flow controller is first used to mix high-purity nitrogen with a known concentration of nitrous oxide standard gas in a preset ratio (for testing purposes only; the concentration of nitrous oxide is unknown in actual use). This mixture is configured to produce standard gas samples with concentration gradients of 100 ppb, 300 ppb, 500 ppb, 700 ppb, 900 ppb, 1100 ppb, 1300 ppb, and 1500 ppb. Each gas sample concentration is then sequentially charged into a long-path gas cell with an optical path of 14.5 meters. A multiple-reflection design is employed to enhance the interaction path between the laser and gas molecules, thereby improving detection sensitivity. The interior of the gas cell is polished to reduce light scattering losses and ensure efficient transmission of the laser beam within the cell. Precision valves are installed at the inlet and outlet of the gas cell to control the gas flow rate and pressure, ensuring consistent gas conditions for each experiment. During the inflation process, the system monitors the pressure and temperature in the gas pool in real time to ensure the stability of the experimental environment and avoid the impact of fluctuations in external conditions on the test results.
[0059] According to an embodiment of the present application, the signal generator module generates a low-frequency triangular wave signal with a frequency of 10 Hz, which is used to drive the quantum cascade laser for wavelength scanning. The rising and falling edges of the triangular wave signal correspond to the forward and reverse sweeps of the laser wavelength, respectively, ensuring that the output wavelength covers the strong absorption peak of N2O in the mid-infrared band (4.53 μm). The output signal of the signal generator module is transmitted to the laser driver module via a digital-to-analog converter (DAC), ensuring a stable and distortion-free signal waveform. The signal generator module also generates a high-frequency sinusoidal wave signal with a frequency of 5 kHz, which is used to modulate the output wavelength and intensity of the QCL. Superimposing the high-frequency modulated signal on the low-frequency triangular wave enables rapid fine-tuning of the laser wavelength, thereby enhancing the extraction efficiency of the absorption signal of the gas to be detected. The output signal of the signal generator module is also transmitted to the laser driver module via a high-precision DAC and synchronously superimposed with the low-frequency triangular wave signal to ensure consistency in modulation depth and phase. Through high-frequency modulation, the system can effectively suppress interference from low-frequency noise (such as ambient vibration and detector thermal noise), significantly improving the signal-to-noise ratio of the detection signal. In addition, the frequency and amplitude of the high-frequency modulation signal can be flexibly adjusted according to experimental requirements to adapt to gas detection in different concentration ranges.
[0060] According to the embodiments of this application, the laser driver module precisely superimposes the low-frequency triangular wave signal and the high-frequency sine wave signal generated by the signal generator module. This superimposed composite signal is converted into a current signal by a high-precision current amplifier and input into a quantum cascade laser (QCL). The output range of the current amplifier is calibrated to ensure that the current injected into the QCL is linearly proportional to the laser wavelength, thus preventing nonlinear distortion from affecting the detection results.
[0061] According to an embodiment of the present application, the laser driving module connected to the quantum cascade laser is also equipped with a temperature control module, which can implement overcurrent protection and temperature compensation functions to ensure stable current output during long-term operation.
[0062] According to an embodiment of the present application, the temperature control module utilizes a thermoelectric cooler (TEC) and a precision temperature sensor to monitor and adjust the QCL's operating temperature in real time, stabilizing it at a set value (typically 20°C). Temperature control accuracy reaches ±0.01°C, ensuring that the laser's output wavelength varies linearly with the injected current, preventing wavelength drift caused by temperature fluctuations. The temperature control module is also equipped with a PID (proportional-integral-derivative) control algorithm, enabling rapid response to temperature changes and ensuring the QCL's wavelength stability during long-term operation. Based on the current signal injected by the laser driver module, the quantum cascade laser (QCL) outputs a wavelength-tunable mid-infrared laser with a central wavelength of 4.53 μm, covering the strong absorption peak of N2O. The laser beam enters the gas cell through high-reflectivity mirrors M1 and M2 (reflectivity >99.9%). The mirrors are precisely calibrated to ensure perpendicular incidence and minimize optical path losses. After the laser beam passes through the gas cell, a detector (a photoelectric sensor made of mercury cadmium telluride) collects the absorbed spectral signal. The detector's response time is less than 1 μs, enabling accurate capture of high-speed modulated signals. The collected spectral signals are transmitted to the signal processing module in real time through a high-speed data acquisition card (sampling frequency 1 MHz, resolution 16 bits) to ensure high fidelity and integrity of the signals.
[0063] According to an embodiment of the present application, the quantum cascade laser outputs a laser of a corresponding wavelength to the mixed gas in the gas pool under the action of the above-mentioned composite signal, so that the quantum cascade laser can obtain a spectral signal corresponding to the gas pool. The spectral signal is reconstructed based on the initial matrix to remove redundant information in the spectral signal, thereby obtaining a target matrix. At this time, the matrix dimension of the target matrix is determined according to the preset sampling parameters. The preset sampling parameters can refer to the total number of sampling points of the quantum cascade laser as T and the sampling frequency as f. s (1 MHz), the scanning frequency of the triangle wave signal is (i.e. 10 Hz as shown above), with Reconstruct the spectral signal for the period to obtain the matrix M. The dimension m of the matrix M is shown in formula (1):
[0064] (1)
[0065] The number of rows in the matrix M corresponds to the number of sampling points of each triangle wave signal within a period, and the number of columns corresponds to the total number of periods. In order to optimize the low-rank feature extraction, the matrix M is dislocated by the decomposition factor n. The calculation of the decomposition factor n is shown in formula (2):
[0066] (2)
[0067] When n is less than 1, it takes the value of 1. The matrix dimension A of the target matrix obtained after decomposition is shown in formula (3):
[0068] (3)
[0069] Decomposition by factoring n can ensure that the number of rows and columns of the matrix is close, thereby retaining more effective information in the low-rank decomposition.
[0070] According to an embodiment of the present application, the optimal low-rank solution (i.e., the optimal matrix solution) is gradually approached by calculating the maximum singular value of the matrix. Therefore, after obtaining the spectral signal, the search direction information and the search distance information are first calculated based on the initial matrix and the spectral signal, and then the transition matrix is calculated based on the spectral signal, the search direction information, and the search distance information. If the change value between the transition matrix generated in each iteration and the corresponding initial matrix is less than a preset threshold, the transition matrix can be determined as the target matrix.
[0071] According to an embodiment of the present application, the reconstructed target matrix and a preset reference signal are calculated and filtered to filter out high-frequency components and noise, retaining the DC component and generating a DC filtered signal. This DC filtered signal is then converted to generate a target harmonic signal, which is then input into a trained gas concentration prediction model to obtain gas concentration information for the gas to be detected.
[0072] According to an embodiment of the present application, a spectral signal obtained by detecting a gas to be detected in a gas pool by a quantum cascade laser under preset sampling parameters is reconstructed based on an initial matrix to remove redundant information in the spectral signal and obtain a target matrix. The target matrix and a preset reference signal are calculated and filtered to obtain a DC filtered signal related to the DC signal. The DC filtered signal is subjected to signal conversion processing to obtain a target harmonic signal. The target harmonic signal is input into a gas concentration prediction model to output gas concentration information of the gas to be detected. The spectral signal is reconstructed based on the initial matrix to remove redundant information in the spectral signal and obtain a target matrix. The preset reference signal is used for processing. Since the initial search direction solution and the initial search distance solution constructed based on the instrument parameters of the quantum cascade laser, the gas parameters of the gas to be detected, and the spectral signal are used during the matrix conversion, the signal-to-noise ratio can be improved, thereby improving the detection accuracy and efficiency of the gas concentration.
[0073] According to an embodiment of the present application, the gas concentration detection method further includes: when the change value between the transition matrix and the initial matrix does not meet a preset threshold, determining the transition matrix as a new initial matrix to iteratively calculate a new transition matrix.
[0074] According to an embodiment of the present application, during the iterative process, if the change value between the transition matrix generated in each iteration and the corresponding initial matrix is not less than a preset threshold, the transition matrix is used as the initial matrix to iteratively calculate a new transition matrix until the target matrix is determined.
[0075] According to embodiments of the present application, during the above iterations, a low-rank constraint factor e (ranging from 0.01 to 0.001) can be set to control the degree of redundant information removal. A smaller value of e results in a more pronounced denoising effect, but this may weaken the true trend of gas concentration changes. Therefore, the choice of e requires a balance between denoising performance and real-time performance.
[0076] According to an embodiment of the present application, the search direction information and the search distance information are calculated based on the spectral signal and the initial matrix, including: generating the search direction information based on the spectral signal and the initial matrix; generating the search distance information based on the spectral signal, the initial matrix and the search direction information.
[0077] According to an embodiment of the present application, the instrument parameters include the modulation frequency, sampling frequency and laser intensity of the quantum cascade laser laser signal, and the gas parameters include the absorption spectrum of the gas to be detected.
[0078] According to an embodiment of the present application, search direction information is generated based on the spectral signal and the initial matrix, as shown in formula (4):
[0079] (4)
[0080] Among them, the initial solution s of the search direction is obtained by the formula Calculate, where is the baseline intensity, is the laser intensity of the laser signal emitted by the quantum cascade laser for detection, is the absorption spectrum of the gas to be detected for the signal of wavelength j, is the weight coefficient, which can be 0.4, for example.
[0081] According to an embodiment of the present application, search distance information is generated based on the spectral signal, the initial matrix and the search direction information, as shown in formula (5):
[0082] (5)
[0083] Where i+1 represents the i+1th iteration, ALS represents the alternating least squares method, is the search direction information at the i+1th iteration, is the search distance information at the i+1th iteration, is the initial matrix at the i+1th iteration. The search distance initial solution r is obtained by the formula Calculate, where i is the sampling point, is the modulation frequency of the laser signal. is the sampling frequency of the quantum cascade laser.
[0084] According to an embodiment of the present application, the cold start scheme of the least squares method in the related art uses an initial matrix (the initial solution of the search distance and the initial solution of the search direction) that is calculated by setting random initial values. The instrument parameters used in the embodiment of the present application include the modulation frequency, sampling frequency and laser intensity of the quantum cascade laser signal, and the gas parameters include the absorption spectrum of the gas to be detected, thereby obtaining the initial solution of the search distance and the initial solution of the search direction, which can ensure the calculation speed in the subsequent matrix reconstruction while avoiding interference from local optimal solutions as much as possible.
[0085] In addition, in the process of matrix reconstruction, the embodiment of the present application is different from the related art. The dimension m of the matrix M obtained by reconstructing the spectral signal is combined with the matrix dimension A of the target matrix obtained by the decomposition factor n to iteratively calculate the search direction information and search distance information, thereby improving the calculation speed and avoiding falling into the local optimal solution.
[0086] According to an embodiment of the present application, the transition matrix is calculated based on the spectral signal, the search direction information and the search distance information. Specifically, in each iteration, a set of parameters is fixed and the least squares problem of another set of parameters is solved, so that the transition matrix is obtained as shown in formula (6) :
[0087] (6)
[0088] According to an embodiment of the present application, a target matrix and a preset reference signal are calculated and filtered to obtain a DC filtered signal related to the DC signal, including: generating a target voltage signal based on the target matrix and a preset reference signal of a preset frequency; and filtering the target voltage signal using a low-pass filter to obtain a DC filtered signal.
[0089] According to the embodiment of the present application, the preset frequency can be set according to actual needs, for example, it can be twice the scanning frequency f t .
[0090] According to an embodiment of the present application, a target voltage signal is generated according to a target matrix and a preset reference signal of a preset frequency. and , where j represents the periodic sequence and k represents the time series, the low-pass filter will and The high frequency components and noise in the filter are filtered, and the DC components are retained to obtain the filtered signal. and .
[0091] According to an embodiment of the present application, the filtering signal and After the square sum and square root operation, the DC filtered signal is obtained , as shown in formula (7):
[0092] (7)
[0093] Among them, Q1 and Q2 are and .
[0094] According to an embodiment of the present application, the preset reference signal includes a sine reference signal and a cosine reference signal.
[0095] In which, a target voltage signal is generated according to a target matrix and a preset reference signal of a preset frequency, including: generating a first voltage signal according to a target matrix and a sine reference signal; generating a second voltage signal according to a target matrix and a cosine reference signal, wherein the target voltage signal includes the first voltage signal and the second voltage signal.
[0096] According to an embodiment of the present application, the preset frequencies of the sine reference signal and the cosine reference signal can be twice the scanning frequency f t .
[0097] According to an embodiment of the present application, according to the target matrix and a sinusoidal reference signal to generate a first voltage signal , according to the target matrix and cosine reference signal to generate a second voltage signal .
[0098] Figure 3 A schematic diagram of a target harmonic signal according to an embodiment of the present application is shown.
[0099] According to an embodiment of the present application, a signal conversion process is performed on a DC filter signal to obtain a target harmonic signal, including: mapping the DC filter signal to a preset coordinate system based on a sampling time to obtain the target harmonic signal.
[0100] According to the embodiment of the present application, since the laser output by the quantum cascade laser is related to time during the detection process, the DC filter signal can be mapped to a preset coordinate system based on the sampling time to obtain the target harmonic signal. The target harmonic signal is as follows: Figure 3 As shown, Figure 3 The horizontal axis is the sampling time, and the vertical axis is the absorption intensity.
[0101] According to an embodiment of the present application, due to the peak intensity of the target harmonic signal (see Figure 3 The red dots in the figure are linearly positively correlated with the gas concentration. Therefore, the target harmonic signal can be input into the trained gas concentration prediction model to obtain the gas concentration information of the gas to be detected.
[0102] According to an embodiment of the present application, a period-aligned partial least squares analysis model is constructed as a gas concentration prediction model, including:
[0103] Perform periodic structure identification on the target harmonic signal, extract the main period length through autocorrelation analysis, and divide the target harmonic signal into several complete period samples based on the period boundaries;
[0104] Perform normalization on each periodic sample to align samples of different periods to eliminate intensity differences, and then combine all aligned periodic samples into a period-level feature matrix;
[0105] A periodic structure constraint is introduced in the modeling process of the cycle-aligned partial least squares analysis model, allowing only the principal component projection direction to change smoothly within the cycle. At the same time, a periodic phase perception mechanism is introduced, assigning different modeling weights to the initial, middle, and final segments of the cycle sample, to enhance the sensitivity of the cycle-aligned partial least squares analysis model to local changes within the cycle.
[0106] Based on the period-aligned partial least squares analysis model, the period-level characteristic matrix is analyzed and an initial prediction model for predicting the concentration of the gas to be detected is established.
[0107] According to an embodiment of the present application, the target harmonic signal is divided into several complete cycle samples based on the cycle boundary, including:
[0108] Calculating the autocorrelation function of the input multi-periodic target harmonic signal to reveal the potential periodicity in the target harmonic signal;
[0109] The autocorrelation functions of multiple periods are averaged to obtain a global autocorrelation function;
[0110] performing a difference operation on the global autocorrelation function and identifying the position of the main period by peak search, so as to calculate the main period length according to the position of the main period;
[0111] According to the identified main cycle length, the target harmonic signal is divided into cycle boundaries to achieve standard cycle segmentation and obtain multiple complete cycle samples.
[0112] Figure 4 A training flow chart of a gas concentration prediction model according to an embodiment of the present application is shown.
[0113] According to the embodiments of the present application, Figure 4 As shown, the training method of the gas concentration prediction model includes operations S401 to S403.
[0114] In operation S401 , a training sample set is acquired, where the training sample set includes a plurality of training harmonic signals and a concentration label corresponding to each training harmonic signal.
[0115] In operation S402 , each training harmonic signal is input into an initial prediction model to output predicted concentration information, wherein the initial prediction model is constructed based on a partial least squares method.
[0116] In operation S403 , model parameters of the initial prediction model are iteratively adjusted according to the predicted concentration information and the concentration label to obtain a trained gas concentration prediction model.
[0117] According to an embodiment of the present application, the initial prediction model is constructed based on the partial least squares method (PLS), and the initial prediction model is used to associate the optimized second harmonic signal (i.e., the training harmonic signal) with the nitrous oxide concentration. The initial prediction model maximizes the correlation between the signal and the concentration by extracting the principal components in the signal, thereby effectively reducing the impact of noise on the prediction results. During the model building process, the experimental data is first divided into a training sample set and a test set. The training sample set is used to build the model, and the test set is used to verify the generalization ability of the model. The training sample set can contain 100 sets of second harmonic signals at different concentrations, and the test set contains 50 sets of data. The number of principal components of the initial prediction model is set to 10 to ensure that the model strikes a balance between fitting accuracy and computational efficiency.
[0118] According to the embodiments of the present application, after preliminary processing, the optimized second harmonic signal (i.e., the training harmonic signal) has low redundancy, which is not conducive to the extraction of latent variables by traditional PLS models. Therefore, the correlation problem between the second harmonic signal (i.e., the training harmonic signal) and nitrous oxide concentration can be transformed into a generalized eigenvalue problem. Furthermore, due to the periodic modulation characteristics of QCL gas detection signals, the embodiments of the present application propose a period-aligned partial least squares PLS model (i.e., the initial prediction model). This divides the signal into several complete periods and aligns them to form a unified model. This aims to improve the stability of latent variable direction extraction and model prediction accuracy in periodic signal modeling. The specific implementation is as follows:
[0119] The original signal is segmented into periods, which can explicitly align periodic information and enhance the PLS's ability to capture structural regularities. In this step, the autocorrelation function analysis method is used to identify the potential periodic structure of the input second harmonic signal (i.e., the original signal), and the starting position set of the period is determined based on this, which is used for the segmentation and alignment of subsequent periodic samples. Assume that the input is a signal matrix X(n, p), where n is the number of points and p is the number of periods. Each periodic signal is , j is the number of points in a period. First, calculate the autocorrelation function of each periodic signal separately , defined as follows: , where τ is the delay, and its value range is τ∈[1,τ max ], τ max is the maximum delay, which is usually set between 1 / 3 and 1 / 2 of the length of p; to integrate multi-channel information, the autocorrelation functions of all cycles can be averaged to obtain the global autocorrelation function : , and obtain the autocorrelation function Then, perform the main cycle peak search. Perform first-order difference calculation to detect the peak position; set the threshold θ and select the lag position where the autocorrelation function is higher than θ. As the main period length 𝑃, after obtaining the period length P, the period boundary point set is generated according to the initial sampling point sequence: , where N is the total number of points, [N / P] represents the number of complete periods that can be divided; the distance between boundary points is a fixed value P (i.e., the period length P), forming a standard period segmentation. If there are incomplete periods at the beginning and end, you can choose to truncate or complete them.
[0120] In the process of period division or segmentation of the target harmonic signal, incomplete period samples at the beginning and end are processed by truncation or interpolation to ensure the integrity of the period samples.
[0121] After completing the period segmentation, to improve the consistency of the period samples and the stability of the model's principal component directions, we perform alignment and normalization on each period sample. This step involves normalizing the Z-score of each period sample to eliminate the influence of intensity variations between periods and enhance the consistency of principal component feature extraction.
[0122] After completing the period normalization and alignment, a unified input feature matrix is constructed for each period sample for subsequent model analysis. All period sample vectors are combined to obtain the period-level feature matrix Z.
[0123]
[0124] where z(i) The expanded feature vector of the periodic sample representing a complete aligned period is used as the input feature matrix for establishing the initial prediction model.
[0125] In order to adapt to the particularity of the periodic structure, the following optimization strategy is proposed to be embedded in the standard PLS process. When constructing the score matrix, the projection vector of each dimension is restricted to Corresponding to the original periodic structure, specifically, a projection vector is constructed based on the periodic characteristic matrix and the concentration information of the gas to be detected to generate a projection vector, wherein the projection vector The calculation formula is:
[0126]
[0127] Among them S cycle It represents a periodic structure preserving subspace, i.e. a linear subspace, the purpose of which is to preserve the periodic structural characteristics of the data during projection or dimensionality reduction. is the projection vector ω of the i-th row, where only the projection directions of adjacent time points in ω are allowed to change smoothly; y is the known concentration information of other gases; and Z is the periodic characteristic matrix. Other gases can be gases with known concentrations, such as nitrogen.
[0128] In the establishment of the initial prediction model, a periodic phase-aware projection structure is introduced, that is, different learning weights are applied to each phase point (such as the start, center, and end) in the periodic sample. The following form of segmented principal component load a can be used:
[0129]
[0130] in: represents the inner product, l1, l2, l3 represent the starting, center, and end segments respectively, and a1, a2, a3 represent the corresponding weights.
[0131] According to the period-level feature matrix and the projection vector, an initial prediction model is constructed, where the initial prediction model is as follows:
[0132]
[0133] in, is the predicted concentration, Z is the period-level characteristic matrix, is the i-th row in the projection vector ω.
[0134] According to an embodiment of the present application, for each training harmonic signal in the training sample set, it is input into the initial prediction model constructed based on the partial least squares method to obtain the predicted concentration information. Based on the predicted concentration information and the concentration label, the model parameters of the initial prediction model are iteratively adjusted to obtain a trained gas concentration prediction model.
[0135] According to an embodiment of the present application, the model parameters of the initial prediction model are iteratively adjusted according to the predicted concentration information and the concentration label to obtain a trained gas concentration prediction model, including: calculating the target loss result according to the predicted concentration information and the concentration label; iteratively adjusting the model parameters according to the target loss result to obtain the gas concentration prediction model.
[0136] According to an embodiment of the present application, the predicted concentration information and the concentration label are input into the loss function to obtain the corresponding target loss result, wherein the loss function can be Mean Squared Error (MSE), Mean Absolute Error (MAE), Cross-Entropy Loss, etc.
[0137] According to an embodiment of the present application, model parameters are iteratively adjusted based on the calculated target loss result to obtain a gas concentration prediction model.
[0138] According to the embodiments of the present application, in order to verify the processing effect of the spectral signal, after obtaining the target matrix, a rank comparison analysis can be performed on the two matrices before and after matrix reconstruction. The rank of the matrix before optimization is higher, indicating the presence of a large amount of redundant noise; the rank of the matrix after optimization is significantly reduced, indicating that the noise has been effectively filtered out while retaining the main components related to the nitrous oxide concentration. By comparing and analyzing the gas concentration information, the signal-to-noise ratio of the optimized signal is increased to 7.5 times that of the related technology, significantly improving the accuracy and stability of the gas detection.
[0139] In a specific embodiment, by processing the spectral signal within a sampling time of 10 seconds, the gas concentration detection method of this embodiment has a detection standard deviation of 2.82, which is far superior to the 21.13 of the traditional orthogonal phase-locked amplification method. The coefficient of determination R² reaches 0.931, indicating that the gas concentration prediction model can well explain the variation in the data and the prediction effect is significantly better than the traditional method (R²=0.870). The root mean square error (RMSE) is as low as 0.024, which is 74% lower than the 0.093 of the traditional method, indicating that the gas concentration detection method of this embodiment has high accuracy and stability in low-concentration nitrous oxide detection. In addition, the calculation time is only 1.42 seconds, which significantly shortens the detection time and meets the needs of real-time monitoring.
[0140] According to the embodiments of the present application, in order to further verify the applicability of the gas concentration detection method of this embodiment, this embodiment also tests the detection performance under different sampling times. The results show that even within a sampling time of 1 second, the R² of the gas concentration detection method of this embodiment can still reach 0.903 and the RMSE is 0.091, which is significantly better than the traditional method (R²=0.858, RMSE=0.203). As the sampling time increases, the detection accuracy is further improved. When the sampling time reaches 60 seconds, the R² increases to 0.985 and the RMSE decreases to 0.019, indicating that the gas concentration detection method of this embodiment has excellent performance in different application scenarios.
[0141] Figure 5 A block diagram of a gas concentration detection device according to an embodiment of the present application is shown.
[0142] like Figure 5 As shown, the gas concentration detection device 500 includes an acquisition module 510 , a first processing module 520 , a second processing module 530 , and a prediction module 540 .
[0143] An acquisition module 510 is configured to acquire a spectral signal obtained by detecting the gas to be detected in the gas cell using a quantum cascade laser under preset sampling parameters;
[0144] The first processing module 520 is configured to:
[0145] Calculating search direction information and search distance information based on the spectral signal and the initial matrix, wherein the initial matrix includes an initial search direction solution and an initial search distance solution, and the initial search direction solution and the initial search distance solution are constructed based on instrument parameters of the quantum cascade laser, gas parameters of the gas to be detected, and the spectral signal; calculating a transition matrix based on the spectral signal, the search direction information, and the search distance information; and determining the transition matrix corresponding to the change value as a target matrix when a change value between the transition matrix and the initial matrix meets a preset threshold, wherein the matrix dimension of the target matrix is determined based on preset sampling parameters;
[0146] The second processing module 530 is configured to calculate and filter the target matrix and the preset reference signal to obtain a DC filtered signal related to the DC signal, and perform signal conversion processing on the DC filtered signal to obtain a target harmonic signal;
[0147] The prediction module 540 is used to construct a period-aligned partial least squares analysis model based on the characteristics of the target harmonic signal as a gas concentration prediction model, input the target harmonic signal into the gas concentration prediction model, and output the gas concentration information of the gas to be detected.
[0148] According to an embodiment of the present application, a spectral signal obtained by detecting a gas to be detected in a gas pool by a quantum cascade laser under preset sampling parameters is reconstructed based on an initial matrix to remove redundant information in the spectral signal and obtain a target matrix. The target matrix and a preset reference signal are calculated and filtered to obtain a DC filtered signal related to the DC signal. The DC filtered signal is subjected to signal conversion processing to obtain a target harmonic signal. The target harmonic signal is input into a gas concentration prediction model to output gas concentration information of the gas to be detected. The spectral signal is reconstructed based on the initial matrix to remove redundant information in the spectral signal and obtain a target matrix. The preset reference signal is used for processing. Since the initial search direction solution and the initial search distance solution constructed based on the instrument parameters of the quantum cascade laser, the gas parameters of the gas to be detected, and the spectral signal are used during the matrix conversion, the signal-to-noise ratio can be improved, thereby improving the detection accuracy and efficiency of the gas concentration.
[0149] According to the embodiments of the present application, any number of modules, submodules, units, and subunits, or at least part of the functions of any number of them, can be implemented in one module. According to the embodiments of the present application, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present application, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present application, one or more of the modules, submodules, units, and subunits can be at least partially implemented as a computer program module, which can perform the corresponding functions when the computer program module is executed.
[0150] For example, any multiple of the acquisition module 510, the first processing module 520, the second processing module 530, and the prediction module 540 can be combined into a single module / unit / sub-unit, or any one of these modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functionality of one or more of these modules / units / sub-units can be combined with at least part of the functionality of other modules / units / sub-units and implemented in a single module / unit / sub-unit. According to an embodiment of the present application, at least one of the acquisition module 510, the first processing module 520, the second processing module 530, and the prediction module 540 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented in hardware or firmware through any other reasonable means of circuit integration or packaging, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or any appropriate combination of any of these. Alternatively, at least one of the acquisition module 510 , the first processing module 520 , the second processing module 530 , and the prediction module 540 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
[0151] It should be noted that the gas concentration detection device part in the embodiment of the present application corresponds to the gas concentration detection method part in the embodiment of the present application. The description of the gas concentration detection device part specifically refers to the gas concentration detection method part and will not be repeated here.
[0152] Figure 6 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present application is shown. Figure 6 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0153] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present application includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory 602 or a program loaded from a storage portion 608 into a random access memory 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present application.
[0154] The random access memory (RAM) 603 stores various programs and data required for the operation of the electronic device 600. The processor 601, the read-only memory (ROM) 602, and the random access memory (RAM) 603 are connected to each other via a bus 604. The processor 601 executes the various operations of the method flow according to the embodiment of the present application by executing the programs in the read-only memory (ROM) 602 and / or the random access memory (RAM) 603. It should be noted that the programs may also be stored in one or more memories other than the read-only memory (ROM) 602 and the random access memory (RAM) 603. The processor 601 may also execute the various operations of the method flow according to the embodiment of the present application by executing the programs stored in the one or more memories.
[0155] According to an embodiment of the present application, electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to bus 604. Electronic device 600 may also include one or more of the following components connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section 608 including a hard disk; and a communication section 609 including a network interface card such as a LAN card or modem. Communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. Removable media 611, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in drive 610 as needed, so that computer programs read from the removable media can be installed into storage section 608 as needed.
[0156] According to an embodiment of the present application, the method flow according to the embodiment of the present application can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the system of the embodiment of the present application are executed. According to an embodiment of the present application, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0157] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments of this application is implemented.
[0158] According to embodiments of the present application, a computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples include, but are not limited to, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0159] For example, according to an embodiment of the present application, the computer-readable storage medium may include the read-only memory (ROM) 602 and / or the random access memory (RAM) 603 described above and / or one or more memories other than the read-only memory (ROM) 602 and the random access memory (RAM) 603.
[0160] An embodiment of the present application also includes a computer program product, which includes a computer program, which contains program code for executing the method provided by the embodiment of the present application. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the method provided by the embodiment of the present application.
[0161] When the computer program is executed by the processor 601, the above functions defined in the system / device of the embodiment of the present application are performed. According to the embodiment of the present application, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0162] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0163] According to an embodiment of the present application, the program code for executing the computer program provided by the embodiment of the present application can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).
[0164] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It will be understood by those skilled in the art that the features described in the various embodiments of the present application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments of the present application may be combined and / or coupled in various ways, and all of these combinations and / or couplings fall within the scope of the present application.
[0165] The embodiments of the present application have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present application. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. The present application does not depart from the scope of the present application, and those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present application.
Claims
1. A gas concentration detection method, characterized in that: include: Acquiring a spectral signal obtained by detecting the gas to be detected in the gas cell using a quantum cascade laser under preset sampling parameters; Calculating search direction information and search distance information based on the spectral signal and the initial matrix, wherein the initial matrix includes an initial search direction solution and an initial search distance solution, and the initial search direction solution and the initial search distance solution are constructed based on instrument parameters of the quantum cascade laser, gas parameters of the gas to be detected, and the spectral signal; calculating a transition matrix based on the spectral signal, the search direction information, and the search distance information; and determining the transition matrix corresponding to the change value as a target matrix when a change value between the transition matrix and the initial matrix satisfies a preset threshold, wherein the matrix dimension of the target matrix is determined based on the preset sampling parameters; Calculating and filtering the target matrix and a preset reference signal to obtain a DC filtered signal related to the DC signal, and performing signal conversion processing on the DC filtered signal to obtain a target harmonic signal; According to the characteristics of the target harmonic signal, a period-aligned partial least squares analysis model is constructed as a gas concentration prediction model. The target harmonic signal is input into the gas concentration prediction model to output the gas concentration information of the gas to be detected.
2. The method according to claim 1, characterized in that The instrument parameters include the modulation frequency, sampling frequency and laser intensity of the quantum cascade laser signal, and the gas parameters include the absorption spectrum of the gas to be detected; The calculation method of the initial solution of the search direction and the initial solution of the search distance is: (1) (2) Where s is the initial solution for the search direction, r is the initial solution for the search distance, and f t is the modulation frequency, f v is the sampling frequency, u is the absorption spectrum of the gas to be detected, I e is the baseline intensity of the spectral signal, I z is the laser intensity of the quantum cascade laser, and i is the sampling point.
3. The method according to claim 1, characterized in that A period-aligned partial least squares analysis model is constructed as a gas concentration prediction model, including: Performing periodic structure identification on the target harmonic signal, extracting the main period length through autocorrelation analysis, and dividing the target harmonic signal into a number of complete period samples based on period boundaries; Perform normalization on each periodic sample to align samples of different periods to eliminate intensity differences, and then combine all aligned periodic samples into a period-level feature matrix; A periodic structure constraint is introduced in the modeling process of the cycle-aligned partial least squares analysis model, allowing only the principal component projection direction to change smoothly within the cycle. At the same time, a periodic phase perception mechanism is introduced, assigning different modeling weights to the initial, middle, and final segments of the cycle sample, to enhance the sensitivity of the cycle-aligned partial least squares analysis model to local changes within the cycle. Based on the period-aligned partial least squares analysis model, the period-level characteristic matrix is analyzed to establish an initial prediction model for predicting the concentration of the gas to be detected.
4. The method according to claim 3, characterized in that Divide the target harmonic signal into several complete cycle samples based on the cycle boundary, including: Calculating the autocorrelation function of the input multi-periodic target harmonic signal to reveal the potential periodicity in the target harmonic signal; The autocorrelation functions of multiple periods are averaged to obtain a global autocorrelation function; performing a difference operation on the global autocorrelation function and identifying the position of the main period by peak search, so as to calculate the main period length according to the position of the main period; According to the identified main cycle length, the target harmonic signal is divided into cycle boundaries to achieve standard cycle segmentation and obtain multiple complete cycle samples.
5. The method according to claim 4, characterized in that The calculation method of the autocorrelation function and the global autocorrelation function of the multi-period target harmonic signal is as follows: (3) (4) in, is the autocorrelation function, is the global autocorrelation function, n is the total number of points of the spectral signal, p is the number of cycles of multiple cycles, For each periodic signal, j is the number of sample points in one period, and τ is the delay amount.
6. The method according to claim 5, characterized in that The delay value τ ranges from τ∈[1,τ max ], τ max For the maximum delay, set it between 1 / 3 and 1 / 2 of the cycle length of one cycle sample.
7. The method according to claim 4, characterized in that In the process of period division of the target harmonic signal, the incomplete period samples at the beginning and end are processed by truncation or interpolation to ensure the integrity of the period samples.
8. The method according to claim 3, characterized in that After completing the period division, each period sample is standardized separately. Specifically, each period sample is normalized by the Z-score method to eliminate the intensity differences between samples of different periods and enhance the consistency of features.
9. The method according to claim 3, characterized in that The periodic characteristic matrix Z is as follows: (5) where z (i) To represent the expanded feature vector of the period sample of a complete alignment period, Z is used as the input feature matrix to establish the initial prediction model; The period-level characteristic matrix is analyzed to establish an initial prediction model for predicting the concentration of the gas to be detected, including: In order to adapt to the particularity of the periodic structure, a projection vector is constructed based on the periodic characteristic matrix and the concentration information of the gas to be detected to generate a projection vector, where the projection vector The calculation formula is: (6) Among them S cycle It represents a periodic structure preserving subspace, i.e. a linear subspace, the purpose of which is to preserve the periodic structural characteristics of the data during projection or dimensionality reduction. is the projection vector ω of the i-th row, where only the projection directions of adjacent time points in ω are allowed to change smoothly; y is the known concentration information of other gases; Z is the periodic characteristic matrix; In the establishment of the initial prediction model, a periodic phase-aware projection structure is introduced, that is, different learning weights are applied to each phase point in the periodic sample, and the following form of segmented principal component load a is adopted: (7) in: represents the inner product, l1, l2, l3 represent the start, center, and end signals of the periodic sample respectively, and a1, a2, a3 represent the corresponding weights; According to the period-level feature matrix and the projection vector, an initial prediction model is constructed, where the initial prediction model is shown in formula (8): (8) in, is the predicted concentration, Z is the period-level characteristic matrix, is the i-th row in the projection vector ω.
10. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Gas concentration detection method based on multi-harmonic information fusion laser absorption spectrum technology
CN115326751A
Multi-component gas concentration detection method based on spectrum analysis algorithm
CN116879190A
Adaptive quantum cascade laser pulse width modulation driving system
CN117728804A
Multi-sensor fused infrared gas analysis method and device
CN119808009A
Gas detection method and gas detection device
CN120142193A
Cited By
Ozone forecasting method, electronic equipment and storage medium
CN121634348A