A method, apparatus, device, and readable storage medium for measuring flow velocity
By processing ultrasonic water meter signals using the Hilbert algorithm, extracting waveform envelopes and calculating the fundamental initial phase, and determining the phase difference between the uplink and downlink signal plateau segments, the problem of transducer frequency drift was solved, and high-precision flow velocity measurement was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QINGDAO TOPSCOMM COMM
- Filing Date
- 2023-12-08
- Publication Date
- 2026-07-17
AI Technical Summary
Existing ultrasonic water meters suffer from reduced measurement accuracy or misinterpretation due to frequency drift caused by transducer oscillation and free oscillation when measuring flow velocity, making it difficult to accurately measure fluid flow velocity.
The Hilbert algorithm is used to process uplink and downlink signals. The waveform envelope is extracted and integrated with the standard orthogonal fundamental wave to determine the initial phase of the fundamental wave. The phase difference between the uplink and downlink signal platform segments is calculated based on the positioning point. The flow velocity is calculated by the coarse and fine phase differences to avoid the influence of frequency drift.
This improves the accuracy of flow velocity measurement, avoids the influence of frequency components superimposed during the unforced oscillation phase of the transducer on the measurement results, and enhances the precision of calculation and measurement results.
Smart Images

Figure CN117686734B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of flow velocity measurement, and in particular to a flow velocity measurement method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] Ultrasonic water meters that use water as the specific liquid propagation medium often employ the time-of-flight method to measure flow velocity. This method measures the fluid velocity by measuring the time difference between the upstream and downstream propagation of ultrasonic waves. Since it is difficult to accurately measure the time, the time difference can be indirectly measured by measuring the phase difference between the upstream and downstream ultrasonic signals, thereby improving the measurement accuracy.
[0003] However, during the measurement process, transducer oscillation and free oscillation can introduce other frequency components, resulting in frequency drift. That is, if the entire receiving sequence is used directly to measure the phase difference, it will lead to a decrease in the final measurement accuracy or a wrong signal.
[0004] Overcoming the aforementioned technical problems and eliminating the resulting technical defects is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this application is to provide a flow velocity measurement method, apparatus, electronic device, and computer-readable storage medium.
[0006] To achieve the above objectives, this application provides a flow velocity measurement method in a first aspect. The method includes: acquiring a downstream signal propagating in the fluid to be measured and an upstream signal propagating upstream; processing both the upstream and downstream signals using the Hilbert algorithm to extract waveform envelopes; integrating the waveform envelopes with a preset orthogonal fundamental wave to obtain the vector coordinates of the envelope fundamental wave, and calculating the initial phase of the fundamental wave based on the vector coordinates; determining, based on the initial phase of the envelope fundamental wave, sampling points corresponding to the maximum values of the envelope fundamental waves corresponding to the upstream and downstream signals as a first positioning point and a second positioning point, respectively; wherein the positioning point is used to determine a waveform segment received by the signal receiving end when both the transmitting transducer emitting the corresponding signal and the receiving transducer receiving the corresponding signal are in stable forced oscillation; determining an upstream signal plateau segment and a downstream signal plateau segment based on the first and second positioning points, calculating the phase difference between the upstream and downstream signals based on the phase difference between the upstream and downstream signal plateau segments, and determining the flow velocity of the fluid to be measured based on the signal flight time difference determined by the phase difference.
[0007] In some other embodiments of the first aspect of this application, an uplink signal platform segment and a downlink signal platform segment are determined based on a first positioning point and a second positioning point, respectively, and the phase difference between the uplink signal and the downlink signal is calculated based on the phase difference between the uplink signal platform segment and the downlink signal platform segment, including:
[0008] The fundamental phase of the envelope corresponding to the first positioning point is determined as the first phase;
[0009] The fundamental phase of the envelope corresponding to the second positioning point is determined as the second phase;
[0010] The first waveform segment corresponding to the uplink signal is determined based on the first positioning point, and the second waveform segment corresponding to the downlink signal is determined based on the second positioning point;
[0011] The sampling points of the first waveform segment and the second waveform segment are accumulated periodically to obtain the first accumulation sequence and the second accumulation sequence, respectively.
[0012] Trigonometric interpolation fitting is performed on the first and second accumulated sequences respectively to calculate the phase of the first waveform segment of the first waveform segment and the phase of the second waveform segment of the second waveform segment.
[0013] The first zero-crossing sampling point closest to the first sampling point of the first waveform segment is determined based on the phase of the first waveform segment, and the first positioning point is corrected based on the offset of the first zero-crossing sampling point relative to the first sampling point of the first waveform segment to obtain the third positioning point;
[0014] The second zero-crossing sampling point closest to the first sampling point of the second waveform segment is determined based on the phase of the second waveform segment, and the second positioning point is corrected based on the offset of the second zero-crossing sampling point relative to the first sampling point of the second waveform segment to obtain the fourth positioning point;
[0015] The uplink signal platform segment and the downlink signal platform segment are determined based on the third and fourth positioning points, respectively.
[0016] The difference between the first phase and the second phase is defined as the coarse phase difference, and the fine phase difference is calculated based on the uplink signal plateau segment and the downlink signal plateau segment.
[0017] The final phase difference between the uplink and downlink signals is calculated based on the coarse and fine phase differences.
[0018] In some other embodiments of the first aspect of this application, determining the waveform segment corresponding to the corresponding signal based on the positioning point includes:
[0019] Use the corresponding positioning point as the center coordinate;
[0020] The waveform segment obtained by taking a first preset number of cycles before and a second preset number of cycles after the corresponding position of the center coordinate is determined as the waveform segment corresponding to the signal of the corresponding positioning point.
[0021] In some other embodiments of the first aspect of this application, the fine phase difference is calculated based on the uplink signal plateau segment and the downlink signal plateau segment, including:
[0022] Both the uplink signal plateau segment and the downlink signal plateau segment are accumulated periodically to obtain the third accumulation sequence and the fourth accumulation sequence, respectively.
[0023] Cyclic correlation processing is performed on the third and fourth accumulated sequences to obtain the cyclic correlation function;
[0024] Trigonometric interpolation is performed on the cyclic correlation function using least squares estimation to obtain the position corresponding to the maximum value of the cyclic correlation function, and the phase corresponding to the position is determined as the fine phase difference between the uplink signal plateau segment and the downlink signal plateau segment;
[0025] Correspondingly, the final phase difference between the uplink and downlink signals is calculated based on the coarse and fine phase differences, including:
[0026] The sum of the coarse phase difference and the fine phase difference is determined as the final phase difference between the uplink and downlink signals.
[0027] In some other embodiments of the first aspect of this application, both the uplink signal and the downlink signal are ultrasonic signals, which are signals emitted by the transmitting transducer due to forced vibration after receiving the electrical excitation signal.
[0028] In some other embodiments of the first aspect of this application, the fluid to be tested includes: a first type of fluid to be tested with a liquid as the flow medium and a second type of fluid to be tested with a gas as the flow medium.
[0029] To achieve the above objectives, this application provides a flow velocity measurement device in a second aspect. The device includes: a signal acquisition unit configured to acquire a downstream signal propagating in the fluid to be measured and an upstream signal propagating in the opposite direction; a waveform envelope extraction unit configured to process both the upstream and downstream signals using the Hilbert algorithm to extract the waveform envelope; a fundamental wave coordinate and fundamental wave phase determination unit configured to integrate the waveform envelope with a preset orthogonal fundamental wave to obtain the vector coordinates of the envelope fundamental wave, and calculate the initial phase of the envelope fundamental wave based on the vector coordinates; and a calculation unit configured to, based on the initial phase of the envelope fundamental wave, integrate the upstream and downstream signals... The sampling points corresponding to the fundamental maximum values of the signals are respectively determined as the first positioning point and the second positioning point; wherein, the positioning point is used to determine the waveform received by the signal receiving end when both the transmitting transducer that emits the corresponding signal and the receiving transducer that receives the corresponding signal are in stable forced oscillation; the phase difference and flow velocity determination unit is configured to determine the uplink signal platform segment and the downlink signal platform segment based on the first positioning point and the second positioning point respectively, and calculate the phase difference between the uplink signal and the downlink signal based on the phase difference between the uplink signal platform segment and the downlink signal platform segment, and determine the flow velocity of the fluid to be measured based on the signal flight time difference determined by the phase difference.
[0030] In some other embodiments of the second aspect of this application, the phase difference and flow velocity determination unit includes a phase difference determination subunit configured to determine an uplink signal platform segment and a downlink signal platform segment based on a first positioning point and a second positioning point, respectively, and to calculate the phase difference between the uplink signal and the downlink signal based on the phase difference between the uplink signal platform segment and the downlink signal platform segment. The phase difference determination subunit includes:
[0031] The first phase determination module is configured to determine the envelope fundamental phase corresponding to the first positioning point as the first phase.
[0032] The second phase determination module is configured to determine the envelope fundamental phase corresponding to the second positioning point as the second phase.
[0033] The coarse positioning waveform segment determination submodule is configured to determine the first waveform segment corresponding to the uplink signal based on the first positioning point, and to determine the second waveform segment corresponding to the downlink signal based on the second positioning point;
[0034] The periodic accumulation submodule is configured to accumulate the sampling points of the first waveform segment and the second waveform segment periodically, thereby obtaining the first accumulation sequence and the second accumulation sequence respectively.
[0035] The waveform segment phase determination submodule is configured to perform trigonometric interpolation fitting on the first accumulated sequence and the second accumulated sequence respectively, and calculate the first waveform segment phase of the first waveform segment and the second waveform segment phase of the second waveform segment.
[0036] The third positioning point determination submodule is configured to determine the first zero-crossing sampling point closest to the first sampling point of the first waveform segment based on the phase of the first waveform segment, and to correct the first positioning point based on the offset of the first zero-crossing sampling point relative to the first sampling point of the first waveform segment to obtain the third positioning point;
[0037] The fourth positioning point determination submodule is configured to determine the second zero-crossing sampling point closest to the first sampling point of the second waveform segment based on the phase of the second waveform segment, and to correct the second positioning point based on the offset of the second zero-crossing sampling point relative to the first sampling point of the second waveform segment, so as to obtain the fourth positioning point;
[0038] The fine positioning waveform segment determination submodule is configured to determine the uplink signal platform segment and the downlink signal platform segment based on the third positioning point and the fourth positioning point, respectively.
[0039] The coarse and fine phase difference determination submodule is configured to determine the difference between the first phase and the second phase as the coarse phase difference, and calculate the fine phase difference based on the uplink signal plateau segment and the downlink signal plateau segment;
[0040] The final phase difference calculation submodule is configured to calculate the final phase difference between the uplink and downlink signals based on the coarse and fine phase differences.
[0041] In some other embodiments of the second aspect of this application, the phase difference determination module further includes: a waveform segment determination submodule configured to determine a waveform segment corresponding to a corresponding signal based on a positioning point, the waveform segment determination submodule being further configured to:
[0042] Use the corresponding positioning point as the center coordinate;
[0043] The waveform segment obtained by taking a first preset number of cycles before and a second preset number of cycles after the corresponding position of the center coordinate is determined as the waveform segment corresponding to the signal of the corresponding positioning point.
[0044] In some other embodiments of the second aspect of this application, the coarse-fine phase difference determination submodule includes a fine phase difference determination component that calculates a fine phase difference based on the uplink signal plateau segment and the downlink signal plateau segment, the fine phase difference determination component being further configured to:
[0045] Both the uplink signal plateau segment and the downlink signal plateau segment are accumulated periodically to obtain the third accumulation sequence and the fourth accumulation sequence, respectively.
[0046] Cyclic correlation processing is performed on the third and fourth accumulated sequences to obtain the cyclic correlation function;
[0047] Trigonometric interpolation is performed on the cyclic correlation function using least squares estimation to obtain the position corresponding to the maximum value of the cyclic correlation function, and the phase corresponding to the position is determined as the fine phase difference between the uplink signal plateau segment and the downlink signal plateau segment;
[0048] Correspondingly, the final phase difference calculation submodule is further configured as follows:
[0049] The sum of the coarse phase difference and the fine phase difference is determined as the final phase difference between the uplink and downlink signals.
[0050] In some other embodiments of the second aspect of this application, both the uplink signal and the downlink signal are ultrasonic signals, which are signals emitted by the transmitting transducer due to forced vibration after receiving the electrical excitation signal.
[0051] In some other embodiments of the second aspect of this application, the fluid to be tested includes: a first type of fluid to be tested with a liquid as the flow medium and a second type of fluid to be tested with a gas as the flow medium.
[0052] To achieve the above objectives, this application provides an electronic device in a third aspect, the electronic device comprising:
[0053] Memory, used to store computer programs;
[0054] A processor is configured to implement the steps of the flow rate measurement method as described in any of the embodiments of the first aspect above when executing a computer program stored in a memory.
[0055] To achieve the above objectives, this application provides a computer-readable storage medium in a fourth aspect, on which a computer program is stored, which, when executed by a processor, performs the steps of flow rate measurement as described in any of the embodiments of the first aspect above.
[0056] The flow velocity measurement scheme provided in this application, after receiving the complete waveforms of the uplink and downlink signals, first converts them into complex form using the Hilbert algorithm to extract the waveform envelope. Then, it uses integration with the standard orthogonal fundamental wave to obtain the initial phase of the envelope fundamental wave. Based on the initial phase of the fundamental wave, the first positioning point (corresponding to the uplink signal) and the second positioning point (corresponding to the downlink signal) for locating the waveform segment in a stable forced oscillation state are calculated. That is, by calculating the phase difference between the uplink and downlink signal platform segments determined by the first and second positioning points respectively, the phase difference between the uplink and downlink signals is calculated and the flow velocity is subsequently measured. This avoids the drift problem introduced by other frequency components superimposed during the unforced oscillation stage of the transducer during the measurement process, thus improving the accuracy of the calculation and measurement results.
[0057] This application also provides a flow rate measuring device, an electronic device, and a computer-readable storage medium, which have the aforementioned beneficial effects, and will not be elaborated further here. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0059] Figure 1 A flowchart of a flow velocity measurement method provided in an embodiment of this application;
[0060] Figure 2 Taking an ultrasonic water meter as an example, this application illustrates a schematic diagram of a transducer that emits ultrasonic signals.
[0061] Figure 3 A flowchart illustrating a method for calculating the phase difference between uplink and downlink signals in a flow velocity measurement method provided in an embodiment of this application;
[0062] Figure 4 A flowchart illustrating a method for calculating a fine phase difference and determining the final phase difference based on an uplink signal plateau segment and a downlink signal plateau segment, provided in an embodiment of this application;
[0063] Figure 5 A schematic flowchart of another flow velocity measurement method provided in an embodiment of this application;
[0064] Figure 6 This is a structural block diagram of a flow velocity measuring device provided in an embodiment of this application. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0066] Please see Figure 1 , Figure 1 A flowchart for flow velocity measurement provided in this application includes the following steps:
[0067] Step 101: Collect the downstream signal propagating with the current and the upstream signal propagating against the current in the fluid to be tested;
[0068] This step aims to transmit a downward signal (i.e., the signal propagates in the same direction as the fluid flow) and an upward signal (i.e., the signal propagates against the direction of fluid flow) in the fluid to be measured by an execution subject suitable for performing the flow velocity measurement method provided in this application (e.g., a local computing terminal or cloud computing terminal for data processing and analysis).
[0069] The fluid to be measured can include: a first type of fluid with liquid as the flow medium and a second type of fluid with gas as the flow medium. Regardless of whether it is an uplink signal or a downlink signal, it can be a sound wave, ultrasonic wave, electromagnetic wave or a signal emitted by other sensors.
[0070] Taking an example where both the uplink and downlink signals are ultrasonic signals, this ultrasonic signal can be the signal emitted by the transmitting transducer due to forced vibration after receiving the electrical excitation signal, i.e., reference... Figure 2As shown, transmitting transducers can be installed upstream and downstream of the water pipe along the direction of water flow. Upon receiving an incoming electrical excitation signal, they begin to operate, emitting ultrasonic waves through forced vibration according to the excitation signal. This process necessarily involves the transition from unstable forced oscillations to stable forced oscillations.
[0071] Step 102: Process both the uplink and downlink signals using the Hilbert algorithm to extract the waveform envelope;
[0072] Based on step 101, this step aims to have the aforementioned execution entity obtain the waveform envelope of both uplink and downlink signals using the Hilbert algorithm. Depending on the signal being processed, it can actually be further divided into: the uplink waveform envelope obtained after processing the uplink signal and the downlink waveform envelope obtained after processing the downlink signal.
[0073] The Hilbert algorithm primarily manifests as the Hilbert transform. Its main purpose is to compute the analytic representation of a signal, which is a complex representation of the original signal, including its amplitude and phase information. The Hilbert transform is commonly used to analyze the envelope, instantaneous frequency, and phase of a signal. The output of the Hilbert transform is a complex signal that includes the amplitude and phase information of the original signal. Typically, only the imaginary part of the Hilbert transform is used to obtain the envelope of the original signal. The envelope is a "smoothed" version of the original signal amplitude, reflecting the change in signal amplitude over time while removing high-frequency components.
[0074] Step 103: Integrate the waveform envelope with the preset standard orthogonal fundamental wave to obtain the vector coordinates of the envelope fundamental wave, and calculate the initial phase of the envelope fundamental wave based on the vector coordinates;
[0075] Based on step 102, this step aims to have the aforementioned execution entity perform integration operations on the uplink waveform envelope and downlink waveform envelope with a preset standard orthogonal fundamental wave, thereby obtaining the vector coordinates of the envelope fundamental wave corresponding to the uplink signal and downlink signal, and calculating the initial phase of the envelope fundamental wave based on the vector coordinates.
[0076] The standard orthogonal fundamental wave is usually a known signal with a fundamental frequency, such as a sine wave. By integrating the envelope of this waveform with the standard orthogonal fundamental wave, the fundamental component in the envelope signal is extracted. The result of this step is the integral value of the envelope signal, which can usually be regarded as the vector coordinates of the envelope fundamental wave. This coordinate contains basic information about the overall "magnitude" of the signal and its change over time, and can be used for subsequent analysis or applications. In this step, it is used to further calculate the initial phase of the fundamental wave. In order to accelerate this process, CORDIC acceleration technology can also be used to shorten the time required to obtain the results.
[0077] CORDIC (Coordinate Rotation Digital Computer) is an algorithm for implementing coordinate system rotation operations in computers. It efficiently calculates trigonometric functions, square roots, and other complex mathematical operations through a series of iterative translation and accumulation operations. Its main idea is to transform complex trigonometric function calculations or coordinate rotation problems into a series of simple translation and accumulation operations, thereby reducing the use of multipliers and improving computational efficiency.
[0078] Step 104: Based on the initial phase of the envelope fundamental wave, determine the sampling points corresponding to the fundamental wave maximum values corresponding to the uplink and downlink signals as the first positioning point and the second positioning point, respectively.
[0079] Based on step 103, this step aims to have the aforementioned execution entity determine the sampling point corresponding to the fundamental value of the uplink signal as the first positioning point and the sampling point corresponding to the fundamental value of the downlink signal as the second positioning point, based on the initial phase of the envelope fundamental wave corresponding to the uplink signal and the downlink signal, respectively. That is, the first positioning point and the second positioning point are both points at the center of the waveform segment selected in the corresponding signal when it is in a stable forced oscillation (i.e., a waveform received by the signal receiving end when both the transmitting transducer that emits the corresponding signal and the receiving transducer that receives the corresponding signal are in a stable forced oscillation). This is used to locate the waveform segment.
[0080] Step 105: Determine the uplink signal platform segment and the downlink signal platform segment based on the first positioning point and the second positioning point respectively, calculate the phase difference between the uplink signal and the downlink signal based on the phase difference between the uplink signal platform segment and the downlink signal platform segment, and determine the flow velocity of the fluid to be measured based on the signal flight time difference determined by the phase difference.
[0081] Based on step 104, this step aims to calculate the phase difference between the uplink and downlink signals by the execution entity based on the phase difference between the uplink and downlink signal platform segments determined by the first positioning point and the second positioning point respectively. Then, the signal flight time difference is determined according to the correspondence between the phase difference and the signal flight time difference. Finally, the flow rate of the fluid to be measured is determined according to the correspondence between the signal flight time difference and the flow rate of the fluid to be measured.
[0082] Furthermore, after measuring the flow velocity of the fluid to be measured, the flow rate can be calculated based on the flow velocity and the constraint range of the constrained fluid. For example, in the application scenario of ultrasonic water meters, the water consumption in the corresponding house can be calculated based on the flow rate.
[0083] The flow velocity measurement method provided in this application, after receiving the complete waveforms of the uplink and downlink signals, first converts them into complex form using the Hilbert algorithm to extract the waveform envelope. Then, it uses integration with the standard orthogonal fundamental wave to obtain the initial phase of the envelope fundamental wave. Based on the initial phase of the fundamental wave, the first positioning point (corresponding to the uplink signal) and the second positioning point (corresponding to the downlink signal) for locating the waveform segment in a stable forced oscillation state are calculated. That is, by calculating the phase difference between the uplink and downlink signal platform segments determined by the first and second positioning points respectively, the flow velocity is measured. This avoids the drift problem introduced by other frequency components superimposed during the unforced oscillation stage of the transducer during the measurement process, thus improving the accuracy of the calculation and measurement results.
[0084] To further improve the accuracy of the determined waveform, the embodiments also... Figure 4 A scheme for calculating more accurate uplink and downlink signal plateau segments and their corresponding phase differences is shown, which includes the following steps:
[0085] Step 401: Determine the first waveform segment corresponding to the uplink signal based on the first positioning point, and determine the second waveform segment corresponding to the downlink signal based on the second positioning point;
[0086] This step aims to have the aforementioned executing entity determine, based on the first positioning point, a waveform (i.e., the first waveform segment) received by the signal receiving end when both the transmitting transducer that emits the signal and the receiving transducer that receives the signal are in a stable forced oscillation state, corresponding to the uplink signal. Similarly, based on the second positioning point, it also determines a waveform (i.e., the second waveform segment) received by the signal receiving end when both the transmitting transducer that emits the signal and the receiving transducer that receives the signal are in a stable forced oscillation state, corresponding to the downlink signal. This is to mitigate the impact of other factors hidden in the signal when it has not entered a stable oscillation state on the accuracy of subsequent calculations.
[0087] A method for determining the corresponding waveform segment based on a positioning point, including but not limited to, may include the following steps:
[0088] First, the corresponding positioning point is taken as the center coordinate; then, the waveform segment obtained by taking a first preset number of cycles before and a second preset number of cycles after the corresponding position of the center coordinate is determined as the waveform segment corresponding to the signal of the corresponding positioning point.
[0089] Taking the determination of the first waveform segment corresponding to its uplink signal based on the first positioning point as an example, the above steps are adaptively adjusted as follows: the first positioning point is used as the first center coordinate; then, a first preset number of cycles are taken before the position corresponding to the first center coordinate, and a second preset number of cycles are taken after the position to obtain the first waveform segment. That is, with the first positioning point as the center position, N cycles are taken before the center position and M cycles are taken after the center position to obtain a relatively complete waveform segment. The numbers N and M can be flexibly determined according to the actual situation and actual needs, and are not specifically limited here. For the second positioning point, the corresponding second waveform segment can be obtained in a similar way. The implementation process of determining the corresponding waveform segment based on other positioning points mentioned later in this application can also refer to this method, and will not be repeated here.
[0090] Step 402: Accumulate the sampling points of the first waveform segment and the second waveform segment according to the period to obtain the first accumulation sequence and the second accumulation sequence respectively;
[0091] Step 403: Perform trigonometric interpolation fitting on the first and second accumulated sequences respectively to calculate the phase of the first waveform segment of the first waveform segment and the phase of the second waveform segment of the second waveform segment;
[0092] The process of periodically accumulating sampled points involves sampling a stable, forced oscillation signal and then accumulating the sampled values at the same time points within each period. This produces an accumulated sequence, where each sampled point corresponds to a periodic waveform with the same phase. Trigonometric interpolation is then applied to this accumulated sequence because trigonometric functions are commonly used to fit periodic signals. These functions are periodic (e.g., sine and cosine functions) and can approximate many waveform shapes well to approximate the original accumulated sequence, resulting in a smoother curve. The phase information of the oscillating signal can be derived from the function obtained through trigonometric interpolation. In the fitted curve, the phase is typically related to the periodicity of the waveform. Determining the phase shift within each period helps in understanding the nature and characteristics of the oscillating signal.
[0093] The technical principle behind the above two steps is that by accumulating periodic waveforms of the same phase, the periodic characteristics of the signal can be enhanced. Trigonometric interpolation fitting is used to more accurately approximate the shape of the signal so as to more accurately determine the phase information in the waveform segment.
[0094] Its goal is to reconstruct the signal waveform from discretely sampled data and determine its phase information, so as to facilitate further analysis of signal characteristics and more accurate processing based on the phase information of the signal.
[0095] Step 404: Determine the first zero-crossing sampling point closest to the first sampling point of the first waveform segment based on the phase of the first waveform segment, and correct the first positioning point based on the offset of the first zero-crossing sampling point relative to the first sampling point of the first waveform segment to obtain the third positioning point;
[0096] Step 405: Determine the second zero-crossing sampling point closest to the first sampling point of the second waveform segment based on the phase of the second waveform segment, and correct the second positioning point based on the offset of the second zero-crossing sampling point relative to the first sampling point of the second waveform segment to obtain the fourth positioning point;
[0097] Based on step 403, the above two steps aim to have the executing entity first calculate the zero-crossing sampling point closest to the first sampling point of the first / second waveform segment (the first zero-crossing sampling point corresponds to the first waveform segment, and the second zero-crossing sampling point corresponds to the second waveform segment) according to the phase of the first / second waveform segment, and then correct the corresponding positioning point according to the offset between the corresponding zero-crossing sampling point and the corresponding first sampling point, so as to obtain a more accurate third and fourth positioning point.
[0098] Step 406: Determine the uplink signal platform segment and downlink signal platform segment based on the third and fourth positioning points respectively;
[0099] This step obtains the uplink signal platform segment and the downlink signal platform segment by determining the third and fourth positioning points in the same waveform segment determination method mentioned above (see the determination method mentioned in step 401). (That is, the uplink and downlink signal platform segments are essentially waveform segments.)
[0100] Step 407: Determine the difference between the first phase and the second phase as the coarse phase difference, and calculate the fine phase difference based on the uplink signal plateau segment and the downlink signal plateau segment;
[0101] This step first determines the coarse phase difference by directly identifying the difference between the first and second phases, and then calculates the fine phase difference based on the uplink and downlink signal platform segments.
[0102] Step 408: Calculate the final phase difference between the uplink and downlink signals based on the coarse and fine phase differences.
[0103] Regarding steps 407 and 408, this embodiment also provides a specific implementation method, including but not limited to the following steps:
[0104] First, both the uplink and downlink signal plateau segments are periodically accumulated to obtain the third and fourth accumulated sequences, respectively. Then, cyclic correlation processing is applied to the third and fourth accumulated sequences to obtain the cyclic correlation function. Next, the cyclic correlation function is fitted using trigonometric interpolation through least squares estimation to obtain the position corresponding to the maximum value of the cyclic correlation function, and the phase corresponding to the position is determined as the fine phase difference between the uplink and downlink signal plateau segments. Finally, the sum of the coarse and fine phase differences is determined as the final phase difference between the uplink and downlink signals.
[0105] To deepen the understanding of the overall solution, this application also provides a specific implementation scheme for measuring the water flow velocity in an ultrasonic water meter, using the ultrasonic water meter as a specific scenario, through the following embodiments:
[0106] The following section will first introduce the relevant background technologies for the scenario of ultrasonic water meters:
[0107] For a pipe with a fixed cross-section, the flow rate is the integral of the product of the flow velocity and the pipe area over time. By accurately measuring the instantaneous flow velocity, the flow rate over a period of time can be obtained.
[0108] Ultrasonic water meters mostly calculate fluid velocity by measuring the time difference between the downstream and upstream propagation of ultrasonic waves in a fluid. The basic principle is as follows: A pair of transducers, denoted as TRANS_UP and TRANS_DOWN, are installed upstream and downstream of the measuring pipe. The ultrasonic signal emitted from upstream TRANS_UP propagates through the flow channel to TRANS_DOWN, and the propagation time is denoted as t. UD ,have Where L is the sound path length, c is the still water speed, and v is the water flow velocity in the pipe.
[0109] Correspondingly, the time required for the signal sent from the downstream TRANS_DOWN to reach TRANS_UP is denoted as t. DU ,have
[0110] Then the time difference ΔToF between upstream and downstream propagation is:
[0111] Since the speed of sound in water, c, is much greater than the flow velocity, v can be approximated as having a linear relationship with ΔToF. When the temperature remains constant, c is a constant. Therefore, the flow velocity can be obtained by measuring the time difference between upstream and downstream signal propagation.
[0112] like Figure 2As shown, the velocity measurement system simultaneously sends the same electrical excitation signal to both the upstream and downstream transmitting transducers. The transmitting transducers convert this signal into an ultrasonic signal. After the ultrasonic signal propagates upstream and downstream of the water flow within the measuring pipe, it is received by the downstream and upstream receiving transducers and converted into an electrical signal. The velocity measurement system then activates an ADC (Analog-to-Digital Converter) to sample the received signal and calculates the phase difference between the upstream and downstream signals using a platform segment method, thereby obtaining the time-of-flight difference and determining the flow velocity. A block diagram of the received signal processing can be found in [reference needed]. Figure 5 The schematic diagram shown illustrates the specific steps of the measurement method as follows:
[0113] 1) Signals are transmitted simultaneously from upstream and downstream, and the receiver's ADC samples the signals;
[0114] 2) Coarse positioning of platform segment:
[0115] 2.1) The waveform envelope is extracted using the Hilbert algorithm (mentioned above);
[0116] 2.2) Integrate the obtained envelope with the orthogonal fundamental wave to obtain the vector coordinates of the envelope fundamental wave, which are used as the integral result;
[0117] 2.3) The vector coordinates are fed into the CORDIC acceleration module to obtain the initial phase θ of the envelope fundamental wave. Therefore, the phase of the sampling point X corresponding to the maximum value of the fundamental wave is...
[0118] 2.4) Perform the operations in 2.1-2.3 on both uplink and downlink received signals. The phases corresponding to the peak values of the uplink and downlink received signal envelopes are denoted as φ1 and φ2, respectively. That is, the center phases of the platform segments in the uplink and downlink signals are denoted as φ1 and φ2, respectively.
[0119] 2.5) Based on the test verification, take the N cycles before and M cycles after the positioning point X to obtain the platform segment;
[0120] 3) Detailed positioning of platform segment
[0121] 3.1) Periodically accumulate the sampling points of the platform segment;
[0122] 3.2) Perform triangular interpolation fitting on the accumulated sequence and calculate the phase of the plateau segment;
[0123] 3.3) Based on the phase of the platform segment, calculate the position offset Y of the nearest zero-crossing point relative to the platform segment;
[0124] 3.4) Readjust the center position of the platform segment, X' = X + Y;
[0125] 3.5) Based on the test verification, take the N cycles before and M cycles after the positioning point X', and re-acquire the platform segment.
[0126] 4) Calculating phase difference using cyclic correlation
[0127] 4.1) Periodically accumulate the platform segment data after fine positioning;
[0128] 4.2) Perform cyclic correlation on the accumulated uplink and downlink platform segment signal sequences to obtain the correlation function; fit the correlation function using trigonometric differences to obtain the phase of the correlation function, which is the phase difference Δφ between the uplink and downlink platform segments. 细 The final phase difference between uplink and downlink signals is Δφ = φ2 - φ1 + Δφ 细 The flight time difference is determined based on the phase difference.
[0129] In addition, although the embodiment here uses the cyclic correlation method to calculate the phase difference, direct interpolation parameter estimation and subtraction of the phase of the uplink and downlink platform segments can also suppress noise to a certain extent.
[0130] Specifically, assuming the transducer emits a 1MHz ultrasonic wave, the receiver uses an LMHz ADC for sampling, and the received signal x(t) is obtained by applying a Hilbert transform. extract The model is worth the envelope
[0131] Will Integrating with the locally stored fundamental sine and cosine waves respectively, the integral results are used to construct the fundamental wave vector coordinates and fed into the CORDIC module to obtain the initial phase θ of the envelope fundamental wave. Therefore, the phase of the sampling point X corresponding to the maximum value of the fundamental wave is...
[0132] Perform the above operation on both uplink and downlink received signals. The phases corresponding to the peak values of the uplink and downlink received signal envelopes are denoted as φ1 and φ2, respectively. The result of φ1-φ2 is the low-precision phase difference. Take X as the center positioning point of the platform segment, and take the first N cycles and the last M cycles to obtain the coarse positioning platform segment.
[0133] To address the inconsistency in platform segment localization between uplink and downlink signals, a zero-crossing algorithm is employed to further refine the platform segment localization, ensuring that the first sampling point of each platform segment is a zero-crossing point. This first requires determining the initial phase of the received signal. The calculation process is as follows:
[0134] The data within the platform segment is periodically accumulated. When L=3, at a sampling rate of 3 times, the final accumulated data yields 3 points. Trigonometric interpolation fitting is performed on the accumulated sequence to obtain the phase of the plateau segment.
[0135] Where d0 corresponds to the maximum value in {x0, x1, x2}, and the other points correspond sequentially, for example, f0 = x1, f1 = x2, f -1 =x0.
[0136] According to the platform segment phase Calculate the position offset of the nearest zero-crossing point relative to the platform segment. Where K is the oversampling factor, with X+Y as the center point, N cycles are taken before and M cycles after, and the plateau segment is re-acquired. The plateau segment is adjusted using the zero-crossing algorithm, and the phase difference is calculated with high precision. The calculation process is as follows:
[0137] The data within the finely positioned platform segment is periodically accumulated, following the same accumulation process as above. Then, a cyclic correlation is performed on the uplink and downlink accumulated sequences. Assume the uplink and downlink correlation signal sequences after the periodic accumulation are as follows: and Cyclic correlation adds / rotates a fixed phase to another signal. Assuming a fixed downlink y-sequence, a cyclic right shift is performed on the uplink x-sequence to obtain the cyclic correlation sequence. Trigonometric interpolation fitting is performed on the accumulated sequence to obtain the phase Δφ of the cyclic correlation function. 细 The final phase difference between uplink and downlink signals is: Δφ = φ2 - φ1 + Δφ 细 The time difference between uplink and downlink signals is calculated based on the phase difference.
[0138] Compared with the prior art, the solution provided in this embodiment has the following advantages:
[0139] 1. The time-of-flight difference is indirectly obtained by calculating the phase difference, thus improving measurement accuracy;
[0140] 2. By adopting the plateau segment method, the drift problem caused by the superposition of unforced oscillation frequency components such as transducer free oscillation can be avoided, thus improving measurement accuracy.
[0141] 3. Platform segment positioning is divided into two parts: coarse positioning and fine positioning. Fine positioning uses a zero-crossing algorithm to further adjust the platform segment, which can solve the problem of inaccurate positioning of the uplink and downlink platform segments when the original waveform platform segment is short.
[0142] Due to the complexity of the situation, it is impossible to list and elaborate on them all. Those skilled in the art should realize that there are many examples based on the basic method principles provided in this application and in combination with actual situations. Without sufficient creative effort, they should all be within the protection scope of this application.
[0143] Please see below. Figure 6 , Figure 6This is a structural block diagram of a flow velocity measuring device 600 provided in this application embodiment. This embodiment exists as a device embodiment corresponding to the above method embodiment. The flow velocity measuring device 600 may include:
[0144] The signal acquisition unit 601 is configured to acquire the downstream signal propagating in the fluid under test and the upstream signal propagating against the current.
[0145] Waveform envelope extraction 602 is configured to process both uplink and downlink signals using the Hilbert algorithm to extract the waveform envelope;
[0146] The fundamental wave coordinate and fundamental wave phase determination unit 603 is configured to perform an integral operation between the waveform envelope and a preset standard orthogonal fundamental wave to obtain the vector coordinates of the envelope fundamental wave, and calculate the initial phase of the envelope fundamental wave based on the vector coordinates.
[0147] The calculation unit 604 is configured to determine the sampling points corresponding to the maximum values of the fundamental wave corresponding to the uplink signal and the downlink signal, respectively, as the first positioning point and the second positioning point, based on the initial phase of the fundamental wave; wherein, the positioning point is used to determine a waveform received by the signal receiving end when both the transmitting transducer that emits the corresponding signal and the receiving transducer that receives the corresponding signal are in a stable forced oscillation.
[0148] The phase difference and flow velocity determination unit 605 is configured to determine the uplink signal platform segment and the downlink signal platform segment based on the first positioning point and the second positioning point, respectively, calculate the phase difference between the uplink signal and the downlink signal based on the phase difference between the uplink signal platform segment and the downlink signal platform segment, and determine the flow velocity of the fluid to be measured based on the signal flight time difference determined by the phase difference.
[0149] In some other embodiments of this application, the phase difference and flow velocity determination unit 605 may include a phase difference determination subunit configured to determine an uplink signal platform segment and a downlink signal platform segment based on a first positioning point and a second positioning point, respectively, and to calculate the phase difference between the uplink signal and the downlink signal based on the phase difference between the uplink signal platform segment and the downlink signal platform segment. The phase difference determination subunit may include:
[0150] The first phase determination module is configured to determine the phase corresponding to the first positioning point as the first phase;
[0151] The second phase determination module is configured to determine the phase corresponding to the second positioning point as the second phase.
[0152] The coarse positioning waveform segment determination submodule is configured to determine the first waveform segment corresponding to the uplink signal based on the first positioning point, and to determine the second waveform segment corresponding to the downlink signal based on the second positioning point;
[0153] The periodic accumulation submodule is configured to accumulate the sampling points of the first waveform segment and the second waveform segment periodically, thereby obtaining the first accumulation sequence and the second accumulation sequence respectively.
[0154] The waveform segment phase determination submodule is configured to perform trigonometric interpolation fitting on the first accumulated sequence and the second accumulated sequence respectively, and calculate the first waveform segment phase of the first waveform segment and the second waveform segment phase of the second waveform segment.
[0155] The third positioning point determination submodule is configured to determine the first zero-crossing sampling point closest to the first sampling point of the first waveform segment based on the phase of the first waveform segment, and to correct the first positioning point based on the offset of the first zero-crossing sampling point relative to the first sampling point of the first waveform segment to obtain the third positioning point;
[0156] The fourth positioning point determination submodule is configured to determine the second zero-crossing sampling point closest to the first sampling point of the second waveform segment based on the phase of the second waveform segment, and to correct the second positioning point based on the offset of the second zero-crossing sampling point relative to the first sampling point of the second waveform segment, so as to obtain the fourth positioning point;
[0157] The fine positioning waveform segment determination submodule is configured to determine the uplink signal platform segment and the downlink signal platform segment based on the third positioning point and the fourth positioning point, respectively.
[0158] The coarse and fine phase difference determination submodule is configured to determine the coarse phase difference by the difference between the first phase and the second phase, and to calculate the fine phase difference based on the uplink signal plateau segment and the downlink signal plateau segment;
[0159] The final phase difference calculation submodule is configured to calculate the final phase difference between the uplink and downlink signals based on the coarse and fine phase differences.
[0160] In some other embodiments of this application, the phase difference determination module may further include: a waveform segment determination submodule configured to determine a waveform segment corresponding to a corresponding signal based on a positioning point, wherein the waveform segment determination submodule is further configured to:
[0161] Use the corresponding positioning point as the center coordinate;
[0162] The waveform segment obtained by taking a first preset number of cycles before and a second preset number of cycles after the corresponding position of the center coordinate is determined as the waveform segment corresponding to the signal of the corresponding positioning point.
[0163] In some other embodiments of this application, the coarse and fine phase difference determination submodule includes a fine phase difference determination component that calculates a fine phase difference based on the uplink signal plateau segment and the downlink signal plateau segment. The fine phase difference determination component is further configured to:
[0164] Both the uplink signal plateau segment and the downlink signal plateau segment are accumulated periodically to obtain the third accumulation sequence and the fourth accumulation sequence, respectively.
[0165] Cyclic correlation processing is performed on the third and fourth accumulated sequences to obtain the cyclic correlation function;
[0166] Trigonometric interpolation is performed on the cyclic correlation function using least squares estimation to obtain the position corresponding to the maximum value of the cyclic correlation function, and the phase corresponding to the position is determined as the fine phase difference between the uplink signal plateau segment and the downlink signal plateau segment;
[0167] Correspondingly, the final phase difference calculation submodule is further configured as follows:
[0168] The sum of the coarse phase difference and the fine phase difference is determined as the final phase difference between the uplink and downlink signals.
[0169] In some other embodiments of this application, both the uplink signal and the downlink signal are ultrasonic signals, which are signals emitted by the transmitting transducer due to forced vibration after receiving the electrical excitation signal.
[0170] In some other embodiments of this application, the fluid to be tested includes: a first type of fluid to be tested with liquid as the flow medium and a second type of fluid to be tested with gas as the flow medium.
[0171] This embodiment is a device embodiment corresponding to the method embodiment described above. The flow velocity measurement device provided in this embodiment, after receiving the complete waveforms of the uplink and downlink signals, first converts them into complex form using the Hilbert algorithm to extract the waveform envelope. Then, it uses integration with the standard orthogonal fundamental wave to obtain the vector coordinates of the envelope fundamental wave and the initial phase of the fundamental wave. Based on the initial phase of the envelope fundamental wave, it calculates the first positioning point (corresponding to the uplink signal) and the second positioning point (corresponding to the downlink signal) for locating the waveform segment in a stable forced oscillation state. That is, by calculating the phase difference between the uplink and downlink signal platform segments determined by the first and second positioning points respectively, and subsequently measuring the flow velocity, it avoids the drift problem introduced by other frequency components superimposed during the unforced oscillation phase of the transducer during the measurement process, thus improving the accuracy of the calculation and measurement results.
[0172] Based on the above embodiments, this application also provides an electronic device, which may include a memory and a processor. The memory stores a computer program, and when the processor calls the computer program in the memory, it can implement the steps provided in the above embodiments. Of course, the electronic device may also include various necessary network interfaces, a power supply, and other components.
[0173] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by an execution terminal or processor, can perform the steps provided in the above embodiments. The storage medium may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0174] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0175] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0176] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. For those skilled in the art, various improvements and modifications can be made to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
[0177] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
Claims
1. A method for measuring flow velocity, characterized in that, include: Collect the downstream signal propagating in the fluid under test and the upstream signal propagating against the current; Both the uplink and downlink signals are processed using the Hilbert algorithm to extract the waveform envelope; The waveform envelope is integrated with a preset standard orthogonal fundamental wave to obtain the vector coordinates of the envelope fundamental wave, and the initial phase of the envelope fundamental wave is calculated based on the vector coordinates. Based on the initial phase of the envelope fundamental wave, the sampling points corresponding to the maximum values of the envelope fundamental wave corresponding to the uplink signal and the downlink signal are respectively determined as the first positioning point and the second positioning point; wherein, the positioning point is used to determine a waveform received by the signal receiving end when both the transmitting transducer that emits the corresponding signal and the receiving transducer that receives the corresponding signal are in a stable forced oscillation. Based on the first positioning point and the second positioning point, the uplink signal platform segment and the downlink signal platform segment are determined respectively. The phase difference between the uplink signal and the downlink signal is calculated based on the phase difference between the uplink signal platform segment and the downlink signal platform segment. The flow velocity of the fluid to be measured is determined based on the signal flight time difference determined by the phase difference. The step of determining the uplink signal platform segment and the downlink signal platform segment based on the first positioning point and the second positioning point respectively, and calculating the phase difference between the uplink signal and the downlink signal based on the phase difference between the uplink signal platform segment and the downlink signal platform segment, includes: The fundamental phase of the envelope corresponding to the first positioning point is determined as the first phase; The fundamental phase of the envelope corresponding to the second positioning point is determined as the second phase; A first waveform segment corresponding to the uplink signal is determined based on the first positioning point, and a second waveform segment corresponding to the downlink signal is determined based on the second positioning point; The sampling points of the first waveform segment and the second waveform segment are accumulated periodically to obtain the first accumulation sequence and the second accumulation sequence, respectively. Trigonometric interpolation fitting is performed on the first accumulated sequence and the second accumulated sequence respectively to calculate the first waveform segment phase of the first waveform segment and the second waveform segment phase of the second waveform segment. The first zero-crossing sampling point closest to the first sampling point of the first waveform segment is determined based on the phase of the first waveform segment, and the first positioning point is corrected based on the offset of the first zero-crossing sampling point relative to the first sampling point of the first waveform segment to obtain the third positioning point; The second zero-crossing sampling point closest to the first sampling point of the second waveform segment is determined based on the phase of the second waveform segment, and the second positioning point is corrected based on the offset of the second zero-crossing sampling point relative to the first sampling point of the second waveform segment to obtain the fourth positioning point; The uplink signal platform segment and the downlink signal platform segment are determined based on the third positioning point and the fourth positioning point, respectively. The difference between the first phase and the second phase is determined as the coarse phase difference, and the fine phase difference is calculated based on the uplink signal platform segment and the downlink signal platform segment; The final phase difference between the uplink signal and the downlink signal is calculated based on the coarse phase difference and the fine phase difference.
2. The method according to claim 1, wherein, Based on the positioning point, determine the waveform segment corresponding to the corresponding signal, including: Use the corresponding positioning point as the center coordinate; The waveform segment obtained by taking a first preset number of cycles before and a second preset number of cycles after the corresponding position of the center coordinates is determined as the waveform segment corresponding to the signal of the corresponding positioning point.
3. The method according to claim 1, wherein, The step of calculating the fine phase difference based on the uplink signal plateau segment and the downlink signal plateau segment includes: Both the uplink signal platform segment and the downlink signal platform segment are accumulated periodically to obtain the third accumulation sequence and the fourth accumulation sequence, respectively. Cyclic correlation processing is performed on the third and fourth accumulated sequences to obtain the cyclic correlation function; The cyclic correlation function is fitted by least squares trigonometric interpolation to obtain the position corresponding to the maximum value of the cyclic correlation function, and the phase corresponding to the position is determined as the fine phase difference between the uplink signal plateau segment and the downlink signal plateau segment. Correspondingly, the step of calculating the final phase difference between the uplink signal and the downlink signal based on the coarse phase difference and the fine phase difference includes: The sum of the coarse phase difference and the fine phase difference is determined as the final phase difference between the uplink signal and the downlink signal.
4. The method according to any one of claims 1-3, wherein, Both the uplink signal and the downlink signal are ultrasonic signals, which are signals emitted by the transmitting transducer due to forced vibration after receiving the electrical excitation signal.
5. The method according to claim 4, wherein, The fluid to be tested includes: a first type of fluid to be tested with liquid as the flow medium and a second type of fluid to be tested with gas as the flow medium.
6. A flow velocity measuring device for performing the method according to any one of claims 1 to 5, characterized in that, include: The signal acquisition unit is configured to acquire the downstream signal propagating in the fluid under test and the upstream signal propagating against the current. Waveform envelope extraction is configured to process both the uplink signal and the downlink signal using the Hilbert algorithm to extract the waveform envelope; The fundamental wave coordinate and fundamental wave phase determination unit is configured to perform an integral operation between the waveform envelope and a preset standard orthogonal fundamental wave to obtain the vector coordinates of the envelope fundamental wave, and calculate the initial phase of the envelope fundamental wave based on the vector coordinates; The calculation unit is configured to determine, based on the initial phase of the envelope fundamental wave, the sampling points corresponding to the maximum values of the envelope fundamental wave corresponding to the uplink signal and the downlink signal, respectively, as a first positioning point and a second positioning point; wherein, the positioning point is used to determine a waveform received by the signal receiving end when both the transmitting transducer that emits the corresponding signal and the receiving transducer that receives the corresponding signal are in a stable forced oscillation. The phase difference and flow velocity determination unit is configured to determine an uplink signal platform segment and a downlink signal platform segment based on the first positioning point and the second positioning point, respectively, calculate the phase difference between the uplink signal and the downlink signal based on the phase difference between the uplink signal platform segment and the downlink signal platform segment, and determine the flow velocity of the fluid to be measured based on the signal flight time difference determined by the phase difference.
7. An electronic device, characterized in that, include: Memory, used for computer programs; A processor configured to implement the steps of the flow rate measurement method as described in any one of claims 1 to 5 when executing a computer program stored in the memory.
8. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, can implement the steps of the flow rate measurement method as described in any one of claims 1 to 5.