Time of flight calculation method for ultrasonic fluid metering apparatus, and related device

By processing the envelope and segmenting the period of the echo signal from the ultrasonic fluid metering device, the characteristic wave and period are identified, solving the problems of noise interference and wave skipping misjudgment, and realizing high-precision and stable time-of-flight calculation, which is suitable for various application scenarios.

WO2026158408A1PCT designated stage Publication Date: 2026-07-30HANGZHOU INNOVER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HANGZHOU INNOVER TECH CO LTD
Filing Date
2026-01-21
Publication Date
2026-07-30

AI Technical Summary

Technical Problem

Existing methods for calculating the time of flight of ultrasonic fluid metering devices suffer from high noise interference, wave skipping misjudgment, and computational burden, resulting in poor calculation accuracy and stability, and a narrow range of applicable scenarios.

Method used

By acquiring the echo signal from the ultrasonic fluid metering device, the envelope and phase are determined, and the envelope is periodically segmented to generate an envelope gradient line. The gradient difference between adjacent sub-envelope gradient lines is used to identify the characteristic wave and period, and the flight time is calculated by combining the phase and period of the characteristic wave.

Benefits of technology

It improves the accuracy and stability of time-of-flight calculation, reduces the computational burden, expands the applicable scenarios of the method, and enhances the system's noise resistance and real-time processing capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026074050_30072026_PF_FP_ABST
    Figure CN2026074050_30072026_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to a time of flight calculation method for an ultrasonic fluid metering apparatus, and a related device. The method comprises: acquiring an echo signal of an ultrasonic fluid metering apparatus, and determining the envelope and phase of the echo signal; performing periodic segmentation on the envelope to obtain an envelope gradient line, wherein each gradient value in the envelope gradient line is determined on the basis of the amplitude of the envelope in a corresponding period; in a rising interval of the envelope gradient line, on the basis of a gradient difference value between adjacent sub-envelope gradient lines, determining a characteristic wave and a characteristic wave period from the echo signal; and on the basis of the phase of the characteristic wave and the characteristic wave period, calculating the time of flight of the ultrasonic fluid metering apparatus. The method overcomes cycle-skipping misjudgment while avoiding noise interference, and improves the accuracy and stability of time of flight calculation.
Need to check novelty before this filing date? Find Prior Art

Description

A method for calculating the time of flight of an ultrasonic fluid metering device and related equipment.

[0001] This disclosure claims priority to Chinese Patent Application No. 202510103299.1, filed on January 22, 2025, the contents of which are incorporated herein by reference in their entirety. Technical Field

[0002] This disclosure relates to the field of ultrasonic metrology technology, and in particular to a method for calculating the flight time of an ultrasonic fluid metering device and related equipment. Background Technology

[0003] Ultrasonic fluid metering devices (such as ultrasonic gas meters and ultrasonic water meters, which are devices that use ultrasonic waves to measure fluids (gas and liquids)) have been widely used in industry, energy, environmental protection and other fields due to their advantages such as non-contact measurement, no moving parts, no pressure loss and extremely high metering accuracy. The metering principle of ultrasonic fluid metering devices is to estimate the instantaneous flow rate by using the difference in the flight time of ultrasonic waves in the direction of propagation in the forward and reverse directions.

[0004] In related technologies, thresholding, characteristic wave, and cross-correlation methods are commonly used to calculate the time of flight of ultrasonic fluid metering devices. Each of these methods has its own characteristics but also certain limitations. For example, the thresholding method is simple but easily affected by noise and environmental changes, resulting in poor accuracy and stability of the time of flight calculation. Although the characteristic wave method improves noise resistance, it is prone to periodic errors and wave skipping misjudgments, affecting the accuracy of the time of flight calculation. The cross-correlation method provides higher calculation accuracy but increases the computational burden, making it difficult to meet the requirements of real-time applications, and it also faces the wave skipping problem.

[0005] There is currently no effective solution to the aforementioned problems in the relevant technologies.

[0006] Summary of the Invention

[0007] The present disclosure provides a method and related equipment for calculating the flight time of an ultrasonic fluid metering device, which at least solves the problem that the flight time calculation methods provided by related technologies have poor accuracy and stability due to noise interference, wave skipping misjudgment, or high computational burden, and have a narrow range of applicable scenarios.

[0008] To address the aforementioned problems, one aspect of this disclosure provides a method for calculating the time of flight of an ultrasonic fluid metering device, the method comprising:

[0009] Acquire the echo signal from the ultrasonic fluid metering device and determine the envelope and phase of the echo signal;

[0010] The envelope is periodically segmented to obtain the envelope gradient line; where each gradient value in the envelope gradient line is determined based on the amplitude of the envelope line within the corresponding period.

[0011] In the rising region of the envelope gradient line, the characteristic wave and its period are determined from the echo signal based on the gradient difference between adjacent sub-envelope gradient lines.

[0012] The flight time of the ultrasonic fluid metering device is calculated based on the phase and period of the characteristic wave.

[0013] In some embodiments, the step of periodically segmenting the envelope to obtain the envelope gradient line includes:

[0014] The envelope is periodically segmented based on the first transformation point of the echo signal to obtain multiple first gradient lines; wherein, the echo signal includes multiple sampling signal points, and the first transformation point is the amplitude transformation point corresponding to the transformation of the signal amplitude of the sampling signal point from less than the average amplitude of the echo signal to greater than the average amplitude of the echo signal, and the average amplitude of the echo signal is the average value of the amplitudes of all sampling signal points in the echo signal;

[0015] By connecting multiple first gradient lines in sequence, the envelope gradient line corresponding to the echo signal is obtained.

[0016] In some embodiments, the step of periodically segmenting the envelope to obtain the envelope gradient line further includes:

[0017] The envelope is periodically segmented based on the second transformation point of the echo signal to obtain multiple second gradient lines; wherein, the echo signal includes multiple sampling signal points, and the second transformation point is the phase transformation point corresponding to the signal phase of the sampling signal point transforming from negative phase to positive phase;

[0018] By connecting multiple second gradient lines in sequence, the envelope gradient line corresponding to the echo signal is obtained.

[0019] In some embodiments, the step of determining the characteristic wave and its period from the echo signal based on the gradient difference between adjacent sub-envelope gradient lines in the rising region of the envelope gradient line includes:

[0020] In the rising region of the envelope gradient line, the gradient difference between adjacent sub-envelope gradient lines is calculated; wherein, within the rising region of the envelope gradient line, the gradient values ​​corresponding to adjacent sub-envelope gradient lines are in an increasing relationship.

[0021] If the gradient difference is greater than a preset gradient difference threshold, then the sub-envelope gradient line with the larger gradient value among the adjacent sub-envelope gradient lines is identified as the target sub-envelope gradient line. The wave corresponding to the target sub-envelope gradient line in the echo signal is identified as the characteristic wave, and the period of the target sub-envelope gradient line is identified as the characteristic wave period. The preset gradient difference threshold is determined based on the maximum amplitude of the envelope line.

[0022] In some embodiments, the step of calculating the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave includes:

[0023] Based on the amplitude extrema points corresponding to the echo signals within the characteristic wave period, find the target sampled signal point closest to the amplitude extrema points;

[0024] Based on the phase of the amplitude extreme point and the phase of the target sampling signal point, the peak time corresponding to the peak value of the characteristic wave is calculated by linear fitting. Based on the characteristic wave period and the peak time, the first characteristic point time of the echo signal is calculated.

[0025] The flight time of the ultrasonic fluid metering device is obtained by adding the time of the first feature point to the ADC capture delay time.

[0026] In some embodiments, the step of calculating the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave further includes:

[0027] Determine the first and second sampling points with opposite phase signs during the process of the signal phase in the echo signal changing from negative to positive phase within the characteristic wave period;

[0028] Based on the phase of the first sampling point and the phase of the second sampling point, the zero-crossing time of the characteristic wave is calculated by linear fitting. Based on the zero-crossing time and the period of the characteristic wave, the time of the second characteristic point corresponding to the echo signal is calculated.

[0029] The flight time of the ultrasonic fluid metering device is obtained by adding the second feature point time to the ADC capture delay time.

[0030] In some embodiments, the steps of determining the envelope and phase of the echo signal include:

[0031] Signal processing is performed on the echo signal to determine its envelope and phase; the signal processing includes any one of the following: Hilbert transform processing, analytic signal transform processing, wavelet transform processing, short-time Fourier transform processing, fast Fourier transform processing, and adaptive filter processing.

[0032] To address the aforementioned problems, one aspect of this disclosure provides a time-of-flight calculation system for an ultrasonic fluid metering device, the system comprising:

[0033] The signal acquisition module is configured to acquire the echo signal from the ultrasonic fluid metering device and determine the envelope and phase of the echo signal.

[0034] The envelope gradient line determination module is configured to periodically segment the envelope line to obtain the envelope gradient line; wherein, each gradient value in the envelope gradient line is determined based on the amplitude of the envelope line within the corresponding period;

[0035] The characteristic wave determination module is set to determine the characteristic wave and its period from the echo signal based on the gradient difference between adjacent sub-envelope gradient lines in the rising region of the envelope gradient line.

[0036] The flight time calculation module is designed to calculate the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave.

[0037] To address the aforementioned problems, one aspect of this disclosure provides an electronic device, including: a processor and a memory storing a program, the program including instructions that, when executed by the processor, cause the processor to perform the time-of-flight calculation method of any of the above-described ultrasonic fluid metering devices.

[0038] To address the aforementioned problems, one aspect of this disclosure provides a non-transient machine-readable medium storing computer instructions configured to cause a computer to execute the time-of-flight calculation method for any of the aforementioned ultrasonic fluid metering devices.

[0039] The beneficial effects of this embodiment are as follows: By acquiring the echo signal of an ultrasonic fluid metering device, the envelope and phase of the echo signal are determined; the envelope is periodically segmented to obtain an envelope gradient line; wherein, each gradient value in the envelope gradient line is determined based on the amplitude of the envelope within the corresponding period; in the rising region of the envelope gradient line, the characteristic wave and its period are determined from the echo signal based on the gradient difference between adjacent sub-envelope gradient lines; and the flight time of the ultrasonic fluid metering device is calculated based on the phase and period of the characteristic wave, this technique overcomes the problems in related technologies where the accuracy and stability of flight time calculation are poor due to noise interference, wave skipping misjudgment, or high computational burden, resulting in a narrow range of applicable scenarios. This method achieves the technical effect of obtaining the envelope gradient line by periodically segmenting the envelope of the echo signal, and then accurately determining the characteristic wave based on the gradient difference between adjacent sub-envelope gradient lines. This avoids noise interference and overcomes wave skipping misjudgment, and directly calculates the flight time based on the phase and period of the characteristic wave, thereby reducing the computational burden, improving the accuracy and stability of flight time calculation, and expanding the applicable scenarios of the method.

[0040] Details of one or more embodiments of this disclosure are set forth in the following drawings and description to make other features, objects and advantages of this disclosure more readily apparent.

[0041] Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.

[0043] Figure 1 is a schematic flowchart of the flight time calculation method of an ultrasonic fluid metering device according to an embodiment of the present disclosure.

[0044] Figure 2 is a schematic diagram of the waveform of the echo signal and the envelope corresponding to the echo signal in one embodiment of the present disclosure.

[0045] Figure 3 is a schematic diagram of the waveform of the echo signal and the envelope gradient line corresponding to the echo signal in one embodiment of the present disclosure.

[0046] Figure 4 is a schematic diagram of the time-of-flight calculation system of an ultrasonic fluid metering device according to an embodiment of the present disclosure.

[0047] Figure 5 is a schematic diagram of the structure of the electronic device disclosed herein.

[0048] Detailed Implementation

[0049] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0050] Thresholding method, characteristic wave method, and cross-correlation method are some of the most commonly used methods in correlation techniques for calculating the time of flight of ultrasonic fluid metering devices. Among them,

[0051] Threshold method: This is a direct and simple method that determines the arrival time of ultrasound waves based on the point in time when the received signal amplitude exceeds a preset threshold. Specifically, when the amplitude of the received signal first exceeds this threshold, the system records this moment as a reference point for the ultrasound time of flight. Disadvantages: Noise from the environment or internal circuitry may cause the signal to reach the threshold prematurely, leading to premature triggering; if the threshold is set too high, it may miss the direct wave and select "jumping waves" on the reflected path, as these jumping waves may have higher amplitudes, resulting in incorrect time measurements; temperature and pressure changes affect gas density and sound velocity, thus altering the signal amplitude and waveform, which may cause the set threshold to become inappropriate, affecting measurement accuracy.

[0052] The characteristic wave method determines the arrival time of ultrasound by identifying specific features (such as wave crests, zero-crossing points, etc.) in the received signal. This method attempts to utilize the unique properties of the signal to improve its resistance to noise and other interference. Limitations: For high-frequency signals, if similar features exist across multiple cycles, features from subsequent cycles may be mistakenly identified as the first arriving signal, causing measurement errors. Additional signals generated by the reflection path may also contain features similar to the direct wave, leading to feature identification errors and affecting the accuracy of the time-of-flight method.

[0053] Cross-correlation method: This method uses the cross-correlation function between the transmitted and received signals to find the optimal matching position, thereby determining the time of flight of the ultrasonic wave. It considers the entire signal shape rather than a single point, theoretically handling noise better and providing more accurate measurement results. Limitations: Calculating the cross-correlation function requires significant computational resources, making it difficult to meet the requirements of real-time applications, especially with limited hardware resources. To ensure measurement accuracy, the transmitted and received signals must maintain high consistency and stability; any deviation can affect the measurement results. Although the cross-correlation method can effectively reduce the impact of noise, it is still difficult to completely avoid wave skipping caused by strong reflections or multipath effects. Especially when the intensity of the reflected wave is close to or even exceeds that of the direct wave, the cross-correlation peak may be misleading, leading to incorrect time measurements.

[0054] In summary, the flight time calculation methods for ultrasonic fluid metering devices provided in related technologies mainly suffer from poor accuracy and stability in flight time calculation, and have a narrow range of applicable scenarios.

[0055] To address the aforementioned problems, this disclosure provides a method for calculating the flight time of an ultrasonic fluid metering device, as shown in Figure 1. The method for calculating the flight time of the ultrasonic fluid metering device mainly includes:

[0056] Step S101: Obtain the echo signal from the ultrasonic fluid metering device and determine the envelope and phase of the echo signal.

[0057] The envelope reflects the overall trend of signal amplitude change over time, rather than each instantaneous value. Therefore, it can smooth out short-term fluctuations caused by environmental noise or other interference factors. Thus, by determining the envelope of the echo signal, high-frequency noise can be effectively filtered out. The phase provides important clues about the signal's arrival time and frequency components. Therefore, retaining the signal's phase information while extracting the envelope helps to more accurately identify characteristic waves and their periods.

[0058] The above settings preprocess the original echo signal to determine the envelope and phase. Further processing of the envelope can then accurately identify the characteristic wave and its period. The phase and period of the characteristic wave can then be used to calculate the time of flight, improving the accuracy of characteristic wave identification, overcoming wave skipping, and ultimately achieving the goal of improving the accuracy of time of flight calculation.

[0059] According to embodiments of this disclosure, an ADC (Analog-to-Digital Converter) can be used to sample the echo signal of an ultrasonic fluid metering device to obtain the echo signal waveform shown in Figure 2. In the schematic diagram shown in Figure 2, the horizontal axis represents the sampling time, and the vertical axis represents the amplitude corresponding to the sampling signal point. It should be noted that the echo signal waveform is actually composed of multiple discrete sampling signal points. When the sampling target is the ultrasonic echo signal in the downstream direction, the obtained data is a series of downstream sampling points arranged in chronological order. These downstream sampling points together constitute a downstream sampling sequence, meaning the corresponding echo signal is actually multiple discrete sampling signal points in a downstream sampling sequence. When the sampling target is the ultrasonic echo signal in the upstream direction, the obtained data is a series of upstream sampling points ordered in chronological order. These upstream sampling points constitute a downstream sampling sequence, meaning the corresponding echo signal is actually multiple discrete sampling signal points in a downstream sampling sequence. Each sampling point represents the amplitude of the ultrasonic signal at a specific time.

[0060] According to a specific embodiment of the present disclosure, the echo signal can be filtered by a bandpass filter during the acquisition process to reduce noise impact and improve the signal-to-noise ratio.

[0061] In some embodiments, the steps of determining the envelope and phase of the echo signal include: performing signal processing on the echo signal to determine the envelope and phase of the echo signal; wherein the signal processing includes any one of Hilbert transform processing, analytic signal transform processing, wavelet transform processing, short-time Fourier transform processing, fast Fourier transform processing, and adaptive filter processing.

[0062] The scheme disclosed herein allows for the extraction of envelope and phase using different signal processing methods, such as Hilbert transform, wavelet transform, and short-time Fourier transform. This flexibility allows for the selection of the most suitable algorithm based on the specific application scenario, further optimizing measurement performance. It should be noted that the specific signal processing method chosen depends on factors such as application requirements, signal characteristics, and computational resources. For example, for applications like ultrasonic gas meters, if real-time processing is required and computational resources are limited, the computationally simple energy operator method can be chosen; while for situations requiring high-precision analysis, wavelet transform may be a better choice. Each method has its unique advantages and limitations, and a comprehensive consideration should be made based on the specific circumstances in practical applications.

[0063] Step S102: Periodically segment the envelope to obtain the envelope gradient line; wherein, each gradient value in the envelope gradient line is determined according to the amplitude of the envelope line within the corresponding period.

[0064] Based on the above settings, by periodically segmenting the envelope and generating an envelope gradient line, not only is the accuracy of feature wave recognition enhanced, but noise interference is also effectively reduced, algorithm complexity is simplified, and the overall system performance is improved. This method lays a solid foundation for subsequent time-of-flight calculations, ensuring the high accuracy and reliability of the ultrasonic fluid metering device in various application scenarios.

[0065] Specifically, by periodically segmenting the envelope and calculating the gradient value within each period, the changing trend of the ultrasonic echo signal over time can be captured more precisely. Subsequent analysis of the envelope gradient line allows for accurate identification of characteristic waveforms in the signal, avoiding wave skipping and thus improving the accuracy of time-of-flight measurements. Furthermore, it is understandable that using the envelope gradient line significantly reduces the amount of data that needs to be processed compared to directly processing the raw sampling points.

[0066] According to embodiments of this disclosure, each gradient value in the envelope gradient line is determined based on the amplitude of the envelope line within the corresponding period. By retaining only one representative gradient value in each period, one period corresponds to one sub-envelope gradient line; or by retaining several representative gradient values, one period corresponds to multiple sub-envelope gradient lines, the computational complexity is greatly reduced and the real-time processing capability is improved.

[0067] On the other hand, the envelope gradient line also achieves a further smoothing of the envelope line. By analyzing the average rate of change within each period to represent the trend of the signal, it achieves a more effective filtering of high-frequency noise, making subsequent processing more stable and reliable.

[0068] Furthermore, the envelope gradient line provides a stable reference benchmark for subsequent characteristic wave detection. Even under complex environmental conditions, the gradient line, especially the rising region of the envelope gradient line, maintains a relatively consistent pattern of change. This promotes the consistency of measurement results and the repeatability of measurement operations, thereby improving the stability of time-of-flight calculation.

[0069] In some embodiments, the step of periodically segmenting the envelope to obtain the envelope gradient line includes: periodically segmenting the envelope based on the first transformation point of the echo signal to obtain multiple first gradient lines; wherein the echo signal includes multiple sampling signal points, the first transformation point is the amplitude transformation point corresponding to the transformation of the signal amplitude of the sampling signal point from less than the average amplitude of the echo signal to greater than the average amplitude of the echo signal, and the average amplitude of the echo signal is the average value of the amplitudes of all sampling signal points in the echo signal; and connecting the multiple first gradient lines sequentially to obtain the envelope gradient line corresponding to the echo signal.

[0070] The selection of the first transform point is based on the characteristic that the signal amplitude changes from below the average echo signal amplitude to above the average echo signal amplitude. On one hand, this effectively filters out low-amplitude components below the average echo signal amplitude. These components typically represent background noise or weak, non-characteristic signals that do not contribute to time-of-flight measurement and instead introduce interference, thus improving the signal-to-noise ratio and making subsequent processing more stable and reliable. On the other hand, it allows for rapid and accurate periodization of the echo signal. The first transform point, as a key reference point for period segmentation, can quickly and accurately determine the starting position of each period. This is because when the signal amplitude changes from below the average to above the average, it often marks the beginning of a new period or the appearance of an important characteristic waveform. This not only simplifies the algorithm's complexity but also improves the speed and accuracy of period segmentation. Precise period segmentation yields a clearer envelope gradient line, better capturing the characteristic waveforms in the signal, thus preparing for the accurate calculation of the time of flight.

[0071] Understandably, because the definition of the first transformation point depends on relative change—that is, change relative to the average amplitude rather than the absolute amplitude—this method is highly robust to signal fluctuations caused by environmental changes (such as temperature, pressure, etc.). This means that it can still provide consistent and reliable period division results even under different operating conditions.

[0072] This disclosure also provides a specific implementation method for periodically segmenting the envelope to obtain the envelope gradient line: First, the amplitude change point is defined as the sampling signal point corresponding to the change in signal amplitude from less than the average amplitude of the echo signal to greater than the average amplitude of the echo signal. Then, two consecutive amplitude change points n1 and n2 are found in the echo signal. The sampling time corresponding to the first amplitude change point n1 is taken as the starting point of the current period division, and the sampling time corresponding to the sampling signal point preceding the second amplitude change point n2 is taken as the ending point of the current period division. When only one sub-envelope gradient line is divided for a period, the average amplitude of the envelope line within the corresponding period can be used as the gradient value corresponding to the sub-envelope gradient line; when multiple sub-envelope gradient lines are divided for a period, the average amplitude of the envelope line within the current interval can be used as the gradient value corresponding to the sub-envelope gradient line for further division. It is understandable that the sampling time corresponding to the second amplitude change point n2 is the starting point of the next period division. Then, the endpoint of the current division period is connected to the starting point of the next division period to obtain the envelope gradient line. The schematic diagram of the obtained envelope gradient line is shown in Figure 3. The connection method can be a straight line connection or a smooth connection through linear fitting.

[0073] In some embodiments, the step of periodically segmenting the envelope to obtain the envelope gradient line further includes: periodically segmenting the envelope based on the second transformation point of the echo signal to obtain multiple second gradient lines; wherein the echo signal includes multiple sampling signal points, and the second transformation point is the phase transformation point corresponding to the signal phase of the sampling signal point transforming from negative phase to positive phase; and the multiple second gradient lines are connected sequentially to obtain the envelope gradient line corresponding to the echo signal.

[0074] Based on the above settings, this disclosure also provides another scheme for periodically dividing the envelope to obtain the envelope gradient line. The second transformation point, based on the clear physical characteristic that the signal phase changes from negative to positive, provides a very clear and stable basis for period division. This period boundary definition based on phase change is not easily affected by amplitude fluctuations and can effectively filter out noise components that do not affect the phase but may interfere with amplitude judgment, thereby making the system more stable and reducing the risk of misjudgment caused by noise.

[0075] This disclosure also provides another specific implementation method for periodically segmenting the envelope to obtain the envelope gradient line: First, the phase transition point is defined as the sampling signal point corresponding to the signal phase transitioning from negative to positive. Then, two consecutive change points m1 and m2 are found in the echo signal. The first phase transition point m1 is taken as the starting point of the current period division, and the previous sampling time of the second phase transition point m2 is taken as the ending point of the current period division.

[0076] Step S103: In the rising region of the envelope gradient line, the characteristic wave and the characteristic wave period are determined from the echo signal based on the gradient difference between adjacent sub-envelope gradient lines.

[0077] The rising region of the envelope gradient line typically corresponds to a rapid increase in signal energy and is one of the most significant regions of the characteristic waveform. The rising region of the envelope gradient line can be clearly identified by its changes. Within this rising region, the gradient values ​​of adjacent sub-envelope gradient lines show an increasing relationship. By determining the gradient difference between adjacent sub-envelope gradient lines within the rising region, accurate capture of the true characteristic wave is ensured, reducing false positives. Furthermore, the gradient difference-based selective method exhibits strong robustness to noise. Even in the presence of background noise, this method can still focus on meaningful gradient changes, thus ignoring low-amplitude noise components. This makes the system more stable and reliable, reducing the risk of false positives caused by noise.

[0078] In some embodiments, the step of determining the characteristic wave and its period from the echo signal based on the gradient difference between adjacent sub-envelope gradient lines in the rising region of the envelope gradient line includes: calculating the gradient difference between adjacent sub-envelope gradient lines in the rising region of the envelope gradient line; wherein, within the rising region of the envelope gradient line, the gradient values ​​corresponding to adjacent sub-envelope gradient lines are in an increasing relationship; determining whether the gradient difference is greater than a preset gradient difference threshold; if so, determining the target sub-envelope gradient line as the one with the larger gradient value among the adjacent sub-envelope gradient lines, determining the wave corresponding to the target sub-envelope gradient line in the echo signal as the characteristic wave, and determining the period of the target sub-envelope gradient line as the characteristic wave period; wherein, the preset gradient difference threshold is determined based on the maximum amplitude of the envelope line.

[0079] According to embodiments of this disclosure, the aforementioned preset gradient difference threshold is determined based on a certain proportion of the maximum amplitude of the envelope or the maximum amplitude of the echo signal. It is understood that, based on the desired characteristic wave—that is, the desired waveform after the normal arrival of the ultrasonic echo signal—the preset gradient difference threshold can be determined for different proportions of the maximum amplitude of the envelope. It is also understood that the specific selection of the desired characteristic wave can be determined in conjunction with the accuracy requirements of the ultimately calculated time of flight.

[0080] According to a specific embodiment of this disclosure, the rising region of the envelope gradient lines, which are divided into multiple (at least three) periodic segments, is determined. Within the rising region of the envelope gradient, the gradient difference between adjacent sub-envelope gradient lines is calculated. When the difference is greater than a preset gradient difference threshold, the adjacent sub-envelope gradient lines with the larger gradient value are identified as the target sub-envelope gradient line. The wave corresponding to the target sub-envelope gradient line in the echo signal is determined as the characteristic wave, as shown in Figure 3. It is worth noting that the preset gradient difference threshold for the echo signal propagating downstream and the preset gradient difference threshold for the echo signal propagating upstream are used in the same proportion to facilitate accurate calculation of the time difference between downstream and upstream propagation.

[0081] Based on the above settings, this disclosure provides specific steps for determining the characteristic wave and the period of the characteristic wave from the echo signal. By calculating the gradient difference between adjacent sub-envelope gradient lines and determining whether it exceeds a preset gradient difference threshold, the characteristic wave can be more accurately identified in the rising region of the envelope gradient line.

[0082] Since it only needs to focus on the case where the gradient difference is greater than the preset gradient difference threshold, unnecessary data processing is reduced, the computational efficiency of the algorithm is improved, it is suitable for real-time applications, and the applicable scenarios of the method are expanded.

[0083] Step S104: Calculate the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave.

[0084] By utilizing the phase and period information of characteristic waves, the arrival time and propagation path of ultrasonic signals can be determined more accurately, while eliminating errors caused by factors such as noise and reflected waves (bouncing waves), thereby improving the accuracy of time-of-flight measurements. Specifically, because the phase information of characteristic waves is highly robust to noise—phase changes are generally more stable than amplitude changes—the phase information can reliably reflect the actual state of the signal even in the presence of background noise, ensuring the stability of the measurement results. By focusing on the phase and period of characteristic waves, other non-characteristic signal components, such as noise or minor reflected waves, can be effectively ignored, further improving the system's anti-interference capability.

[0085] Based on the above description, it can be understood that since the phase and period of the characteristic wave reflect the overall characteristics of the signal, it has strong robustness to small fluctuations caused by factors such as temperature and pressure. This means that even under different working environments, this method can still provide relatively accurate measurement results, ensuring the long-term stability of the system. Compared to directly processing the raw sampled data, using the phase and period information of the characteristic wave for time-of-flight calculation greatly simplifies the algorithm. Only a few key parameters need to be processed to complete high-precision time-of-flight measurement, reducing the computational burden and improving real-time processing efficiency. Compared to traditional thresholding methods or other methods, the method based on the phase and period of the characteristic wave can provide a more stable time reference point, reducing random and systematic errors in time delay estimation.

[0086] In some embodiments, the step of calculating the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave includes: finding the target sampling signal point closest to the amplitude extremum point based on the amplitude extremum point corresponding to the echo signal within the characteristic wave period; calculating the peak time corresponding to the peak value of the characteristic wave by linear fitting based on the phase of the amplitude extremum point and the phase of the target sampling signal point; calculating the first characteristic point time of the echo signal based on the characteristic wave period and the peak time; and adding the first characteristic point time to the ADC capture delay time to obtain the flight time of the ultrasonic fluid metering device.

[0087] According to a specific embodiment of this disclosure, within a single characteristic wave period, the phase of the signal changes linearly with time. By using the phase of a local peak point and the phase of its adjacent sampling time, the maximum peak time of the characteristic wave can be calculated, thus obtaining the characteristic point time of the echo signal. Specifically, the amplitude extremum point of the characteristic wave period (i.e., the amplitude extremum point corresponding to the echo signal within the characteristic wave period) can be found first. Then, the sampling signal point whose amplitude is closest to that amplitude extremum point can be determined to further reduce the linearization error. Using the phase of that amplitude extremum point and the phase of the sampling signal point, the time of the maximum peak of the characteristic wave can be calculated by linear fitting. Finally, based on the period of the characteristic wave and the maximum peak time, the first characteristic point time of the echo signal is calculated. The first characteristic point time of the echo signal is added to the ADC capture delay time to obtain the flight time of the ultrasonic fluid metering device.

[0088] Based on the above settings, this disclosure provides a specific embodiment for calculating the flight time of an ultrasonic fluid metering device according to the phase and period of a characteristic wave. Specifically, the flight time is calculated by steps including finding the amplitude extrema corresponding to the echo signal within the characteristic wave period, calculating the peak time through linear fitting, and combining the characteristic wave period and ADC capture delay time. This method achieves high-precision flight time measurement, enhances the system's noise immunity, reduces computational complexity, and exhibits good adaptability to environmental changes. Specifically, based on the amplitude extrema corresponding to the echo signal within the characteristic wave period, the target sampling signal point closest to the amplitude extrema is found, and the peak time of the characteristic wave is calculated through linear fitting. Then, based on the characteristic wave period and the peak time, the first characteristic point time of the echo signal is calculated. This first characteristic point time is precisely calibrated and can better reflect the actual propagation time of the ultrasonic signal. This allows for a more accurate determination of the maximum energy point (i.e., peak value) of the characteristic wave, thus providing a stable time reference point. Compared to directly using the threshold method or other simpler methods, linear fitting using the phase information of the amplitude extrema and the target sampling signal point can more accurately estimate the arrival time of the characteristic wave, reducing random and systematic errors. Furthermore, the ADC acquisition delay time is taken into account; the time of the first characteristic point is added to the ADC acquisition delay time to obtain the final flight time of the ultrasonic fluid metering device. These steps ensure that all delay factors are considered throughout the measurement process, improving measurement accuracy.

[0089] In some embodiments, the step of calculating the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave further includes: determining a first sampling point and a second sampling point with opposite phase signs during the process of the signal phase in the echo signal changing from a negative phase to a positive phase within the characteristic wave period; calculating the zero-crossing time of the characteristic wave by linear fitting based on the phase of the first sampling point and the phase of the second sampling point; calculating the second characteristic point time corresponding to the echo signal based on the zero-crossing time and the characteristic wave period; and adding the second characteristic point time to the ADC capture delay time to obtain the flight time of the ultrasonic fluid metering device.

[0090] According to a specific embodiment of the present disclosure, two sampling signal points in the period of the characteristic wave whose phase changes from negative to positive can be found first. Using the phase of the two sampling signal points, the zero-crossing time of the characteristic wave is calculated by linear fitting. Based on the zero-crossing time of the characteristic wave and the period of the characteristic wave, the characteristic point time of the echo signal is calculated. The characteristic point time of the echo signal is added to the ADC capture delay time to obtain the flight time of the ultrasonic fluid metering device.

[0091] Based on the above settings, this disclosure provides another specific embodiment for calculating the flight time of an ultrasonic fluid metering device according to the phase and period of the characteristic wave. By determining the first and second sampling points with opposite phase signs corresponding to the process of the signal phase changing from negative to positive phase in the echo signal within the characteristic wave period, and calculating the zero-crossing time of the characteristic wave based on these points, the flight time is obtained. This method not only achieves high-precision flight time measurement, but also enhances the noise resistance of the system and reduces computational complexity.

[0092] Specifically, by identifying the first and second sampling points within the characteristic wave period—the two key points where the signal phase transitions from negative to positive—the zero-crossing time of the characteristic wave can be determined more accurately. The zero-crossing point is an important characteristic of ultrasonic signals; its position is relatively stable and easy to detect, thus providing a highly reliable time reference point. Furthermore, since the detection of the zero-crossing point is based on phase changes rather than amplitude changes, it exhibits strong robustness to noise. Compared to methods that rely solely on amplitude extrema, combining zero-crossing point detection further refines time measurements and reduces time delay estimation errors caused by signal asymmetry or other factors.

[0093] Among them, sampling points with opposite phase signs: by finding the first and second sampling points within the characteristic wave period where the signal phase changes from negative to positive, the zero-crossing time of the characteristic wave can be determined more accurately. The zero-crossing point is one of the important characteristics of a signal, and its position is relatively stable and easy to detect.

[0094] Linear fitting calculation: This method uses the phase information of the first and second sampling points to perform linear fitting, which can more accurately estimate the zero-crossing time of the characteristic wave and reduce random and systematic errors.

[0095] The second characteristic point time is calculated based on the zero-crossing time and the characteristic wave period to obtain the second characteristic point time corresponding to the echo signal. This second characteristic point time has been precisely calibrated and can better reflect the actual propagation time of the ultrasonic signal.

[0096] It should be noted that the first and second feature point times mentioned above refer to the feature point times calculated through different processing methods, that is, the arrival time of the first wave signal in the echo signal, rather than the two calculated feature point times.

[0097] The flight time calculation method for the ultrasonic fluid metering device provided in this embodiment involves acquiring the echo signal of the ultrasonic fluid metering device, determining the envelope and phase of the echo signal, periodically segmenting the envelope to obtain an envelope gradient line, wherein each gradient value in the envelope gradient line is determined based on the amplitude of the envelope line within the corresponding period, determining the characteristic wave and its period from the echo signal in the rising region of the envelope gradient line based on the gradient difference between adjacent sub-envelope gradient lines, and calculating the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave. This approach overcomes the problems of poor accuracy and stability in time-of-flight calculations and narrow applicability caused by noise interference, wave skipping misjudgment, or high computational burden in related technologies. It achieves the goal of obtaining envelope gradient lines by periodically segmenting the envelope of the echo signal, and then accurately determining the characteristic wave based on the gradient difference between adjacent sub-envelope gradient lines. This avoids noise interference and overcomes wave skipping misjudgment, and then directly calculates the time of flight based on the phase and period of the characteristic wave. This achieves the technical effect of reducing computational burden, improving the accuracy and stability of time-of-flight calculations, and expanding the applicability of the method.

[0098] Based on the flight time calculation method for the ultrasonic fluid metering device provided in the embodiments of this disclosure, the embodiments of this disclosure also provide a flight time calculation system for the ultrasonic fluid metering device, as shown in FIG4. The flight time calculation system 400 for the ultrasonic fluid metering device includes:

[0099] The signal acquisition module 401 is configured to acquire the echo signal from the ultrasonic fluid metering device and determine the envelope and phase of the echo signal.

[0100] The above settings preprocess the original echo signal to determine the envelope and phase. Further processing of the envelope can then accurately identify the characteristic wave and its period. The phase and period of the characteristic wave can then be used to calculate the time of flight, improving the accuracy of characteristic wave identification, overcoming wave skipping, and ultimately achieving the goal of improving the accuracy of time of flight calculation.

[0101] In some embodiments, the signal acquisition module 401 is further configured to perform signal processing on the echo signal to determine the envelope and phase of the echo signal; wherein the signal processing includes any one of Hilbert transform processing, analytic signal transform processing, wavelet transform processing, short-time Fourier transform processing, fast Fourier transform processing, and adaptive filter processing.

[0102] The scheme disclosed herein allows for the use of different signal processing methods to extract the envelope and phase, such as Hilbert transform, wavelet transform, and short-time Fourier transform. This flexibility allows for the selection of the most suitable algorithm based on the specific application scenario, further optimizing measurement performance. It should be noted that the specific signal processing method chosen depends on factors such as application requirements, signal characteristics, and computational resources.

[0103] The envelope gradient line determination module 402 is configured to perform periodic segmentation on the envelope line to obtain the envelope gradient line; wherein, each gradient value in the envelope gradient line is determined based on the amplitude of the envelope line within the corresponding period.

[0104] Based on the above settings, by periodically segmenting the envelope and generating an envelope gradient line, not only is the accuracy of feature wave recognition enhanced, but noise interference is also effectively reduced, algorithm complexity is simplified, and the overall system performance is improved. This method lays a solid foundation for subsequent time-of-flight calculations, ensuring the high accuracy and reliability of the ultrasonic fluid metering device in various application scenarios.

[0105] In some embodiments, the envelope gradient line determination module 402 is further configured to: periodically segment the envelope line based on the first transformation point of the echo signal to obtain multiple first gradient lines; wherein the echo signal includes multiple sampling signal points, the first transformation point is the amplitude transformation point corresponding to the transformation of the signal amplitude of the sampling signal point from less than the average amplitude of the echo signal to greater than the average amplitude of the echo signal, and the average amplitude of the echo signal is the average value of the amplitudes of all sampling signal points in the echo signal; the multiple first gradient lines are connected sequentially to obtain the envelope gradient line corresponding to the echo signal.

[0106] The above settings effectively filter out low-amplitude components below the average amplitude of the echo signal. These components typically represent background noise or weak, non-characteristic signals that contribute nothing to time-of-flight measurement and instead introduce interference, thus improving the signal-to-noise ratio and making subsequent processing more stable and reliable. Furthermore, the echo signal can be quickly and accurately divided into periods. The first transition point, serving as a key reference point for period segmentation, allows for rapid and accurate determination of the start position of each period. This is because when the signal amplitude changes from below the mean to above the mean, it often marks the beginning of a new period or the appearance of an important characteristic waveform. This not only simplifies the algorithm's complexity but also improves the speed and accuracy of period segmentation. Precise period segmentation yields clearer envelope gradient lines, better capturing characteristic waveforms in the signal and thus preparing for accurate time-of-flight calculations.

[0107] In some embodiments, the envelope gradient line determination module 402 is further configured to: periodically segment the envelope line based on the second transformation point of the echo signal to obtain multiple second gradient lines; wherein the echo signal includes multiple sampling signal points, and the second transformation point is the phase transformation point corresponding to the signal phase of the sampling signal point changing from negative phase to positive phase; and the multiple second gradient lines are connected sequentially to obtain the envelope gradient line corresponding to the echo signal.

[0108] Based on the above settings, this disclosure also provides another scheme for periodically dividing the envelope to obtain the envelope gradient line. The second transformation point, based on the clear physical characteristic that the signal phase changes from negative to positive, provides a very clear and stable basis for period division. This period boundary definition based on phase change is not easily affected by amplitude fluctuations and can effectively filter out noise components that do not affect the phase but may interfere with amplitude judgment, thereby making the system more stable and reducing the risk of misjudgment caused by noise.

[0109] The characteristic wave determination module 403 is configured to determine the characteristic wave and its period from the echo signal based on the gradient difference between adjacent sub-envelope gradient lines in the rising region of the envelope gradient line.

[0110] With the above settings, since the rising region of the envelope gradient line typically corresponds to the part where signal energy increases rapidly and is one of the most significant regions of the characteristic waveform, determining the gradient difference between adjacent sub-envelope gradient lines within the rising region of the envelope gradient line ensures accurate capture of the true characteristic wave and reduces misjudgments. Furthermore, the gradient difference-based selective method exhibits strong robustness to noise; even in the presence of background noise, this method can still focus on meaningful gradient changes, thereby ignoring low-amplitude noise components. This makes the system more stable and reliable, reducing the risk of misjudgments caused by noise.

[0111] In some embodiments, the feature wave determination module 403 is further configured to: calculate the gradient difference between adjacent sub-envelope gradient lines in the rising region of the envelope gradient line; wherein, within the rising region of the envelope gradient line, the gradient values ​​corresponding to adjacent sub-envelope gradient lines are in an increasing relationship; determine whether the gradient difference is greater than a preset gradient difference threshold; if so, determine that the adjacent sub-envelope gradient lines with the larger gradient value are the target sub-envelope gradient lines, determine that the wave corresponding to the target sub-envelope gradient line in the echo signal is the feature wave, and determine that the period of the target sub-envelope gradient line is the feature wave period; wherein, the preset gradient difference threshold is determined based on the maximum amplitude of the envelope line.

[0112] Based on the above settings, this disclosure provides specific steps for determining the characteristic wave and the period of the characteristic wave from the echo signal. By calculating the gradient difference between adjacent sub-envelope gradient lines and determining whether it exceeds a preset gradient difference threshold, the characteristic wave can be more accurately identified in the rising region of the envelope gradient line.

[0113] The flight time calculation module 404 is configured to calculate the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave.

[0114] By utilizing the phase and period information of characteristic waves, the arrival time and propagation path of ultrasonic signals can be determined more accurately, while eliminating errors caused by factors such as noise and reflected waves (bouncing waves), thereby improving the accuracy of time-of-flight measurements. Specifically, because the phase information of characteristic waves is highly robust to noise—phase changes are generally more stable than amplitude changes—the phase information can reliably reflect the actual state of the signal even in the presence of background noise, ensuring the stability of the measurement results. By focusing on the phase and period of characteristic waves, other non-characteristic signal components, such as noise or minor reflected waves, can be effectively ignored, further improving the system's anti-interference capability.

[0115] In some embodiments, the flight time calculation module 404 is further configured to: find the target sampling signal point closest to the amplitude extremum point based on the amplitude extremum point corresponding to the echo signal within the characteristic wave period; calculate the peak time corresponding to the peak value of the characteristic wave by linear fitting according to the phase of the amplitude extremum point and the phase of the target sampling signal point; calculate the first characteristic point time of the echo signal according to the characteristic wave period and the peak time; and add the first characteristic point time to the ADC capture delay time to obtain the flight time of the ultrasonic fluid metering device.

[0116] Based on the above settings, this disclosure provides a specific embodiment for calculating the flight time of an ultrasonic fluid metering device according to the phase and period of the characteristic wave. Specifically, the flight time of the ultrasonic fluid metering device is calculated by steps such as finding the amplitude extrema corresponding to the echo signal within the characteristic wave period, calculating the peak time by linear fitting, and combining the characteristic wave period and the ADC capture delay time. The method based on this specific embodiment achieves high-precision flight time measurement, enhances the system's noise resistance, reduces computational complexity, and has good adaptability to environmental changes.

[0117] In some embodiments, the step of calculating the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave further includes: determining a first sampling point and a second sampling point with opposite phase signs during the process of the signal phase in the echo signal changing from a negative phase to a positive phase within the characteristic wave period; calculating the zero-crossing time of the characteristic wave by linear fitting based on the phase of the first sampling point and the phase of the second sampling point; calculating the second characteristic point time corresponding to the echo signal based on the zero-crossing time and the characteristic wave period; and adding the second characteristic point time to the ADC capture delay time to obtain the flight time of the ultrasonic fluid metering device.

[0118] Based on the above settings, this disclosure provides another specific embodiment for calculating the flight time of an ultrasonic fluid metering device according to the phase and period of the characteristic wave. By determining the first and second sampling points with opposite phase signs corresponding to the process of the signal phase changing from negative to positive phase in the echo signal within the characteristic wave period, and calculating the zero-crossing time of the characteristic wave based on these points, the flight time is obtained. This method not only achieves high-precision flight time measurement, but also enhances the noise resistance of the system and reduces computational complexity.

[0119] The flight time calculation system for the ultrasonic fluid metering device provided in this embodiment utilizes a signal acquisition module to acquire the echo signal of the ultrasonic fluid metering device and determine the envelope and phase of the echo signal; an envelope gradient line determination module is configured to periodically segment the envelope to obtain the envelope gradient line; wherein, each gradient value in the envelope gradient line is determined based on the amplitude of the envelope within the corresponding period; a characteristic wave determination module is configured to determine the characteristic wave and its period from the echo signal in the rising region of the envelope gradient line based on the gradient difference between adjacent sub-envelope gradient lines; and a flight time calculation module is configured to calculate the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave. This achieves the technical effect of obtaining the envelope gradient line by periodically segmenting the envelope of the echo signal, and then accurately determining the characteristic wave based on the gradient difference between adjacent sub-envelope gradient lines. This avoids noise interference and overcomes wave skipping misjudgment, and directly calculates the flight time based on the phase and period of the characteristic wave. This reduces the computational burden, improves the accuracy and stability of flight time calculation, and expands the applicable scenarios of the method.

[0120] This disclosure also provides a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform the methods of embodiments of this disclosure.

[0121] This disclosure also provides a computer program product, including a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform the methods of the embodiments of this disclosure. The computer program product should be understood as a software product that primarily implements the methods described above through a computer program.

[0122] This disclosure also provides an electronic device, including: at least one processor, and a memory storing a computer program executable by the at least one processor, the computer program including instructions that, when executed by the processor, cause the processor to perform the flight time calculation method of any of the above-described ultrasonic fluid metering devices.

[0123] Referring to Figure 5, a structural block diagram of an electronic device that can serve as an embodiment of the present disclosure, representing an example of hardware devices applicable to various aspects of the present disclosure, is now described. 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 processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0124] As shown in Figure 5, the electronic device includes a processor unit 501, which can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Examples of processor units 501 include, but are not limited to, MCUs, CPUs, graphics processing units (GPUs), various special-purpose artificial intelligence (AI) computing units, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor unit 501 is used to perform the various methods and processes described above. For example, in some embodiments, the method embodiments of this disclosure can be implemented as a computer program tangibly contained in a machine-readable medium, such as external storage unit 507. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device via local storage unit 502 and / or communication unit 508. In some embodiments, the processor unit 501 can be configured to perform the methods described above by any other suitable means (e.g., by means of firmware).

[0125] Specifically, the processor unit 501 can perform various appropriate actions and processes based on computer programs stored in the local storage unit 502 (which can be a ROM storage unit or other storage-enabled devices) or computer programs loaded into the local storage unit 502 (such as random access memory RAM) from the external storage unit 507. The local storage unit 502 can also store various programs and data required for the operation of the electronic device. The processor unit 501 and the local storage unit 502 are interconnected via a bus 503. The input / output (I / O) interface 504 is also connected to the bus 503.

[0126] Multiple components in the electronic device are connected to I / O interface 504, including: input unit 505, output unit 506, external storage unit 507, and communication unit 508. Input unit 505 can be any type of device capable of inputting information into the electronic device. Input unit 505 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. Output unit 506 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. External storage unit 507 may include, but is not limited to, hard disks and optical disks. Communication unit 508 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, and / or wireless communication transceivers, such as Bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0127] Computer programs for implementing the methods of embodiments of this 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, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0128] In the context of embodiments of this disclosure, a machine-readable medium can 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 can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, or infrared systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0129] It should be noted that the term "comprising" and its variations used in this disclosure are open-ended, meaning "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"; and the term "some embodiments" means "at least some embodiments". The modifications of "one" and "multiple" mentioned in this disclosure are illustrative and not restrictive, and those skilled in the art should understand that unless explicitly indicated in the context, they should be understood as "one or more".

[0130] The information and data involved in the embodiments of this disclosure (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties. The collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0131] The steps described in the method embodiments provided in this disclosure can be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of protection of this disclosure is not limited in this respect.

[0132] The term "embodiment" in this specification refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this disclosure. The appearance of this phrase in various places throughout the specification does not necessarily imply the same embodiment, nor does it imply independence from or alternative to other embodiments. The various embodiments in this specification are described in a related manner, with reference made to the same or similar parts between the embodiments. In particular, for apparatus, device, and system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and relevant details are referred to in the description of the method embodiments.

[0133] The embodiments described above are merely illustrative of several implementations of this disclosure, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this disclosure, and these all fall within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the appended claims.

Claims

1. A method for calculating the flight time of an ultrasonic fluid metering device, wherein, The method includes: Acquire the echo signal from the ultrasonic fluid metering device, and determine the envelope and phase of the echo signal; The envelope is periodically segmented to obtain the envelope gradient line; wherein, each gradient value in the envelope gradient line is determined based on the amplitude of the envelope within the corresponding period. In the rising region of the envelope gradient line, the characteristic wave and the characteristic wave period are determined from the echo signal based on the gradient difference between adjacent sub-envelope gradient lines. The flight time of the ultrasonic fluid metering device is calculated based on the phase and period of the characteristic wave.

2. The method according to claim 1, wherein, The step of periodically segmenting the envelope to obtain the envelope gradient line includes: Based on the first transformation point of the echo signal, the envelope is periodically segmented to obtain multiple first gradient lines; wherein, the echo signal includes multiple sampling signal points, and the first transformation point is the amplitude transformation point corresponding to the transformation of the signal amplitude of the sampling signal point from less than the average amplitude of the echo signal to greater than the average amplitude of the echo signal, and the average amplitude of the echo signal is the average value of the amplitudes of all sampling signal points in the echo signal; By connecting the plurality of first gradient lines in sequence, the envelope gradient line corresponding to the echo signal is obtained.

3. The method according to claim 1, wherein, The step of performing periodic segmentation on the envelope to obtain the envelope gradient line further includes: The envelope is periodically segmented based on the second transformation point of the echo signal to obtain multiple second gradient lines; wherein, the echo signal includes multiple sampling signal points, and the second transformation point is the phase transformation point corresponding to the signal phase of the sampling signal point transforming from negative phase to positive phase; By connecting the plurality of second gradient lines in sequence, the envelope gradient line corresponding to the echo signal is obtained.

4. The method according to claim 1, characterized in that, The step of determining the characteristic wave and its period from the echo signal based on the gradient difference between adjacent sub-envelope gradient lines in the rising region of the envelope gradient line includes: In the rising region of the envelope gradient line, the gradient difference between adjacent sub-envelope gradient lines is calculated; wherein, within the rising region of the envelope gradient line, the gradient values ​​corresponding to adjacent sub-envelope gradient lines are in an increasing relationship. If the gradient difference is greater than a preset gradient difference threshold, then the target sub-envelope gradient line is determined to be the one with the larger gradient value among the adjacent sub-envelope gradient lines. The wave corresponding to the target sub-envelope gradient line in the echo signal is determined to be the characteristic wave, and the period of the target sub-envelope gradient line is determined to be the period of the characteristic wave. The preset gradient difference threshold is determined based on the maximum amplitude of the envelope line.

5. The method according to claim 1, characterized in that, The step of calculating the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave includes: Based on the amplitude extreme points corresponding to the echo signals within the characteristic wave period, find the target sampling signal point closest to the amplitude extreme points; Based on the phase of the amplitude extreme point and the phase of the target sampling signal point, the peak time corresponding to the peak value of the characteristic wave is calculated by linear fitting. Based on the characteristic wave period and the peak time, the first characteristic point time of the echo signal is calculated. The flight time of the ultrasonic fluid metering device is obtained by adding the time of the first feature point to the ADC capture delay time.

6. The method according to claim 1, wherein, The step of calculating the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave further includes: Within the characteristic wave period, determine the first and second sampling points with opposite phase signs corresponding to the process of the signal phase in the echo signal changing from negative to positive phase during the characteristic wave period; Based on the phase of the first sampling point and the phase of the second sampling point, the zero-crossing time of the characteristic wave is calculated by linear fitting. Based on the zero-crossing time and the period of the characteristic wave, the time of the second characteristic point corresponding to the echo signal is calculated. The flight time of the ultrasonic fluid metering device is obtained by adding the second feature point time to the ADC capture delay time.

7. The method according to claim 1, wherein, The step of determining the envelope and phase of the echo signal includes: The echo signal is processed to determine the envelope and phase of the echo signal; wherein the signal processing includes any one of the following: Hilbert transform processing, analytic signal transform processing, wavelet transform processing, short-time Fourier transform processing, fast Fourier transform processing, and adaptive filter processing.

8. A time-of-flight calculation system for an ultrasonic fluid metering device, wherein, The system includes: The signal acquisition module is configured to acquire the echo signal from the ultrasonic fluid metering device and determine the envelope and phase of the echo signal. The envelope gradient line determination module is configured to periodically segment the envelope line to obtain the envelope gradient line; wherein, each gradient value in the envelope gradient line is determined based on the amplitude of the envelope line within the corresponding period; The characteristic wave determination module is set to determine the characteristic wave and the characteristic wave period from the echo signal based on the gradient difference between adjacent sub-envelope gradient lines in the rising region of the envelope gradient line. The flight time calculation module is configured to calculate the flight time of the ultrasonic fluid metering device based on the phase and period of the characteristic wave.

9. An electronic device, comprising: A processor, and a memory storing a program, wherein the program includes instructions that, when executed by the processor, cause the processor to perform the method according to any one of claims 1-7.

10. A non-transitory machine-readable medium storing computer instructions, wherein, The computer instructions are configured to cause the computer to perform the method according to any one of claims 1-7.