Method for determining flight time of ultrasonic flowmeter and related equipment
By obtaining and processing the envelope array of up and downward echo signals in an ultrasonic flowmeter, identifying feature waves and calculating the envelope difference value, the problem of time-of-flight calculation deviation is solved, and higher measurement accuracy and anti-interference ability are achieved.
Patent Information
- Application Number
- CN202510847886.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-06-24
AI Technical Summary
Under factors such as 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 envelope array of up and downward echo signals, identifying the characteristic waves and calculating the zero-crossing time, combining the preset interval length and the offset of the integer wave period, 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 application scenarios.
Smart Images

Figure CN120352015B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of ultrasonic measurement, and in particular to a method for determining the flight time of an ultrasonic flowmeter and related equipment. Background Art
[0002] Ultrasonic flow meters (such as ultrasonic gas meters and ultrasonic water meters) are devices that use ultrasonic waves to measure fluids (gases and liquids). Due to their advantages such as small size and light weight, no mechanical wear, long service life, and high measurement accuracy, they have been widely used in industries such as industry, energy, and environmental protection. The measurement principle of ultrasonic flow meters 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, a threshold method is typically used to identify the characteristic waves of ultrasonic signals and calculate the time of flight. While this method is simple and fast, it relies heavily on the stability of the echo signal and the rationality of the threshold setting, resulting in poor interference resistance. In practical applications, the waveform of the ultrasonic signal may be distorted due to factors such as external electromagnetic interference, transducer aging, flow field instability, and temperature fluctuations. This can easily lead to misidentification of the characteristic waves, resulting in deviations in the time of flight calculation, which in turn affects the accuracy of fluid flow measurement. Summary of the Invention
[0004] The embodiments of the present disclosure provide a method for determining the flight time of an ultrasonic flowmeter and related equipment, which at least solve the problem that the flight time calculation method in the related art is subject to the error wave phenomenon, resulting in deviations in the flight time calculation, affecting the measurement accuracy of the fluid flow, and leading to a narrow application scenario of the ultrasonic flowmeter.
[0005] To solve the above-mentioned problem, one aspect of an embodiment of the present disclosure provides a method for determining the flight time of an ultrasonic flowmeter, comprising: obtaining uplink and downlink echo signals of the ultrasonic flowmeter, and determining uplink and downlink envelope arrays corresponding to the uplink and downlink echo signals; wherein the envelope arrays include envelope lines between multiple consecutive local wave peak points; based on the uplink and downlink envelope arrays, determining the uplink and downlink characteristic waves, as well as the zero-crossing times of the uplink and downlink characteristic waves; according to a preset interval length and the zero-crossing times of the uplink and downlink characteristic waves, respectively, intercepting a first envelope interval array and a second envelope interval array from the uplink and downlink envelope arrays; performing a timing advance offset and a timing lag offset on the intercepted interval of the second envelope interval array by an integer wave period, and obtaining a front offset envelope interval array and a rear offset envelope interval array; calculating 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, and determining the flight time of the ultrasonic flowmeter based on the envelope difference arrays.
[0006] In some embodiments, the echo signal includes multiple sampling points. Determining uplink and downlink envelope arrays corresponding to the uplink and downlink echo signals includes performing the following steps on the uplink and downlink echo signals, respectively: determining multiple local maxima in the echo signal, performing nonlinear curve fitting on the multiple local maxima to obtain multiple continuous local wave peaks; and interpolating the peaks of adjacent local waves to segmentally generate envelopes between the peaks of adjacent local waves to obtain an envelope array.
[0007] In some of the embodiments, based on the uplink and downlink envelope arrays, the uplink and downlink characteristic waves, as well as the respective zero-crossing times of the uplink and downlink characteristic waves are determined, including: 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 a preset uplink and downlink maximum envelope value ratio, and the uplink and downlink maximum envelope values; and respectively determining the respective zero-crossing times of the uplink and downlink characteristic waves.
[0008] In some embodiments, according to the preset interval length and the zero-crossing time of the upper and lower characteristic waves, a first envelope interval array and a second envelope interval array are respectively intercepted from the upper and lower envelope arrays, including: taking the zero-crossing time of the upper and lower characteristic waves as the starting point, taking multiple timing points within the preset interval length as the interception objects, intercepting the upper envelope interval array from the upper envelope array, and intercepting the lower envelope interval array from the lower envelope array; determining any one of the upper envelope interval array and the lower envelope interval array as the first envelope interval array, and determining the remaining one as the second envelope interval array.
[0009] In some embodiments, envelope difference arrays are calculated 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, including: 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; normalizing the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array 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 calculating 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 embodiments, the flight time of the ultrasonic flowmeter is determined based on the envelope difference array, including: determining the maximum difference and / or the difference cumulative value in each envelope difference array respectively, and based on multiple maximum differences and / or difference cumulative 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; determining the target up and down characteristic waves based on the target envelope interval array and the up and down characteristic waves; and determining the flight time of the ultrasonic flowmeter based on the zero crossing time of the target up and down characteristic waves.
[0011] In some embodiments, based on multiple maximum differences and / or difference accumulation values, one of the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array is determined as the target envelope interval array, including: determining the envelope difference array to which the minimum 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 minimum value among the multiple difference accumulation 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 difference accumulation threshold interval, determining the target difference accumulation value among the multiple difference accumulation values, and determining the target envelope interval array based on the target difference accumulation value.
[0012] In one aspect of an embodiment of the present disclosure, a device for determining the flight time of an ultrasonic flowmeter is provided, comprising: a signal acquisition module for acquiring uplink and downlink echo signals of the ultrasonic flowmeter and determining uplink and downlink envelope arrays corresponding to the uplink and downlink echo signals; wherein the envelope array comprises envelope lines between a plurality of consecutive local wave peak points; a characteristic wave identification module for determining uplink and downlink characteristic waves and respective zero-crossing times of the uplink and downlink characteristic waves based on the uplink and downlink envelope arrays; a first interception module for determining the flight time of the uplink and downlink characteristic waves based on a preset interval length and respective zero-crossing times of the uplink and downlink characteristic waves; The zero-crossing time is respectively intercepted from the upper and lower envelope arrays to obtain the first envelope interval array and the second envelope interval array; the second interception module is used to perform a timing advance offset and a timing lag offset on the intercepted interval of the second envelope interval array by an integer wave period, and intercept to obtain the front offset envelope interval array and the rear offset envelope interval array; the determination module is used to calculate the envelope difference array 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, and determine the flight time of the ultrasonic flowmeter according to the envelope difference array.
[0013] One aspect of an embodiment of the present disclosure provides an electronic device including: a processor and a memory storing a program, wherein the program includes instructions, and when the instructions are executed by the processor, the processor executes any one of the methods for determining the flight time of an acoustic wave flow meter.
[0014] One aspect of an embodiment of the present disclosure provides a non-transitory machine-readable medium storing computer instructions, where the computer instructions are used to cause a computer to execute any one of the methods for determining the time of flight of an acoustic wave flow meter.
[0015] The method disclosed herein determines the uplink and downlink envelope arrays of the uplink and downlink echo signals, then intercepts one of the uplink and downlink envelope arrays multiple times, with each interception interval offset by an integer wave period in different timing directions. The other of the uplink and downlink envelope arrays is also intercepted. Next, the envelope difference between the first envelope interval array and the second envelope interval array, as well as the envelope difference between the first and second envelope interval arrays, is compared. Based on this envelope difference, characteristic wave misidentification (i.e., false wave phenomenon) caused by signal distortion or noise interference can be identified and reduced, thereby improving the measurement accuracy of time-of-flight. By improving the accuracy of time-of-flight and enhancing the anti-interference capability of the calculation process, the measurement accuracy and reliability of ultrasonic flowmeters can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] To more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other embodiments based on these drawings without inventive effort.
[0017] Figure 1 The figure shows a flow chart of determining the flight time of an ultrasonic flow meter provided by an embodiment of the present disclosure.
[0018] Figure 2 Shown is a schematic diagram of the waveform and envelope of the echo signal provided by an embodiment of the present disclosure.
[0019] Figure 3 FIG2 is a flow chart of the steps of determining uplink and downlink envelope arrays corresponding to uplink and downlink echo signals provided by an embodiment of the present disclosure.
[0020] Figure 4 The figure shows a flow chart of determining the uplink and downlink characteristic waves and the zero-crossing time steps of the uplink and downlink characteristic waves based on the uplink and downlink envelope arrays provided by an embodiment of the present disclosure.
[0021] Figure 5The figure shows a flow chart of the steps of obtaining the first envelope interval array and the second envelope interval array from the uplink and downlink envelope arrays according to the preset interval length and the zero-crossing time of the uplink and downlink characteristic waves, respectively, provided by an embodiment of the present disclosure.
[0022] Figure 6 The figure shows a flow chart of the steps of calculating the envelope difference array 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 provided by an embodiment of the present disclosure.
[0023] Figure 7 The figure shows a flow chart of the steps of determining the flight time of an ultrasonic flow meter based on an envelope difference array provided by an embodiment of the present disclosure.
[0024] Figure 8 Shown is a structural schematic diagram of a flight time determination device for an ultrasonic flow meter provided in one embodiment of the present disclosure.
[0025] Figure 9 Shown is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] The following will clearly and completely describe the technical solutions in the embodiments of the present disclosure in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0027] In related technologies, a threshold method is often used to identify the characteristic waves of ultrasonic signals and thus calculate the flight time. The principle of the threshold method is to set a preset threshold. When the amplitude of the received signal first exceeds this threshold, the system records this moment as the reference point for the ultrasonic flight time.
[0028] The threshold method has certain defects. For example, noise generated by the environment or internal circuits may cause the signal to reach the threshold prematurely, resulting in premature triggering. If the threshold is set too high, the direct wave may be missed and the "wrong wave" on the reflected path may be selected. Because these wrong waves may have higher amplitudes, they will cause erroneous time measurements. Temperature and pressure changes will affect the gas density and sound speed, thereby changing the amplitude and waveform of the signal, which may cause the set threshold to no longer be appropriate and affect the measurement accuracy.
[0029] The threshold method is highly dependent on the stability of the echo signal and the rationality of the threshold setting, and has poor anti-interference capabilities. In practical applications, the ultrasonic signal waveform may be distorted due to factors such as external electromagnetic interference, transducer aging, flow field instability, and temperature changes. This can easily lead to false waves when identifying characteristic waves based on the threshold method, resulting in deviations in flight time calculations and affecting the accuracy of fluid flow measurement.
[0030] Taking ultrasonic gas meters as an example, with the widespread use of natural gas in urban gas, the industry has placed higher demands on the metering accuracy and reliability of gas meters. Ultrasonic gas meters must maintain high-precision measurement capabilities under various complex operating conditions while also possessing excellent anti-interference capabilities and long-term stability. The limitations of the time-of-flight method based on the threshold method have limited the application scenarios of ultrasonic flow meters.
[0031] Furthermore, the problem of wave error is not limited to simple signal delays; it also involves misjudgment of signal characteristics due to changes in external conditions, and the resulting inaccurate time-of-flight measurements. To address this issue, related technologies often use more advanced signal processing algorithms, dynamic threshold adjustment methods, automatic gain control (AGC) technology, and optimized hardware design to ensure that direct wave signals can be accurately captured even in complex environments, thereby improving the reliability and accuracy of ultrasonic flow measurement. However, this leads to high power consumption and high cost of ultrasonic flow meters, low efficiency in time-of-flight calculation, and difficulty in ensuring the accuracy of time-of-flight calculations.
[0032] In order to solve the above problems, the present disclosure provides a method for determining the flight time of an ultrasonic flow meter, such as Figure 1 As shown, the method for determining the flight time of the ultrasonic flow meter includes the following steps.
[0033] S110, obtaining uplink and downlink echo signals of the ultrasonic flowmeter, and determining uplink and downlink envelope arrays corresponding to the uplink and downlink echo signals.
[0034] Specifically, the uplink and downlink echo signals (hereinafter collectively referred to as echo signals) represent the uplink echo signal and the downlink echo signal. The ultrasonic flowmeter transmits and receives ultrasonic signals in the downstream (downstream) and upstream (upstream) directions, respectively, through an ultrasonic transducer. The uplink echo signal is the ultrasonic signal received by the ultrasonic transducer when the ultrasonic wave propagates upstream in the fluid being measured; the downlink echo signal is the ultrasonic signal received by the ultrasonic transducer when the ultrasonic wave propagates downstream in the fluid being measured.
[0035] Next, an analog-to-digital converter (ADC) converts the collected uplink and downlink echo signals into digital form. At this point, the waveforms of the uplink and downlink echo signals are actually composed of multiple discrete sampling points, 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 (hereinafter collectively referred to as "envelope arrays") represent the uplink and downlink envelope arrays. The envelope arrays include envelope lines between multiple consecutive local peak points. Envelope lines can be determined using methods such as interpolation and curve fitting, which are not specifically limited in this disclosure.
[0037] like Figure 2 As shown in FIG, an envelope is constructed between two adjacent local peak points (indicated by “*”) by an interpolation method. Here, the envelope is composed of multiple interpolation points (indicated by “·”) and sampling points located at the local peak values.
[0038] The envelope curve reflects the overall variation trend and amplitude range of the echo signal, facilitating subsequent characteristic wave identification and zero-crossing time determination. Furthermore, even in complex scenarios such as unstable flow fields, transducer aging, or temperature fluctuations, the envelope array can effectively extract echo signal features, expanding the method's applicable scenarios.
[0039] S120, determining the uplink and downlink characteristic waves, and the respective zero-crossing times of the uplink and downlink characteristic waves based on the uplink and downlink envelope arrays.
[0040] The uplink and downlink characteristic waves (collectively referred to as characteristic waves) represent the uplink and downlink characteristic waves. A characteristic wave is a waveform portion of an echo signal that represents its key characteristics. The envelope array allows for clearer identification of characteristic waves from echo signals, helping to reduce misjudgments caused by noise and signal distortion.
[0041] Next, the zero-crossing time of each of the uplink and downlink characteristic waves may be determined based on the uplink and downlink characteristic waves.
[0042] For example, 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 point 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 impose specific restrictions on this.
[0043] S130 , according to the preset interval length and the zero-crossing time of the uplink and downlink characteristic waves, respectively, extracting a first envelope interval array and a second envelope interval array from the uplink and downlink envelope arrays.
[0044] The preset interval length can be determined based on the error range of the error wave. For example, if the error wave error range is small, a smaller preset interval length can be selected; if the error wave error range is large, a larger preset interval length can be selected. For example, half a wave cycle, one or more wave cycles can be selected as the preset interval length.
[0045] Starting from the zero-crossing time of the upstream characteristic wave, a partial envelope line with a duration equal to the preset interval length is extracted from the envelope line of the upstream envelope array. Starting from the zero-crossing time of the downstream characteristic wave, a partial envelope line with a duration equal to the preset interval length is extracted from the envelope line of the downstream envelope array. One of the partial envelope lines in the upstream envelope array and the partial envelope lines in the downstream envelope array is used as the first envelope interval array, and the other is used as the second envelope interval array.
[0046] S140 , performing a timing advance offset and a timing lag offset of an integer wave period on the truncated interval of the second envelope interval array, and obtaining a front offset envelope interval array and a rear offset envelope interval array.
[0047] The truncated interval of the second envelope interval array is subjected to a timing advance offset and a timing lag offset of an integer wave period. Based on the truncated interval after the timing advance and timing lag offsets, the envelope array corresponding to the second envelope interval array is truncated again to obtain a forward offset envelope interval array and a backward offset envelope interval array, respectively. The truncated interval is the time range corresponding to the second envelope interval array.
[0048] The phenomenon of missed waves often results in characteristic wave identification being advanced or delayed by one or more integer wave periods. To prevent this phenomenon during characteristic wave identification, the disclosed embodiment extracts a leading offset envelope interval array, a second envelope interval array, and a trailing offset envelope interval array from the uplink or downlink envelope array, each of which is sequentially offset by an integer wave period, and verifies each of these interval arrays.
[0049] According to a specific implementation of the present disclosure, a timing advance offset and a timing lag offset of one integer wave cycle may be first performed, followed by a subsequent verification step (i.e., step S150 described below). If the target characteristic wave cannot be identified, a timing advance offset and a timing lag offset of two integer wave cycles may be performed, followed by a subsequent verification step.
[0050] According to another specific implementation of the disclosed embodiment, if the error range cannot be determined or is deemed to be large, multiple consecutive integer-cycle timing advance and delay offsets can be performed simultaneously. For example, by performing timing advance offsets of one cycle, two cycles, and three cycles, respectively, on the intercepted intervals of the second envelope interval array, three sets of pre-offset envelope interval arrays can be obtained. Simultaneously, by performing timing delay offsets of one cycle, two cycles, and three cycles, three sets of post-offset envelope interval arrays can be obtained. The subsequent envelope difference array calculation and flight time determination steps can then be performed.
[0051] S150, calculating 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, and determining 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 an 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 an 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 an envelope difference array corresponding to the post-offset envelope interval array.
[0053] In the disclosed embodiments, the envelope difference array reflects the differences in signal characteristics under different offset conditions. Therefore, by comparing the envelope differences under different offset conditions, it is possible to effectively identify and eliminate false positives caused by noise or signal distortion. Subsequently, the ultrasonic flowmeter's time of flight is determined, and measurement errors caused by false positives are corrected, thereby improving the accuracy and reliability of the ultrasonic flowmeter's measurement results.
[0054] In the disclosed embodiment, the uplink and downlink envelope arrays of the uplink and downlink echo signals are first determined. Multiple intercepts are performed on one of the uplink and downlink envelope arrays, with each interception interval offset by an integer wave period in different timing directions. The other of the uplink and downlink envelope arrays is also intercepted. By comparing the envelope differences between the first envelope interval array and the second envelope interval array, as well as the front and rear offset envelope interval arrays, the envelope differences can be used to identify and reduce characteristic wave misidentification (i.e., false wave phenomenon) caused by signal deformation or noise interference, thereby improving the measurement accuracy of the time of flight. By improving the accuracy of the time of flight and enhancing the anti-interference capability of the calculation process, the measurement accuracy and reliability of the ultrasonic flowmeter can be improved.
[0055] The following continues to introduce the specific implementation of each step in the method for determining the flight time of an ultrasonic flow meter.
[0056] Figure 3 FIG. 1 is a flow chart of the steps of determining the uplink and downlink envelope arrays corresponding to the uplink and downlink echo signals provided by an embodiment of the present disclosure. Figure 3 As 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 may be performed for the uplink echo signal and the downlink echo signal respectively.
[0057] S111 , determining a plurality of local maxima in the echo signal, performing nonlinear curve fitting on the plurality of local maxima, and obtaining a plurality of continuous local wave peaks.
[0058] The echo signal includes multiple sampling points. Based on the multiple sampling points, multiple local maximum values in the echo signal can be determined.
[0059] Specifically, the following methods can be used to extract local maxima from echo signals: (1) Derivative-based methods: Based on multiple sampling points in the echo signal, the first-order derivative of the echo signal is calculated, and the point where the derivative is zero is regarded as the local maximum; (2) Threshold-based methods: A threshold is set, and sampling points above the threshold are regarded as local maxima. It should be noted that other extreme value detection methods can also be used to extract local maxima from echo signals.
[0060] Next, a nonlinear curve fitting is performed on multiple local maxima to calculate the peak values of multiple continuous local waves in the echo signal. The following fitting methods can be used: (1) Parabola fitting: Fit the local maximum points by a quadratic polynomial, and determine the peak value of the local wave based on the quadratic polynomial obtained by fitting; continue to refer to Figure 2 , Figure 2 In the waveform diagram shown, the peak value of the local wave indicated by "*" is determined by parabola fitting; (2) Gaussian fitting: Assuming that the data near the local maximum follows a Gaussian distribution, the parameters of the Gaussian function are fitted by the nonlinear least squares method, and the peak value of the local wave is determined based on the fitted Gaussian function. It should be pointed out that other nonlinear curve fitting methods can also be used to determine the peak value of the local wave; (3) Cosine fitting: Assuming that the data near the local maximum follows a cosine distribution, the local maximum point is fitted by a cosine function, and the peak value of the local wave is determined based on the fitted cosine function.
[0061] By extracting local maxima, key feature points in the echo signal can be quickly located, providing a foundation for subsequent nonlinear curve fitting. The fitting results obtained using nonlinear curve fitting can more accurately restore the peak value of the local wave and reduce the error caused by fragmented sampling.
[0062] S112 , performing interpolation processing on the peak values of adjacent local waves, and generating envelopes between the peak values of adjacent local waves in segments to obtain an envelope array.
[0063] For any pair of adjacent local wave peaks among multiple consecutive local wave peaks, an interpolation operation can be performed according to the positions and numerical relationship of the two peaks to obtain a local envelope between the adjacent local wave peaks.
[0064] Specifically, the steps of constructing the local envelope may include: for any pair of adjacent local waves, first calculating the difference ratio between the adjacent local wave peaks to determine the rising or falling trend of the local wave; then using an interpolation method to generate the amplitude of the sampling point between the adjacent local wave peaks (wherein commonly used interpolation methods include linear interpolation, spline interpolation, etc.).
[0065] Finally, all local envelopes are stitched together in sequence to form a complete envelope array.
[0066] Based on the above settings, constructing an envelope array effectively filters out noise and interference signals, enhancing signal stability. The envelope array clearly reflects the key signal characteristics, facilitating subsequent characteristic wave identification and zero-crossing time determination. The segmented envelope array accurately restores the true waveform of the echo signal, avoiding the effects of discrete sampling and reducing measurement errors caused by echo signal deformation.
[0067] The following continues to introduce the specific implementation method of determining the uplink and downlink characteristic waves based on the uplink and downlink envelope arrays.
[0068] Figure 4 FIG. 1 is a flow chart of determining the uplink and downlink characteristic waves and their respective zero-crossing time steps based on the uplink and downlink envelope arrays provided by an embodiment of the present disclosure. Figure 4 As shown, based on the uplink and downlink envelope arrays, determining the uplink and downlink characteristic waves, and the zero-crossing time steps of the uplink and downlink characteristic waves respectively includes the following steps.
[0069] S121, determining uplink and downlink maximum envelope values corresponding to the uplink and downlink echo signals according to the uplink and downlink envelope arrays.
[0070] The maximum envelope values of the uplink and downlink (hereinafter referred to as the maximum envelope values) are selected from the uplink and downlink envelope arrays respectively. The maximum envelope value reflects the strongest feature of the echo signal and is the basis for subsequent identification of characteristic waves.
[0071] S122 , identifying uplink and downlink characteristic waves from the uplink and downlink echo signals according to a preset uplink and downlink maximum envelope value ratio and the uplink and downlink maximum envelope values.
[0072] After determining the maximum uplink and downlink envelope values, thresholds for identifying the uplink and downlink characteristic waves are determined based on the preset ratio of the maximum uplink and downlink envelope values. By traversing the uplink and downlink envelope arrays and addressing waveforms exceeding the corresponding thresholds, the uplink characteristic wave in the uplink echo signal and the downlink characteristic wave in the downlink echo signal are respectively obtained.
[0073] 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, and the present disclosure does not impose any specific limitation on this.
[0074] S123, determining the zero-crossing time of the uplink and downlink characteristic waves.
[0075] Based on the zero-crossing detection method, the zero-crossing time of the uplink characteristic wave and the zero-crossing time of the downlink characteristic wave are obtained from the uplink and downlink characteristic waves, respectively. For example, the following methods can be used: (1) the zero-crossing time is determined by 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 the intersection point is the zero-crossing time); (2) the zero-crossing time is determined by interpolating the sampling points near the zero-crossing point (such as quadratic interpolation or cosine interpolation) 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 impose specific restrictions on this.
[0076] In this disclosed embodiment, the maximum envelope value and maximum envelope value ratio are used to identify the characteristic wave in the echo signal, improving the accuracy of characteristic wave identification. Next, based on the zero-crossing time of the characteristic wave, multiple time points within a preset interval length are used as interception targets to obtain the first envelope interval array and the second envelope interval array. This method ensures accuracy while reducing data processing and improving verification efficiency. This is described in detail below.
[0077] Figure 5 The figure shows a flow chart of the steps of obtaining the first envelope interval array and the second envelope interval array from the uplink and downlink envelope arrays according to the preset interval length and the zero-crossing time of the uplink and downlink characteristic waves, provided by an embodiment of the present disclosure. Figure 5 As shown, according to the preset interval length and the zero-crossing time of the uplink and downlink characteristic waves, the steps of respectively cutting out the first envelope interval array and the second envelope interval array from the uplink and downlink envelope arrays include the following steps.
[0078] S131, taking the zero-crossing time of the upper and lower characteristic waves as the starting point, taking multiple timing points within the preset interval length as the interception objects, intercepting the upper envelope interval array from the upper envelope array, and intercepting the lower envelope interval array from the lower envelope array.
[0079] The following operations are performed on the uplink and downlink envelope arrays: Starting from the zero-crossing time of the characteristic wave, multiple time points within a preset interval length are extracted from the envelope array. The multiple time points extracted from the uplink envelope array are used as the uplink envelope interval array, and the multiple time points extracted from the downlink envelope interval array are used as the downlink envelope interval array.
[0080] Specifically, since the envelope array includes envelope lines between multiple continuous local peak points constructed in segments, the corresponding partial envelope line in the preset interval length is composed of multiple timing points; wherein the multiple timing 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 a first envelope interval array, and determine the remaining one as a second envelope interval array.
[0082] Exemplarily, the uplink envelope interval array can be used as the first envelope interval array, and the downlink envelope interval array can be used as the second envelope interval array; alternatively, the downlink envelope interval array can be used as the first envelope interval array, and the uplink envelope interval array can be used as the second envelope interval array.
[0083] In the disclosed embodiment, using multiple timing points within a preset interval length as interception targets can reduce data processing volume and improve verification efficiency. Furthermore, the purpose of selecting interception targets is to ensure that envelope interval arrays representing the same interval segment (or the same series of timing points) are intercepted from the upstream and downstream envelope arrays. This ensures that the comparison scales of the first envelope interval array, the second envelope interval array, and the front and rear offset envelope interval arrays obtained by offsetting the second envelope interval array are consistent. This ensures that the calculated envelope difference array can be used to determine whether a wave is misaligned.
[0084] Therefore, the multiple time points in the above-mentioned intercepted object can be multiple continuous sampling points or interpolation points, or can be sampling points or interpolation points selected intermittently from the same sequence. According to another specific embodiment of the present disclosure, the multiple time points in the above-mentioned intercepted object can also directly select multiple key feature points within the above-mentioned 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, the interception interval of the second envelope interval array is subjected to a timing advance offset and a timing lag offset of an integer wave period, and multiple timing points within the interception interval after the offset are intercepted respectively to obtain the front offset envelope interval array and the rear offset envelope interval array.
[0086] According to another specific implementation of the embodiment of the present disclosure, after the first envelope interval array and the second envelope interval array are respectively intercepted from the uplink envelope array and the downlink envelope array according to the preset interval length, the first envelope interval array and the second envelope interval array can also be simultaneously subjected to a timing advance offset and a timing lag offset of an integer wave period.
[0087] To ensure verification accuracy, the number of integer wave cycles corresponding to the timing advance offset and timing lag offset can be increased, for example, by one integer wave cycle and two integer wave cycles, respectively, and then by one integer wave cycle and two integer wave cycles, respectively. The envelope differences between multiple envelope interval arrays intercepted from the uplink envelope array and multiple envelope interval arrays intercepted from the downlink envelope array are then determined to verify whether there is a mismatch. The following describes the specific implementation methods for calculating the envelope difference and verifying whether there is a mismatch based on the envelope difference.
[0088] Figure 6 The figure shows a flow chart of steps for calculating the envelope difference array 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 provided by an embodiment of the present disclosure. Figure 6 As shown, the steps of calculating the envelope difference array 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 include the following steps.
[0089] S610 , performing normalization processing on 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.
[0090] Based on the maximum envelope value of the echo signal belonging to the first envelope interval array, the amplitude of each point in the first envelope interval array is normalized, and the amplitude of the first envelope interval array is unified to the same reference (usually between 0 and 1) to obtain a first envelope ratio array.
[0091] S620, based on the maximum envelope value of the echo signal corresponding to the second envelope interval array, the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array are respectively normalized to obtain the second envelope ratio array, the front envelope ratio array, and the rear envelope ratio array.
[0092] Similarly, based on the maximum envelope value of the echo signal belonging to the second envelope interval array, the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array are normalized respectively to obtain the second envelope ratio array, the front envelope ratio array, and the rear envelope ratio array.
[0093] S630: Calculate 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.
[0094] Subtract the first envelope ratio array from the second envelope ratio array to obtain an envelope difference array between the first and second envelope ratio arrays. Similarly, obtain an envelope difference array between the first envelope ratio array and the front envelope ratio array, and an envelope difference array between the first envelope ratio array and the back envelope ratio array.
[0095] In the disclosed embodiment, by normalizing the values in the envelope interval array, comparison errors caused by differences in signal strength are eliminated. Furthermore, the normalized envelope ratio array facilitates direct comparison and more accurately reflects differences in signal characteristics under different offset conditions. The envelope difference array calculated in this manner, because it can quantify signal changes under different offset conditions, provides a more reliable basis for flight time determination and enhances the reliability of flight time.
[0096] Figure 7 FIG. 1 is a flow chart showing the steps of determining the flight time of an ultrasonic flowmeter according to an envelope difference array provided by an embodiment of the present disclosure. Figure 7 As shown, the step of determining the flight time of the ultrasonic flowmeter according to the envelope difference array includes the following steps.
[0097] S710, respectively determine the maximum difference and / or difference accumulation value in each envelope difference array, and based on multiple maximum differences and / or difference accumulation 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 embodiment, envelope difference arrays are obtained between the first envelope interval array and the second envelope interval array, the front offset envelope interval array, and the back offset envelope interval array. Next, for each envelope difference array, the largest value is used as the maximum difference value of that envelope difference array, and the sum of the envelope differences in that envelope difference array is used as the accumulated difference value of that envelope difference array.
[0099] Based on the maximum difference and / or the accumulated difference value, the one with the smallest difference from the first envelope interval array is selected from the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array as the target envelope interval array.
[0100] Here, the target envelope interval array can be determined only based on multiple maximum difference values, or only based on multiple difference cumulative values; alternatively, the weight between the maximum difference value and the difference cumulative value can be determined, and the target envelope interval array can be comprehensively determined based on multiple maximum difference values and multiple difference cumulative values. The present disclosure does not impose any specific restrictions on this.
[0101] S720: Determine target uplink and downlink characteristic waves based on the target envelope interval array and the uplink and downlink characteristic waves.
[0102] The target uplink and downlink characteristic waves represent the target uplink characteristic wave and the target downlink characteristic wave.
[0103] After determining the target envelope interval array, the target envelope interval array can be used to determine whether the previously determined uplink and downlink characteristic waves have an error problem. If an error problem exists, the selected intervals of the uplink and downlink characteristic waves are offset and adjusted to obtain the target uplink and downlink characteristic waves.
[0104] Specifically, if the target envelope interval array is the second envelope interval array, it means that the characteristic wave identified in the above steps is relatively accurate and there is no problem of wrong waves. In this case, the uplink characteristic wave can be directly determined as the target uplink characteristic wave, and the downlink characteristic wave can be determined as the target downlink characteristic wave.
[0105] If the target envelope interval array is not the second envelope interval array, there is a wave error. Adjust the selected interval for the characteristic wave corresponding to the target envelope interval array based on the integer wave period and offset direction. The selected interval refers to the time range corresponding to the original upward or downward characteristic wave.
[0106] Specifically, if the target envelope interval array is a forward-offset envelope interval array, the selected interval for the characteristic wave corresponding to the forward-offset envelope interval array needs to be adjusted forward (or leftward) by a corresponding integer wave period. The partial echo signal within the adjusted selected interval, along with the characteristic wave corresponding to the first envelope interval array, is used as the target uplink and downlink characteristic waves, respectively. Similarly, if the target envelope interval array is a backward-offset envelope interval array, the selected interval for the characteristic wave corresponding to the backward-offset envelope interval array needs to be adjusted backward (or rightward) by a corresponding integer wave period.
[0107] The distance and direction of the characteristic wave that need to be adjusted are consistent with the offset distance and offset direction of the intercepted interval when intercepting the target envelope interval array.
[0108] S730: Determine the flight time of the ultrasonic flowmeter according to the zero-crossing time of the target uplink and downlink characteristic waves.
[0109] After the above steps, there is no error in the target uplink and downlink characteristic waves. Therefore, the zero-crossing time of the target uplink and downlink characteristic waves can be determined, and the flight time of the ultrasonic flowmeter can be further determined.
[0110] In the embodiment of the present disclosure, the envelope difference array is used to identify and eliminate the possible wave error problem in the process of determining the uplink and downlink characteristic waves, thereby improving the accuracy of the final zero-crossing time and thereby improving the measurement accuracy and reliability of the ultrasonic flowmeter.
[0111] The following further introduces a specific implementation method of determining the target envelope interval array based on the maximum difference and / or the difference accumulation value.
[0112] According to a specific implementation of an embodiment of the present disclosure, step S710 in the above embodiment can be specifically implemented as: determining the envelope difference value array to which the minimum value among multiple maximum differences belongs as the target envelope difference value array, and determining the target envelope interval array based on the target envelope difference value array.
[0113] In the above embodiment, the maximum difference values of the plurality of envelope difference value arrays are obtained, the envelope difference value array to which the smallest maximum difference value belongs is determined as the target envelope difference value array, and the envelope interval array corresponding to the target envelope difference value array is determined as the target envelope interval array.
[0114] According to another specific implementation of the embodiment of the present disclosure, step S710 in the above embodiment can be specifically implemented as: determining the envelope difference array to which the minimum value among multiple difference accumulated 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 embodiment, the difference accumulation values of the plurality of envelope difference arrays are obtained, the envelope difference array to which the smallest difference accumulation value belongs is determined as the target envelope difference array, and the envelope interval array corresponding to the target envelope difference array is determined as the target envelope interval array.
[0116] In addition to the above method for determining a target envelope interval array, an embodiment of the present disclosure further provides a method for determining a target envelope interval array based on a preset threshold interval, and the specific implementation method is as follows.
[0117] According to another specific implementation of the embodiment of the present disclosure, step S710 in the above embodiment can be specifically implemented as follows: based on the maximum difference threshold interval, determine the target maximum difference among multiple maximum differences, and determine the target envelope interval array based on the target maximum difference.
[0118] First, a maximum difference threshold interval is preset. The left and right endpoints of the maximum difference threshold interval are empirically determined and can be adjusted based on actual operating conditions. If the maximum difference corresponding to the envelope difference array falls within the maximum difference threshold interval, 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 of the embodiment of the present disclosure, step S710 in the above embodiment can be specifically implemented as follows: based on the difference cumulative value threshold interval, determine the target difference cumulative value among multiple difference cumulative values, and determine the target envelope interval array based on the target difference cumulative value.
[0120] First, a threshold interval for cumulative difference values is preset. The left and right endpoints of the threshold interval are empirically determined and can be adjusted based on actual operating conditions. If the cumulative difference value corresponding to the envelope difference array falls within the threshold interval, the cumulative difference value is determined as the target cumulative difference value, and the envelope interval array corresponding to the target cumulative difference 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, the smallest one is selected as the target maximum difference value or target difference accumulation value.
[0122] When the maximum difference or the difference accumulation value falls within the corresponding threshold interval, it can be considered that the maximum difference or the difference accumulation value is relatively reasonable, that is, the gap between the two envelope interval arrays corresponding to the maximum difference or the difference accumulation value is within a reasonable range.
[0123] To facilitate setting of the maximum difference threshold interval or the difference accumulation threshold interval, the envelope difference array in the above step may be an envelope difference array calculated between envelope ratio arrays obtained by normalization based on the maximum envelope value.
[0124] The method for determining the time-of-flight of an ultrasonic flowmeter provided in the embodiments of the present disclosure utilizes a technical approach to determining the time-of-flight of an ultrasonic flowmeter based on an envelope difference array, overcoming the problem in related technologies of the error wave phenomenon causing deviations in the time-of-flight calculation, affecting the measurement accuracy of fluid flow, and resulting in a narrow range of application scenarios for ultrasonic flowmeters. By determining the uplink and downlink envelope arrays corresponding to the uplink and downlink echo signals, and performing periodic offset interception on the uplink and downlink envelope arrays, and by comparing the differences between the uplink and downlink envelope interval arrays at different periodic offsets, the uplink and downlink characteristic waves are verified, overcoming the error wave phenomenon, and thereby achieving the technical effect of improving the accuracy of target characteristic wave identification, improving the accuracy of flight time calculation, improving the accuracy of fluid flow measurement, and expanding the applicable scenarios of ultrasonic flight devices.
[0125] Combined with the above Figures 1 to 7 The method embodiment of the present disclosure is described in detail. Figure 8 It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, and therefore, for parts not described in detail, reference can be made to the previous method embodiment.
[0126] Figure 8 FIG. 1 is a schematic diagram of the structure of a flight time determination device for an ultrasonic flowmeter according to an embodiment of the present disclosure. Figure 8 As shown, the flight time determination device 800 of the ultrasonic flow meter 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 used to obtain the uplink and downlink echo signals of the ultrasonic flowmeter and determine the uplink and downlink envelope arrays corresponding to the uplink and downlink echo signals; wherein the envelope array includes envelope lines between multiple consecutive local peak points.
[0128] The characteristic wave identification module 820 is used to determine the uplink and downlink characteristic waves, and the zero-crossing time of the uplink and downlink characteristic waves based on the uplink and downlink envelope arrays.
[0129] The first interception module 830 is used to intercept the first envelope interval array and the second envelope interval array from the uplink and downlink envelope arrays according to the preset interval length and the zero-crossing time of the uplink and downlink characteristic waves.
[0130] The second interception module 840 is used to perform a timing advance offset and a timing lag offset on the intercepted interval of the second envelope interval array by an integer wave period, and intercept to obtain a front offset envelope interval array and a rear offset envelope interval array.
[0131] The determination module 850 is used to calculate the envelope difference array 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, and determine the flight time of the ultrasonic flowmeter based on the envelope difference array.
[0132] In some of the embodiments, the signal acquisition module 810 is also used to perform the following steps for the uplink echo signal and the downlink echo signal respectively: determine multiple local maxima in the echo signal, perform nonlinear curve fitting on the multiple local maxima to obtain multiple continuous local wave peaks; interpolate the peaks of adjacent local waves, and generate envelope lines between the peaks of adjacent local waves in segments to obtain an envelope array.
[0133] In some of the embodiments, the characteristic wave identification module 820 is also used to determine the uplink and downlink maximum envelope values corresponding to the uplink and downlink echo signals based on the uplink and downlink envelope arrays; identify the uplink and downlink characteristic waves from the uplink and downlink echo signals based on the preset uplink and downlink maximum envelope value ratios and the uplink and downlink maximum envelope values; and determine the zero-crossing time of the uplink and downlink characteristic waves respectively.
[0134] In some of the embodiments, the first interception module 830 is further used to, with the zero-crossing time of each of the upper and lower characteristic waves as the starting point, and with multiple timing points within a preset interval length as interception objects, intercept an upper envelope interval array from the upper envelope array, and intercept a lower envelope interval array from the lower envelope array; determine any one of the upper envelope interval array and the lower envelope interval array as the first envelope interval array, and determine the remaining one as the second envelope interval array.
[0135] In some embodiments, the determination module 850 is further used 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 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 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.
[0136] In some embodiments, the determination module 850 is also used to respectively determine the maximum difference and / or the difference cumulative value in each envelope difference array, and based on multiple maximum differences and / or difference cumulative 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 uplink and downlink characteristic waves based on the target envelope interval array and the uplink and downlink characteristic waves; and determine the flight time of the ultrasonic flowmeter according to the zero-crossing time of the target uplink and downlink characteristic waves.
[0137] In some embodiments, the determination module 850 is further configured to determine the envelope difference value array to which the minimum value among multiple maximum difference values belongs as the target envelope difference value array, and determine the target envelope interval array based on the target envelope difference value array; or, determine the envelope difference value array to which the minimum value among multiple difference accumulation values belongs as the target envelope difference value array, and determine the target envelope interval array based on the target envelope difference value array; or, determine the target maximum difference value among multiple maximum difference values based on the maximum difference threshold interval, and determine the target envelope interval array based on the target maximum difference value; or, determine the target difference accumulation value among 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] An embodiment of the present disclosure further provides a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to perform the method of the embodiment of the present disclosure.
[0139] Illustratively, the non-transitory machine-readable medium may be a memory chip, a memory card, etc., which may be applied to an ultrasonic flow meter.
[0140] The present disclosure also provides a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to perform the method of the present disclosure. The computer program product should be understood as a software product that primarily implements the method of any of the above embodiments of the present disclosure through the computer program.
[0141] An embodiment of the present disclosure also provides an electronic device, comprising: at least one processor, and a memory storing a computer program that can be executed by the at least one processor, wherein the computer program comprises instructions, and when the instructions are executed by the processor, the processor executes the method in any of the above embodiments.
[0142] Illustratively, the electronic device may be an ultrasonic flow meter.
[0143] refer to Figure 9 , a structural block diagram of an electronic device that can serve as a server or client of an embodiment of the present disclosure will now be described, which 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 laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, 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 required herein.
[0144] like Figure 9 As shown, the electronic device includes a processor unit 901, which can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of processor unit 901 include, but are not limited to, an MCU, a CPU, a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing units, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor unit 901 is used to perform the various methods and processes described above. For example, in some embodiments, the method embodiments of the present disclosure may be implemented as a computer program tangibly embodied in a machine-readable medium, such as an external storage unit 907. In some embodiments, part or all of the computer program may 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 may be configured to perform the above-described methods by any other suitable means (e.g., via firmware).
[0145] Specifically, the processor unit 901 can perform various appropriate actions and processes based on a computer program stored in a local storage unit 902 (which can be a ROM storage unit or other device with storage capabilities) or a computer program loaded from an external storage unit 907 into the local storage unit 902 (such as random access memory (RAM)). The local storage unit 902 can also store various programs and data required for the operation of the electronic device. 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 within 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 capable of inputting information into the electronic device. The input unit 905 can receive input numeric or character information and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 906 can be any type of device capable of presenting information and may 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 may include, but is not limited to, a magnetic disk or an optical disk. The communication unit 908 allows the electronic device to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks, and may 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 may be written in any combination of one or more programming languages. These computer programs may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer programs are executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0148] In the context of the embodiments of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may 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 machine-readable storage media 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), optical fibers, 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 variations used in the embodiments of the present disclosure are open inclusions, 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 other embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "multiple" mentioned in the embodiments of the present disclosure are illustrative and not restrictive. Those skilled in the art should understand that unless the context clearly indicates otherwise, 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 information and data used for analysis, information and data stored, information and data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant information and data must comply with the relevant laws, regulations and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0151] The various steps described in the method implementation methods provided in the embodiments of the present disclosure may be performed in different orders and / or in parallel. In the apparatus and method of the present disclosure, each component or each step may be decomposed and / or reassembled, and these decompositions and / or reassemblies shall be considered equivalents of the present disclosure. In addition, the method implementation methods may include additional steps and / or omit the steps shown. The scope of protection of the present disclosure is not limited in this respect.
[0152] The term "embodiment" in this specification refers to specific features, structures or characteristics described in conjunction with the embodiment that can be included in at least one embodiment of the present disclosure. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. The various embodiments in this specification are described in a related manner, and the same or similar parts between the various embodiments are referenced to each other. In particular, for the device, equipment, and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment.
[0153] The above embodiments merely illustrate several embodiments of the present disclosure, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of protection. It should be noted that a person of ordinary skill in the art would be able to make numerous variations and improvements without departing from the spirit of the present disclosure, all of which fall within the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure shall be determined by the appended claims.
Claims
1. A method for determining the flight time of an ultrasonic flowmeter, characterized in that: include: Acquire uplink and downlink echo signals of the ultrasonic flowmeter, and determine uplink and downlink envelope arrays corresponding to the uplink and downlink echo signals; wherein the envelope array includes envelope lines between a plurality of consecutive local peak points; Determining the uplink and downlink characteristic waves, and the respective zero-crossing times of the uplink and downlink characteristic waves based on the uplink and downlink envelope arrays; According to the preset interval length and the zero-crossing time of the uplink and downlink characteristic waves, respectively, a first envelope interval array and a second envelope interval array are obtained from the uplink and downlink envelope arrays; Performing a timing advance offset and a timing lag offset of an integer wave period on the intercepted interval of the second envelope interval array, and obtaining a front offset envelope interval array and a rear offset envelope interval array; Calculating 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, and determining the flight time of the ultrasonic flowmeter based on the envelope difference arrays; wherein the envelope difference arrays are obtained by calculating the differences 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; Determining the flight time of the ultrasonic flowmeter according to the envelope difference array includes: Determining the maximum difference and / or the difference cumulative value in each of the envelope difference arrays respectively, and 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 multiple maximum differences and / or difference cumulative values; Determining target uplink and downlink characteristic waves based on the target envelope interval array and the uplink and downlink characteristic waves; The flight time of the ultrasonic flowmeter is determined according to the zero-crossing time of the target uplink and downlink characteristic waves.
2. The method according to claim 1, characterized in that The echo signal includes multiple sampling points; the determining of the uplink and downlink envelope arrays corresponding to the uplink and downlink echo signals includes: The following steps are performed for the uplink echo signal and the downlink echo signal respectively: determining a plurality of local maxima in the echo signal, performing nonlinear curve fitting on the plurality of local maxima to obtain a plurality of continuous local wave peaks; The peak values of adjacent local waves are interpolated, and envelope lines between the peak values of adjacent local waves are generated in segments to obtain an envelope array.
3. The method according to claim 1, characterized in that The determining of the uplink and downlink characteristic waves and the respective zero-crossing times of the uplink and downlink characteristic waves based on the uplink and downlink envelope arrays 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 and obtaining the uplink and downlink characteristic waves from the uplink and downlink echo signals according to a preset uplink and downlink maximum envelope value ratio and the uplink and downlink maximum envelope values; The zero-crossing time of the uplink and downlink characteristic waves is determined respectively.
4. The method according to claim 1, wherein The method of obtaining a first envelope interval array and a second envelope interval array from the uplink and downlink envelope arrays according to the preset interval length and the zero-crossing time of the uplink and downlink characteristic waves respectively includes: Taking the zero-crossing time of each of the uplink and downlink characteristic waves as the starting point and multiple time sequence points within the preset interval length as the interception objects, the uplink envelope interval array is intercepted from the uplink envelope array, and the downlink envelope interval array is intercepted from the downlink envelope array; Any one of the uplink envelope interval array and the downlink envelope interval array is determined as the first envelope interval array, and the remaining one is determined as the second envelope interval array.
5. The method according to claim 1, wherein The step of calculating 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 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, the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array are respectively normalized to obtain a second envelope ratio array, a front envelope ratio array, and a rear envelope ratio array; Calculate 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, characterized in that The step of determining one of the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array as a target envelope interval array based on the plurality of maximum differences and / or difference accumulated values comprises: Determine the envelope difference value array to which the minimum value among the plurality of maximum differences belongs as the target envelope difference value array, and determine the target envelope interval array based on the target envelope difference value array; or, Determine the envelope difference value array to which the minimum value among the plurality of difference accumulated values belongs as the target envelope difference value array, and determine the target envelope interval array based on the target envelope difference value array; or, Determining a target maximum difference among the plurality of maximum differences based on a maximum difference threshold interval, and determining the target envelope interval array based on the target maximum difference; or, Based on the difference accumulated value threshold interval, a target difference accumulated value among the plurality of difference accumulated values is determined, and based on the target difference accumulated value, the target envelope interval array is determined.
7. A device for determining the time of flight of an ultrasonic flowmeter, characterized in that: include: A signal acquisition module, configured to acquire uplink and downlink echo signals of the ultrasonic flowmeter and determine uplink and downlink envelope arrays corresponding to the uplink and downlink echo signals; wherein the envelope array includes envelope lines between a plurality of consecutive local peak points; A characteristic wave identification module is used to determine the uplink and downlink characteristic waves and the zero-crossing time of the uplink and downlink characteristic waves based on the uplink and downlink envelope arrays; A first interception module is configured to intercept a first envelope interval array and a second envelope interval array from the uplink and downlink envelope arrays, respectively, according to a preset interval length and the zero-crossing time of the uplink and downlink characteristic waves; A second interception module is used to perform a timing advance offset and a timing lag offset on the interception interval of the second envelope interval array by an integer wave period, and intercept to obtain a front offset envelope interval array and a rear offset envelope interval array; a determination module, configured to calculate an envelope difference array between the first envelope interval array and each of the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array, and determine the flight time of the ultrasonic flowmeter based on the envelope difference array; wherein the envelope difference array is obtained by calculating the difference between the first envelope interval array and each of the second envelope interval array, the front offset envelope interval array, and the rear offset envelope interval array; Determining the flight time of the ultrasonic flowmeter according to the envelope difference array includes: Determining the maximum difference and / or the difference cumulative value in each of the envelope difference arrays respectively, and 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 multiple maximum differences and / or difference cumulative values; Determining target uplink and downlink characteristic waves based on the target envelope interval array and the uplink and downlink characteristic waves; The flight time of the ultrasonic flowmeter is determined according to the zero-crossing time of the target uplink and downlink characteristic waves.
8. An electronic device comprising: A processor and a memory storing a program, wherein the program comprises instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 6.
9. A non-transitory machine-readable medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Ultrasonic flowmeter time difference stable measurement method based on envelope threshold-peak value method
CN113758543A
Method for measuring flight time of ultrasonic flow sensor
CN117906692A