Gas detection method and device, readable storage medium and program product
By extracting the amplitude and environmental information of the NDIR gas detection system through Fourier transform and combining it with dynamic adjustment of the light source and sampling frequency, the problems of signal offset and noise interference are solved, and high-precision, low-power multi-gas detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BYD CO LTD
- Filing Date
- 2026-02-28
- Publication Date
- 2026-04-17
AI Technical Summary
Existing NDIR gas detection technology is susceptible to signal sampling interval offset and noise interference, resulting in low accuracy of gas concentration calculation, and multi-gas detection systems are costly and require large equipment footprints.
The amplitude of the infrared light source is extracted using Fourier transform technology. Combined with air pressure and temperature information, the light source and sampling frequency are adjusted, and a shared filter module is used for multi-gas detection.
It improves the accuracy of gas concentration detection, reduces sensor power consumption, reduces equipment cost and space occupation, and adapts to gas concentration changes in complex scenarios.
Smart Images

Figure CN121877791A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of environmental monitoring technology, and in particular to a gas detection method, device, readable storage medium, and program product. Background Technology
[0002] Non-dispersive infrared (NDIR) is a technique that detects gas concentration by measuring the absorption rate of infrared light at a specific wavelength. It is widely used in many fields such as environmental monitoring and industrial safety.
[0003] In related technologies, NDIR multi-gas detection integrated systems generally calculate gas concentration by detecting the peak-to-peak value of the output voltage of an infrared detector, that is, by acquiring the signal waveform through an ADC and calculating the peak-to-peak value of the signal based on the maximum and minimum values of the signal.
[0004] However, relying solely on the peak-to-peak voltage of the signal to calculate gas concentration is susceptible to signal sampling interval shifts or noise interference, resulting in inaccurate concentration calculations and low detection precision. Summary of the Invention
[0005] The purpose of this application is to provide a gas detection method, apparatus, readable storage medium, and program product, which aims to solve the problem of how to improve the detection accuracy of gas concentration.
[0006] In a first aspect, a gas detection method is provided, comprising: controlling an infrared light source to operate at a target driving frequency, acquiring a detection signal from a detector of the infrared light source; performing a Fourier transform on the detection signal to obtain a frequency domain signal; determining the amplitude based on the frequency domain signal and the target driving frequency; determining the gas concentration based on the amplitude; the amplitude being used to characterize the intensity of infrared light absorbed by the gas.
[0007] The technical solution provided in this application performs a Fourier transform on the detection signal obtained when the infrared light source operates at the target driving frequency to extract the amplitude corresponding to the driving frequency of the infrared light source, and uses it to determine the gas concentration instead of the voltage peak-to-peak value. This reduces the error introduced by the offset of the signal sampling point, effectively suppresses the aliasing effect of environmental noise, power frequency interference and non-target frequency signals, and improves the accuracy of gas concentration detection.
[0008] In one implementation, determining the gas concentration based on the amplitude further includes: determining the gas concentration based on the amplitude and environmental information; wherein the environmental information includes air pressure and / or temperature.
[0009] In one implementation, determining the gas concentration based on amplitude and environmental information includes: determining a concentration generation model corresponding to a target driving frequency and a target sampling frequency; wherein the target sampling frequency is the frequency of the output signal acquired by the detector. The amplitude and environmental information are input into the concentration generation model to obtain the gas concentration.
[0010] In one implementation, the target driving frequency and the target sampling frequency are adjusted based on the gas concentration.
[0011] In one implementation, adjusting the target driving frequency and the target sampling frequency based on the gas concentration includes: adjusting the target driving frequency and the target sampling frequency based on the concentration difference between the gas concentration and a preset concentration threshold.
[0012] In one implementation, adjusting the target driving frequency and the target sampling frequency based on the concentration difference between the gas concentration and a preset concentration threshold includes: determining a frequency group corresponding to the concentration difference and the gas type; wherein the frequency group includes a driving frequency and a sampling frequency; adjusting the target driving frequency to the driving frequency in the frequency group; and adjusting the target sampling frequency to the sampling frequency in the frequency group.
[0013] In one embodiment, based on the type of gas to be detected, the filter module is controlled to switch to a filter corresponding to the type of gas, so that the frequency of the infrared light emitted by the infrared light source after passing through the filter matches the type of gas.
[0014] Secondly, a gas detection device is also provided, including a processor and a memory, the processor being connected to the memory, and the memory storing computer instructions. When the computer instructions are executed on the gas detection device, the gas detection device performs the detection method of any embodiment of the first aspect described above.
[0015] Thirdly, a computer-readable storage medium is also provided, which stores computer-executable instructions. When the computer-executable instructions are executed on a computer, the computer performs the detection method of any embodiment of the first aspect described above.
[0016] Fourthly, a computer program product is also provided, which includes instructions. When the instructions are executed on a computer, the computer performs the detection method according to any embodiment of the first aspect described above. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the structure of a gas detection system provided in an embodiment of this application; Figure 2 This is a schematic diagram of a gas detection structure provided in an embodiment of this application; Figure 3 A schematic flowchart of a gas detection method provided in an embodiment of this application; Figure 4 A schematic flowchart of another gas detection method provided in an embodiment of this application; Figure 5 A schematic flowchart illustrating another gas detection method provided in an embodiment of this application; Figure 6 A flowchart illustrating a frequency dynamic adjustment method provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a gas detection device provided in an embodiment of this application.
[0019] Figure label: 101. NDIR gas detection system; 102. Main unit; 103. NDIR sensor; 104. Embedded processor; 105. Light source driver module; 106. Filter module control module; 107. Signal acquisition and processing module; 108. Gas pressure monitoring module; 119. Light source; 110. Filter module; 111. Infrared detector; 112. Gas chamber; 113. NTC thermistor; 114. Air inlet; 115. Air outlet; 110-1. Filter. Detailed Implementation
[0020] In the embodiments of this application, the terms "first," "second," "third," "fourth," "fifth," and "sixth" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first," "second," "third," "fourth," "fifth," and "sixth" may explicitly or implicitly include one or more of that feature.
[0021] In embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0022] "A and / or B" includes the following three combinations: A only, B only, and a combination of A and B.
[0023] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner. In the description of this specification, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0024] Non-dispersive infrared (NDIR) is a technique that utilizes the different absorption intensities of different gases at different wavelengths of infrared light. By measuring the absorptivity of infrared light at a specific wavelength, the concentration of the corresponding gas can be deduced. For example, the concentration of CO2 gas can be calculated by measuring its absorptivity at 4.26 μm, CO gas by measuring its absorptivity at 4.64 μm, and CH4 gas by measuring its absorptivity at 3.375 μm. NDIR technology is widely used in many fields such as environmental monitoring and industrial safety.
[0025] The NDIR sensor used in NDIR technology mainly consists of a light source, a gas chamber, an infrared detector, a data acquisition circuit, and a driving circuit. Compared with electrochemical sensors, it has a more complex structure and requires algorithms to calculate the concentration of the gas to be measured.
[0026] In related technologies, NDIR sensor light source driving typically uses intermittent illumination and acquires signal waveforms via an ADC to obtain signal extrema and calculate peak-to-peak values for gas concentration calculation. While this can eliminate the influence of background light to some extent, it is susceptible to signal sampling interval shifts or noise, leading to reduced output accuracy. For example, if the signal sampling time is offset, the sampling point will deviate from the signal's maximum or minimum value, causing errors in peak-to-peak value calculation and affecting sensor accuracy. Similarly, if noise causes a large shift in the signal sampling point, it will also lead to errors in peak-to-peak value calculation, affecting sensor accuracy. Furthermore, NDIR sensors in related technologies generally drive and sample the light source at a fixed frequency after power-on, exhibiting technical drawbacks such as difficulty adapting to dynamic changes in gas concentration in complex scenarios and high sensor power consumption.
[0027] Furthermore, most NDIR multi-gas detection integrated systems in related technologies are implemented by using multiple detectors or multiple transmitters (infrared light sources). For example, a rotatable structure uses a motor to periodically match three optical chambers with different optical path lengths (longest optical path optical chamber, medium-long optical path optical chamber, and short optical path optical chamber) with three detectors equipped with different filters for multi-gas detection. This has technical drawbacks such as high design cost and large space occupation. Alternatively, a robot-based gas detection system uses a gas sensor group composed of multiple gas sensors to achieve multi-gas detection. This system has technical drawbacks such as a large number of gas detection devices, a large workload for equipment maintenance, and high cost of establishing the detection system.
[0028] Based on this, this application provides an NDIR gas detection system. This NDIR gas detection system can also be applied in industrial safety (such as combustible gas detection and toxic gas detection), medical (such as anesthetic gas detection), agricultural (such as greenhouse gas detection), and smart home (such as indoor volatile organic compound detection), etc., and this application does not limit its applications to these areas.
[0029] like Figure 1 As shown, Figure 1 This is a schematic diagram of an NDIR gas detection system 101 provided in an embodiment of this application. The NDIR gas detection system 101 includes a host 102 and an NDIR sensor 103. The host 102 and the NDIR sensor 103 are connected through a specific interface, supporting quick plug-and-play and improving maintainability. The host 102 supplies power to the NDIR sensor 103.
[0030] The host 102 includes an embedded processor 104, a light source driving module 105, a filter module control module 106, a signal acquisition and processing module 107, and a barometric pressure monitoring module 108. The NDIR sensor 103 includes a light source 109, a filter module 110, an infrared detector 111, a gas chamber 112, and an NTC thermistor 113.
[0031] In some embodiments, the host 102 is responsible for driving the light source of the NDIR sensor 103. The host 102 outputs a PWM signal with a specific frequency and duty cycle to the NDIR sensor 103. The frequency range of this signal is 0.5-10Hz, and the duty cycle range is 10%-50%. Furthermore, the amplitude of the square wave can be flexibly varied depending on the driving method.
[0032] In some embodiments, the host 102 is responsible for acquiring the signal from the NDIR sensor 103. The signal acquisition is characterized by the frequency of the acquired signal being consistent with the light source driving frequency. Furthermore, depending on the difference in the duty cycle of the driving signal, the acquired signal rises when the PWM signal is at a high level and falls when the PWM signal is at a low level. Additionally, the amplitude of the acquired signal can vary depending on the specific acquisition circuit.
[0033] In some embodiments, the core of the host 102 is an embedded processor 104. The embedded processor 104 is connected to a light source driving module 105, a filter module control module 106, a signal acquisition and processing module 107, and a pressure monitoring module 108. The embedded processor 104 connects to the pressure monitoring module 108 to acquire the current pressure. The embedded processor 104 connects to the signal acquisition and processing module 107 to acquire and calculate the gas concentration based on the acquired NDIR signal, temperature, and pressure.
[0034] In some embodiments, the light source driving module 105 is connected to the light source 109 to drive the light source. The light source 109 is used to emit infrared light of a specific wavelength to provide a light source for gas absorption. The light source 109 includes the absorption peak band corresponding to the gas to be measured.
[0035] The specific configuration of the light source 109 can be determined based on factors such as cost and the type of gas to be detected. For example, considering cost, while meeting basic detection requirements, the light source 109 can be configured as an incandescent lamp covering the 0-5µm wavelength band to control costs. Considering the type of gas to be detected, since different gases have specific infrared absorption peak bands, in order to ensure effective detection of the target gas, the wavelength coverage of the light source 109 should match the absorption peak band of the gas to be detected. For example, if the gas to be detected contains sulfur hexafluoride, the corresponding absorption peak band is 10.55µm, then the light source 109 can be configured as a blackbody infrared light source that needs to cover the 2-14µm wavelength band.
[0036] In some embodiments, the filter module control module 106 is connected to the filter module 110 to control the switching of different wavelength filters. The filter module 110 integrates multiple narrowband filters, and the switching of filters can be achieved by motor drive.
[0037] The filter module 110 integrates M filters, each corresponding to one of the M different gases. The M filters correspond to M pre-calibrated positions. For example, M = 4, corresponding to carbon dioxide, carbon monoxide, methane, and sulfur hexafluoride. The filter module 110 includes the required wavelength range for one or more gases. For example, the wavelength range for carbon dioxide is 4260nm, for carbon monoxide it is 4640nm, and for methane it is 3375nm.
[0038] The host 102 drives the motor to a designated position through the filter module control module 106 to switch between different filters in the filter module 110.
[0039] The switching of filters is not limited to the rotary table method. Alternative solutions include motorized translational filter modules and other methods that switch filters by electronic control. All of these methods can achieve the detection of multiple gases by switching only the filter wavelength.
[0040] In some embodiments, the signal acquisition and processing module 107 is connected to the infrared detector 111 and the NTC thermistor 113 to acquire NDIR signals and temperature. The infrared detector 111 can be configured as a thermopile detector or a pyroelectric infrared detector.
[0041] In some embodiments, the signal acquisition and processing module 107 includes an analog-to-digital converter (ADC). The ADC is used to acquire data from the infrared detector 111 at a sampling frequency, and to perform analog-to-digital conversion on the acquired data, converting the analog signal output by the detector into a digital signal.
[0042] In some embodiments, the air pressure monitoring module 108 is composed of an air pressure sensor or a piezoresistive barometer, etc., and is used to monitor the air pressure of the current gas detection environment in real time.
[0043] In some embodiments, the inner wall of the gas chamber 112 is coated with a highly reflective metallic material to improve the reflectivity to the light source. The metallic material used for the inner wall of the gas chamber 112 is typically selected from materials such as gold, silver, and copper. Because gold has high stability and is not easily oxidized, it is generally preferred for coating the inner wall.
[0044] In this embodiment, the separate design of the host and the NDIR sensor improves maintainability. The host is responsible for driving the NDIR sensor's light source, switching the detected gas, acquiring the output signal, and flexibly controlling the driving strategy, which reduces sensor power consumption and increases sensor lifespan.
[0045] like Figure 2 As shown, Figure 2 This is a schematic diagram of a gas detection structure provided in an embodiment of this application. The gas detection structure includes a light source 109, a gas chamber 112, an air inlet 114, an air outlet 115, a filter module 110, and an infrared detector 111. The filter module 110 includes multiple filters 110-1.
[0046] Among them, filter 110-1 is a narrow-bandpass filter with a specific wavelength determined according to the gas to be detected. Filter 110-1 is used to filter non-target wavelength light, allowing only specific absorption peak light to pass through, thus eliminating background light interference.
[0047] In actual gas detection, the infrared light emitted by the light source 109 can be filtered by the filter 110-1 to remove unwanted wavelength components, allowing only infrared light of specific wavelengths to pass through, and finally transmitted to the infrared detector 111 for subsequent signal processing and gas concentration analysis.
[0048] Infrared detector 111 is used to receive light filtered by filter 110-1 and convert it into an analog signal output.
[0049] In some embodiments, the inlet 114 guides the gas to be measured into the gas chamber 112; the gas chamber 112 provides a fixed path length for the gas to interact with infrared light; and the outlet 115 discharges the detected gas, maintaining pressure balance within the gas chamber. The inlet 114, the gas chamber 112, and the outlet 115 provide the necessary gas environment for the NDIR sensor.
[0050] A miniature air pump is connected to the air inlet 114 or the air outlet 115 to accelerate the gas exchange rate and shorten the sensor's response time.
[0051] like Figure 3 As shown, Figure 3 This application provides a schematic flowchart of a gas detection method, which is applied to the aforementioned NDIR gas detection system 101. The method includes: Step 301: Control the infrared light source to work according to the target driving frequency and acquire the detection signal of the infrared light source detector.
[0052] The target driving frequency is the frequency at which the infrared light source is periodically switched on and off using pulse width modulation, which is the number of times the light source completes the "on-off" cycle per unit time.
[0053] In some embodiments, the detection signal is a digital signal obtained by converting the analog signal output by the detector after receiving radiation light emitted by the infrared light source into an analog signal using an analog-to-digital converter (ADC). The ADC can also be used to acquire the analog signal output by the detector after receiving radiation light emitted by the infrared light source.
[0054] In some embodiments, after driving the infrared light source, a preset time delay is applied before acquiring the analog signal output by the detector after receiving the radiation light emitted by the infrared light source.
[0055] The preset duration can be determined through experimental calibration or by combining the characteristics of the light source. For example, by testing the waveform changes collected after driving the infrared light source, it was found that the analog signal output by the detector has transient fluctuations (such as overshoot, oscillation or temperature drift) 2ms after the infrared light source is started. After that, the signal amplitude and phase tend to stabilize. At this time, a certain margin is reserved to cope with extreme temperature or power fluctuations, and the preset duration is set to 3ms.
[0056] In this embodiment, by delaying the infrared light source for a period of time after driving it, and then collecting the analog signal output by the detector after receiving the radiation light emitted by the infrared light source, the situation where no signal can be collected due to the driving of the light source and the delay of the optical path can be effectively avoided.
[0057] Step 302: Perform a Fourier transform on the probe signal to obtain the frequency domain signal.
[0058] The Fourier transform is used to convert a time-domain signal into a frequency-domain signal. For example, the Fourier transform can be a Fast Fourier Transform (FFT) to improve the computational efficiency of the Fourier transform.
[0059] The frequency domain signal is a complex sequence obtained by performing a Fourier transform on the probe signal. Each complex element contains the amplitude and phase information of the corresponding frequency component.
[0060] Step 303: Determine the amplitude based on the frequency domain signal and the target driving frequency.
[0061] The amplitude is used to characterize the intensity of infrared light absorbed by a gas. A higher amplitude indicates a higher intensity of light absorption by the gas, and consequently a higher gas concentration.
[0062] In some embodiments, the amplitude determination method specifically includes: determining the frequency resolution using the number of samplings and sampling points of the analog signal output by the detector; the frequency resolution is used to characterize the interval between two adjacent frequency points in the frequency domain signal. The frequency index of the target driving frequency in the frequency domain signal is determined based on the frequency resolution. The amplitude spectrum is obtained by taking the modulus of each complex element in the frequency domain signal; the amplitude spectrum is used to reflect the magnitude of different frequency components. The amplitude is extracted from the amplitude spectrum based on the frequency index.
[0063] Step 304: Determine the gas concentration based on the amplitude.
[0064] In some embodiments, the gas concentration is determined by substituting the amplitude for the change in light intensity and calculating the gas concentration according to the Lambert-Beer law.
[0065] In other embodiments, the gas concentration is determined by: performing multi-point experimental calibration using a standard gas of known concentration in advance, establishing a calibration curve of amplitude versus concentration (such as least squares fitting), and calculating the gas concentration using the calibration curve and the obtained amplitude during the gas detection process.
[0066] In this embodiment, the analog signal output by the infrared detector after receiving the radiation light emitted by the infrared light source is converted from analog to digital, and the detection signal obtained by analog-to-digital conversion is Fourier transformed to extract the amplitude corresponding to the driving frequency of the infrared light source, so as to replace the voltage peak-to-peak value to determine the gas concentration. This can reduce the error introduced by the signal sampling point offset, effectively suppress the aliasing effect of environmental noise, power frequency interference and non-target frequency signals, and improve the gas concentration detection accuracy.
[0067] In some implementations, determining the gas concentration based on the amplitude further includes determining the gas concentration based on the amplitude and environmental information. The environmental information includes air pressure and / or temperature.
[0068] For example, such as Figure 4 As shown, Figure 4 This is a schematic flowchart of another gas detection method provided in an embodiment of this application. The detection method is applied to the aforementioned NDIR gas detection system 101 and includes: Step 401: Control the infrared light source to work according to the target driving frequency and acquire the detection signal of the infrared light source detector.
[0069] Step 402: Perform a Fourier transform on the probe signal to obtain the frequency domain signal.
[0070] Step 403: Determine the amplitude based on the frequency domain signal and the target driving frequency.
[0071] Step 404: Determine the gas concentration based on the amplitude and environmental information; wherein, the environmental information includes air pressure and / or temperature.
[0072] In some embodiments, the air pressure is obtained from a gas monitoring device via a specific communication method. The gas monitoring device can be configured as a pressure sensor, a piezoresistive barometer, or other similar device, used to monitor the air pressure of the current gas detection environment in real time.
[0073] Optionally, a specific communication method is configured to be one of the following communication protocols: SPI, I2C, LIN, or CAN.
[0074] In some embodiments, the temperature is calculated based on NTC thermistor data. The NTC thermistor data is a voltage value read through a voltage divider circuit.
[0075] In some embodiments, the temperature is obtained by: consulting an NTC calibration table or calculating the temperature of the current gas detection environment based on NTC thermistor data, i.e., the voltage value read from the voltage divider circuit, or by using a predetermined equation. The NTC calibration table can be provided by the NTC supplier. The predetermined equation can be a pre-defined Steinhart-Hart equation.
[0076] In this embodiment, by combining temperature, air pressure and the amplitude of the detection signal to calculate gas concentration, the interference of temperature and air pressure changes on the concentration calculation results can be effectively eliminated. The effects of temperature fluctuations on the thermal motion of gas molecules and air pressure changes on the concentration calculation can be accurately compensated, thereby improving the accuracy and stability of the concentration calculation and enabling the sensor to adapt to extreme scenarios such as high and low temperatures and high and low pressures.
[0077] In some implementations, the gas concentration is determined based on amplitude and environmental information, including: determining a concentration generation model corresponding to a target driving frequency and a target sampling frequency; wherein the target sampling frequency is the frequency of the output signal of the acquisition detector; and inputting the amplitude and environmental information into the concentration generation model to obtain the gas concentration.
[0078] The target sampling frequency is the number of times the detector's output signal is sampled per unit time. The detector's output signal is the analog signal output by the detector after receiving radiation light emitted by the infrared source.
[0079] In some embodiments, the target driving frequency and the target sampling frequency are mapped to the concentration generation model.
[0080] By comprehensively considering the combined influence of the driving frequency of the infrared light source and the sampling frequency of the detector on the gas detection process, as well as the interaction between the two, establishing a mapping relationship between frequency combinations and the model can fully account for the combined effect of driving frequency and sampling frequency. This allows for a more accurate description of the relationship between gas concentration and signal, while enabling the model to adapt to a wider range of frequency ranges and combinations, thus improving the model's adaptability and flexibility.
[0081] In some embodiments, gas concentration prediction is performed by selecting a corresponding concentration generation model from a preset frequency-model mapping table based on the target driving frequency and the target sampling frequency.
[0082] By fully considering the influence of frequency factors on gas absorption and signal acquisition, namely the influence of the driving frequency of the infrared light source on the characteristics of gas absorption of infrared light, and the influence of the detector sampling frequency on the accuracy of reflecting the characteristics of gas absorption of infrared light, a concentration generation model mapped to the driving frequency and sampling frequency is selected for gas concentration analysis. This can effectively improve the accuracy of gas concentration calculation and enhance anti-interference capability.
[0083] For example, the preset frequency-model mapping table is established as follows: The concentration range corresponding to each type of gas to be detected is clearly defined; based on considerations of the characteristics of the light source and the detection accuracy, a series of different light source driving frequencies and detector sampling frequencies are divided; different light source driving frequencies and detector sampling frequencies are combined to form multiple frequency pairs; experiments are conducted using each frequency pair at different gas concentrations, and experimental data such as temperature, air pressure, and detector signal amplitude are recorded during the experiment; the concentration generation model is verified using experimental data not involved in model training, and a mapping relationship is established between each verified and effective model and its corresponding frequency pair; the mapping relationships between all frequency pairs and models are summarized to form the preset frequency-model mapping table.
[0084] For example, the concentration generation model can be constructed using machine learning algorithms. The model construction method is as follows: acquire several sets of gas pressure data, temperature data, and amplitude obtained by performing Fourier transform on the collected infrared detector data under different gas concentrations, and label each set of data with the real gas concentration; after cleaning and normalizing each set of data, use it as training samples to select an initial model (such as random forest, neural network, or support vector machine) for training to obtain the concentration generation model.
[0085] In this embodiment of the application, a machine learning algorithm is introduced, combined with amplitude. air pressure Temperature co-modeling enables gas detection to adapt to extreme scenarios such as high and low temperatures and high and low pressures. While avoiding interference from extreme environments on the accuracy of gas concentration detection, it also utilizes the nonlinear fitting and generalization characteristics of machine learning algorithms to achieve high-precision gas concentration prediction in complex environments.
[0086] In some implementations, adjusting the target driving frequency and the target sampling frequency based on the gas concentration includes: adjusting the target driving frequency and the target sampling frequency based on the concentration difference between the gas concentration and a preset concentration threshold.
[0087] The preset concentration threshold can be the sum of the preset threshold and the concentration margin, or the difference between the preset threshold and the concentration margin. The preset threshold can be set in advance based on safety standards for the detected gas, environmental baseline concentrations, and other indicators. The value of the preset threshold varies depending on the type of gas being detected.
[0088] The concentration margin is determined based on the gas concentration conditions. For example, the concentration margin is taken as 10% of the absolute difference between the gas concentration and a preset threshold.
[0089] By combining a preset threshold with a concentration margin to form a trigger value for dynamic frequency adjustment, frequent switching of the drive / sampling frequency caused by minute fluctuations in gas concentration can be avoided.
[0090] The adjustment can be done in two ways: increasing or decreasing. Decreasing the target driving frequency (i.e., the driving frequency of the light source) avoids wavelength drift caused by continuous operation of the light source, reducing detection power consumption. Increasing the driving frequency of the light source suppresses low-frequency noise through high-frequency modulation, accelerating the sensor's detection response speed. Decreasing the target sampling frequency (i.e., the sampling frequency of the detector's output signal) reduces the data processing load; increasing the sampling frequency of the detector's output signal improves dynamic response accuracy and anomaly detection speed.
[0091] Depending on the type of gas, the adjustment direction of the driving frequency of the light source and the output signal of the detector will differ when the gas concentration is greater than or less than the preset concentration threshold.
[0092] For example, if the detected gas is carbon dioxide and its concentration is greater than a preset concentration threshold, the driving frequency of the light source and the sampling frequency of the detector's output signal are reduced. If the detected gas is methane and its concentration is greater than a preset concentration threshold, the driving frequency of the light source and the sampling frequency of the detector's output signal are increased.
[0093] In this embodiment, the driving frequency and sampling frequency are dynamically adjusted by calculating the difference between the gas concentration and the preset concentration threshold based on the gas concentration change characteristics in the current scenario. This allows for the reasonable allocation of detection resources according to the actual needs of gas detection while ensuring detection accuracy. This significantly improves the sensitivity and response speed of gas detection, effectively avoids detection lag or misjudgment caused by fixed frequency settings, reduces unnecessary energy consumption, and achieves efficient and energy-saving operation of the gas detection system.
[0094] In some implementations, adjusting the target driving frequency and target sampling frequency based on the concentration difference between the gas concentration and a preset concentration threshold includes: determining a frequency group corresponding to the concentration difference and the gas type; wherein the frequency group includes a driving frequency and a sampling frequency; adjusting the target driving frequency to the driving frequency in the frequency group; and adjusting the target sampling frequency to the sampling frequency in the frequency group.
[0095] The concentration difference and gas type are mapped to frequency groups. By using the concentration difference and gas type as the basis, frequency groups containing preset driving and sampling frequencies can be selected from the preset frequency mapping table, and the driving and sampling frequencies can be adjusted.
[0096] The preset frequency mapping table includes gas type, concentration difference range, driving frequency and sampling frequency combination, as well as the mapping relationship between each gas type and its corresponding concentration difference range and the corresponding driving frequency and sampling frequency combination.
[0097] For example, the construction method of the preset frequency mapping table includes: for different gas types, through a large number of experiments, obtaining the optimal combination of light source driving frequency and detector sampling frequency under different gas concentration conditions that can achieve the best comprehensive indicators such as detection accuracy, response speed, and power consumption (for example, for carbon dioxide gas, under low concentration and slow concentration change conditions, an experimental combination of driving frequency and sampling frequency is determined to ensure a certain detection accuracy while having low power consumption; under high concentration and rapid concentration change conditions, another combination of driving frequency and sampling frequency that can quickly detect and respond while maintaining high accuracy is determined). Then, according to the optimal frequency combination corresponding to various concentration conditions of different gas types, the table is classified and organized according to gas type and concentration difference (the concentration difference can be divided by setting different concentration ranges) to form the preset frequency mapping table.
[0098] In related technologies, NDIR sensors drive the light source and sample data at a fixed frequency after being powered on. However, they have technical drawbacks such as difficulty in adapting to dynamic changes in gas concentration under complex scenarios and high power consumption.
[0099] In this embodiment, taking into account the inherent characteristics of gas absorption of infrared light and the dynamic changes in gas concentration, the driving frequency of the light source and the sampling frequency of the detector output signal are precisely adjusted based on the concentration difference between the gas type, gas concentration and preset concentration threshold. This enables the NDIR sensor to flexibly adapt to different gas types and dynamic changes in gas concentration under complex scenarios, effectively reducing sensor power consumption and extending its service life while ensuring detection performance.
[0100] In some embodiments, adjusting the target driving frequency and target sampling frequency based on the concentration difference between the gas concentration and a preset concentration threshold further includes controlling the NDIR sensor to perform gas detection using a default light source driving frequency and a default sampling frequency. When the detected gas concentration is greater than the preset threshold, the driving frequency and sampling frequency are increased. Otherwise, gas detection continues using the default light source driving frequency and default sampling frequency. During the dynamic adjustment process, the duty cycle of the driving PWM is simultaneously adjusted to ensure that the driving time of a single light source remains constant.
[0101] The default light source driving frequency and default sampling frequency are set in advance based on the specific requirements for detection accuracy, response speed and power consumption in the gas detection application scenario of the NDIR sensor, combined with the experience in actual application, and the values are relatively low.
[0102] Duty cycle is used to control the average power of a light source over one cycle. The duty cycle can be selected from a preset duty cycle range based on the characteristics of the light source. The preset duty cycle range can be determined in advance based on the light source's current-intensity characteristic curve, thermal stability, and optimal efficiency range. For example, the preset duty cycle range can be set to 10%-50%.
[0103] During the dynamic adjustment of the driving frequency, the duty cycle needs to be adjusted synchronously to ensure that the driving time of a single light source remains unchanged.
[0104] For example, the duty cycle synchronization adjustment is implemented as follows: when the driving frequency changes from... Adjusted to The duty cycle is adjusted according to the following formula: ; in, This is expressed as the duty cycle after synchronous adjustment; This represents the duty cycle before synchronization adjustment.
[0105] By inversely adjusting the duty cycle and driving frequency, the pulse width of the light source can be kept constant, avoiding light intensity fluctuations caused by changes in the driving frequency of the light source, which would affect the detection accuracy.
[0106] In this embodiment, by setting a default light source driving frequency and a default sampling frequency when the detected gas concentration does not exceed the threshold, the detection frequency and system power consumption can be reduced without changing the illumination time of the light source in a single detection. When the detected gas concentration exceeds the threshold, i.e., when the concentration condition is initially abnormal, increasing the driving frequency and sampling frequency can improve the sensor's response speed, enabling faster and more effective detection and early detection of abnormalities.
[0107] In some embodiments, based on the type of gas to be detected, the filter module is controlled to switch to a filter corresponding to the type of gas, so that the frequency of the infrared light emitted by the infrared light source after passing through the filter matches the type of gas.
[0108] The gases to be detected include, but are not limited to, carbon dioxide, carbon monoxide, methane, and sulfur hexafluoride.
[0109] In this embodiment, by sharing all structural components except the filter, and using only electronically controlled switching of the filter corresponding to the current gas type to achieve multi-gas detection, the cost of using an NDIR sensor for multi-gas detection can be effectively reduced.
[0110] like Figure 5 As shown, Figure 5 This is a flowchart illustrating another gas detection method provided in an embodiment of this application. The detection method is applied to the aforementioned NDIR gas detection system 101 and includes: Step 501: The host 102 controls the filter module 110 to switch to the filter of the corresponding filter band according to the type of gas to be detected.
[0111] When multiple gas detectors are configured, the host 102 can detect multiple gases sequentially.
[0112] Step 502: The host 102 controls the light source 109 according to the driving frequency and duty cycle through the light source driving module 105.
[0113] Step 503: After a preset delay, the host 102 collects N sets of infrared detector data according to the sampling frequency through the signal acquisition and processing module 107.
[0114] Step 504: The host 102 obtains the air pressure monitored by the air pressure monitoring module 108 through a specific communication method, and collects the data of the NTC thermistor 113 to calculate the temperature.
[0115] Step 505: The host 102 calculates the amplitude at the driving frequency through Fourier transform, and inputs the amplitude, air pressure and current temperature into the concentration generation model to calculate the current gas concentration.
[0116] In some embodiments, step 505 specifically includes: performing a Fourier transform on the collected N sets of infrared detector data to extract the amplitude corresponding to the driving frequency. The gas concentration is obtained by substituting the gas pressure detected by the gas pressure monitoring module 108, the temperature data calculated based on the data collected by the NTC thermistor 113 in the NDIR sensor 103, and the amplitude into the concentration generation model.
[0117] For example, N can be a power of 2. For instance, N can be 256.
[0118] In this embodiment, by sharing all structural components except the filter and using only electrically controlled filter switching to detect multiple gases, the cost of using an NDIR sensor for multi-gas detection can be effectively reduced. Utilizing Fourier transform to accurately extract the amplitude of the light source driving frequency as a concentration calculation parameter can effectively suppress environmental noise, power frequency interference, and aliasing effects of non-target frequency signals, thus improving the sensor's measurement accuracy. By introducing machine learning algorithms and combining amplitude... air pressure Temperature co-modeling can leverage the nonlinear fitting and generalization characteristics of machine learning algorithms to achieve high-precision gas concentration prediction in complex environments, while enabling sensors to adapt to extreme scenarios such as high and low temperatures and high and low pressures, thus avoiding interference from extreme environments on sensor detection accuracy.
[0119] like Figure 6 As shown, Figure 6 This is a flowchart illustrating a frequency dynamic adjustment method provided in an embodiment of this application. The adjustment method includes: Step 601: The host 102 moves according to the predetermined planned path. During the movement, the default drive frequency is maintained. Duty cycle D and default sampling frequency .
[0120] The predetermined planned path is the movement path pre-set by the host to fully cover the gas detection area.
[0121] Step 602: When the gas concentration is detected to be greater than the first preset threshold, increase the driving frequency and sampling frequency, and adjust the duty cycle accordingly.
[0122] The first preset threshold can be the sum of the preset threshold and the concentration margin.
[0123] For example, default drive frequency Set to 0.5Hz, default sampling frequency Set as N, i.e., 128 Hz, and the duty cycle D is set to 25%; when the current gas concentration is detected to be greater than the first preset threshold, the driving frequency is increased to 1 Hz, and the sampling frequency is increased to... 2N, which is 512Hz, corresponds to a duty cycle D that is adjusted to 50%.
[0124] Step 603: When the gas concentration C is detected to be less than the second preset threshold, the driving frequency and sampling frequency are adjusted to the default driving frequency. and default sampling frequency .
[0125] The second preset threshold can be the difference between the preset threshold and the concentration balance.
[0126] In this embodiment, when the detected gas concentration is less than a preset threshold, the default light source driving frequency and default sampling frequency are used. This reduces the detection frequency and system power consumption without changing the illumination time of the light source in a single detection. When the detected gas concentration exceeds the threshold, indicating an initial abnormality in the concentration condition, the driving frequency and sampling frequency are increased to improve the sensor's response speed, enabling faster and more effective detection and early discovery of abnormalities.
[0127] In implementing the functions of the integrated modules described above using hardware, this embodiment of the invention provides a possible structural schematic diagram of the gas detection device involved in the above embodiments. For example... Figure 7 As shown, the gas detection device 700 includes: a processor 702, a communication interface 703, and a bus 704. Optionally, the gas detection device 700 may also include a memory 701.
[0128] Processor 702 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 702 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 702 may also be a combination that implements computing functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0129] The communication interface 703 is used to connect to other devices via a communication network. This communication network can be Ethernet, wireless access network, wireless local area network (WLAN), etc.
[0130] The memory 701 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0131] In one possible implementation, the memory 701 can exist independently of the processor 702. The memory 701 can be connected to the processor 702 via a bus 704 and is used to store instructions or program code. When the processor 702 calls and executes the instructions or program code stored in the memory 701, it can implement the gas detection method provided in this embodiment of the invention.
[0132] In another possible implementation, the memory 701 can also be integrated with the processor 702.
[0133] The 704 bus can be an extended industry standard architecture (EISA) bus, etc. The 704 bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0134] Through the above description of the implementation methods, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the service calling device can be divided into different functional modules to complete all or part of the functions described above.
[0135] This application also provides a computer-readable storage medium. All or part of the processes in the above method embodiments can be executed by computer instructions instructing related hardware. The program can be stored in the aforementioned computer-readable storage medium, and when executed, it can include the processes of the above method embodiments. The computer-readable storage medium can be any of the foregoing embodiments or memory. The aforementioned computer-readable storage medium can also be an external storage device of the aforementioned service invocation device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the aforementioned service invocation device. Further, the aforementioned computer-readable storage medium can include both internal storage units of the aforementioned service invocation device and external storage devices. The aforementioned computer-readable storage medium is used to store the aforementioned computer program and other programs and data required by the aforementioned service invocation device. The aforementioned computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0136] This application also provides a computer program product comprising a computer program that, when run on a computer, causes the computer to execute any of the gas detection methods provided in the above embodiments.
[0137] In the description of the embodiments of this application, specific features, structures, materials or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0138] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A gas detection method, characterized in that, include: Control the infrared light source to operate according to the target driving frequency, and acquire the detection signal of the detector of the infrared light source; Perform a Fourier transform on the detected signal to obtain a frequency domain signal; The amplitude is determined based on the frequency domain signal and the target driving frequency; Based on the amplitude, the gas concentration is determined; the amplitude is used to characterize the intensity of the infrared light absorbed by the gas.
2. The gas detection method according to claim 1, characterized in that, The method of determining the gas concentration based on the amplitude also includes: The gas concentration is determined based on the amplitude and environmental information; wherein the environmental information includes air pressure and / or temperature.
3. The gas detection method according to claim 2, characterized in that, Determining the gas concentration based on the amplitude and environmental information includes: Determine the concentration generation model corresponding to the target driving frequency and the target sampling frequency; wherein, the target sampling frequency is the frequency at which the output signal of the detector is acquired; The amplitude and environmental information are input into the concentration generation model to obtain the gas concentration.
4. The gas detection method according to any one of claims 1-3, characterized in that, The method further includes: Based on the gas concentration, the target driving frequency and the target sampling frequency are adjusted.
5. The gas detection method according to claim 4, characterized in that, The step of adjusting the target driving frequency and the target sampling frequency based on the gas concentration includes: Based on the concentration difference between the gas concentration and the preset concentration threshold, the target driving frequency and the target sampling frequency are adjusted.
6. The gas detection method according to claim 5, characterized in that, Adjusting the target driving frequency and the target sampling frequency based on the concentration difference between the gas concentration and a preset concentration threshold includes: Determine the frequency group corresponding to the concentration difference and gas type; wherein, the frequency group includes the driving frequency and the sampling frequency; Adjust the target driving frequency to the driving frequency in the frequency group; Adjust the target sampling frequency to the sampling frequency in the frequency group.
7. The method according to claim 1, characterized in that, The method further includes: Based on the type of gas to be detected, the control filter module switches to a filter corresponding to the type of gas, so that the frequency of the infrared light emitted by the infrared light source after passing through the filter matches the type of gas.
8. A gas detection device, characterized in that, It includes a processor and a memory, the processor being connected to the memory, the memory storing computer instructions that, when executed on the gas detection device, cause the gas detection device to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-7.
10. A computer program product, the computer program product comprising instructions, characterized in that, When the instructions are executed on a computer, the computer performs the method as described in any one of claims 1-7.