An ultrasonic time-of-flight measurement method and apparatus based on echo zero-crossing

CN122670945BActive Publication Date: 2026-11-03CHINA JILIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611177104.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-05
Publication Date
2026-11-03
Estimated Expiration
2046-08-05

AI Technical Summary

Technical Problem

Existing ultrasonic flow meters are susceptible to noise interference under complex operating conditions, which leads to inaccurate positioning of echo feature points, large data calculation volume, and affects the accuracy of time-of-flight measurement.

Method used

An ultrasonic time-of-flight measurement method based on echo zero-crossing is adopted. By acquiring ultrasonic echo waveforms, positive zero-crossing points are screened, the Akaike Information Criterion (AIC) value is calculated, an AIC curve is generated, a signal-to-noise ratio (SNR) starting point significance verification mechanism is constructed, significant starting points with strong anti-noise interference ability are screened, and ultrasonic time-of-flight is calculated.

Benefits of technology

It reduces the amount of data computation, improves measurement accuracy and stability, reduces periodic errors, and enhances the accuracy and real-time performance of TOF measurements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122670945B_ABST
    Figure CN122670945B_ABST
Patent Text Reader

Abstract

The application relates to an ultrasonic time-of-flight measurement method and device based on an echo zero-crossing point, an electronic device and a storage medium, which comprises the following steps: performing forward zero-crossing point screening on an ultrasonic echo waveform to obtain screened zero-crossing points; calculating Akaike information criterion (AIC) values of the screened zero-crossing points; generating an AIC curve according to the AIC values; constructing a starting point significance checking mechanism based on echo signal-to-noise ratio (SNR) to check candidate zero-crossing points of the AIC curve and screen significant starting points with strong anti-noise interference capability; and calculating an ultrasonic time-of-flight according to the significant starting points. Through the application, the significant starting points can be accurately positioned, periodic errors during measurement can be effectively reduced, measurement accuracy can be improved, the ultrasonic time-of-flight is calculated according to the significant starting points, and the TOF measurement precision is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of flow detection technology, and specifically to a method for measuring the time of flight of an ultrasonic flow meter. Background Technology

[0002] Ultrasonic flow meters are widely used in natural gas metering due to their advantages such as high accuracy, low loss, wide rangeability, and ease of maintenance. The time-of-flight (TOF) method is currently the mainstream measurement method. Its principle is to deduce flow velocity and flow rate by obtaining the difference in the time of flight (TOF) of ultrasonic waves propagating upstream and downstream. Therefore, the TOF positioning accuracy directly determines the metering performance of the instrument.

[0003] Traditional ultrasonic time-of-flight (TOF) measurement methods mainly include thresholding, cross-correlation, and the traditional AIC (Akaike Information Criterion) algorithm. However, in practical engineering applications of ultrasonic flow meters, these traditional methods suffer from limitations such as susceptibility to noise and waveform misalignment interference, high computational complexity, and drift of the starting point under low signal-to-noise ratio conditions, all of which affect the accuracy of TOF measurements. Therefore, designing an ultrasonic time-of-flight measurement method that can effectively resist various noise interferences, accurately locate echo characteristic points, and significantly reduce computational complexity under complex operating conditions is a critical technical bottleneck that urgently needs to be addressed in the field of ultrasonic flow metering. Summary of the Invention

[0004] This embodiment provides an ultrasonic time-of-flight measurement method, apparatus, electronic device, and storage medium based on the zero-crossing point of the echo.

[0005] Firstly, this embodiment provides a method for measuring ultrasonic time-of-flight based on the zero-crossing point of the echo, the method comprising: Acquire the ultrasonic echo waveform obtained from the sampling; The ultrasonic echo waveform is screened for positive zero-crossing points to obtain the selected zero-crossing points; Calculate the AIC value of the selected zero-crossing Akaike Information Criterion; Generate an AIC curve based on the AIC value; A starting point significance verification mechanism based on echo signal-to-noise ratio (SNR) is constructed to verify the candidate zero-crossing points of the AIC curve and screen significant starting points with strong anti-noise interference capabilities. Calculate the ultrasonic flight time based on the significant starting point.

[0006] In some embodiments, the Akaike Information Criterion (AIC) value for the selected zero-crossing points is calculated, including: Pre-compute the cumulative sum array and cumulative sum of squares array of the data sequence; Calculate the variance of any interval in the data sequence based on the cumulative sum array and the cumulative sum of squares array; Calculate the AIC value of the selected zero-crossing points based on the variance.

[0007] In some embodiments, the Akaike Information Criterion (AIC) value for the selected zero-crossing points is calculated, including: Pre-calculated cumulative sum array and cumulative sum of squares array The calculation formulas are as follows: in, For sample values, for any sliding point The left-side signal variance of its division and the right-side signal variance Solve using the following formula: in, This represents the total number of data items. The left-side signal variance variance of the signal on the right Substitute into the AIC calculation formula to obtain the corresponding sliding point. The AIC value at that location.

[0008] In some embodiments, a starting point significance verification mechanism based on echo signal-to-noise ratio (SNR) is constructed to verify candidate zero-crossing points of the AIC curve and screen significant starting points with strong noise interference resistance, including: The sampling point corresponding to the minimum value of the AIC curve is determined as the first starting point, the next sampling point corresponding to the first starting point is determined as the second starting point, and the next sampling point corresponding to the second starting point is determined as the third starting point. Let the slope of the fitted line between the first starting point and the second starting point be denoted as... Let the slope of the fitted line between the first starting point and the third starting point be denoted as ; when and If the preset conditions are met, the first starting point is determined to be a significant starting point; if not, the subsequent starting points are checked until a significant starting point is found.

[0009] In some of these embodiments, when and When preset conditions are met, the first starting point is determined to be a significant starting point, including: when When the first starting point is determined to be a significant starting point, then, This is the dynamic threshold that changes with the signal-to-noise ratio.

[0010] In some embodiments, the ultrasonic time of flight is calculated based on a significant starting point, including: After the significant starting point, the first n The positive zero-crossing point of each wave is taken as the measurement point for the ultrasonic time of flight; among them... An integer greater than or equal to 4; The ultrasonic time of flight is obtained by fitting a straight line between the ultrasonic time of flight measurement point and its next sampling point, solving for the intersection of the line and the horizontal axis as the precise zero point position, and then converting it into the ultrasonic time of flight.

[0011] In some embodiments, the ultrasonic time of flight is calculated based on a significant starting point, including: Ultrasonic Time-of-Flight Measurement Points With its next sampling point Fit a straight line and find the intersection points of the line with the horizontal axis. The ultrasonic flight time is calculated using the following formula: In the formula, The sampling delay time is set according to the pipe diameter. This refers to the number of periods following the ultrasonic time-of-flight measurement relative to a significant starting point. The sampling period.

[0012] Secondly, this embodiment provides an ultrasonic time-of-flight measurement device based on the zero-crossing point of the echo, the device comprising: The acquisition module is used to acquire the ultrasonic echo waveform obtained from sampling; The first screening module is used to screen the ultrasonic echo waveform for positive zero-crossing points and obtain the screened zero-crossing points. The first calculation module is used to calculate the AIC value of the zero-crossing Akaike Information Criterion for the selected zero-crossing points; The generation module is used to generate an AIC curve based on the AIC value; The second screening module is used to construct a starting point significance verification mechanism based on echo signal-to-noise ratio (SNR), verify the candidate zero-crossing points of the AIC curve, and screen significant starting points with strong anti-noise interference capabilities. The second calculation module is used to calculate the ultrasonic flight time based on a significant starting point.

[0013] Thirdly, this embodiment provides an electronic device including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to perform the ultrasonic time-of-flight measurement method based on the echo zero-crossing point described in the first aspect.

[0014] Fourthly, this embodiment provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the ultrasonic time-of-flight measurement method based on the zero-crossing point of the echo as described in the first aspect.

[0015] Compared with related technologies, this embodiment provides an ultrasonic time-of-flight measurement method, apparatus, electronic device, and storage medium based on echo zero-crossing points. The method involves acquiring sampled ultrasonic echo waveforms; performing positive zero-crossing point screening on the ultrasonic echo waveforms to obtain selected zero-crossing points; calculating the Akaike Information Criterion (AIC) value of the selected zero-crossing points; generating an AIC curve based on the AIC value; constructing a starting point saliency verification mechanism based on echo signal-to-noise ratio (SNR) to verify candidate zero-crossing points of the AIC curve and screen for significant starting points with strong anti-noise interference capabilities; and calculating the ultrasonic time-of-flight based on the significant starting points. First, by replacing the computational process of traversing the sampling point sequence in the original AIC algorithm with zero-crossing point screening, redundant calculations in the original algorithm are effectively reduced, and starting point positioning jitter is alleviated, achieving a lightweight algorithm design. Next, AIC curve features are extracted, and a saliency verification mechanism based on the ultrasonic echo signal SNR is constructed to accurately locate significant starting points, effectively reducing periodic errors during measurement and improving measurement accuracy. Finally, the ultrasonic time-of-flight is calculated based on the significant starting points, further improving the accuracy of Time-of-Flight (TOF) measurements.

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

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a hardware structure block diagram of a terminal for an ultrasonic time-of-flight measurement method based on the zero-crossing point of the echo provided in this embodiment; Figure 2 This is a flowchart of an ultrasonic time-of-flight measurement method based on the zero-crossing point of the echo provided in an embodiment of this application; Figure 3 This application provides an example of an ultrasonic echo and its corresponding AIC curve. Figure 4 This application provides an embodiment of an ultrasonic echo zero-crossing point and its corresponding AIC curve; Figure 5 This application provides an example of an echo waveform with added noise and its corresponding AIC curve. Figure 6 This application provides an embodiment of an AIC curve under different noise intensities. Figure 7 This is a flowchart of a starting point saliency verification provided in an embodiment of this application; Figure 8 This application provides a threshold curve for two echo sources under different SNRs. Figure 9 This application provides an example of an ultrasonic echo initiation point and a TOF measurement point. Figure 10 This is a time difference measurement result provided by a different method in the embodiments of this application. Detailed Implementation

[0018] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0019] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. For example, it can run on a terminal. Figure 1 This is a hardware structure block diagram of a terminal for an ultrasonic time-of-flight measurement method based on the zero-crossing point of the echo provided in this embodiment. (See diagram for example.) Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA). The terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that… Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.

[0020] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to an ultrasonic time-of-flight measurement method based on the zero-crossing point of the echo in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0021] The transmission device 106 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0022] This embodiment provides a method for measuring ultrasonic time-of-flight based on the zero-crossing point of the echo. Figure 2 This is a flowchart of an ultrasonic time-of-flight measurement method based on the zero-crossing point of the echo provided in an embodiment of this application, as shown below. Figure 2 As shown, the process includes the following steps: Step S210: Obtain the ultrasonic echo waveform obtained from the sampling; Step S220: Perform positive zero-crossing point screening on the ultrasonic echo waveform to obtain the selected zero-crossing points; Step S230: Calculate the AIC value of the selected zero-crossing Akaike Information Criterion; Step S240: Generate an AIC curve based on the AIC value; Step S250: Construct a starting point significance verification mechanism based on echo signal-to-noise ratio (SNR) to verify candidate zero-crossing points of the AIC curve and screen significant starting points with strong anti-noise interference capabilities. Step S260: Calculate the ultrasonic flight time based on the significant starting point.

[0023] Through the above steps, firstly, by selecting zero-crossing points to replace the computational process of traversing the sampling point sequence in the original AIC algorithm, redundant calculations in the original algorithm are effectively reduced, and the jitter in starting point positioning is alleviated, achieving a lightweight algorithm design. Next, AIC curve features are extracted, and a saliency verification mechanism based on the ultrasonic echo signal-to-noise ratio (SNR) is constructed to accurately locate significant starting points, effectively reducing periodic errors during measurement and improving measurement accuracy. Finally, based on the significant starting points, the ultrasonic time of flight is calculated, further improving the accuracy of TOF measurements.

[0024] In some embodiments, the Akaike Information Criterion (AIC) value for the selected zero-crossing points is calculated, including: Pre-compute the cumulative sum array and cumulative sum of squares array of the data sequence; Calculate the variance of any interval in the data sequence based on the cumulative sum array and the cumulative sum of squares array; Calculate the AIC value of the selected zero-crossing points based on the variance.

[0025] In some embodiments, the Akaike Information Criterion (AIC) value for the selected zero-crossing points is calculated, including: Pre-calculated cumulative sum array and cumulative sum of squares array The calculation formulas are as follows: in, For sample values, for any sliding point , where i, j, and k are integers. The variance of the left-side signal is... and the right-side signal variance Solve using the following formula: in, N represents the total number of data points, where N is an integer.

[0026] The left-side signal variance variance of the signal on the right Substitute into the AIC calculation formula to obtain the corresponding sliding point. The AIC value at that location.

[0027] In some embodiments, a starting point significance verification mechanism based on echo signal-to-noise ratio (SNR) is constructed to verify candidate zero-crossing points of the AIC curve and screen significant starting points with strong noise interference resistance, including: The sampling point corresponding to the minimum value of the AIC curve is determined as the first starting point, the next sampling point corresponding to the first starting point is determined as the second starting point, and the next sampling point corresponding to the second starting point is determined as the third starting point. Let the slope of the fitted line between the first starting point and the second starting point be denoted as... Let the slope of the fitted line between the first starting point and the third starting point be denoted as ; when and If the preset conditions are met, the first starting point is determined to be a significant starting point; if not, the subsequent starting points are checked until a significant starting point is found.

[0028] In some of these embodiments, when and When preset conditions are met, the first starting point is determined to be a significant starting point, including: when When the first starting point is determined to be a significant starting point, then, This is the dynamic threshold that changes with the signal-to-noise ratio.

[0029] In some embodiments, the ultrasonic time of flight is calculated based on a significant starting point, including: After the significant starting point, the first n The positive zero-crossing point of each wave is taken as the measurement point for the ultrasonic time of flight; among them... It must be an integer greater than or equal to 4. That is, after finding a significant starting point, the significant starting point will be shifted sequentially backward. n After obtaining a significant starting point in the first ultrasound cycle, the second... n The positive zero-crossing point of the wave will significantly influence the starting point of the wave. n The positive zero-crossing point of each wave is used as the measurement point for ultrasonic time of flight.

[0030] The ultrasonic time of flight is obtained by fitting a straight line between the ultrasonic time of flight measurement point and its next sampling point, solving for the intersection of the line and the horizontal axis as the precise zero point position, and then converting it into the ultrasonic time of flight.

[0031] In some embodiments, the ultrasonic time of flight is calculated based on a significant starting point, including: Ultrasonic Time-of-Flight Measurement Points With its next sampling point Fit a straight line and find the intersection points of the line with the horizontal axis. The ultrasonic flight time is calculated using the following formula: In the formula, The sampling delay time is set according to the pipe diameter. This refers to the number of periods following the ultrasonic time-of-flight measurement relative to a significant starting point. The sampling period.

[0032] This application employs an optimized AIC algorithm, which significantly reduces the amount of data computation and improves computational efficiency. The original AIC algorithm requires traversing all sampling point sequences and calculating the cumulative sum and cumulative variance, resulting in a huge computational load and low efficiency. After optimization, zero-crossing points are first screened as candidate starting points, and then only the AIC values ​​of these candidate starting points need to be calculated, thus greatly reducing the computational load in the AIC algorithm.

[0033] This application constructs a significance verification mechanism based on the signal-to-noise ratio of ultrasonic echo signals, accurately locating significant starting points and effectively suppressing periodic jump phenomena in TOF measurements. By adding Gaussian noise of different intensities to the ultrasonic echo signals and plotting their AIC curves based on zero crossings, the anti-interference ability of different candidate starting points against noise is verified, and finally, the more suitable significant starting point for TOF measurements is selected.

[0034] The present embodiment will be described and explained below through specific examples.

[0035] refer to Figure 3 The AIC algorithm is a statistical method based on an autoregressive model. Its core idea is to treat the arrival and departure of the effective signal as two distinct stationary random processes. The minimum point of the AIC function corresponds to the optimal boundary between these two random processes, i.e., the starting point of the effective signal. The mathematical expression for calculating the AIC curve is shown in Equation 1:

[0036] (1) in, It is a signal sequence. For signal length, For the sliding point within the signal sequence, and For sliding point The variance of the left and right segments of the signal. When After traversing the entire signal sequence, an AIC curve can be obtained.

[0037] On the AIC curve, the energy pulse will appear as a prominent global minimum valley. Because the echo signal of the ultrasonic flowmeter is relatively stable in the initial stage, the effective signal gradually increases after arrival, forming a relatively gentle global minimum valley on the AIC curve.

[0038] Reference Figure 4First, the sampled ultrasonic echo waveforms are screened for positive zero-crossings, taking into account the 200kHz ultrasonic echo and 5MHz sampling rate used. The interval between adjacent zero-crossings is set to be more than 10 sampling points to prevent false zero-crossings within the same period. Simultaneously, the three consecutive sampling points following a positive zero-crossing are set to be positive to ensure the stability of that positive zero-crossing. Then, the AIC value is calculated only for the screened zero-crossings, and an AIC characteristic curve is plotted. At this point, each AIC value corresponds one-to-one with a valid zero-crossing in the echo waveform. This algorithm avoids fluctuations in the minimum AIC value position caused by noise interference, effectively improving the stability of the starting point positioning. In terms of computational efficiency, assuming the entire echo signal waveform has 700 sampling points, and without using the first and last 5 sampling points as the AIC curve segmentation points, the traditional AIC algorithm needs to calculate the variance from the 5th sampling point to the 695th sampling point, requiring a total of 1380 variance calculations. After optimization, only about 20 selected zero-crossing points need to be calculated, reducing the variance calculation to about 40 times, significantly reducing redundant computation. Furthermore, the traditional AIC algorithm's repeated variance calculations in the segmented sequence greatly increase the computational load. After optimization, a pre-calculated cumulative sum array is used to improve the variance calculation speed; the acceleration principle is as follows.

[0039] 1) Calculate the sample variance and mean, see Equations 2 and 3. (2) (3) in, For the number of samples, These are sample values. Substituting Equation 3 into Equation 2 yields Equation 4: 4 2) Calculate the cumulative sum array (Equation 5) and cumulative square sum array (Equation 6) of the data sequence to quickly calculate the variance of any interval in the data sequence.

[0040] (5) 6 In the AIC algorithm, for the sliding point The variance of the signal on the left is shown in Equation 7, and the variance of the signal on the right is shown in Equation 8.

[0041] 7 (8) in, Let be the total number of data points. Finally, substituting these two variance results into Equation 4 yields the sliding point. The AIC value at that location.

[0042] Assuming an echo waveform has 700 sampling points, after filtering, 20 positive zero-crossing points are obtained. In the traditional algorithm, calculating the variance to obtain 20 AIC values ​​requires approximately 56,000 floating-point operations. However, after optimizing the variance calculation through pre-calculation of the cumulative sum array, only about 2,400 floating-point operations are needed. This optimization of the variance repetition calculation significantly improves the algorithm's processing speed, making it more suitable for the real-time requirements of ultrasonic flow meters.

[0043] Reference Figure 5 Different intensities of Gaussian noise were added to ultrasonic echo signals, and their AIC curves based on the zero-crossing point of the echo were plotted. The figures show ultrasonic echo signals with Gaussian noise added at 0%, 4%, and 8% of the original signal energy intensity, along with magnified views of their starting point regions. It can be seen from the figures that as the noise intensity increases, the first starting point of the waveform is gradually submerged, and the corresponding bottom peak of the AIC curve gradually flattens. To better illustrate the changes in the AIC curves under different noise intensities, the AIC curves under the influence of 0%-8% Gaussian noise intensity are plotted on the same coordinate system, as shown below. Figure 6 .

[0044] Reference Figure 6 As noise intensity increases, the right half of the AIC curve remains almost unchanged because the right half of the waveform is dominated by the effective signal, and its intensity is much greater than the noise intensity. Therefore, adding noise has almost no effect on the right half of the AIC curve. However, the left half of the AIC curve is dominated by noise, and this region gradually introduces several initial waveforms with small amplitudes. After adding noise, the variance of this part increases significantly. When the noise intensity is 0%, the AIC value corresponding to starting point 1 is the minimum value of the AIC curve. However, when the noise intensity is 2%, the AIC value corresponding to starting point 1 is no longer the minimum value of the AIC curve, indicating that the anti-interference ability of starting point 1 is weak. Meanwhile, within the noise intensity range of 0%-8%, the AIC value corresponding to starting point 2 is consistently lower than the AIC value corresponding to starting point 3. This indicates that compared to starting point 1, starting point 2 has stronger anti-noise interference ability, more significant characteristics, and is more suitable as a feature reference point for measuring TOF.

[0045] To achieve accurate and stable Time-of-Flight (TOF) measurements, the key is to locate a feature point with strong anti-interference capabilities and high stability within the ultrasonic echo waveform. However, as mentioned earlier, the first positive zero-crossing of the echo occurs at the initial arrival of the effective echo signal, resulting in a very small echo amplitude that is easily drowned out by noise. Therefore, considering the characteristic of the AIC curve where the AIC value increases rapidly after significant waveform oscillations but the upward trend gradually slows down, a starting point significance verification process is constructed for the AIC algorithm based on the echo zero-crossing to ensure a stable feature point is obtained. The specific verification process is as follows: Figure 7 As shown.

[0046] Reference Figure 7 The specific verification process, in order to Figure 6 Taking the AIC curve with 0% noise as an example, first find the starting point 1 corresponding to the minimum value of the AIC curve, and then set the slope of the straight line fitted by the starting point 1 and the starting point 2 as... K 1. Set the slope of the straight line fitted from starting point 1 and starting point 3 as... K 2. At this point (starting point 1), if the following conditions are met... K 1> K 2. If the condition is not met, then the starting point 1 is determined to be a significant feature point; if not, then the starting points 2 and 3 are used as the reference points. K 1. Starting from points 2 and 4, we obtain K 2. Verify starting point 2 until a significant starting point is found. However, if... Figure 6 As shown, with the increase of noise intensity, the horizontal position of starting point 2 relative to starting points 3 and 4 will also rise, resulting in the obtained slope. K 1 will be less than K 2. Therefore, a dynamic threshold that changes with the signal-to-noise ratio is introduced into the verification process. threshold(SNR) Make the slope K 1. K 2. Satisfying Equation 9 ensures that the same positive zero-crossing point can be accurately selected as a significant starting point under different noise intensities, guaranteeing the stability of TOF measurements. It should be noted that starting point 1, starting point 2, and starting point 3 here are equivalent to the first starting point, second starting point, and third starting point in the aforementioned embodiments.

[0047] (9) in The curve was obtained by statistical fitting of the ultrasonic echo waveform under standard conditions, and the steps are as follows: The echo signal waveforms of each channel of the ultrasonic flowmeter were collected under static standard conditions.

[0048] Calculate the signal-to-noise ratio (SNR) of the echo and its corresponding AIC curve based on zero crossings, mark the salient starting point of the target and its corresponding AIC point, and calculate the signal-to-noise ratio (SNR) at that AIC point. K 1. K 2.

[0049] Add Gaussian noise of varying intensities and record its values. K 1. K 2 and signal-to-noise ratio SNR .

[0050] by SNR The x-axis is... K 1. KThe difference between 2 and 3 is used as the ordinate to plot a scatter plot. Then, a polynomial fit is performed on these scatter points to obtain a curve, which is then shifted above the scatter set. This curve is... curve. Figure 8 In the design of the dual-channel flow meter, the corresponding forward and reverse flow echoes of the first channel Schematic diagram of the curve.

[0051] After significance verification, the final starting point is actually the second positive zero-crossing point of the original ultrasonic echo. Compared to the first positive zero-crossing point of the echo, the echo oscillation amplitude corresponding to the second positive zero-crossing point is larger, the waveform is more stable, and it is less likely to be submerged by noise.

[0052] In practical applications, the accuracy of Time-of-Flight (TOF) measurements is limited by the hardware sampling capability, while ultrasonic flowmeters require TOF accuracy at the nanosecond (ns) level. Considering the actual waveform of the ultrasonic echo, to minimize the interference of sampling point jitter on TOF measurement accuracy, after finding a significant starting point, it is necessary to shift it forward four cycles to obtain the positive zero-crossing point of the fourth wave after the significant starting point, which will be used as the TOF measurement point. The waveform corresponding to this point has a large oscillation amplitude throughout the entire ultrasound echo and is located in the rising phase of the echo peak, exhibiting good waveform stability. Figure 9 As shown. Determine the TOF measurement points. Then, use that point With its next sampling point Fit a straight line to obtain the intersection point of the line and the x-axis. Because the slope of this straight line is significantly greater than the slope of the fitted line between the significant starting point and its next sampling point, its zero-point jitter caused by sampling point jitter is smaller, resulting in higher positioning accuracy. The x-coordinate corresponding to this intersection point can be converted into the final TOF according to Equation 10, breaking through the limitations of hardware sampling accuracy and further improving the measurement accuracy of TOF.

[0053] 10 in, The sampling delay time is set according to the pipe diameter. This represents the number of cycles following the TOF measurement point relative to the starting point. The sampling period.

[0054] To verify the effectiveness and feasibility of measuring Time of Flight (TOF) using the improved AIC algorithm based on echo zero-crossing, static time difference measurement experiments and flow rate experiments were conducted on the method proposed in this application. The method described in this application was used to acquire 500 sets of static echo data (500 downstream echoes + 500 upstream echoes). Each echo data frame consisted of 700 sampling points. A random coefficient was used for each echo. Amplitude random scaling was performed to simulate the abrupt changes in echo signal intensity under complex operating conditions. The AIC algorithm, a zero-crossing-based AIC algorithm (without significance verification), cross-correlation method, double threshold method, and the improved AIC algorithm of this application were used for processing. Since the cross-correlation method outputs the time difference, the raw time difference without zero drift correction was selected as the final evaluation criterion. The time difference measurement results output by each method are shown below. Figure 10 The statistical data are shown in Table 1.

[0055] Table 1. Statistics of time difference results for each algorithm output Calculation method Time difference fluctuation range / ns Time difference variance / ns AIC algorithm 4836 1352 AIC algorithm based on zero crossing point 11040 1135 Double threshold method 9696 1394 Cross-correlation method 44 8.8 Improved AIC method 35 6.3 The results show that the AIC algorithm, the zero-crossing-based AIC algorithm (without significance verification), and the double-threshold method all have significant deviations in their measurement results. The improved AIC algorithm proposed in this application shows better time-of-flight fluctuation range and variance results than the cross-correlation method, indicating that its measurement performance is superior to that of the cross-correlation method. It should be noted that the improved AIC method in this application is the ultrasonic time-of-flight measurement method based on the echo zero-crossing point described in the foregoing embodiments.

[0056] To demonstrate the lightweight advantage of the optimized algorithm in this application, the time consumed by the main body of the AIC algorithm, the cross-correlation method, and the improved AIC algorithm of this application when processing 500 sets of ultrasonic echo signals was measured using the tic-toc function built into MATLAB on the same PC. To make the measurement results more reliable, each algorithm was run cyclically ten times, and the average time consumption of the obtained time difference result was taken. The results are shown in Table 2.

[0057] Table 2. Algorithm processing time measurement results processing method Average time / AIC algorithm 8.22 Cross-correlation method 3.99 Improved AIC algorithm 0.66 In contrast, the improved AIC algorithm proposed in this application significantly reduces the computational load while maintaining excellent accuracy, has a more prominent real-time advantage, is more lightweight, and is more suitable for real-time TOF measurement scenarios of ultrasonic flow meters.

[0058] To further verify the accuracy of TOF measurement using the method described in this application, a flow calibration experiment was conducted using this method. The experiment was conducted according to the relevant requirements of JJG1030-2007 "Ultrasonic Flowmeter Verification Procedure," selecting a 1m... 3 / h, 16m 3 / h、64m 3 / h, 160m 3 The experiment was calibrated at four flow points, and each flow point was repeated three times. The experimental results are shown in Table 3.

[0059] Table 3 Flow rate experiment results

[0060] Experimental results show that the error at each flow point of the method in this application is less than ±1%, and the repeatability is less than 0.2%, which meets the requirements of Class 1 table in the "Verification Procedure for Ultrasonic Flowmeters".

[0061] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0062] This embodiment also provides an ultrasonic time-of-flight measurement device based on the zero-crossing point of the echo. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. The terms "module," "unit," "subunit," etc., used below refer to combinations of software and / or hardware that perform a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0063] The device includes: The acquisition module is used to acquire the ultrasonic echo waveform obtained from sampling; The first screening module is used to screen the ultrasonic echo waveform for positive zero-crossing points and obtain the screened zero-crossing points. The first calculation module is used to calculate the AIC value of the zero-crossing Akaike Information Criterion for the selected zero-crossing points; The generation module is used to generate an AIC curve based on the AIC value; The second screening module is used to construct a starting point significance verification mechanism based on echo signal-to-noise ratio (SNR), verify the candidate zero-crossing points of the AIC curve, and screen significant starting points with strong anti-noise interference capabilities. The second calculation module is used to calculate the ultrasonic flight time based on a significant starting point.

[0064] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0065] This embodiment also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0066] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0067] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program: S1, acquire the ultrasonic echo waveform obtained from sampling; S2, perform positive zero-crossing point screening on the ultrasonic echo waveform to obtain the selected zero-crossing points; S3, calculate the AIC value of the Akaike Information Criterion for the zero-crossing points selected; S4, Generate the AIC curve based on the AIC value; S5. Construct a starting point significance verification mechanism based on echo signal-to-noise ratio (SNR) to verify candidate zero-crossing points of the AIC curve and screen significant starting points with strong anti-noise interference capabilities. S6, Calculate the ultrasonic flight time based on the significant starting point.

[0068] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.

[0069] Furthermore, in conjunction with the ultrasonic time-of-flight measurement method based on echo zero-crossing provided in the above embodiments, this embodiment can also provide a storage medium for implementation. This storage medium stores a computer program; when executed by a processor, the computer program implements any of the ultrasonic time-of-flight measurement methods based on echo zero-crossing provided in the above embodiments.

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

Claims

1. A method for measuring ultrasonic time-of-flight based on the zero-crossing point of the echo, characterized in that, The method includes: Acquire the ultrasonic echo waveform obtained from the sampling; The ultrasonic echo waveform is subjected to positive zero-crossing point screening to obtain the selected zero-crossing points; Calculate the AIC value of the zero-crossing Akaike Information Criterion for the selected points; Generate an AIC curve based on the AIC value; A starting point significance verification mechanism based on echo signal-to-noise ratio (SNR) is constructed to verify the candidate zero-crossing points of the AIC curve and screen significant starting points with strong anti-noise interference capabilities. Calculate the ultrasonic flight time based on the aforementioned significant starting point; The calculation of the Akaike Information Criterion (AIC) value of the selected zero-crossing points includes: Pre-compute the cumulative sum array and cumulative sum of squares array of the data sequence; Calculate the variance of any interval in the data sequence based on the cumulative sum array and the cumulative sum of squares array; Calculate the AIC value of the selected zero-crossing points based on the variance; The establishment of a starting point significance verification mechanism based on echo signal-to-noise ratio (SNR) verifies candidate zero-crossing points of the AIC curve and screens significant starting points with strong anti-noise interference capabilities, including: The sampling point corresponding to the minimum value of the AIC curve is determined as the first starting point, the next sampling point corresponding to the first starting point is determined as the second starting point, and the next sampling point corresponding to the second starting point is determined as the third starting point. Let K1 be the slope of the line fitted between the first starting point and the second starting point, and let K2 be the slope of the line fitted between the first starting point and the third starting point. If K1 and K2 meet the preset conditions, the first starting point is determined to be a significant starting point; if not, the subsequent starting points are checked until a significant starting point is found.

2. The ultrasonic time-of-flight measurement method based on the zero-crossing point of the echo according to claim 1, characterized in that, The calculation of the Akaike Information Criterion (AIC) value of the selected zero-crossing points includes: Pre-calculated cumulative sum array and cumulative sum of squares array The calculation formulas are as follows: in, For sample values, for any sliding point The variance of the left-side signal is divided. and the variance of the signal on the right Solve using the following formula: in, This represents the total number of data items. The left-side signal variance variance of the signal on the right Substitute into the AIC calculation formula to obtain the corresponding sliding point. The AIC value at that location.

3. The ultrasonic time-of-flight measurement method based on the zero-crossing point of the echo according to claim 1, characterized in that, The when and When preset conditions are met, the first starting point is determined to be a significant starting point, including: when When the first starting point is determined to be a significant starting point, then, This is the dynamic threshold that changes with the signal-to-noise ratio.

4. The ultrasonic time-of-flight measurement method based on the zero-crossing point of the echo according to claim 1, characterized in that, The calculation of the ultrasonic flight time based on the significant starting point includes: After the significant starting point, the first n The positive zero-crossing point of each wave is used as the measurement point for the ultrasonic time of flight; among them... An integer greater than or equal to 4; The ultrasonic flight time is obtained by fitting a straight line between the ultrasonic time-of-flight measurement point and its next sampling point, solving for the intersection of the straight line and the horizontal axis as the precise zero point position, and then converting it into the ultrasonic time of flight.

5. The ultrasonic time-of-flight measurement method based on the zero-crossing point of the echo according to claim 4, characterized in that, Based on the aforementioned significant starting point, the ultrasonic flight time is calculated, including: Ultrasonic Time-of-Flight Measurement Points With its next sampling point Fit a straight line and find the intersection points of the line with the horizontal axis. The ultrasonic flight time is calculated using the following formula: In the formula, The sampling delay time is set according to the pipe diameter. This refers to the number of periods following the ultrasonic time-of-flight measurement relative to a significant starting point. The sampling period.

6. An ultrasonic time-of-flight measurement device based on the zero-crossing point of the echo, characterized in that, The device includes: The acquisition module is used to acquire the ultrasonic echo waveform obtained from sampling; The first screening module is used to perform positive zero-crossing point screening on the ultrasonic echo waveform to obtain the screened zero-crossing points; The first calculation module is used to calculate the AIC value of the selected zero-crossing Akaike Information Criterion; The generation module is used to generate an AIC curve based on the AIC value; The second screening module is used to construct a starting point significance verification mechanism based on echo signal-to-noise ratio (SNR), verify the candidate zero-crossing points of the AIC curve, and screen significant starting points with strong anti-noise interference capabilities. The second calculation module is used to calculate the ultrasonic flight time based on the significant starting point; The calculation of the Akaike Information Criterion (AIC) value of the selected zero-crossing points includes: Pre-compute the cumulative sum array and cumulative sum of squares array of the data sequence; Calculate the variance of any interval in the data sequence based on the cumulative sum array and the cumulative sum of squares array; Calculate the AIC value of the selected zero-crossing points based on the variance; The establishment of a starting point significance verification mechanism based on echo signal-to-noise ratio (SNR) verifies candidate zero-crossing points of the AIC curve and screens significant starting points with strong anti-noise interference capabilities, including: The sampling point corresponding to the minimum value of the AIC curve is determined as the first starting point, the next sampling point corresponding to the first starting point is determined as the second starting point, and the next sampling point corresponding to the second starting point is determined as the third starting point. Let K1 be the slope of the line fitted between the first starting point and the second starting point, and let K2 be the slope of the line fitted between the first starting point and the third starting point. If K1 and K2 meet the preset conditions, the first starting point is determined to be a significant starting point; if not, the subsequent starting points are checked until a significant starting point is found.

7. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the ultrasonic time-of-flight measurement method based on the echo zero-crossing point as described in any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the ultrasonic time-of-flight measurement method based on the zero-crossing point of the echo as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Akaike information criterion transit time estimation method based on waveform similarity

    CN118981007A

  • Ultrasonic wave flight time measuring method, circuit, flow metering method and device

    CN122329425A