Gas ultrasonic transducer rapid matching method, device and equipment, and storage medium
By processing ultrasonic signals using wavelet denoising and dynamic time warping algorithms, and combining them with machine learning models for feature fusion and real-time calibration, the accuracy and stability issues of gas flow measurement in complex flow field environments are solved, achieving high-precision flow monitoring.
Patent Information
- Application Number
- CN202511149783.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-08-18
AI Technical Summary
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 and stable 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.
Wavelet denoising and dynamic time warping algorithms are used to align the time sequence of multipath signals, extract time-domain, frequency-domain, environmental and statistical features, perform feature fusion through attention mechanism, and use machine learning models for traffic calibration. The model is trained by combining multi-objective loss functions and data augmentation strategies to achieve real-time compensation.
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 in the gas transportation process.
Smart Images

Figure CN121071503A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of flow measurement combined with machine learning, and in particular to a gas ultrasonic transducer rapid matching method based on machine learning, a storage medium, an apparatus and an equipment. BACKGROUND
[0002] In the process of gas extraction and utilization, accurate measurement of gas flow is crucial for safety production and energy efficiency management. Currently, the mainstream gas flow measurement technology is mainly based on ultrasonic time difference method, which calculates the flow rate by detecting the time difference of ultrasonic propagation in gas in the forward and reverse directions.
[0003] Figure 1 The traditional gas ultrasonic detection principle diagram is given, several pairs of transducers are installed on the upper side of the pipeline in the shell, corresponding transducers are installed in the lower part of the middle of the shell, the reflection plate is parallel to the flow direction of the fluid medium, the ultrasonic signal is transmitted from one transducer to another transducer after being reflected by the reflection plate, the angle between the ultrasonic signal propagation direction and the reflection plate is represented by θ, the distance from the transducer emission end face to the reflection point is L. When the flow velocity of the gas medium in the measurement space is 0, the propagation velocity of the ultrasonic signal is the sound velocity vc, when the flow velocity of the gas medium in the measurement space is v, the velocity v will superimpose with the velocity vc in the direction of ultrasonic signal propagation, the forward propagation velocity v1 increases, the propagation time is represented by t1, the reverse propagation velocity v2 decreases, the propagation time is represented by t2, the relationship between v1, v2, t1 and t2 is shown in the following four equations.
[0004] The final flow Q can be obtained by the pipe cross-sectional area S and the flow velocity v, and the expression is as follows, However, in a complex and variable flow field environment, environmental factors such as gas concentration, temperature, humidity and pressure significantly interfere with the propagation characteristics of ultrasonic signals, resulting in large deviations in measurement results. In addition, the traditional single-path ultrasonic measurement method is difficult to achieve high-precision and stable measurement in the face of uneven flow field, turbulent disturbance and other working conditions. The existing system mostly uses fixed filtering or simple time-frequency analysis method in signal processing, lacks the ability of cooperative processing of multi-path ultrasonic array data, and is difficult to effectively suppress noise interference and extract key features. At the same time, the existing technology lacks effective fault tolerance and degradation mechanism in the face of sensor abnormalities or extreme working conditions, affecting the stability and reliability of the system. Therefore, it is urgent to develop a gas ultrasonic transducer rapid matching system that can consider the influence of multiple environmental parameters, fuse multi-path signal features and has online learning and dynamic compensation capability, in order to improve the measurement accuracy and system robustness. SUMMARY
[0005] Therefore, in order to solve the technical problems of low measurement accuracy and poor stability caused by environmental interference and gas composition changes in the existing ultrasonic gas flow measurement process, a machine learning-based gas ultrasonic transducer rapid matching method, storage medium, device and equipment are proposed.
[0006] The present application protects a kind of gas ultrasonic transducer rapid matching method, obtains original measurement data by deploying ultrasonic sensor in gas delivery pipeline, and carries out data acquisition in combination with environmental parameter information;Wavelet denoising processing is carried out to the ultrasonic signal collected, and dynamic time warping algorithm is used to time sequence alignment to multi-path signal;From the signal after denoising and time sequence alignment, time domain, frequency domain, environment and statistical features are extracted to form multi-dimensional feature vector;Multi-dimensional feature vector is input into time sequence feature branch and environment feature branch respectively to carry out feature modeling, and the output of different feature branches is weighted and fused by attention mechanism;Machine learning model is trained based on the fused feature data, multi-objective loss function is used to adjust learning model parameters in training process, and the model after adjusting parameters is used to predict output compensation value;The compensation value output by the model is applied to original flow measurement value, and real-time calibration output of gas flow is realized.
[0007] Further, data acquisition includes input data acquisition and output label data acquisition;Input data acquisition includes collecting ultrasonic time difference t1 and t2 for preliminary estimation of flow rate;Collecting signal amplitude and signal-to-noise ratio SNR for evaluating signal quality;Collecting gas concentration, temperature, humidity and pressure for reflecting channel gas state;Collecting multi-path ultrasonic data for improving measurement stability, and the multi-path ultrasonic data is obtained by deploying orthogonal array ultrasonic sensor;Output label data acquisition is to collect real gas flow data, and the real gas flow data is the flow reference value under different gas states simulated in laboratory.
[0008] Further, the wavelet denoising processing includes: using a db4 wavelet basis function to perform wavelet transform on the original ultrasonic signal, using a soft threshold method to suppress the high frequency coefficients after the transform, and retaining the low frequency trend part to obtain the denoised ultrasonic signal; the dynamic time warping algorithm includes: using a fast DTW algorithm to perform dynamic time warping processing on the multi-path ultrasonic signal, and approaching the optimal alignment path layer by layer through a multi-resolution strategy, before performing the DTW alignment, performing wavelet packet decomposition on the wavelet denoised signal, and extracting the wavelet packet decomposition coefficients as the input features of the DTW; in the DTW alignment process, a multi-dimensional DTW algorithm is used to jointly time-align the multi-channel signals; in the DTW alignment process, a slant window is introduced to constrain the path offset range and limit the global offset of the alignment path; in the distance measurement of the DTW, a multi-scale distance based on the wavelet coefficients is used as the similarity measurement method; after the DTW alignment is completed, the time difference change rate and the signal similarity matrix after the alignment are extracted.
[0009] Further, time domain, frequency domain, environmental and statistical features are extracted from the signals after denoising and time alignment to form a multi-dimensional feature vector; the multi-dimensional feature vector is input into a time sequence feature branch and an environmental feature branch for feature modeling, and the outputs of different feature branches are weighted and fused through an attention mechanism, including: using a sliding window statistical method to extract time domain features in the window, the time domain features including time difference Δt and signal energy; using a 5-layer db4 wavelet packet decomposition method to extract frequency domain features, the frequency domain features including wavelet energy spectrum, and the frequency range being 0-200 kHz; using a polynomial cross-feature generation method based on gas concentration and temperature to extract environmental features; after abnormal filtering based on the 3σ principle, joint statistical features of kurtosis and variance are extracted; the waveform is time sequence feature modeled, and the 4-dimensional environmental parameters are feature modeled, the outputs of different feature branches are weighted and spliced through an attention mechanism, and feature fusion is realized.
[0010] Further, a machine learning model is trained based on the fused feature data, and the training process uses a multi-objective loss function and combines a data enhancement strategy, including: in the model training process, a Gaussian noise injection strategy is used to add Gaussian white noise with a mean of 0 and a standard deviation σ=0.05 to the continuous feature dimensions in the input feature vector, and in the model training process, a random jitter within ±15% is applied to the gas concentration label, in each training iteration, whether to perform Gaussian noise injection or gas concentration label jitter is randomly selected, forming a diversified training sample distribution.
[0011] Further, the training process adopts a multi-objective loss function and combines a data enhancement strategy, including: the multi-objective loss function is composed of three parts: the mean square error (MSE) of flow prediction, the mean absolute error (MAE) of time difference prediction, and the dynamic time warping (DTW) alignment loss, with weighting coefficients of 0.7, 0.3, and 0.1, respectively; in the inference process, a sliding window mechanism is used for real-time data processing, and a double-buffer pipeline is used for parallel execution of inference calculation.
[0012] Further, the compensation value output by the model is applied to the original flow measurement value to realize real-time calibration output of the gas flow, including: determining the compensation value based on the trained machine learning model, displaying a hyperbolic curve comparison chart in real time to show the difference trend between the original flow and the compensated flow; generating a gas concentration heat map based on GIS coordinates to reflect the spatial distribution state of gas concentration at different positions; when the gas concentration exceeds the set threshold, the flow fluctuation exceeds the set range, or the signal quality drops to the critical value, triggering the corresponding early warning mechanism and recording the abnormal event.
[0013] The present application protects a kind of gas ultrasonic transducer fast matching device, comprising: data acquisition and signal processing module, for in gas delivery pipeline deployment ultrasonic sensor obtains original measurement data, and data acquisition is carried out in combination with environmental parameter information;Wavelet denoising processing is carried out to the ultrasonic signal collected, and dynamic time warping algorithm is used to carry out time sequence alignment to multi-path signal;Feature extraction and modeling module, for extracting time domain, frequency domain, environment and statistical features from the signal after denoising and time sequence alignment, form multi-dimensional feature vector;Multi-dimensional feature vector is input into time sequence feature branch and environment feature branch respectively to carry out feature modeling, and the output of different feature branches is weighted and fused by attention mechanism;Model training module, for training machine learning model based on the feature data after fusion, the learning model parameter is adjusted using multi-objective loss function in training process, and the model after adjusting parameter is used to predict output compensation value;Flow compensation module, for the compensation value output by the model is applied to the original flow measurement value, to realize the real-time calibration output of the gas flow.
[0014] The present application protects an electronic device, comprising: processor, memory and bus, memory stores machine readable instructions executable by processor, when electronic device runs, processor and memory communicate through bus, machine readable instructions are executed when processor runs to execute the steps of machine learning based ultrasonic gas flow measurement compensation method of any one of claims 1 to 7.
[0015] The present application protects a kind of computer readable storage medium, computer readable storage medium stores computer program, computer program is executed when processor runs to execute the steps of machine learning based ultrasonic gas flow measurement compensation method of any one of claims 1 to 7.
[0016] The application protects a gas ultrasonic transducer rapid matching method, which acquires original measurement data by deploying ultrasonic sensors in a gas delivery pipeline and combining environmental parameter information for data acquisition; wavelet denoising processing is performed on the collected ultrasonic signals, and a dynamic time warping algorithm is used to time-align the 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; the multi-dimensional feature vector is input into a time sequence feature branch and an 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 learning model parameters, so that the model balances between multiple optimization targets, improves the prediction accuracy and generalization ability, and the model after adjusting the parameters is used to predict the output compensation value, thereby realizing intelligent compensation and matching of measurement errors; the compensation value output by the model is applied to the original flow measurement value to realize real-time calibration output of the gas flow, which significantly improves the accuracy and stability of gas flow measurement, and is suitable for high-precision monitoring requirements under complex working conditions. BRIEF DESCRIPTION OF DRAWINGS
[0017] The accompanying drawings are included to provide a further understanding of the application, and constitute a part of the specification, together with the embodiments of the application, to explain the application, and do not constitute a limitation on the application. In the drawings: Figure 1 : principle diagram of gas flow monitoring by ultrasonic transducer in prior art; Figure 2 : arrangement schematic diagram of ultrasonic transducer in gas passage provided by the embodiment of the application; Figure 3 : flowchart of a gas ultrasonic transducer rapid matching method provided by the embodiment of the application; Figure 4 : flowchart of a gas ultrasonic transducer rapid matching method provided by the embodiment of the application; Figure 5 : arrangement diagram of ultrasonic detection device for gas ultrasonic transducer rapid matching provided by the embodiment of the application; Figure 6 : data acquisition and processing flowchart of gas ultrasonic transducer rapid matching provided by the embodiment of the application; Figure 7 : feature processing and fusion flowchart of gas ultrasonic transducer rapid matching provided by the embodiment of the application; Figure 8 : model training flowchart of gas ultrasonic transducer rapid matching provided by the embodiment of the application; Figure 9 A computer front-end page display diagram of a gas ultrasonic transducer fast matching provided by the present application is provided. Figure 10 A gas ultrasonic transducer fast matching device schematic diagram provided by the embodiment of the present application is provided. Figure 11 An electronic device diagram of a gas ultrasonic transducer fast matching provided by the embodiment of the present application is provided. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. The components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, every other embodiment obtained by a person skilled in the art without creative work belongs to the scope of protection of the present application.
[0019] It is found through research that the existing ultrasonic gas flow measurement technology has a large error in a complex gas flow field environment, especially in the case of a dramatic change in gas concentration and pressure. The traditional method is difficult to effectively eliminate the interference of gas on the ultrasonic wave propagation path and signal quality. The conventional detection method leads to unstable measurement results, affecting the safety and efficiency of gas extraction and utilization. In addition, the existing system lacks the ability to fuse and model multi-source heterogeneous data, making it difficult to fully reflect the gas flow state and environmental interference factors, thereby limiting the further improvement of measurement accuracy.
[0020] Figure 2 The arrangement of the ultrasonic transducer in the gas pipeline is shown, and the data for measurement is obtained by the aimed ultrasonic transducer. Figure 3A flow chart of the entire method is shown, raw measurement data is acquired by deploying ultrasonic sensors in the gas delivery pipeline, combined with environmental parameter information for data acquisition; the collected ultrasonic signals are wavelet denoising processed, and the dynamic time warping algorithm is used for time sequence alignment of the multi-path signals; time domain, frequency domain, environmental and statistical features are extracted from the denoised and time sequence aligned signals to form a multi-dimensional feature vector; the multi-dimensional feature vector is input into the time sequence feature branch and the environmental feature branch respectively for feature modeling, and the outputs of different feature branches are weighted and fused through the 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 learning 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 realize real-time calibration output of the gas flow.
[0021] The embodiment of the present application provides a kind of gas ultrasonic transducer fast matching method, by introducing wavelet denoising and dynamic time warping algorithm, effectively improve signal quality and time sequence consistency, enhance the robustness to gas concentration, pressure interference.By multi-dimensional feature extraction and branch modeling structure, realize feature fusion in combination with attention mechanism, improve the adaptability of model to complex working conditions.Multi-objective loss function is used to optimize training process, so that model can predict compensation value while considering time sequence accuracy, which significantly improves the stability and accuracy of measurement.Finally, through real-time compensation mechanism, high-precision online calibration output of gas flow is realized, which meets the actual needs of natural gas and other gas media safety production and intelligent monitoring.
[0022] In step S101, raw measurement data is acquired by deploying ultrasonic sensors in the gas delivery pipeline of the gas ultrasonic flowmeter, see Figure 4 The ultrasonic detection device is arranged in the middle part of the gas delivery pipeline connected by two flanges, and the detected signal data is transmitted to the control center through the data line; the control center also collects environmental parameter information; the collected ultrasonic signals are wavelet denoised, and the dynamic time warping algorithm is used for time sequence alignment of the multi-path signals; specifically, in response to the real-time monitoring demand of flow measurement in the gas delivery pipeline, multiple groups of ultrasonic sensors are deployed to collect original ultrasonic signals, and environmental parameter information is collected synchronously to construct a complete input data set; at the same time, real flow data is collected as output label by high-precision calibration device in laboratory environment; after data collection, the collected ultrasonic signals are wavelet denoised to remove noise interference and improve signal quality; further, dynamic time warping algorithm is used for time sequence alignment of multi-path ultrasonic signals to eliminate the difference in propagation time caused by gas concentration and pressure interference, thereby improving measurement accuracy.
[0023] The data collection includes input data collection and output label data collection; specifically, in the data collection process, the system divides the input data into multiple dimensions, including ultrasonic time difference t1 and t2 for preliminary estimation of flow rate, received signal amplitude and signal-to-noise ratio SNR for evaluation of signal quality, gas concentration, temperature, humidity, pressure parameters for reflecting channel gas state, and multi-path ultrasonic data for improving measurement stability; wherein the multi-path ultrasonic data is obtained by deploying an orthogonal array of ultrasonic sensors, ensuring the integrity of signal collection under different propagation paths; the output label data is collected by simulating the gas flow under different gas concentration conditions in the laboratory environment, using high-precision calibration devices (such as critical flow nozzles and positive pressure flow comparison devices) to collect real flow values as the target output of model training.
[0024] The wavelet denoising processing includes: using db4 wavelet basis function to perform wavelet transform on the original ultrasonic signal, using soft threshold method to suppress the high frequency coefficients after transformation, and retaining the low frequency trend part to obtain the denoised ultrasonic signal; specifically, in the signal preprocessing stage, the system uses db4 wavelet basis function to perform multi-scale decomposition on the original ultrasonic signal. In one specific embodiment, it is set to 5 layers of decomposition to separate the high frequency noise and low frequency effective component in the signal; the high frequency coefficients of each layer are processed by soft threshold value, and the threshold value is set to 0.1 to suppress the noise component and retain the main trend of the signal; then, the processed coefficients are restored to the denoised ultrasonic signal by wavelet reconstruction algorithm, so as to improve the signal-to-noise ratio of the signal and the stability of subsequent processing.
[0025] Subsequently, the dynamic time warping algorithm is used for data processing, the fast DTW algorithm is used for dynamic time warping processing of the multi-path ultrasonic signal, the optimal alignment path is approached layer by layer through a multi-resolution strategy, the wavelet packet decomposition coefficient is extracted as the input feature of DTW before the DTW alignment, the multi-dimensional DTW algorithm is used for joint timing alignment of the multi-channel signal in the DTW alignment process, the slant window is introduced to constrain the path offset range and limit the global offset of the alignment path in the DTW alignment process, and the multi-scale distance based on the wavelet coefficient is used as the similarity measurement method in the distance measurement of DTW. Specifically, after the wavelet denoising is completed, the system performs dynamic time warping processing on the multi-path ultrasonic signal to solve the signal timing misplacement problem caused by the difference in the propagation path. First, the wavelet packet decomposition is performed on the denoised signal, and the wavelet packet coefficients of each frequency band are extracted as the feature input. Subsequently, the fast DTW algorithm is combined with the multi-resolution strategy to gradually approach the optimal alignment path from coarse to fine. In the alignment process, the multi-dimensional DTW algorithm is used to process the multi-channel signal to ensure the synchronization of the signals in the time axis. At the same time, the Sakoe-Chiba band constraint mechanism is introduced to limit the path offset range and prevent excessive alignment. In terms of distance measurement, the multi-scale distance function based on the wavelet coefficient is used to improve the alignment accuracy. Finally, the time difference rate and the signal similarity matrix are extracted from the aligned signal as the basis for subsequent feature extraction.
[0026] In step S102, the time domain, frequency domain, environment and statistical features are extracted from the signals after denoising and timing alignment to form a multi-dimensional feature vector; and the multi-dimensional feature vector is input into the timing feature branch and the environment feature branch for feature modeling, and the outputs of different feature branches are weighted and fused through the attention mechanism; Specifically, after the wavelet denoising and dynamic time warping processing of the ultrasonic signal are completed, the system enters the feature extraction stage, which aims to extract multi-dimensional features with physical meaning and prediction ability from the processed signal to support the training of the subsequent machine learning model and the prediction of the compensation value. The extracted features include time domain features, frequency domain features, environmental features and statistical features, and these features are combined to form a unified multi-dimensional feature vector. Subsequently, the multi-dimensional feature vector is input into two feature modeling branches, namely the timing feature branch for modeling the timing signal features and the environmental feature branch for modeling the environmental parameter features. After the feature modeling of the two branches is completed, the system weights and fuses the outputs of the two branches through the attention mechanism to enhance the attention ability of the model to the key features and improve the accuracy of the final compensation value prediction.
[0027] S1021, extract time domain, frequency domain, environmental and statistical features from the noise-reduced and time-aligned signal to form a multi-dimensional feature vector: adopt a sliding window statistical method to extract time domain features within the window, the time domain features including time difference At and signal energy; adopt a 5-layer db4 wavelet packet decomposition method to extract frequency domain features, the frequency domain features including wavelet energy spectrum, and the frequency range is 0-200 kHz; extract environmental features based on a polynomial cross-feature generation method of gas concentration pressure and temperature; after abnormal filtering based on the 3σ principle, extract joint statistical features of kurtosis and variance; model the time sequence features of the waveform, and model the features of the 4-dimensional environmental parameters, and realize feature fusion by weighting and splicing the outputs of different feature branches through the attention mechanism; specifically, in the feature extraction process, the system first adopts a sliding window mechanism to segment the noise-reduced and aligned ultrasonic signal, and the window length is set to 200 ms to capture local time sequence changes; within each window, time domain features such as time difference At (i.e. t1-t2) and signal energy are extracted to reflect flow rate changes and the attenuation effect of gas on the signal; then, a db4 wavelet packet decomposition method is used to decompose the signal in the frequency domain for 5 layers, and the wavelet energy spectrum of each frequency band is extracted, focusing on the energy distribution in the range of 0-100 kHz 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 to reflect the coupling effect between gas concentration pressure and temperature; in terms of statistical feature extraction, the system filters the abnormal values of the signal amplitude based on the 3σ principle, and then extracts joint statistical features of kurtosis and variance to represent the stability and volatility of the signal; all extracted features are finally combined into a unified multi-dimensional feature vector as the input of subsequent feature modeling.
[0028] S1022, the waveform is modeled for timing characteristics, and the 4-dimensional environmental parameters are modeled for characteristics, the outputs of different characteristic branches are weighted and spliced through an attention mechanism to realize feature fusion; specifically, in the feature modeling stage, the system inputs the timing signal part in the multi-dimensional feature vector into the timing characteristic branch, the branch adopts an LSTM network structure, contains 128 hidden units, and is used to capture the long-term dependence of the ultrasonic waveform; at the same time, the environmental characteristic part, including 4-dimensional parameters such as gas concentration, temperature, humidity and pressure, is input into the environmental characteristic branch, the branch adopts a fully connected network structure, contains two layers of Dense layers, and is used to model the influence of environmental parameters on flow measurement; after completing the feature modeling of the two branches, the system performs weighted fusion on the outputs of the two branches through the attention mechanism, specifically, a learnable attention weight is used to linearly weight the output vectors of the two branches, the weight is normalized through a Softmax function, and it is ensured that the fused feature vector can dynamically reflect the importance of different characteristic branches; finally, the weighted feature vector is spliced and used as the input feature of the subsequent machine learning model training to improve the gas flow measurement compensation capability of the model under the complex gas concentration interference environment.
[0029] In step S103, a machine learning model is trained based on the fused feature data, a multi-objective loss function is used to adjust the learning model parameters in the training process, and the model with adjusted parameters is used to predict the output compensation value; specifically, after completing feature extraction, multi-branch feature modeling and attention mechanism weighted fusion, the system enters the training stage of the machine learning model; in this stage, the fused feature vector is used as the input, and the real flow value calibrated in the laboratory is used as the output label to construct the training data set of supervised learning; in the training process, a multi-objective loss function is used to jointly optimize the model parameters, and a data enhancement strategy is introduced to improve the generalization ability of the model; through multiple rounds of training iterations, the model parameters are gradually adjusted, and finally a machine learning model capable of accurately predicting the gas flow compensation value is obtained; after the training is completed, the trained model is deployed to the actual measurement system to compensate the original flow measurement value in real time, thereby improving the measurement accuracy.
[0030] S1031, a machine learning model is trained based on the fused feature data: in the model training process, a Gaussian noise injection strategy is adopted to add Gaussian white noise with a mean of 0 and a standard deviation σ=0.05 to the continuous feature dimensions in the input feature vector, and a random jitter within ±15% is applied to the gas concentration label during model training, in each training iteration, whether to perform Gaussian noise injection or gas concentration label jitter is randomly selected to form a diversified training sample distribution.
[0031] Specifically, in the model training phase, in order to enhance the adaptability of the model to the complex downhole environment, the system performs data enhancement processing on the input feature vector 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 on the original feature value to simulate the downhole signal fluctuation; at the same time, on the label side, random jitter within ±15% is applied to the gas concentration label to simulate sensor measurement error and dynamic change of 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 distribution in the training process and improving the robustness and generalization performance of the model.
[0032] S1032, the training process adopts a multi-objective loss function combined with a data enhancement strategy: 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).
[0033] In a preferred embodiment, the weighting coefficients of the three parts are 0.7, 0.3 and 0.1 respectively; in the inference process, a sliding window mechanism is used for real-time data processing, and a double buffering pipeline is used for parallel execution of inference calculation; specifically, in the model training process, the system uses a multi-objective loss function to jointly optimize the model parameters to improve the performance of the model on multiple key indicators; the multi-objective loss function consists of three parts: the first part is the mean square error (MSE) of flow prediction, which is used to measure the difference between the compensated flow output by the model and the true flow, and the weight coefficient is 0.7; the second part is the mean absolute error (MAE) of time difference prediction, which is used to constrain the prediction accuracy of the model for ultrasonic wave propagation time difference, and the weight coefficient is 0.3; the third part is the dynamic time warping alignment loss (DTW Loss), which is used to optimize the alignment effect of multi-path signals on the time axis, and the weight coefficient is 0.1; by jointly optimizing these three loss terms, the model can maintain the overall flow prediction accuracy while considering the stability of signal timing alignment; in the inference phase after model deployment, the system uses a sliding window mechanism to process real-time collected ultrasonic signals, with a window length of 50ms and a sliding step of 20ms to ensure data continuity and real-time performance; at the same time, the system realizes parallel execution of inference calculation through a double buffering pipeline mechanism to ensure that the model inference delay is controlled within 50ms, meeting the real-time requirements of the gas flow measurement system.
[0034] In step S104, the compensation value output by the model is applied to the original flow measurement value to realize real-time calibration output of the 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, corrects the measurement result through a dynamic compensation algorithm, and thus outputs a more accurate gas flow value; this process is executed in real time in the edge computing device in a sliding window mechanism, ensuring that the system response delay is controlled within 50 ms; at the same time, the system visually displays 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 conveying process.
[0035] Applying the compensation value output by the model to the original flow measurement value to realize real-time calibration output of the gas flow includes: determining the compensation value based on the trained machine learning model, displaying a hyperbolic curve comparison chart in real time to show the difference change trend between the original flow and the compensated flow; generating a gas concentration pressure thermal map based on GIS coordinates to reflect the spatial distribution state of gas concentration pressure at different positions; when it is detected that the gas concentration pressure exceeds the set threshold, the flow 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.
[0036] Specifically, after the compensation value is generated, the system multiplies the compensation coefficient predicted by the model with the original flow measurement value through a dynamic compensation algorithm to obtain the calibrated gas flow output; the compensation algorithm adopts a confidence weighting mechanism, combines the confidence predicted by the model with the historical median for smoothing processing to prevent output mutation caused by single prediction deviation; at the same time, the system front end displays a hyperbolic curve comparison chart in real time to respectively show the change trend of the original flow and the compensated flow, facilitating the operator to intuitively judge the compensation effect; in addition, the system generates a gas concentration pressure thermal map based on the collected gas concentration and pressure, temperature data in combination with the GIS coordinate information of the deployment position to reflect the spatial distribution state of gas concentration in different regions. As shown in FIG. 8, the double-line chart of the computer flow original measurement value and the compensation value and the distribution thermal map of the gas in the measurement channel under a certain working condition are displayed, and through the front-end data display, the distribution of the gas concentration in the gas detection channel can be intuitively displayed, and the final data after the system compensation is limited.
[0037] In terms of abnormal detection, the system sets multi-level early warning rules, and when it is detected that the gas concentration exceeds 1.5 Kg / m 3 , the flow fluctuation amplitude exceeds ±5%, or the signal signal-to-noise ratio is lower than the set threshold, the early warning mechanism is automatically triggered, and the abnormal event is recorded to the database for subsequent analysis and tracing.
[0038] Please refer to Figure 9 , Figure 9A structural schematic diagram of a gas ultrasonic transducer rapid matching device provided by an embodiment of the present application is shown in FIG. 1. Figure 9 As shown in the figure, the compensation device 200 includes: A data acquisition and signal processing module 210 is configured to acquire original measurement data by deploying an ultrasonic sensor in a gas delivery pipeline and to perform data acquisition in combination with environmental parameter information; to perform wavelet denoising processing on the acquired ultrasonic signal and to perform time sequence alignment on the multi-path signal by using a dynamic time warping algorithm; A feature extraction and modeling module 220 is configured to extract time domain, frequency domain, environmental and statistical features from the denoised and time sequence aligned signal to form a multi-dimensional feature vector; to input the multi-dimensional feature vector into a time sequence feature branch and an environmental feature branch respectively for feature modeling and to perform weighted fusion on the outputs of different feature branches by using an attention mechanism; A model training module 230 is configured to train a machine learning model based on the fused feature data, and the training process is configured to adjust the learning model parameters by using a multi-objective loss function, and to use the model with adjusted parameters to predict an output compensation value; A flow compensation module 240 is configured to apply the compensation value output by the model to the original flow measurement value to realize real-time calibration output of the gas flow.
[0039] Further, the data acquisition includes input data acquisition and output label data acquisition; when the data acquisition and signal processing module 210 is configured to perform wavelet denoising processing on the acquired ultrasonic signal and to perform time sequence alignment on the multi-path signal by using a dynamic time warping algorithm, it is specifically configured to: acquire ultrasonic time differences t1 and t2 for preliminary estimation of flow rate; acquire received signal amplitude and signal-to-noise ratio SNR for evaluation of signal quality; acquire gas concentration, temperature, humidity and pressure for reflecting the state of the channel gas; acquire multi-path ultrasonic data for improving measurement stability, the multi-path ultrasonic data being acquired by deploying an ultrasonic sensor of an orthogonal array; The output label data acquisition is to acquire real gas flow data, and the real gas flow data is a flow reference value under different gas states simulated in a laboratory.
[0040] Further, the wavelet denoising processing includes: performing wavelet transform on the original ultrasonic signal by using a db4 wavelet basis function, suppressing the high-frequency coefficients after the transform by using a soft threshold method, and retaining the low-frequency trend part to obtain the denoised ultrasonic signal; The dynamic time warping algorithm comprises: using a fast DTW algorithm to perform dynamic time warping processing on the multi-path ultrasonic signal, and using a multi-resolution strategy to gradually approach the optimal alignment path layer by layer; before performing the DTW alignment, performing wavelet packet decomposition on the signal after wavelet denoising, and extracting the wavelet packet decomposition coefficients as the input features of the DTW; in the DTW alignment process, using a multi-dimensional DTW algorithm to perform joint time sequence alignment on the multi-channel signal; in the DTW alignment process, introducing a slant window to constrain the path offset range and limit the global offset of the alignment path; in the distance measurement of the DTW, using a multi-scale distance based on wavelet coefficients as the similarity measurement method; After the DTW alignment is completed, the time difference change rate and the signal similarity matrix after alignment are extracted.
[0041] Further, the feature extraction and modeling module 120 is configured to extract time domain, frequency domain, environmental and statistical features from the signals after denoising and time sequence alignment to form a multi-dimensional feature vector, and input the multi-dimensional feature vector into a time sequence feature branch and an environmental feature branch for feature modeling, and when the outputs of different feature branches are weighted and fused through an attention mechanism, the specific operations are as follows: The time domain features are extracted in the window by using a sliding window statistical method, and the time domain features include a time difference Δt and a signal energy; the frequency domain features are extracted by using a 5-layer db4 wavelet packet decomposition method, and the frequency domain features include a wavelet energy spectrum, and the frequency range is 0-200 kHz; the environmental features are extracted by using a polynomial cross-feature generation method based on gas concentration and temperature; after abnormal filtering based on the 3σ principle, the joint statistical features of kurtosis and variance are extracted; The waveform is subjected to time sequence feature modeling, and the 4-dimensional environmental parameters are subjected to feature modeling, the outputs of different feature branches are weighted and spliced through an attention mechanism, and feature fusion is realized.
[0042] Further, the model training module 230 is configured to train a machine learning model based on the fused feature data, and when a multi-objective loss function is used in the training process and a data enhancement strategy is combined, the specific operations are as follows: In the model training process, a Gaussian noise injection strategy is used to add Gaussian white noise with a mean of 0 and a standard deviation σ=0.05 to the continuous feature dimensions in the input feature vector, and in the model training process, a random jitter within ±15% is applied to the gas concentration label, and in each training iteration, it is randomly selected whether to perform Gaussian noise injection or gas concentration label jitter to form a diversified training sample distribution.
[0043] Further, the multi-objective loss function is composed of three parts: a mean square error MSE of flow prediction, an average absolute error MAE of time difference prediction, and a dynamic time warping alignment loss DTW, and the weighting coefficients are 0.7, 0.3 and 0.1 respectively; A sliding window mechanism is adopted in the inference process for real-time data processing, and a double-buffer pipeline is used for parallel execution of inference calculation.
[0044] Further, the flow compensation module 240 is used for applying the compensation value output by the model to the original flow measurement value to realize real-time calibration output of the gas flow. The compensation value is determined based on the trained machine learning model calculation, and a hyperbolic curve comparison chart is displayed in real time to show the difference trend between the original flow and the compensated flow. A gas concentration pressure thermal map based on GIS coordinates is generated to reflect the spatial distribution state of gas concentration pressure at different positions. When the gas concentration pressure exceeds the set threshold, the flow 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.
[0045] The machine learning-based ultrasonic gas flow measurement compensation device provided by the embodiments of the present application acquires original measurement data by deploying ultrasonic sensors, collects data in combination with environmental parameter information, and performs wavelet denoising and dynamic time warping processing on the collected signals. After extracting multi-dimensional features, feature fusion is performed through branch modeling and attention mechanism, 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 realize real-time calibration output of the gas flow. This scheme effectively improves the accuracy and stability of gas flow measurement and is suitable for industrial field applications in complex flow field environments.
[0046] Please refer to Figure 10 , Figure 10 The electronic device structure schematic diagram for quickly matching the gas ultrasonic transducer provided by the embodiments of the present application is shown in FIG. 1. Figure 10 As shown in FIG. 1, the electronic device 300 includes a processor 310, a memory 320, and a bus 330.
[0047] The memory 320 stores machine-readable instructions executable by the processor 310. When the electronic device 300 is running, the processor 310 communicates with the memory 320 through the bus 330. The machine-readable instructions executed by the processor 310 can perform the steps of the machine learning-based ultrasonic gas flow measurement compensation method in the above method embodiments. For specific implementation, please refer to the method embodiments, which will not be described here.
[0048] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program can execute the steps of the method for compensating ultrasonic gas flow measurement based on machine learning when the computer program is run by a processor. The specific implementation manners can be referred to the method embodiments, and will not be described here.
[0049] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, and will not be described here.
[0050] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented by other manners. The foregoing device embodiments are merely schematic, for example, the division of the units is only a logical function division, and another division manner can be used in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interfaces, devices or units, and can be electrical, mechanical or other forms.
[0051] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment scheme.
[0052] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0053] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a nonvolatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present application essentially or the parts of the prior art that make contributions or parts of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0054] Finally, it should be noted that: the above-described embodiments are only specific embodiments of the present application, which are used to illustrate the technical solutions of the present application, but not to limit them. The protection scope of the present application is not limited thereto. Although the present 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 make modifications or easily think of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed by the present application, or make equivalent replacements to some of the technical features. The modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A gas ultrasonic transducer rapid matching method, characterized in that, obtain original measurement data by deploying ultrasonic sensors in the gas conveying pipeline, and combine environmental parameter information for data collection; perform wavelet denoising processing on the collected ultrasonic signals, and use a dynamic time warping algorithm to perform time sequence alignment on the multi-path signals; extract time domain, frequency domain, environmental and statistical features from the denoised and time sequence aligned signals to form a multi-dimensional feature vector; input the multi-dimensional feature vector into a time sequence feature branch and an environmental feature branch respectively for feature modeling, and use an attention mechanism to weight and fuse the outputs of different feature branches; train a machine learning model based on the fused feature data, adjust the learning model parameters using a multi-objective loss function during the training process, and use the model with adjusted parameters to predict the output compensation value; apply the compensation value output by the model to the original flow measurement value to realize real-time calibration output of the gas flow.
2. The gas ultrasonic transducer rapid matching method according to claim 1, characterized in that: the data collection includes input data collection and output label data collection; the input data collection includes collecting ultrasonic time differences t1 and t2 for preliminary estimation of flow rate; collecting signal amplitude and signal-to-noise ratio SNR for evaluation of signal quality; collecting gas concentration, temperature, humidity, and pressure for reflecting the state of the channel gas; and collecting multi-path ultrasonic data for improving measurement stability, which is obtained by deploying orthogonal array ultrasonic sensors; the output label data collection is to collect real gas flow data, which is the flow reference value under different gas states simulated in the laboratory.
3. The gas ultrasonic transducer rapid matching method according to claim 2, characterized in that: the wavelet denoising processing includes: using a db4 wavelet basis function to perform wavelet transform on the original ultrasonic signal, using a soft threshold method to suppress the high frequency coefficients after wavelet transform, and retaining the low frequency trend part to obtain the denoised ultrasonic signal; the dynamic time warping algorithm includes: using a fast DTW algorithm to perform dynamic time warping processing on the multi-path ultrasonic signal, using a multi-resolution strategy to approach the optimal alignment path layer by layer, performing wavelet packet decomposition on the wavelet denoised signal before DTW alignment, 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 sequence alignment on the multi-channel signals, introducing a slant window to constrain the path offset range and limit the global offset of the alignment path; in the distance measurement of DTW, using a multi-scale distance based on wavelet coefficients as the similarity measurement method; after the DTW alignment is completed, the time difference change rate and the signal similarity matrix after alignment are extracted.
4. The method of claim 1, wherein, the extraction of time domain, frequency domain, environmental and statistical features from the denoised and time sequence aligned signals to form a multi-dimensional feature vector; inputting the multi-dimensional feature vector into a time sequence feature branch and an environmental feature branch respectively for feature modeling, and using an attention mechanism to weight and fuse the outputs of different feature branches includes: The sliding window statistical method is adopted to extract time domain features in the window, the time domain features including time difference Δt and signal energy; the 5-layer db4 wavelet packet decomposition method is adopted to extract frequency domain features, the frequency domain features including wavelet energy spectrum, and the frequency range being 0-200 kHz; the environmental features are extracted based on the polynomial cross-feature generation method of gas concentration and temperature, pressure; after abnormal filtering based on the 3σ principle, the joint statistical features of kurtosis and variance are extracted; The waveform is subjected to time sequence feature modeling, and the 4-dimensional environmental parameters are subjected to feature modeling, the outputs of different feature branches are weighted and spliced through the attention mechanism, and feature fusion is realized.
5. The gas ultrasonic transducer fast matching method according to claim 1, characterized in that, the trained machine learning model based on the fused feature data, the training process adopting a multi-objective loss function and combining a data enhancement strategy comprises: In the model training process, a Gaussian noise injection strategy is adopted to add Gaussian white noise to the continuous feature dimensions in the input feature vector, and a random jitter is applied to the gas concentration label during the model training process. In each training iteration, it is randomly selected whether to perform Gaussian noise injection or gas concentration label jitter to form a diversified training sample distribution.
6. A method of rapid matching of a gas ultrasonic transducer according to claim 5, characterized in that, The training process adopts a multi-objective loss function and combines a data enhancement strategy, which comprises: The multi-objective loss function consists of three parts: the mean square error MSE of flow rate prediction, the mean absolute error MAE of time difference prediction, and the dynamic time warping alignment loss DTW, and the weighting coefficients are 0.7, 0.3 and 0.1 respectively; In the inference process, a sliding window mechanism is adopted for real-time data processing, and parallel execution of inference calculation is performed through a double-buffer pipeline.
7. The method of claim 1, wherein, The compensation value output by the model is applied to the original flow rate measurement value to realize real-time calibration output of the gas flow, which comprises: Based on the trained machine learning model, the compensation value is calculated and determined, a hyperbolic curve comparison chart is displayed in real time to show the difference trend between the original flow rate and the compensated flow rate; A gas pressure thermal map based on GIS coordinates is generated to reflect the spatial distribution state of gas pressure at different positions; When it is detected that the gas pressure exceeds the set threshold, the flow fluctuation exceeds the set range, or the signal quality drops to the critical value, a warning is triggered and an abnormal event is recorded.
8. A gas ultrasonic transducer rapid matching device, characterized by, It comprises: A data acquisition and signal processing module is used to deploy ultrasonic sensors in the gas conveying pipeline to acquire original measurement data and combine environmental parameter information for data acquisition; wavelet denoising processing is performed on the acquired ultrasonic signals, and a dynamic time warping algorithm is used to time-align the multi-path signals; A feature extraction and modeling module is used to extract time domain, frequency domain, environmental and statistical features from the denoised and time-aligned signals to form a multi-dimensional feature vector; the multi-dimensional feature vector is input into a time sequence feature branch and an environmental feature branch for feature modeling, and the outputs of different feature branches are weighted and fused through an attention mechanism; A model training module is configured to train a machine learning model based on the fused feature data, wherein the training process uses a multi-objective loss function to adjust the learning model parameters, and the model with adjusted parameters is used to predict the compensation value. A flow compensation module is configured to apply the compensation value output by the model to the original flow measurement value to realize real-time calibration output of the gas flow.
9. An electronic device, comprising: The method comprises the following steps: A processor, a clock chip, a memory and a bus, wherein the memory stores machine readable instructions executable by the processor, the processor and the memory communicate through the bus when the electronic device is running, and the machine readable instructions are executed by the processor to perform the steps of the machine learning based ultrasonic gas flow measurement compensation method according to any one of claims 1 to 7. 10.A computer readable storage medium, comprising: The computer readable storage medium stores a computer program, and the computer program is executed by the processor to perform the steps of the machine learning based ultrasonic gas flow measurement compensation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Ultrasonic gas flowmeter on basis of FPGA (field programmable gate array) and DSP (digital signal processor)
CN104697593A
Method and system for analyzing transducer consistency based on DTW algorithm and computer
CN116465472A
Ultrasonic flowmeter correction device, method and system based on BP neural network
CN117309077A
Method for measuring water flow velocity
CN118671376A
Signal processing method of computer system
CN119669647A
Cited By
Multi-component gas monitoring device and method based on unmanned aerial vehicle carried sensor array
CN121299053A
Gas ultrasonic flowmeter signal processing method, device, equipment and medium
CN121384168A
Ultrasonic transducer measuring device and use method thereof
CN121409369A
Internet of Things water meter operation mode monitoring method
CN121677886A
Ultrasonic sensor environment compensation method and system based on multi-modal feature fusion
CN121763267A