Fluid velocity determination method and device, ultrasonic flowmeter and storage medium
By aligning and cross-correlation the signals of the ultrasonic flow meter, and combining interpolation techniques, the accuracy problem of fluid velocity measurement under limited signal sampling frequency was solved, and higher precision fluid velocity measurement was achieved.
Patent Information
- Application Number
- CN202511120856.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-08-11
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 with the same starting time is obtained. Cross-correlation processing is then performed to analyze the target duration to correct the time difference. If the target duration exceeds the allowable error value, interpolation is performed, and the time difference is iteratively corrected until sufficient accuracy is achieved.
This improves the accuracy of fluid velocity measurement when the signal sampling frequency is limited by hardware, ensures the accuracy of time-of-flight difference and fluid velocity, and enhances the measurement accuracy of the flow meter.
Smart Images

Figure CN120907622A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of flow measurement, in particular to a fluid velocity determination method and device, an ultrasonic flowmeter and a storage medium. BACKGROUND
[0002] The ultrasonic flowmeter has the advantages of non-contact (the ultrasonic flowmeter does not contact the fluid), no pressure loss, fast response speed, etc., and is widely used in the scenes of flow measurement of fluids such as water, gas and oil. The current ultrasonic flowmeter measures the flow velocity of the fluid by using the time difference method, and the measurement principle is to determine the flow velocity of the fluid according to the time difference of the ultrasonic wave propagating in the fluid in the forward and reverse directions. Therefore, the measurement accuracy of the time difference also determines the accuracy of the calculated flow velocity.
[0003] When calculating the time difference, the signals after the ultrasonic wave propagating in the fluid in the forward and reverse directions need to be aligned. However, the sampling frequency of the ultrasonic flowmeter is limited by hardware; then, if the sampling frequency of the ultrasonic flowmeter is low, the time interval of the signals collected according to the sampling frequency is also large, so that the alignment accuracy of the signals after the ultrasonic wave propagating in the fluid in the forward and reverse directions is also low, resulting in a large error in the calculated time difference, and finally the accuracy of the determined fluid velocity is low.
[0004] Therefore, for the ultrasonic flowmeter, how to improve the accuracy of the determined fluid velocity under the condition that the sampling frequency of the signal is limited by hardware. SUMMARY
[0005] The purpose of the embodiments of the present application is to provide a fluid velocity determination method and device, an ultrasonic flowmeter and a storage medium, to improve the accuracy of the determined fluid velocity under the condition that the sampling frequency of the signal is limited by hardware. The specific technical solutions are as follows:
[0006] In a first aspect, the embodiments of the present application provide a fluid velocity determination method applied to an ultrasonic flowmeter; the method comprises:
[0007] aligning the first time domain signal and the second time domain signal to obtain first and second backup signals with the same starting time point; wherein the first and second time domain signals are signals collected after the ultrasonic wave propagating in different directions of the target fluid;
[0008] correlating the first and second backup signals to obtain a current cross-correlation signal;
[0009] analyze a target time length based on the current cross-correlation signal, wherein the target time length is used to represent an error of a time offset corresponding to a maximum cross-correlation degree in the current cross-correlation signal;
[0010] correct the current time difference based on the target time length obtained through the current analysis, wherein an initial value of the current time difference is an offset of the time offset required by the alignment processing;
[0011] if the target time length obtained through the current analysis is greater than a predetermined allowable error value, interpolate the second backup signal 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; otherwise,
[0012] determine the flow velocity of the target fluid by taking the current time difference as a time-of-flight difference of the ultrasonic wave when propagating in the target fluid in a downstream direction and an upstream direction.
[0013] In a second aspect, an embodiment of the present application provides a device for determining a flow velocity, applied to an ultrasonic flowmeter; the device comprises:
[0014] an alignment processing module, configured to perform alignment processing on a first time-domain signal and a second time-domain signal to obtain a first backup signal and a second backup signal corresponding to the same starting time point; wherein the first time-domain signal and the second time-domain signal are signals obtained by collecting and after the ultrasonic wave propagates in different directions of a target fluid;
[0015] a cross-correlation processing module, configured to perform cross-correlation processing on the first backup signal and the second backup signal to obtain a current cross-correlation signal;
[0016] an analysis module, configured to analyze a target time length based on the current cross-correlation signal, wherein the target time length is used to represent an error of a time offset corresponding to a maximum cross-correlation degree in the current cross-correlation signal;
[0017] a correction module, configured to correct the current time difference based on the target time length obtained through the current analysis, wherein an initial value of the current time difference is an offset of the time offset required by the alignment processing;
[0018] an interpolation module, configured to, if the target time length obtained through the current analysis is greater than a predetermined allowable error value, interpolate the second backup signal 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;
[0019] The first determining module is configured to determine the flow velocity of the target fluid by taking the current time difference as the time difference of the ultrasonic wave in the target fluid in the downstream propagation and the upstream propagation.
[0020] In a third aspect, the embodiments of the present application provide an ultrasonic flowmeter, comprising:
[0021] The memory is configured to store the computer program.
[0022] The processor is configured to execute the program stored in the memory, and implement any of the above fluid velocity determination methods.
[0023] In a fourth aspect, the embodiments of the present application provide a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement any of the above fluid velocity determination methods.
[0024] The embodiments of the present application have the following beneficial effects:
[0025] The method for determining fluid velocity provided by the embodiments of the present application can perform alignment processing on the first time domain signal and the second time domain signal to align the starting time points of the first time domain signal and the second time domain signal, and obtain the first backup signal and the second backup signal, so as to realize preliminary alignment of the signals after the ultrasonic waves propagate in different directions of the target fluid. In addition, the method can perform cross-correlation processing on the first backup signal and the second backup signal to obtain the current cross-correlation signal, which can represent the cross-correlation degree between the first backup signal and the second backup signal under different time offsets. Based on the current cross-correlation signal, the error of the time offset corresponding to the maximum cross-correlation degree in the current cross-correlation signal, that is, the target time length, can be analyzed, and the current time difference can be corrected based on the target time length obtained by the current analysis to improve the accuracy of the current time difference. If the target time length obtained by the current analysis is greater than the predetermined allowable error value, it can be considered that the accuracy of the target time length (that is, the alignment accuracy between the first backup signal and the second backup signal) is insufficient, and accordingly, 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 step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain the cross-correlation signal is returned, so as to realize iterative correction of the current time difference. Until the target time length obtained by the current analysis is not 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 is corrected based on the target time length obtained by the current analysis, the current time difference can be taken as the time of flight difference of the ultrasonic waves when the ultrasonic waves propagate in the target fluid in the downstream direction and the upstream direction. Then, compared with the prior art, in the case that the sampling frequency of the signal is limited by hardware, the current time difference between the two time domain signals can be iteratively corrected by the present application to improve the accuracy of the current time difference, so that the determined time of flight difference 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, thereby improving the accuracy of the determined fluid velocity in the case that the sampling frequency of the signal is limited by hardware.
[0026] Of course, implementing any product or method of the present application does not necessarily require all the advantages described above to be achieved at the same time. BRIEF DESCRIPTION OF DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other embodiments can also be obtained by those skilled in the art based on these drawings.
[0028] Figure 1A working principle schematic diagram of an ultrasonic flowmeter provided by an embodiment of the present application is provided.
[0029] Figure 2 A flowchart of a fluid velocity determination method provided by an embodiment of the present application is provided.
[0030] FIG. 3(a) is a schematic diagram of a first time domain signal and a second time domain signal provided by an embodiment of the present application.
[0031] FIG. 3(b) is a schematic diagram of the first time domain signal and the second time domain signal provided by an embodiment of the present application being aligned.
[0032] FIG. 3(c) is a schematic diagram of the precision alignment of the two standby signals provided by an embodiment of the present application.
[0033] FIG. 4(a) is a schematic diagram of a current cross-correlation signal provided by an embodiment of the present application.
[0034] FIG. 4(b) is a schematic diagram of an interpolated signal provided by an embodiment of the present application.
[0035] Figure 5 A flowchart of another fluid velocity determination method provided by an embodiment of the present application is provided.
[0036] Figure 6 A structural schematic diagram of a fluid velocity determination apparatus provided by an embodiment of the present application is provided.
[0037] Figure 7 A structural schematic diagram of an ultrasonic flowmeter provided by an embodiment of the present application is provided. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art based on the present application belong to the scope of protection of the present application.
[0039] First, some professional terms in the embodiments of the present application are introduced:
[0040] Time of flight of the ultrasonic flowmeter: can be referred to as TOF, Time of Flight, used to measure the flow rate of the fluid. The propagation speed of the ultrasonic wave in the fluid is affected by the fluid, and the propagation speed of the ultrasonic wave in the fluid is accelerated in the downstream flow and slowed down in the upstream flow.
[0041] Time difference method: also known as time difference method, by measuring the time difference of the ultrasonic wave propagating in the fluid, the flow rate of the fluid is calculated.
[0042] Ultrasonic flowmeter: with non-contact, no pressure loss, fast response speed, etc., widely used in water, gas, oil and other fluid flow rate / flow measurement.
[0043] Zero-crossing comparison method: also known as Zero-crossing comparison method, is a technology that measures the phase difference by detecting the time or voltage difference of the signal zero crossing. Its core principle is to compare the zero crossing difference of two sinusoidal waves of the same frequency, calculate the phase difference or time difference.
[0044] Cross-correlation method: a method for analyzing the similarity and time delay between two signals, widely used in signal processing, fault location and other fields.
[0045] Time resolution: refers to the time interval between two adjacent observations / detections of the same research object (such as a certain area, object) by a sensor or observation system.
[0046] Flow resolution: refers to the degree of precision that can be achieved when observing, analyzing or controlling flow.
[0047] Secondly, the working principle of the ultrasonic flowmeter will be introduced below, for example, as shown in the following figure: Figure 1
[0048] The ultrasonic flowmeter can include ultrasonic transducer 110 and ultrasonic transducer 120, ultrasonic transducer 110 is located below the pipeline, ultrasonic transducer 120 is located above the pipeline, the diameter of the pipeline is D, and v represents the direction of the fluid flowing in the pipeline; Then, ultrasonic transducer 110 can first act as a transmitter, and ultrasonic transducer 120 can first act as a receiver to realize forward propagation of ultrasonic waves, and then ultrasonic transducer 110 can act as a receiver and ultrasonic transducer 120 can act as a transmitter to realize reverse propagation of ultrasonic waves; Then, based on the time of flight between the forward propagation and the reverse propagation of the ultrasonic waves, the fluid velocity (also known as flow rate or speed) of the fluid in the pipeline is calculated.
[0049] In order to better understand the present scheme, the determination method of fluid velocity in the related art is introduced:
[0050] In the related art, a common method for determining fluid velocity can be: first calculating a time of flight difference, and then determining the velocity of the fluid based on the calculated time of flight difference; specifically, the time of flight difference can be calculated using a zero-crossing comparison method and a cross-correlation method, but the sampling frequency of the signal of the ultrasonic flowmeter is limited by hardware, and generally the sampling frequency of the ultrasonic flowmeter is less than 100MHz, and the time interval (time resolution) of the signal collected according to the sampling frequency is greater than 10000ps (picoseconds), and for measuring the flow rate of a small-diameter fluid, the time resolution corresponding to the flow resolution often needs to reach tens of picoseconds, or even a few picoseconds, therefore, interpolation of the signal is required to improve the accuracy of the signal; the interpolation methods currently used in the field of ultrasonic waves mainly include nonlinear interpolation, cosine interpolation and other methods, but the sampling frequency of the signal of the ultrasonic flowmeter is limited by hardware, and in actual use, only information of a few signals can be used, and about 10000 points need to be interpolated between two adjacent signal sampling points in the signal, thereby causing a large error of the interpolated signal, a large error of the calculated time of flight difference, and further a large error of the determined fluid velocity.
[0051] And the following introduces the derivation principle of the time of flight difference for calculating the velocity of the fluid in combination with the contents of Figure 1
[0052] The time of flight of the sound wave (denoted as an uplink signal) from the ultrasonic transducer 110 to the ultrasonic transducer 120 is: Then
[0053] The time of flight of the sound wave (denoted as a downlink signal) from the ultrasonic transducer 120 to the ultrasonic transducer 110 is: Then
[0054] Wherein, t 12 is the time of flight of the ultrasonic wave emitted by the ultrasonic transducer 110 to the ultrasonic transducer 120, t 21 is the time of flight of the ultrasonic wave emitted by the ultrasonic transducer 120 to the ultrasonic transducer 110, L is the length of the ultrasonic wave transmission path (not shown in Figure 1 ), c is the speed of sound propagation in the fluid, v is the flow rate of the fluid, is the included angle between the ultrasonic wave transmission path and the pipeline (not shown in Figure 1 ).
[0055] Wherein, The time of flight difference ΔT = t 21 -t 12 ; wherein D is the diameter of the pipeline;
[0056] However, 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 time length obtained by 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 step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal is returned; otherwise,
[0068] The current time difference is taken as the time-of-flight difference of the ultrasonic wave in the target fluid in the downstream propagation and the upstream propagation, and the flow rate of the target fluid is determined.
[0069] The method for determining the flow rate of the fluid provided by the embodiments of the present application can perform alignment processing on the first time domain signal and the second time domain signal to align the starting time points of the first time domain signal and the second time domain signal, to obtain the first backup signal and the second backup signal, thereby realizing preliminary alignment of the signals propagated in different propagation directions of the ultrasonic wave through the target fluid; and performing cross-correlation processing on the first backup signal and the second backup signal to obtain the current cross-correlation signal, which can represent the cross-correlation degree between the first backup signal and the second backup signal under different time offsets. Based on the current cross-correlation signal, the error of the time offset corresponding to the maximum cross-correlation degree in the current cross-correlation signal, that is, the target time length, can be analyzed. Based on the target time length obtained by the current analysis, the current time difference can be corrected to improve the accuracy of the current time difference. If the target time length obtained by the current analysis is greater than the predetermined allowable error value, it can be considered that the accuracy of the target time length (that is, the alignment accuracy between the first backup signal and the second backup signal) is still insufficient, and accordingly, the accuracy of the current time difference is also insufficient, so the second backup signal can be interpolated to obtain a new backup signal, and the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal is returned, thereby realizing iterative correction of the current time difference. Until the target time length obtained by the current analysis is not 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 time length obtained by the current analysis, the current time difference can be taken as the time-of-flight difference of the ultrasonic wave in the target fluid in the downstream propagation and the upstream propagation. Then, compared with the prior art, in the case that the sampling frequency of the signal is limited by hardware, the current time difference between the two time domain signals can be iteratively corrected by the present application to improve the accuracy of the current time difference, so that the determined time-of-flight difference is also more accurate, and the flow rate of the target fluid determined based on the more accurate time-of-flight difference is also more accurate, thereby improving the accuracy of the determined flow rate of the fluid in the case that the sampling frequency of the signal is limited by hardware.
[0070] A method for determining the flow rate of a fluid provided by the embodiments of the present application will be described below with reference to the accompanying drawings.
[0071] As Figure 2 shown in the following embodiments of the present application, a method for determining fluid velocity is provided, which is applied to an ultrasonic flowmeter; the method comprises:
[0072] S201, aligning the first time domain signal and the second time domain signal to obtain the first standby signal and the second standby signal corresponding to the same starting time point;
[0073] The first time domain signal and the second time domain signal are signals collected by the ultrasonic flowmeter, which are propagated in different directions of the target fluid.
[0074] It can be understood that the first time domain signal can be a signal collected by the ultrasonic flowmeter, which is propagated in the target fluid in the same direction, or a signal propagated in the target fluid in the opposite direction, and the second time domain signal is a time domain signal opposite to the propagation direction of the first time domain signal, which is not limited in the embodiments of the present application; for example, the first time domain signal is a signal propagated in the natural gas in the same direction, and the second time domain signal can be a signal propagated in the natural gas in the opposite direction. The first time domain signal and the second time domain signal can be aligned, and then the starting time point of the second time domain signal can be used as the reference point to offset the first time domain signal, or the starting time point of the first time domain signal can be used as the reference point to offset the second time domain signal, so that the starting time points of the two signals are aligned to obtain the first standby signal and the second standby signal. It should be emphasized that since the collection frequency of the ultrasonic flowmeter is fixed, the starting time points of the first time domain signal and the second time domain signal can be aligned to obtain the first standby signal and the second standby signal, and the time points of other sampling points in the first standby signal and the second standby signal are aligned, but the signal amplitudes of the first standby signal and the second standby signal corresponding to the same time point can be different, so after obtaining the first standby signal and the second standby signal, the phase of the second standby signal needs to be adjusted (i.e. fine adjustment) to completely align the two signals. For example, if the first standby signal and the second standby signal are graphed and placed in a coordinate system, the horizontal coordinates of each sampling point in the first standby signal and the horizontal coordinates of each sampling point in the second standby signal are aligned, which is not limited in the embodiments of the present application. In addition, under normal circumstances, the starting time point of the signal propagated in the target fluid in the same direction can be used as the reference point, and the starting time point of the signal propagated in the target fluid in the opposite direction can be aligned with the reference point to obtain the first standby signal and the second standby signal, which is not limited in the embodiments of the present application.
[0075] In order to better understand the alignment process of the first time domain signal and the second time domain signal, the following will be introduced in combination with the drawings, as shown in FIG. 3(a) and FIG. 3(b):
[0076] The time-domain signal 310 in FIG. 3(a) is a signal collected by the ultrasonic flowmeter and propagating in the target fluid in the forward direction, and the time-domain signal 320 is a signal collected by the ultrasonic flowmeter and propagating in the target fluid in the reverse direction. The time-domain signal 310 and the time-domain signal 320 can be graphed, i.e., placed in a coordinate system, where the abscissa represents time, the range of time represented by the abscissa is [0, 18], the ordinate represents signal amplitude, the range of signal amplitude represented by the ordinate is [-1.5, 1.5], the starting time point of the time-domain signal 310 is 1, the ending time point is 7 (the time represented by the abscissa of the last time point in the time-domain signal 310), the range of signal amplitude is [-1, 1], and the time-domain signal 310 can be composed of 7 signal sampling points collected by the ultrasonic flowmeter and propagating in the target fluid in the forward direction, all of which are represented as squares. The starting time point of the time-domain signal 320 is 10, the ending time point is 16 (the time represented by the abscissa of the last time point in the time-domain signal 320), the range of signal amplitude is [-1, 1], and the time-domain signal 320 can be composed of 7 signal sampling points collected by the ultrasonic flowmeter and propagating in the target fluid in the reverse direction, all of which are represented as circles. In addition, it is emphasized that, in order to facilitate comparison of the two time-domain signals, the two time-domain signals are represented by the coordinate system shown in FIG. 3(a). For any time-domain signal, the time represented by the origin in FIG. 3(a) can be understood as the starting emission time of the ultrasonic signal to which the time-domain signal belongs, and the time difference between the collection time corresponding to any sampling point of the time-domain signal and the time represented by the origin, i.e., the time difference between the collection time corresponding to any sampling point of the time-domain signal and the starting emission time of the ultrasonic signal to which the time-domain signal belongs, is the time difference. In this way, the difference between the time offset of the starting time point of the time-domain signal 320 to 0 and the time offset of the starting time point of the time-domain signal 310 to 0 can be considered as the time difference of the ultrasonic wave propagating in the target fluid in the forward direction and in the reverse direction.
[0077] FIG. 3(b) is a schematic diagram of aligning the time-domain signal 310 with the time-domain signal 320. The horizontal coordinate of the coordinate system represents time, and the range of the time represented by the horizontal coordinate is [0, 18]. The vertical coordinate represents the signal amplitude, and the range of the signal amplitude represented by the vertical coordinate is [-1.5, 1.5]. The starting time point of the time-domain signal 320 is aligned with the starting time point of the time-domain signal 310, the horizontal coordinates of the sampling points in 310 are aligned with the horizontal coordinates of the sampling points in 320, and the process can also be referred to as coarse alignment or preliminary alignment. In FIG. 3(b), the range of the horizontal coordinates of the two time-domain signals is [1, 7], and the range of the vertical coordinates is [-1, 1]. For example, the horizontal coordinates of the sampling points in the first and second backup signals are [1, 7], the vertical coordinate of the sampling point of the first backup signal at the horizontal coordinate 1 is 0, the vertical coordinate of the sampling point of the second backup signal at the horizontal coordinate 1 is 0.198669, the vertical coordinate of the sampling point of the first backup signal at the horizontal coordinate 2 is 0.84147, the vertical coordinate of the sampling point of the second backup signal at the horizontal coordinate 2 is 0.932039, the vertical coordinate of the sampling point of the first backup signal at the horizontal coordinate 3 is 0.90929, and the vertical coordinate of the sampling point of the second backup signal at the horizontal coordinate 3 is 0.808496. Therefore, the first backup signal and the second backup signal with the same horizontal coordinate have different vertical coordinates.
[0078] S202, performing cross-correlation processing on the first backup signal and the second backup signal to obtain a current cross-correlation signal.
[0079] It can be understood that after obtaining the first backup signal and the second backup signal, the first backup signal and the second backup signal can be subjected to cross-correlation processing to obtain a cross-correlation signal, and the obtained cross-correlation signal can reflect the correlation degree (cross-correlation degree) between the first backup signal and the second backup signal. In addition, the cross-correlation signal can be graphed, that is, placed in a coordinate system, the horizontal coordinate of the coordinate system represents the time offset, and the vertical coordinate represents the signal amplitude (which can also be referred to as the amplitude). The vertical coordinate of each point in the cross-correlation signal is: the correlation degree between the first backup signal and the second backup signal after the second backup signal is offset by the time offset represented by the horizontal coordinate of the point. Therefore, the higher the value represented by the vertical coordinate, the higher the correlation degree between the first backup signal and the second backup signal at the time offset, which is not limited in the embodiments of the present application.
[0080] In order to better understand the content of the cross-correlation processing, the following introduces the cross-correlation processing in combination with the formula:
[0081]
[0082] wherein, S 1-1 [i] is the signal amplitude of the i-th signal sampling point in the first backup signal, m is the time offset, S 2-1 [i-m] is the signal amplitude of the (i-m)-th signal sampling point in the second backup signal, C1[m] is the signal amplitude of the cross-correlation signal at the time offset m.
[0083] Of course, the above-mentioned cross-correlation processing process is only exemplary, and other ways can also be used to implement cross-correlation processing of the first backup signal and the second backup signal, and the embodiments of the present application do not make specific limitations.
[0084] S203, based on the current cross-correlation signal, analyzing the target duration;
[0085] wherein, the target duration is used to represent: the error of the time offset corresponding to the maximum cross-correlation degree in the current cross-correlation signal;
[0086] It can be understood that according to the current cross-correlation signal, the error of the time offset corresponding to the maximum cross-correlation degree in the current cross-correlation signal can be analyzed; for example, the current cross-correlation signal can be subjected to interpolation processing to combine the cross-correlation signal after interpolation processing with the current cross-correlation signal to analyze the target duration; the embodiments of the present application do not make specific limitations.
[0087] In order to clearly layout, the process of analyzing the target duration will be introduced in other embodiments, and will not be described in detail here.
[0088] S204, based on the target duration obtained by the current analysis, correcting the current time difference;
[0089] wherein, the initial value of the current time difference is the offset of the time offset required for alignment processing;
[0090] It can be understood that if the current time difference that has been corrected does not exist currently, the offset amount required for time offset of the alignment processing is determined as an initial value of the current time difference; if the current time difference that has been corrected exists currently, 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 periods moved when the first time domain signal and the second time domain signal are aligned, T1 is the sampling interval of the first time domain signal or the sampling interval of the second time domain signal, and the sampling interval of the first time domain signal and the sampling interval of the second time domain signal are the same. It should be emphasized that in an implementation, after the current time difference is corrected, it can be detected whether the target duration obtained by the current analysis is greater than a predetermined allowable error value, if the target duration obtained by the current analysis is greater than the predetermined allowable error value, step S205 is performed, otherwise, step S206 is performed, and the embodiments of the present application do not make specific limitations.
[0091] In an implementation, the current time difference is corrected based on the target duration obtained by the current analysis, including step A1:
[0092] Step A1, the sum of the target duration obtained by the current analysis and the current time difference is calculated to obtain the corrected current time difference.
[0093] It can be understood that the target duration obtained by the current analysis can be positive or negative, and the embodiments of the present application do not make specific limitations; then, the sum of the target duration obtained by the current analysis and the current time difference can be calculated to correct the current time difference to obtain the corrected current time difference. For example, the current time difference is 5 milliseconds 10 picoseconds, the target duration is 20 picoseconds, then the corrected current time difference can be calculated as 5 milliseconds 30 picoseconds; the current time difference is 10 milliseconds 20 picoseconds, the target duration is -10 picoseconds, and the corrected current time difference can be calculated as 10 milliseconds 10 picoseconds.
[0094] It can be seen that when the current time difference is corrected, the sum of the target duration obtained by the current analysis and the current time difference can be calculated to obtain the corrected current time difference, thereby providing an implementation basis for subsequent calculation of the time difference between the forward propagation and the reverse propagation of the ultrasonic wave in the target fluid.
[0095] S205, if the target duration obtained by the current analysis is greater than a predetermined allowable error value, the second backup signal is interpolated to obtain a new second backup signal;
[0096] It can be understood that the case corresponding to step S205 is that the target time length obtained by the current analysis is 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 insufficient, that is, the alignment accuracy between the first backup signal and the second backup signal is insufficient, and the second backup signal can be interpolated, and the signal obtained after interpolation is taken as a new second backup signal; and 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 a cross-correlation signal can be returned to, so as to realize iterative correction of the current time difference, that is, returning to step S202.
[0097] In order to clearly layout, the process of interpolating the second backup signal to obtain the new second backup signal will be introduced in other embodiments, and will not be described in detail here.
[0098] S206, if the target time length obtained by the current analysis is not greater than the predetermined allowable error value, taking the current time difference as the flight time difference of the ultrasonic wave when propagating in the target fluid in the downstream and the upstream, determining the flow rate of the target fluid.
[0099] It can be understood that the case corresponding to step S206 is that the target time length obtained by 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 time length obtained by the current analysis; then, the current time difference can be taken as the flight time difference of the ultrasonic wave when propagating in the target fluid in the downstream and the upstream, so as to determine the flow rate of the target fluid.
[0100] In order to better understand that the alignment accuracy between the first backup signal and the second backup signal is sufficient, the following will be introduced in combination with the drawings, as shown in FIG. 3(c):
[0101] The alignment accuracy between the first backup signal and the second backup signal in FIG. 3(c) is sufficient, the horizontal coordinate of the coordinate system where the two backup signals are located represents time, the range of the time represented by the horizontal coordinate is [0, 18], the vertical coordinate represents signal amplitude, and the range of the signal amplitude represented by the vertical coordinate is [-1.5, 1.5]. After multiple iterations on the second backup signal, the target time length obtained by the current analysis is not greater than the predetermined allowable error value, so that the two backup signals with sufficient alignment accuracy are obtained, the range of the horizontal coordinate of the two backup signals is [1, 7], and the range of the vertical coordinate is [-1, 1].
[0102] Exemplarily, after determining the flight time difference of the ultrasonic wave when propagating in the target fluid in the downstream and the upstream, the flight time difference can be substituted into the calculation formula of the flow rate of the target fluid, so as to determine the flow rate of the target fluid.
[0103] The calculation formula of the flow rate of the target fluid is:
[0104]
[0105] Wherein, v is the flow rate of the target fluid, c is the sound propagation speed in the fluid, ΔT is the time difference of the ultrasonic wave in the target fluid when the ultrasonic wave propagates in the same direction and in the opposite direction, D is the diameter of the pipeline, is the included angle between the ultrasonic wave transmission path and the pipeline.
[0106] Of course, the above is only an exemplary introduction, and other calculation methods can also be used to determine the flow rate of the target fluid, and the embodiments of the application do not make specific limitations.
[0107] The method for determining fluid velocity provided by the embodiments of the present application can perform alignment processing on the first time domain signal and the second time domain signal to align the starting time points of the first time domain signal and the second time domain signal, to obtain a first backup signal and a second backup signal, thereby realizing preliminary alignment of the signals after the ultrasonic waves propagate in different directions of the target fluid; and performing cross-correlation processing on the first backup signal and the second backup signal to obtain a current cross-correlation signal, which can represent the cross-correlation degree between the first backup signal and the second backup signal under different time offsets; based on the current cross-correlation signal, the error of the time offset corresponding to the maximum cross-correlation degree in the current cross-correlation signal, that is, the target time length, can be analyzed, and based on the target time length obtained by the current analysis, the current time difference can be corrected to improve the accuracy of the current time difference; if the target time length obtained by the current analysis is greater than a predetermined allowable error value, it can be considered that the accuracy of the target time length (that is, the alignment accuracy between the first backup signal and the second backup signal) is insufficient, and accordingly, the accuracy of the current time difference is also insufficient, so the second backup signal can be interpolated to obtain a new backup signal, and the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal is returned, thereby realizing iterative correction of the current time difference. Until the target time length obtained by the current analysis is not 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 time length obtained by the current analysis, the current time difference can be taken as the time of flight difference of the ultrasonic waves when propagating in the target fluid in the downstream direction and in the upstream direction; then, compared with the prior art, in the case that the sampling frequency of the signal is limited by hardware, the current time difference between the two time domain signals can be iteratively corrected by the present application to improve the accuracy of the current time difference, so that the determined time of flight difference 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, thereby improving the accuracy of the determined fluid velocity in the case that the sampling frequency of the signal is limited by hardware.
[0108] Optionally, in another embodiment, based on the current cross-correlation signal, the target time length is analyzed, including steps B1-B3:
[0109] Step B1, interpolating the current cross-correlation signal to obtain an interpolated signal;
[0110] Step B2, determining the time offset corresponding to the peak value in the interpolated signal to obtain a first time offset, and determining the time offset corresponding to the peak value in the current cross-correlation signal to obtain a second time offset; the peak value of any signal represents the maximum amplitude of the signal;
[0111] Step B3, the first time offset and the second time offset are subtracted to obtain the target time length.
[0112] It can be understood that, for step B1, due to the sampling frequency of the signal of the ultrasonic flowmeter being limited by hardware, the accuracy of the first backup signal and the second backup signal is low (the effective information is small), so that the accuracy of the current cross-correlation signal is also low, and therefore the current cross-correlation signal can be interpolated to obtain an interpolated signal, thereby improving the accuracy of the cross-correlation signal. Then, a plurality of interpolation methods can be used to interpolate the current cross-correlation signal, for example: nonlinear interpolation method, sinusoidal interpolation method, etc., which are not specifically limited by the embodiments of the present application. Exemplarily, the sinusoidal interpolation method can be used to interpolate the current cross-correlation signal, that is, wherein C1[m] is the signal amplitude of the cross-correlation signal at the time offset m, n is the time offset of interpolation, C 1-1 [n] is the signal amplitude of the interpolated signal at the time offset n. Of course, the above is only an exemplary introduction, and other interpolation methods can also be used to interpolate the current cross-correlation signal, which is not specifically limited by the embodiments of the present application.
[0113] It can be understood that, for step B2, the interpolated signal and the current cross-correlation signal can both be graphed, that is, placed in a coordinate system; the peak value in the interpolated signal can be considered as the maximum value represented by the ordinate in the interpolated signal, that is, the maximum amplitude of the signal, and the abscissa of the maximum amplitude can be considered as the time offset corresponding to the peak value in the interpolated signal, that is, the first time offset; then, based on the interpolated signal, it can be determined that the cross-correlation degree of the first backup signal and the second backup signal offset by the first time offset is maximum. And the peak value in the current cross-correlation signal can be considered as the maximum value represented by the ordinate in the current cross-correlation signal, that is, the maximum amplitude of the signal, and the abscissa of the maximum amplitude can be considered as the time offset corresponding to the peak value in the current cross-correlation signal, that is, the second time offset; then, based on the current cross-correlation signal, it can be determined that the cross-correlation degree of the first backup signal and the second backup signal offset by the second time offset is maximum, which is not specifically limited by the embodiments of the present application.
[0114] It can be understood that, for step B3, based on the first time offset and the second time offset determined in step B2, the two can be subtracted to determine the target time length. Exemplarily, the first time offset is 20 ms and the second time offset is 10 ms, and the target time length can be calculated as 10 ms.
[0115] In order to better understand the current cross-correlation signal and the interpolated signal, the following will be introduced in conjunction with the drawings, as shown in FIG. 4(a) and FIG. 4(b):
[0116] Figure 4(a) is a schematic diagram of the current cross-correlation signal, the horizontal coordinate is the time offset, the range is [-7, 7], the vertical coordinate is the signal amplitude, the range is [-2, 4], the signal amplitude of the peak 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 coordinate is the time offset, the range is [-7, 7], the vertical coordinate is the signal amplitude, the range is [-2, 4], and the peak in the interpolated signal is adjusted due to the higher accuracy of the interpolated signal, wherein the signal amplitude of the peak in the interpolated signal is 3.1, and the corresponding time offset is 0.4.
[0118] It can be seen that the embodiments of the present application can interpolate the current cross-correlation signal to obtain an interpolated signal, and determine the time offset corresponding to the peak in the interpolated signal and the time offset corresponding to the peak in the current cross-correlation signal. Based on the above two time offsets, the target time length can be determined. Subsequently, the current time difference can be corrected based on the target time length, and the size relationship between the target time length and the allowable error value is determined. When the target time length is greater than the predetermined allowable error value, it can be considered that the accuracy of the target time length is insufficient, and accordingly, the accuracy of the current time difference is also insufficient. The current time difference can be iteratively corrected, thereby improving the accuracy of the current time difference, so that the determined time of flight difference is more accurate, thereby 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, comprising step C1:
[0120] Step C1, according to the target time length obtained by the current analysis, and according to the sampling frequency used when collecting the second time domain signal, the second backup signal is interpolated to obtain a new second backup signal.
[0121] It can be understood that in the process of interpolating the second backup signal, the target time length obtained by the current analysis and the sampling frequency used when collecting the second time domain signal can be used, so that the signal obtained by interpolation can be used as a new second backup 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 sampling frequency of the second backup signal before interpolation is also the same. In the process of interpolation, the sampling frequency is not adjusted, and the embodiments of the present application do not make specific limitations.
[0122] It can be seen that, according to the target time length obtained by current analysis, the second backup signal is interpolated according to the sampling frequency used when collecting the second time domain signal to obtain a new second backup signal. The new second backup signal and the first backup signal can be subsequently cross-correlated to implement iteration, so that the current time difference can be iteratively corrected until the target time length obtained by current analysis is not greater than the 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 time length obtained by current analysis to improve the accuracy of the current time difference, so that the determined time of flight difference is more accurate, thereby improving the accuracy of the determined fluid velocity.
[0123] In an implementation manner, according to the target time length obtained by current analysis, the second backup signal is interpolated according to the sampling frequency used when collecting the second time domain signal to obtain a new second backup signal, including steps C11-C12:
[0124] In step C11, for each signal sampling point in the second backup signal, a time point obtained by offsetting the target time length obtained by current analysis at the time point corresponding to 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.
[0125] It can be understood that there can be multiple signal sampling points in the second backup signal. For each signal sampling point, a time point obtained by offsetting the target time length at the time point corresponding to the signal sampling point can be determined as the target time point corresponding to the signal sampling point, and the target time point can also be used as the horizontal coordinate of the signal sampling point in the coordinate system. For example, if the target time length is 5 ms and the time point corresponding to the signal sampling point 1 is 0, the target time point can be determined as 5 ms. Furthermore, the signal amplitude at the target time point corresponding to the signal sampling point can be calculated based on the sampling frequency used when collecting the second time domain signal, and the signal amplitude at the target time point corresponding to the signal sampling point can also be used as the vertical coordinate of the signal sampling point in the coordinate system. The embodiments of the present application do not make specific limitations on this. In addition, in an implementation manner, the phase of the signal sampling point can be offset by the target time length to obtain a new phase, which can be considered as the target time point corresponding to the signal sampling point. The phase can also be considered as a time point, and the embodiments of the present application do not make specific limitations on this.
[0126] And, there are various ways to calculate the signal amplitude at the target time point corresponding to the signal sampling point. An exemplary way to calculate the signal amplitude at the target time point corresponding to the signal sampling point is described below.
[0127] Exemplarily, in one way, 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, including:
[0128] According to a predetermined amplitude calculation formula, the signal amplitude at the time point corresponding to the signal sampling point is calculated; wherein the predetermined amplitude calculation formula includes:
[0129]
[0130] 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 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 time length analyzed at present, T1 is the sampling frequency used when collecting the second time domain signal.
[0131] And, It can be considered as a weight, It can be transformed into It can also be considered as a weight, and the embodiments of the present application do not make specific limitation thereon. Exemplarily, i=1, S3[1]=S2[1]×0.1+S2[2]×0.9.
[0132] It can be understood that the signal amplitude at the time point corresponding to the signal sampling point can be calculated according to a predetermined amplitude calculation formula; and the product of and the signal amplitude of the i-th signal sampling point in the second backup signal can be taken as the first signal amplitude, and the product of and the signal amplitude of the i+1-th signal sampling point in the second backup signal can be taken as the second signal amplitude, and the sum of the first signal amplitude and the second signal amplitude can be calculated to obtain the signal amplitude at the time point corresponding to the signal sampling point.
[0133] Of course, the above only exemplarily introduces one way to calculate the signal amplitude at the target time point corresponding to the signal sampling point, and other ways can also be used to calculate the signal amplitude, for example: the signal amplitude is calculated by means of a neural network model, and the embodiments of the present application do not make specific limitation thereon.
[0134] It can be seen that the embodiments of the present application can calculate the signal amplitude of the signal sampling point at the target time point according to the predetermined amplitude calculation formula, and provide an implementation basis for the interpolation processing of the second backup signal, so that the subsequent determined time of flight difference is more accurate, thereby improving the accuracy of the determined fluid velocity.
[0135] In step C12, the signal based on the target time point and the signal amplitude corresponding to each signal sampling point is interpolated to obtain a new second backup signal.
[0136] It can be understood that after calculating the signal amplitude of the target time point corresponding to each signal sampling point, the signal based on the target time point and the signal amplitude corresponding to each signal sampling point can be interpolated to obtain a new second backup signal. Subsequently, the new second backup signal and the first backup signal can be cross-correlated to implement the cycle processing. For example, for each signal sampling point, the target time point corresponding to the signal sampling point can be taken as the abscissa, and the signal amplitude corresponding to the signal sampling point can be taken as the ordinate, so as to determine the coordinates of the signal sampling point, and the new second backup signal can be constructed based on the coordinates of each signal sampling point.
[0137] It can be seen that the embodiments of the present application determine the target time point and the signal amplitude corresponding to each signal sampling point in the second backup signal, and then interpolate the signal based on the target time point and the signal amplitude corresponding to each signal sampling point to obtain a new second backup signal. Subsequently, the new second backup signal and the first backup signal can be cross-correlated to implement iteration, so that the current time difference can be iteratively corrected until the target time length obtained by the current analysis is not 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 time length obtained by the current analysis, thereby improving the accuracy of the current time difference. Subsequently, the current time difference is taken as the time of flight difference of the ultrasonic wave when propagating in the target fluid, so that the determined time of flight difference is more accurate, thereby improving the accuracy of the determined fluid velocity.
[0138] Optionally, in another embodiment, after the target time length obtained by 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 then the method further includes steps D1-D2 before the step of cross-correlating the first backup signal and the second backup signal to obtain a cross-correlation signal.
[0139] Step D1, determining the frequency of the band-pass filter based on the frequency of the ultrasonic flowmeter transmitting signal; wherein the upper limit of the frequency of the band-pass filter is the product of the frequency of the ultrasonic flowmeter transmitting signal and the first multiple, and the lower limit of the frequency of the band-pass filter is the product of the frequency of the ultrasonic flowmeter transmitting signal and the second multiple, and the first multiple is greater than the second multiple;
[0140] It can be understood that after the second backup signal is interpolated to obtain the new second backup signal, the frequency of the band-pass filter can be determined based on the frequency of the ultrasonic flowmeter transmitting signal first; then, the upper limit of the frequency of the band-pass filter can be the product of the frequency of the ultrasonic flowmeter transmitting signal and the first multiple, wherein the experience value of the first multiple can be 2, which is not limited in the embodiment of the application; and the lower limit of the frequency of the band-pass filter can be the product of the frequency of the ultrasonic flowmeter transmitting signal and the second multiple, wherein the experience value of the second multiple can be 0.3, which is not limited in the embodiment of the application; it should be emphasized that since the upper limit of the frequency of the band-pass filter is related to the first multiple, and the lower limit of the frequency of the band-pass filter is related to the second multiple, the first multiple can be greater than the second multiple, which is not limited in the embodiment of the application.
[0141] Step D2, filtering the new second backup signal based on the frequency of the band-pass filter to obtain the filtered second backup signal, and performing the step of returning to the cross-correlation processing of the first backup signal and the second backup signal to obtain the cross-correlation signal.
[0142] It can be understood that based on the frequency of the band-pass filter, the new second backup signal can be anti-aliasing filtered, so that the signal not located in the frequency of the band-pass filter is filtered out to obtain the filtered second backup signal, wherein the high-frequency noise signal in the filtered second backup signal has been filtered out, so that the filtered second backup signal is more accurate, and the subsequent step of returning to the cross-correlation processing of the first backup signal and the second backup signal to obtain the cross-correlation signal can be performed.
[0143] It can be seen that the embodiment of the application can filter the new second backup signal to filter out the high-frequency noise signal in the second backup signal for subsequent cross-correlation processing, so that the filtered second backup signal is more accurate, the time-of-flight difference determined subsequently 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, thereby improving the accuracy of the determined flow velocity under the condition that the sampling frequency of the signal is limited by hardware.
[0144] Optionally, in another embodiment, the embodiment of the application also provides another method for determining the flow velocity of a fluid, as shown in Figure 5 .
[0145] S501, pre-aligning the uplink signal S1 and the downlink signal S2 to obtain a signal S 1-1 2-1 and determining an alignment time difference t1;
[0146] Wherein, the uplink signal S1 can be considered as the first time domain signal in the above embodiment, the downlink signal S2 can be considered as the second time domain signal in the above embodiment, the pre-alignment of the signal can be considered as the alignment processing in the above embodiment, the signal S 1-1 is the first standby signal in the above embodiment, the signal S 2-1 is the second standby signal in the above embodiment, the signal S 1-1 and the signal S 2-1 correspond to the same starting time point.
[0147] S502, performing cross-correlation processing on the signal S 1-1 , the signal S 2-1 , and performing interpolation processing on the obtained current cross-correlation signal C1 to obtain an interpolated signal C 1-1 .
[0148] It can be understood that the signal S 1-1 , the signal S 2-1 can be cross-correlation processed to obtain the current cross-correlation processing C1, and the cross-correlation signal C1 can also be interpolated to obtain the interpolated signal C 1-1 , and the way of cross-correlation processing and interpolation processing has been introduced in the above embodiment, which will not be described in detail here.
[0149] S503, calculating the difference between the time offset corresponding to the peak value of the current cross-correlation signal C1 and the time offset corresponding to the peak value of the interpolated signal C 1-1 to obtain a target time length t2;
[0150] It can be understood that step S503 is similar to the process of steps B1-B3 described above, which will not be described in detail here.
[0151] S504, detecting whether the target time length t2 is greater than an allowable error value;
[0152] If yes, step S505 is executed, and if no, step S506 is executed;
[0153] S505, performing interpolation processing on the signal S 2-1 to obtain a new signal S 2-1 .
[0154] It can be understood that the new signal S 2-1 Band-pass anti-aliasing filtering can be further performed on the new signal S 2-1 to filter out high-frequency noise signals, and the subsequent step S502 can be returned to for iterative processing.
[0155] S506, calculating the sum of the alignment time difference t1 and the target time length t2 as the time-of-flight difference between the uplink signal S1 and the downlink signal S2, and determining the flow rate of the target fluid.
[0156] The method for determining the flow rate of the fluid provided by the embodiments of the present application can pre-align the uplink signal S1 and the downlink signal S2 to obtain the signal S 1-1 , the signal S 2-1 , so as to preliminarily align the signals after the ultrasonic waves propagate in different directions of the target fluid; and perform cross-correlation processing on the signal S 1-1 , the signal S 2-1 to obtain the current cross-correlation signal C1, which can represent the cross-correlation degree between the signal S 1-1 , the signal S 2-1 at different time offsets; performing interpolation processing on the obtained current cross-correlation signal C1 to obtain the interpolated signal C 1-1 , calculating the difference between the time offset corresponding to the peak value of the current cross-correlation signal C1 and the time offset corresponding to the peak value of the interpolated signal C 1-1 to obtain the target time length t2, and detecting whether the target time length t2 is greater than the allowable error value; if yes, it can be considered that the accuracy of the target time length is insufficient, and the signal S 2-1 can be interpolated to obtain a new signal S 2-1 , and the step of performing cross-correlation processing on the signal S 1-1 , the signal S 2-1 is returned until the target time length is not greater than the allowable error value, the sum of the alignment time difference t1 and the target time length t2 can be calculated as the time-of-flight difference between the uplink signal S1 and the downlink signal S2, and the flow rate of the target fluid can be determined; the time-of-flight difference determined by the present application is more accurate, and the flow rate of the target fluid determined based on the more accurate time-of-flight difference is also more accurate, thereby improving the accuracy of the determined flow rate of the fluid under the condition that the sampling frequency of the signal is limited by hardware.
[0157] Based on the above method embodiments, the embodiments of the present application also provide a device for determining the flow rate of a fluid, which is applied to an ultrasonic flowmeter; as shown in Figure 6 , the device comprises:
[0158] The alignment processing module 610 is configured to perform alignment processing on the first time domain signal and the second time domain signal to obtain first and second backup signals corresponding to the same starting time point; wherein the first and second time domain signals are signals collected after the ultrasonic wave propagates in different directions of the target fluid;
[0159] The cross-correlation processing module 620 is configured to perform cross-correlation processing on the first and second backup signals to obtain a current cross-correlation signal;
[0160] The analysis module 630 is configured to analyze a target time length based on the current cross-correlation signal; wherein the target time length is used to represent an error of a time offset corresponding to a maximum cross-correlation degree in the current cross-correlation signal;
[0161] The correction module 640 is configured to correct a current time difference based on the target time length obtained through the current analysis; wherein an initial value of the current time difference is an offset amount of the time offset required by the alignment processing;
[0162] The interpolation module 650 is configured to, if the target time length obtained through the current analysis is greater than a predetermined allowable error value, perform interpolation on the second backup signal to obtain a new second backup signal, and return to the step of performing cross-correlation processing on the first and second backup signals to obtain a cross-correlation signal;
[0163] The first determination module 660 is configured to determine a flow rate of the target fluid by taking the current time difference as a time-of-flight difference of the ultrasonic wave when the ultrasonic wave propagates in the target fluid in a forward direction and in a reverse direction.
[0164] Optionally, the analysis module is specifically configured to:
[0165] perform interpolation on the current cross-correlation signal to obtain an interpolated signal;
[0166] determine a time offset corresponding to a peak value in the interpolated signal to obtain a first time offset, and determine a time offset corresponding to a peak value in the current cross-correlation signal to obtain a second time offset; the peak value of any signal represents a maximum amplitude of the signal;
[0167] perform subtraction on the first time offset and the second time offset to obtain the target time length.
[0168] Optionally, the interpolation module includes:
[0169] The interpolation processing submodule is configured to perform interpolation processing on the second backup signal according to the target time length obtained through the current analysis and according to a sampling frequency used when the second time domain signal is collected to obtain a new second backup signal.
[0170] Optionally, the interpolation processing submodule comprises:
[0171] The calculation unit is configured to, for each signal sampling point in the second backup signal, determine a time point obtained after time offsetting a target time length obtained by current analysis of a time point corresponding to the signal sampling point, as a target time point corresponding to the signal sampling point, and calculate a signal amplitude at the target time point corresponding to the signal sampling point based on a sampling frequency used when the second time domain signal is collected.
[0172] The interpolation processing unit is configured to perform interpolation processing on a signal formed based on the target time point and the signal amplitude corresponding to each signal sampling point, to obtain a new second backup signal.
[0173] Optionally, the correction module is specifically configured to:
[0174] Calculate a sum of the target time length obtained by current analysis and the current time difference, to obtain a corrected current time difference.
[0175] Optionally, the calculation unit is specifically configured to:
[0176] Calculate the signal amplitude at the time point corresponding to the signal sampling point according to a predetermined amplitude calculation formula; wherein the predetermined amplitude calculation formula comprises:
[0177]
[0178] Wherein S3[i] is a signal amplitude at a target time point corresponding to an i-th signal sampling point, S2[i] is a signal amplitude of an i-th signal sampling point in the second backup signal, S2[i+1] is a signal amplitude of an i+1-th signal sampling point in the second backup signal, t2 is a target time length obtained by current analysis, and T1 is a sampling frequency used when the second time domain signal is collected.
[0179] Optionally, the apparatus further comprises:
[0180] The second determination module is configured to, if the target time length obtained by current analysis is greater than a predetermined allowable error value, determine a frequency of a band-pass filter based on a frequency of the ultrasonic flowmeter transmission signal, before returning to the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal, after interpolating the second backup signal to obtain a new second backup signal; wherein an upper limit of the frequency of the band-pass filter is a product of the frequency of the ultrasonic flowmeter transmission signal and a first multiplication rate, and a lower limit of the frequency of the band-pass filter is a product of the frequency of the ultrasonic flowmeter transmission signal and a second multiplication rate, and the first multiplication rate is greater than the second multiplication rate.
[0181] The filter processing module is configured to perform filter processing on the new second backup signal based on the frequency of the band-pass filter to obtain a second backup signal after filter processing, and perform the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain a cross-correlation signal.
[0182] In the technical solution of the present application, the operations of obtaining, storing, using, processing, transmitting, providing and disclosing of the user personal information are all performed under the authorization of the user.
[0183] The present application also provides an ultrasonic flowmeter, as shown in the accompanying drawings, comprising: Figure 7
[0184] The memory 701 is configured to store a computer program.
[0185] The processor 702 is configured to execute the program stored in the memory 701 to implement the method for determining the fluid velocity.
[0186] The ultrasonic flowmeter can further comprise a communication bus and / or a communication interface, and the processor 702, the communication interface and the memory 701 can communicate with each other through the communication bus.
[0187] The communication bus of the ultrasonic flowmeter can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is shown in the figure, but it does not mean that there is only one bus or only one type of bus.
[0188] The communication interface is configured to communicate between the ultrasonic flowmeter and other devices.
[0189] The memory can include a Random Access Memory (RAM) and a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.
[0190] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0191] In another embodiment provided in the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement any of the above fluid velocity determination methods.
[0192] In another embodiment provided in the present application, a computer program product is provided, and the computer program product contains instructions. When the computer program product is executed on a computer, the computer is caused to perform any of the above fluid velocity determination methods.
[0193] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented 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 the present 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 computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a solid state disk (SSD) and the like.
[0194] It is to be noted that, as used in this document, the terminology "first", "second", etc. is merely used to differentiate one entity or action from another, and does not necessarily imply any actual physical or logical relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0195] Each of the embodiments in the present specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the description of the method embodiments.
[0196] The above only describes the preferred embodiments of the present application, and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method of determining a fluid velocity, characterized by, The method is applied to an ultrasonic flowmeter, and comprises the following steps: aligning a first time domain signal and a second time domain signal to obtain a first backup signal and a second backup signal corresponding to the same starting time point, wherein the first time domain signal and the second time domain signal are signals collected after ultrasonic waves propagate in different directions through a target fluid; performing cross-correlation processing on the first backup signal and the second backup signal to obtain a current cross-correlation signal; analyzing a target time length based on the current cross-correlation signal, wherein the target time length is used to represent an error of a time offset corresponding to a maximum cross-correlation degree in the current cross-correlation signal; correcting a current time difference based on the target time length obtained through current analysis, wherein an initial value of the current time difference is an offset required for the alignment processing; if the target time length obtained through current analysis is greater than a predetermined allowable error value, performing interpolation on the second backup signal to obtain a new second backup signal, and returning 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, determining a flow rate of the target fluid by taking the current time difference as a time-of-flight difference of ultrasonic waves when the ultrasonic waves propagate in a forward direction and a reverse direction through the target fluid.
2. The method of claim 1, wherein, The analyzing of the target time length based on the current cross-correlation signal comprises: performing interpolation on the current cross-correlation signal to obtain an interpolated signal; determining a time offset corresponding to a peak value in the interpolated signal to obtain a first time offset, and determining a time offset corresponding to a peak value in the current cross-correlation signal to obtain a second time offset; the peak value of any signal represents a maximum amplitude of the signal; subtracting the first time offset from the second time offset to obtain the target time length.
3. The method of claim 1, wherein, The interpolation on the second backup signal to obtain a new second backup signal comprises: performing interpolation processing on the second backup signal according to the target time length obtained through current analysis and a sampling frequency used when the second time domain signal is collected to obtain the new second backup signal.
4. The method of claim 3, wherein, The interpolation on the second backup signal to obtain a new second backup signal according to the target time length obtained through current analysis and a sampling frequency used when the second time domain signal is collected comprises: for each signal sampling point in the second backup signal, determining a time point obtained after a time offset of the target time length obtained through current analysis at a time point corresponding to the signal sampling point as a target time point corresponding to the signal sampling point, and calculating a signal amplitude at the target time point corresponding to the signal sampling point based on the sampling frequency used when the second time domain signal is collected; performing interpolation processing on a signal formed based on the target time points and the signal amplitudes corresponding to the respective signal sampling points to obtain the new second backup signal.
5. The method according to any one of claims 1 to 4, characterized in that, The correction of the current time difference based on the target time length obtained through current analysis comprises: calculating a sum of the target time length obtained through current analysis and the current time difference to obtain a corrected current time difference.
6. The method of claim 4, wherein, The signal amplitude at the target time point corresponding to the signal sampling point is calculated based on a sampling frequency used when the second time domain signal is collected, and the signal amplitude at the target time point corresponding to the signal sampling point is calculated based on a predetermined amplitude calculation formula, wherein the predetermined amplitude calculation formula comprises: The signal amplitude at the target time point corresponding to the signal sampling point is calculated based on a sampling frequency used when the second time domain signal is collected, and the signal amplitude at the target time point corresponding to the signal sampling point is calculated based on a predetermined amplitude calculation formula, wherein the predetermined amplitude calculation formula comprises: 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 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 time length obtained by the current analysis, T1 is the sampling frequency used when the second time domain signal is collected.
7. The method of claim 1, wherein, The method further comprises: The frequency of the band-pass filter is determined based on the frequency of the ultrasonic flowmeter transmission signal; wherein the upper limit of the frequency of the band-pass filter is the product of the frequency of the ultrasonic flowmeter transmission signal and a first multiplier, and the lower limit of the frequency of the band-pass filter is the product of the frequency of the ultrasonic flowmeter transmission signal and a second multiplier, and the first multiplier is greater than the second multiplier; The new second backup signal is filtered based on the frequency of the band-pass filter to obtain a filtered second backup signal, and the step of returning to the cross-correlation processing of the first backup signal and the second backup signal to obtain the cross-correlation signal is executed.
8. A device for determining the velocity of a fluid, characterized in that The device is applied to an ultrasonic flowmeter; the device comprises: An alignment processing module is configured to perform alignment processing on a first time domain signal and a second time domain signal to obtain a first backup signal and a second backup signal corresponding to the same starting time point; wherein the first time domain signal and the second time domain signal are signals obtained by collecting signals propagated in different directions of a target fluid by ultrasonic waves; A cross-correlation processing module is configured to perform cross-correlation processing on the first backup signal and the second backup signal to obtain a current cross-correlation signal; An analysis module is configured to analyze a target time length based on the current cross-correlation signal; wherein the target time length is used to represent an error of a time offset corresponding to a maximum cross-correlation degree in the current cross-correlation signal; A correction module is configured to correct a current time difference based on the target time length obtained by the current analysis; wherein an initial value of the current time difference is an offset amount of a time offset required by the alignment processing; An interpolation module is configured to perform interpolation on the second backup signal to obtain a new second backup signal if the target time length obtained by the current analysis is greater than a predetermined allowable error value, and return to the step of performing cross-correlation processing on the first backup signal and the second backup signal to obtain the cross-correlation signal; A first determination module is configured to determine a flow rate of the target fluid by taking the current time difference as a time of flight difference of ultrasonic waves when the ultrasonic waves propagate in the target fluid in a forward direction and a reverse direction.
9. An ultrasonic flow meter characterized by, The device comprises: a memory for storing a computer program; a processor for implementing the method of any one of claims 1-7 when executing the program stored in the memory.
10. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and the computer program is executed by the processor to implement the method of any one of claims 1-7.
Citation Information
Patent Citations
Lightweight implementation method of cross-correlation algorithm in ultrasonic flow measurement
CN114254253A
Pulsating flow measuring method and device of ultrasonic flowmeter and storage medium
CN117824762A
Thin film thickness measuring method, device and equipment based on ultrasonic time domain signal
CN119124056A
Fluid metering method and device, computer equipment and storage medium
CN119147057A
Flow velocity determination method, device and equipment
CN119667195A