A gas ultrasonic transducer fast matching method, storage medium, device and equipment

By deploying ultrasonic sensors in gas delivery pipelines and combining wavelet denoising and dynamic time warping algorithms to extract multidimensional features and train machine learning models, the accuracy and stability issues of gas flow measurement in complex environments are solved, and high-precision real-time calibration output is achieved.

CN121071503BActive Publication Date: 2026-05-12HANGZHOU WEIWEI INSTRUMENT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU WEIWEI INSTRUMENT CO LTD
Filing Date
2025-08-18
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing ultrasonic gas flow measurement technology suffers from decreased measurement accuracy and poor stability in complex and variable flow field environments. In particular, it is difficult to achieve high-precision measurement under the interference of environmental factors such as gas concentration, temperature, humidity and pressure. Furthermore, it lacks the ability to collaboratively process multi-path ultrasonic array data and the fault-tolerant mechanism.

Method used

Machine learning methods are employed to acquire data by deploying ultrasonic sensors in gas delivery pipelines. Signal processing is combined with wavelet denoising and dynamic time warping algorithms to extract multidimensional feature vectors. Feature fusion is performed through an attention mechanism to train a machine learning model for flow compensation. The model parameters are optimized using a multi-objective loss function to achieve real-time calibration.

Benefits of technology

It significantly improves the accuracy and stability of gas flow measurement, is suitable for high-precision monitoring under complex working conditions, and meets the needs of safe production and intelligent monitoring of gas media.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121071503B_ABST
    Figure CN121071503B_ABST
Patent Text Reader

Abstract

The application provides a gas ultrasonic transducer rapid matching method, device, equipment and storage medium, obtains original measurement data such as time of flight through deploying ultrasonic transducers in the gas ultrasonic flowmeter in the gas conveying pipeline, and carries out multidimensional data acquisition in combination with other sensor parameters. The collected signals are subjected to wavelet denoising and dynamic time warping processing, the signal quality and timing consistency are improved, time domain, frequency domain, environment and statistical characteristics are extracted, and a multidimensional feature vector is formed. The timing feature branch and the environment feature branch are modeled, and the attention mechanism is used for weighted fusion to enhance the recognition ability of the model to key features. Based on the fusion features, a machine learning model is trained, a multi-objective loss function and a data enhancement strategy are used to improve the prediction accuracy and generalization ability of the model, and a compensation value is output to calibrate the original flow in real time. The method effectively improves the accuracy and stability of gas flow measurement in complex environments, and has good engineering application prospect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of flow measurement combined with machine learning, specifically to a machine learning-based method for rapid matching of gas ultrasonic transducers, a storage medium, a device, and an equipment. Background Technology

[0002] Accurate measurement of gas flow rate is crucial for safe production and energy efficiency management during gas extraction and utilization. Currently, the mainstream gas flow rate measurement technology is mainly based on the ultrasonic time-of-flight method, which calculates the flow velocity by detecting the time difference between the propagation of ultrasonic waves in the gas along and against the current.

[0003] Figure 1 A schematic diagram of the traditional ultrasonic gas detection principle is given. The ultrasonic gas flow meter has several pairs of transducers installed on the upper side of the pipe inside the housing. A corresponding transducer is installed slightly below the middle of the housing. The reflector is parallel to the flow direction of the fluid medium. The ultrasonic signal is emitted by one transducer and reflected by the reflector to another transducer. The angle between the ultrasonic signal propagation direction and the reflector is denoted by θ. The distance from the transducer's emitting end face to the reflection point is L. When the flow velocity of the gas medium in the measurement space is 0, the propagation speed of the ultrasonic signal is the speed of sound vc. When the flow velocity of the gas medium in the measurement space is v, this velocity v will be superimposed on the velocity vc in the direction of ultrasonic signal propagation. The downstream propagation velocity v1 increases, and the propagation time is denoted by t1; the upstream propagation velocity v2 decreases, and the propagation time is denoted by t2. The relationship between v1, v2 and t1, t2 is expressed by the following four equations.

[0004]

[0005]

[0006]

[0007]

[0008] The final flow rate Q can be obtained from the pipe cross-sectional area S and the flow velocity v, as shown in the following expression.

[0009]

[0010] However, in complex and variable flow field environments, environmental factors such as gas concentration, temperature, humidity, and pressure significantly interfere with the propagation characteristics of ultrasonic signals, leading to substantial deviations in measurement results. Furthermore, traditional single-path ultrasonic measurement methods struggle to achieve high-precision and stable measurements under conditions of non-uniform flow fields and turbulent disturbances. Existing systems often employ fixed filtering or simple time-frequency analysis methods for signal processing, lacking the ability to collaboratively process multi-path ultrasonic array data, making it difficult to effectively suppress noise interference and extract key features. Simultaneously, existing technologies lack effective fault tolerance and degradation mechanisms when facing sensor anomalies or extreme conditions, affecting system stability and reliability. Therefore, there is an urgent need for a rapid matching system for gas ultrasonic transducers that can comprehensively consider the influence of multiple environmental parameters, fuse multi-path signal characteristics, and possess online learning and dynamic compensation capabilities to improve measurement accuracy and system robustness. Summary of the Invention

[0011] Based on this, in order to solve the technical problems of decreased measurement accuracy and poor stability caused by environmental interference and changes in gas composition in the existing ultrasonic gas flow measurement process, a machine learning-based method for rapid matching of gas ultrasonic transducers, a storage medium, a device, and equipment are proposed.

[0012] This invention protects a rapid matching method for a gas ultrasonic transducer. The method involves deploying ultrasonic sensors in a gas delivery pipeline to acquire raw measurement data, combined with environmental parameter information. The acquired ultrasonic signals undergo wavelet denoising, and a dynamic time warping algorithm is used to align the multi-path signals in time. Time-domain, frequency-domain, environmental, and statistical features are extracted from the denoised and time-aligned signals to form a multi-dimensional feature vector. This multi-dimensional feature vector is then input into the time-series feature branch and the environmental feature branch for feature modeling, and the outputs of different feature branches are weighted and fused using an attention mechanism. A machine learning model is trained based on the fused feature data. During training, a multi-objective loss function is used to adjust the model parameters, and the adjusted model is used to predict the output compensation value. The compensation value output by the model is applied to the original flow measurement value to achieve real-time calibration of the gas flow rate.

[0013] Furthermore, data acquisition includes input data acquisition and output tag data acquisition; input data acquisition includes acquiring ultrasonic time differences t1 and t2 for preliminary estimation of flow velocity; acquiring received signal amplitude and signal-to-noise ratio (SNR) for evaluating signal quality; acquiring gas concentration, temperature, humidity, and pressure to reflect the gas state of the channel; acquiring multipath ultrasonic data to improve measurement stability, which is obtained by deploying an orthogonal array of ultrasonic sensors; output tag data acquisition is the acquisition of real gas flow data, which is the flow reference value simulated under different gas states in the laboratory.

[0014] Furthermore, the wavelet denoising process includes: performing wavelet transform on the original ultrasound signal using the db4 wavelet basis function, suppressing the high-frequency coefficients of the transformed wavelet using a soft thresholding method, and retaining the low-frequency trend portion to obtain the denoised ultrasound signal; the dynamic time warping algorithm includes: performing dynamic time warping on the multi-path ultrasound signal using the fast DTW algorithm, approximating the optimal alignment path layer by layer through a multi-resolution strategy; before DTW alignment, performing wavelet packet decomposition on the wavelet-denoised signal and extracting the wavelet packet decomposition coefficients as the input features of DTW; during the DTW alignment process, using a multi-dimensional DTW algorithm to perform joint time alignment on the multi-channel signals; during the DTW alignment process, introducing a slanted window to constrain the path offset range and limit the global offset of the alignment path; in the DTW distance metric, using multi-scale distance based on wavelet coefficients as the similarity metric; after DTW alignment, extracting the aligned time difference change rate and signal similarity matrix.

[0015] Furthermore, time-domain, frequency-domain, environmental, and statistical features are extracted from the denoised and time-aligned signal to form a multi-dimensional feature vector. This multi-dimensional feature vector is then input into the time-domain feature branch and the environmental feature branch for feature modeling. An attention mechanism is used to weightedly fuse the outputs of different feature branches, including: extracting time-domain features (time difference Δt and signal energy) using a sliding window statistical method; extracting frequency-domain features (wavelet energy spectrum, frequency range 0-200kHz) using a 5-layer db4 wavelet packet decomposition method; extracting environmental features using a polynomial cross-feature generation method based on gas concentration and temperature; extracting joint statistical features of kurtosis and variance after anomaly filtering based on the 3σ principle; performing time-domain feature modeling on the waveform and feature modeling on the 4-dimensional environmental parameters; and weightedly concatenating the outputs of different feature branches using an attention mechanism to achieve feature fusion.

[0016] Furthermore, a machine learning model is trained based on the fused feature data. The training process employs a multi-objective loss function combined with data augmentation strategies, including: a Gaussian noise injection strategy is used during model training to add Gaussian white noise with a mean of 0 and a standard deviation of σ=0.05 to the continuous feature dimensions in the input feature vector; random jitter within a range of ±15% is applied to the gas concentration label during model training; and in each training iteration, it is randomly selected whether to perform Gaussian noise injection or gas concentration label jitter to form a diverse training sample distribution.

[0017] Furthermore, the training process employs a multi-objective loss function combined with data augmentation strategies, including: the multi-objective loss function consists of three parts: mean squared error (MSE) for flow prediction, mean absolute error (MAE) for time difference prediction, and dynamic time warping alignment loss (DTW), with weighting coefficients of 0.7, 0.3, and 0.1, respectively; during inference, a sliding window mechanism is used for real-time data processing, and parallel execution of inference computation is achieved through a double-buffered pipeline.

[0018] Furthermore, the compensation value output by the model is applied to the original flow measurement value to achieve real-time calibration output of gas flow, including: calculating and determining the compensation value based on the trained machine learning model, displaying a hyperbola comparison graph in real time to show the trend of the difference between the original flow and the compensated flow; generating a gas concentration heat map based on GIS coordinates to reflect the spatial distribution of gas concentration at different locations; and triggering a corresponding early warning mechanism and recording abnormal events when the gas concentration exceeds the set threshold, the flow fluctuation exceeds the set range, or the signal quality drops to the critical value.

[0019] This invention protects a rapid matching device for a gas ultrasonic transducer, comprising: a data acquisition and signal processing module, used to deploy an ultrasonic sensor in a gas delivery pipeline to acquire raw measurement data and combine it with environmental parameter information for data acquisition; performing wavelet denoising on the acquired ultrasonic signals and using a dynamic time warping algorithm to perform time-series alignment of multi-path signals; a feature extraction and modeling module, used to extract time-domain, frequency-domain, environmental, and statistical features from the denoised and time-series aligned signals to form a multi-dimensional feature vector; inputting the multi-dimensional feature vector into the time-series feature branch and the environmental feature branch respectively for feature modeling, and using an attention mechanism to perform weighted fusion of the outputs of different feature branches; a model training module, used to train a machine learning model based on the fused feature data, using a multi-objective loss function to adjust the parameters of the learning model during the training process, and using the model with adjusted parameters to predict the output compensation value; and a flow compensation module, used to apply the compensation value output by the model to the original flow measurement value to achieve real-time calibration output of gas flow.

[0020] This invention protects an electronic device, comprising: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus. The machine-readable instructions are executed by the processor to perform the steps of the ultrasonic gas flow measurement compensation method based on machine learning as claimed in any one of claims 1 to 7.

[0021] This invention protects a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the machine learning-based ultrasonic gas flow measurement compensation method as described in any one of claims 1 to 7.

[0022] This invention protects a rapid matching method for gas ultrasonic transducers. The method involves deploying an ultrasonic sensor in a gas ultrasonic flow meter within a gas delivery pipeline to acquire raw measurement data, combined with environmental parameter information. The acquired ultrasonic signals undergo wavelet denoising, and a dynamic time warping algorithm is used to align the time sequence of multi-path signals. Time-domain, frequency-domain, environmental, and statistical features are extracted from the denoised and time-aligned signals to form a multi-dimensional feature vector. This multi-dimensional feature vector is then input into a time-series feature branch and an environmental feature branch for feature modeling, and the outputs of different feature branches are weighted and fused using an attention mechanism. A machine learning model is trained based on the fused feature data. The training process employs a multi-objective loss function to adjust the model parameters, achieving a balance between multiple optimization objectives, thus improving prediction accuracy and generalization ability. The model with adjusted parameters is used to predict and output compensation values, thereby achieving intelligent compensation matching for measurement errors. The compensation value output by the model is applied to the original flow measurement value, achieving real-time calibration of the gas flow rate. This significantly improves the accuracy and stability of gas flow measurement and is suitable for high-precision monitoring requirements under complex operating conditions. Attached Figure Description

[0023] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0024] Figure 1 : A schematic diagram of the principle of gas flow monitoring using an ultrasonic transducer in the prior art;

[0025] Figure 2 This application provides a schematic diagram of the arrangement of an ultrasonic transducer in a gas channel according to an embodiment of the present application.

[0026] Figure 3 A simplified flowchart of a rapid matching method for a gas ultrasonic transducer provided in this application embodiment;

[0027] Figure 4 The flowchart of a rapid matching method for a gas ultrasonic transducer provided in this application embodiment;

[0028] Figure 5 This application provides an embodiment of an ultrasonic testing device for rapid matching of a gas ultrasonic transducer, as shown in the diagram.

[0029] Figure 6 This application provides a flowchart of a rapid matching data acquisition and processing process for a gas ultrasonic transducer.

[0030] Figure 7This application provides a flowchart of rapid matching feature processing and fusion for a gas ultrasonic transducer.

[0031] Figure 8 This application provides a flowchart of a rapid matching model training method for a gas ultrasonic transducer.

[0032] Figure 9 This application provides a computer front-end page display diagram of a rapid matching method for a gas ultrasonic transducer.

[0033] Figure 10 : A schematic diagram of a rapid matching device for a gas ultrasonic transducer provided in an embodiment of this application;

[0034] Figure 11 This application provides an embodiment of an electronic device for rapid matching of a gas ultrasonic transducer. Detailed Implementation

[0035] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.

[0036] Research has revealed that existing ultrasonic gas flow measurement technologies suffer from significant errors in complex gas flow environments, particularly under conditions of drastic changes in gas concentration and pressure. Traditional methods struggle to effectively eliminate gas interference on the ultrasonic propagation path and signal quality. Conventional detection methods lead to unstable measurement results, impacting the safety and efficiency of gas extraction and utilization. Furthermore, existing systems lack the capability to fuse and model multi-source heterogeneous data, failing to comprehensively reflect gas flow conditions and environmental interference factors, thus limiting further improvements in measurement accuracy.

[0037] Figure 2 The arrangement of the ultrasonic transducer of this application in a gas pipeline is shown, and measurement data is obtained through the through-beam ultrasonic transducer. Figure 3The flowchart illustrates the entire method, which involves acquiring raw measurement data by deploying ultrasonic sensors in the gas delivery pipeline and combining this data with environmental parameter information. The acquired ultrasonic signals undergo wavelet denoising, and a dynamic time warping algorithm is used to align the multi-path signals in time. Time-domain, frequency-domain, environmental, and statistical features are extracted from the denoised and time-aligned signals to form a multi-dimensional feature vector. This multi-dimensional feature vector is then input into the time-series feature branch and the environmental feature branch for feature modeling, and the outputs of different feature branches are weighted and fused using an attention mechanism. A machine learning model is trained based on the fused feature data. The training process uses a multi-objective loss function to adjust the model parameters, and the model with adjusted parameters is used to predict the output compensation value. The compensation value output by the model is applied to the original flow measurement value to achieve real-time calibration of the gas flow rate.

[0038] This application provides a rapid matching method for gas ultrasonic transducers. By introducing wavelet denoising and dynamic time warping algorithms, it effectively improves signal quality and temporal consistency, and enhances robustness against interference from gas concentration and pressure. Through multi-dimensional feature extraction and branch modeling structures, combined with an attention mechanism to achieve feature fusion, it improves the model's adaptability to complex operating conditions. A multi-objective loss function is used to optimize the training process, enabling the model to predict compensation values ​​while maintaining temporal accuracy, significantly improving measurement stability and accuracy. Finally, through a real-time compensation mechanism, it achieves high-precision online calibration output of gas flow rate, meeting the practical needs of safe production and intelligent monitoring of natural gas and other gaseous media.

[0039] In step S101, raw measurement data is acquired by deploying an ultrasonic sensor in the housing of the ultrasonic gas flow meter in the gas delivery pipeline, as detailed below. Figure 4 As described above, an ultrasonic detection device is installed in the middle of the gas transmission pipeline connected by two flanges. The detected signal data is transmitted to the control center via a data line. The control center simultaneously collects environmental parameter information. The collected ultrasonic signals undergo wavelet denoising processing, and a dynamic time warping algorithm is used to align the time sequence of multi-path signals. Specifically, in response to the real-time monitoring requirements of flow measurement in the gas transmission pipeline, multiple sets of ultrasonic sensors are deployed to collect raw ultrasonic signals and simultaneously collect environmental parameter information to construct a complete input dataset. At the same time, real flow data is collected in a laboratory environment using a high-precision calibration device as the output label. After data acquisition, wavelet denoising processing is performed on the collected ultrasonic signals to remove noise interference and improve signal quality. Furthermore, a dynamic time warping algorithm is used to align the time sequence of multi-path ultrasonic signals to eliminate propagation time differences caused by gas concentration and pressure interference, thereby improving measurement accuracy.

[0040] The data acquisition includes input data acquisition and output tag data acquisition. Specifically, during the data acquisition process, the system divides the input data into multiple dimensions, including ultrasonic time differences t1 and t2 for preliminary flow velocity estimation, received signal amplitude and signal-to-noise ratio (SNR) for evaluating signal quality, gas concentration, temperature, humidity, and pressure parameters for reflecting the gas state in the channel, and multipath ultrasonic data for improving measurement stability. Among them, multipath ultrasonic data is acquired by deploying an orthogonal array of ultrasonic sensors to ensure the integrity of signal acquisition under different propagation paths. The output tag data is obtained by simulating gas flow under different gas concentrations in a laboratory environment and collecting real flow values ​​using high-precision calibration devices (such as critical flow nozzles and positive pressure flow comparison devices) as the target output for model training.

[0041] Wavelet denoising includes: performing wavelet transform on the original ultrasonic signal using the db4 wavelet basis function; suppressing the high-frequency coefficients of the transformed wavelet using a soft thresholding method; and preserving the low-frequency trend component to obtain the denoised ultrasonic signal. Specifically, in the signal preprocessing stage, the system uses the db4 wavelet basis function to perform multi-scale decomposition on the original ultrasonic signal. In one specific implementation, a 5-level decomposition is used to separate high-frequency noise from low-frequency effective components in the signal; soft thresholding is performed on the high-frequency coefficients of each level, with a threshold set to 0.1 to suppress noise components and preserve the main trend of the signal; subsequently, the processed coefficients are restored to the denoised ultrasonic signal using a wavelet reconstruction algorithm, thereby improving the signal-to-noise ratio and the stability of subsequent processing.

[0042] Subsequently, a dynamic time warping algorithm is employed for data processing. The fast DTW algorithm is used to dynamically warp the multi-path ultrasound signals, approximating the optimal alignment path layer by layer through a multi-resolution strategy. Before DTW alignment, wavelet packet decomposition is performed on the wavelet-denoised signals, and the wavelet packet decomposition coefficients are extracted as input features for DTW. During DTW alignment, a multi-dimensional DTW algorithm is used to jointly align the multi-channel signals in time. A slant window is introduced to constrain the path offset range, limiting the global offset of the alignment path. In the DTW distance metric, multi-scale distance based on wavelet coefficients is used as a similarity metric. Specifically, after wavelet denoising, the system performs dynamic time warping on the multi-path ultrasound signals. To address the signal timing misalignment caused by differences in propagation paths, the following steps are taken: First, wavelet packet decomposition is performed on the denoised signal to extract wavelet packet coefficients for each frequency band as feature inputs. Then, a fast DTW algorithm combined with a multi-resolution strategy is used to gradually approximate the optimal alignment path from coarse to fine. During alignment, a multi-dimensional DTW algorithm is used to process multi-channel signals to ensure the synchronization of signals along each path on the time axis. Simultaneously, a Sakoe-Chiba band constraint mechanism is introduced to limit the path offset range and prevent over-alignment. For distance measurement, a multi-scale distance function based on wavelet coefficients is used to improve alignment accuracy. Finally, the time difference change rate and signal similarity matrix are extracted from the aligned signal as the basis for subsequent feature extraction.

[0043] In step S102, time-domain, frequency-domain, environmental, and statistical features are extracted from the denoised and time-aligned signal to form a multi-dimensional feature vector. This multi-dimensional feature vector is then input into the time-series feature branch and the environmental feature branch for feature modeling. An attention mechanism is used to weightedly fuse the outputs of different feature branches. Specifically, after wavelet denoising and dynamic time warping of the ultrasonic signal, the system enters the feature extraction stage. This stage aims to extract physically meaningful and predictive multi-dimensional features from the processed signal to support the training of subsequent machine learning models and the prediction of compensation values. The extracted features include time-domain features, frequency-domain features, environmental features, and statistical features, which are combined to form a unified multi-dimensional feature vector. Subsequently, this multi-dimensional feature vector is input into two feature modeling branches: the time-series feature branch for modeling time-series signal features and the environmental feature branch for modeling environmental parameter features. After completing feature modeling in both branches, the system uses an attention mechanism to weightedly fuse the outputs of the two branches to enhance the model's ability to focus on key features and improve the accuracy of the final compensation value prediction.

[0044] S1021. Extract time-domain, frequency-domain, environmental, and statistical features from the denoised and time-aligned signal to form a multi-dimensional feature vector: A sliding window statistical method is used to extract time-domain features within the window, including time difference Δt and signal energy; a 5-layer db4 wavelet packet decomposition method is used to extract frequency-domain features, including wavelet energy spectrum with a frequency range of 0-200kHz; a polynomial cross-feature generation method based on gas concentration, pressure, and temperature is used to extract environmental features; after anomaly filtering based on the 3σ principle, joint statistical features of kurtosis and variance are extracted; time-series feature modeling is performed on the waveform, and 4-dimensional environmental parameters are modeled. An attention mechanism is used to weightedly concatenate the outputs of different feature branches to achieve feature fusion; specifically, in the feature extraction process, the system first uses a sliding window mechanism to segment the denoised and aligned ultrasonic signal, with a window length set to 200ms to capture local time-series changes; within each window, time-domain features are extracted, such as time difference Δt (i.e., t1-). The system first extracts t2) and signal energy to reflect changes in flow velocity and the attenuation effect of gas on the signal. Then, it uses the db4 wavelet packet decomposition method to perform a 5-level frequency domain decomposition on the signal, extracting the wavelet energy spectrum of each frequency band, focusing on the energy distribution in the range of 0-100kHz to capture the frequency domain characteristics of gas scattering noise. At the same time, based on the collected gas concentration, pressure and temperature data, the system generates environmental features through polynomial cross-validation to reflect the coupling effect between gas concentration, pressure and temperature. In terms of statistical feature extraction, the system filters outliers of the signal amplitude based on the 3σ principle, and then extracts the joint statistical features of kurtosis and variance to characterize the stability and volatility of the signal. All extracted features are finally combined into a unified multidimensional feature vector as input for subsequent feature modeling.

[0045] S1022. The system performs time-series feature modeling on the waveform and feature modeling on the 4-dimensional environmental parameters. It then uses an attention mechanism to weightedly concatenate the outputs of different feature branches to achieve feature fusion. Specifically, in the feature modeling stage, the system inputs the time-series signal portion of the multi-dimensional feature vector into the time-series feature branch. This branch uses an LSTM network structure with 128 hidden units to capture the long-term dependencies of the ultrasonic waveform. Simultaneously, the environmental features, including four-dimensional parameters (gas concentration, temperature, humidity, and pressure), are input into the environmental feature branch. This branch uses a fully connected network structure with two dense layers to model the impact of environmental parameters on flow measurement. After completing the feature modeling of the two branches, the system weights and fuses the outputs of the two branches using an attention mechanism. Specifically, learnable attention weights are used to linearly weight the output vectors of the two branches. The weights are normalized using a Softmax function to ensure that the fused feature vector dynamically reflects the importance of different feature branches. Finally, the weighted feature vectors are concatenated and used as input features for subsequent machine learning model training to improve the model's ability to compensate for gas flow measurement under complex gas concentration interference environments.

[0046] In step S103, a machine learning model is trained based on the fused feature data. The training process uses a multi-objective loss function to adjust the parameters of the learning model, and the model with adjusted parameters is used to predict the output compensation value. Specifically, after completing feature extraction, multi-branch feature modeling, and weighted fusion using an attention mechanism, the system enters the training phase of the machine learning model. In this phase, the fused feature vector is used as input, and the laboratory-calibrated real flow rate value is used as the output label to construct a supervised learning training dataset. During the training process, a multi-objective loss function is used to jointly optimize the model parameters, and a data augmentation strategy is introduced to improve the model's generalization ability. Through multiple rounds of training iterations, the model parameters are gradually adjusted, and finally a machine learning model that can accurately predict gas flow rate compensation values ​​is obtained. After training is completed, the trained model is deployed to the actual measurement system for real-time compensation of the original flow rate measurement value, thereby improving measurement accuracy.

[0047] S1031. Training a machine learning model based on fused feature data: During model training, a Gaussian noise injection strategy is adopted to add Gaussian white noise with a mean of 0 and a standard deviation of σ=0.05 to the continuous feature dimensions in the input feature vector. During model training, random jitter within ±15% is applied to the gas concentration label. In each training iteration, it is randomly selected whether to perform Gaussian noise injection or gas concentration label jitter to form a diverse training sample distribution.

[0048] Specifically, during the model training phase, to enhance the model's adaptability to complex downhole environments, the system performs data augmentation on the input feature vectors in each training iteration. For continuous feature dimensions (such as time difference Δt, signal energy, gas concentration, etc.), the system generates noise according to a Gaussian distribution with a mean of 0 and a standard deviation σ=0.05, and superimposes it onto the original feature values ​​to simulate downhole signal fluctuations. Simultaneously, on the label side, random jitter within ±15% is applied to the gas concentration label to simulate sensor measurement errors and dynamic changes in gas concentration. In each training iteration, the system randomly decides whether to perform Gaussian noise injection or gas concentration label jitter, thereby introducing diverse sample distributions during training and improving the model's robustness and generalization performance.

[0049] S1032. The training process adopts a multi-objective loss function combined with data augmentation strategy: The multi-objective loss function consists of three parts: mean squared error (MSE) for traffic prediction, mean absolute error (MAE) for time difference prediction, and dynamic time warping and alignment loss (DTW).

[0050] In a preferred embodiment, the weighting coefficients of the three parts are 0.7, 0.3, and 0.1, respectively. A sliding window mechanism is used for real-time data processing during inference, and parallel execution of inference computation is achieved through a double-buffered pipeline. Specifically, during model training, the system uses a multi-objective loss function to jointly optimize model parameters to improve the model's performance on multiple key indicators. This multi-objective loss function consists of three parts: the first part is the mean squared error (MSE) of flow prediction, used to measure the difference between the compensated flow rate output by the model and the actual flow rate, with a weighting coefficient of 0.7; the second part is the mean absolute error (MAE) of time difference prediction, used to constrain the model's prediction accuracy for ultrasonic propagation time difference, with a weighting coefficient of 0.3; and the third part is the dynamic time warping alignment loss (DTW). The Loss term is used to optimize the alignment of multi-path signals on the time axis, with a weighting coefficient of 0.1. By jointly optimizing these three loss terms, the model can maintain the overall flow prediction accuracy while ensuring the stability of signal timing alignment. In the inference phase after model deployment, the system uses a sliding window mechanism to process the real-time acquired ultrasonic signals, with a window length of 50ms and a sliding step size of 20ms, to ensure data continuity and real-time performance. At the same time, the system uses a double-buffered pipeline mechanism to achieve parallel execution of inference computation, ensuring that the model inference latency is controlled within 50ms, meeting the real-time requirements of the gas flow measurement system.

[0051] In step S104, the compensation value output by the model is applied to the original flow measurement value to achieve real-time calibration output of gas flow. Specifically, after the machine learning model completes the prediction of the fused feature data, the system applies the compensation value output by the model to the original flow measurement value in real time, and corrects the measurement result through a dynamic compensation algorithm to output a more accurate gas flow value. This process is executed in real time in the edge computing device using a sliding window mechanism to ensure that the system response latency is controlled within 50ms. At the same time, the system visualizes the flow data before and after compensation and generates multi-dimensional monitoring data output in combination with environmental parameter information to support real-time monitoring and abnormal early warning of the coal mine gas transportation process.

[0052] Applying the compensation value output by the model to the original flow measurement value to achieve real-time calibration output of gas flow includes: calculating and determining the compensation value based on the trained machine learning model; displaying a hyperbola comparison graph in real time to show the trend of the difference between the original flow and the compensated flow; generating a gas concentration and pressure heat map based on GIS coordinates to reflect the spatial distribution of gas concentration and pressure at different locations; and triggering a corresponding early warning mechanism and recording abnormal events when the gas concentration and pressure exceed a set threshold, the flow fluctuation exceeds a set range, or the signal quality drops to a critical value.

[0053] Specifically, after the compensation value is generated, the system uses a dynamic compensation algorithm to multiply the compensation coefficient predicted by the model with the original flow measurement value to obtain the calibrated gas flow output. This compensation algorithm employs a confidence-weighted mechanism, combining the confidence level of the model prediction with the historical median for smoothing, preventing sudden output changes due to single prediction biases. Simultaneously, the system front-end displays a real-time hyperbola comparison chart, showing the changing trends of the original flow and the compensated flow, facilitating operators' intuitive judgment of the compensation effect. Furthermore, based on the collected gas concentration, pressure, and temperature data, combined with the GIS coordinate information of the deployment location, the system generates a gas concentration and pressure heat map to reflect the spatial distribution of gas concentration in different areas. Figure 8 shows a hyperbola of the original and compensated flow measurements under a certain operating condition, as well as a heat map of gas distribution in the measurement channel. The front-end data display visually shows the distribution of gas concentration within the gas detection channel, while also limiting the final data after system compensation.

[0054] Regarding anomaly detection, the system is equipped with multi-level early warning rules. When a gas concentration exceeding 1.5 kg / m³ is detected... 3 When the flow rate fluctuation exceeds ±5% or the signal-to-noise ratio is lower than the set threshold, an early warning mechanism will be automatically triggered, and the abnormal event will be recorded in the database for subsequent analysis and tracing.

[0055] Please see Figure 9 , Figure 9This is a schematic diagram of a rapid matching device for a gas ultrasonic transducer provided in an embodiment of this application. Figure 9 As shown, the compensation device 200 includes:

[0056] The data acquisition and signal processing module 210 is used to deploy ultrasonic sensors in the gas delivery pipeline to acquire raw measurement data and combine them with environmental parameter information for data acquisition; to perform wavelet noise reduction processing on the acquired ultrasonic signals and to use a dynamic time warping algorithm to perform time alignment on multipath signals;

[0057] The feature extraction and modeling module 220 is used to extract time-domain, frequency-domain, environmental and statistical features from the denoised and time-aligned signal to form a multi-dimensional feature vector; the multi-dimensional feature vector is input to the time-series feature branch and the environmental feature branch respectively for feature modeling, and the outputs of different feature branches are weighted and fused through an attention mechanism;

[0058] The model training module 230 is used to train a machine learning model based on the fused feature data. The training process uses a multi-objective loss function to adjust the parameters of the learning model and uses the model with adjusted parameters to predict the output compensation value.

[0059] The flow compensation module 240 is used to apply the compensation value output by the model to the original flow measurement value to achieve real-time calibration output of gas flow.

[0060] Furthermore, the data acquisition includes input data acquisition and output tag data acquisition; the data acquisition and signal processing module 210, when performing wavelet noise reduction processing on the acquired ultrasonic signals and using a dynamic time warping algorithm to perform time-series alignment of multipath signals, is specifically used for:

[0061] The system acquires ultrasonic time differences t1 and t2 for preliminary estimation of flow velocity; acquires received signal amplitude and signal-to-noise ratio (SNR) for evaluating signal quality; acquires gas concentration, temperature, humidity, and pressure to reflect the gas state in the channel; and acquires multipath ultrasonic data to improve measurement stability, which is obtained by deploying an orthogonal array of ultrasonic sensors.

[0062] The output label data acquisition is to collect real gas flow data, which is the flow baseline value simulated under different gas conditions in the laboratory.

[0063] Furthermore, the wavelet denoising process includes: performing wavelet transform on the original ultrasonic signal using the db4 wavelet basis function, suppressing the high-frequency coefficients of the transformed wavelet using a soft thresholding method, and retaining the low-frequency trend part to obtain the denoised ultrasonic signal.

[0064] The dynamic time warping algorithm includes: using the fast DTW algorithm to dynamically warp multi-path ultrasound signals, and approximating the optimal alignment path layer by layer through a multi-resolution strategy; before DTW alignment, wavelet packet decomposition is performed on the wavelet-denoised signal, and the wavelet packet decomposition coefficients are extracted as input features for DTW; during DTW alignment, a multi-dimensional DTW algorithm is used to jointly align the multi-channel signals in time; during DTW alignment, a slant window is introduced to constrain the path offset range and limit the global offset of the alignment path; in the distance metric of DTW, multi-scale distance based on wavelet coefficients is used as a similarity metric.

[0065] After DTW alignment is completed, the aligned time difference rate of change and signal similarity matrix are extracted.

[0066] Furthermore, the feature extraction and modeling module 120, when extracting time-domain, frequency-domain, environmental, and statistical features from the denoised and time-aligned signal to form a multi-dimensional feature vector; and inputting the multi-dimensional feature vector into the time-series feature branch and the environmental feature branch respectively for feature modeling, and weighting and fusing the outputs of different feature branches through an attention mechanism, is specifically used for:

[0067] A sliding window statistical method is used to extract time-domain features within the window, including time difference Δt and signal energy. A 5-layer db4 wavelet packet decomposition method is used to extract frequency-domain features, including wavelet energy spectrum with a frequency range of 0-200kHz. Environmental features are extracted using a polynomial cross-feature generation method based on gas concentration and temperature. After anomaly filtering based on the 3σ principle, joint statistical features of kurtosis and variance are extracted.

[0068] The waveform is modeled with time-series features, and the 4D environmental parameters are modeled with features. The outputs of different feature branches are weighted and spliced ​​through an attention mechanism to achieve feature fusion.

[0069] Furthermore, when the model training module 230 is used to train a machine learning model based on the fused feature data, and the training process employs a multi-objective loss function combined with data augmentation strategies, it is specifically used for:

[0070] During model training, a Gaussian noise injection strategy is adopted, adding Gaussian white noise with a mean of 0 and a standard deviation of σ=0.05 to the continuous feature dimensions of the input feature vector. During model training, random jitter within ±15% is applied to the gas concentration label. In each training iteration, it is randomly selected whether to perform Gaussian noise injection or gas concentration label jitter to form a diverse training sample distribution.

[0071] Furthermore, the multi-objective loss function consists of three parts: mean square error (MSE) of flow prediction, mean absolute error (MAE) of time difference prediction, and dynamic time warping alignment loss (DTW), with weighting coefficients of 0.7, 0.3, and 0.1, respectively.

[0072] A sliding window mechanism is used for real-time data processing during inference, and a double-buffered pipeline is used for parallel execution of inference computation.

[0073] Furthermore, when the flow compensation module 240 applies the compensation value output by the model to the original flow measurement value to achieve real-time calibration output of the gas flow rate, it is specifically used for:

[0074] The compensation value is calculated and determined based on the trained machine learning model, and a hyperbola comparison graph is displayed in real time to show the trend of the difference between the original traffic and the compensation traffic.

[0075] Generate a gas concentration and pressure heat map based on GIS coordinates to reflect the spatial distribution of gas concentration and pressure at different locations;

[0076] When the gas concentration pressure exceeds the set threshold, the flow rate fluctuation exceeds the set range, or the signal quality drops to the critical value, the corresponding early warning mechanism is triggered and the abnormal event is recorded.

[0077] The ultrasonic gas flow measurement compensation device based on machine learning provided in this application acquires raw measurement data by deploying ultrasonic sensors, combines this data with environmental parameter information, and performs wavelet denoising and dynamic time warping on the acquired signals. After extracting multi-dimensional features, feature fusion is performed through branch modeling and attention mechanisms. A machine learning model is trained using a multi-objective loss function, and finally, the compensation value output by the model is applied to the original flow measurement value to achieve real-time calibration output of gas flow. This solution effectively improves the accuracy and stability of gas flow measurement and is suitable for industrial field applications in complex flow field environments.

[0078] Please see Figure 10 , Figure 10 This is a schematic diagram of an electronic device structure for rapid matching of a gas ultrasonic transducer, provided as an embodiment of this application. Figure 10 As shown, the electronic device 300 includes a processor 310, a memory 320, and a bus 330.

[0079] The memory 320 stores machine-readable instructions that can be executed by the processor 310. When the electronic device 300 is running, the processor 310 and the memory 320 communicate via the bus 330. When the machine-readable instructions are executed by the processor 310, the steps of the ultrasonic gas flow measurement compensation method based on machine learning as described in the above method embodiment can be executed. For specific implementation details, please refer to the method embodiment, which will not be repeated here.

[0080] This application also provides a computer-readable storage medium storing a computer program. When the computer program is run by a processor, it can execute the steps of the ultrasonic gas flow measurement compensation method based on machine learning as described in the above method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0081] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0082] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0083] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0084] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0085] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0086] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered 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 rapid matching method for a gas ultrasonic transducer, characterized in that, Raw measurement data is acquired by deploying ultrasonic sensors in gas delivery pipelines and combined with environmental parameter information; wavelet noise reduction is performed on the acquired ultrasonic signals, and a dynamic time warping algorithm is used to align the time sequence of multipath signals. The wavelet noise reduction process includes: performing wavelet transform on the original ultrasonic signal using the db4 wavelet basis function, suppressing the high-frequency coefficients of the transformed wavelet using the soft thresholding method, and retaining the low-frequency trend part to obtain the noise-reduced ultrasonic signal. The dynamic time warping algorithm includes: using the fast DTW algorithm to dynamically warp multi-path ultrasound signals, and approximating the optimal alignment path layer by layer through a multi-resolution strategy; before DTW alignment, wavelet packet decomposition is performed on the wavelet-denoised signal, and the wavelet packet decomposition coefficients are extracted as input features for DTW; during DTW alignment, a multi-dimensional DTW algorithm is used to jointly align the multi-channel signals in time, and a slant window is introduced to constrain the path offset range, limiting the global offset of the alignment path; in the distance metric of DTW, multi-scale distance based on wavelet coefficients is used as a similarity metric; after DTW alignment is completed, the time difference change rate and signal similarity matrix after alignment are extracted. Time-domain, frequency-domain, environmental, and statistical features are extracted from the denoised and time-aligned signal to form a multi-dimensional feature vector. The multi-dimensional feature vector is then input into the time-series feature branch and the environmental feature branch for feature modeling, and the outputs of different feature branches are weighted and fused through an attention mechanism. A machine learning model is trained based on the fused feature data. The training process uses a multi-objective loss function to adjust the parameters of the learning model, and the model with adjusted parameters is used to predict the output compensation value. The compensation value output by the model is applied to the original flow measurement value to achieve real-time calibration output of gas flow.

2. The rapid matching method for a gas ultrasonic transducer according to claim 1, characterized in that: The data acquisition includes input data acquisition and output label data acquisition; Input data acquisition includes acquiring ultrasonic time differences t1 and t2 for preliminary estimation of flow velocity; acquiring received signal amplitude and signal-to-noise ratio (SNR) for evaluating signal quality; acquiring gas concentration, temperature, humidity, and pressure to reflect the gas state of the channel; and acquiring multipath ultrasonic data to improve measurement stability, wherein the multipath ultrasonic data is acquired by deploying an orthogonal array of ultrasonic sensors. The output label data acquisition is to collect real gas flow data, which is the flow baseline value simulated under different gas conditions in the laboratory.

3. The rapid matching method for a gas ultrasonic transducer according to claim 1, characterized in that, The process of extracting time-domain, frequency-domain, environmental, and statistical features from the denoised and time-aligned signal to form a multi-dimensional feature vector; inputting the multi-dimensional feature vector into the time-series feature branch and the environmental feature branch respectively for feature modeling; and weighting and fusing the outputs of different feature branches through an attention mechanism includes: A sliding window statistical method is used to extract time-domain features within the window, including time difference Δt and signal energy. A 5-level db4 wavelet packet decomposition method is used to extract frequency-domain features, including wavelet energy spectrum with a frequency range of 0-200kHz. Environmental features are extracted based on a polynomial cross-feature generation method using gas concentration, temperature, and pressure. After anomaly filtering based on the 3σ principle, joint statistical features of kurtosis and variance are extracted. The waveform is modeled with time-series features, and the 4D environmental parameters are modeled with features. The outputs of different feature branches are weighted and spliced ​​through an attention mechanism to achieve feature fusion.

4. The rapid matching method for a gas ultrasonic transducer according to claim 1, characterized in that, The training of the machine learning model based on the fused feature data, wherein the training process employs a multi-objective loss function and combines data augmentation strategies, includes: During model training, a Gaussian noise injection strategy is adopted to add Gaussian white noise to the continuous feature dimensions of the input feature vector. During model training, random jitter is applied to the gas concentration label. In each training iteration, it is randomly selected whether to perform Gaussian noise injection or gas concentration label jitter to form a diverse training sample distribution.

5. The rapid matching method for a gas ultrasonic transducer according to claim 4, characterized in that, The training process employs a multi-objective loss function combined with data augmentation strategies, including: The multi-objective loss function consists of three parts: mean square error (MSE) for flow forecasting, mean absolute error (MAE) for time difference forecasting, and dynamic time warping alignment loss (DTW), with weighting coefficients of 0.7, 0.3, and 0.1, respectively. A sliding window mechanism is used for real-time data processing during inference, and a double-buffered pipeline is used for parallel execution of inference computation.

6. The rapid matching method for a gas ultrasonic transducer according to claim 1, characterized in that, The step of applying the compensation value output by the model to the original flow measurement value to achieve real-time calibration output of the gas flow includes: The compensation value is calculated and determined based on the trained machine learning model, and a hyperbola comparison graph is displayed in real time to show the trend of the difference between the original traffic and the compensation traffic. Generate a gas pressure heat map based on GIS coordinates to reflect the spatial distribution of gas pressure at different locations; When the gas pressure exceeds the set threshold, the flow rate fluctuates beyond the set range, or the signal quality drops to a critical value, an alarm is triggered and the abnormal event is recorded.

7. A rapid matching device for a gas ultrasonic transducer, characterized in that, include: The data acquisition and signal processing module is used to deploy ultrasonic sensors in gas delivery pipelines to acquire raw measurement data and combine them with environmental parameter information for data acquisition; it performs wavelet noise reduction processing on the acquired ultrasonic signals and uses a dynamic time warping algorithm to perform time alignment on multipath signals; The wavelet noise reduction process includes: performing wavelet transform on the original ultrasonic signal using the db4 wavelet basis function, suppressing the high-frequency coefficients of the transformed wavelet using the soft thresholding method, and retaining the low-frequency trend part to obtain the noise-reduced ultrasonic signal. The dynamic time warping algorithm includes: using the fast DTW algorithm to dynamically warp multi-path ultrasound signals, and approximating the optimal alignment path layer by layer through a multi-resolution strategy; before DTW alignment, wavelet packet decomposition is performed on the wavelet-denoised signal, and the wavelet packet decomposition coefficients are extracted as input features for DTW; during DTW alignment, a multi-dimensional DTW algorithm is used to jointly align the multi-channel signals in time, and a slant window is introduced to constrain the path offset range, limiting the global offset of the alignment path; in the distance metric of DTW, multi-scale distance based on wavelet coefficients is used as a similarity metric; after DTW alignment is completed, the time difference change rate and signal similarity matrix after alignment are extracted. The feature extraction and modeling module is used to extract time-domain, frequency-domain, environmental, and statistical features from the denoised and time-aligned signal to form a multi-dimensional feature vector. The multi-dimensional feature vector is then input into the time-series feature branch and the environmental feature branch for feature modeling, and the outputs of different feature branches are weighted and fused through an attention mechanism. The model training module is used to train a machine learning model based on the fused feature data. The training process uses a multi-objective loss function to adjust the parameters of the learning model, and uses the model with adjusted parameters to predict the output compensation value. The flow compensation module is used to apply the compensation value output by the model to the original flow measurement value, so as to realize the real-time calibration output of gas flow.

8. An electronic device, characterized in that, include: The device includes a processor, a clock chip, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the ultrasonic gas flow measurement compensation method based on machine learning as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the machine learning-based ultrasonic gas flow measurement compensation method as described in any one of claims 1 to 6.