Ultrasonic water meter flow measurement data processing method and device, electronic equipment and storage medium
By processing ultrasonic signals through windowing and framing with window functions, and combining Fourier transform and frequency domain filtering, a complete signal processing chain is constructed, which solves the accuracy and stability problems of ultrasonic flow measurement under complex working conditions and realizes high-precision flow measurement.
Patent Information
- Application Number
- CN202511164213.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-08-20
AI Technical Summary
Existing ultrasonic flow measurement technology has low measurement accuracy, weak anti-interference ability, and inadequate signal processing under low signal-to-noise ratio and complex working conditions, resulting in unstable measurement results.
Ultrasonic signals are processed by windowing and framing using a window function, combined with Fourier transform and frequency domain filtering, and the propagation time difference is extracted through cross-correlation analysis to build a complete signal acquisition, preprocessing, frequency domain enhancement and flow calculation chain.
The signal quality is improved, the stability and anti-interference ability of time difference extraction are enhanced, the robustness and accuracy of measurement are improved, and it is suitable for flow measurement under complex working conditions.
Smart Images

Figure CN120668227A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of ultrasonic measurement and signal processing, and in particular relates to an ultrasonic water meter flow measurement data processing method, device, electronic equipment and storage medium. Background Art
[0002] Ultrasonic flow measurement is a common non-contact fluid measurement method, widely used in water and heat meters, as well as in industrial process fluid monitoring. This technology typically uses ultrasonic transducers installed at both ends of a pipeline to transmit and receive ultrasonic signals in both the downstream and upstream directions. By comparing the time difference between the two propagation directions, the flow velocity in the pipeline is inferred and the overall flow rate is calculated based on the pipeline's cross-sectional area.
[0003] In related technologies, ultrasonic signals are typically processed directly in the time domain after acquisition, using methods such as signal enhancement and cross-correlation analysis. However, time domain signals are susceptible to noise interference, making it difficult to accurately extract the propagation time difference, especially in low signal-to-noise ratio environments, which affects measurement accuracy and stability.
[0004] On the other hand, the processes of ultrasonic signal preprocessing, frequency domain filtering, and frame reconstruction in related technologies are not systematic enough, and the signal utilization rate is low. Especially under non-ideal pipeline conditions (such as turbulence, water hammer, or multipath interference), the measurement results fluctuate greatly and the accuracy is limited. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to propose an ultrasonic water meter flow measurement data processing method, device, electronic device and storage medium. This method improves the accuracy and stability of propagation time difference extraction by introducing window function adding, framing, frequency domain transformation and filtering, frame-level time domain restoration and cross-correlation analysis in the ultrasonic signal processing process, enhances the anti-interference ability under complex working conditions, and thus improves the measurement reliability and application adaptability of ultrasonic water meters.
[0006] To achieve the above object, the technical solution created by the present invention is implemented as follows: In a first aspect, the present invention provides a method for processing ultrasonic water meter flow measurement data, the method comprising: S1. Acquire ultrasonic signals in the downstream direction and the upstream direction respectively based on the ultrasonic transducer, thereby forming a first time domain signal and a second time domain signal; S2. Performing windowing processing on the first time domain signal and the second time domain signal respectively, and dividing the signals into frames according to a predetermined frame length to obtain a first signal frame sequence and a second signal frame sequence; S3. Perform Fourier transform on the first signal frame sequence and the second signal frame sequence respectively to obtain corresponding frequency domain signal frame sequences, perform frequency domain filtering on the frequency domain signal frame sequences to remove noise and interference, and then perform inverse Fourier transform on the filtered frequency domain signal frame sequences to obtain a first time domain signal frame sequence and a second time domain signal frame sequence; S4. performing time sequence splicing on the first time domain signal frame sequence and the second time domain signal frame sequence, and extracting the ultrasonic wave propagation time difference through cross-correlation analysis; S5. Calculate the flow velocity based on the propagation time difference, and calculate the water flow rate in combination with the pipe cross-sectional area.
[0007] Furthermore, in step S2, the window function windowing processing is to apply a window function to the first time domain signal and the second time domain signal respectively to reduce boundary effects and leakage phenomena, and the window function includes any one of a Hamming window, a Hanning window or a Blackman window.
[0008] Furthermore, in step S2, the framing process divides the first time domain signal and the second time domain signal after windowing into frames based on a preset frame length N and a frame shift M to form the first signal frame sequence and the second signal frame sequence.
[0009] Furthermore, in step S3, the frequency domain filtering uses a bandpass filter to filter out noise and interference components in non-target frequency bands, and the bandpass filter includes a Gaussian or rectangular window frequency domain filter.
[0010] Furthermore, in step S4, the first time domain signal frame sequence and the second time domain signal frame sequence are spliced in time sequence to form a first time domain signal and a second time domain signal, and the ultrasonic propagation time difference is extracted by cross-correlation analysis, wherein the cross-correlation function for performing the cross-correlation analysis is defined as: ; The propagation time difference is t, , is the sampling period, and the first time domain signal is , the second time domain signal is , for and Delay between The cross-correlation function value under is the delay amount, is the number of sampling points contained in a single frame, for The maximum delay , The index of the sampling point in the current frame.
[0011] Furthermore, in step S5, the flow rate is calculated by the following formula: ; Wherein, L is the distance between ultrasonic transducers; and Represent the propagation time in the downstream and upstream directions respectively, satisfying t; The water flow rate is set to Q, which is calculated by the following formula: ; Where A is the cross-sectional area of the pipe, is the average flow velocity of water in the pipe.
[0012] In a second aspect, the present invention provides a flow measurement data processing device, comprising: The acquisition module acquires ultrasonic signals in the downstream direction and the upstream direction respectively through an ultrasonic transducer, thereby forming a first time domain signal and a second time domain signal.
[0013] The processing module performs window function windowing processing on the first time domain signal and the second time domain signal respectively, and divides the frames into frames according to a predetermined frame length to obtain a first signal frame sequence and a second signal frame sequence.
[0014] The filtering module performs Fourier transform on the first signal frame sequence and the second signal frame sequence respectively to obtain corresponding frequency domain signal frame sequences, performs frequency domain filtering on the frequency domain signal frame sequences to remove noise and interference, and then performs inverse Fourier transform on the filtered frequency domain signal frame sequences to obtain first time domain signal frame sequences and second time domain signal frame sequences.
[0015] The extraction module performs time sequence splicing on the first time domain signal frame sequence and the second time domain signal frame sequence, and extracts the ultrasonic wave propagation time difference through cross-correlation analysis.
[0016] The calculation module calculates the flow velocity based on the propagation time difference and calculates the water flow rate in combination with the cross-sectional area of the pipe.
[0017] In a third aspect, the present invention provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; When the processor executes the computer-executable instructions stored in the memory, it is used to implement the ultrasonic water meter flow measurement data processing method of the first aspect of the invention.
[0018] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the method for processing ultrasonic water meter flow measurement data is used to implement the content of the first aspect of the invention.
[0019] The above technical solution, through the establishment of independent preprocessing steps, windowing the raw ultrasonic signals in the downstream and upstream directions and performing fixed-length framing operations, thus endowing the signals with good time-domain boundary characteristics and local stationarity, effectively suppressing the spectrum diffusion and interference problems caused by the initial boundary discontinuity. Subsequently, in the frequency domain processing stage, a frame-by-frame Fourier transform is used to map the framed signals to the frequency domain, and a frequency domain filtering strategy is combined to effectively remove noise and interference components. This frequency domain filtering process can specifically suppress interference in non-target frequency bands and enhance the spectral concentration of the main signal. After filtering, the signal is restored to the time domain via an inverse Fourier transform, and a continuous sequence of first and second time domain signal frames is constructed through frame-level time splicing. This ensures the coherence and integrity of the final time domain signal while preserving the frequency domain enhancement effect, providing a high-quality signal foundation for time difference analysis. Furthermore, during the critical propagation time difference extraction stage, a cross-correlation analysis method is introduced to measure the similarity of the two signals at different time offsets and identify the delay corresponding to the most matching moment. This cross-correlation strategy has excellent noise immunity, and is particularly capable of accurately extracting the time delay information of the main propagation path in scenarios with multipath or complex background interference. Furthermore, based on the extracted time difference, combined with known structural parameters and physical models, the flow velocity is calculated, ultimately determining the volume flow rate within the pipeline.
[0020] In summary, the present invention focuses on core links such as signal quality improvement, interference suppression, and enhanced time difference recognition accuracy, and constructs a complete data processing chain from signal acquisition, frame filtering, reconstruction and splicing, time difference extraction to flow output. It can significantly improve the robustness, accuracy and engineering practicality of the flow measurement system under complex working conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings, which constitute part of the present invention, are intended to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are intended to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings: Figure 1 Schematic diagram of the process of ultrasonic water meter flow measurement data processing method provided in embodiment 1 of the present invention Figure 1 ; Figure 2 Schematic diagram of the process of ultrasonic water meter flow measurement data processing method provided in embodiment 2 of the present invention Figure 2 ; Figure 3 A schematic structural diagram of a flow measurement data processing device provided in a third embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of the electronic device hardware provided in the fourth embodiment of the present invention. DETAILED DESCRIPTION
[0022] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0023] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit differences. It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described in this application as "exemplary" or "for example" should not be interpreted as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more.
[0024] It should be noted that the phrase "at the time of..." in the embodiments of this application can refer to the instant a certain situation occurs or a period of time after the situation occurs, and this is not specifically limited in this embodiment of the application. Furthermore, the training method for lateral control of an autonomous driving vehicle provided in the embodiments of this application is merely an example, and the training method for lateral control of an autonomous driving vehicle may also include more or less content.
[0025] To facilitate a clear description of the technical solutions of the embodiments of the present application, some of the terms and technologies involved in the embodiments of the present application are briefly introduced below: Ultrasonic transducer: refers to an acoustic device installed on the pipe wall for sending or receiving ultrasonic signals. It is usually arranged in pairs, transmitting and receiving ultrasonic pulse signals in the downstream and upstream directions respectively.
[0026] Downstream direction / countercurrent direction: Downstream direction refers to the path where the ultrasonic wave propagation direction is consistent with the fluid flow direction, and countercurrent direction refers to the opposite path. The propagation time difference between the two reflects the influence of fluid flow velocity.
[0027] Sampling signal: refers to the discrete time series formed by digitizing the ultrasonic analog signal through the analog-to-digital converter (ADC), which serves as the basis for subsequent processing.
[0028] The first time domain signal / second time domain signal refers to the original sampling signals obtained in the downstream direction and the upstream direction, respectively, and represents the time domain response of the ultrasonic wave propagating in the two directions after passing through the medium.
[0029] Windowing: Before signal framing, a window function (such as a rectangular window or Hanning window) is used to weight each frame of the signal to reduce spectrum leakage caused by edge mutations and improve transformation stability.
[0030] Framing: refers to dividing a long continuous signal into several segments (frames) of fixed length to facilitate subsequent frame-by-frame analysis and processing.
[0031] Frame sequence: refers to a set of equal-length signal segments obtained after windowing and framing, which facilitates batch processing operations at the frame level.
[0032] Fourier transform / inverse Fourier transform: Fourier transform converts time domain signals into frequency domain to reveal the characteristics of frequency components; inverse transform restores frequency domain signals to time domain waveforms.
[0033] Frequency domain signal frame sequence: refers to the frequency domain data set obtained after Fourier transform of the framed signal, which is used for frequency domain processing (such as filtering).
[0034] Frequency domain filtering: Apply filters (such as bandpass, lowpass, and highpass) to signals in the frequency domain to remove noise or retain specific frequency bands to improve the quality of the target signal.
[0035] Time domain signal frame reconstruction: refers to restoring a time domain signal frame with higher clarity by performing an inverse transform on the spectrum after frequency domain filtering.
[0036] Time sequence stitching: Multiple frame-level signals are sequentially connected to form a continuous time sequence, maintaining the integrity on the time axis and ensuring consistency with the physical order of the original signal.
[0037] Cross-correlation analysis: used to detect the similarity between two signals at different time offsets and identify the propagation delay between signals by finding the maximum position of the cross-correlation function.
[0038] Propagation time difference: It indicates the time difference caused by the influence of fluid velocity during the transmission of ultrasonic signals in the downstream and upstream directions. It is the core parameter for calculating flow velocity.
[0039] Maximum correlation delay point: refers to the delay position corresponding to the peak in the cross-correlation function curve, indicating the most likely time alignment point of the two signals.
[0040] Sampling period: The time interval at which an ADC digitally samples a signal, often used to convert discrete delay points into real time.
[0041] Flow velocity calculation: Based on structural parameters such as the propagation time difference and the distance between sensors, the actual flow velocity of the medium in the pipeline is calculated using the principle of sound velocity difference.
[0042] Pipe cross-sectional area: refers to the cross-sectional area parameter inside the measured pipe, which is usually a fixed value and is used to convert flow velocity into volume flow.
[0043] Flow output: The volume flow rate passing through the pipeline per unit time is calculated by integrating the flow velocity and cross-sectional area, which can be used as a basis for measurement or control.
[0044] Complex working conditions: including unstable flow rate, bubbles or impurities in the water, multi-path signal reflection, strong noise interference and other environmental conditions, which pose challenges to traditional methods.
[0045] Anti-interference ability / robustness: refers to the ability of this method to maintain a stable data processing flow, accurate time difference extraction, and reliable flow calculation under the above-mentioned complex working conditions.
[0046] In existing technologies, flow measurement methods based on ultrasonic transducers are widely used to detect flow velocity and flow rate in pipeline media. Their advantages, such as non-contact, fast response, and adaptability to a variety of media, make them particularly practical in industrial flow measurement scenarios. However, current ultrasonic flow measurement systems still face many challenges in practical applications, primarily in terms of signal processing accuracy, anti-interference capabilities, and adaptability to complex environments.
[0047] First, existing technologies preprocess raw ultrasonic signals in a crude manner, lacking targeted data windowing and framing. Instead, they often analyze the entire signal as a whole, resulting in significant edge effects and severe spectral leakage, which impacts the quality of subsequent frequency-domain processing. Furthermore, some solutions fail to incorporate effective filtering mechanisms during frequency-domain analysis, or rely solely on fixed-threshold filtering. This makes it difficult to effectively remove high-frequency noise, pulse interference, or background spurious signals, leading to aliasing of frequency-domain features and reduced accuracy of time-difference calculations.
[0048] Secondly, the propagation time difference, as a key intermediate quantity in flow velocity calculation, is often roughly estimated in traditional methods through peak position, zero crossing point, correlation accumulation, etc., and is easily affected by noise or multipath interference. Especially in scenarios with low flow rate, small signal amplitude or complex water quality, time difference recognition is unstable and the accuracy fluctuates greatly, further amplifying the error in flow velocity calculation.
[0049] Furthermore, some existing methods have problems with loose links and lack of systematicity in the design of data processing processes. The processing steps from signal acquisition to output do not form an efficient closed loop, resulting in slow response speed and poor robustness of the overall system, which is not conducive to deployment and operation in actual industrial conditions such as high dynamics and high disturbances.
[0050] In summary, there is an urgent need for an ultrasonic water meter flow measurement data processing method that can improve signal quality, enhance the stability of time difference extraction, and build a complete processing flow to solve the above-mentioned shortcomings in the existing technology and meet the higher requirements for measurement accuracy, response speed and system stability under complex working conditions.
[0051] Based on this, the embodiments of the present application provide an ultrasonic water meter flow measurement data processing method, device, equipment and storage medium, which can be used in the field of ultrasonic measurement and signal processing technology, aiming to solve the above technical problems of the prior art.
[0052] Example 1 Figure 1 Schematic diagram of the process of ultrasonic water meter flow measurement data processing method provided in embodiment 1 of the present invention Figure 1 ,like Figure 1 As shown, the method includes: S1. Acquire ultrasonic signals in the downstream direction and the upstream direction respectively based on the ultrasonic transducer, thereby forming a first time domain signal and a second time domain signal; Specifically, in step S1, by configuring a pair of ultrasonic transducers, ultrasonic signals are emitted and received in the downstream and upstream directions respectively, and the time response of their propagation in the fluid is collected to generate a first time domain signal and a second time domain signal respectively, forming a complete two-way acoustic measurement channel. That is, step S1 realizes the accurate acquisition of two-way propagation information, effectively reflects the influence of fluid motion on the sound propagation path, and ensures that accurate flow velocity calculation can be carried out based on the propagation time difference in the two directions in the subsequent processing process. By distinguishing between the forward and reverse propagation signals, the adaptability to asymmetric flow or disturbance conditions can be enhanced, and the overall environmental adaptability of the measurement system can be improved.
[0053] S2. Perform windowing processing on the first time domain signal and the second time domain signal respectively, and divide the signals into frames according to a predetermined frame length to obtain a first signal frame sequence and a second signal frame sequence; Specifically, in step S2, window function processing is introduced before signal framing. The sampled signal is often weighted in the form of a Hanning window or a Hamming window, and then divided into multiple independent frames according to the set frame length to form a first signal frame sequence and a second signal frame sequence. That is, the window function windowing processing can effectively suppress the spectrum leakage phenomenon caused by the sudden change of the frame boundary and improve the energy focusing of the frequency domain analysis; and the frame processing can keep the signal stable within the local time period, which is more conducive to refined frequency domain analysis and time series reconstruction. Through step S2, the system signal processing link obtains good time-frequency resolution capability, providing high-quality input data for subsequent processing.
[0054] S3. Perform Fourier transform on the first signal frame sequence and the second signal frame sequence respectively to obtain corresponding frequency domain signal frame sequences, perform frequency domain filtering on the frequency domain signal frame sequences to remove noise and interference, and then perform inverse Fourier transform on the filtered frequency domain signal frame sequences to obtain first time domain signal frame sequences and second time domain signal frame sequences; Specifically, in step S3, the first and second signal frame sequences are Fourier transformed frame by frame to obtain a frequency domain signal frame sequence. Frequency domain filtering is then used to remove high-frequency noise, background interference, and spurious components. The filtered frequency domain data is then inverse Fourier transformed to reconstruct the purified first and second time domain signal frame sequences. Frequency domain filtering improves signal purity and the ability to express effective signal components, effectively removing interference components caused by pipeline impurities, transducer aging, or environmental noise. Furthermore, the time domain signal restored by the inverse transform exhibits greater stability and boundary continuity, laying a solid foundation for time difference analysis.
[0055] S4, performing time sequence splicing on the first time domain signal frame sequence and the second time domain signal frame sequence, and extracting the ultrasonic wave propagation time difference through cross-correlation analysis; Specifically, in step S4, the filtered and reconstructed frame sequences are spliced in chronological order to form complete continuous time-domain signals in the first and second directions. Subsequently, based on a cross-correlation analysis method, a sliding comparison is performed on the two signals to extract the most likely propagation time difference. In other words, the complete signal trajectory is restored through time-series splicing, avoiding the problem of signal continuity affected by frame structure fragmentation. Delay detection using a cross-correlation algorithm has strong noise robustness and positioning accuracy, and can accurately identify the time delay of the actual propagation path under complex conditions such as echo interference, nonlinear distortion, or signal envelope overlap.
[0056] S5. Calculate the flow velocity based on the propagation time difference, and calculate the water flow rate based on the cross-sectional area of the pipe.
[0057] Specifically, in step S5, the extracted propagation time difference is used as the core parameter, and the instantaneous flow velocity of the medium in the pipeline is calculated in combination with structural information such as the transducer spacing. Subsequently, the volume flow output is calculated in combination with the known cross-sectional area of the pipeline. That is, the flow velocity estimation method based on the propagation time difference has high accuracy and fast response. At the same time, by combining the actual pipeline size data, the water flow result can be output in real time, completing the closed-loop process from signal acquisition to metering output.
[0058] Therefore, the ultrasonic water meter flow measurement data processing method provided by the present invention systematically solves the technical difficulties existing in existing ultrasonic flow measurement technology, such as poor signal quality, weak anti-interference ability, and unstable time difference recognition, by constructing a complete signal acquisition, preprocessing, frequency domain enhancement, time difference extraction, and flow calculation chain. It has the following significant advantages: First, during the signal acquisition and preprocessing phase, the present invention utilizes a bidirectional synchronous ultrasonic signal acquisition mechanism, combined with windowing and fixed-length framing, to ensure the signal's time-frequency locality and boundary continuity from the source. This design effectively suppresses spectral leakage caused by signal truncation in traditional methods, providing a foundation for high-quality time-frequency analysis in subsequent processing.
[0059] Secondly, for signal enhancement, the present invention employs a frame-by-frame Fourier transform combined with frequency-domain filtering. This effectively removes all types of noise interference through frequency-domain selective filtering, while simultaneously reconstructing a pure time-domain signal through inverse transformation. This processing approach significantly improves the signal-to-noise ratio and feature preservation compared to traditional time-domain filtering or overall frequency-domain processing methods.
[0060] During the critical time difference extraction phase, the present invention restores signal continuity through time sequence splicing and accurately identifies propagation delays using cross-correlation analysis. This method fully leverages the overall waveform characteristics of the signal and, compared to traditional peak detection or zero-crossing detection methods, offers enhanced anti-interference capabilities and sub-sampling-level time resolution.
[0061] Finally, in the flow calculation phase, the present invention integrates high-precision time difference measurements with pipeline structural parameters for integrated calculation, achieving a complete closed-loop process from raw signal to flow output. This end-to-end processing ensures consistent and reliable measurement results, making it particularly suitable for long-term stable operation under complex industrial conditions.
[0062] In some embodiments, for the signal preprocessing process in step S2, windowing with a window function is performed as follows: a window function is applied to the first time-domain signal and the second time-domain signal respectively for windowing, so as to reduce the sudden change effect at the signal frame boundary and the resulting spectral leakage problem. Specifically, the window function used can be any one of a Hamming window, a Hanning window, or a Blackman window.
[0063] In some embodiments, for step S2, the framing process is based on a preset frame length N and a frame shift amount M. The windowed first time-domain signal and second time-domain signal are framed to form a first signal frame sequence and a second signal frame sequence. Here, the frame length N refers to the number of sampling points included in each frame, and the frame shift amount M refers to the offset of the starting position between adjacent frames; when M < N, there is an overlap between adjacent frames, which is often used to improve temporal continuity and frequency-domain smoothness. By setting reasonable N and M parameters in the present invention, while the signal is divided into multiple short time periods, necessary time continuity and spectral integrity are still retained.
[0064] Specifically, after framing with the window function, a gentle transition is formed between frame segments through overlap (determined by M < N), effectively alleviating the energy jump problem caused by hard cutting, further suppressing spectral leakage, and improving spectral smoothness and energy focusing ability.
[0065] At the same time, since the frame length N and the frame shift amount M are adjustable parameters, they can be dynamically configured according to the signal-to-noise ratio characteristics, waveform structure, and computing resources of different application scenarios, enhancing the adaptability of the system under different working conditions; for example, in a high-noise scenario, a longer frame length can be selected and combined with a smaller frame shift to improve spectral clarity and time tracking ability.
[0066] In some embodiments, for the frequency-domain filtering operation in step S3, a band-pass filter is used for frequency-domain filtering to suppress noise and interference components in non-target frequency bands in the frequency domain, thereby retaining the effective information consistent with the frequency of the ultrasonic main signal. Specifically, the band-pass filter includes a Gaussian-type frequency-domain filter or a rectangular-window-type frequency-domain filter.
[0067] Among them, a band-pass filter is a filtering structure that allows a specific frequency interval (i.e., the target frequency band) to pass through while suppressing all frequency components outside this frequency band. In the present invention, based on the characteristics that the signal emitted by the ultrasonic transducer has a stable center frequency and a limited bandwidth, the band-pass filter can be accurately designed around this main frequency range to shield irrelevant noise and abnormal spectral fluctuations.
[0068] In some embodiments, for step S4, the first time domain signal frame sequence and the second time domain signal frame sequence are spliced in time sequence to form a first time domain signal and a second time domain signal, and the ultrasonic propagation time difference is extracted by cross-correlation analysis, wherein the cross-correlation function for performing the cross-correlation analysis is defined as: ; The propagation time difference is t, , is the sampling period, and the first time domain signal is , the second time domain signal is , for and Delay between The cross-correlation function value under is the delay amount, is the number of sampling points contained in a single frame, for The maximum delay , The index of the sampling point in the current frame.
[0069] For example, the propagation time difference It represents the difference between the propagation time of ultrasonic wave in the downstream and upstream directions, which is the core input variable for the subsequent calculation of flow velocity and volume flow. , with stronger physical accuracy and signal consistency, building a high-quality data foundation for the entire measurement system.
[0070] In some embodiments, for step S5, the flow rate is calculated by the following formula: ; Wherein, L is the distance between ultrasonic transducers; and Represent the propagation time in the downstream and upstream directions respectively, satisfying t; The water flow rate is set to Q, which is calculated by the following formula: ; Where A is the cross-sectional area of the pipe, is the average flow velocity of water in the pipe.
[0071] In some embodiments, the time domain signals of ultrasonic waves propagating in the downstream and upstream directions are collected and cross-correlation analysis is performed to extract the propagation time difference between the two. t, the t represents the downstream propagation time and countercurrent propagation time The difference between t; It should be noted that in the ultrasonic water meter flow measurement data processing method, the downstream propagation time is not directly measured. and countercurrent propagation time Instead of using the specific value of the received signal in two directions, the cross-correlation function is used to analyze the received signals in two directions and identify the time delay points corresponding to the cross-correlation peak. , and then multiplied by the sampling period Calculate the propagation time difference t: ; Among them, the cross-correlation function measures the similarity between two waveforms at different time delays, and can stably and accurately extract the time difference between the waveforms. Even in the case of complex noise background or signal amplitude distortion, it can also achieve reliable matching. is the difference between the downstream and upstream propagation times, so as long as we know the average propagation time (For example, a preliminary estimate based on the sound velocity and the transducer spacing L) can be inferred through the following formula: , ; For example, when the flow rate is low, The value of is small, and conventional methods are prone to being unable to estimate the time difference stably due to signal ambiguity. The cross-correlation method can be enhanced by increasing the sampling rate or using interpolation. time resolution, thus achieving effective perception of flow velocities below 0.05m / s.
[0072] Example 2 Figure 2 Schematic diagram of the process of ultrasonic water meter flow measurement data processing method provided in embodiment 2 of the present invention Figure 2 , wherein this embodiment is in Figure 1 Based on the embodiment, the ultrasonic water meter flow measurement data processing method is described in detail. Figure 2 As shown, the method includes: S11. Disposing ultrasonic transducers at two end points of the pipeline, respectively, the ultrasonic transducers being configured to alternately transmit and receive ultrasonic signals to form a first ultrasonic signal propagating in a downstream direction in the pipeline and a second ultrasonic signal propagating in a countercurrent direction; Specifically, ultrasonic transducers are installed at both the upstream and downstream ends of the pipeline. These transducers alternately transmit and receive ultrasonic signals, generating a first ultrasonic signal propagating downstream and a second ultrasonic signal propagating upstream. This bidirectional signal generation mechanism not only reflects the fluid's effect on ultrasonic propagation velocity but also facilitates flow velocity calculation via time difference, improving measurement sensitivity and accuracy.
[0073] S12, sampling and processing the first ultrasonic signal and the second ultrasonic signal respectively to obtain corresponding first original time domain signals and second original time domain signals, and preprocessing the first original time domain signals and the second original time domain signals respectively, wherein the preprocessing includes applying a window function to both the first original time domain signal and the second original time domain signal to perform a windowing operation, and framing the windowed first original time domain signal and the second original time domain signal respectively to obtain a first signal frame sequence and a second signal frame sequence; Specifically, ultrasonic signals from two directions are sampled and processed to obtain a first original time-domain signal and a second original time-domain signal. To improve signal processing, these signals are windowed and framed to form a frame-level signal sequence. This process helps suppress spectral leakage, improves temporal resolution, and provides high-quality input for subsequent frequency-domain processing.
[0074] S13. Perform Fourier transform on the first signal frame sequence and the second signal frame sequence respectively to obtain a first frequency domain signal frame sequence and a second frequency domain signal frame sequence, and perform frequency domain filtering on the first frequency domain signal frame sequence and the second frequency domain signal frame sequence to obtain a third frequency domain signal frame sequence and a fourth frequency domain signal frame sequence after filtering.
[0075] Specifically, a fast Fourier transform is performed on the first and second signal frame sequences to obtain frequency domain representations. Frequency domain filtering is then applied to remove interference from irrelevant frequency bands, ultimately yielding third and fourth frequency domain signal frame sequences with a high signal-to-noise ratio. This step effectively mitigates the effects of power frequency, electromagnetic, or background noise, enhances the structural characteristics of the useful signal, and improves the accuracy of subsequent time difference extraction.
[0076] S14, performing inverse Fourier transform processing on the third frequency domain signal frame sequence and the fourth frequency domain signal frame sequence respectively to obtain restored first time domain signal frame sequence and second time domain signal frame sequence; Specifically, the third frequency domain signal frame sequence and the fourth frequency domain signal frame sequence are respectively subjected to inverse Fourier transform processing to obtain the restored first time domain signal frame sequence and the second time domain signal frame sequence, thereby enhancing the signal clarity and time domain alignment, and providing higher quality input for the next step of cross-correlation analysis.
[0077] S15. Perform cross-correlation analysis on the first time domain signal frame sequence and the second time domain signal frame sequence to extract a propagation time difference between the first ultrasonic signal and the second ultrasonic signal; Specifically, after the time-domain signal optimization is complete, cross-correlation analysis is performed to extract the propagation time difference between the first and second ultrasonic signals. This cross-correlation method extracts time differences by matching the entire waveform, avoiding reliance on starting points or instantaneous feature points. It exhibits excellent anti-interference capabilities and can generate stable and reliable time differences even at low flow rates or with poor signal-to-noise ratios.
[0078] S16. Calculate the velocity of the water flow in the pipe based on the propagation time difference and the preset distance between the ultrasonic transducers, and calculate the water flow rate according to the cross-sectional area of the pipe.
[0079] Specifically, the flow velocity is calculated based on the extracted propagation time difference and the preset distance between the transducers, and the water flow is calculated in combination with the pipe cross-sectional area, thereby reducing the dependence on time synchronization accuracy. It is suitable for water meter structures of different sizes and flow ranges, and the output results can be directly used for flow monitoring and billing management.
[0080] Specifically, in step S12, the window function is any one of the Hanning window, Hamming window or Blackman window, wherein the window function is set to ; The windowing operation includes: the first time domain signal is set to ; The second time domain signal is set to ,Will and Frames are divided according to fixed frame length N and frame shift M to form a frame sequence and ,in, represents the i-th frame of the first time domain signal, Indicates the i-th frame of the second time domain signal, and the value range of the frame index n is 0≤n <N; Apply a window function to each frame , obtaining the first signal frame sequence and the second signal frame sequence after windowing, wherein the windowing processing form of each frame is: ; ; Among them, i represents the frame number, n represents the sampling point in the frame, represents the first signal frame sequence, Represents a second signal frame sequence.
[0081] Specifically, the introduction of the window function significantly suppresses the spectrum leakage caused by the signal frame boundary, especially the frequency domain representation of short-time signal fragments is clearer and more reliable. At the same time, the frame length N and frame shift M are used for framing, so that the system has a sliding window structure to adapt to dynamic characteristics such as flow rate fluctuations and signal period changes. Moreover, the signal after windowing with the window function and standard framing has good waveform consistency and alignment, which is helpful for the accurate identification of cross-correlation peaks and propagation time differences. Stable extraction.
[0082] Specifically, in step S13, Fourier transform is performed on the first signal frame sequence and the second signal frame sequence respectively, and the transform formula is: ; ; Where k represents the frequency index, is the length of each frame, j is the imaginary unit, is the first frequency domain signal frame sequence, is the second frequency domain signal frame sequence.
[0083] Specifically, in step S13, frequency domain filtering includes applying a Gaussian bandpass filter to each frame in the first frequency domain signal frame sequence and the second frequency domain signal frame sequence, wherein the filter function is defined as: ; After filtering, we get: ; ; in, is the third frequency domain signal frame sequence, is the fourth frequency domain signal frame sequence, For the The filter gain coefficient of the frequency point is Controls the filter bandwidth. The smaller the value, the narrower the bandwidth. is the index corresponding to the center frequency of the filter.
[0084] Specifically, in step S14, an inverse Fourier transform is performed on each frame in the third frequency domain signal frame sequence and the fourth frequency domain signal frame sequence to obtain a first time domain signal frame sequence and a second time domain signal frame sequence, wherein the transformation formula is: ; ; in, and are respectively the first time domain signal frame sequence and the second time domain signal frame sequence, is the frame length, k is the frequency index, n is the sampling point index within the frame, and j is the imaginary unit.
[0085] Specifically, in step S15, the first time domain signal frame sequence and the second time domain signal frame sequence are spliced into a first reconstructed time domain signal and a second reconstructed time domain signal, respectively. The first reconstructed time domain signal is set to , the second reconstructed time domain signal is set to , and and Perform cross-correlation analysis; Among them, the cross-correlation function for performing cross-correlation analysis is defined as: ; The propagation time difference is t, , is the sampling period, and the first time domain signal is , the second time domain signal is , for and Delay between The cross-correlation function value under is the delay amount, is the number of sampling points contained in a single frame, for The maximum delay , The index of the sampling point in the current frame.
[0086] Specifically, in step S16, the velocity of the water flow in the pipe is calculated as follows: ; Wherein, L is the distance between ultrasonic transducers; and Represent the propagation time in the downstream and upstream directions respectively, satisfying t; The water flow rate is set to Q, which is calculated by the following formula: ; Where A is the cross-sectional area of the pipe.
[0087] Example 3 Figure 3 This is a schematic diagram of the structure of the flow measurement data processing device provided by the third embodiment of the present invention. Figure 3 As shown, the flow measurement data processing device 100 provided in the third embodiment of the present invention includes an acquisition module 110, a processing module 120, a filtering module 130, an extraction module 140 and a calculation module 150; The acquisition module 110 acquires ultrasonic signals in the downstream direction and the upstream direction respectively through an ultrasonic transducer, thereby forming a first time domain signal and a second time domain signal.
[0088] The processing module 120 performs windowing processing on the first time domain signal and the second time domain signal respectively, and divides the signals into frames according to a predetermined frame length to obtain a first signal frame sequence and a second signal frame sequence.
[0089] The filtering module 130 performs Fourier transform on the first signal frame sequence and the second signal frame sequence respectively to obtain corresponding frequency domain signal frame sequences, performs frequency domain filtering on the frequency domain signal frame sequences to remove noise and interference, and then performs inverse Fourier transform on the filtered frequency domain signal frame sequences to obtain first time domain signal frame sequences and second time domain signal frame sequences.
[0090] The extraction module 140 performs time sequence splicing on the first time domain signal frame sequence and the second time domain signal frame sequence, and extracts the ultrasonic wave propagation time difference through cross-correlation analysis.
[0091] The calculation module 150 calculates the flow velocity based on the propagation time difference and calculates the water flow rate in combination with the cross-sectional area of the pipe.
[0092] The flow measurement data processing device 100 provided in the third embodiment can execute the ultrasonic water meter flow measurement data processing method of the first embodiment. The implementation principle and technical effects are similar and will not be described in detail in the third embodiment.
[0093] In a specific implementation of the aforementioned flow measurement data processing device 100, each module can be implemented as a processor, and the processor can execute computer-executable instructions stored in the memory, so that the processor executes the aforementioned ultrasonic water meter flow measurement data processing method.
[0094] Example 4 Figure 4 This is a schematic diagram of the structure of the electronic device hardware provided in the fourth embodiment of the present invention. Figure 4 shows a block diagram of an exemplary electronic device 12 suitable for implementing embodiments of the present invention. Figure 4 The electronic device 12 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present invention.
[0095] like Figure 4 As shown, electronic device 12 is implemented as a general-purpose computing device. Components of electronic device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 that connects various system components (including system memory 28 and processing unit 16).
[0096] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0097] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0098] System memory 28 may include computer-readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer-readable storage media. By way of example only, storage system 34 may be configured to read and write to non-removable, non-volatile magnetic media. Each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.
[0099] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally implement the functions and / or methodologies of the embodiments described herein.
[0100] The electronic device 12 can also communicate with one or more external devices 14 (e.g., a keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the electronic device 12 / server / computer, and / or any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). This communication can occur via an input / output (I / O) interface 22. Furthermore, the electronic device 12 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with the electronic device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0101] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the ultrasonic water meter flow measurement data processing method provided in the embodiment of the present invention.
[0102] At the same time, an embodiment of the present invention further provides a storage medium containing computer executable instructions, which, when executed by a computer processor, is used to execute the ultrasonic water meter flow measurement data processing method provided in the above embodiment.
[0103] Example 5 The computer storage medium of the fifth embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component.
[0104] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0105] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0106] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0107] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for processing ultrasonic water meter flow measurement data, characterized in that: The following steps are involved: S1. Acquire ultrasonic signals in the downstream direction and the upstream direction respectively based on the ultrasonic transducer, thereby forming a first time domain signal and a second time domain signal; S2. Performing windowing processing on the first time domain signal and the second time domain signal respectively, and dividing the signals into frames according to a predetermined frame length to obtain a first signal frame sequence and a second signal frame sequence; S3. Perform Fourier transform on the first signal frame sequence and the second signal frame sequence respectively to obtain corresponding frequency domain signal frame sequences, perform frequency domain filtering on the frequency domain signal frame sequences to remove noise and interference, and then perform inverse Fourier transform on the filtered frequency domain signal frame sequences to obtain a first time domain signal frame sequence and a second time domain signal frame sequence; S4. performing time sequence splicing on the first time domain signal frame sequence and the second time domain signal frame sequence, and extracting the ultrasonic wave propagation time difference through cross-correlation analysis; S5. Calculate the flow velocity based on the propagation time difference, and calculate the water flow rate in combination with the pipe cross-sectional area.
2. The ultrasonic water meter flow measurement data processing method according to claim 1, characterized in that: In step S2, the window function windowing processing is to apply window functions to the first time domain signal and the second time domain signal respectively to reduce boundary effects and leakage phenomena, and the window function includes any one of a Hamming window, a Hanning window or a Blackman window.
3. The ultrasonic water meter flow measurement data processing method according to claim 1, characterized in that: In step S2, the framing process performs frame division on the windowed first time domain signal and the second time domain signal based on a preset frame length N and a frame shift M to form the first signal frame sequence and the second signal frame sequence.
4. The ultrasonic water meter flow measurement data processing method according to claim 1, characterized in that: In step S3, the frequency domain filtering uses a bandpass filter to filter out noise and interference components in non-target frequency bands. The bandpass filter includes a Gaussian or rectangular window frequency domain filter.
5. The ultrasonic water meter flow measurement data processing method according to claim 1, characterized in that: In step S4, the first time domain signal frame sequence and the second time domain signal frame sequence are spliced in time sequence to form a first time domain signal and a second time domain signal, and the ultrasonic propagation time difference is extracted by cross-correlation analysis, wherein the cross-correlation function for performing the cross-correlation analysis is defined as: ; The propagation time difference is t, , is the sampling period, and the first time domain signal is , the second time domain signal is , for and Delay between The cross-correlation function value under is the delay amount, is the number of sampling points contained in a single frame, for The maximum delay , The index of the sampling point in the current frame.
6. The ultrasonic water meter flow measurement data processing method according to claim 1, characterized in that: In step S5, the flow rate is calculated by the following formula: ; Wherein, L is the distance between ultrasonic transducers; and Represent the propagation time in the downstream and upstream directions respectively, satisfying t; The water flow rate is set to Q, which is calculated by the following formula: ; Where A is the cross-sectional area of the pipe, is the average flow velocity of water in the pipe.
7. A flow measurement data processing device, characterized in that: include: an acquisition module, which acquires ultrasonic signals in the downstream direction and the upstream direction respectively through an ultrasonic transducer, thereby forming a first time domain signal and a second time domain signal; a processing module, performing windowing processing on the first time domain signal and the second time domain signal respectively, and dividing the signals into frames according to a predetermined frame length to obtain a first signal frame sequence and a second signal frame sequence; a filtering module that performs Fourier transform on the first signal frame sequence and the second signal frame sequence respectively to obtain corresponding frequency domain signal frame sequences, performs frequency domain filtering on the frequency domain signal frame sequences to remove noise and interference, and then performs inverse Fourier transform on the filtered frequency domain signal frame sequences to obtain first time domain signal frame sequences and second time domain signal frame sequences; an extraction module, which performs time sequence splicing on the first time domain signal frame sequence and the second time domain signal frame sequence, and extracts the ultrasonic wave propagation time difference through cross-correlation analysis; The calculation module calculates the flow velocity based on the propagation time difference and calculates the water flow rate in combination with the cross-sectional area of the pipe.
8. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; When the processor executes the computer-executable instructions stored in the memory, it is used to implement the ultrasonic water meter flow measurement data processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method for processing ultrasonic water meter flow measurement data according to any one of claims 1 to 6.
Citation Information
Patent Citations
Ultrasonic flow meter and time difference measuring method thereof
CN103323063A
Lightweight implementation method of cross-correlation algorithm in ultrasonic flow measurement
CN114254253A
Flow measurement equipment, method and device based on path integration and storage medium
CN115540963A
Cited By
Pipe network blockage detection method and device based on ultrasonic water meter, server and medium
CN120849922A
Flight time difference calculation method of ultrasonic flowmeter and related equipment
CN121558137A