Ultrasonic gas flow measurement method and system based on flow regime adaptive sampling
Patent Information
- Application Number
- CN202610737462.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-27
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2046-05-27
AI Technical Summary
[0005]为了解决现有技术中存在的时差法超声波流量计在信号信噪比欠缺、采样策略动态调整有限以及复杂流态识别精度不足等问题,本发明提出了基于流态自适应采样的超声波气体流量测量方法和系统,其具体技术方案如下:
[0052] The beneficial effects of this invention are as follows: A phase coding enhancement mechanism is introduced, utilizing the high time-bandwidth product characteristics of the 13-bit Barker code to perform phase modulation and superposition of sub-pulses to generate excitation signals, significantly improving the anti-interference performance of the signal under strong noise backgrounds; This invention proposes an adaptive wavelet denoising mechanism, which performs multi-layer wavelet decomposition on the original echo signal and calculates an adaptive threshold by combining it with the noise standard deviation. The threshold function smooths the detail coefficients of each layer, effectively suppressing complex background noise while preserving echo characteristics to the maximum extent; This invention also proposes a flow-sensing sampling strategy, which identifies pulsating flow by extracting features such as the jump ratio, asymmetry, and persistence ratio of the flow velocity sequence, and captures implicit pulsations by combining random phase misalignment sampling. The sampling period is dynamically calculated and adjusted based on the rate of change of the propagation time difference, improving the dynamic response accuracy of the measurement.
Smart Images

Figure CN122282037B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ultrasonic detection and flow measurement technology, specifically to an ultrasonic gas flow measurement method and system based on flow-adaptive sampling. Background Technology
[0002] In recent years, the field of ultrasonic flow metering has developed rapidly, especially with the emergence of time-of-flight ultrasonic measurement methods, which have greatly improved the real-time monitoring capability of gas flow. With the development of multi-signal processing technology and coded excitation methods, the measurement performance of ultrasonic flow meters under complex flow field conditions has been continuously improved. By encoding and exciting the echo signal, performing noise reduction processing, and correlation enhancement, the echo recognition capability under low signal-to-noise ratio conditions can be improved to a certain extent, thereby enhancing the stability and accuracy of flow measurement. This type of technology has been gradually applied in fields such as energy metering and industrial process control.
[0003] In practical applications of ultrasonic precision measurement, traditional methods typically rely on single-pulse or single-frequency sinusoidal excitation signals. These methods struggle to handle insufficient signal energy and strong background noise due to the strong attenuation caused by gaseous media, limiting the utilization of the time-width-bandwidth product potential of the ultrasonic excitation signal. Current ultrasonic flow measurement methods often employ frequency domain filtering and fixed-threshold detection structures for echo signal processing. However, these methods are ineffective at extracting the time-frequency local features of the echo signal when dealing with complex flow fields and non-stationary noise conditions, limiting noise reduction and feature enhancement capabilities and consequently affecting the reliability of echo feature identification. Furthermore, existing measuring instruments often use fixed sampling periods, lacking the perception and real-time adaptive adjustment of dynamic fluid disturbance characteristics. Implicit pulsating flow and abrupt flow regime changes are ignored, impacting the dynamic response accuracy and system power consumption.
[0004] Therefore, a method for ultrasonic flow measurement is needed. This method comprehensively processes the echo signal by introducing phase encoding enhancement, signal denoising processing, and a flow-sensing-based sampling period adjustment mechanism, thereby improving the stability and measurement accuracy of flow data generation under complex flow fields and non-stationary noise conditions. Summary of the Invention
[0005] To address the shortcomings of existing time-of-flight ultrasonic flowmeters, such as insufficient signal-to-noise ratio, limited dynamic adjustment of sampling strategies, and inadequate accuracy in identifying complex flow regimes, this invention proposes an ultrasonic gas flow measurement method and system based on flow regime adaptive sampling. The specific technical solution is as follows:
[0006] An ultrasonic gas flow rate measurement method based on flow-adaptive sampling includes the following steps:
[0007] Step 1: Acquire the broadband ultrasonic excitation signal encoded by Barker code phase, and transmit it in the downstream and upstream directions through the ultrasonic transmitting transducer, so that the signal can propagate through the gas medium;
[0008] Step 2: Receive the original forward and reverse echo signals after propagation through the gas medium, and perform wavelet denoising processing on the original forward and reverse echo signals to obtain the denoised echo signals;
[0009] Step 3: Obtain a stored copy of the broadband ultrasonic excitation signal as a reference signal and perform matched filtering on the denoised echo signal to achieve pulse compression. Then, calculate the propagation time difference between upstream and downstream flow through cross-correlation analysis and cosine interpolation, and derive the instantaneous gas velocity and flow rate by combining the pipeline parameters.
[0010] Step 4: Acquire the current gas flow rate data and write it into the annular buffer. Perform mean binarization on the flow rate samples within the sampling window. Extract key features such as jump ratio, asymmetry, and persistence ratio to achieve logical determination of pulsating flow and steady-state flow.
[0011] Step 5: Obtain the flow regime determination result. During the steady-state flow, randomly insert high-frequency sampling to monitor implicit pulsations. Dynamically adjust the target sampling period based on the flow regime characteristics and the propagation time difference information obtained from the sampling to achieve adaptive sampling control of the flow meter.
[0012] Furthermore, step one specifically includes:
[0013] Step 1.1: Determine the phase modulation basis sequence: Select the Barker code phase coding sequence with the lowest sidelobe characteristics as the phase modulation basis sequence of the ultrasonic excitation signal;
[0014] Step 1.2: Generate discrete phase-coded excitation signal: Select a sinusoidal monochromatic pulse that matches the center frequency of the ultrasonic transducer as a sub-pulse sequence. Perform periodic phase modulation and superposition on the sub-pulse sequence through a phase modulation basis sequence to generate a discrete phase-coded excitation signal with a high time-width-bandwidth product.
[0015] Step 1.3, Emission of excitation signal: The generated discrete phase encoded excitation signal is input to the high-voltage excitation circuit. The high-voltage excitation circuit drives the ultrasonic transducer to convert the electrical signal into ultrasonic waves and emit them along the flow direction with and against the flow.
[0016] Furthermore, step two specifically includes:
[0017] Step 2.1, Acquisition of raw echo signals: The raw downstream echo signal and the raw upstream echo signal of the ultrasonic wave after propagation through the gas medium are acquired by an ultrasonic transducer.
[0018] Step 2.2 Wavelet decomposition: The original downstream echo signal and the original upstream echo signal are iteratively decomposed using discrete wavelet transform to obtain multi-layer wavelet coefficients, which are a series of sub-band coefficients carrying low-frequency contour information and high-frequency detail information.
[0019] Step 2.3, Threshold Calculation: Calculate a threshold with adaptive adjustment performance based on the current wavelet decomposition level, noise standard deviation, and signal sampling point number;
[0020] Step 2.4, Detail Coefficient Processing: The threshold function is applied to the sub-band coefficients of each layer carrying high-frequency detail information obtained from the decomposition to suppress noise and retain useful signal features;
[0021] Step 2.5: Reconstruction of the original signal after denoising: Perform inverse discrete wavelet transform on the wavelet coefficients of each layer after thresholding to reconstruct the smooth time-domain signal after denoising.
[0022] Furthermore, in step 2.2, the discrete wavelet transform selects the Db3 wavelet basis function and sets the number of decomposition levels.
[0023] Furthermore, step three specifically includes:
[0024] Step 3.1, Obtaining the reference spectrum for matched filtering: Convert the broadband ultrasonic excitation signal to the frequency domain and extract the conjugate form of its spectrum as the reference excitation signal spectrum for performing matched filtering operations;
[0025] Step 3.2, Pulse compression processing: The denoised echo signal is converted to the frequency domain and multiplied with the spectrum of the reference excitation signal, and then an inverse fast Fourier transform is performed to convert it back to the time domain to obtain the downstream and upstream pulse compression signals;
[0026] Step 3.3, Matched Filtering: Perform cross-correlation analysis on the downstream and upstream pulse compression signals, and find the time delay when the two signals achieve the maximum similarity through the cross-correlation function;
[0027] Step 3.4, Cosine Interpolation Algorithm: Perform cosine interpolation algorithm on the main peak of the cross-correlation function and its neighboring sampling points to obtain the sub-sampling level propagation time difference;
[0028] Step 3.5, Calculation of airflow velocity: Based on the subsampling level propagation time difference, the effective sound path length of the ultrasonic wave in the gas, the ultrasonic speed in the current gas medium, and the sensor installation angle, the fluid velocity is calculated;
[0029] Step 3.6, Calculation of air flow rate: Combine the calculated flow velocity with the effective cross-sectional area of the fluid pipe and the flow correction coefficient to deduce the instantaneous volumetric flow rate and cumulative flow rate.
[0030] Furthermore, step four specifically includes:
[0031] Step 4.1: Buffer storage of historical flow data: The historical flow data in the gas pipeline is sampled according to the sampling period, and the flow rate samples are stored in the buffer.
[0032] Step 4.2 Flow Binarization and Statistical Processing: Calculate the mean of the flow velocity samples in the buffer and use it as the discrimination threshold to perform binarization on all flow velocity samples, generate a binarized sequence and count its number of transitions, number of quantized values and the length of the longest segment with consecutive 1s, in order to describe the fluctuation structure and continuous state of the flow velocity sequence.
[0033] Step 4.3 Calculation of key features: Extract key features for flow regime determination, including the jump ratio that measures the frequency of sequence fluctuations, the asymmetry that reflects the degree of sequence bias, and the percentage of the largest continuous segment that characterizes the duration of high flow velocity segments.
[0034] Step 4.4 Flow regime determination: Based on the jump ratio, asymmetry and the proportion of the largest continuous segment, combined with the preset threshold, the gas flow regime is determined to identify whether the current flow regime is pulsating flow or steady-state flow.
[0035] Furthermore, step 4.3 specifically includes:
[0036] The number of times adjacent elements change state is counted based on the binarized sequence, that is, the total number of times they change from 0 to 1 or from 1 to 0. The jump ratio is calculated based on the total number of intervals. The jump ratio is used to measure the fluctuation frequency of the sequence within the sampling window. The higher the value, the more frequently the flow rate fluctuates around the mean. The lower the value, the more stable the flow rate.
[0037] The number of 1s and 0s in the binarized sequence is counted, and the asymmetry is calculated. The asymmetry reflects the degree of bias of the sequence towards the high or low value side. The larger the value, the more concentrated the flow velocity is on the high or low value side. The smaller the value, the more evenly the flow velocity is distributed between the high and low values.
[0038] The longest segment of consecutive 1s in the binarized sequence is identified and its proportion of the entire sampling window is calculated to characterize the duration of high-velocity segments, thereby distinguishing between short-term spikes and plateau or decaying pulsating flows.
[0039] Further, step 4.4 specifically involves: setting a preset threshold. , and According to the jump ratio Asymmetry and the percentage of the largest consecutive segment Determine the gas flow state: when the jump ratio Greater than or equal to the jump threshold When the current flow state is determined to be pulsating flow; when the transition ratio is less than the threshold... When determining whether the asymmetry degree and the proportion of the largest continuous segment simultaneously satisfy the condition that the asymmetry degree is greater than or equal to the threshold, the following criteria are used: And the proportion of the largest consecutive segment is greater than or equal to the threshold. When the condition is met, it is also determined to be a pulsating flow; when the jump ratio is less than the threshold... And the asymmetry is less than the threshold. Or the percentage of the largest consecutive segment is less than the threshold. When the flow is steady, it is determined to be a steady-state flow.
[0040] Furthermore, step five specifically includes:
[0041] Step 5.1, Receiving and Refining the Flow Pattern: Receive the flow pattern determination result. If it is determined to be a steady flow, introduce a time offset to perform test random phase misalignment sampling, and execute the operation in step four to complete the final flow pattern determination and identify the implicit pulsating flow.
[0042] Step 5.2, Flow Condition Confirmation and Sampling Period Adjustment Trigger: Based on the judgment result of Step 5.1, determine whether to start the adaptive sampling period adjustment process: When the current flow condition is confirmed to be a stable flow condition, there is no need to start the adaptive sampling period adjustment process, and the target sampling period is set to the current sampling period to maintain the existing sampling strategy unchanged; when the current flow condition is confirmed to be an explicit pulsating flow or an implicit pulsating flow, the adaptive sampling period adjustment process is started, and the disturbance feature parameter extraction step is entered;
[0043] Step 5.3, Real-time extraction and quantification of flow disturbance characteristic parameters: In the case of confirmed pulsating flow, read the propagation time difference data obtained in two adjacent sampling periods from the buffer, calculate the rate of change of the propagation time difference information obtained from continuous sampling in adjacent sampling periods and the average absolute error of historical samples, and quantify the disturbance intensity.
[0044] Step 5.4 Adaptive calculation of target sampling period: Using the mean absolute error as a constraint relationship for the typical perturbation scale, calculate the target sampling period for the next period based on the change in propagation time difference.
[0045] Step 5.5, Sampling Period Update and Execution: Determine the optimal target sampling period based on the final flow state determination result in Step 5.1 and perform dynamic adjustment: If the flow state is confirmed as a stable flow state, it is determined that no adjustment of the sampling rate is required; if the flow state is confirmed as an implicit pulsating flow or an explicit pulsating flow, the target sampling period is set to the sampling period determined in Step 5.4.
[0046] An ultrasonic gas flow measurement system based on flow-adaptive sampling includes:
[0047] The broadband ultrasonic excitation signal acquisition module is used to perform the task of generating and transmitting broadband ultrasonic excitation signals encoded by Barker code phase.
[0048] The wavelet denoising module is used to suppress noise in the transmitted signal while preserving the characteristics of a smooth signal.
[0049] The matched filtering and flow calculation module is used to improve timing accuracy through pulse compression technology, calculate the propagation time difference between upstream and downstream flow through cross-correlation analysis and cosine interpolation, and derive the instantaneous gas velocity and flow rate by combining pipeline parameters;
[0050] The flow regime identification module is used to extract gas flow regime features and analyze the structured features of the flow velocity sequence to achieve real-time identification and classification of pulsating flow and steady flow in airflow conditions;
[0051] The adaptive data sampling period adjustment module is used to randomly insert high-frequency samples during steady-state flow to monitor implicit pulsations. It dynamically adjusts the target sampling period based on flow characteristics and propagation time difference information obtained from sampling, thereby achieving adaptive sampling control of the flow meter.
[0052] The beneficial effects of this invention are as follows: A phase coding enhancement mechanism is introduced, utilizing the high time-bandwidth product characteristics of the 13-bit Barker code to perform phase modulation and superposition of sub-pulses to generate excitation signals, significantly improving the anti-interference performance of the signal under strong noise backgrounds; This invention proposes an adaptive wavelet denoising mechanism, which performs multi-layer wavelet decomposition on the original echo signal and calculates an adaptive threshold by combining it with the noise standard deviation. The threshold function smooths the detail coefficients of each layer, effectively suppressing complex background noise while preserving echo characteristics to the maximum extent; This invention also proposes a flow-sensing sampling strategy, which identifies pulsating flow by extracting features such as the jump ratio, asymmetry, and persistence ratio of the flow velocity sequence, and captures implicit pulsations by combining random phase misalignment sampling. The sampling period is dynamically calculated and adjusted based on the rate of change of the propagation time difference, improving the dynamic response accuracy of the measurement. Attached Figure Description
[0053] Figure 1 This is a flowchart of an ultrasonic gas flow measurement method based on flow-adaptive sampling according to an embodiment of the present invention;
[0054] Figure 2 This is a flowchart of the wavelet denoising method for ultrasonic wave receivers in both forward and reverse directions, as described in this embodiment.
[0055] Figure 3 This is a flowchart of the airflow velocity calculation method in this embodiment;
[0056] Figure 4 This is a flowchart of gas flow pattern feature extraction and preliminary determination in this embodiment;
[0057] Figure 5 This is a flowchart of the adaptive sampling strategy selection based on flow regime classification in this embodiment. Detailed Implementation
[0058] To make the objectives, technical solutions, and technical effects of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0059] like Figure 1 As shown in this embodiment, an ultrasonic gas flow rate measurement method based on flow-adaptive sampling is disclosed, which includes the following steps:
[0060] Step 1: Acquire a broadband ultrasonic excitation signal encoded by Barker code phase, and transmit it through a transducer in the downstream and upstream directions, respectively, so that the signal can propagate through the gas medium.
[0061] In an ultrasonic gas flow measurement system, a broadband ultrasonic excitation signal acquisition module is used to perform the task of generating and transmitting a broadband ultrasonic excitation signal encoded by Barker code phase. Specifically, this includes:
[0062] Step 1.1: Determine the phase modulation basis sequence: Select a 13-bit Barker-coded sequence with the lowest sidelobe characteristics. The sequence is defined as , serving as the phase modulation basis sequence of the ultrasonic excitation signal. For the discrete-time index of the sequence, satisfying .
[0063] Step 1.2: Generate discrete phase coded excitation signal:
[0064] Select the center frequency of the transducer used. The matched sinusoidal monochromatic sub-pulse is used as the basic excitation waveform, denoted as . Its duration is:
[0065] ,
[0066] By using the 13-bit Barker encoding sequence As a phase modulation basis sequence, the sub-pulse signal is periodically phase modulated and then shifted and superimposed in time order to construct a discrete phase-coded ultrasonic excitation signal with a high time-bandwidth product. , excitation signal The generation satisfies the following relation:
[0067] ,
[0068] in, The code length for Barker encoding is the number of sub-pulses. The number of sampling points for each sub-pulse. For discrete-time indexing, Used to control the phase flip of the corresponding sub-pulse.
[0069] Step 1.3, Transmission of excitation signal:
[0070] The generated discrete phase encoded excitation signal The signal is input to a high-voltage excitation circuit, which drives an ultrasonic transducer to convert the electrical signal into ultrasonic waves. The transducer emits broadband ultrasonic waves in both the forward and reverse directions of the airflow, allowing the signal to propagate through the gas medium.
[0071] Step 2: The receiving end acquires the original downstream echo signal and the original upstream echo signal after propagation through the gas medium, and performs wavelet denoising processing to obtain the denoised downstream and upstream echo signals.
[0072] like Figure 2 As shown, a wavelet denoising module is employed to suppress noise while preserving useful signal features to the maximum extent. This module mainly includes wavelet decomposition, threshold calculation, detail coefficient processing, and signal reconstruction. Its input is the acquired raw downstream echo signal. and the original reverse echo signal The output is a denoised, smoothed time-domain signal. The specific steps are as follows:
[0073] Step 2.1: Acquisition of raw echo signals: Using pairs of ultrasonic transducers arranged in the co-current and counter-current directions, the raw co-current echo signals of ultrasonic waves propagating in the gas flow medium are acquired. and the original reverse echo signal This signal is then used as the input signal for subsequent wavelet denoising.
[0074] Step 2.2, Wavelet Decomposition: Decompose the input noisy ultrasonic echo signal and Discrete wavelet transform is used for iterative decomposition. The Db3 wavelet basis function is selected, and the number of decomposition levels is set. After wavelet decomposition, the original signal is decomposed into a series of subband coefficients: ,in It is the first Approximation coefficients of the layer It is the first The detail coefficients of each layer carry low-frequency contour information and high-frequency detail information of the signal, respectively. For ease of description, the wavelet coefficients of each layer are uniformly denoted as... ,in Indicates the number of decomposition layers. Indicates coefficient index.
[0075] Step 2.3, Threshold Calculation: Based on the current processing layer and signal characteristics, calculate a threshold with adaptive adjustment performance. :
[0076] ,
[0077] in, The standard deviation of noise. The number of signal sampling points. This is the index of the wavelet decomposition level currently being processed.
[0078] Step 2.4, Detail Coefficient Processing: A threshold function is applied to the detail coefficients obtained from the decomposition to suppress noise while preserving useful signal features to the maximum extent. The processed denoising wavelet coefficients are shown below. Satisfies the following mathematical relationship:
[0079] ,
[0080] in , These are the wavelet coefficients before and after processing, respectively. This is the sign function, used to extract the positive and negative directions of wavelet coefficients, ensuring that the denoising process does not change the phase polarity of the signal.
[0081] Step 2.5, Reconstruction of the original signal after denoising: Reconstructing the wavelet coefficients of each layer after thresholding. Perform inverse discrete wavelet transform to reconstruct the denoised smooth time-domain signal. and This is used for subsequent pulse compression processing.
[0082] Step 3: Obtain a stored copy of the broadband ultrasonic excitation signal as a reference signal and perform matched filtering on the denoised forward and reverse flow echo signals to achieve pulse compression. Then, calculate the forward and reverse flow time difference through cross-correlation analysis and cosine interpolation, and derive the instantaneous gas velocity and flow rate by combining the pipeline parameters.
[0083] like Figure 3 As shown, a matched filtering and flow rate calculation module is used, and pulse compression technology is employed to improve timing accuracy, ultimately calculating the gas velocity and flow rate information. This module mainly includes reference spectrum acquisition, pulse compression processing, cross-correlation analysis, cosine interpolation, and flow rate model calculation. Its inputs are the denoised forward and reverse flow echo signals and a reference copy of the excitation signal, and its outputs are the gas velocity and flow rate. The specific steps are as follows:
[0084] Step 3.1, Obtaining the Matched Filter Reference Spectrum: The broadband ultrasonic excitation signal obtained in Step 1... Its spectrum is obtained by converting it to the frequency domain using Fast Fourier Transform. Extracting and acquiring the spectrum conjugate form The spectrum of the reference excitation signal is used to perform the matched filtering operation.
[0085] Step 3.2, Pulse Compression Processing: The denoised downstream echo signal obtained in Step 2 is processed... and reverse echo signal The echo signal spectrum is obtained by converting it to the frequency domain using a Fast Fourier Transform. In the frequency domain, compare the spectra of the two echo signals with the conjugate reference spectrum determined in step 3.1. Pulse compression is achieved by performing multiplication operations. The mathematical expression of the pulse compression process is as follows:
[0086] ,
[0087] Finally, an inverse fast Fourier transform is performed on the spectra of the two obtained pulse compression signals to transform them back into the time domain, yielding a downstream pulse compression signal with a clear main peak and good sidelobe suppression. and reverse pulse compression signal .
[0088] Step 3.3, Matched Filtering: Compress the downstream pulse signal obtained in Step 3.2. and reverse pulse compression signal Perform cross-correlation analysis. This is done using the cross-correlation function. Find the time delay between two signals that achieve maximum similarity on the time axis. The peak position of the cross-correlation function corresponds to the transit time difference between signals. ,Right now .
[0089] Step 3.4, Cosine Interpolation Algorithm: To overcome the limitation of digital sampling rate on timing accuracy and achieve sub-sampling level time difference extraction, the cross-correlation function in Step 3.3 is used... The main peak and its neighboring sampling points are processed using a cosine interpolation algorithm to obtain a high-precision propagation time difference. .
[0090] Step 3.5, Airflow velocity calculation: Obtain the refined subsampling-level propagation time difference. At a sound path length of The speed of sound in a stationary medium is The fluid velocity is Furthermore, the cosine of the angle between the ultrasonic beam and the flow direction is... Time difference It can be represented as:
[0091] ,
[0092] In the denominator By rearranging this approximate relationship, the fluid velocity can be calculated. The solution is as follows:
[0093] ,
[0094] in, It is the effective sound path length (in meters) of ultrasound propagation in gas. It is a geometric correction factor for the sensor mounting angle. It is the ultrasonic velocity in the current gaseous medium, while It is a high-precision time difference obtained through cross-correlation and cosine interpolation.
[0095] Step 3.6, Airflow Calculation: Calculate the airflow velocity... Effective cross-sectional area of combined fluid pipe and flow correction coefficient The instantaneous volumetric flow rate at that time point can then be calculated. and cumulative traffic :
[0096] ,
[0097] .
[0098] Step 4: Acquire the current gas flow rate data and write it into the annular buffer. Perform mean binarization on the flow rate samples within the sampling window. By extracting key features such as the jump ratio, asymmetry, and persistence ratio, realize the logical determination of pulsating flow and steady-state flow.
[0099] like Figure 4 As shown, the role of the gas flow pattern feature extraction and preliminary judgment in step four of the flow pattern identification module is to achieve real-time identification and classification of pulsating flow and steady-state flow in airflow conditions by analyzing the structured features of the flow velocity sequence. This module mainly includes historical data caching, signal binarization processing, key feature extraction, and flow pattern logic judgment. Specifically:
[0100] Step 4.1: Buffer storage of historical flow data: Before starting operation, the flow pattern identification module stores the historical flow data in the gas pipeline according to the current sampling period. Sampling is performed, and the N most recent flow velocity samples are stored in a buffer for subsequent flow regime analysis. The samples in the buffer can be represented as:
[0101] ;
[0102] in, Indicates the first The system continuously acquires the latest changes in flow velocity within a sliding window by maintaining the data in the buffer, providing a complete data foundation for subsequent statistical analysis and flow regime determination.
[0103] Step 4.2, Flow Binarization and Statistical Processing: Calculate the mean of the flow velocity samples within the buffer zone to obtain the sample mean. :
[0104] ,
[0105] The system then uses this average. As a discrimination threshold, for all flow rate samples Perform binarization to generate a binarized sequence. The binarization rules are as follows:
[0106] ,
[0107] The binary sequence is used to describe the distribution of flow velocity around the average value. The system then performs further statistical analysis on this binary sequence, primarily including the number of transitions. Number of quantized values and And the length of the longest segment with consecutive 1s. :
[0108] ,
[0109] Continuous length This represents the maximum length of consecutive 1s in a binary sequence. These statistical results can comprehensively describe the fluctuation structure and persistence of the velocity sequence.
[0110] Step 4.3, Calculation of Key Feature Quantities: After completing the flow velocity binarization and basic statistics, the system further extracts key feature quantities for flow regime determination to comprehensively describe the fluctuation characteristics and structural features of the flow velocity sequence. Specifically, the system first calculates the key feature quantities based on the binarized sequence. Count the number of state changes that occur between adjacent elements. That is, the total number of times the value changes from 0 to 1 or from 1 to 0, expressed as the total number of intervals. Calculate the jump ratio based on the baseline:
[0111] ,
[0112] The jump ratio is used to measure the frequency of fluctuation of the sequence within the sampling window. The higher the value, the more frequently the flow rate fluctuates around the mean, and the lower the value, the more stable the flow rate.
[0113] Subsequently, the system counted the number of 1s and 0s in the binary sequence, respectively. and And calculate the asymmetry:
[0114] ,
[0115] Asymmetry reflects the degree of bias of the sequence towards high or low values. The larger the value, the more concentrated the flow velocity is on the high or low value side, and the smaller the value, the more evenly the flow velocity is distributed between high and low values.
[0116] Simultaneously, the system identifies the length of the longest segment in a binary sequence that consists of consecutive 1s. And calculate its proportion of the entire sampling window:
[0117] ,
[0118] Maximum consecutive segment percentage Used to characterize the duration of high-velocity sections, thereby distinguishing short-duration spikes from plateau-type or decaying pulsating flows.
[0119] By jointly calculating three features—jump ratio, asymmetry, and the proportion of the largest continuous segment—the system can comprehensively describe the fluctuation amplitude, bias, and high-energy persistence of the velocity sequence within a sliding window, providing a complete basis for subsequent flow regime determination and effectively avoiding the interference of occasional spikes on the determination results.
[0120] Step 4.4, Flow Regime Determination: After completing the calculation of key feature quantities, the system determines the flow regime based on the jump ratio. Asymmetry and the percentage of the largest consecutive segment To accurately distinguish between pulsating and steady-state flow, the system sets a preset threshold to determine the gas flow state. , and When the jump ratio Greater than or equal to the jump threshold When the system determines the current flow state to be pulsating flow, this determination applies to periodic or significantly fluctuating pulsating flows; when the jump ratio is less than a threshold... Then, the system further determines whether the asymmetry degree and the proportion of the largest continuous segment simultaneously satisfy the condition that the asymmetry degree is greater than or equal to the threshold. And the proportion of the largest consecutive segment is greater than or equal to the threshold. When the conditions are met, the system also classifies it as pulsating flow, and can identify situations where the high-velocity segment lasts for a long time or the flow velocity is mainly concentrated in the high-value region; when the jump ratio is less than the threshold And the asymmetry is less than the threshold. Or the percentage of the largest consecutive segment is less than the threshold. When this condition is met, the system is determined to be in a steady flow state. This determination applies to sequences with minimal velocity changes and no sustained high-energy states. The formula can be expressed as:
[0121] .
[0122] Step 5: Obtain the flow regime determination result. During the steady-state flow, randomly insert high-frequency sampling to monitor implicit pulsations. Dynamically adjust the target sampling period based on the flow regime characteristics and the propagation time difference information obtained from the sampling to achieve adaptive sampling control of the flow meter.
[0123] like Figure 5 As shown, the adaptive sampling strategy based on flow regime classification in step five receives the preliminary judgment result from step four. For the working condition judged as a steady-state flow, additional test samples are obtained by introducing random phase misalignment sampling to achieve accurate classification of explicit pulsating flow, implicit pulsating flow, and steady-state flow. This enables dynamic control of the sampling period. The main construction process is as follows:
[0124] Step 5.1, Receiving and Refining Flow Pattern Judgment: Before the adaptive adjustment of the data sampling period begins, the module first receives the flow pattern judgment result output in Step 4, and uses this judgment result as the initial basis for whether to trigger refined judgment; when the flow pattern judgment result indicates that the current flow pattern is pulsating flow, the data sampling period adaptive adjustment module directly enters the subsequent sampling period adaptive calculation process; when the previous step determines that the current flow pattern is a stable flow pattern, the system does not immediately reduce the sampling frequency or extend the sampling period, but maintains the basic sampling period at the current sampling period. Under the premise of no change, a test-based random phase misalignment sampling process is initiated to refine and verify the stable flow state determination results. This test-based phase misalignment sampling introduces a time offset based on the original sampling time. To achieve this, the time offset is set to the current sampling period. Half of, that is During normal sampling, the system randomly selects several sampling periods and collects additional samples at the offset sampling time within the corresponding period, thereby forming a set of test sample sequences that are out of phase with the original sampling sequence. .
[0125] The system then performs statistical analysis on the test sample sequence using the same processing flow as in step four, including sample mean calculation, binarization, and extraction of features such as jump ratio, asymmetry, and the proportion of consecutive identical value segments. Based on the same joint judgment rules as in step four, it further discriminates the current flow state. It can accurately identify previously masked implicit pulsating flows to confirm whether the current flow state is a stable flow state, an explicit pulsating flow, or an implicit pulsating flow.
[0126] Step 5.2, Flow Condition Confirmation and Sampling Period Adjustment Trigger: When the current flow condition is confirmed to be a stable flow condition by the precise refinement judgment, the data sampling period adaptive adjustment module determines that there is no need to start the sampling period adaptive adjustment process, and sets the target sampling period to the current sampling period to maintain the existing sampling strategy unchanged; when the current flow condition is confirmed to be an explicit pulsating flow or an implicit pulsating flow by the precise refinement judgment, the data sampling period adaptive adjustment module determines that the sampling period adaptive adjustment process needs to be started, and enters the disturbance feature parameter extraction step.
[0127] Step 5.3 Real-time extraction and quantification of flow disturbance characteristic parameters: When the flow is confirmed to be pulsating flow, the data sampling period adaptive adjustment module extracts and quantifies the disturbance characteristic parameters under the current flow state in real time based on the propagation time difference information obtained from continuous sampling, so as to provide a basis for the adaptive calculation of the subsequent sampling period.
[0128] The data sampling period adaptive adjustment module reads the propagation time difference data obtained in two adjacent sampling periods from the buffer, and records them as the propagation time difference of the current sampling period. Propagation time difference with the previous sampling period And in the current sampling period is Under the given conditions, calculate the change in propagation time difference within adjacent sampling periods. Based on the change in propagation time difference, the data sampling period adaptive adjustment module further calculates the rate of change of propagation time difference. This is used to quantify the intensity of change in propagation time difference per unit time, and its calculation method is as follows:
[0129] ,
[0130] Among them, the rate of change of flight time difference The magnitude of the value reflects the rate of change of fluid velocity under the current flow condition. The larger the value, the more severe the fluid disturbance.
[0131] Meanwhile, to characterize the overall fluctuation level of the propagation time difference over a longer time scale, the data sampling period adaptive adjustment module is based on multiple sets of historical propagation time difference samples stored in the buffer. Calculate the mean absolute error of the propagation time difference The calculation method is as follows:
[0132] ,
[0133] in, This represents the average value of the historical propagation time difference samples. Propagation time difference change rate. The mean absolute error reflects the instantaneous disturbance intensity of the current flow regime. These two parameters represent the level of disturbance that the system can stably track in historical statistics, and are the disturbance characteristic parameters required for adaptive adjustment of the sampling period.
[0134] Step 5.4 Adaptive Calculation of Target Sampling Period: After completing the real-time extraction and quantization of the flow disturbance characteristic parameters in Step 5.3, the data sampling period adaptive adjustment module adjusts the target sampling period based on the propagation time difference change rate. and mean absolute error The target sampling period for the next sampling period is adaptively calculated to achieve dynamic adjustment of the sampling period as the flow regime changes.
[0135] Given that the fluid state changes continuously between adjacent sampling periods, and that there are no sudden jumps in the propagation time difference within a single sampling period, the magnitude of the change in the propagation time difference within a sampling period can be approximated as proportional to the sampling period length. Therefore, when the next sampling period begins, the propagation time difference will change from the current sampling period. Adjust to target sampling period When the propagation time difference is expected to change in the next sampling period, it can be expressed as:
[0136] ,
[0137] To ensure the system can effectively track fluid disturbance changes in the next sampling period, the predicted change should not exceed the typical disturbance scale that the system can stably track in a historical statistical sense. This is based on the mean absolute error obtained in step 5.3. Establish the following constraints:
[0138] ,
[0139] By organizing the above constraints, the target sampling period is obtained. The calculation formula is:
[0140] ,
[0141] The target sampling period The sampling period decreases as the amplitude of the propagation time difference increases, and increases as the amplitude of the propagation time difference decreases, thus enabling the sampling period to be adaptively adjusted according to the intensity of fluid disturbance.
[0142] Step 5.5, Sampling Period Update and Execution: After confirming the flow regime and its potential characteristics through the precise and refined judgment in Step 5.1, the system will immediately enter the sampling period. The dynamic adjustment phase is then implemented, and the optimal target sampling period is determined based on the final discrimination result. If the flow regime is confirmed to be a truly stable flow regime, the system determines that there is no need to adjust the sampling rate and adopts Strategy 1, which is to adjust the target sampling period. Set to the current sampling period :
[0143] ,
[0144] If the flow regime is identified as implicit or explicit pulsating flow, the system adopts sampling strategy 2, which involves targeting the sampling period. Set to use the sampling period determined in step 5.4. :
[0145] .
[0146] In summary, this invention first generates a broadband excitation signal with a high time-bandwidth product by phase modulation of a sinusoidal pulse, driving a transducer to emit ultrasonic waves along both the forward and reverse flow directions of the airflow. Next, the receiver acquires the original forward and reverse flow echo signals, performs wavelet decomposition, and combines this with an adaptive threshold function for denoising and reconstruction to suppress noise and extract useful signal features. Then, the denoised echo is matched and filtered with the reference signal spectrum to achieve pulse compression. Cross-correlation analysis is performed on the forward and reverse flow pulse compression signals to extract the propagation time difference, thereby calculating the real-time flow velocity and flow rate. Then, by binarizing and statistically analyzing the flow velocity data samples, features such as the jump ratio, asymmetry, and the proportion of the largest continuous segment are extracted to determine the gas flow state, and a random phase misalignment sampling technique is introduced to identify implicit pulsating flow. Finally, based on the flow state determination results, the propagation time difference change rate and mean absolute error are calculated, and the target sampling period for the next cycle is dynamically calculated and updated, achieving adaptive adjustment of the sampling strategy according to fluid disturbances.
[0147] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any way. Although the implementation process of the present invention has been described in detail above, those skilled in the art can still modify the technical solutions described in the foregoing examples or make equivalent substitutions for some of the technical features. All modifications and equivalent substitutions made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for measuring ultrasonic gas flow rate based on flow-adaptive sampling, characterized in that, Includes the following steps: Step 1: Acquire the broadband ultrasonic excitation signal encoded by Barker code phase, and transmit it in the downstream and upstream directions through the ultrasonic transmitting transducer, so that the signal can propagate through the gas medium; Step 2: Receive the original forward and reverse echo signals after propagation through the gas medium, and perform wavelet denoising processing on the original forward and reverse echo signals to obtain the denoised echo signals; Step 3: Obtain a stored copy of the broadband ultrasonic excitation signal as a reference signal and perform matched filtering on the denoised echo signal to achieve pulse compression. Then, calculate the propagation time difference between upstream and downstream flow through cross-correlation analysis and cosine interpolation, and derive the instantaneous gas velocity and flow rate by combining the pipeline parameters. Step 4: Acquire the current gas flow rate data and write it into the annular buffer. Perform mean binarization on the flow rate samples within the sampling window. Extract key features such as jump ratio, asymmetry, and persistence ratio to achieve logical determination of pulsating flow and steady-state flow. Step 5: Obtain the flow regime determination result. During the steady-state flow, randomly insert high-frequency sampling to monitor implicit pulsations. Dynamically adjust the target sampling period based on the flow regime characteristics and the propagation time difference information obtained from the sampling to achieve adaptive sampling control of the flow meter. Step four specifically includes: Step 4.1: Buffer storage of historical flow data: The historical flow data in the gas pipeline is sampled according to the sampling period, and the flow rate samples are stored in the buffer. Step 4.2 Flow Binarization and Statistical Processing: Calculate the mean of the flow velocity samples in the buffer and use it as the discrimination threshold to perform binarization on all flow velocity samples, generate a binarized sequence and count its number of transitions, number of quantized values and the length of the longest segment with consecutive 1s, in order to describe the fluctuation structure and continuous state of the flow velocity sequence. Step 4.3 Calculation of key features: Extract key features for flow regime determination, including the jump ratio that measures the frequency of sequence fluctuations, the asymmetry that reflects the degree of sequence bias, and the percentage of the largest continuous segment that characterizes the duration of high flow velocity segments. Step 4.4 Flow regime determination: Based on the jump ratio, asymmetry and the proportion of the largest continuous segment, combined with the preset threshold, the gas flow regime is determined to identify whether the current flow regime is pulsating flow or steady-state flow. Step 4.3 specifically involves: The number of times adjacent elements change state is counted based on the binarized sequence, that is, the total number of times they change from 0 to 1 or from 1 to 0. The jump ratio is calculated based on the total number of intervals. The jump ratio is used to measure the fluctuation frequency of the sequence within the sampling window. The higher the value, the more frequently the flow rate fluctuates around the mean. The lower the value, the more stable the flow rate. The number of 1s and 0s in the binarized sequence is counted, and the asymmetry is calculated. The asymmetry reflects the degree of bias of the sequence towards the high or low value side. The larger the value, the more concentrated the flow velocity is on the high or low value side. The smaller the value, the more evenly the flow velocity is distributed between the high and low values. The longest segment of consecutive 1s in the binarized sequence is identified and its proportion of the entire sampling window is calculated to characterize the duration of high-velocity segments, thereby distinguishing between short-term spikes and plateau or decaying pulsating flows.
2. The ultrasonic gas flow rate measurement method based on flow-adaptive sampling according to claim 1, characterized in that, Step one specifically includes: Step 1.1: Determine the phase modulation basis sequence: Select the Barker code phase coding sequence with the lowest sidelobe characteristics as the phase modulation basis sequence of the ultrasonic excitation signal; Step 1.2: Generate discrete phase-coded excitation signal: Select a sinusoidal monochromatic pulse that matches the center frequency of the ultrasonic transducer as a sub-pulse sequence. Perform periodic phase modulation and superposition on the sub-pulse sequence through a phase modulation basis sequence to generate a discrete phase-coded excitation signal with a high time-width-bandwidth product. Step 1.3, Emission of excitation signal: The generated discrete phase encoded excitation signal is input to the high-voltage excitation circuit. The high-voltage excitation circuit drives the ultrasonic transducer to convert the electrical signal into ultrasonic waves and emit them along the flow direction with and against the flow.
3. The ultrasonic gas flow rate measurement method based on flow-adaptive sampling according to claim 1, characterized in that, Step two specifically includes: Step 2.1, Acquisition of raw echo signals: The raw downstream echo signal and the raw upstream echo signal of the ultrasonic wave after propagation through the gas medium are acquired by an ultrasonic transducer. Step 2.2 Wavelet decomposition: The original downstream echo signal and the original upstream echo signal are iteratively decomposed using discrete wavelet transform to obtain multi-layer wavelet coefficients, which are a series of sub-band coefficients carrying low-frequency contour information and high-frequency detail information. Step 2.3, Threshold Calculation: Calculate a threshold with adaptive adjustment performance based on the current wavelet decomposition level, noise standard deviation, and signal sampling point number; Step 2.4, Detail Coefficient Processing: The threshold function is applied to the sub-band coefficients of each layer carrying high-frequency detail information obtained from the decomposition to suppress noise and retain useful signal features; Step 2.5: Reconstruction of the original signal after denoising: Perform inverse discrete wavelet transform on the wavelet coefficients of each layer after thresholding to reconstruct the smooth time-domain signal after denoising.
4. The ultrasonic gas flow rate measurement method based on flow-adaptive sampling according to claim 3, characterized in that, In step 2.2, the discrete wavelet transform selects the Db3 wavelet basis function and sets the number of decomposition levels.
5. The ultrasonic gas flow rate measurement method based on flow-adaptive sampling according to claim 1, characterized in that, Step three specifically includes: Step 3.1, Obtaining the reference spectrum for matched filtering: Convert the broadband ultrasonic excitation signal to the frequency domain and extract the conjugate form of its spectrum as the reference excitation signal spectrum for performing matched filtering operations; Step 3.2, Pulse compression processing: The denoised echo signal is converted to the frequency domain and multiplied with the spectrum of the reference excitation signal, and then an inverse fast Fourier transform is performed to convert it back to the time domain to obtain the downstream and upstream pulse compression signals; Step 3.3, Matched Filtering: Perform cross-correlation analysis on the downstream and upstream pulse compression signals, and find the time delay when the two signals achieve the maximum similarity through the cross-correlation function; Step 3.4, Cosine Interpolation Algorithm: Perform cosine interpolation algorithm on the main peak of the cross-correlation function and its neighboring sampling points to obtain the sub-sampling level propagation time difference; Step 3.5, Calculation of airflow velocity: Based on the subsampling level propagation time difference, the effective sound path length of the ultrasonic wave in the gas, the ultrasonic speed in the current gas medium, and the sensor installation angle, the fluid velocity is calculated; Step 3.6, Calculation of air flow rate: Combine the calculated flow velocity with the effective cross-sectional area of the fluid pipe and the flow correction coefficient to deduce the instantaneous volumetric flow rate and cumulative flow rate.
6. The ultrasonic gas flow rate measurement method based on flow-adaptive sampling according to claim 1, characterized in that, Step 4.4 specifically involves setting a preset threshold. , and According to the jump ratio Asymmetry and the percentage of the largest consecutive segment Determine the gas flow state: when the jump ratio Greater than or equal to the jump threshold When the current flow state is determined to be pulsating flow; when the transition ratio is less than the threshold... When determining whether the asymmetry degree and the proportion of the largest continuous segment simultaneously satisfy the condition that the asymmetry degree is greater than or equal to the threshold, the following criteria are used: And the proportion of the largest consecutive segment is greater than or equal to the threshold. When the condition is met, it is also determined to be a pulsating flow; when the jump ratio is less than the threshold... And the asymmetry is less than the threshold. Or the percentage of the largest consecutive segment is less than the threshold. When the flow is steady, it is determined to be a steady-state flow.
7. The ultrasonic gas flow rate measurement method based on flow-adaptive sampling according to claim 1, characterized in that, Step five specifically includes: Step 5.1, Receiving and Refining the Flow Pattern: Receive the flow pattern determination result. If it is determined to be a steady flow, introduce a time offset to perform test random phase misalignment sampling, and execute the operation in step four to complete the final flow pattern determination and identify the implicit pulsating flow. Step 5.2, Flow Condition Confirmation and Sampling Period Adjustment Trigger: Based on the judgment result of Step 5.1, determine whether to start the adaptive sampling period adjustment process: When the current flow condition is confirmed to be a stable flow condition, there is no need to start the adaptive sampling period adjustment process, and the target sampling period is set to the current sampling period to maintain the existing sampling strategy unchanged; when the current flow condition is confirmed to be an explicit pulsating flow or an implicit pulsating flow, the adaptive sampling period adjustment process is started, and the disturbance feature parameter extraction step is entered; Step 5.3, Real-time extraction and quantification of flow disturbance characteristic parameters: In the case of confirmed pulsating flow, read the propagation time difference data obtained in two adjacent sampling periods from the buffer, calculate the rate of change of the propagation time difference information obtained from continuous sampling in adjacent sampling periods and the average absolute error of historical samples, and quantify the disturbance intensity. Step 5.4 Adaptive calculation of target sampling period: Using the mean absolute error as a constraint relationship for the typical perturbation scale, calculate the target sampling period for the next period based on the change in propagation time difference. Step 5.5, Sampling Period Update and Execution: Determine the optimal target sampling period based on the final flow state determination result in Step 5.1 and perform dynamic adjustment: If the flow state is confirmed as a stable flow state, it is determined that no adjustment of the sampling rate is required; if the flow state is confirmed as an implicit pulsating flow or an explicit pulsating flow, the target sampling period is set to the sampling period determined in Step 5.
4.
8. A system employing the ultrasonic gas flow measurement method based on flow-adaptive sampling as described in any one of claims 1 to 7, characterized in that, include: The broadband ultrasonic excitation signal acquisition module is used to perform the task of generating and transmitting broadband ultrasonic excitation signals encoded by Barker code phase. The wavelet denoising module is used to suppress noise in the transmitted signal while preserving the characteristics of a smooth signal. The matched filtering and flow calculation module is used to improve timing accuracy through pulse compression technology, calculate the propagation time difference between upstream and downstream flow through cross-correlation analysis and cosine interpolation, and derive the instantaneous gas velocity and flow rate by combining pipeline parameters; The flow regime identification module is used to extract gas flow regime features and analyze the structured features of the flow velocity sequence to achieve real-time identification and classification of pulsating flow and steady flow in airflow conditions; The adaptive data sampling period adjustment module is used to randomly insert high-frequency samples during steady-state flow to monitor implicit pulsations. It dynamically adjusts the target sampling period based on flow characteristics and propagation time difference information obtained from sampling, thereby achieving adaptive sampling control of the flow meter.
Citation Information
Patent Citations
Time difference method ultrasonic flow sensor with acoustic lens
CN202092696U
Ultrasonic current meter
JP2002340642A