A method and apparatus for determining fluid velocity, an ultrasonic flow meter, and a storage medium
By aligning and cross-correlated the time-domain signals in the ultrasonic flow meter, and combining this with interpolation techniques, the accuracy problem of fluid velocity measurement under limited signal sampling frequency was solved, and higher precision fluid velocity calculation was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU MICROIMAGE INTELLIGENT CONTROL TECHNOLOGY CO LTD
- Filing Date
- 2025-08-11
- Publication Date
- 2026-07-03
AI Technical Summary
Existing ultrasonic flow meters have low accuracy in measuring fluid velocity due to hardware limitations in signal sampling frequency, resulting in large errors in time-of-flight difference and thus affecting the accuracy of fluid velocity measurement.
By aligning the first and second time-domain signals, a backup signal is obtained. Cross-correlation processing is then performed to analyze the target duration and correct the time difference. If the target duration does not meet the accuracy requirements, interpolation processing is performed to iteratively correct the time difference until the accuracy requirements are met.
It improves the accuracy of fluid velocity measurement when the signal sampling frequency is limited by hardware, ensures the accuracy of fluid velocity calculation, and reduces errors.
Smart Images

Figure CN120907622B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of flow measurement technology, and in particular to a method, apparatus, ultrasonic flow meter, and storage medium for determining fluid velocity. Background Technology
[0002] Ultrasonic flow meters offer advantages such as non-contact operation (the flow meter does not contact the fluid), zero pressure loss, and fast response, making them widely used for measuring the flow rate of fluids such as water, gas, and oil. Currently, most ultrasonic flow meters employ the time-of-flight method to measure fluid velocity. This method determines the flow rate based on the time difference between the forward and reverse propagation of ultrasonic waves in the fluid. Therefore, the accuracy of the time-of-flight measurement directly determines the accuracy of the calculated flow rate.
[0003] When calculating the time difference of flight (TDF), it is necessary to align the ultrasonic signals after they propagate downstream and upstream in the fluid. However, the sampling frequency of ultrasonic flow meters is limited by hardware. If the sampling frequency is low, the time interval between the signals acquired at that frequency will be large, resulting in lower alignment accuracy between the downstream and upstream signals. This leads to a larger error in the calculated TDF and ultimately lower accuracy in determining the fluid velocity.
[0004] Therefore, for ultrasonic flow meters, how to improve the accuracy of the determined fluid velocity when the signal sampling frequency is limited by hardware? Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, ultrasonic flow meter, and storage medium for determining fluid velocity, so as to improve the accuracy of the determined fluid velocity when the signal sampling frequency is limited by hardware. The specific technical solution is as follows:
[0006] In a first aspect, embodiments of this application provide a method for determining fluid velocity, applied to an ultrasonic flow meter; the method includes:
[0007] The first time-domain signal and the second time-domain signal are aligned to obtain a first backup signal and a second backup signal with the same starting time point; wherein, the first time-domain signal and the second time-domain signal are the acquired signals after the ultrasonic wave has propagated through different propagation directions of the target fluid;
[0008] The first backup signal and the second backup signal are cross-correlated to obtain the current cross-correlation signal.
[0009] Based on the current cross-correlation signal, the target duration is analyzed; wherein, the target duration is used to characterize the error existing in the time offset corresponding to the maximum degree of cross-correlation in the current cross-correlation signal.
[0010] Based on the target duration obtained from the current analysis, the current time difference is corrected; wherein, the initial value of the current time difference is the offset amount required for the alignment process.
[0011] If the target duration obtained from the current analysis is greater than the predetermined allowable error value, the second backup signal is interpolated to obtain a new second backup signal, and the process returns to the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal; otherwise,
[0012] The current time difference is used as the flight time difference of the ultrasonic wave when it propagates downstream and upstream in the target fluid to determine the flow velocity of the target fluid.
[0013] Secondly, embodiments of this application provide a fluid velocity determination device applied to an ultrasonic flow meter; the device includes:
[0014] An alignment processing module is used to align the first time-domain signal and the second time-domain signal to obtain a first backup signal and a second backup signal with the same corresponding start time point; wherein, the first time-domain signal and the second time-domain signal are acquired signals after the ultrasonic wave has propagated through different propagation directions of the target fluid;
[0015] The cross-correlation processing module is used to perform cross-correlation processing on the first backup signal and the second backup signal to obtain the current cross-correlation signal;
[0016] The analysis module is used to analyze the target duration based on the current cross-correlation signal; wherein the target duration is used to characterize the error existing in the time offset corresponding to the maximum cross-correlation degree in the current cross-correlation signal.
[0017] The correction module is used to correct the current time difference based on the target duration obtained from the current analysis; wherein the initial value of the current time difference is the offset amount required for the alignment process.
[0018] The interpolation module is used to interpolate the second backup signal to obtain a new second backup signal if the target duration obtained from the current analysis is greater than a predetermined allowable error value, and then return to the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal.
[0019] The first determining module is used to determine the flow velocity of the target fluid by using the current time difference as the flight time difference of the ultrasonic wave when it propagates downstream and upstream in the target fluid.
[0020] Thirdly, embodiments of this application provide an ultrasonic flow meter, comprising:
[0021] Memory, used to store computer programs;
[0022] The processor, when executing a program stored in memory, implements any of the methods for determining the velocity of the fluid described above.
[0023] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the methods for determining fluid velocity described above.
[0024] Beneficial effects of the embodiments in this application:
[0025] The fluid velocity determination method provided in this application embodiment can align a first time-domain signal and a second time-domain signal to align their starting time points, obtaining a first backup signal and a second backup signal, thereby achieving preliminary alignment of the signals after ultrasonic waves propagate through different propagation directions of the target fluid; and perform cross-correlation processing on the first backup signal and the second backup signal to obtain a current cross-correlation signal, which can characterize the degree of cross-correlation between the first backup signal and the second backup signal under different time offsets; based on the current cross-correlation signal, it is possible to analyze which cross-correlation signal corresponds to the maximum cross-correlation. The error in the time offset of the correlation degree, which is the target duration, can be used to correct the current time difference based on the target duration obtained from the current analysis, thereby improving the accuracy of the current time difference. If the target duration obtained from the current analysis is greater than the predetermined allowable error value, it can be considered that the accuracy of the target duration is still insufficient (that is, the alignment accuracy between the first backup signal and the second backup signal is still insufficient). Correspondingly, the accuracy of the current time difference is also insufficient. Therefore, the second backup signal can be interpolated to obtain a new backup signal, and the process of cross-correlation processing of the first backup signal and the second backup signal can be returned to obtain the cross-correlation signal, thereby realizing the iterative correction of the current time difference. Until the target duration obtained from the current analysis is no greater than the predetermined allowable error value, that is, the alignment accuracy between the first backup signal and the second backup signal is sufficient, and the current time difference has been corrected based on the target duration obtained from the current analysis, the current time difference can be used as the flight time difference of the ultrasonic wave propagating downstream and upstream in the target fluid; then, compared with the prior art, when the sampling frequency of the signal is limited by hardware, this application can iteratively correct the current time difference between the two time domain signals to improve the accuracy of the current time difference, so that the determined flight time difference is also more accurate, and the flow velocity of the target fluid determined based on the more accurate flight time difference is also more accurate, thereby improving the accuracy of the determined fluid velocity when the sampling frequency of the signal is limited by hardware.
[0026] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0027] 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 some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0028] Figure 1This application provides a schematic diagram illustrating the working principle of an ultrasonic flow meter.
[0029] Figure 2 A flowchart illustrating a method for determining fluid velocity provided in an embodiment of this application;
[0030] Figure 3(a) is a schematic diagram of the first time-domain signal and the second time-domain signal provided in an embodiment of this application;
[0031] Figure 3(b) is a schematic diagram of the alignment processing of the first time-domain signal and the second time-domain signal provided in the embodiment of this application;
[0032] Figure 3(c) is a schematic diagram of the precision alignment of two backup signals provided in an embodiment of this application;
[0033] Figure 4(a) is a schematic diagram of the current cross-correlation signal provided in the embodiment of this application;
[0034] Figure 4(b) is a schematic diagram of the interpolated signal provided in the embodiment of this application;
[0035] Figure 5 A flowchart illustrating another method for determining fluid velocity provided in an embodiment of this application;
[0036] Figure 6 A schematic diagram of a fluid velocity determination device provided in an embodiment of this application;
[0037] Figure 7 This is a schematic diagram of the structure of an ultrasonic flow meter provided in an embodiment of this application. Detailed Implementation
[0038] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0039] First, some technical terms in the embodiments of this application will be introduced:
[0040] The time of flight (TOF) of an ultrasonic flow meter is used to measure the flow velocity of a fluid. The propagation speed of ultrasound waves in a fluid is affected by the fluid itself; ultrasound waves propagate faster when traveling downstream and slower when traveling upstream.
[0041] Time difference method: also known as the time-of-flight method, it calculates the flow velocity of a fluid by measuring the time difference between the downstream and upstream propagation of ultrasonic waves.
[0042] Ultrasonic flow meters have the advantages of being non-contact, pressure loss-free, and having a fast response speed. They are widely used for measuring the velocity / flow rate of fluids such as water, gas, and oil.
[0043] Zero-crossing comparison method: also known as the zero-crossing comparison method, is a technique for measuring phase difference by detecting the time or voltage difference at the zero-crossing points of a signal. Its core principle is to calculate the phase difference or time difference by comparing the differences in the zero-crossing points of two sine waves of the same frequency.
[0044] Cross-correlation method: a method used to analyze the similarity and time delay between two signals, which is widely used in signal processing, fault location and other fields.
[0045] Temporal resolution refers to the time interval between two adjacent observations / detections of the same research object (such as a certain area or object) by a sensor or observation system.
[0046] Flow resolution: refers to the level of detail that can be achieved when observing, analyzing or controlling flow.
[0047] Secondly, the working principle of the ultrasonic flow meter will be illustrated below with reference to the accompanying drawings, such as... Figure 1 As shown:
[0048] An ultrasonic flow meter may include an ultrasonic transducer 110 and an ultrasonic transducer 120. The ultrasonic transducer 110 is located below the pipe, and the ultrasonic transducer 120 is located above the pipe. The diameter of the pipe is D, and v represents the direction of downstream propagation of the fluid in the pipe. The ultrasonic transducer 110 can first act as a transmitter, and the ultrasonic transducer 120 can first act as a receiver to achieve downstream propagation of ultrasonic waves. Then, the ultrasonic transducer 110 can act as a receiver and the ultrasonic transducer 120 can act as a transmitter to achieve upstream propagation of ultrasonic waves. Finally, based on the longer flight time of the ultrasonic waves between downstream and upstream propagation, the fluid velocity (also called flow rate or speed) in the pipe is calculated.
[0049] Furthermore, to better understand this solution, the methods for determining fluid velocity in related technologies are introduced:
[0050] In related technologies, a common method for determining fluid velocity is to first calculate the time-of-flight difference (TOF), and then determine the fluid velocity based on the calculated TOF. Specifically, the TOF can be calculated using the zero-crossing comparison method and the cross-correlation method. However, the sampling frequency of ultrasonic flow meters is limited by hardware. Generally, the sampling frequency of ultrasonic flow meters is less than 100MHz, and the time interval (time resolution) of the signals acquired according to the sampling frequency is greater than 10,000 ps (picoseconds). However, for measuring the flow velocity of fluids in small-diameter pipes, the time resolution corresponding to the flow resolution often needs to reach tens of picoseconds or even a few picoseconds. Therefore, signal interpolation is required to improve the signal accuracy. Currently, the interpolation methods used in the ultrasonic field are mainly nonlinear interpolation and cosine interpolation. However, the sampling frequency of ultrasonic flow meters is limited by hardware, and in actual use, only a few signal information can be used. Approximately 10,000 points need to be interpolated between two adjacent signal sampling points, resulting in a large error in the interpolated signal, a large error in the calculated TOF, and consequently a large error in the determined fluid velocity.
[0051] And, in conjunction with the following Figure 1 The content explains the derivation principle of using time difference of flight to calculate fluid velocity:
[0052] The flight time of the sound wave (denoted as the uplink signal) from ultrasonic transducer 110 to ultrasonic transducer 120 is: but
[0053] The flight time of the sound wave (denoted as the downlink signal) from ultrasonic transducer 120 to ultrasonic transducer 110 is: but
[0054] Among them, t 12 The flight time t is the time from ultrasonic transducer 110 to ultrasonic transducer 120 during which the ultrasonic waves are emitted. 21 The time of flight for ultrasonic waves emitted from ultrasonic transducer 120 to ultrasonic transducer 110 is given by L, where L is the length of the sound wave transmission. Figure 1 (not shown in the image), where c is the speed of sound in the fluid, and v is the fluid velocity. The angle between the ultrasonic transmission path and the pipe ( Figure 1 (Not shown in the image).
[0055] in, Flight time difference ΔT=t 21 -t 12 Where D is the diameter of the pipe;
[0056] However, due to t 12 and t21 The measurement error is relatively large; therefore, the fluid velocity can be calculated using the time-of-flight difference, i.e.:
[0057]
[0058] In summary, the flight time difference ΔT can directly affect the calculation result of the flow velocity v; therefore, if the error in the calculated flight time difference is large, it will lead to a large error in the determined fluid velocity.
[0059] Based on the problems described above, embodiments of this application provide a method for determining fluid velocity, so as to improve the accuracy of the determined fluid velocity when the sampling frequency of the signal is limited by hardware.
[0060] Furthermore, the method for determining fluid velocity provided in the embodiments of this application will be described below.
[0061] The method for determining fluid velocity is applicable to various scenarios involving fluid velocity determination, such as determining the velocity of natural gas flowing in a pipeline or the velocity of oil flowing in a pipeline. This application does not specifically limit the application in this regard. Furthermore, this method for determining fluid velocity can be used with an ultrasonic flow meter. It should be emphasized that the ultrasonic flow meter in this application embodiment can include two ultrasonic transducers, which can be respectively installed on the outer wall of the pipeline. One ultrasonic transducer is used to emit ultrasonic waves, and the other ultrasonic transducer is used to receive ultrasonic waves.
[0062] One method for determining fluid velocity is applied to an ultrasonic flow meter; the method includes:
[0063] The first time-domain signal and the second time-domain signal are aligned to obtain a first backup signal and a second backup signal with the same starting time point; wherein, the first time-domain signal and the second time-domain signal are the acquired signals after the ultrasonic wave has propagated through different propagation directions of the target fluid;
[0064] The first backup signal and the second backup signal are cross-correlated to obtain the current cross-correlation signal.
[0065] Based on the current cross-correlation signal, the target duration is analyzed; wherein, the target duration is used to characterize the error existing in the time offset corresponding to the maximum degree of cross-correlation in the current cross-correlation signal.
[0066] Based on the target duration obtained from the current analysis, the current time difference is corrected; wherein, the initial value of the current time difference is the offset amount required for the alignment process.
[0067] If the target duration obtained from the current analysis is greater than the predetermined allowable error value, the second backup signal is interpolated to obtain a new second backup signal, and the process returns to the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal; otherwise,
[0068] The current time difference is used as the flight time difference of the ultrasonic wave when it propagates downstream and upstream in the target fluid to determine the flow velocity of the target fluid.
[0069] The fluid velocity determination method provided in this application embodiment can align a first time-domain signal and a second time-domain signal to align their starting time points, obtaining a first backup signal and a second backup signal, thereby achieving preliminary alignment of the signals after ultrasonic waves propagate through different propagation directions of the target fluid; and perform cross-correlation processing on the first backup signal and the second backup signal to obtain a current cross-correlation signal, which can characterize the degree of cross-correlation between the first backup signal and the second backup signal under different time offsets; based on the current cross-correlation signal, it is possible to analyze which cross-correlation signal corresponds to the maximum cross-correlation. The error in the time offset of the correlation degree, which is the target duration, can be used to correct the current time difference based on the target duration obtained from the current analysis, thereby improving the accuracy of the current time difference. If the target duration obtained from the current analysis is greater than the predetermined allowable error value, it can be considered that the accuracy of the target duration is still insufficient (that is, the alignment accuracy between the first backup signal and the second backup signal is still insufficient). Correspondingly, the accuracy of the current time difference is also insufficient. Therefore, the second backup signal can be interpolated to obtain a new backup signal, and the process of cross-correlation processing of the first backup signal and the second backup signal can be returned to obtain the cross-correlation signal, thereby realizing the iterative correction of the current time difference. Until the target duration obtained from the current analysis is no greater than the predetermined allowable error value, that is, the alignment accuracy between the first backup signal and the second backup signal is sufficient, and the current time difference has been corrected based on the target duration obtained from the current analysis, the current time difference can be used as the flight time difference of the ultrasonic wave propagating downstream and upstream in the target fluid; then, compared with the prior art, when the sampling frequency of the signal is limited by hardware, this application can iteratively correct the current time difference between the two time domain signals to improve the accuracy of the current time difference, so that the determined flight time difference is also more accurate, and the flow velocity of the target fluid determined based on the more accurate flight time difference is also more accurate, thereby improving the accuracy of the determined fluid velocity when the sampling frequency of the signal is limited by hardware.
[0070] The following describes a method for determining fluid velocity provided in an embodiment of this application, with reference to the accompanying drawings.
[0071] like Figure 2 As shown in the embodiment of this application, a method for determining fluid velocity is applied to an ultrasonic flow meter; the method includes:
[0072] S201, Align the first time domain signal and the second time domain signal to obtain a first backup signal and a second backup signal with the same corresponding start time point;
[0073] Among them, the first time domain signal and the second time domain signal are the signals obtained after the ultrasonic waves have propagated through different propagation directions of the target fluid;
[0074] It is understood that the first time-domain signal can be a signal collected by the ultrasonic flowmeter that propagates downstream in the target fluid or upstream in the target fluid, while the second time-domain signal is a time-domain signal with the opposite propagation direction to the first time-domain signal. This application does not specifically limit this; for example, if the first time-domain signal is a signal propagating downstream in natural gas, then the second time-domain signal can be a signal propagating upstream in natural gas. Furthermore, the first and second time-domain signals can be aligned. This means that the first time-domain signal can be offset using the start time point of the second time-domain signal as a reference point, or vice versa, so that the corresponding start time points of the two signals are aligned, resulting in a first backup signal and a second backup signal. It should be emphasized that since the ultrasonic flowmeter's acquisition frequency is fixed, aligning the start time points of the first and second time-domain signals yields both a first backup signal and a second backup signal. The time points of other sampling points in the second backup signal are all aligned. However, the signal amplitudes of the first backup signal and the second backup signal at the same time point may be different. Therefore, after obtaining the first backup signal and the second backup signal, the phase of the second backup signal needs to be adjusted (i.e., fine-tuned) to make the two signals completely aligned. For example, if the first backup signal and the second backup signal are graphically represented and placed in a coordinate system, the horizontal coordinates of each sampling point in the first backup signal are aligned with the horizontal coordinates of each sampling point in the second backup signal. This embodiment of the invention does not specifically limit this. In addition, under normal circumstances, the starting time point of the signal propagating downstream in the target fluid can be used as the reference point, and the starting time point of the signal propagating upstream in the target fluid can be aligned with the reference point to obtain the first backup signal and the second backup signal. This embodiment of the application does not specifically limit this.
[0075] To better understand the process of aligning the first and second time-domain signals, the following description is provided with reference to the accompanying figures, as shown in Figures 3(a) and 3(b):
[0076] In Figure 3(a), time-domain signal 310 is the signal collected by the ultrasonic flowmeter and propagating downstream in the target fluid, and time-domain signal 320 is the signal collected by the ultrasonic flowmeter and propagating upstream in the target fluid. Time-domain signals 310 and 320 can be graphically represented, i.e., placed in a coordinate system. The horizontal axis of this coordinate system represents time, with a time range of [0, 18], and the vertical axis represents signal amplitude, with a signal amplitude range of [-1.5, 1.5]. The starting time point of time-domain signal 310 is 1, and the ending time point is 7 (the last time in time-domain signal 310). The time range of the signal amplitude is [-1, 1]. Based on the 7 signal sampling points that propagate downstream in the target fluid collected by the ultrasonic flowmeter, a time domain signal 310 can be formed. These 7 signal sampling points are all represented as squares. The starting time point of the time domain signal 320 is 10, and the ending time point is 16 (the time represented by the abscissa of the last time point in the time domain signal 320). The signal amplitude range is [-1, 1]. Based on the 7 signal sampling points that propagate upstream in the target fluid collected by the ultrasonic flowmeter, a time domain signal 320 can be formed. These 7 signal sampling points are all represented as circles. In addition, it should be emphasized that, in order to facilitate the comparison of the two time-domain signals, the two time-domain signals are characterized by the coordinate system shown in Figure 3(a). For any time-domain signal, the time represented by the origin shown in Figure 3(a) can be understood as: the start time of the ultrasonic signal to which the time-domain signal belongs. The time difference between the acquisition time corresponding to any sampling point of the time-domain signal and the origin is the time difference between the acquisition time corresponding to any sampling point of the time-domain signal and the start time of the ultrasonic signal to which the time-domain signal belongs. Thus, the difference between the time offset from the start time point of time-domain signal 320 to 0 and the time offset from the start time point of time-domain signal 310 to 0 can be regarded as the flight time difference of the ultrasonic wave when it propagates downstream and upstream in the target fluid.
[0077] Figure 3(b) is a schematic diagram of aligning time-domain signal 310 and time-domain signal 320. The horizontal axis of the coordinate system represents time, and the range of time represented by the horizontal axis is [0, 18]. The vertical axis represents the signal amplitude, and the range of signal amplitude represented by the vertical axis is [-1.5, 1.5]. The starting time point of time-domain signal 320 is aligned with the starting time point of time-domain signal 310, so that the horizontal axis of 310 and 320 is aligned. The horizontal axis of each sampling point in 310 is aligned with the horizontal axis of each sampling point in 320. This process can also be called coarse alignment or preliminary alignment. In Figure 3(b), the range of the horizontal axis of the two time-domain signals is [1, 7], and the range of the vertical axis is [-1, 1]. For example, the x-coordinates of each sampling point in the first backup signal and the second backup signal are [1,7]. The y-coordinate of the sampling point of the first backup signal with x-coordinate 1 is 0, the y-coordinate of the sampling point of the second backup signal with x-coordinate 1 is 0.198669, the y-coordinate of the sampling point of the first backup signal with x-coordinate 2 is 0.84147, the y-coordinate of the sampling point of the second backup signal with x-coordinate 2 is 0.932039, the y-coordinate of the sampling point of the first backup signal with x-coordinate 3 is 0.90929, and the y-coordinate of the sampling point of the second backup signal with x-coordinate 3 is 0.808496. Therefore, the y-coordinates of the first backup signal and the second backup signal, which have the same x-coordinate, are also different.
[0078] S202, perform cross-correlation processing on the first backup signal and the second backup signal to obtain the current cross-correlation signal;
[0079] It is understandable that after obtaining the first backup signal and the second backup signal, cross-correlation processing can be performed on the first backup signal and the second backup signal to obtain a cross-correlation signal. The obtained cross-correlation signal can reflect the degree of correlation (cross-correlation degree) between the first backup signal and the second backup signal. In addition, the cross-correlation signal can also be visualized, that is, placed in a coordinate system. The horizontal axis of the coordinate system represents the time offset, and the vertical axis represents the signal amplitude (also called amplitude). The vertical axis of each point in the cross-correlation signal is: the degree of correlation between the first backup signal and the offset second backup signal after the second backup signal is offset by the time offset represented by the horizontal axis of that point. Therefore, the higher the value represented by the vertical axis, the higher the degree of correlation between the first backup signal and the second backup signal under that time offset. This application does not specifically limit this.
[0080] To better understand the content of cross-correlation processing, the following section introduces it in conjunction with the formula:
[0081]
[0082] Among them, S 1-1 [i] represents the signal amplitude at the i-th sampling point in the first backup signal, m is the time offset, and S 2-1 [im] is the signal amplitude of the (im)th signal sampling point in the second backup signal, and C1[m] is the signal amplitude of the cross-correlation signal at the time offset m.
[0083] Of course, the cross-correlation process described above is only an example. Other methods can also be used to perform cross-correlation processing on the first backup signal and the second backup signal. This application does not specifically limit this.
[0084] S203, Analyze the target duration based on the current cross-correlation signal;
[0085] The target duration is used to characterize the error in the time offset corresponding to the maximum degree of cross-correlation in the current cross-correlation signal.
[0086] It is understood that, based on the current cross-correlation signal, the error existing in the time offset corresponding to the maximum degree of cross-correlation in the current cross-correlation signal can be analyzed; for example, the current cross-correlation signal can be interpolated, and the target duration can be analyzed by combining the interpolated cross-correlation signal with the current cross-correlation signal; this application embodiment does not specifically limit this.
[0087] For clarity, the process of analyzing the target duration will be described in other embodiments, and will not be elaborated on here.
[0088] S204, Based on the target duration obtained from the current analysis, correct the current time difference;
[0089] The initial value of the current time difference is the offset amount required for the alignment process.
[0090] It is understandable that if there is no corrected current time difference, the offset required for alignment processing is determined as the initial value of the current time difference; if there is a corrected current time difference, the current time difference can be directly corrected. For example, the initial value of the current time difference can be: t1 = N × T1, where N is the number of cycles moved during the alignment processing of the first and second time domain signals, and T1 is the sampling interval of the first time domain signal or the sampling interval of the second time domain signal, where the sampling interval of the first and second time domain signals is the same. It should be emphasized that in one implementation, after correcting the current time difference, it can be detected whether the currently analyzed target duration is greater than a predetermined allowable error value. If the currently analyzed target duration is greater than the predetermined allowable error value, step S205 is executed; otherwise, step S206 is executed. This application embodiment does not specifically limit this step.
[0091] In one implementation, the current time difference is corrected based on the target duration obtained from the current analysis, including step A1:
[0092] Step A1: Calculate the sum of the target duration obtained from the current analysis and the current time difference to obtain the corrected current time difference.
[0093] It is understood that the target duration obtained from the current analysis can be a positive or negative number, and this application embodiment does not specifically limit it. Therefore, the sum of the target duration obtained from the current analysis and the current time difference can be calculated to correct the current time difference, resulting in a corrected current time difference. For example, if the current time difference is 5 milliseconds and 10 picoseconds, and the target duration is 20 picoseconds, then the corrected current time difference can be calculated as 5 milliseconds and 30 picoseconds; if the current time difference is 10 milliseconds and 20 picoseconds, and the target duration is -10 picoseconds, then the corrected current time difference can be calculated as 10 milliseconds and 10 picoseconds.
[0094] As can be seen, when correcting the current time difference, the embodiments of this application can calculate the sum of the target duration obtained from the current analysis and the current time difference, thereby obtaining the corrected current time difference, which provides a basis for subsequent calculation of the flight time difference of ultrasonic waves when they propagate downstream and upstream in the target fluid.
[0095] S205, If the target duration obtained from the current analysis is greater than the predetermined allowable error value, interpolate the second backup signal to obtain a new second backup signal;
[0096] It is understandable that step S205 corresponds to the situation where the target duration obtained from the current analysis is greater than the predetermined allowable error value. It can be considered that the accuracy of the target duration is insufficient, that is, the alignment accuracy between the first backup signal and the second backup signal is not sufficient. The second backup signal can be interpolated, and the signal obtained after interpolation can be used as the new second backup signal. After obtaining the new second backup signal, the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain the cross-correlation signal can be returned to achieve iterative correction of the current time difference, that is, return to step S202.
[0097] For clarity of layout, the process of interpolating the second backup signal to obtain a new second backup signal will be described in other embodiments and will not be elaborated on here.
[0098] S206, If the target duration obtained from the current analysis is not greater than the predetermined allowable error value, the current time difference is used as the flight time difference of the ultrasonic wave when it propagates downstream and upstream in the target fluid to determine the flow velocity of the target fluid.
[0099] It is understandable that step S206 corresponds to the situation where the target duration obtained from the current analysis is not greater than the predetermined allowable error value, and it can be considered that the alignment accuracy between the first backup signal and the second backup signal is sufficient, and the current time difference has been corrected based on the target duration obtained from the current analysis; then, the current time difference can be used as the flight time difference of the ultrasonic wave when it propagates downstream and upstream in the target fluid, thereby determining the flow velocity of the target fluid.
[0100] Furthermore, to better understand that the alignment accuracy between the first backup signal and the second backup signal is sufficient, the following explanation is provided in conjunction with the attached figure, as shown in Figure 3(c):
[0101] In Figure 3(c), the alignment accuracy between the first and second backup signals is sufficient. The horizontal axis of the coordinate system in which the two backup signals are located represents time, with the range of time represented by the horizontal axis being [0, 18]. The vertical axis represents the signal amplitude, with the range of signal amplitude represented by the vertical axis being [-1.5, 1.5]. After multiple iterations of the second backup signal, the target duration obtained by the current analysis is made to be no greater than the predetermined allowable error value, thereby obtaining two backup signals with sufficient alignment accuracy. The horizontal axis of the two backup signals is in the range of [1, 7], and the vertical axis is in the range of [-1, 1].
[0102] For example, after determining the time difference of flight of the ultrasonic wave when it propagates with and against the current in the target fluid, it can be substituted into the formula for calculating the flow velocity of the target fluid to determine the flow velocity of the target fluid.
[0103] The formula for calculating the velocity of the target fluid is as follows:
[0104]
[0105] Where v is the flow velocity of the target fluid, c is the speed of sound in the fluid, ΔT is the time difference between the propagation of the ultrasonic wave in the target fluid with and against the current, and D is the diameter of the pipe. The angle between the ultrasonic wave transmission path and the pipe.
[0106] Of course, the above is only an illustrative example, and other calculation methods can also be used to determine the flow rate of the target fluid. This application does not specifically limit this method.
[0107] The fluid velocity determination method provided in this application embodiment can align a first time-domain signal and a second time-domain signal to align their starting time points, obtaining a first backup signal and a second backup signal, thereby achieving preliminary alignment of the signals after ultrasonic waves propagate through different propagation directions of the target fluid; and perform cross-correlation processing on the first backup signal and the second backup signal to obtain a current cross-correlation signal, which can characterize the degree of cross-correlation between the first backup signal and the second backup signal under different time offsets; based on the current cross-correlation signal, it is possible to analyze which cross-correlation signal corresponds to the maximum cross-correlation. The error in the time offset of the correlation degree, which is the target duration, can be used to correct the current time difference based on the target duration obtained from the current analysis, thereby improving the accuracy of the current time difference. If the target duration obtained from the current analysis is greater than the predetermined allowable error value, it can be considered that the accuracy of the target duration is still insufficient (that is, the alignment accuracy between the first backup signal and the second backup signal is still insufficient). Correspondingly, the accuracy of the current time difference is also insufficient. Therefore, the second backup signal can be interpolated to obtain a new backup signal, and the process of cross-correlation processing of the first backup signal and the second backup signal can be returned to obtain the cross-correlation signal, thereby realizing the iterative correction of the current time difference. Until the target duration obtained from the current analysis is no greater than the predetermined allowable error value, that is, the alignment accuracy between the first backup signal and the second backup signal is sufficient, and the current time difference has been corrected based on the target duration obtained from the current analysis, the current time difference can be used as the flight time difference of the ultrasonic wave propagating downstream and upstream in the target fluid; then, compared with the prior art, when the sampling frequency of the signal is limited by hardware, this application can iteratively correct the current time difference between the two time domain signals to improve the accuracy of the current time difference, so that the determined flight time difference is also more accurate, and the flow velocity of the target fluid determined based on the more accurate flight time difference is also more accurate, thereby improving the accuracy of the determined fluid velocity when the sampling frequency of the signal is limited by hardware.
[0108] Alternatively, in another embodiment, the target duration is analyzed based on the current cross-correlation signal, including steps B1-B3:
[0109] Step B1: Interpolate the current cross-correlation signal to obtain the interpolated signal;
[0110] Step B2: Determine the time offset corresponding to the peak value in the interpolated signal to obtain the first time offset, and determine the time offset corresponding to the peak value in the current cross-correlation signal to obtain the second time offset; the peak value of any signal represents the maximum amplitude of the signal.
[0111] Step B3: Subtract the first time offset from the second time offset to obtain the target duration.
[0112] It is understandable that, regarding step B1, due to hardware limitations in the sampling frequency of the ultrasonic flowmeter, the accuracy of the first and second backup signals is low (less effective information), resulting in low accuracy of the current cross-correlation signal. Therefore, interpolation can be performed on the current cross-correlation signal to obtain an interpolated signal, thereby improving the accuracy of the cross-correlation signal. Various interpolation methods can be used to interpolate the current cross-correlation signal, such as nonlinear interpolation and sinusoidal interpolation. This application does not specifically limit the methods used. For example, sinusoidal interpolation can be used to interpolate the current cross-correlation signal, i.e., Where C1[m] is the signal amplitude of the cross-correlation signal at time offset m, n is the interpolation time offset, and C 1-1 [n] represents the signal amplitude of the interpolated signal at a time offset of n. Of course, the above is merely an illustrative example; other interpolation methods can also be used to interpolate the current cross-correlation signal, and this application does not specifically limit this method.
[0113] It is understood that, for step B2, both the interpolated signal and the current cross-correlation signal can be graphically represented, i.e., placed in a coordinate system. The peak value in the interpolated signal can be considered as the maximum value represented by the vertical axis of the interpolated signal, i.e., the maximum amplitude of the signal. The horizontal axis of this maximum amplitude can be considered as the time offset corresponding to the peak value in the interpolated signal, i.e., the first time offset. Therefore, based on the interpolated signal, it can be determined that the cross-correlation between the first backup signal and the second backup signal offset by the first time offset is the greatest. Similarly, the peak value in the current cross-correlation signal can be considered as the maximum value represented by the vertical axis of the current cross-correlation signal, i.e., the maximum amplitude of the signal. The horizontal axis of this maximum amplitude can be considered as the time offset corresponding to the peak value in the current cross-correlation signal, i.e., the second time offset. Therefore, based on the current cross-correlation signal, it can be determined that the cross-correlation between the first backup signal and the second backup signal offset by the second time offset is the greatest. This embodiment of the application does not specifically limit this.
[0114] It is understandable that, for step B3, based on the first time offset and the second time offset determined in step B2, the difference between the two can be calculated to determine the target duration. For example, if the first time offset is 20ms and the second time offset is 10ms, the target duration can be calculated to be 10ms.
[0115] To better understand the current cross-correlation signal and the interpolated signal, the following description is provided with reference to the accompanying figures, as shown in Figures 4(a) and 4(b):
[0116] Figure 4(a) is a schematic diagram of the current cross-correlation signal. The horizontal axis represents the time offset, which ranges from [-7, 7], and the vertical axis represents the signal amplitude, which ranges from [-2, 4]. The peak signal amplitude in the current cross-correlation signal is 3, and the corresponding time offset is 0.
[0117] Figure 4(b) is a schematic diagram of the interpolated signal. The horizontal axis represents the time offset, which ranges from [-7, 7], and the vertical axis represents the signal amplitude, which ranges from [-2, 4]. Since the interpolated signal has higher precision, the peak value in the interpolated signal will also be adjusted. The peak value in the interpolated signal has a signal amplitude of 3.1 and a corresponding time offset of 0.4.
[0118] As can be seen, the embodiments of this application can interpolate the current cross-correlation signal to obtain the interpolated signal, and determine the time offset corresponding to the peak value in the interpolated signal and the time offset corresponding to the peak value in the current cross-correlation signal. Subsequently, based on the above two time offsets, the target duration can be determined. Subsequently, based on the target duration, the current time difference can be corrected, and the relationship between the target duration and the allowable error value can be judged. When the target duration is greater than the predetermined allowable error value, it can be considered that the accuracy of the target duration is insufficient. Correspondingly, the accuracy of the current time difference is also insufficient. The current time difference can be iteratively corrected to improve the accuracy of the current time difference, thereby making the determined flight time difference more accurate, and thus improving the accuracy of the determined fluid velocity.
[0119] Optionally, in another embodiment, the second backup signal is interpolated to obtain a new second backup signal, including step C1:
[0120] Step C1: Based on the target duration obtained from the current analysis and according to the sampling frequency used when acquiring the second time domain signal, interpolate the second backup signal to obtain a new second backup signal.
[0121] It is understandable that during the interpolation process of the second backup signal, the interpolated signal can be used as the new second backup signal based on the target duration obtained from the current analysis and the sampling frequency used when acquiring the second time-domain signal. It should be emphasized that the sampling frequency of the new second backup signal is the same as the sampling frequency of the second time-domain signal and the same as the sampling frequency of the second backup signal before interpolation. The sampling frequency is not adjusted during the interpolation process, and this application embodiment does not specifically limit this.
[0122] As can be seen, in this embodiment, the second backup signal can be interpolated based on the target duration obtained from the current analysis and the sampling frequency used when acquiring the second time domain signal to obtain a new second backup signal. Subsequently, the new second backup signal can be cross-correlated with the first backup signal to achieve iteration, thereby iteratively correcting the current time difference until the target duration obtained from the current analysis is not greater than a predetermined allowable error value. It can be considered that the alignment accuracy between the first backup signal and the second backup signal is sufficient, and the current time difference has been corrected based on the target duration obtained from the current analysis to improve the accuracy of the current time difference, thereby making the determined flight time difference more accurate, and thus improving the accuracy of the determined fluid velocity.
[0123] In one implementation, based on the target duration obtained from the current analysis and according to the sampling frequency used when acquiring the second time-domain signal, the second backup signal is interpolated to obtain a new second backup signal, including steps C11-C12:
[0124] Step C11: For each signal sampling point in the second backup signal, determine the time point obtained after performing the current analysis on the target duration of the time point corresponding to the signal sampling point, and take it as the target time point corresponding to the signal sampling point. Based on the sampling frequency used when collecting the second time domain signal, calculate the signal amplitude at the target time point corresponding to the signal sampling point.
[0125] It is understood that the second backup signal may contain multiple signal sampling points. For each signal sampling point, the time point corresponding to that sampling point can be shifted based on the target duration, and this time point is taken as the target time point for that sampling point. This target time point can also be used as the abscissa of the signal sampling point in the coordinate system. For example, if the target duration is 5ms and the time point corresponding to signal sampling point 1 is 0, then the target time point can be determined to be 5ms. Furthermore, the signal amplitude at the target time point can be calculated based on the sampling frequency used when acquiring the second time-domain signal. The signal amplitude at the target time point can also be used as the ordinate of the signal sampling point in the coordinate system. This application embodiment does not specifically limit this. Additionally, in one implementation, the phase of the signal sampling point, shifted according to the target duration, can be considered as the target time point for that sampling point. The phase can also be considered as a time point. This application embodiment does not specifically limit this.
[0126] Furthermore, there are multiple ways to calculate the signal amplitude at the target time point corresponding to the signal sampling point. The following is an example of one way to calculate the signal amplitude at the target time point corresponding to the signal sampling point.
[0127] For example, in one approach, calculating the signal amplitude at a target time point corresponding to a sampling point of the signal based on the sampling frequency used when acquiring the second time-domain signal includes:
[0128] Calculate the signal amplitude at the time point corresponding to the signal sampling point according to the predetermined amplitude calculation formula; wherein the predetermined amplitude calculation formula includes:
[0129]
[0130] Where S3[i] is the signal amplitude at the target time point corresponding to the i-th signal sampling point, S2[i] is the signal amplitude of the i-th signal sampling point in the second backup signal, S2[i+1] is the signal amplitude of the (i+1)-th signal sampling point in the second backup signal, t2 is the target duration obtained from the current analysis, and T1 is the sampling frequency used when collecting the second time domain signal.
[0131] as well as, This can be considered as weight. It can be transformed into This can also be considered as a weight, but this application does not specifically limit this in its embodiments. For example, i = 1, S3[1]=S2[1]×0.1+S2[2]×0.9.
[0132] Understandably, the signal amplitude at the time point corresponding to the signal sampling point can be calculated according to a predetermined amplitude calculation formula; and, it can be... The product of the signal amplitude at the i-th signal sampling point in the second backup signal and the first signal amplitude is taken as the first signal amplitude. The product of the signal amplitude at the (i+1)th signal sampling point in the second backup signal is taken as the second signal amplitude. By calculating the sum of the first signal amplitude and the second signal amplitude, the signal amplitude at the corresponding time point of the signal sampling point can be obtained.
[0133] Of course, the above is only an example of one way to calculate the signal amplitude at the target time point corresponding to the signal sampling point. Other methods can also be used to calculate the signal amplitude, such as using a neural network model. This application does not specifically limit this method.
[0134] As can be seen, the embodiments of this application can calculate the signal amplitude at the time point corresponding to the signal sampling point according to the predetermined amplitude calculation formula, providing a basis for interpolating the second backup signal, making the subsequently determined flight time difference more accurate, thereby improving the accuracy of the determined fluid velocity.
[0135] Step C12 involves interpolating the signal based on the target time point and signal amplitude corresponding to each signal sampling point to obtain a new second backup signal.
[0136] Understandably, after calculating the signal amplitude at the target time point corresponding to each signal sampling point, interpolation processing can be performed on the signal composed of the target time point and signal amplitude corresponding to each signal sampling point to obtain a new second backup signal. Subsequently, the new second backup signal can be cross-correlated with the first backup signal to achieve cyclic processing. For example, for each signal sampling point, the target time point corresponding to that signal sampling point can be used as the abscissa, and the signal amplitude corresponding to that signal sampling point can be used as the ordinate to determine the coordinates of that signal sampling point, and a new second backup signal can be constructed based on the coordinates of each signal sampling point.
[0137] As can be seen, the embodiments of this application determine the target time point and signal amplitude corresponding to each signal sampling point in the second backup signal. Based on the signal composed of the target time point and signal amplitude corresponding to each signal sampling point, interpolation processing is performed to obtain a new second backup signal. Subsequently, the new second backup signal can be cross-correlated with the first backup signal to achieve iteration, thereby iteratively correcting the current time difference until the target duration obtained by the current analysis is not greater than a predetermined allowable error value. That is, the alignment accuracy between the first backup signal and the second backup signal is sufficient, and the current time difference has been corrected based on the target duration obtained by the current analysis, thereby improving the accuracy of the current time difference. Subsequently, the current time difference is used as the flight time difference of the ultrasonic wave when it propagates downstream and upstream in the target fluid, thereby making the determined flight time difference more accurate, and thus improving the accuracy of the determined fluid velocity.
[0138] Optionally, in another embodiment, if the target duration obtained from the current analysis is greater than a predetermined allowable error value, after interpolating the second backup signal to obtain a new second backup signal, before returning to the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain the cross-correlation signal, the method further includes steps D1-D2:
[0139] Step D1: Determine the frequency of the bandpass filter based on the frequency of the ultrasonic flow meter's transmitted signal; wherein, the upper limit of the bandpass filter frequency is the product of the ultrasonic flow meter's transmitted signal frequency and a first magnification, and the lower limit of the bandpass filter frequency is the product of the ultrasonic flow meter's transmitted signal frequency and a second magnification, wherein the first magnification is greater than the second magnification.
[0140] It is understandable that after interpolating the second backup signal to obtain a new second backup signal, the frequency of the bandpass filter can be determined based on the frequency of the ultrasonic flowmeter's transmitted signal. The upper limit of the bandpass filter frequency can be the product of the ultrasonic flowmeter's transmitted signal frequency and a first multiplier, where the empirical value of the first multiplier can be 2, and this embodiment does not specifically limit this. The lower limit of the bandpass filter frequency can be the product of the ultrasonic flowmeter's transmitted signal frequency and a second multiplier, where the empirical value of the second multiplier can be 0.3, and this embodiment does not specifically limit this. It should be emphasized that since the upper limit of the bandpass filter frequency is related to the first multiplier, and the lower limit of the bandpass filter frequency is related to the second multiplier, the first multiplier can be greater than the second multiplier, and this embodiment does not specifically limit this.
[0141] Step D2: Based on the frequency of the bandpass filter, the new second backup signal is filtered to obtain the filtered second backup signal, and then the step of returning to perform cross-correlation processing on the first backup signal and the second backup signal to obtain the cross-correlation signal is executed.
[0142] Understandably, based on the frequency of the bandpass filter, the new second backup signal can be subjected to anti-aliasing filtering, so that signals not located at the frequency of the bandpass filter are filtered out, resulting in a filtered second backup signal. In this filtered second backup signal, high-frequency noise signals have been filtered out, making the filtered second backup signal more accurate. Subsequently, the step of returning to perform cross-correlation processing on the first and second backup signals can be executed to obtain a cross-correlation signal.
[0143] As can be seen, the embodiments of this application can filter the new second backup signal so that the high-frequency noise signal in the second backup signal that is subsequently cross-correlation processed is filtered out. This makes the filtered second backup signal more accurate, and the subsequently determined time-of-flight difference is also more accurate. The flow velocity of the target fluid determined based on the more accurate time-of-flight difference is also more accurate. Thus, the accuracy of the determined fluid velocity is improved when the sampling frequency of the signal is limited by hardware.
[0144] Optionally, in another embodiment, this application also provides another method for determining fluid velocity, such as... Figure 5 As shown:
[0145] S501 performs pre-alignment on the uplink signal S1 and the downlink signal S2 to obtain signal S. 1-1 Signal S 2-1 And determine the alignment time difference t1;
[0146] Wherein, uplink signal S1 can be considered as the first time-domain signal in the above embodiment, downlink signal S2 can be considered as the second time-domain signal in the above embodiment, and signal pre-alignment can be considered as the alignment process in the above embodiment. 1-1 As the first backup signal in the above embodiments, signal S 2-1 The second backup signal in the above embodiment, signal S 1-1 and signal S 2-1 The corresponding start time points are the same.
[0147] S502, for signal S 1-1 Signal S 2-1 Perform cross-correlation processing and interpolate the obtained current cross-correlation signal C1 to obtain the interpolated signal C. 1-1 ;
[0148] Understandably, it is possible to apply signal S 1-1 Signal S 2-1 Perform cross-correlation processing to obtain the current cross-correlation signal C1. You can also interpolate the cross-correlation signal C1 to obtain the interpolated signal C. 1-1 The methods for cross-correlation and interpolation have been described in the above embodiments and will not be elaborated further here.
[0149] S503, calculate the time offset corresponding to the peak value of the current cross-correlation signal C1, and compare it with the interpolated signal C. 1-1 The difference between the time offsets corresponding to the peak values is used to obtain the target duration t2.
[0150] It is understandable that step S503 is similar to the process of steps B1-B3 above, and will not be elaborated on here.
[0151] S504, Detect whether the target duration t2 is greater than the allowable error value;
[0152] If yes, proceed to step S505; otherwise, proceed to step S506.
[0153] S505, for signal S 2-1 Interpolation is performed to obtain a new signal S. 2-1 ;
[0154] It is understandable that a new signal S is obtained. 2-1Bandpass anti-aliasing filtering can then be performed to filter the new signal S. 2-1 The high-frequency noise signal in the process is filtered out, and the process can then return to step S502 for iterative processing.
[0155] S506, calculate the sum of the alignment time difference t1 and the target duration t2 as the flight time difference between the uplink signal S1 and the downlink signal S2, and determine the flow velocity of the target fluid.
[0156] The fluid velocity determination method provided in this application embodiment can pre-align the uplink signal S1 and the downlink signal S2 to obtain signal S. 1-1 Signal S 2-1 This allows for the initial alignment of ultrasonic signals propagating through different directions in the target fluid; and the alignment of signal S... 1-1 Signal S 2-1 Perform cross-correlation processing to obtain the current cross-correlation signal C1. The cross-correlation signal C1 can characterize the signal S at different time offsets. 1-1 Signal S 2-1 The degree of cross-correlation between them; interpolation processing is performed on the obtained current cross-correlation signal C1 to obtain the interpolated signal C. 1-1 Calculate the time offset corresponding to the peak value of the current cross-correlation signal C1, and compare it with the interpolated signal C. 1-1 The difference between the peak values and the corresponding time offsets is used to obtain the target duration t2. It is then checked whether the target duration t2 is greater than the allowable error value. If so, the accuracy of the target duration is considered insufficient, and the signal S can be adjusted. 2-1 Interpolation is performed to obtain a new signal S. 2-1 and return the signal S 1-1 Signal S 2-1 The process involves cross-correlation processing until the target duration is no greater than the allowable error value. The sum of the alignment time difference t1 and the target duration t2 can be calculated as the time-of-flight difference between the uplink signal S1 and the downlink signal S2, and the flow velocity of the target fluid can be determined. The time-of-flight difference determined in this application is also more accurate, and the flow velocity of the target fluid determined based on the more accurate time-of-flight difference is also more accurate. This improves the accuracy of the determined fluid velocity when the sampling frequency of the signal is limited by hardware.
[0157] Based on the above method embodiments, this application also provides a fluid velocity determination device, applied to an ultrasonic flow meter; such as Figure 6 As shown, the device includes:
[0158] Alignment processing module 610 is used to align the first time domain signal and the second time domain signal to obtain a first backup signal and a second backup signal with the same corresponding start time point; wherein, the first time domain signal and the second time domain signal are acquired signals after the ultrasonic wave has propagated through different propagation directions of the target fluid;
[0159] The cross-correlation processing module 620 is used to perform cross-correlation processing on the first backup signal and the second backup signal to obtain the current cross-correlation signal;
[0160] Analysis module 630 is used to analyze the target duration based on the current cross-correlation signal; wherein the target duration is used to characterize the error existing in the time offset corresponding to the maximum cross-correlation degree in the current cross-correlation signal;
[0161] The correction module 640 is used to correct the current time difference based on the target duration obtained from the current analysis; wherein the initial value of the current time difference is the offset amount required for the alignment process.
[0162] The interpolation module 650 is used to interpolate the second backup signal if the target duration obtained by the current analysis is greater than a predetermined allowable error value, so as to obtain a new second backup signal, and return to the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal;
[0163] The first determining module 660 is used to determine the flow velocity of the target fluid by using the current time difference as the flight time difference when the ultrasonic wave propagates downstream and upstream in the target fluid.
[0164] Optionally, the analysis module is specifically used for:
[0165] Interpolate the current cross-correlation signal to obtain the interpolated signal;
[0166] The time offset corresponding to the peak value in the interpolated signal is determined to obtain a first time offset, and the time offset corresponding to the peak value in the current cross-correlation signal is determined to obtain a second time offset; the peak value of any signal represents the maximum amplitude of the signal.
[0167] The target duration is obtained by subtracting the first time offset from the second time offset.
[0168] Optionally, the interpolation module includes:
[0169] The interpolation processing submodule is used to interpolate the second backup signal according to the target duration obtained from the current analysis and the sampling frequency used when acquiring the second time domain signal, so as to obtain a new second backup signal.
[0170] Optionally, the interpolation processing submodule includes:
[0171] The calculation unit is used to determine, for each signal sampling point in the second backup signal, the time point obtained after performing the current analysis on the target duration obtained from the time point corresponding to the signal sampling point, and take the obtained time point as the target time point corresponding to the signal sampling point, and calculate the signal amplitude at the target time point corresponding to the signal sampling point based on the sampling frequency used when collecting the second time domain signal.
[0172] The interpolation processing unit is used to perform interpolation processing on the signal composed of the target time point and signal amplitude corresponding to each signal sampling point to obtain a new second backup signal.
[0173] Optionally, the correction module is specifically used for:
[0174] Calculate the sum of the target duration obtained from the current analysis and the current time difference to obtain the corrected current time difference.
[0175] Optionally, the computing unit is specifically used for:
[0176] The signal amplitude at the corresponding time point of the signal sampling point is calculated according to a predetermined amplitude calculation formula; wherein the predetermined amplitude calculation formula includes:
[0177]
[0178] Wherein, S3[i] is the signal amplitude at the target time point corresponding to the i-th signal sampling point, S2[i] is the signal amplitude at the i-th signal sampling point in the second backup signal, S2[i+1] is the signal amplitude at the (i+1)-th signal sampling point in the second backup signal, t2 is the target duration obtained from the current analysis, and T1 is the sampling frequency used when collecting the second time domain signal.
[0179] Optionally, the device further includes:
[0180] The second determining module is used to determine the frequency of a bandpass filter based on the frequency of the ultrasonic flowmeter's transmitted signal, before returning to the step of performing cross-correlation processing on the first and second backup signals to obtain a cross-correlation signal if the target duration obtained from the current analysis is greater than a predetermined allowable error value. The upper limit of the bandpass filter frequency is the product of the frequency of the ultrasonic flowmeter's transmitted signal and a first magnification factor, and the lower limit of the bandpass filter frequency is the product of the frequency of the ultrasonic flowmeter's transmitted signal and a second magnification factor, where the first magnification factor is greater than the second magnification factor.
[0181] The filtering module is used to filter the new second backup signal based on the frequency of the bandpass filter to obtain the filtered second backup signal, and to perform the step of returning to perform cross-correlation processing on the first backup signal and the second backup signal to obtain the cross-correlation signal.
[0182] In the technical solution of this application, the operations of obtaining, storing, using, processing, transmitting, providing and disclosing user personal information are all carried out with the user's authorization.
[0183] This application also provides an ultrasonic flow meter, such as... Figure 7 As shown, it includes:
[0184] Memory 701 is used to store computer programs;
[0185] The processor 702, when executing the program stored in the memory 701, implements any of the above-mentioned methods for determining fluid velocity.
[0186] Furthermore, the aforementioned ultrasonic flow meter may also include a communication bus and / or a communication interface, with the processor 702, communication interface, and memory 701 communicating with each other via the communication bus.
[0187] The communication bus mentioned in the ultrasonic flow meter above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the figure, but this does not mean that there is only one bus or one type of bus.
[0188] The communication interface is used for communication between the ultrasonic flow meter and other devices.
[0189] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0190] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0191] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements any of the above-described methods for determining fluid velocity.
[0192] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the methods for determining fluid velocity in the above embodiments.
[0193] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.
[0194] It should be noted that, in this document, 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 a 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 said element.
[0195] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0196] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method for determining fluid velocity, characterized in that, Applied to ultrasonic flow meters; the method includes: The first time-domain signal and the second time-domain signal are aligned to obtain a first backup signal and a second backup signal with the same starting time point; wherein, the first time-domain signal and the second time-domain signal are the acquired signals after the ultrasonic wave has propagated through different propagation directions of the target fluid; The first backup signal and the second backup signal are cross-correlated to obtain the current cross-correlation signal. Based on the current cross-correlation signal, the target duration is analyzed; wherein, the target duration is used to characterize: the time offset corresponding to the maximum cross-correlation degree in the current cross-correlation signal, and the error existing relative to the time offset corresponding to the maximum cross-correlation degree in the interpolated signal; the interpolated signal is the signal obtained by interpolating the current cross-correlation signal; Based on the target duration obtained from the current analysis, the current time difference is corrected; wherein, the initial value of the current time difference is the offset amount required for the alignment process. If the target duration obtained from the current analysis is greater than the predetermined allowable error value, the second backup signal is interpolated to obtain a new second backup signal, and the process returns to the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal; otherwise, The current time difference is used as the flight time difference of the ultrasonic wave when it propagates downstream and upstream in the target fluid to determine the flow velocity of the target fluid.
2. The method according to claim 1, characterized in that, The analysis of the target duration based on the current cross-correlation signal includes: Interpolate the current cross-correlation signal to obtain the interpolated signal; The time offset corresponding to the peak value in the interpolated signal is determined to obtain a first time offset, and the time offset corresponding to the peak value in the current cross-correlation signal is determined to obtain a second time offset; the peak value of any signal represents the maximum amplitude of the signal. The target duration is obtained by subtracting the first time offset from the second time offset.
3. The method according to claim 1, characterized in that, The step of interpolating the second backup signal to obtain a new second backup signal includes: Based on the target duration obtained from the current analysis, and according to the sampling frequency used when acquiring the second time-domain signal, the second backup signal is interpolated to obtain a new second backup signal.
4. The method according to claim 3, characterized in that, The step of interpolating the second backup signal based on the target duration obtained from the current analysis and according to the sampling frequency used when acquiring the second time-domain signal to obtain a new second backup signal includes: For each signal sampling point in the second backup signal, the time point obtained after performing the current analysis on the target duration corresponding to the time point of the signal sampling point is determined as the target time point corresponding to the signal sampling point, and the signal amplitude at the target time point corresponding to the signal sampling point is calculated based on the sampling frequency used when collecting the second time domain signal. Interpolation processing is performed on the signal composed of the target time point and signal amplitude corresponding to each signal sampling point to obtain a new second backup signal.
5. The method according to any one of claims 1-4, characterized in that, Based on the target duration obtained from the current analysis, the current time difference is corrected, including: Calculate the sum of the target duration obtained from the current analysis and the current time difference to obtain the corrected current time difference.
6. The method according to claim 4, characterized in that, The step of calculating the signal amplitude at the target time point corresponding to the sampling point of the signal based on the sampling frequency used when acquiring the second time-domain signal includes: The signal amplitude at the corresponding time point of the signal sampling point is calculated according to a predetermined amplitude calculation formula; wherein the predetermined amplitude calculation formula includes: ; in, Let be the signal amplitude at the target time point corresponding to the i-th signal sampling point. Let be the signal amplitude of the i-th signal sampling point in the second backup signal; t1 is the signal amplitude of the (i+1)th signal sampling point in the second backup signal, t2 is the target duration obtained from the current analysis, and T1 is the sampling frequency used when acquiring the second time domain signal.
7. The method according to claim 1, characterized in that, Before the step of interpolating the second backup signal to obtain a new second backup signal if the target duration obtained from the current analysis is greater than a predetermined allowable error value, and then returning to perform cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal, the method further includes: The frequency of the bandpass filter is determined based on the frequency of the ultrasonic flow meter's transmitted signal; wherein, the upper limit of the bandpass filter's frequency is the product of the ultrasonic flow meter's transmitted signal frequency and a first magnification, and the lower limit of the bandpass filter's frequency is the product of the ultrasonic flow meter's transmitted signal frequency and a second magnification, wherein the first magnification is greater than the second magnification. Based on the frequency of the bandpass filter, the new second backup signal is filtered to obtain a filtered second backup signal, and then the step of returning to perform cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal is executed.
8. A device for determining fluid velocity, characterized in that, Applied to ultrasonic flow meters; the device includes: An alignment processing module is used to align the first time-domain signal and the second time-domain signal to obtain a first backup signal and a second backup signal with the same corresponding start time point; wherein, the first time-domain signal and the second time-domain signal are acquired signals after the ultrasonic wave has propagated through different propagation directions of the target fluid; The cross-correlation processing module is used to perform cross-correlation processing on the first backup signal and the second backup signal to obtain the current cross-correlation signal; The analysis module is used to analyze the target duration based on the current cross-correlation signal; wherein, the target duration is used to characterize: the error between the time offset corresponding to the maximum cross-correlation degree in the current cross-correlation signal and the time offset corresponding to the maximum cross-correlation degree in the interpolated signal; the interpolated signal is the signal obtained by interpolating the current cross-correlation signal; The correction module is used to correct the current time difference based on the target duration obtained from the current analysis; wherein the initial value of the current time difference is the offset amount required for the alignment process. The interpolation module is used to interpolate the second backup signal to obtain a new second backup signal if the target duration obtained from the current analysis is greater than a predetermined allowable error value, and then return to the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal. The first determining module is used to determine the flow velocity of the target fluid by using the current time difference as the flight time difference of the ultrasonic wave when it propagates downstream and upstream in the target fluid.
9. An ultrasonic flow meter, characterized in that, include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.