Gas detection method and system based on quartz tuning fork enhanced optoacoustic spectrum
By constructing a gas detection method based on quartz tuning fork-enhanced photoacoustic spectrum, and through dynamic segmentation processing and feature vector generation, the reliability issues of signal recognition and leak tracing in dynamic gas concentration fields are solved, achieving efficient gas detection and leak identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAQING HUISHANG (BEIJING) TECH CO LTD
- Filing Date
- 2026-01-09
- Publication Date
- 2026-06-09
Smart Images

Figure CN121558634B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gas sensing and detection technology, specifically to a gas detection method and system based on quartz tuning fork enhanced photoacoustic spectrum. Background Technology
[0002] Quartz-enhanced photoacoustic spectroscopy detects gas concentration by probing the vibration response of a quartz tuning fork. Current techniques typically acquire signals within a fixed time window and extract the amplitude or Q value at the tuning fork's resonant frequency as a concentration indicator. This method is based on a static assumption that the gas concentration remains stable during the detection period. However, in actual industrial leak monitoring or environmental trace gas analysis, the gas concentration field exhibits dynamic characteristics, with various complex situations including background fluctuations, instantaneous leaks, or rapid concentration changes caused by airflow.
[0003] Fixed-time-window analysis is ill-suited to adapting to dynamic concentration changes. When concentration is stable, short time windows limit the improvement of signal-to-noise ratio; when concentration changes abruptly, long time windows lead to signal aliasing, distorted measurement results, and an inability to accurately reflect transient processes. Furthermore, existing technologies rely on preset fixed thresholds to detect anomalies, lacking adaptability to changes in environmental and system noise. This static judgment method is prone to false alarms due to environmental drift in complex environments, or missed alarms due to sudden interference, severely impacting detection reliability.
[0004] Existing technologies cannot intelligently identify effective stable concentration ranges from continuous dynamic signals, nor can they extract richer features to support accurate leak identification and source tracing. This constitutes the core problem that this invention needs to solve: how to develop a new gas detection method that can adapt to dynamic concentration fields, intelligently identify effective signals, and support accurate source tracing. Summary of the Invention
[0005] The purpose of this invention is to provide a gas detection method and system based on quartz tuning fork enhanced photoacoustic spectrum to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides a gas detection method based on quartz tuning fork enhanced photoacoustic spectroscopy, the method comprising:
[0007] Construct a standardized tuning fork signal data stream containing temporal vibration response and synchronous laser modulation information, continuously acquired from a quartz tuning fork;
[0008] The standardized tuning fork signal data stream is dynamically segmented based on gas concentration ranges, and time-domain waveform features and frequency-domain spectral features are extracted in parallel within each segment to form an initial feature vector;
[0009] The anomaly detection threshold for identifying sudden changes in concentration state is dynamically adjusted based on the jump amplitude of the initial feature vector between adjacent segments.
[0010] The standardized tuning fork signal data stream is scanned using the adjusted anomaly detection threshold, and data segments in a stable concentration state are selected and marked as valid analysis intervals.
[0011] Based on the inherent mechanical properties of the quartz tuning fork and the laser parameters, cross-domain coupling compensation is performed on the initial feature vector within the effective analysis interval to generate an enhanced feature vector;
[0012] Based on the enhanced feature vector, reverse source tracing reasoning is performed in the preset gas leak propagation model, and the location identifier and detection sequence of the potential leak source are output.
[0013] Preferably, constructing a standardized tuning fork signal data stream containing time-series vibration response and synchronous laser modulation information continuously acquired from a quartz tuning fork includes: synchronously recording the vibration voltage signal of the quartz tuning fork and the modulation current signal driving the laser, and aligning the two signals according to a global clock; applying a bandpass filter based on the tuning fork resonance frequency to the aligned vibration voltage signal, and smoothing the modulation current signal to eliminate high-frequency glitches; interpolating and resampling the filtered vibration voltage signal and modulation current signal according to a unified time base axis to generate the standardized tuning fork signal data stream with a fixed sampling interval.
[0014] Preferably, the standardized tuning fork signal data stream is dynamically segmented based on gas concentration intervals, and time-domain waveform features and frequency-domain spectral features are extracted in parallel within each segment to form an initial feature vector. This includes: dividing the standardized tuning fork signal data stream into multiple data segments corresponding to gas concentration intervals based on real-time calculated gas concentration values; within each data segment, extracting time-domain waveform features, including peak amplitude, zero-crossing rate, and waveform factor, from the vibration voltage signal, and extracting frequency-domain spectral features, including main resonance peak frequency, spectral centroid, and harmonic component energy ratio, from the frequency-domain spectral lines; and combining the time-domain waveform features and frequency-domain spectral features extracted within the same data segment into the initial feature vector, thereby obtaining multiple gas concentration feature vectors.
[0015] Preferably, the anomaly detection threshold for identifying sudden changes in concentration state is dynamically adjusted based on the jump amplitude of the initial feature vector between adjacent segments, including: calculating the Euclidean distance in the feature space of the gas concentration feature vectors corresponding to adjacent data segments as the jump amplitude; statistically analyzing the historical distribution of the jump amplitude within a sliding time window and taking its higher percentile as a benchmark threshold; and dynamically adjusting the specific value of the anomaly detection threshold by linear scaling based on the deviation of the jump amplitude from the benchmark threshold at the current moment.
[0016] Preferably, the standardized tuning fork signal data stream is scanned using the adjusted anomaly detection threshold to filter out data segments in a stable concentration state and mark them as valid analysis intervals. This includes: using the adjusted anomaly detection threshold to sequentially determine the jump amplitude between each data segment and the previous data segment; if the jump amplitude is less than the anomaly detection threshold, the current data segment is determined to be in a stable concentration state and added to the candidate set; and consecutive data segments in the candidate set are merged to form the valid analysis interval with a longer time span.
[0017] Preferably, based on the inherent mechanical properties of the quartz tuning fork and the laser parameters, cross-domain coupling compensation is performed on the initial feature vector within the effective analysis interval to generate an enhanced feature vector, including: obtaining the inherent mechanical properties of the quartz tuning fork, including the quality factor and effective mass, and the laser parameters, including wavelength and beam focus size;
[0018] Establish the correlation between the inherent mechanical properties and the frequency domain spectral features in the initial feature vector, and perform temperature drift compensation for the main resonance peak frequency; establish the correlation between the laser parameters and the time domain waveform features in the initial feature vector, and perform optical path loss compensation for the peak amplitude; recombine the compensated frequency domain spectral features and time domain waveform features to generate the enhanced feature vector.
[0019] Preferably, establishing the correlation between the inherent mechanical properties and the frequency domain spectral characteristics of the initial feature vector, and performing temperature drift compensation for the main resonance peak frequency, includes: based on the theoretical relationship between the quality factor and the resonance peak width, back-calculating the actual quality factor of the current tuning fork from the measured spectral peak width; using the difference between the actual quality factor and the standard quality factor, combined with the temperature frequency coefficient of the tuning fork material, calculating the temperature drift compensation amount of the main resonance peak frequency and applying the compensation.
[0020] Preferably, establishing the correlation between the laser parameters and the temporal waveform features in the initial feature vector, and performing optical path loss compensation for the peak amplitude, includes: calculating the effective coupling efficiency of the laser energy on the tuning fork based on the matching degree between the beam focal point size and the tuning fork interdigitation gap; and using the ratio of the effective coupling efficiency to the ideal coupling efficiency, combined with the gas absorption cross section corresponding to the laser wavelength, calculating the optical path loss compensation coefficient of the peak amplitude and applying compensation.
[0021] Preferably, the process involves performing reverse source tracing reasoning based on the enhanced feature vector within a preset gas leak propagation model, outputting location identifiers and detection sequences for potential leak sources. This includes: loading the gas leak propagation model, which includes a pipeline network topology and the gas diffusion time relationships between nodes; mapping the enhanced feature vector to anomaly intensity values of specific nodes in the gas leak propagation model; starting from the node with the highest anomaly intensity value, traversing the pipeline network topology in the opposite direction of gas diffusion, and calculating the cumulative anomaly probability of each upstream node; and sorting the upstream nodes according to the cumulative anomaly probability to generate the detection sequence containing location identifiers.
[0022] The process of constructing the gas leak propagation model includes: obtaining a digital map of the pipeline network in the target monitoring area through a geographic information system, analyzing the coordinates and connections of pipeline nodes to generate a topology map; marking historical leak event records on the topology map, and measuring the actual length and diameter of the pipelines between each point; calculating the time delay distribution curve of gas propagation from the leak point to the detection point based on the gas diffusion equation and combined with environmental wind speed and temperature gradient parameters; collecting actual leak data through field experiments, and calibrating the parameters of the time delay distribution curve using the least squares method; and merging the calibrated time delay distribution curve with the topology map to generate the gas leak propagation model.
[0023] Preferably, the present invention also includes a gas detection system based on quartz tuning fork enhanced photoacoustic spectroscopy, the system including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, it implements the steps of the gas detection method based on quartz tuning fork enhanced photoacoustic spectroscopy as described above.
[0024] Compared with the prior art, the beneficial effects of the present invention are:
[0025] This method employs dynamic segmentation of continuous data streams based on gas concentration variation trends, replacing the traditional fixed-duration analysis approach. It adaptively divides data into segments according to the actual rhythm of concentration changes, extending segments during periods of stable concentration to improve the signal-to-noise ratio and shortening segments during periods of rapid concentration change to capture transient features. Within each segment, time-domain and frequency-domain features are extracted simultaneously to construct a multi-dimensional feature vector. This approach overcomes the limitations of solely relying on frequency domain amplitude, enabling a more complete characterization of the vibrational characteristics of tuning forks under different concentration conditions. Dynamic segmentation allows for better matching of data analysis units with gas physical processes, avoiding information confusion or loss caused by fixed windows in dynamic scenarios.
[0026] By calculating the difference in feature vectors between adjacent segments, the anomaly detection threshold is adaptively adjusted, achieving dynamic optimization of the judgment criteria. This mechanism automatically adjusts the discrimination sensitivity based on the short-term change characteristics of the signal: when features are stable, the tolerance is relaxed to suppress fluctuation interference; when features change abruptly, the sensitivity is increased to capture state transitions. This dynamic threshold strategy effectively distinguishes between real concentration changes and random interference, reduces dependence on preset thresholds, enhances the system's anti-interference capability and reliability in complex environments, and thus more accurately selects high-quality data intervals representing stable states. Attached Figure Description
[0027] Figure 1 This is a schematic diagram illustrating the working principle of the gas detection method based on quartz tuning fork enhanced photoacoustic spectrum as described in this invention.
[0028] Figure 2 A flowchart for constructing a standardized tuning fork signal data stream;
[0029] Figure 3 A flowchart for dynamically adjusting the anomaly detection threshold;
[0030] Figure 4 This is a graph showing the relationship between the amplitude of feature vector jumps and dynamic threshold adjustment.
[0031] Figure 5 Comparison chart of the calibration effect of the leakage propagation model. Detailed Implementation
[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0033] Please see Figure 1This invention provides a gas detection method based on enhanced photoacoustic spectroscopy using a quartz tuning fork. The method includes: constructing a standardized tuning fork signal data stream continuously acquired from a quartz tuning fork, the data stream containing temporal vibration response and synchronous laser modulation information; then dynamically segmenting the standardized tuning fork signal data stream based on gas concentration ranges, and extracting time-domain waveform features and frequency-domain spectral features in parallel within each segment to form an initial feature vector; then dynamically adjusting the anomaly detection threshold for identifying abrupt changes in concentration state based on the jump amplitude of the initial feature vector between adjacent segments; scanning the standardized tuning fork signal data stream using the adjusted anomaly detection threshold, filtering out data segments in a stable concentration state and marking them as valid analysis intervals; performing cross-domain coupling compensation on the initial feature vectors within the valid analysis intervals based on the inherent mechanical properties of the quartz tuning fork and laser parameters to generate enhanced feature vectors; finally, performing reverse source tracing inference based on the enhanced feature vectors in a preset gas leakage propagation model, outputting the location identifier and detection sequence for potential leakage sources.
[0034] Example 1: See Figure 2 In practice, the process of constructing a standardized tuning fork signal data stream begins with synchronous signal acquisition. A multi-channel synchronous acquisition card is used to simultaneously record the vibration voltage signal of the quartz tuning fork and the modulation current signal driving the laser. The multi-channel synchronous acquisition card is equipped with a high-precision global clock source, such as a temperature-controlled crystal oscillator, to provide a unified time reference for all input channels. The vibration voltage signal comes from the output of a preamplifier connected across the electrodes of the quartz tuning fork, and the modulation current signal comes from the current monitoring output of the laser driver module. Synchronous recording ensures that the two signals are strictly aligned in the time dimension, eliminating time delay errors introduced by different acquisition paths. In practice, a bandpass filter based on the tuning fork's resonant frequency is applied to the aligned vibration voltage signal. The bandpass filter is implemented using a digital infinite impulse response filter, and its center frequency is strictly set to the nominal resonant frequency of the quartz tuning fork, typically 32768 Hz. The bandwidth of the bandpass filter is configured according to the actual quality factor of the quartz tuning fork, typically set to one to five percent of the resonant frequency, to effectively preserve the fundamental frequency vibration component excited by the photoacoustic effect while suppressing environmental noise and circuit thermal noise.
[0035] In practice, the filtered vibration voltage signal and modulation current signal are interpolated and resampled along a unified time axis to generate a standardized tuning fork signal data stream with a fixed sampling interval. The unified time axis is referenced to the system master clock, and the time interval is set to the order of microseconds. The interpolation and resampling algorithm uses the cubic spline interpolation method, which ensures the smoothness and continuity of the signal waveform. The interpolation process first normalizes the timestamps of the vibration voltage signal and modulation current signal, and then calculates the signal amplitude at each equally spaced time point. The fixed sampling interval of the standardized tuning fork signal data stream is determined according to the Nyquist sampling theorem and must be greater than twice the highest frequency component of the signal. The final standardized tuning fork signal data stream is stored in a two-dimensional array format, with each row of the array containing the timestamp, vibration voltage value, and modulation current value.
[0036] In practice, the standardized tuning fork signal data stream is divided into data segments corresponding to multiple gas concentration ranges based on the real-time calculated gas concentration values. The real-time calculation of gas concentration values is accomplished by querying a pre-established concentration-voltage calibration curve, which is obtained through calibration experiments under standard gas concentration conditions. The boundaries of the gas concentration ranges are dynamically set according to the needs of the detection task, for example, dividing the concentration range into multiple ranges such as 0-10ppm, 10-50ppm, and 50-100ppm. The length of the data segment is related to the concentration stability; when the concentration value remains within the same range, the segment length gradually increases; when the concentration value crosses the range boundary, the current segment is immediately terminated and a new segment is generated. Each data segment contains a fixed number of data points, and the minimum segment length is one complete signal cycle, approximately 30.5 microseconds corresponding to 32768 Hz.
[0037] In practical implementation, time-domain waveform features, including peak amplitude, zero-crossing rate, and waveform factor, are extracted from the vibration voltage signal within each data segment. Peak amplitude extraction is achieved by searching for the maximum absolute voltage value of all sampling points within the segment, which directly reflects the intensity level of the photoacoustic signal. Zero-crossing rate calculation is performed by counting the number of times the signal crosses the zero-voltage point within the segment and normalizing the number by dividing by the segment time length; the zero-crossing rate feature characterizes the frequency of signal oscillation. Waveform factor calculation is performed by first calculating the root mean square value of the signal segment and then dividing it by the absolute average value of the signal segment; the waveform factor is a dimensionless parameter describing the shape of the signal waveform. Frequency-domain spectral features, including the main resonance peak frequency, spectral centroid, and harmonic component energy ratio, are extracted from the frequency-domain spectral lines within each data segment. The frequency-domain spectral lines are obtained by performing a Fast Fourier Transform on the vibration voltage signal within the data segment, with the number of transform points set to 1024, and a Hanning window is applied to reduce spectral leakage. The main resonance peak frequency is determined as the frequency value corresponding to the point with the maximum amplitude in the spectrum, which reflects the actual resonance state of the quartz tuning fork. The centroid of the spectrum is calculated by multiplying each frequency point of the spectrum by its corresponding amplitude value, summing the results, and then dividing by the sum of the amplitude values. The centroid of the spectrum represents the center of the frequency distribution of the signal energy. The harmonic component energy ratio is calculated by integrating the energy values in a narrow band near the fundamental frequency, then integrating the energy values in a narrow band near the second harmonic frequency, and finally calculating the ratio of the second harmonic energy to the fundamental energy. This ratio reflects the nonlinear characteristics of the system.
[0038] In practice, time-domain waveform features and frequency-domain spectral features extracted from the same data segment are combined into an initial feature vector. The time-domain waveform features include three components: peak amplitude, zero-crossing rate, and waveform factor. The frequency-domain spectral features include three components: main resonance frequency, spectral centroid, and harmonic component energy ratio. The initial feature vector is a six-dimensional vector, with a fixed order of components, for example, peak amplitude, zero-crossing rate, waveform factor, main resonance frequency, spectral centroid, and harmonic component energy ratio. Each feature component is normalized before combination to ensure its value is between 0 and 1. The normalization method uses a min-max scaling algorithm, with scaling parameters derived from the training dataset. After generation, the initial feature vector is stored in a structured data format along with the timestamps and concentration interval labels of the corresponding data segments.
[0039] In practice, multiple gas concentration feature vectors are generated by repeatedly performing feature extraction and combination operations on continuous data segments. Each data segment corresponds to a gas concentration feature vector, and the vector sequence is continuous in time. The gas concentration feature vectors are arranged in chronological order to form a feature vector sequence, with the sequence index consistent with the data segment index. The gas concentration feature vectors are stored in a two-dimensional matrix, where the rows correspond to time points and the columns correspond to feature dimensions. Optionally, a sliding window averaging process can be applied to the gas concentration feature vector sequence to smooth random fluctuations. Optionally, a differencing operation can be performed on the gas concentration feature vector sequence to highlight the trend of feature changes. The final set of gas concentration feature vectors serves as input data for subsequent dynamic threshold adjustment and effective interval selection.
[0040] Example 2: See Figure 3 In practical implementation, the process of dynamically adjusting the anomaly detection threshold and screening effective analysis intervals is based on a continuous sequence of gas concentration feature vectors. This sequence is generated by the method described in Example 1, with each gas concentration feature vector corresponding to a data segment. The Euclidean distance between the gas concentration feature vectors corresponding to adjacent data segments in the feature space is calculated as the jump amplitude. The feature space consists of six dimensions of the gas concentration feature vectors, including peak amplitude, zero-crossing rate, waveform factor, main resonance frequency, spectral centroid, and harmonic component energy ratio. The formula for calculating the Euclidean distance is:
[0041] ;
[0042] in: Indicates the magnitude of the jump. Indicates the first The first data segment Each feature component value, Indicates the first The first data segment Each characteristic component value, summation range arrive This corresponds to the six dimensions of the gas concentration feature vector. When calculating the Euclidean distance, each feature component has been normalized to ensure dimensional consistency. In practice, the historical distribution of jump amplitudes within a sliding time window is statistically analyzed. The sliding time window size is set to include the most recent 100 data segments, corresponding to approximately several seconds of real-time data stream. The historical distribution is represented by a probability density function of the jump amplitude, and the data is smoothed using kernel density estimation. Then, the 95th percentile is used as the baseline threshold. The baseline threshold represents the typical high level of historical jump amplitudes and is used to identify anomalous changes. Based on the deviation of the current jump amplitude from the baseline threshold, the specific value of the anomaly judgment threshold is dynamically adjusted using a linear scaling method. The deviation is calculated as the ratio of the current jump amplitude to the baseline threshold. If the ratio is greater than 1, the anomaly judgment threshold is increased proportionally; if the ratio is less than 1, the anomaly judgment threshold is decreased. The adjustment formula is:
[0043] ;
[0044] in: This indicates the adjusted anomaly detection threshold. Indicates the baseline threshold. Indicates the current jump magnitude. This represents the scaling factor, which takes a value of 0.1 and is used to control the adjustment range. Linear scaling ensures that the anomaly detection threshold adapts to the dynamic changes in the data stream, reducing false alarms.
[0045] In practice, the standardized tuning fork signal data stream is scanned using an adjusted anomaly detection threshold. The standardized tuning fork signal data stream is divided into continuous data segments in chronological order. The scanning process starts with the first data segment, sequentially calculating the jump amplitude between each data segment and the previous data segment, and comparing the jump amplitude with the adjusted anomaly detection threshold. If the jump amplitude is less than the anomaly detection threshold, the current data segment is determined to be in a stable concentration state and added to the candidate set. The candidate set records the start and end timestamps of the data segment. If the jump amplitude is greater than or equal to the anomaly detection threshold, the current data segment is skipped, and the scanning continues with subsequent segments. The scanning process uses real-time streaming processing; a comparison operation is performed immediately after each new data segment is generated to ensure low latency. The scanning process also uses batch processing, accumulating a certain number of data segments before processing them uniformly to improve computational efficiency. A merging operation is performed on continuous data segments in the candidate set. The merging operation checks the continuity of the segment timestamps in the candidate set; if the timestamp interval between adjacent segments is less than a preset threshold, they are merged into a single valid analysis interval. The merged effective analysis interval records the start time, end time, and indexes of all included data segments, forming an analysis unit with a longer time span.
[0046] It is understandable that by dynamically adjusting the anomaly detection threshold, this method can adapt to concentration fluctuations under different environments and improve the robustness of steady-state detection. The entire implementation process is based on a specific example. For instance, assuming a sequence of jump amplitudes in a continuous data segment is [0.05, 0.12, 0.08, 0.15, 0.03, 0.09], the 95th percentile of the historical distribution within the sliding window is 0.10, and the current jump amplitude is 0.03, then the deviation is 0.3, and the adjusted anomaly detection threshold is... Since 0.03 < 0.093, the corresponding data segments are added to the candidate set and eventually merged to form the effective analysis interval.
[0047] Example 3: In specific implementation, the process of cross-domain coupling compensation of the initial eigenvector within the effective analysis range based on the inherent mechanical properties of the quartz tuning fork and laser parameters begins with the acquisition of relevant physical parameters. The inherent mechanical properties of the quartz tuning fork include the quality factor and effective mass. These parameters are directly read from the product specifications or factory calibration certificate of the quartz tuning fork assembly. For example, the quality factor of a certain model of quartz tuning fork is specified as 10000, and the effective mass is specified as 0.1 mg. Laser parameters include wavelength and beam focal point size. The laser wavelength is obtained from the output parameters of the laser control software. For example, the wavelength of a distributed feedback laser is 1576 nm. The beam focal point size is measured in the actual optical path using a laser beam quality analyzer. For example, the measured value is 80 μm. The acquired parameter values are stored in the system configuration file in key-value pairs for use by the compensation algorithm. In practice, a correlation is established between the inherent mechanical properties and the frequency domain spectral characteristics of the initial eigenvector. Temperature drift compensation is then applied to the main resonance peak frequency. This correlation is based on the physical model of the quartz resonator. The quality factor and resonance peak width are inversely proportional, and the effective mass is related to the stability of the resonance frequency. The specific operation of temperature drift compensation is as follows: First, based on the theoretical relationship between the quality factor and the resonance peak width, the actual quality factor of the current tuning fork is deduced from the measured spectral peak width. Then, using the difference between the actual quality factor and the standard quality factor, combined with the inherent temperature frequency coefficient of the quartz crystal, the compensation amount for the main resonance peak frequency is calculated.
[0048] In practical implementation, a correlation is established between laser parameters and the temporal waveform characteristics in the initial feature vector. Optical path loss compensation is then applied to the peak amplitude. This correlation is based on a model of light and sound energy conversion in the photoacoustic effect. The laser wavelength determines the absorption intensity of a specific gas, and the size of the beam focal point affects the spatial distribution efficiency of energy in the sensitive region of the tuning fork. The specific operation of optical path loss compensation involves first calculating the effective coupling efficiency of laser energy on the tuning fork based on the matching degree between the beam focal point size and the gap between the quartz tuning fork fingers. The matching degree between the beam focal point size and the tuning fork finger gap is evaluated using a geometric optics model. The effective coupling efficiency is defined as the ratio of the actual laser power incident into the finger gap to the total power emitted by the laser. Then, using the ratio of the effective coupling efficiency to the ideal coupling efficiency, combined with the absorption cross-section data of the gas to be measured corresponding to the laser wavelength, the optical path loss compensation coefficient for the peak amplitude is calculated. The compensated peak amplitude value is obtained by multiplying the compensation coefficient by the original peak amplitude value in the initial feature vector. In some embodiments, the gas absorption cross-section data is obtained from authoritative sources such as the HITRAN spectral database and stored as a wavelength-absorption cross-section lookup table.
[0049] In practice, the compensated frequency-domain spectral features and time-domain waveform features are recombine to generate an enhanced feature vector. The compensated frequency-domain spectral features include the main resonance frequency after temperature drift compensation, the original spectral centroid, and the harmonic component energy ratio. The compensated time-domain waveform features include the peak amplitude after optical path loss compensation, the original zero-crossing rate, and the waveform factor. The recombination order remains consistent with the initial feature vector to ensure data structure uniformity. The enhanced feature vector is a six-dimensional vector containing more accurate feature information after physical mechanism correction. Optionally, before recombination, the compensated feature values can undergo another round of normalization to adapt their numerical range to the input requirements of subsequent inference algorithms. Metadata tags can be added to the enhanced feature vector to record the applied compensation type and parameter version.
[0050] Example 4: In specific implementation, temperature drift compensation is based on the physical characteristics of the quartz tuning fork resonator. According to the theoretical relationship between quality factor and resonance peak width, the actual quality factor of the tuning fork is inversely proportional to the measured peak width. The theoretical relationship is that the quality factor is inversely proportional to the resonance peak width, specifically, the quality factor equals the resonance frequency divided by the full width at half maximum (FWHM). The measured spectrum is obtained by performing a Fast Fourier Transform on the vibration voltage signal within the effective analysis interval. The peak width is obtained by finding the frequency points where the amplitude drops by 3 dB on both sides of the peak value and calculating the difference. The calculation process for the actual quality factor is as follows: first, the main resonance peak is accurately identified from the transformed spectrum; then, the FWHM of the main resonance peak is measured; finally, the nominal resonance frequency is divided by the measured FWHM value. For example, when the nominal resonance frequency is 32768 Hz and the measured FWHM is 2.5 Hz, the calculated actual quality factor is 13107.2. In practice, the difference between the actual quality factor and the standard quality factor, combined with the temperature frequency coefficient of the tuning fork material, is used to calculate and apply compensation for the temperature drift of the main resonance peak frequency. The standard quality factor is derived from the factory calibration value of the quartz tuning fork and stored in the device parameter file. The temperature frequency coefficient is an inherent material property of quartz crystal, with a typical value of 0.035 ppm / °C² for AT-cut quartz.
[0051] In practical implementation, optical path loss compensation is based on a geometric-optical coupling model of the laser and tuning fork. The effective coupling efficiency of the laser energy on the tuning fork is calculated based on the matching degree between the beam focal point size and the gap between the tuning fork fingers. The width of the tuning fork finger gap is a fixed known parameter, such as a common value of 300 micrometers. The matching degree is quantified by comparing the ratio of the beam focal point size to the finger gap. The effective coupling efficiency is defined as the proportion of the optical power actually acting on the sensitive area of the tuning fork to the total output optical power. The calculation process establishes a beam propagation model, considering the intensity distribution of the Gaussian beam and the geometric blocking effect of the finger gap. Refer to Table 1 for the numerical relationship of the effective coupling efficiency.
[0052] Table 1: Numerical Relationship of Effective Coupling Efficiency
[0053] ratio of beam focal point size to interdigital gap width Effective coupling efficiency η ≤0.5 0.95 0.5~0.8 0.85 0.8~1.0 0.70 1.0~1.2 0.50 >1.2 0.30
[0054] In practical implementation, the ratio of effective coupling efficiency to ideal coupling efficiency, combined with the gas absorption cross-section corresponding to the laser wavelength, is used to calculate the optical path loss compensation coefficient for the peak amplitude and apply compensation. The ideal coupling efficiency is set to 1, representing a perfect match. The gas absorption cross-section is retrieved from a standard spectral database; for example, for methane gas at a wavelength of 1576 nm, the absorption cross-section is 1.2 × 10⁻⁶. -2cm² / molecule. The compensation coefficient is calculated by multiplying the ratio of effective coupling efficiency to ideal coupling efficiency by a normalization factor for the gas absorption cross-section. The compensated peak amplitude is obtained by multiplying the original peak amplitude in the initial eigenvector by the compensation coefficient. The compensation calculation also introduces an attenuation factor related to the optical path length, which is determined through calibration measurements.
[0055] See Figure 4 During the threshold adjustment phase, the relationship between the eigenvector jump amplitude and the dynamic threshold is presented through quantified data from a sliding time window. Specifically, the eigenvector jump amplitude (red line) represents the Euclidean distance between the initial eigenvectors of adjacent data segments, the baseline threshold (blue line) is the higher-order percentile of the historical distribution of jump amplitudes within the sliding window, and the dynamically adjusted threshold (green line) is generated by linear scaling based on the deviation of the current jump amplitude from the baseline threshold. Abnormal jump points (red solid circles) are the points where the jump amplitude exceeds the dynamically adjusted threshold: for example, at windows 2 and 13, the eigenvector jump amplitude is significantly higher than the dynamic threshold for the same period and is marked as abnormal. During parameter configuration, the sliding time window covers continuous data segments, the percentile of the baseline threshold is selected to match the time scale of gas concentration changes, and the linear scaling coefficient for dynamic adjustment is calibrated based on the fluctuation range of historical jump amplitudes. This intuitively reflects the implementation process of "dynamically adjusting the anomaly judgment threshold based on the jump amplitude": by tracking the time-series changes of three types of data, stable concentration segments with jump amplitudes lower than the dynamic threshold can be screened out, providing a basis for determining the effective analysis interval in the future.
[0056] Example 5: In specific implementation, the process of reverse source tracing reasoning based on the enhanced feature vector in the preset gas leak propagation model begins with the loading operation of the gas leak propagation model, which is stored in the system memory as a graph structure data file. The loading process calls the graph database interface to read the pipeline network topology data. The topology data includes a set of nodes and a set of edges. Nodes represent pipeline connection points or detection points, and edges represent pipeline segments with associated connection relationships and gas diffusion time attributes. The gas leak propagation model also includes the gas diffusion time relationships between each node, which are stored in the form of an adjacency matrix. The matrix element values represent the time delay required for gas to diffuse from the source node to the target node. In specific implementation, the enhanced feature vector is mapped to the anomaly intensity value of a specific node in the gas leak propagation model. The mapping process is based on a pre-trained regression model. The input of the regression model is a six-dimensional enhanced feature vector, and the output is a real number between 0 and 1 representing the anomaly intensity. The regression model is trained using the support vector regression algorithm, and the training data comes from the enhanced feature vectors recorded in historical leak events and the labels of confirmed leak locations. For each detection node in the gas leak propagation model, the enhanced feature vector collected within the current time window is input into the regression model to calculate the anomaly intensity value corresponding to that node. The anomaly intensity value reflects the probability of a gas leak occurring or a leaking gas being detected at that node. In practice, starting from the node with the highest anomaly intensity value, the pipeline network topology is traversed in the opposite direction of gas diffusion. The traversal algorithm uses a breadth-first search strategy, starting from the initial node and sequentially visiting all its upstream neighboring nodes. For each visited upstream node, its cumulative anomaly probability is calculated. The formula for calculating the cumulative anomaly probability is:
[0057] ;
[0058] in: This represents the cumulative anomaly probability of the current upstream node. This represents the anomaly strength value of the starting node. This indicates the number of pipe segments traversed on the path from the starting node to the current upstream node. This represents the actual length of the i-th segment of the pipe. This represents the diffusion time coefficient of the gas in the i-th segment of the pipeline, and the product term characterizes the attenuation effect of the gas concentration along the propagation path. When calculating the cumulative anomaly probability, it is calculated independently for each possible tracing path. In a specific implementation, upstream nodes are sorted according to their cumulative anomaly probabilities, generating a detection sequence containing location identifiers. The sorting operation arranges all upstream nodes in descending order of their cumulative anomaly probabilities, forming a priority list. The location identifier uses a unique node number in the pipeline network. The output format of the detection sequence is a structured list, where each item contains a node identifier, a cumulative anomaly probability value, and path information from the starting node to that node. The detection sequence filters out nodes with cumulative anomaly probabilities below a set threshold to improve the significance of the results. In some embodiments, for nodes reached by multiple paths, the maximum cumulative anomaly probability is taken as the representative value for that node. The detection sequence can be appended with the geographic coordinates of each node for easy visualization on a digital map. The detection sequence can include timestamp information to record the time of the inference calculation.
[0059] In practical implementation, the construction process of the gas leak propagation model includes: acquiring digital drawings of the pipeline network in the target monitoring area through a Geographic Information System (GIS); the GIS provides an application programming interface (API) to access the CAD design files or GIS map data of the pipeline network; generating a topology diagram by parsing the coordinates and connections of pipeline nodes; identifying pipeline segments and connection points in the drawings using a parsing algorithm; abstracting pipeline segments as edges and connection points as nodes to construct a graph data structure; marking historical leak event records on the topology diagram, which are extracted from the operation and maintenance database and include the time, location coordinates, and severity of the leak; measuring the actual length and diameter of the pipeline between each point using coordinate distance calculation on the digital drawing; and obtaining the pipeline diameter from the drawing annotations or equipment ledger; and calculating the time delay distribution curve of gas propagation from the leak point to the detection point based on the gas diffusion equation and combined with environmental wind speed and temperature gradient parameters. The gas diffusion equation uses a Gaussian plume model, and environmental wind speed and temperature gradient are obtained from real-time data from the on-site meteorological station. The time delay distribution curve represents the functional relationship between gas concentration and time. Actual leakage data was collected through field experiments. The experiments used standard gas released at known locations, and the concentration response time at different detection points was recorded. The time-delay distribution curve was calibrated using the least squares method, which optimized the parameters in the diffusion model to achieve the best fit between the simulated curve and the experimental data. The calibrated time-delay distribution curve was then fused with a topological graph to generate a gas leakage propagation model. The fusion operation assigned the time-delay data as attributes to the edges in the graph structure.
[0060] See Figure 5In the parameter calibration process of the gas leakage propagation model, a comparison of the fitting effect between the model before and after calibration and the measured data is shown. With time (seconds) as the horizontal axis and gas concentration (normalized) as the vertical axis, the trends of the measured data (red scatter dots), the model before calibration (blue dashed line, average error 0.1291), the model after calibration (green solid line, average error 0.1049), and the confidence interval after calibration (light green filled area) are presented. Specifically, in the model construction stage, an initial model is generated based on the gas diffusion equation combined with environmental parameters. After collecting actual leakage data through field experiments, the model parameters are optimized and calibrated using the least squares method. Before calibration, the model deviated significantly from the measured data; after calibration, the model curve is closer to the measured data, the average error is reduced by approximately 18.7%, and the confidence interval covers most of the measured data points, demonstrating the improved accuracy and enhanced reliability of the model after calibration. In parameter configuration, the calibration process uses the least squares method to fit and optimize the time delay distribution curve to reduce the sum of squared residuals between the simulated and measured values.
[0061] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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 process, method, article, or apparatus.
[0062] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A gas detection method based on quartz tuning fork enhanced photoacoustic spectroscopy, characterized in that, The method includes: Construct a standardized tuning fork signal data stream containing temporal vibration response and synchronous laser modulation information, continuously acquired from a quartz tuning fork; The standardized tuning fork signal data stream is dynamically segmented based on gas concentration ranges, and time-domain waveform features and frequency-domain spectral features are extracted in parallel within each segment to form an initial feature vector; The anomaly detection threshold for identifying sudden changes in concentration state is dynamically adjusted based on the jump amplitude of the initial feature vector between adjacent segments, including: calculating the Euclidean distance in the feature space of the gas concentration feature vectors corresponding to adjacent data segments as the jump amplitude; statistically analyzing the historical distribution of the jump amplitude within a sliding time window and taking its higher percentile as a benchmark threshold; and dynamically adjusting the specific value of the anomaly detection threshold by linear scaling based on the deviation of the jump amplitude from the benchmark threshold at the current moment. The standardized tuning fork signal data stream is scanned using the adjusted anomaly detection threshold, and data segments in a stable concentration state are selected and marked as valid analysis intervals. Based on the inherent mechanical properties of the quartz tuning fork and the laser parameters, cross-domain coupling compensation is performed on the initial feature vector within the effective analysis interval to generate an enhanced feature vector; Based on the enhanced feature vector, reverse source tracing reasoning is performed in the preset gas leak propagation model, and the location identifier and detection sequence of the potential leak source are output.
2. The gas detection method based on quartz tuning fork enhanced photoacoustic spectroscopy according to claim 1, characterized in that, Constructing a standardized tuning fork signal data stream containing time-series vibration response and synchronous laser modulation information, continuously acquired from a quartz tuning fork, includes: synchronously recording the vibration voltage signal of the quartz tuning fork and the modulation current signal driving the laser, and aligning the two signals according to a global clock; applying a bandpass filter based on the tuning fork resonance frequency to the aligned vibration voltage signal, and smoothing the modulation current signal to eliminate high-frequency glitches; interpolating and resampling the filtered vibration voltage signal and modulation current signal according to a unified time base axis to generate the standardized tuning fork signal data stream with a fixed sampling interval.
3. The gas detection method based on quartz tuning fork enhanced photoacoustic spectroscopy according to claim 2, characterized in that, The standardized tuning fork signal data stream is dynamically segmented based on gas concentration intervals, and time-domain waveform features and frequency-domain spectral features are extracted in parallel within each segment to form an initial feature vector. This includes: dividing the standardized tuning fork signal data stream into multiple data segments corresponding to gas concentration intervals based on real-time calculated gas concentration values; within each data segment, extracting time-domain waveform features, including peak amplitude, zero-crossing rate, and waveform factor, from the vibration voltage signal, and extracting frequency-domain spectral features, including main resonance peak frequency, spectral centroid, and harmonic component energy ratio, from the frequency-domain spectral lines; and combining the time-domain waveform features and frequency-domain spectral features extracted within the same data segment into the initial feature vector, thereby obtaining multiple gas concentration feature vectors.
4. The gas detection method based on quartz tuning fork enhanced photoacoustic spectroscopy according to claim 3, characterized in that, The standardized tuning fork signal data stream is scanned using the adjusted anomaly detection threshold to filter out data segments in a stable concentration state and mark them as valid analysis intervals. This includes: using the adjusted anomaly detection threshold to sequentially determine the jump amplitude between each data segment and the previous data segment; if the jump amplitude is less than the anomaly detection threshold, the current data segment is determined to be in a stable concentration state and added to the candidate set; and consecutive data segments in the candidate set are merged to form the valid analysis interval with a longer time span.
5. The gas detection method based on quartz tuning fork enhanced photoacoustic spectroscopy according to claim 4, characterized in that, Based on the inherent mechanical properties of the quartz tuning fork and the laser parameters, cross-domain coupling compensation is performed on the initial feature vector within the effective analysis interval to generate an enhanced feature vector, including: obtaining the inherent mechanical properties of the quartz tuning fork, including the quality factor and effective mass, and the laser parameters, including wavelength and beam focus size; Establish the correlation between the inherent mechanical properties and the frequency domain spectral features in the initial feature vector, and perform temperature drift compensation for the main resonance peak frequency; establish the correlation between the laser parameters and the time domain waveform features in the initial feature vector, and perform optical path loss compensation for the peak amplitude; recombine the compensated frequency domain spectral features and time domain waveform features to generate the enhanced feature vector.
6. The gas detection method based on quartz tuning fork enhanced photoacoustic spectroscopy according to claim 5, characterized in that, Establishing the correlation between the inherent mechanical properties and the frequency domain spectral characteristics of the initial feature vector, and performing temperature drift compensation for the main resonance peak frequency, includes: based on the theoretical relationship between the quality factor and the resonance peak width, inferring the actual quality factor of the current tuning fork from the measured spectral peak width; using the difference between the actual quality factor and the standard quality factor, combined with the temperature frequency coefficient of the tuning fork material, calculating the temperature drift compensation amount of the main resonance peak frequency and applying the compensation.
7. The gas detection method based on quartz tuning fork enhanced photoacoustic spectroscopy according to claim 6, characterized in that, Establishing the correlation between the laser parameters and the time-domain waveform features in the initial feature vector, and performing optical path loss compensation for the peak amplitude, includes: calculating the effective coupling efficiency of the laser energy on the tuning fork based on the matching degree between the beam focal point size and the tuning fork interdigitation gap; using the ratio of the effective coupling efficiency to the ideal coupling efficiency, combined with the gas absorption cross section corresponding to the laser wavelength, calculating the optical path loss compensation coefficient of the peak amplitude and applying compensation.
8. The gas detection method based on quartz tuning fork enhanced photoacoustic spectroscopy according to claim 7, characterized in that, Based on the enhanced feature vector, reverse source tracing reasoning is performed in a preset gas leak propagation model to output the location identifier and detection sequence for potential leak sources. This includes: loading the gas leak propagation model, which includes the pipeline network topology and the gas diffusion time relationship between nodes; mapping the enhanced feature vector to the anomaly intensity value of a specific node in the gas leak propagation model; starting from the node with the highest anomaly intensity value, traversing the pipeline network topology in the opposite direction of gas diffusion, and calculating the cumulative anomaly probability of each upstream node; sorting the upstream nodes according to the cumulative anomaly probability, and generating the detection sequence containing the location identifier. The process of constructing the gas leak propagation model includes: obtaining a digital map of the pipeline network in the target monitoring area through a geographic information system, analyzing the coordinates and connections of pipeline nodes to generate a topology map; marking historical leak event records on the topology map, and measuring the actual length and diameter of the pipelines between each point; calculating the time delay distribution curve of gas propagation from the leak point to the detection point based on the gas diffusion equation and combined with environmental wind speed and temperature gradient parameters; collecting actual leak data through field experiments, and calibrating the parameters of the time delay distribution curve using the least squares method; and merging the calibrated time delay distribution curve with the topology map to generate the gas leak propagation model.
9. A gas detection system based on quartz tuning fork enhanced photoacoustic spectrum, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the gas detection method based on quartz tuning fork enhanced photoacoustic spectrum as described in any one of claims 1 to 8.