A gas concentration detection system and method based on dynamic optical path regulation

By employing dynamic optical path control technology and a concentration decision neural network model, the accuracy and robustness issues of gas concentration detection systems in wastewater treatment under complex environments were resolved, achieving efficient and accurate gas concentration detection.

CN122150185APending Publication Date: 2026-06-05BEIJING CAPITAL CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING CAPITAL CO LTD
Filing Date
2026-02-14
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing gas concentration detection systems based on tunable semiconductor laser absorption spectroscopy face challenges in wastewater treatment processes, including decreased detection accuracy and insufficient robustness under dynamic changes in gas concentration and complex environmental interference.

Method used

By employing dynamic optical path control technology, combined with dual lasers, optical path switching components, and environmental and health status monitoring modules, a closed-loop intelligent detection architecture is constructed through a concentration decision neural network model to select the optimal laser and concentration inversion algorithm in real time.

Benefits of technology

It achieves intelligent, adaptive, and high-precision gas concentration detection in complex and ever-changing wastewater treatment environments, improving detection accuracy and system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122150185A_ABST
    Figure CN122150185A_ABST
Patent Text Reader

Abstract

The application relates to a gas concentration detection system and method based on dynamic optical path regulation, the system comprising a detection terminal and a data processing terminal in communication connection; the detection terminal comprising a long optical path absorption gas chamber, a laser emission module, a signal detection and collection module and an environment and health state monitoring module; the data processing terminal is used for receiving original digital signals and state data, converting the original digital signals into harmonic components, inputting the harmonic components and the state data into a concentration decision neural network model to obtain a decision result; and is also used for sending a first control instruction to the detection terminal according to the decision result, so that the detection terminal selects a laser corresponding to a target laser identifier to work; after the laser corresponding to the target laser identifier works, the data processing terminal is also used for receiving new digital signals, calling a recommended concentration inversion algorithm to process the newly received digital signals, and obtaining a concentration value of the gas to be detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wastewater treatment technology, and in particular to a gas concentration detection system and method based on dynamic optical path control. Background Technology

[0002] Accurate monitoring of key gases such as methane and hydrogen sulfide is crucial in wastewater treatment. Currently, tunable semiconductor laser absorption spectroscopy (TDLAS) technology is widely used, which enhances the absorption signal through a long optical path gas cell to improve detection sensitivity.

[0003] Existing TDLAS systems typically operate with a fixed configuration. Specifically, the system pre-selects a laser of a specific wavelength, along with a fixed concentration inversion algorithm (such as the second harmonic method) and a fixed optical path length. During system operation, the laser operates under fixed parameters, the detected signal is processed by the fixed algorithm, and the final output concentration value is determined.

[0004] However, the wastewater treatment site environment is complex, and this fixed mode faces significant problems in practical applications: gas concentration often fluctuates drastically with the process stage; when the concentration is too high, the signal is prone to saturation and distortion; when the concentration is too low, the signal is too weak. At the same time, due to the high water vapor content, numerous interfering gases, and the susceptibility of optical windows to contamination at the site, the fixed single algorithm is not robust enough in the face of signal distortion and interference, and the inversion error often increases.

[0005] Therefore, there is an urgent need for a gas concentration detection system and method based on dynamic optical path control. Summary of the Invention

[0006] (a) Technical problems to be solved

[0007] In view of the above-mentioned shortcomings and deficiencies of the prior art, this application provides a gas concentration detection system and method based on dynamic optical path control, which solves the technical problem that in complex and ever-changing wastewater treatment environments, detection systems with fixed working modes are unable to adaptively match dynamic changes in gas concentration and on-site interference, resulting in decreased measurement accuracy and insufficient reliability.

[0008] (II) Technical Solution

[0009] To achieve the above objectives, the main technical solutions adopted in this application include:

[0010] In a first aspect, embodiments of this application provide a gas concentration detection system based on dynamic optical path control for gas detection in a wastewater treatment process, including a detection terminal and a data processing terminal connected by communication.

[0011] The detection terminal includes:

[0012] Long optical path absorption gas cell, used to contain the gas to be measured;

[0013] The laser emitting module includes a first laser, a second laser, and an optical path switching component, used to generate laser light and couple the output laser light of the selected laser light to the long optical path absorption gas chamber;

[0014] The signal detection and acquisition module is used to receive the optical signal emitted through the long optical path absorption chamber and convert the optical signal into a raw digital signal;

[0015] The environmental and health status monitoring module is used to collect status data in real time; the status data includes the pressure and temperature of the long optical path absorption gas chamber and the driving current and operating temperature of the laser in the laser emission module.

[0016] The data processing terminal is used to receive raw digital signals and state data, convert the raw digital signals into harmonic components, input the harmonic components and state data into the concentration decision neural network model, and obtain decision results; the decision results include the target laser identifier and the recommended concentration inversion algorithm; it is also used to send a first control command to the detection terminal according to the decision results, so that the detection terminal selects the laser corresponding to the target laser identifier to work;

[0017] After the laser corresponding to the target laser identifier is activated, the data processing terminal is also used to receive new digital signals, call the recommended concentration inversion algorithm to process the newly received digital signals, and obtain the concentration value of the gas to be measured.

[0018] Optionally, in some embodiments of this application, the signal detection and acquisition module includes:

[0019] A photoelectric conversion unit is used to convert the optical signal emitted from the long optical path absorption chamber into an analog current signal;

[0020] The signal conditioning unit is used to perform transimpedance amplification and bandpass filtering on the analog current signal to obtain a first analog current signal;

[0021] The wavelength modulation and demodulation unit is used to apply high-frequency sinusoidal wavelength modulation to the emitted optical signal and to perform phase-sensitive demodulation on the first analog current signal to extract the second harmonic signal.

[0022] An analog-to-digital converter is used to convert the second harmonic signal into a digital signal as the original digital signal.

[0023] Optionally, in some embodiments of this application, the digital processing terminal converts the original digital signal into harmonic components as follows:

[0024] The original digital signal is input into the neural network correction model to obtain the harmonic components;

[0025] The neural network correction model is a temporal feature correction network based on an attention mechanism, including an encoder and a decoder;

[0026] The encoder is composed of alternating one-dimensional convolutional modules and bidirectional long short-term memory network layers connected in sequence. It is used to extract local temporal features and global temporal-dependent features from the original digital signal in layers and output the fused temporal feature vector.

[0027] The decoder includes a temporal attention computation layer connected to the encoder output, used to obtain the weight distribution of the temporal feature vector at different time steps and generate a weighted context feature vector;

[0028] The context feature vector is then processed by a fully connected regression layer to reconstruct a noise-removed digital signal as a harmonic component reflecting the gas absorption intensity.

[0029] Optionally, in some embodiments of this application, the concentration decision neural network model in the data processing terminal is an adaptive heterogeneous graph attention network, specifically including:

[0030] The heterogeneous graph construction layer is used to construct the harmonic components and state data into time-series signal nodes and state attribute nodes, respectively, and initialize a set of control decision nodes representing different decision options. Each control decision node corresponds to a candidate decision pair composed of the target laser identifier and the concentration inversion algorithm.

[0031] The adaptive meta-path discovery layer is used to dynamically discover and generate multiple semantic meta-paths connecting the time-series signal nodes and state attribute nodes to each control decision node based on the real-time characteristics of the time-series signal nodes and state attribute nodes.

[0032] The feature aggregation layer contains a multi-layer graph attention network for iterative message passing and feature exchange among various nodes along the semantic meta-path, and outputs a set of control decision nodes with updated feature representations.

[0033] The decision output layer is used to obtain the confidence score of each control decision node in the set of control decision nodes, and output the target laser identifier and concentration inversion algorithm corresponding to the highest score as the decision result.

[0034] Optionally, in some embodiments of this application, the concentration decision neural network model is a pre-trained model, and the training process specifically includes:

[0035] During the offline training phase, a complete historical dataset containing different concentrations, environmental pressures, temperatures, laser driving currents, and operating states is used. The difference between the model's decision-making results and the actual optimal expert decision is used as the loss function to supervise the training of the parameters of the adaptive heterogeneous graph attention network.

[0036] During the online adaptive phase, the harmonic components, state data, and confidence scores of the final gas concentration inversion results are continuously collected during the real-time detection process. When the inversion confidence score is lower than a preset threshold or the environmental state changes abruptly, the parameters of the adaptive meta-path discovery layer and feature aggregation layer in the network are dynamically optimized and fine-tuned through an online reinforcement learning algorithm with the goal of improving the confidence score.

[0037] Optionally, in some embodiments of this application, the environment and health status monitoring module further includes:

[0038] An airflow disturbance monitoring unit is used to collect acoustic signals from the long optical path absorption chamber and obtain airflow stability assessment results through spectrum analysis.

[0039] An optical window contamination monitoring unit is used to collect the light flux attenuation rate and obtain the degree of contamination of the optical window;

[0040] The airflow stability assessment results and pollution levels are input into the data processing terminal as additional state data.

[0041] Optionally, in some embodiments of this application, the concentration inversion algorithm includes:

[0042] Direct absorption fitting algorithm, harmonic peak ratio algorithm, and end-to-end concentration regression algorithm based on convolutional neural network.

[0043] Optionally, in some embodiments of this application, the long-path absorption chamber is provided with a set of adjustable mirrors;

[0044] The data processing terminal is also used to extract the signal strength and signal-to-noise ratio of the harmonic components as evaluation indicators; compare the evaluation indicators with the preset optimal working range to obtain the optical path adjustment amount; generate an optical path control command based on the optical path adjustment amount; and send the optical path control command to the detection terminal. The detection terminal receives the optical path control command and drives the adjustable reflector to adjust the absorption optical path of the laser in the gas chamber.

[0045] Optionally, in some embodiments of this application, the data processing terminal is further used for:

[0046] A maintenance alarm is issued when the concentration of the gas to be tested exceeds a preset reasonable range or when the confidence level of the decision result output by the concentration decision neural network model is lower than a preset threshold.

[0047] Secondly, embodiments of this application provide a gas concentration detection method based on dynamic optical path, executed by the data processing terminal described in any of the above claims, comprising the following steps:

[0048] The system receives raw digital signals and state data, converts the raw digital signals into harmonic components, inputs the harmonic components and state data into a concentration decision neural network model, and obtains decision results. The decision results include the target laser identifier and the recommended concentration inversion algorithm.

[0049] Based on the decision result, a first control command is sent to the detection terminal, causing the detection terminal to select the laser corresponding to the target laser identifier to work.

[0050] After the laser corresponding to the target laser identifier is activated, a new digital signal is received, and the recommended concentration inversion algorithm is called to process the newly received digital signal to obtain the concentration value of the gas to be measured.

[0051] (III) Beneficial Effects

[0052] The beneficial effects of this application are as follows: The gas concentration detection system and method based on dynamic optical path control of this application, by adopting dynamic optical path control technology, concentration decision neural network model and real-time environmental and health status monitoring module, can intelligently select the best laser and concentration inversion algorithm compared with the prior art, adapt to the dynamic changes of gas concentration and complex environmental conditions in the sewage treatment process, improve detection accuracy, system stability and self-adaptability, and achieve the technical effect of efficient, accurate and reliable gas concentration detection and optimized system performance. Attached Figure Description

[0053] Figure 1 This is a schematic diagram of a gas concentration detection system based on dynamic optical path control according to an embodiment of this application;

[0054] Figure 2 This is a schematic flowchart of a gas concentration detection method based on dynamic optical path control according to an embodiment of this application;

[0055] Figure 3 This is an internal structure diagram of a concentration decision neural network model in a gas concentration detection system based on dynamic optical path control according to an embodiment of this application;

[0056] Figure 4 This is a graph showing the relationship between the optical path length and the signal intensity corresponding to the gas concentration in a gas concentration detection system based on dynamic optical path length control according to an embodiment of this application. Detailed Implementation

[0057] To better explain and facilitate understanding of this application, the following detailed description of the application is provided in conjunction with the accompanying drawings and specific embodiments.

[0058] In the field of online gas detection during wastewater treatment, traditional laser absorption spectroscopy typically employs detection systems with fixed parameters. Existing technologies largely rely on a single laser, a fixed optical path gas cell, and specific concentration inversion algorithms. These approaches have significant limitations when facing the complex operating conditions of wastewater treatment plants: First, the concentration dynamic range of gases generated during treatment, such as CH4 and H2S, is extremely wide, making it difficult for a single optical path to simultaneously guarantee detection sensitivity at low concentrations and measurement linearity at high concentrations. Second, fluctuations in environmental parameters such as gas cell temperature and pressure, as well as drift in the laser's own operating conditions (such as temperature and current), introduce significant measurement errors, and existing systems often lack effective real-time compensation mechanisms. Finally, fixed algorithms cannot adapt to different concentration ranges and signal-to-noise ratio conditions, potentially leading to decreased inversion accuracy or complete failure.

[0059] To overcome the aforementioned technical problems, this application proposes a gas concentration detection system and method based on dynamic optical path control. Its core lies in constructing a closed-loop intelligent detection architecture of "sensing-decision-execution." The system hardware integrates dual lasers and an optical path switching component, a long optical path absorption gas chamber, and a comprehensive environmental and health status monitoring module, which acquires optical signals, gas chamber physical parameters, and laser operating status in real time. The data processing terminal introduces a concentration decision neural network model. This model comprehensively analyzes the original harmonic signals and real-time system status data, dynamically outputting the optimal decision, including selecting the most suitable target laser for the current conditions and recommending the most matching concentration inversion algorithm. The system then automatically executes this decision, switching lasers and calling the specified algorithm to process new data, ultimately outputting a high-precision gas concentration value. In this way, this application achieves triple dynamic optimization and adaptive control of the detection optical path, light source, and inversion algorithm.

[0060] Through the aforementioned closed-loop intelligent architecture, hardware status, environmental parameters, and concentration inversion are deeply integrated and dynamically controlled for the first time. It can automatically adapt to a wide range of gas concentration changes, ensuring detection sensitivity and accuracy throughout the entire range. By real-time monitoring and compensation for environmental and device state drift, the stability and reliability of long-term monitoring are significantly improved. Ultimately, intelligent, adaptive, and high-precision gas concentration detection is achieved in complex and ever-changing wastewater treatment environments.

[0061] To better understand the above technical solutions, exemplary embodiments of this application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application can be understood more clearly and thoroughly, and that the scope of this application can be fully conveyed to those skilled in the art.

[0062] Figure 1This is a schematic diagram of a gas concentration detection system based on dynamic optical path control according to an embodiment of this application. Figure 1 As shown, the gas concentration detection system is used for gas detection in the wastewater treatment process, including a detection terminal and a data processing terminal with communication connection.

[0063] The detection terminal includes: a long optical path absorption gas chamber, a laser emission module, a signal detection and acquisition module, and an environmental and health status monitoring module;

[0064] Specifically, the long-path absorption gas cell is an optical multiple-reflection cavity employing a White cell or Heriot-Lewis cell structure, containing a high-precision array of mirrors to hold the gas to be measured. The cell has sealed inlet and outlet ports to allow for the flow and containment of the gas. The inner wall of the cell is typically treated with low-absorption, high-reflection polishing or coating to minimize optical signal loss.

[0065] The laser emitting module includes a first laser, a second laser, and an optical path switching component, used to generate laser light and couple the output laser light from the selected laser to the long optical path absorption gas chamber. This module is integrated and installed at one end of the long optical path absorption gas chamber or on a specific cavity base.

[0066] In the laser emission module, the first laser and the second laser can operate at the characteristic absorption wavelengths of different target gases, or at different absorption lines of the same gas to adapt to a wide concentration range.

[0067] Furthermore, the laser emitting module also includes a temperature control device, which is encapsulated within the temperature control device to ensure the stability of the output wavelength.

[0068] The optical path switching component is located after the output optical paths of the two lasers and consists of optical elements such as beam splitters, switchable mirrors, galvanometers, or fiber optic switches. It receives a first control command from the data processing terminal and dynamically switches the optical path mechanically or electrically. This allows for the precise coupling and guidance of the output beam from either the first or second laser, currently selected as the "target laser," to the entrance port of the mirror array in the long-path absorption gas cell, thereby initiating a measurement cycle targeting specific spectral characteristics.

[0069] For example, the optical path switching component uses a high-speed galvanometer to switch the laser beam. In this scheme, the high-speed galvanometer, as the core movable reflector, has its deflection angle precisely controlled by the data processing terminal. By default, the high-speed galvanometer reflects the beam from the first laser and couples it into the long-path absorption gas cell. When the decision is to switch to the second laser, the data processing terminal control signal drives the high-speed galvanometer to rotate to a new angle within milliseconds, thereby reflecting the beam from the second laser to the same entrance of the gas cell, completing the dynamic switching of the optical path.

[0070] The signal detection and acquisition module is used to receive the optical signal emitted through the long optical path absorption chamber and convert the optical signal into a raw digital signal.

[0071] Specifically, the signal detection and acquisition module includes:

[0072] A photoelectric conversion unit is used to convert the optical signal emitted from the long optical path absorption chamber into an analog current signal;

[0073] The signal conditioning unit is used to perform transimpedance amplification and bandpass filtering on the analog current signal to obtain a first analog current signal;

[0074] The wavelength modulation and demodulation unit is used to apply high-frequency sinusoidal wavelength modulation to the emitted optical signal and to perform phase-sensitive demodulation on the first analog current signal to extract the second harmonic signal.

[0075] An analog-to-digital converter is used to convert the second harmonic signal into a digital signal as the original digital signal.

[0076] Taking the detection of N2O generated during wastewater treatment as an example, the operation of each unit in the signal detection and acquisition module is as follows:

[0077] The photoelectric conversion unit: The light signal emitted from the long-path absorption chamber is a weak laser beam modulated by N2O gas molecules on its specific infrared absorption lines. This beam is focused onto the photoelectric conversion unit, which linearly converts the instantaneous change in optical power into an analog current signal. The amplitude change of this signal corresponds to the attenuation of the laser due to N2O absorption. This step completes the physical conversion from optical signal to electrical signal. The photoelectric conversion unit is a photodetector.

[0078] Signal Conditioning Unit: The analog current signal output by the photoelectric conversion unit is very weak and mixed with various noises. The signal conditioning unit first converts the current signal into a voltage signal and performs primary amplification through a low-noise, high-gain transimpedance amplifier. Subsequently, the voltage signal passes through a bandpass filter, whose passband is set to allow only key frequency bands related to the subsequent modulation and demodulation frequencies (e.g., around the modulation frequency and its harmonics) to pass through, thereby effectively filtering out most of the low-frequency noise of the circuit, the residual intensity noise of the laser, and high-frequency electromagnetic interference, resulting in a first analog voltage signal with an initially improved signal-to-noise ratio.

[0079] Wavelength modulation and demodulation unit: A high-frequency (e.g., f = 5 kHz) sinusoidal wave modulation is applied to the laser currently used for N2O detection. This causes the laser wavelength to periodically sweep across the target N2O absorption spectrum at a frequency of 5 kHz. Next, a first analog power supply signal is fed into a lock-in amplifier. The lock-in amplifier uses the 5 kHz modulation signal or its harmonics as a reference. Through precise phase matching and frequency locking, the second harmonic (2f, i.e., 10 kHz) component signal, which is highly sensitive to gas concentration and effectively suppresses background noise, is extracted. Finally, a second harmonic analog voltage signal with an amplitude highly correlated with the N2O concentration in the gas chamber is output.

[0080] Analog-to-digital conversion unit: The core of this unit is a high-precision analog-to-digital converter (ADC), which discretizes and digitally quantizes the demodulated second-harmonic analog voltage signal according to a preset sampling rate. Each instantaneous voltage value is converted into a discrete digital code (e.g., a 24-bit precision digital value). This series of digital codes arranged in a time sequence constitutes the original digital signal characterizing the N2O absorption intensity, providing a direct and accurate input for subsequent intelligent decision-making and concentration inversion algorithms.

[0081] In this embodiment, the signal detection and acquisition module successfully converted the optical signal containing N2O concentration information into a high-quality, resolvable raw digital signal through a standardized process of photoelectric conversion → signal conditioning → modulation and demodulation → analog-to-digital conversion. This lays a solid data foundation for the entire system to achieve high-precision and high-stability detection of N2O gas.

[0082] The environmental and health status monitoring module is used to collect status data in real time. The status data includes the pressure and temperature of the long optical path absorption gas chamber and the driving current and operating temperature of the laser in the laser emission module.

[0083] Specifically, the environmental and health status monitoring module consists of multiple types of sensors deployed in key locations and corresponding signal acquisition circuits. For the long-path absorption gas chamber, a high-precision pressure sensor is installed on the chamber wall to directly measure gas pressure; simultaneously, a fast-response temperature sensor is installed inside the chamber or at a point with good thermal conductivity on the outer wall to accurately obtain the gas or chamber temperature. For the laser emission module, its status monitoring is achieved by acquiring the drive current in real time through precision sampling resistors connected in series in the drive circuits of the two lasers, and a high-resolution analog-to-digital converter measures the voltage drop across the resistors; the laser's operating temperature is monitored by a thermistor integrated into its temperature control module or a surface-mount temperature sensor closely attached to the tube shell. All analog signals from the sensors are amplified, filtered, and subjected to interference suppression by dedicated signal conditioning circuitry before being synchronously converted into digital signals. This integrated hardware configuration ensures that pressure, temperature, current, and laser temperature data can be transmitted in real time and synchronously to the data processing terminal via a high-speed digital interface, providing crucial environmental parameters and device health status information for the system's intelligent decision-making and high-precision concentration inversion.

[0084] Furthermore, the environmental and health status monitoring module also includes:

[0085] An airflow disturbance monitoring unit is used to collect acoustic signals from the long optical path absorption chamber and obtain airflow stability assessment results through spectrum analysis.

[0086] An optical window contamination monitoring unit is used to collect the light flux attenuation rate and obtain the degree of contamination of the optical window;

[0087] The airflow stability assessment results and pollution levels are input into the data processing terminal as additional state data.

[0088] In the specific implementation process, the airflow disturbance monitoring unit acquires acoustic signals in real time by installing a high-sensitivity MEMS microphone at the air inlet of the long optical path absorption chamber. The embedded processor built into this unit performs real-time fast Fourier transform spectrum analysis on the sound signals. By monitoring the energy amplitude and fluctuations of specific low-frequency bands (such as 1-500Hz) related to turbulence and vortices, it dynamically calculates a quantitative airflow stability assessment result, such as the turbulence index. At the same time, the optical window contamination monitoring unit continuously monitors the intensity of the direct light signal fed back by the signal detection and acquisition module, such as the amplitude of the first harmonic in the wavelength modulation spectrum, and compares it with the reference luminous flux established under the initial clean state of the system, thereby calculating the luminous flux attenuation rate as the degree of contamination of the optical window in real time.

[0089] Optionally, after obtaining the airflow stability assessment results and the contamination level of the optical window, these two types of data are input into the data processing terminal. Upon receiving the airflow stability assessment results and the contamination level of the optical window, the data processing terminal corrects and compensates for the obtained gas concentration value based on these two types of data to obtain the final gas concentration value.

[0090] For example, when a fan near the monitoring point suddenly starts, causing severe turbulence in the sampling airflow, the airflow disturbance monitoring unit immediately detects that the turbulence index spikes from the normal value of "15" to "78" in a short period of time, exceeding the normal range. The data processing terminal then triggers an anti-disturbance mode, automatically increasing the amount of data sampled for calculating individual concentration values ​​and averaging the final gas concentration values ​​to obtain more accurate gas concentration values. Simultaneously, addressing the issue of dirt accumulation on the optical window due to long-term exposure to oil mist, the pollution monitoring unit continuously compares light intensity signals and calculates that the luminous flux attenuation rate has reached 30%, exceeding the preset normal luminous flux attenuation rate. In this case, before each concentration inversion calculation, the system automatically divides the obtained gas concentration value by the current transmittance of 0.7 to obtain the final gas concentration value. This operation directly offsets the light intensity loss caused by pollution, ensuring that the concentration values ​​displayed by the system remain consistent with laboratory test results.

[0091] By employing two compensation strategies that closely integrate real-time data—namely, "smoothing by increasing the amount of data" to combat random interference and "restoring the light intensity proportionally" to correct system deviations—the system can stably output accurate and reliable monitoring data in harsh field environments.

[0092] In the specific implementation process, the data processing terminal is used to receive the original digital signal and state data, convert the original digital signal into harmonic components, input the harmonic components and state data into the concentration decision neural network model, and obtain the decision result; the decision result includes the target laser identifier and the recommended concentration inversion algorithm; it is also used to send a first control command to the detection terminal according to the decision result, so that the detection terminal selects the laser corresponding to the target laser identifier to work;

[0093] After the laser corresponding to the target laser identifier is activated, the data processing terminal is also used to receive new digital signals, call the recommended concentration inversion algorithm to process the newly received digital signals, and obtain the concentration value of the gas to be measured.

[0094] The concentration inversion algorithm includes:

[0095] Direct absorption fitting algorithm, harmonic peak ratio algorithm, and end-to-end concentration regression algorithm based on convolutional neural network.

[0096] Among them, the direct absorption fitting algorithm is the most classic and physically well-founded algorithm. It directly relies on the Lambert-Beer law to invert concentration by fitting the complete line shape of the gas's characteristic absorption spectrum (such as the Voigt line shape). It has high accuracy, but depends on accurate temperature and pressure parameters and a stable baseline, and has high requirements for signal-to-noise ratio. The harmonic peak ratio algorithm is a commonly used algorithm in wavelength modulation spectroscopy. It inverts concentration by calculating the ratio of the peak value of a specific harmonic (such as the second harmonic 2f) to the peak value of the first harmonic (1f) or other reference signals. This ratio can effectively suppress common-mode noise such as laser intensity fluctuations. The algorithm is simple and fast, and performs robustly in the medium concentration range. The end-to-end concentration regression algorithm based on convolutional neural networks is a data-driven method. It directly inputs the time-domain / frequency-domain features of the original digital signal into a trained convolutional neural network model. The network automatically extracts deep features and maps them to concentration values. This method has strong adaptability to complex noise and non-ideal interference.

[0097] Taking the harmonic peak ratio algorithm as an example, the specific steps are as follows: In the wavelength modulation and demodulation unit of the signal detection and acquisition module, the first harmonic signal (1f) and the second harmonic signal (2f) are extracted. In signal processing, the peak value of the 1f signal mainly reflects the intensity of the laser, while the peak value of the 2f signal is highly sensitive to gas absorption. Next, the algorithm calculates the ratio (R) between the two. This ratio operation is crucial because it can eliminate common-mode interference such as laser power fluctuations and light intensity attenuation caused by window contamination. Finally, through a pre-established calibration curve (i.e., the R-value curve under different known concentrations of standard gas, which is usually non-linear), the R-value calculated in real time is queried or fitted and converted into the corresponding gas concentration value.

[0098] Specifically, the first harmonic signal is the signal obtained by the lock-in amplifier of the wavelength modulation and demodulation unit when demodulating at the reference frequency f itself; the second harmonic signal is the signal obtained by the lock-in amplifier of the wavelength modulation and demodulation unit when demodulating at 2f.

[0099] Furthermore, the digital processing terminal converts the original digital signal into harmonic components as follows:

[0100] The original digital signal is input into the neural network correction model to obtain the harmonic components;

[0101] The neural network correction model is a temporal feature correction network based on an attention mechanism, including an encoder and a decoder;

[0102] The encoder is composed of alternating one-dimensional convolutional modules and bidirectional long short-term memory network layers connected in sequence. It is used to extract local temporal features and global temporal-dependent features from the original digital signal in layers and output the fused temporal feature vector.

[0103] The decoder includes a temporal attention computation layer connected to the encoder output, used to obtain the weight distribution of the temporal feature vector at different time steps and generate a weighted context feature vector;

[0104] The context feature vector is then processed by a fully connected regression layer to reconstruct a noise-removed digital signal as a harmonic component reflecting the gas absorption intensity.

[0105] In the specific implementation process, an attention-based temporal feature correction network is used to perform deep optimization processing on the demodulated second harmonic digital signal. This network can adaptively learn and separate the core gas absorption features buried in noise, intelligently filter out environmental interference and circuit noise, and thus output an optimized harmonic signal with significantly improved signal-to-noise ratio and highly pure features. This fundamentally improves the quality of the data source, not only greatly enhancing the accuracy of subsequent concentration decisions, but also directly ensuring the computational accuracy of various inversion algorithms and the environmental robustness of the overall system.

[0106] In the embodiments of this application, the concentration decision neural network model in the data processing terminal is an adaptive heterogeneous graph attention network, such as... Figure 3 As shown, the adaptive heterogeneous graph attention network specifically includes:

[0107] The heterogeneous graph construction layer is used to construct the harmonic components and state data into time-series signal nodes and state attribute nodes, respectively, and initialize a set of control decision nodes representing different decision options. Each control decision node corresponds to a candidate decision pair composed of the target laser identifier and the concentration inversion algorithm.

[0108] The adaptive meta-path discovery layer is used to dynamically discover and generate multiple semantic meta-paths connecting the time-series signal nodes and state attribute nodes to each control decision node based on the real-time characteristics of the time-series signal nodes and state attribute nodes.

[0109] The feature aggregation layer contains a multi-layer graph attention network for iterative message passing and feature exchange among various nodes along the semantic meta-path, and outputs a set of control decision nodes with updated feature representations.

[0110] The decision output layer is used to obtain the confidence score of each control decision node in the set of control decision nodes, and output the target laser identifier and concentration inversion algorithm corresponding to the highest score as the decision result.

[0111] In one embodiment of this application, taking the monitoring of nitrous oxide (N2O) gas generated during wastewater treatment as an example, the decision-making and execution process of the adaptive heterogeneous graph attention network is specifically illustrated. The data processing terminal first demodulates the second harmonic digital signal (i.e., the original digital signal) obtained by N2O at a specific absorption spectral line (e.g., the 4.5 μm band) as a time-series signal node. Simultaneously, it constructs multiple state attribute nodes from the real-time collected state data (e.g., gas chamber pressure 102.1 kPa, temperature 32°C, laser drive current 85.2 mA, and operating temperature 25.8°C). The system presets a set of control decision nodes, each node representing a candidate strategy, such as {first laser, direct absorption fitting algorithm}, {second laser, harmonic peak ratio algorithm}, etc. The adaptive meta-path discovery layer analyzes the features of these nodes and dynamically generates semantic connections. For example, the "cell pressure node" and "cell temperature node" are jointly associated with algorithm nodes that rely on accurate physical models for temperature and pressure compensation, such as the direct absorption fitting algorithm. The "laser operating temperature node" and "drive current node" are directly related to the stability of the laser output wavelength, and their fluctuation characteristics tend to connect to algorithm nodes that are insensitive to wavelength drift or have correction capabilities. Subsequently, the feature aggregation layer performs iterative message passing and feature fusion within the graph structure, ensuring that each decision node integrates comprehensive information from the absorption signal, the cell environment (temperature and pressure), and the laser's health status (current, temperature). The decision output layer calculates the confidence score of each node accordingly. Assuming that under the current operating conditions, due to the high cell temperature and slight fluctuations in the laser operating temperature, node {first laser, direct absorption fitting algorithm} receives the highest score because it can directly utilize the input temperature and pressure parameters to perform accurate physical correction of the spectral line shape. The data processing terminal then instructs the first laser to operate and calls the direct absorption fitting algorithm to process the new signal, completing an adaptive high-precision detection that depends on the core physical state.

[0112] An adaptive heterogeneous graph attention network is employed as the concentration decision neural network model. By constructing a heterogeneous graph, it unifies and dynamically associates time-series signal nodes, state attribute nodes, and control decision nodes representing different physical meanings, overcoming the limitations of traditional methods in fusing multi-source heterogeneous data. Its adaptive meta-path discovery mechanism dynamically mines the most relevant semantic associations between signals, states, and decisions based on real-time data characteristics, achieving contextualized and precise decision logic. The graph attention-based feature aggregation layer, through iterative message passing between nodes, integrates all deep information regarding signal quality, environmental conditions, and device state in the final decision, intelligently outputting the optimal laser and algorithm combination. This fundamentally enables a high degree of synergy between perception, analysis, and decision-making, significantly improving the adaptability, decision accuracy, and overall reliability of concentration detection under complex operating conditions.

[0113] Meanwhile, the concentration decision neural network model is a pre-trained model, and the training process specifically includes:

[0114] During the offline training phase, a complete historical dataset containing different concentrations, environmental pressures, temperatures, laser driving currents, and operating states is used. The difference between the model's decision-making results and the actual optimal expert decision is used as the loss function to supervise the training of the parameters of the adaptive heterogeneous graph attention network.

[0115] During the online adaptive phase, the harmonic components, state data, and confidence scores of the final gas concentration inversion results are continuously collected during the real-time detection process. When the inversion confidence score is lower than a preset threshold or the environmental state changes abruptly, the parameters of the adaptive meta-path discovery layer and feature aggregation layer in the network are dynamically optimized and fine-tuned through an online reinforcement learning algorithm with the goal of improving the confidence score.

[0116] The training method described above combines offline learning from historical data with online optimization based on real-time feedback. This enables the decision-making model to not only possess reliable initial judgment capabilities but also to continuously self-adjust and optimize based on feedback during actual operation. This ensures that the system's decision-making intelligence can evolve synchronously when facing new operating conditions or the aging of components during long-term operation, thereby maintaining high accuracy and high reliability over the long term.

[0117] Furthermore, the long optical path absorption chamber in this embodiment is equipped with a set of adjustable reflectors;

[0118] The data processing terminal is also used to extract the signal strength and signal-to-noise ratio of the harmonic components as evaluation indicators; compare the evaluation indicators with the preset optimal working range to obtain the optical path adjustment amount; generate an optical path control command based on the optical path adjustment amount; and send the optical path control command to the detection terminal. The detection terminal receives the optical path control command and drives the adjustable reflector to adjust the absorption optical path of the laser in the gas chamber.

[0119] In the specific implementation process, taking the monitoring of N2O gas during wastewater treatment as an example, the implementation process of dynamic optical path adjustment is explained in detail. (See [link to relevant documentation]) Figure 4When the system begins monitoring, if the N2O concentration is low, the data processing terminal analyzes the harmonic components and finds that the second harmonic signal strength and signal-to-noise ratio are both below the preset optimal operating range, indicating that the absorption signal is too weak at the current optical path. The system immediately calculates the adjustment amount required to significantly increase the optical path and sends an optical path control command to the detection terminal. This drives the adjustable mirror group in the long optical path absorption chamber to change its spatial orientation, increasing the reflection path of the laser beam within the cavity, for example, extending the effective absorption optical path several times from the baseline value. After adjustment, the interaction distance between the laser and the low-concentration N2O gas increases significantly, resulting in a stronger absorption signal and a signal-to-noise ratio improved to the ideal range, thus ensuring accurate measurement at low concentrations. Conversely, when the wastewater treatment process enters a specific stage that causes a sharp increase in N2O concentration, the system monitors in real time that the signal strength is approaching the saturation upper limit. It then immediately generates an optical path control command to shorten the optical path, reducing the number of reflections by adjusting the mirrors, quickly shortening the effective optical path to a suitable range, avoiding signal overload, and ensuring that the concentration inversion results remain within the linear high-precision range. This closed-loop regulation mechanism enables the system to fully adapt to drastic fluctuations in N2O concentration, always maintaining the detection conditions at the optimal level, and achieving reliable monitoring throughout the entire process from trace leakage to high-concentration emissions.

[0120] In specific implementation, the data processing terminal is also used for:

[0121] A maintenance alarm is issued when the concentration of the gas to be tested exceeds a preset reasonable range or when the confidence level of the decision result output by the concentration decision neural network model is lower than a preset threshold.

[0122] Specifically, when the real-time calculated gas concentration exceeds the safe range, or when the confidence level of the concentration decision neural network model's output decision falls below a threshold (e.g., below 0.85) due to poor signal quality or environmental interference, the data processing terminal will immediately trigger a judgment. Subsequently, the data processing terminal will issue alarms in stages based on the nature of the anomaly: for concentration exceedance events that directly endanger safety, the highest-level safety warning will be triggered, and operations personnel will be notified urgently through multiple channels; for low-confidence states that indicate a decline in system performance, detailed maintenance alarms will be generated and sent to the management platform, indicating possible device aging or optical path problems.

[0123] This mechanism represents a crucial shift from passive response to proactive intelligent early warning. In terms of safety, it provides immediate alerts for direct risks such as excessive concentrations, ensuring process safety. Regarding reliability, predictive maintenance is achieved through decision confidence monitoring, enabling early warnings of device aging or optical path problems before system performance substantially degrades, significantly reducing maintenance costs and the risk of unplanned downtime. This allows the system to not only provide measurement data but also possess self-assessment and health management capabilities, enhancing the overall intelligence and application value of the solution.

[0124] This application presents a gas concentration detection system based on dynamic optical path control. By integrating dynamic optical path adjustment, multi-source state sensing, and an intelligent decision-making network, a complete adaptive detection closed loop is constructed. The system not only dynamically optimizes the absorption optical path according to gas concentration to balance high sensitivity at low concentrations and a wide measurement range at high concentrations, but also intelligently selects the optimal laser and inversion algorithm through a neural network, and uses real-time environmental and health status data for precise compensation and correction. Thus, under the complex and variable conditions of wastewater treatment, it achieves high-precision, high-stability, and high-reliability real-time online monitoring of single or multiple gas components, significantly improving the overall performance and environmental adaptability of the system.

[0125] On the other hand, embodiments of this application also provide a gas concentration detection method based on dynamic optical path, executed by the data processing terminal described in any of the above claims, comprising the following steps:

[0126] The system receives raw digital signals and state data, converts the raw digital signals into harmonic components, inputs the harmonic components and state data into a concentration decision neural network model, and obtains decision results. The decision results include the target laser identifier and the recommended concentration inversion algorithm.

[0127] Based on the decision result, a first control command is sent to the detection terminal, causing the detection terminal to select the laser corresponding to the target laser identifier to work.

[0128] After the laser corresponding to the target laser identifier is activated, a new digital signal is received, and the recommended concentration inversion algorithm is called to process the newly received digital signal to obtain the concentration value of the gas to be measured.

[0129] The beneficial effects of the gas concentration detection method provided in this application are as follows: By implementing an integrated intelligent decision-making and adaptive control process, this method modularizes and streamlines the core signal processing, neural network decision-making, and closed-loop execution. Specifically, this method inputs real-time converted harmonic components and multi-dimensional state data into the concentration decision neural network model, realizing the real-time, intelligent, and dynamic generation of detection strategies; and based on this decision, it precisely controls hardware switching and executes the optimal inversion algorithm, thereby solidifying the entire chain capability of "perception-analysis-decision-execution" into a standard, repeatable operating method. This ensures that when facing dynamic and complex working conditions such as wastewater treatment, the system can automatically complete the optimization and execution of optimal detection conditions in a programmed manner, significantly improving the adaptability, consistency, automation level, and reliability of the final results of the entire detection process.

[0130] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0131] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0132] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first and second features are in direct contact, or that they are in indirect contact through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.

[0133] In the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0134] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make modifications, alterations, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A gas concentration detection system based on dynamic optical path control, characterized in that, Gas detection for wastewater treatment processes, including detection terminals and data processing terminals with communication connections; The detection terminal includes: Long optical path absorption gas cell, used to contain the gas to be measured; The laser emitting module includes a first laser, a second laser, and an optical path switching component, used to generate laser light and couple the output laser light of the selected laser light to the long optical path absorption gas chamber; The signal detection and acquisition module is used to receive the optical signal emitted through the long optical path absorption chamber and convert the optical signal into a raw digital signal; The environmental and health status monitoring module is used to collect status data in real time; the status data includes the pressure and temperature of the long optical path absorption gas chamber and the driving current and operating temperature of the laser in the laser emission module. The data processing terminal is used to receive raw digital signals and state data, convert the raw digital signals into harmonic components, input the harmonic components and state data into the concentration decision neural network model, and obtain decision results; the decision results include the target laser identifier and the recommended concentration inversion algorithm; it is also used to send a first control command to the detection terminal according to the decision results, so that the detection terminal selects the laser corresponding to the target laser identifier to work; After the laser corresponding to the target laser identifier is activated, the data processing terminal is also used to receive new digital signals, call the recommended concentration inversion algorithm to process the newly received digital signals, and obtain the concentration value of the gas to be measured.

2. The gas concentration detection system based on dynamic optical path control according to claim 1, characterized in that, The signal detection and acquisition module includes: A photoelectric conversion unit is used to convert the optical signal emitted from the long optical path absorption chamber into an analog current signal; The signal conditioning unit is used to perform transimpedance amplification and bandpass filtering on the analog current signal to obtain a first analog current signal; The wavelength modulation and demodulation unit is used to apply high-frequency sinusoidal wavelength modulation to the emitted optical signal and to perform phase-sensitive demodulation on the first analog current signal to extract the second harmonic signal. An analog-to-digital converter is used to convert the second harmonic signal into a digital signal as the original digital signal.

3. The gas concentration detection system based on dynamic optical path control according to claim 1, characterized in that, The digital processing terminal converts the raw digital signal into harmonic components as follows: The original digital signal is input into the neural network correction model to obtain the harmonic components; The neural network correction model is a temporal feature correction network based on an attention mechanism, including an encoder and a decoder; The encoder is composed of alternating one-dimensional convolutional modules and bidirectional long short-term memory network layers connected in sequence. It is used to extract local temporal features and global temporal-dependent features from the original digital signal in layers and output the fused temporal feature vector. The decoder includes a temporal attention computation layer connected to the encoder output, used to obtain the weight distribution of the temporal feature vector at different time steps and generate a weighted context feature vector; The context feature vector is then processed by a fully connected regression layer to reconstruct a noise-removed digital signal as a harmonic component reflecting the gas absorption intensity.

4. The gas concentration detection system based on dynamic optical path control according to claim 1, characterized in that, The concentration decision neural network model in the data processing terminal is an adaptive heterogeneous graph attention network, specifically including: The heterogeneous graph construction layer is used to construct the harmonic components and state data into time-series signal nodes and state attribute nodes, respectively, and initialize a set of control decision nodes representing different decision options. Each control decision node corresponds to a candidate decision pair composed of the target laser identifier and the concentration inversion algorithm. The adaptive meta-path discovery layer is used to dynamically discover and generate multiple semantic meta-paths connecting the time-series signal nodes and state attribute nodes to each control decision node based on the real-time characteristics of the time-series signal nodes and state attribute nodes. The feature aggregation layer contains a multi-layer graph attention network for iterative message passing and feature exchange among various nodes along the semantic meta-path, and outputs a set of control decision nodes with updated feature representations. The decision output layer is used to obtain the confidence score of each control decision node in the set of control decision nodes, and output the target laser identifier and concentration inversion algorithm corresponding to the highest score as the decision result.

5. The gas concentration detection system based on dynamic optical path control according to claim 4, characterized in that, The concentration decision neural network model is a pre-trained model, and the training process specifically includes: During the offline training phase, a complete historical dataset containing different concentrations, environmental pressures, temperatures, laser driving currents, and operating states is used. The difference between the model's decision-making results and the actual optimal expert decision is used as the loss function to supervise the training of the parameters of the adaptive heterogeneous graph attention network. During the online adaptive phase, the harmonic components, state data, and confidence scores of the final gas concentration inversion results are continuously collected during the real-time detection process. When the inversion confidence score is lower than a preset threshold or the environmental state changes abruptly, the parameters of the adaptive meta-path discovery layer and feature aggregation layer in the network are dynamically optimized and fine-tuned through an online reinforcement learning algorithm with the goal of improving the confidence score.

6. The gas concentration detection system based on dynamic optical path control according to claim 1, characterized in that, The environmental and health status monitoring module also includes: An airflow disturbance monitoring unit is used to collect acoustic signals from the long optical path absorption chamber and obtain airflow stability assessment results through spectrum analysis. An optical window contamination monitoring unit is used to collect the light flux attenuation rate and obtain the degree of contamination of the optical window; The airflow stability assessment results and pollution levels are input into the data processing terminal as additional state data.

7. The gas concentration detection system based on dynamic optical path control according to claim 1, characterized in that, The concentration inversion algorithm includes: Direct absorption fitting algorithm, harmonic peak ratio algorithm, and end-to-end concentration regression algorithm based on convolutional neural network.

8. The gas concentration detection system based on dynamic optical path control according to claim 1, characterized in that, The long-path absorption chamber is equipped with a set of adjustable reflectors. The data processing terminal is also used to extract the signal strength and signal-to-noise ratio of the harmonic components as evaluation indicators; compare the evaluation indicators with the preset optimal working range to obtain the optical path adjustment amount; generate an optical path control command based on the optical path adjustment amount; and send the optical path control command to the detection terminal. The detection terminal receives the optical path control command and drives the adjustable reflector to adjust the absorption optical path of the laser in the gas chamber.

9. The gas concentration detection system based on dynamic optical path control according to claim 1, characterized in that, The data processing terminal is also used for: A maintenance alarm is issued when the concentration of the gas to be tested exceeds a preset reasonable range or when the confidence level of the decision result output by the concentration decision neural network model is lower than a preset threshold.

10. A gas concentration detection method based on dynamic optical path control, characterized in that, Performed by the data processing terminal as described in any one of claims 1 to 9, the method includes the following steps: The system receives raw digital signals and state data, converts the raw digital signals into harmonic components, inputs the harmonic components and state data into a concentration decision neural network model, and obtains decision results. The decision results include the target laser identifier and the recommended concentration inversion algorithm. Based on the decision result, a first control command is sent to the detection terminal, causing the detection terminal to select the laser corresponding to the target laser identifier to work. After the laser corresponding to the target laser identifier is activated, a new digital signal is received, and the recommended concentration inversion algorithm is called to process the newly received digital signal to obtain the concentration value of the gas to be measured.