Method for determining flight time of ultrasonic flowmeter and related equipment
By determining the envelope array and integer wave period offset in the ultrasonic flowmeter and calculating the envelope difference array, the problem of time-of-flight calculation deviation is solved, the measurement accuracy and anti-interference ability are improved, and the application scenarios are expanded.
Patent Information
- Application Number
- CN202510847886.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-06-24
AI Technical Summary
Under the influence of external interference and flow field instability, existing ultrasonic flowmeters have deviations in the calculation of time of flight, which affects the accuracy of fluid flow measurement and leads to limited application scenarios.
By obtaining the up and downward echo signals of the ultrasonic flowmeter, determining the envelope array, identifying the characteristic waves and calculating the zero-crossing time, combining the preset interval length and the periodic offset of the integer wave, the envelope difference array is calculated to determine the flight time and reduce the impact of the wrong wave phenomenon.
It improves the measurement accuracy and anti-interference ability of time of flight, enhances the measurement accuracy and reliability of ultrasonic flowmeters, and expands its application scenarios.
Smart Images

Figure CN120352015A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of ultrasonic metering, and particularly to a method for determining the flight time of an ultrasonic flowmeter and related devices. Background Art
[0002] An ultrasonic flowmeter (such as an ultrasonic gas meter, an ultrasonic water meter, etc.) is a device that uses ultrasonic waves to measure fluids (gases, liquids). Due to its advantages of small size, light weight, no mechanical wear, long service life, high metering accuracy, etc., it has been widely used in the fields of industry, energy, environmental protection, etc. The metering principle of an ultrasonic flowmeter is to estimate the instantaneous flow rate by using the difference in the flight time of ultrasonic waves propagating in the downstream and upstream directions.
[0003] In related technologies, generally, the threshold method is used to identify the characteristic waves of ultrasonic signals, so as to calculate the flight time. Although the method is simple and the calculation speed is fast, due to the high dependence of the threshold method on the stability of the echo signal and the rationality of the threshold setting, its anti-interference ability is poor. In practical applications, due to factors such as external electromagnetic interference, transducer aging, unstable flow field, temperature change, etc., the waveform of the ultrasonic signal may be distorted, resulting in mis-wave phenomena easily occurring during the identification of characteristic waves, thus causing deviations in the calculation of the flight time, and further affecting the measurement accuracy of the fluid flow rate. Summary of the Invention
[0004] A method for determining the flight time of an ultrasonic flowmeter and related devices provided by an embodiment of the present disclosure at least solves the problem that the flight time calculation method in related technologies has deviations in the calculation of the flight time due to mis-wave phenomena, affects the measurement accuracy of the fluid flow rate, and results in a narrow application scenario of the ultrasonic flowmeter.
[0005] To solve the above problems, in one aspect of the embodiments of the present disclosure, a method for determining the flight time of an ultrasonic flowmeter is provided, including: obtaining the upstream and downstream echo signals of the ultrasonic flowmeter, and determining the upstream and downstream envelope arrays corresponding to the upstream and downstream echo signals; wherein, the envelope array includes the envelope lines between multiple consecutive local wave peak points; based on the upstream and downstream envelope arrays, determining the upstream and downstream characteristic waves, and the zero-crossing times of the upstream and downstream characteristic waves respectively; according to the preset interval length and the zero-crossing times of the upstream and downstream characteristic waves respectively, intercepting the first envelope interval array and the second envelope interval array from the upstream and downstream envelope arrays respectively; performing integer wave period time sequence advance offset and time sequence lag offset on the intercepted intervals of the second envelope interval array, and obtaining the pre-offset envelope interval array and the post-offset envelope interval array; calculating the envelope difference arrays between the first envelope interval array and the second envelope interval array, the pre-offset envelope interval array, and the post-offset envelope interval array respectively, and determining the flight time of the ultrasonic flowmeter according to the envelope difference arrays.
[0006] In some of these embodiments, the echo signal includes a plurality of sampling points. Determining the uplink and downlink envelope arrays corresponding to the uplink and downlink echo signals includes performing the following steps for the uplink echo signal and the downlink echo signal respectively: determining a plurality of local maxima in the echo signal, performing non-linear curve fitting on the plurality of local maxima to obtain the peaks of a plurality of consecutive local waves; performing interpolation processing on the peaks of adjacent local waves, and segmentally generating envelope lines between the peaks of adjacent local waves to obtain the envelope array.
[0007] In some of these embodiments, based on the uplink and downlink envelope arrays, determining the uplink and downlink characteristic waves and the zero-crossing times of the uplink and downlink characteristic waves respectively includes: determining the uplink and downlink maximum envelope values corresponding to the uplink and downlink echo signals according to the uplink and downlink envelope arrays; identifying the uplink and downlink characteristic waves from the uplink and downlink echo signals according to the preset uplink and downlink maximum envelope value ratios and the uplink and downlink maximum envelope values; respectively determining the zero-crossing times of the uplink and downlink characteristic waves.
[0008] In some of these embodiments, according to the preset interval length and the zero-crossing times of the uplink and downlink characteristic waves respectively, intercepting the first envelope interval array and the second envelope interval array from the uplink and downlink envelope arrays respectively includes: taking the zero-crossing times of the uplink and downlink characteristic waves as the starting points, taking a plurality of time sequence points within the preset interval length as the intercepting objects, intercepting the uplink envelope interval array from the uplink envelope array, and intercepting the downlink envelope interval array from the downlink envelope array; determining either the uplink envelope interval array or the downlink envelope interval array as the first envelope interval array, and determining the remaining one as the second envelope interval array.
[0009] In some of these embodiments, calculating the envelope difference arrays between the first envelope interval array and the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array respectively includes: normalizing the first envelope interval array based on the maximum envelope value of the echo signal corresponding to the first envelope interval array to obtain the first envelope ratio array; normalizing the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array respectively based on the maximum envelope value of the echo signal corresponding to the second envelope interval array to obtain the second envelope ratio array, the front envelope ratio array, and the rear envelope ratio array; calculating the envelope difference arrays between the first envelope ratio array and the second envelope ratio array, the front envelope ratio array, and the rear envelope ratio array respectively.
[0010] In some of these embodiments, determining the flight time of the ultrasonic flowmeter based on the envelope difference array includes: respectively determining the maximum difference and / or the accumulated difference value in each envelope difference array, and based on multiple maximum differences and / or accumulated difference values, determining one of the second envelope interval array, the front-offset envelope interval array, and the rear-offset envelope interval array as the target envelope interval array; based on the target envelope interval array and the upstream and downstream characteristic waves, determining the target upstream and downstream characteristic waves; and determining the flight time of the ultrasonic flowmeter according to the zero-crossing times of the target upstream and downstream characteristic waves.
[0011] In some of these embodiments, based on multiple maximum differences and / or accumulated difference values, determining one of the second envelope interval array, the front-offset envelope interval array, and the rear-offset envelope interval array as the target envelope interval array includes: determining the envelope difference array to which the smallest value among the multiple maximum differences belongs as the target envelope difference array, and determining the target envelope interval array based on the target envelope difference array; or determining the envelope difference array to which the smallest value among the multiple accumulated difference values belongs as the target envelope difference array, and determining the target envelope interval array based on the target envelope difference array; or based on the maximum difference threshold interval, determining the target maximum difference among the multiple maximum differences, and determining the target envelope interval array based on the target maximum difference; or based on the accumulated difference value threshold interval, determining the target accumulated difference value among the multiple accumulated difference values, and determining the target envelope interval array based on the target accumulated difference value.
[0012] One aspect of the embodiments of the present disclosure provides a device for determining the flight time of an ultrasonic flowmeter, including: a signal acquisition module configured to acquire the upstream and downstream echo signals of the ultrasonic flowmeter and determine the upstream and downstream envelope arrays corresponding to the upstream and downstream echo signals; wherein, the envelope array includes the envelope lines between multiple consecutive local wave peak points; a characteristic wave identification module configured to determine the upstream and downstream characteristic waves and the zero-crossing times of the upstream and downstream characteristic waves respectively based on the upstream and downstream envelope arrays; a first truncation module configured to respectively truncate the first envelope interval array and the second envelope interval array from the upstream and downstream envelope arrays according to the preset interval length and the zero-crossing times of the upstream and downstream characteristic waves respectively; a second truncation module configured to perform a time sequence advance offset and a time sequence delay offset of an integer wave period on the truncation interval of the second envelope interval array, and truncate to obtain the front-offset envelope interval array and the rear-offset envelope interval array; and a determination module configured to calculate the envelope difference arrays between the first envelope interval array and the second envelope interval array, the front-offset envelope interval array, and the rear-offset envelope interval array respectively, and determine the flight time of the ultrasonic flowmeter according to the envelope difference arrays.
[0013] In one aspect of the embodiments of the present disclosure, an electronic device is provided, including: a processor, and a memory storing a program, where the program includes instructions that, when executed by the processor, cause the processor to execute any one of the methods for determining the flight time of an acoustic flowmeter.
[0014] In one aspect of the embodiments of the present disclosure, a non-transitory machine-readable medium storing computer instructions is provided, where the computer instructions are used to cause a computer to execute any one of the methods for determining the flight time of an acoustic flowmeter.
[0015] In the method of the present disclosure, by determining the up and down envelope arrays of the up and down echo signals, one of the up and down envelope arrays is intercepted multiple times, and the interception interval each time has an offset of an integer wave period in different timing directions, and the other of the up and down envelope arrays is also intercepted. Then, the envelope difference between the first envelope interval array and the second envelope interval array, as well as the envelope difference between the first envelope interval array and the front and back offset envelope interval arrays is compared. Based on the envelope difference, it is possible to identify and reduce the misjudgment of the characteristic wave recognition (i.e., the wrong wave phenomenon) caused by signal distortion or noise interference, thereby improving the measurement accuracy of the flight time. By improving the accuracy of the flight time and enhancing the anti-interference ability of the calculation process, it helps to improve the measurement accuracy and reliability of the ultrasonic flowmeter. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present disclosure, and those of ordinary skill in the art can obtain other embodiments according to these drawings without creative efforts.
[0017] Figure 1 The flowchart of determining the flight time of an ultrasonic flowmeter provided by an embodiment of the present disclosure is shown.
[0018] Figure 2 The schematic diagram of the waveform and its envelope line of the echo signal provided by an embodiment of the present disclosure is shown.
[0019] Figure 3 The flowchart of the steps of determining the up and down envelope arrays corresponding to the up and down echo signals provided by an embodiment of the present disclosure is shown.
[0020] Figure 4 The flowchart of the steps of determining the up and down characteristic waves and the zero-crossing times of the up and down characteristic waves respectively based on the up and down envelope arrays provided by an embodiment of the present disclosure is shown.
[0021] Figure 5The figure shows a schematic flowchart of steps for respectively intercepting a first envelope interval array and a second envelope interval array from an uplink envelope array and a downlink envelope array according to a preset interval length and the zero-crossing times of the uplink and downlink characteristic waves provided by an embodiment of the present disclosure.
[0022] Figure 6 The figure shows a schematic flowchart of steps for calculating an envelope difference array between the first envelope interval array and the second envelope interval array, a front offset envelope interval array, and a rear offset envelope interval array provided by an embodiment of the present disclosure.
[0023] Figure 7 The figure shows a schematic flowchart of steps for determining the flight time of an ultrasonic flowmeter according to the envelope difference array provided by an embodiment of the present disclosure.
[0024] Figure 8 The figure shows a schematic structural diagram of a flight time determination device for an ultrasonic flowmeter provided by an embodiment of the present disclosure.
[0025] Figure 9 The figure shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners
[0026] Next, the technical solutions in the embodiments of the present disclosure will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present disclosure.
[0027] In the related art, a threshold method is usually adopted to identify the characteristic waves of ultrasonic signals, so as to calculate the flight time. The principle of the threshold method is as follows: a preset threshold is set, and when the amplitude of the received signal first exceeds this threshold, the system records this moment as the reference point of the ultrasonic flight time.
[0028] The threshold method has certain defects. For example, noise generated by the environment or the internal circuit may cause the signal to reach the threshold in advance, resulting in premature triggering; if the threshold is set too high, the direct wave may be missed and the "wrong wave" on the reflection path may be selected because these wrong waves may have a higher amplitude, thus causing incorrect time measurement; temperature and pressure changes will affect the gas density and the sound speed, and further change the amplitude and waveform of the signal, which may cause the set threshold to be no longer appropriate and affect the measurement accuracy.
[0029] The threshold method highly depends on the stability of the echo signal and the rationality of the threshold setting, and has poor anti-interference ability. In practical applications, due to factors such as external electromagnetic interference, transducer aging, unstable flow field, and temperature change, the waveform of the ultrasonic signal may be distorted, resulting in misjudgment of the characteristic wave when identifying the characteristic wave based on the threshold method, thus leading to deviation in the calculation of the flight time, and further affecting the accuracy of the fluid flow measurement.
[0030] Taking the ultrasonic gas meter as an example, with the wide application of natural gas in urban gas, the industry has put forward higher requirements for the measurement accuracy and reliability of gas meters. The ultrasonic gas meter needs to maintain high-precision measurement ability under various complex working conditions, and at the same time have good anti-interference ability and long-term stability. The method of calculating the flight time based on the threshold method has limitations, resulting in a narrow application scenario for ultrasonic flow meters.
[0031] Furthermore, the problem of misjudgment of waves is not limited to simple signal delay, but also involves misjudgment of signal characteristics caused by changes in external conditions, and inaccurate measurement of flight time caused thereby. To solve this problem, more advanced signal processing algorithms, methods of dynamically adjusting the threshold, automatic gain control (AGC) technology, and optimized hardware design are often adopted in related technologies to ensure that the direct wave signal can be accurately captured even in a complex environment, thereby improving the reliability and accuracy of ultrasonic flow measurement. However, this will lead to problems such as high power consumption, high cost, low flight time calculation efficiency, and difficulty in ensuring the accuracy of flight time calculation of ultrasonic flow meters.
[0032] To solve the above problems, the embodiments of the present disclosure provide a method for determining the flight time of an ultrasonic flow meter, as Figure 1 shown, the method for determining the flight time of the ultrasonic flow meter includes the following steps.
[0033] S110, obtain the upstream and downstream echo signals of the ultrasonic flow meter, and determine the upstream and downstream envelope arrays corresponding to the upstream and downstream echo signals.
[0034] Specifically, the upstream and downstream echo signals (collectively referred to as echo signals hereinafter) refer to the upstream echo signal and the downstream echo signal. The ultrasonic flow meter emits and receives ultrasonic signals in the downstream (downstream) and upstream (upstream) directions through ultrasonic transducers respectively. Among them, the upstream echo signal is the ultrasonic signal received by the ultrasonic transducer when the ultrasonic wave propagates upstream in the fluid to be measured; the downstream echo signal is the ultrasonic signal received by the ultrasonic transducer when the ultrasonic wave propagates downstream in the fluid to be measured.
[0035] Next, through an analog-to-digital converter (ADC), the collected uplink echo signal and downlink echo signal are converted into digital signal forms. At this time, the waveforms of the uplink echo signal and the downlink echo signal are actually composed of multiple discrete sampling points. The multiple sampling points are arranged in chronological order, and each sampling point represents the amplitude of the ultrasonic signal at a specific moment.
[0036] The uplink and downlink envelope arrays (collectively referred to as the envelope array below) represent the uplink envelope array and the downlink envelope array. The envelope array includes the envelope lines between multiple consecutive local wave peak points. The envelope line can be determined by methods such as interpolation and curve fitting, and the present disclosure does not make specific limitations on this.
[0037] As Figure 2 shown, the envelope line is constructed by interpolation between two adjacent local wave peak points (represented by "*"). Here, the envelope line is jointly composed of multiple interpolation points (represented by "·") and the sampling points at the local wave peaks.
[0038] The envelope line can reflect the overall change trend and amplitude range of the echo signal, facilitating subsequent characteristic wave identification and zero-crossing time determination. At the same time, even in complex scenarios such as unstable flow fields, transducer aging, or temperature changes, the envelope array can still effectively extract the characteristics of the echo signal, expanding the applicable scenarios of the method.
[0039] S120. Based on the uplink and downlink envelope arrays, determine the uplink and downlink characteristic waves, and the zero-crossing times of the uplink and downlink characteristic waves respectively.
[0040] The uplink and downlink characteristic waves (collectively referred to as the characteristic waves below) represent the uplink characteristic wave and the downlink characteristic wave. The characteristic wave is the waveform part in the echo signal that is representative and can reflect the key characteristics of the signal. Through the envelope array, the characteristic wave can be more clearly identified from the echo signal, helping to reduce misjudgment caused by noise and signal distortion.
[0041] Next, based on the uplink and downlink characteristic waves, the zero-crossing times of the uplink and downlink characteristic waves can be determined respectively.
[0042] Exemplarily, the zero-crossing time can be determined by the amplitude zero-crossing detection method; or, the zero-crossing time can be determined by interpolating the zero-crossing points to improve the accuracy of the zero-crossing time; in addition, other zero-crossing detection methods can also be used to determine the zero-crossing time, and the present disclosure does not make specific limitations on this.
[0043] S130. According to the preset interval length and the zero-crossing times of the uplink and downlink characteristic waves respectively, intercept the first envelope interval array and the second envelope interval array from the uplink and downlink envelope arrays respectively.
[0044] The preset interval length can be determined according to the cross-wave error range. For example, if the cross-wave error range is small, a smaller preset interval length can be selected; if the cross-wave error range is large, a larger preset interval length can be selected. Exemplarily, half a wave period, one or more wave periods can be selected as the preset interval length.
[0045] Taking the zero-crossing time of the upward characteristic wave as the starting point, a partial envelope line with a time length of the preset interval length is taken on the envelope line of the upward envelope array. Taking the zero-crossing time of the downward characteristic wave as the starting point, a partial envelope line with a duration of the preset interval length is intercepted on the envelope line of the downward envelope array. One of the partial envelope line in the upward envelope array and the partial envelope line in the downward envelope array is used as the first envelope interval array, and the other is used as the second envelope interval array.
[0046] S140, perform a time-series advance offset and a time-series lag offset of an integer wave period on the intercepted interval of the second envelope interval array, and obtain a pre-offset envelope interval array and a post-offset envelope interval array.
[0047] Perform a time-series advance offset and a time-series lag offset of an integer wave period on the intercepted interval of the second envelope interval array. And based on the intercepted intervals after the time-series advance offset and the time-series lag offset, intercept the envelope array corresponding to the second envelope interval array again to obtain a pre-offset envelope interval array and a post-offset envelope interval array respectively. Wherein, the intercepted interval is the time range corresponding to the second envelope interval array.
[0048] In the cross-wave phenomenon, the recognition of the characteristic wave often advances or lags by one or more integer wave periods. Therefore, in order to avoid the cross-wave phenomenon during the recognition of the characteristic wave, the embodiments of the present disclosure intercept a pre-offset envelope interval array, a second envelope interval array, and a post-offset envelope interval array that are offset from each other by an integer wave period in time series in the upward or downward envelope array, and perform verification on the above interval arrays respectively.
[0049] According to a specific implementation manner of the embodiments of the present disclosure, a time-series advance offset and a time-series lag offset of an integer wave period can be first performed, and then subsequent verification steps (i.e., step S150 below) are performed. If the target characteristic wave fails to be recognized, then perform a time-series advance offset and a time-series lag offset of two integer wave periods, and then perform subsequent verification steps.
[0050] According to another specific implementation manner of the embodiments of the present disclosure, if it is impossible to determine the range of the misaligned wave error or it is considered that the range of the misaligned wave error is large, the timing advance offset and the timing lag offset of multiple consecutive integer wave cycles can also be performed at one time. For example, the timing advance offset of one wave cycle, two wave cycles, and three wave cycles are respectively performed on the intercepted intervals of the second envelope interval array, and three groups of pre-offset envelope interval arrays can be obtained. At the same time, the timing lag offset of one wave cycle, two wave cycles, and three wave cycles are respectively performed to obtain three groups of post-offset envelope interval arrays, and then the steps of calculating the subsequent envelope difference array and determining the flight time are performed.
[0051] S150. Calculate the envelope difference arrays between the first envelope interval array and the second envelope interval array, the pre-offset envelope interval array, and the post-offset envelope interval array respectively, and determine the flight time of the ultrasonic flowmeter according to the envelope difference arrays.
[0052] Calculate the difference between the first envelope interval array and the second envelope interval array to obtain the envelope difference array corresponding to the second envelope interval array. Similarly, calculate the difference between the first envelope interval array and the pre-offset envelope interval array to obtain the envelope difference array corresponding to the pre-offset envelope interval array. Calculate the difference between the first envelope interval array and the post-offset envelope interval array to obtain the envelope difference array corresponding to the post-offset envelope interval array.
[0053] In the embodiments of the present disclosure, the envelope difference array can reflect the signal feature differences under different offsets. Therefore, by comparing the envelope differences under different offsets, the misaligned wave misjudgment caused by noise or signal distortion can be effectively identified and excluded. Then, the flight time of the ultrasonic flowmeter is determined, and the measurement error caused by the misaligned wave phenomenon is corrected, thereby improving the accuracy and reliability of the measurement result of the ultrasonic flowmeter.
[0054] In the embodiments of the present disclosure, first, the up and down envelope arrays of the up and down echo signals are determined. One of the up and down envelope arrays is intercepted multiple times, and the intercepted interval has an integer wave cycle offset in different timing directions each time, and the other of the up and down envelope arrays is also intercepted. By comparing the envelope differences between the first envelope interval array and the second envelope interval array, and the pre- and post-offset envelope interval arrays, the misjudgment of the characteristic wave recognition (i.e., the misaligned wave phenomenon) caused by signal distortion or noise interference can be identified and reduced based on the envelope differences, thereby improving the measurement accuracy of the flight time. By improving the accuracy of the flight time and enhancing the anti-interference ability of the calculation process, it helps to improve the measurement accuracy and reliability of the ultrasonic flowmeter.
[0055] Next, the specific implementation manners of each step in the method for determining the flight time of the ultrasonic flowmeter are continued to be introduced.
[0056] Figure 3 The figure shows a schematic flow chart of steps for determining the uplink and downlink envelope arrays corresponding to the uplink and downlink echo signals provided by an embodiment of the present disclosure. As Figure 3 shown, to determine the uplink envelope array corresponding to the uplink echo signal and the downlink envelope array corresponding to the downlink echo signal, the following steps can be respectively executed for the uplink echo signal and the downlink echo signal.
[0057] S111. Determine multiple local maxima in the echo signal, and perform non-linear curve fitting on the multiple local maxima to obtain the peaks of multiple consecutive local waves.
[0058] The echo signal includes multiple sampling points. Based on the multiple sampling points, multiple local maxima in the echo signal can be determined.
[0059] Specifically, the following several methods can be used to extract the local maxima in the echo signal: (1) Derivative-based method: Based on the multiple sampling points in the echo signal, calculate the first derivative of the echo signal, and take the points where the derivative is zero as local maxima; (2) Threshold-based method: Set a threshold, and regard the sampling points higher than the threshold as local maxima. It should be noted that other extreme value detection methods can also be used to extract the local maxima in the echo signal.
[0060] Next, perform non-linear curve fitting on the multiple local maxima to calculate the peaks of multiple consecutive local waves in the echo signal. The following several fitting methods can be used: (1) Parabolic fitting: Fit the local maximum points through a quadratic polynomial, and determine the peak of the local wave based on the fitted quadratic polynomial; Continuing to refer to Figure 2 , Figure 2 in the waveform schematic diagram shown, the peak of the local wave indicated by "*" is determined by parabolic fitting; (2) Gaussian fitting: Assume that the data near the local maximum follows a Gaussian distribution, fit the parameters of the Gaussian function through non-linear least squares method, and determine the peak of the local wave based on the fitted Gaussian function. It should be noted that other non-linear curve fitting methods can also be used to determine the peak of the local wave; (3) Cosine fitting: Assume that the data near the local maximum follows a cosine distribution, fit the local maximum points through a cosine function, and determine the peak of the local wave based on the fitted cosine function.
[0061] By extracting the local maxima, the key feature points in the echo signal can be quickly located, providing a basis for subsequent non-curve fitting. The fitting result obtained by non-linear curve fitting can more accurately restore the peak of the local wave, reducing the error caused by scattered sampling.
[0062] S112. Perform interpolation processing on the peaks of adjacent local waves, and segmentally generate the envelope line between the peaks of adjacent local waves to obtain the envelope array.
[0063] For any pair of adjacent peak values of multiple consecutive local waves, interpolation operations can be performed based on the positional and numerical relationships between the two peak values to obtain the local envelope line between the peak values of adjacent local waves.
[0064] Specifically, the steps of constructing the local envelope line may include: for any pair of adjacent local waves, first calculate the difference ratio between the peak values of adjacent local waves to determine the rising or falling trend of the local wave; then, between the peak values of adjacent local waves, use an interpolation method to generate the amplitudes of the sampling points (where common interpolation methods include linear interpolation, spline interpolation, etc.).
[0065] Finally, splice all the local envelope lines in sequence to form a complete envelope array.
[0066] Based on the above settings, by constructing the envelope array, noise and interference signals can be effectively filtered, enhancing the stability of the signal; the envelope array can clearly reflect the key features of the signal, facilitating subsequent feature wave identification and zero-crossing time determination. The envelope array constructed in segments can accurately restore the true waveform of the echo signal, avoiding the influence of discrete sampling and reducing the measurement error caused by the deformation of the echo signal.
[0067] Next, the specific implementation manners of determining the up and down characteristic waves based on the up and down envelope arrays will be continued to be introduced.
[0068] Figure 4 The following shows a schematic flow chart of the steps of determining the up and down characteristic waves and the zero-crossing times of the up and down characteristic waves respectively based on the up and down envelope arrays provided by an embodiment of the present disclosure. As Figure 4 shown, the steps of determining the up and down characteristic waves and the zero-crossing times of the up and down characteristic waves respectively based on the up and down envelope arrays include the following steps.
[0069] S121, according to the up and down envelope arrays, determine the up and down maximum envelope values corresponding to the up and down echo signals.
[0070] Select the up and down maximum envelope values (hereinafter collectively referred to as the maximum envelope value) from the up and down envelope arrays respectively. The maximum envelope value reflects the strongest feature of the echo signal and is the basis for subsequent identification of the characteristic wave.
[0071] S122, according to the preset up and down maximum envelope value ratios and the up and down maximum envelope values, identify the up and down characteristic waves from the up and down echo signals.
[0072] After determining the maximum envelope values of the uplink and downlink, based on the preset ratio of the maximum envelope values of the uplink and downlink, the thresholds for identifying the uplink and downlink characteristic waves are determined respectively. By traversing the uplink and downlink envelope arrays and addressing the waveforms that exceed the corresponding thresholds, the uplink characteristic wave in the uplink echo signal and the downlink characteristic wave in the downlink echo signal are obtained respectively.
[0073] Among them, the ratio of the maximum envelope values of the uplink and downlink can be determined through experiments, and the two can be the same or different from each other. The present disclosure does not make specific limitations on this.
[0074] S123, determine the zero-crossing times of the uplink and downlink characteristic waves respectively.
[0075] Based on the zero-crossing detection method, the zero-crossing times of the uplink characteristic wave and the zero-crossing times of the downlink characteristic wave are obtained respectively from the uplink and downlink characteristic waves. Exemplarily, the following several methods can be adopted: (1) Determine the zero-crossing time through the amplitude zero-crossing detection method (the amplitude zero-crossing detection method finds the intersection point where the amplitude of the characteristic wave changes from positive to negative or from negative to positive, and this intersection point is the zero-crossing time); (2) Determine the zero-crossing time by interpolating the sampling points near the zero-crossing point (such as quadratic interpolation or cosine interpolation, etc.) to improve the accuracy of the zero-crossing time. In addition, other zero-crossing detection methods can also be used to determine the zero-crossing time, and the present disclosure does not make specific limitations on this.
[0076] In the embodiments of the present disclosure, the characteristic waves in the echo signal are determined by using the maximum envelope value and the ratio of the maximum envelope values, which improves the accuracy of characteristic wave recognition. Then, based on the zero-crossing time of the characteristic wave, and taking multiple time sequence points within the preset interval length as the interception objects, the first envelope interval array and the second envelope interval array are obtained, which ensures the accuracy while reducing the data processing amount and improving the verification efficiency. The following is a specific introduction.
[0077] Figure 5 The figure shows a schematic flowchart of the steps of intercepting the first envelope interval array and the second envelope interval array from the uplink and downlink envelope arrays respectively according to the preset interval length and the zero-crossing times of the uplink and downlink characteristic waves provided by an embodiment of the present disclosure. As Figure 5 shown, the steps of intercepting the first envelope interval array and the second envelope interval array from the uplink and downlink envelope arrays respectively according to the preset interval length and the zero-crossing times of the uplink and downlink characteristic waves include the following steps.
[0078] S131, starting from the zero-crossing times of the uplink and downlink characteristic waves respectively, and taking multiple time sequence points within the preset interval length as the interception objects, intercept the uplink envelope interval array from the uplink envelope array and intercept the downlink envelope interval array from the downlink envelope array.
[0079] The following operations are respectively performed on the uplink and downlink envelope arrays: Starting from the zero-crossing time of the characteristic wave, multiple time series points within a preset interval length are intercepted from the envelope arrays. The multiple time series points intercepted from the uplink envelope array are used as the uplink envelope interval array, and the multiple time series points intercepted from the downlink envelope interval array are used as the downlink envelope interval array.
[0080] Specifically, since the envelope array includes the envelope lines between multiple consecutive local wave peak points constructed in segments, part of the envelope lines within the corresponding preset interval length are composed of multiple time series points; among them, the multiple time series points can be multiple sampling points and / or interpolation points located on the envelope line.
[0081] S132, Determine either the uplink envelope interval array or the downlink envelope interval array as the first envelope interval array, and determine the remaining one as the second envelope interval array.
[0082] Exemplarily, the uplink envelope interval array can be used as the first envelope interval array, and at the same time, the downlink envelope interval array can be used as the second envelope interval array; or, the downlink envelope interval array can be used as the first envelope interval array, and at the same time, the uplink envelope interval array can be used as the second envelope interval array.
[0083] In the embodiments of the present disclosure, using multiple time series points within the preset interval length as the interception object can reduce the data processing volume and improve the verification efficiency. Moreover, the purpose of selecting the interception object is to ensure that the envelope interval arrays of the same interval segment (or the same series of time series points) are intercepted from the uplink and downlink envelope arrays, so that the comparison scales of the first envelope interval array, the second envelope interval array, and the front and back offset envelope interval arrays offset from the second envelope interval array are consistent. Only in this way can it be ensured that the calculated envelope difference array can be used to judge whether there is a wrong wave.
[0084] Therefore, the multiple time series points in the above interception object can be multiple consecutive sampling points or interpolation points, or sampling points or interpolation points of the same sequence selected intermittently. According to another specific embodiment of the embodiments of the present disclosure, the multiple time series points in the above interception object can also directly select multiple key feature points within the preset interval length, such as zero-crossing points and peak points.
[0085] After obtaining the uplink envelope interval array and the downlink envelope interval array, perform integer wave cycle time series advance offset and time series lag offset on the interception interval of the second envelope interval array, and respectively intercept multiple time series points within the offset interception interval to obtain the front offset envelope interval array and the back offset envelope interval array.
[0086] According to another specific implementation manner of the embodiments of the present disclosure, after intercepting the first envelope interval array and the second envelope interval array from the uplink envelope array and the downlink envelope array respectively according to the preset interval length, the first envelope interval array and the second envelope interval array can also be simultaneously subjected to timing advance offset and timing lag offset of the integer wave period.
[0087] To ensure the accuracy of verification, the number of integer wave periods corresponding to the timing advance offset and the timing lag offset can be increased. For example, advance offset by one integer wave period and two integer wave periods respectively, and then lag offset by one integer wave period and two integer wave periods respectively. Determine the envelope difference between the multiple envelope interval arrays intercepted from the uplink envelope array and the multiple envelope interval arrays intercepted from the downlink envelope array respectively, so as to verify whether there is a wrong wave. The following will separately introduce the specific implementation manners of calculating the envelope difference and verifying whether there is a wrong wave based on the envelope difference.
[0088] Figure 6 The figure shows a schematic flowchart of the steps for calculating the envelope difference arrays between the first envelope interval array and the second envelope interval array, the pre-offset envelope interval array, and the post-offset envelope interval array respectively provided by an embodiment of the present disclosure. As Figure 6 shown, the steps for calculating the envelope difference arrays between the first envelope interval array and the second envelope interval array, the pre-offset envelope interval array, and the post-offset envelope interval array respectively include the following steps.
[0089] S610, based on the maximum envelope value of the echo signal corresponding to the first envelope interval array, perform normalization processing on the first envelope interval array to obtain the first envelope ratio array.
[0090] Based on the maximum envelope value of the echo signal to which the first envelope interval array belongs, perform normalization processing on the amplitudes of each point in the first envelope interval array, and unify the amplitudes of the first envelope interval array to the same reference (usually between 0 and 1) to obtain the first envelope ratio array.
[0091] S620, based on the maximum envelope value of the echo signal corresponding to the second envelope interval array, perform normalization processing on the second envelope interval array, the pre-offset envelope interval array, and the post-offset envelope interval array respectively to obtain the second envelope ratio array, the pre-envelope ratio array, and the post-envelope ratio array.
[0092] Similarly, based on the maximum envelope value of the echo signal to which the second envelope interval array belongs, perform normalization processing on the second envelope interval array, the pre-offset envelope interval array, and the post-offset envelope interval array respectively to obtain the second envelope ratio array, the pre-envelope ratio array, and the post-envelope ratio array.
[0093] S630, calculate the envelope difference arrays between the first envelope ratio array and the second envelope ratio array, the front envelope ratio array, and the rear envelope ratio array respectively.
[0094] Subtract the second envelope ratio array from the first envelope ratio array to obtain the envelope difference array between the first envelope ratio array and the second envelope ratio array. Similarly, obtain the envelope difference array between the first envelope ratio array and the front envelope ratio array, and the envelope difference array between the first envelope ratio array and the rear envelope ratio array respectively.
[0095] In the embodiments of the present disclosure, by normalizing the values in the envelope interval array, the comparison error caused by signal strength differences is eliminated. At the same time, the normalized envelope ratio array is convenient for direct comparison and can more accurately reflect the signal feature differences under different offsets. The envelope difference array calculated in the above manner can quantify the signal changes under different offsets, providing a more reliable basis for determining the time of flight and enhancing the reliability of the time of flight.
[0096] Figure 7 The figure shows a schematic flowchart of the steps for determining the time of flight of an ultrasonic flowmeter according to the envelope difference array provided by an embodiment of the present disclosure. As Figure 7 shown, the steps for determining the time of flight of an ultrasonic flowmeter according to the envelope difference array include the following steps.
[0097] S710, respectively determine the maximum difference and / or the accumulated difference value in each envelope difference array, and based on multiple maximum differences and / or accumulated difference values, determine one of the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array as the target envelope interval array.
[0098] In the above embodiments, the envelope difference arrays between the first envelope interval array and the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array are obtained. Then, for each envelope difference array, take the largest one as the maximum difference of the envelope difference array, and take the sum of the envelope differences in the envelope difference array as the accumulated difference value of the envelope difference array.
[0099] Based on the maximum difference and / or the accumulated difference value, select the one with the smallest difference from the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array compared with the first envelope interval array as the target envelope interval array.
[0100] Here, the target envelope interval array can be determined only based on multiple maximum differences, or can be determined only based on multiple difference accumulation values; alternatively, the weight between the maximum difference and the difference accumulation value can also be determined, and the target envelope interval array can be comprehensively determined based on multiple maximum differences and multiple difference accumulation values. The present disclosure does not make specific limitations on this.
[0101] S720. Based on the target envelope interval array and the upstream and downstream characteristic waves, determine the target upstream and downstream characteristic waves.
[0102] The target upstream and downstream characteristic waves represent the target upstream characteristic wave and the target downstream characteristic wave.
[0103] After determining the target envelope interval array, it is possible to know whether there is a problem of wave misalignment in the previously determined upstream and downstream characteristic waves according to the target envelope interval array. If there is a problem of wave misalignment, the selection intervals of the upstream and downstream characteristic waves are offset and adjusted to obtain the target upstream and downstream characteristic waves.
[0104] Specifically, if the target envelope interval array is the second envelope interval array, it means that the characteristic waves identified in the above steps are relatively accurate and there is no problem of wave misalignment. At this time, the upstream characteristic wave can be directly determined as the target upstream characteristic wave, and the downstream characteristic wave can be determined as the target downstream characteristic wave.
[0105] If the target envelope interval array is not the second envelope interval array, it means that there is a problem of wave misalignment, and it is necessary to offset and adjust the selection intervals of the characteristic waves corresponding to the target envelope interval array according to the integer wave period and the offset direction by which the target envelope interval array is offset. The selection interval refers to the time range corresponding to the original upstream characteristic wave or downstream characteristic wave.
[0106] Specifically, if the target envelope interval array is the forward offset envelope interval array, it indicates that the selection interval of the characteristic wave corresponding to the forward offset envelope interval array needs to be adjusted forward (or to the left) by the corresponding integer wave period; the partial echo signals within the adjusted selection interval and the characteristic wave corresponding to the first envelope interval array are respectively used as the target upstream and downstream characteristic waves. Similarly, if the target envelope interval array is the backward offset envelope interval array, the selection interval of the characteristic wave corresponding to the backward offset envelope interval array needs to be adjusted backward (or to the right) by the corresponding integer wave period.
[0107] Among them, the distance and direction that the characteristic wave needs to be adjusted are the same as the offset distance and offset direction of the intercepting interval when intercepting the target envelope interval array.
[0108] S730. According to the zero-crossing times of the target upstream and downstream characteristic waves, determine the flight time of the ultrasonic flowmeter.
[0109] After the above steps, there is no problem of false waves in the target up- and down-travel characteristic waves. Therefore, the zero-crossing times of the target up- and down-travel characteristic waves can be determined, and further the flight time of the ultrasonic flowmeter can be determined.
[0110] In the embodiments of the present disclosure, by using the envelope difference array, the problem of false waves that may exist in the process of determining the up- and down-travel characteristic waves is identified and eliminated, the accuracy of the final zero-crossing time is improved, and thus the measurement accuracy and reliability of the ultrasonic flowmeter are improved.
[0111] Next, the specific implementation manner of determining the target envelope interval array based on the maximum difference and / or the cumulative difference value will be continued to be introduced.
[0112] According to a specific implementation manner of the embodiments of the present disclosure, step S710 in the above embodiments may be specifically implemented as: determining the envelope difference array to which the smallest value among multiple maximum differences belongs as the target envelope difference array, and determining the target envelope interval array based on the target envelope difference array.
[0113] In the above embodiments, the maximum differences of each of the multiple envelope difference arrays are obtained. The envelope difference array to which the smallest maximum difference belongs is determined as the target envelope difference array, and the envelope interval array corresponding to the target envelope difference array is used as the target envelope interval array.
[0114] According to another specific implementation manner of the embodiments of the present disclosure, step S710 in the above embodiments may be specifically implemented as: determining the envelope difference array to which the smallest value among multiple cumulative difference values belongs as the target envelope difference array, and determining the target envelope interval array based on the target envelope difference array.
[0115] In the above embodiments, the cumulative difference values of each of the multiple envelope difference arrays are obtained. The envelope difference array to which the smallest cumulative difference value belongs is determined as the target envelope difference array, and the envelope interval array corresponding to the target envelope difference array is used as the target envelope interval array.
[0116] In addition to the above methods for determining the target envelope interval array, the embodiments of the present disclosure also provide a method for determining the target envelope interval array based on a preset threshold interval, and the specific implementation manner is as follows.
[0117] According to yet another specific implementation manner of the embodiments of the present disclosure, step S710 in the above embodiments may be specifically implemented as: determining the target maximum difference among multiple maximum differences based on the maximum difference threshold interval, and determining the target envelope interval array based on the target maximum difference.
[0118] First, a maximum difference threshold range is preset. The left and right endpoint values of the maximum difference threshold range are empirical values and can be adjusted according to the actual working conditions. If the maximum difference corresponding to the envelope difference array falls within the maximum difference threshold range, then this maximum difference is determined as the target maximum difference, and the envelope interval array corresponding to the target maximum difference is determined as the target envelope interval array.
[0119] According to another specific implementation manner of the embodiment of the present disclosure, step S710 in the above embodiment can be specifically implemented as: based on the difference accumulation value threshold range, determine the target difference accumulation value among multiple difference accumulation values, and based on the target difference accumulation value, determine the target envelope interval array.
[0120] First, a difference accumulation value threshold range is preset. The left and right endpoint values of the difference accumulation value threshold range are empirical values and can be adjusted according to the actual working conditions. If the difference accumulation value corresponding to the envelope difference array falls within the difference accumulation value threshold range, then this difference accumulation value is determined as the target difference accumulation value, and the envelope interval array corresponding to the target difference accumulation value is determined as the target envelope interval array.
[0121] If two or more maximum differences or difference accumulation values fall within the difference accumulation value threshold range, then select the smallest one among them as the target maximum difference or the target difference accumulation value.
[0122] When the maximum difference or the difference accumulation value falls within the corresponding threshold range, it can be considered that this maximum difference or this difference accumulation value is relatively reasonable, that is, the gap between the two envelope interval arrays corresponding to this maximum difference or this difference accumulation value is within a reasonable range.
[0123] For the convenience of setting the maximum difference threshold range or the difference accumulation value threshold range, the envelope difference array in the above steps can be obtained by calculating the envelope difference array between the envelope ratio arrays obtained through normalization processing based on the maximum envelope value.
[0124] The method for determining the flight time of the ultrasonic flowmeter provided by the embodiment of the present disclosure uses the technical means of determining the flight time of the ultrasonic flowmeter based on the envelope difference array, overcomes the problem in the related art that the misaligned wave phenomenon causes deviation in the calculation of the flight time, affects the measurement accuracy of the fluid flow rate, and results in a narrow application scenario of the ultrasonic flowmeter. By determining the upper and lower envelope arrays corresponding to the upper and lower echo signals, and performing periodic offset truncation on the upper and lower envelope arrays, and by comparing the differences between the upper and lower envelope interval arrays at different periodic offsets, the verification of the upper and lower characteristic waves is realized, the misaligned wave phenomenon is overcome, and accordingly, the technical effects of improving the recognition accuracy of the target characteristic wave, improving the calculation accuracy of the flight time, improving the measurement accuracy of the fluid flow rate, and expanding the application scenario of the ultrasonic flight device are achieved.
[0125] As described above in conjunction with Figures 1 to 7 the method embodiments of the present disclosure have been described in detail. Next, in conjunction with Figure 8 the device embodiments of the present disclosure will be described in detail. It should be understood that the descriptions of the method embodiments and the device embodiments correspond to each other. Therefore, for the parts not described in detail, reference may be made to the previous method embodiments.
[0126] Figure 8 The following is a schematic structural diagram of a device for determining the flight time of an ultrasonic flowmeter provided by an embodiment of the present disclosure. As Figure 8 shown, the device 800 for determining the flight time of the ultrasonic flowmeter according to the embodiment of the present disclosure includes: a signal acquisition module 810, a characteristic wave identification module 820, a first interception module 830, a second interception module 840, and a determination module 850.
[0127] Specifically, the signal acquisition module 810 is configured to acquire the upstream and downstream echo signals of the ultrasonic flowmeter, and determine the upstream and downstream envelope arrays corresponding to the upstream and downstream echo signals; wherein, the envelope array includes the envelope lines between multiple consecutive local wave peak points.
[0128] The characteristic wave identification module 820 is configured to determine the upstream and downstream characteristic waves, and the zero-crossing times of the upstream and downstream characteristic waves respectively based on the upstream and downstream envelope arrays.
[0129] The first interception module 830 is configured to respectively intercept a first envelope interval array and a second envelope interval array from the upstream and downstream envelope arrays according to a preset interval length and the zero-crossing times of the upstream and downstream characteristic waves respectively.
[0130] The second interception module 840 is configured to perform a time series advance offset and a time series lag offset of an integer wave period on the interception interval of the second envelope interval array, and intercept a pre-offset envelope interval array and a post-offset envelope interval array.
[0131] The determination module 850 is configured to calculate the envelope difference arrays between the first envelope interval array and the second envelope interval array, the pre-offset envelope interval array, and the post-offset envelope interval array respectively, and determine the flight time of the ultrasonic flowmeter according to the envelope difference arrays.
[0132] In some of these embodiments, the signal acquisition module 810 is further configured to respectively perform the following steps for the upstream echo signal and the downstream echo signal: determine multiple local maxima in the echo signal, perform a non-linear curve fitting on the multiple local maxima to obtain the peaks of multiple consecutive local waves; perform an interpolation process on the peaks of adjacent local waves, and segmentally generate the envelope lines between the peaks of adjacent local waves to obtain the envelope array.
[0133] In some of these embodiments, the characteristic wave recognition module 820 is further configured to determine the maximum envelope values of the upstream and downstream echo signals corresponding to the upstream and downstream envelope arrays according to the upstream and downstream envelope arrays; identify the upstream and downstream characteristic waves from the upstream and downstream echo signals according to a preset ratio of the maximum envelope values of the upstream and downstream, and the maximum envelope values of the upstream and downstream; and respectively determine the zero-crossing times of the upstream and downstream characteristic waves.
[0134] In some of these embodiments, the first truncation module 830 is further configured to, starting from the zero-crossing times of the upstream and downstream characteristic waves respectively, take multiple time sequence points within a preset interval length as the truncation objects, truncate an upstream envelope interval array from the upstream envelope array, and truncate a downstream envelope interval array from the downstream envelope array; and determine either the upstream envelope interval array or the downstream envelope interval array as the first envelope interval array, and determine the remaining one as the second envelope interval array.
[0135] In some of these embodiments, the determination module 850 is further configured to normalize the first envelope interval array based on the maximum envelope value of the echo signal corresponding to the first envelope interval array to obtain a first envelope ratio array; normalize the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array respectively based on the maximum envelope value of the echo signal corresponding to the second envelope interval array to obtain a second envelope ratio array, a front envelope ratio array, and a rear envelope ratio array; and calculate an envelope difference array between the first envelope ratio array and the second envelope ratio array, the front envelope ratio array, and the rear envelope ratio array respectively.
[0136] In some of these embodiments, the determination module 850 is further configured to respectively determine the maximum difference and / or the cumulative difference value in each envelope difference array, and based on multiple maximum differences and / or cumulative difference values, determine one of the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array as the target envelope interval array; determine the target upstream and downstream characteristic waves based on the target envelope interval array and the upstream and downstream characteristic waves; and determine the flight time of the ultrasonic flowmeter according to the zero-crossing times of the target upstream and downstream characteristic waves.
[0137] In some of these embodiments, the determining module 850 is further configured to determine the envelope difference array to which the smallest value among the multiple maximum differences belongs as the target envelope difference array, and determine the target envelope interval array based on the target envelope difference array; or, determine the envelope difference array to which the smallest value among the multiple difference accumulation values belongs as the target envelope difference array, and determine the target envelope interval array based on the target envelope difference array; or, determine the target maximum difference among the multiple maximum differences based on the maximum difference threshold interval, and determine the target envelope interval array based on the target maximum difference; or, determine the target difference accumulation value among the multiple difference accumulation values based on the difference accumulation value threshold interval, and determine the target envelope interval array based on the target difference accumulation value.
[0138] Embodiments of the present disclosure also provide a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is configured to cause the computer to execute the method of the embodiments of the present disclosure.
[0139] Exemplarily, the non-transitory machine-readable medium may be a storage chip, a memory card, etc., and can be applied to an ultrasonic flowmeter.
[0140] Embodiments of the present disclosure also provide a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is configured to cause the computer to execute the method of the embodiments of the present disclosure. Among them, the computer program product should be understood as a software product that mainly implements the method in any of the above embodiments of the present disclosure through the computer program.
[0141] Embodiments of the present disclosure also provide an electronic device, including: at least one processor, and a memory storing a computer program that can be executed by the at least one processor, the computer program including instructions that, when executed by the processor, cause the processor to execute the method in any of the above embodiments.
[0142] Exemplarily, the electronic device may be an ultrasonic flowmeter.
[0143] Reference Figure 9 , the structural block diagram of an electronic device that can be a server or a client as an embodiment of the present disclosure will now be described. It is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0144] As shown Figure 9 in the figure, the electronic device includes a processor unit 901, which can be various general-purpose and / or dedicated processing components with processing and computing capabilities. Some examples of the processor unit 901 include, but are not limited to, an MCU, a CPU, a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing units, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor unit 901 is used to execute the various methods and processes described above. For example, in some embodiments, the method embodiments of the present disclosure can be implemented as a computer program, which is tangibly included in a machine-readable medium, such as an external storage unit 907. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device via the local storage unit 902 and / or the communication unit 908. In some embodiments, the processor unit 901 can be configured to execute the above-described method in any other suitable manner (e.g., by means of firmware).
[0145] Specifically, the above-mentioned processor unit 901 can execute various appropriate actions and processes according to the computer program stored in the local storage unit 902 (which can be a ROM storage unit or other devices with storage functions) or the computer program loaded from the external storage unit 907 into the local storage unit 902 (such as a random access memory RAM). In the local storage unit 902, various programs and data required for the operation of the electronic device can also be stored. The processor unit 901 and the local storage unit 902 are connected to each other via a bus 903. An input / output (I / O) interface 904 is also connected to the bus 903.
[0146] Multiple components in the electronic device are connected to the I / O interface 904, including: an input unit 905, an output unit 906, an external storage unit 907, and a communication unit 908. The input unit 905 can be any type of device that can input information into the electronic device. The input unit 905 can receive input digital or character information, and generate key signal inputs related to the user settings and / or function controls of the electronic device. The output unit 906 can be any type of device that can present information, and can include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The external storage unit 907 can include, but is not limited to, a disk, an optical disc. The communication unit 908 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include, but is not limited to, a modem, a network card, an infrared communication device, and / or a wireless communication transceiver, such as a Bluetooth device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0147] The computer programs for implementing the methods of the embodiments of the present disclosure can be written in any combination of one or more programming languages. These computer programs can be provided to the processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when executed by the processor or controller, the computer programs cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs can be executed entirely on the machine, partially on the machine, executed partially on the machine and partially on a remote machine as an independent software package, or executed entirely on a remote machine or server.
[0148] In the context of the embodiments of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. The machine-readable signal medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, or infrared system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0149] It should be noted that the term "including" and its variants used in the embodiments of the present disclosure are open-ended, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "a plurality" mentioned in the embodiments of the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".
[0150] The information and data involved in the embodiments of the present disclosure (including but not limited to the information and data for analysis, the stored information and data, the displayed information and data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of the relevant information and data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entrances are provided for the user to select authorization or rejection.
[0151] In the method embodiments provided by the present disclosure, the steps described can be executed in different orders and / or in parallel. In the devices and methods of the present disclosure, each component or each step can be decomposed and / or recombined, and such decompositions and / or recombinations shall be regarded as equivalent solutions of the present disclosure. In addition, the method embodiments may include additional steps and / or omit the steps shown. The protection scope of the present disclosure is not limited in this regard.
[0152] The term "embodiment" in this specification means that the specific features, structures or characteristics described in connection with the embodiments may be included in at least one embodiment of the present disclosure. The phrase appears in various positions in the specification and does not necessarily mean the same embodiment, nor does it mean independence or alternative to other embodiments, being mutually exclusive. The various embodiments in this specification are described in a related manner, and the same or similar parts between the embodiments are referred to each other. In particular, for device, equipment, and system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiments.
[0153] The above embodiments only represent several implementation manners of the present disclosure, and the description is relatively specific and detailed, but should not be construed as a limitation on the protection scope. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present disclosure, several modifications and improvements can still be made, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the appended claims.
Claims
1. A method for determining the flight time of an ultrasonic flowmeter, characterized in that, Including: Obtaining the upstream and downstream echo signals of the ultrasonic flowmeter, and determining the upstream and downstream envelope arrays corresponding to the upstream and downstream echo signals; wherein, the envelope array includes the envelope lines between multiple consecutive local wave peak points; Based on the upstream and downstream envelope arrays, determining the upstream and downstream characteristic waves, and the zero-crossing times of the upstream and downstream characteristic waves respectively; According to the preset interval length and the zero-crossing times of the upstream and downstream characteristic waves respectively, intercepting a first envelope interval array and a second envelope interval array from the upstream and downstream envelope arrays respectively; Performing integer wave cycle time series advance offset and time series delay offset on the intercepted intervals of the second envelope interval array, and obtaining a pre-offset envelope interval array and a post-offset envelope interval array; Calculating the envelope difference arrays between the first envelope interval array and the second envelope interval array, the pre-offset envelope interval array, and the post-offset envelope interval array respectively, and determining the flight time of the ultrasonic flowmeter according to the envelope difference arrays.
2. The method according to claim 1, wherein The echo signal includes multiple sampling points; the determining of the upstream and downstream envelope arrays corresponding to the upstream and downstream echo signals includes: Performing the following steps on the upstream echo signal and the downstream echo signal respectively: determining multiple local maxima in the echo signal, and performing non-linear curve fitting on the multiple local maxima to obtain the peaks of multiple consecutive local waves; Performing interpolation processing on the peaks of adjacent local waves, and segmentally generating the envelope lines between the peaks of adjacent local waves to obtain the envelope array.
3. The method according to claim 1, wherein The determining of the upstream and downstream characteristic waves, and the zero-crossing times of the upstream and downstream characteristic waves respectively based on the upstream and downstream envelope arrays includes: According to the upstream and downstream envelope arrays, determining the upstream and downstream maximum envelope values corresponding to the upstream and downstream echo signals; Identifying the upstream and downstream characteristic waves from the upstream and downstream echo signals according to the preset upstream and downstream maximum envelope value ratios and the upstream and downstream maximum envelope values; Respectively determining the zero-crossing times of the upstream and downstream characteristic waves.
4. The method according to claim 1, wherein The intercepting of the first envelope interval array and the second envelope interval array from the upstream and downstream envelope arrays respectively according to the preset interval length and the zero-crossing times of the upstream and downstream characteristic waves respectively includes: Taking the zero-crossing times of the upstream and downstream characteristic waves as the starting points, and taking multiple time series points within the preset interval length as the intercepted objects, intercepting an upstream envelope interval array from the upstream envelope array and a downstream envelope interval array from the downstream envelope array; Determining any one of the upstream envelope interval array and the downstream envelope interval array as the first envelope interval array, and determining the remaining one as the second envelope interval array.
5. The method according to claim 1, characterized in that The calculating of the envelope difference arrays between the first envelope interval array and the second envelope interval array, the pre-offset envelope interval array, and the post-offset envelope interval array respectively includes: Normalizing the first envelope interval array based on the maximum envelope value of the echo signal corresponding to the first envelope interval array to obtain a first envelope ratio array; Based on the maximum envelope value of the echo signal corresponding to the second envelope interval array, normalize the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array respectively to obtain a second envelope ratio array, a front envelope ratio array, and a rear envelope ratio array; Calculate the envelope difference arrays between the first envelope ratio array and the second envelope ratio array, the front envelope ratio array, and the rear envelope ratio array respectively.
6. The method according to claim 1, wherein The determining the flight time of the ultrasonic flowmeter according to the envelope difference array includes: Respectively determine the maximum difference and / or the cumulative value of the differences in each of the envelope difference arrays, and based on a plurality of the maximum differences and / or the cumulative values of the differences, determine one of the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array as the target envelope interval array; Based on the target envelope interval array and the up and down characteristic waves, determine the target up and down characteristic waves; According to the zero-crossing times of the target up and down characteristic waves, determine the flight time of the ultrasonic flowmeter.
7. The method according to claim 6, characterized in that, The determining one of the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array as the target envelope interval array based on a plurality of the maximum differences and / or the cumulative values of the differences includes: Determine the envelope difference array to which the smallest value among the plurality of maximum differences belongs as the target envelope difference array, and determine the target envelope interval array based on the target envelope difference array; or, Determine the envelope difference array to which the smallest value among the plurality of cumulative values of the differences belongs as the target envelope difference array, and determine the target envelope interval array based on the target envelope difference array; or, Based on the maximum difference threshold interval, determine the target maximum difference among the plurality of maximum differences, and determine the target envelope interval array based on the target maximum difference; or, Based on the cumulative value of the difference threshold interval, determine the target cumulative value of the differences among the plurality of cumulative values of the differences, and determine the target envelope interval array based on the target cumulative value of the differences.
8. A flight time determination device for an ultrasonic flowmeter, characterized in that, Including: A signal acquisition module, configured to acquire the up and down echo signals of the ultrasonic flowmeter and determine the up and down envelope arrays corresponding to the up and down echo signals; wherein, the envelope array includes the envelope lines between a plurality of consecutive local wave peak points; A characteristic wave identification module, configured to determine the up and down characteristic waves based on the up and down envelope arrays, and the zero-crossing times of the up and down characteristic waves respectively; A first truncation module, configured to respectively truncate from the up and down envelope arrays to obtain a first envelope interval array and a second envelope interval array according to a preset interval length and the zero-crossing times of the up and down characteristic waves respectively; A second truncation module, configured to perform a time sequence advance offset and a time sequence lag offset of an integer wave cycle on the truncation interval of the second envelope interval array, and truncate to obtain a front offset envelope interval array and a rear offset envelope interval array; A determination module, configured to calculate envelope difference arrays between the first envelope interval array and the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array respectively, and determine the flight time of the ultrasonic flowmeter according to the envelope difference arrays.
9. An electronic device, comprising: A processor and a memory storing a program, characterized in that the program includes instructions that, when executed by the processor, cause the processor to execute the method according to any one of claims 1-7.
10. A non-transitory machine-readable medium storing computer instructions, characterized in that, The computer instructions are used to cause a computer to execute the method according to any one of claims 1-7.
Citation Information
Patent Citations
Ultrasonic flowmeter time difference stable measurement method based on envelope threshold-peak value method
CN113758543A
Flow velocity measurement method, device and equipment and readable storage medium
CN117686734A
Method for measuring flight time of ultrasonic flow sensor
CN117906692A
Method, device and equipment for identifying wrong waves of ultrasonic flowmeter and storage medium
CN118274932A
Fluid metering method and device, computer equipment and storage medium
CN119147057A
Cited By
Method and device for detecting internal defects of lithium ion battery
CN121068750A
Flight time difference calculation method of ultrasonic flowmeter and related equipment
CN121558137A
A time-of-flight difference calculation method for an ultrasonic flow meter and related apparatus
CN121558137B