Time difference calibration method and device of metering device and electronic equipment

By collecting and correcting the transmission time of the ultrasonic signal in the ultrasonic flowmeter, the problem of low accuracy of time difference caused by flow velocity is solved, and more accurate flow velocity and flow calculation is achieved.

CN120628248APending Publication Date: 2025-09-12GODSON ZHONGKE (TAIYUAN) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510740511.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

When ultrasonic signals are transmitted in fluid, they are affected by the flow velocity, which results in low precision of the time difference processing results and affects the accuracy of subsequent calculation results.

Method used

The transmission time of the ultrasonic signal within N cycles is collected, and through error wave adjustment and filtering processing, the target time difference is calculated to correct the flow velocity measurement value and reduce the influence of fluid flow velocity on the time difference accuracy.

Benefits of technology

The time difference measurement accuracy is improved, and the calculation accuracy of fluid flow rate and flow parameters is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120628248A_ABST
    Figure CN120628248A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a time difference calibration method and device of a metering device and electronic equipment. The method comprises the steps that the initial first transmission time of an ultrasonic signal from an upstream transducer to a downstream transducer and the initial second transmission time of the ultrasonic signal from the downstream transducer to the upstream transducer in N periods are collected respectively; for the nth period, determining the initial first transmission time as the first transmission time, determining the initial second transmission time as the second transmission time, and calculating the time difference between the second transmission time and the first transmission time; when the time difference exceeds a preset range, adjusting the first transmission time or the second transmission time in a staggered wave manner, and traversing the next period until the N periods are traversed to obtain a filled time difference array; and determining a target time difference according to each time difference recorded in the time difference array. According to the embodiment of the invention, the time difference measurement precision can be improved, so that the calculation accuracy of parameters such as flow velocity and flow of the to-be-measured fluid is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a time difference calibration method, device and electronic equipment for a measuring device. Background Art

[0002] Ultrasonic flowmeters calculate fluid flow by measuring the time difference between ultrasonic waves traveling through the fluid. Specifically, a built-in ultrasonic transducer emits ultrasonic signals of a certain frequency. As these signals propagate through the fluid, they are affected by the fluid's flow rate, causing the ultrasonic signal's propagation speed to change. By receiving the returned ultrasonic signal and measuring the time difference between the signals' propagation time, the flow velocity can be calculated. The flow rate is then calculated by multiplying the flow velocity by the pipe's cross-sectional area.

[0003] Since the transmission of ultrasonic signals in fluids is easily affected by flow velocity, the waveforms of the forward and backward first-wave threshold positioning are inconsistent. For example, when the wave is transmitted, it is positioned as the second wave, and when the wave is echoed, it is positioned as the third wave. As a result, the accuracy of the obtained target time difference is low, which affects the accuracy of subsequent calculated parameters such as flow velocity and flow. Summary of the Invention

[0004] The embodiments of the present invention provide a time difference calibration method, device and electronic equipment for a metering device, which can solve the problem that the transmission of ultrasonic signals in a fluid is easily affected by the flow velocity, resulting in low accuracy of the time difference processing results and affecting the accuracy of subsequent calculation results.

[0005] In one aspect, an embodiment of the present invention discloses a time difference calibration method for a measuring device, the method comprising:

[0006] respectively collecting an initial first transmission time of an ultrasonic signal from an upstream transducer to a downstream transducer and an initial second transmission time from the downstream transducer to the upstream transducer within N cycles;

[0007] For the nth period, respectively determining the initial first transmission time as the first transmission time, determining the initial second transmission time as the second transmission time, and calculating a time difference between the second transmission time and the first transmission time; wherein n≤N, and n and N are positive integers;

[0008] When the time difference is less than a preset range, the time difference is filled into the time difference array; otherwise, the first transmission time or the second transmission time is adjusted according to the error wave, and the next cycle is traversed until all N cycles are traversed to obtain a filled time difference array;

[0009] A target time difference is determined according to each time difference recorded in the time difference array to correct the flow velocity measurement value of the fluid to be measured.

[0010] Optionally, the step of adjusting the first transmission time or the second transmission time by using the staggered signal includes:

[0011] If the time difference is greater than a first threshold, updating the first transmission time to the initial first transmission time in the (n+1)th cycle of the acquisition, and recalculating the time difference between the second transmission time and the first transmission time;

[0012] When the time difference is less than the second threshold, the second transmission time is updated to the initial second transmission time in the (n+1)th cycle of collection, and the time difference between the second transmission time and the first transmission time is recalculated; wherein the first threshold is greater than the second threshold.

[0013] Optionally, determining the target time difference according to each time difference recorded in the time difference array includes:

[0014] Filtering each time difference recorded in the time difference array and averaging the result to obtain a first time difference;

[0015] The first time difference is converted into a unit to obtain a target time difference.

[0016] Optionally, filtering the time differences recorded in the time difference array and then averaging the filtered time differences to obtain the first time difference includes:

[0017] Performing median filtering on each time difference in the time difference array to obtain a target array;

[0018] An average of the time differences in the target array is calculated to obtain the first time difference.

[0019] Optionally, respectively collecting an initial first transmission time of the ultrasonic signal from the upstream transducer to the downstream transducer within N cycles, and an initial second transmission time from the downstream transducer to the upstream transducer, includes:

[0020] Starting timing when the upstream transducer sends the ultrasonic signal and stopping timing when the downstream transducer receives the ultrasonic signal that meets a preset condition, to obtain the initial first transmission time;

[0021] The timing starts when the downstream transducer sends an ultrasonic signal, and stops when the upstream transducer receives an ultrasonic signal that meets a preset condition, thereby obtaining the initial second transmission time.

[0022] Optionally, the method further includes:

[0023] obtaining the distance between the upstream transducer and the downstream transducer and the pipe diameter;

[0024] The flow velocity of the fluid in the pipeline is calculated according to the target time difference, the distance, the pipeline diameter, and the propagation velocity of the ultrasonic signal in the static fluid to be measured.

[0025] On the other hand, an embodiment of the present invention discloses a time difference calibration device, comprising:

[0026] an acquisition module, configured to respectively acquire an initial first transmission time of an ultrasonic signal from an upstream transducer to a downstream transducer, and an initial second transmission time from the downstream transducer to the upstream transducer within N cycles;

[0027] a calculation module, configured to, for an nth period, determine the initial first transmission time as a first transmission time, determine the initial second transmission time as a second transmission time, and calculate a time difference between the second transmission time and the first transmission time; wherein n≤N, and n and N are positive integers;

[0028] a calibration module, configured to fill the time difference into a time difference array if the time difference is less than a preset range; otherwise, adjust the first transmission time or the second transmission time according to the error wave, and traverse the next cycle until all N cycles are traversed to obtain a filled time difference array;

[0029] The time difference determination module is used to determine a target time difference according to each time difference recorded in the time difference array, so as to correct the flow velocity measurement value of the fluid to be measured.

[0030] Optionally, the calibration module includes:

[0031] a first adjusting unit, configured to update the first transmission time to an initial first transmission time within the (n+1)th period of acquisition when the time difference is greater than a first threshold, and recalculate the time difference between the second transmission time and the first transmission time;

[0032] A second adjustment unit is used to update the second transmission time to the initial second transmission time within the (n+1)th cycle of collection when the time difference is less than the second threshold, and recalculate the time difference between the second transmission time and the first transmission time; wherein the first threshold is greater than the second threshold.

[0033] Optionally, the time difference determination module includes:

[0034] A first calculation submodule is configured to filter each time difference recorded in the time difference array and then calculate an average value to obtain a first time difference;

[0035] The second calculation submodule is configured to perform unit conversion on the first time difference to obtain a target time difference.

[0036] Optionally, the first calculation submodule includes:

[0037] a filtering unit, configured to perform median filtering on each time difference in the time difference array to obtain a target array;

[0038] A calculation unit is used to calculate the average of the time differences in the target array to obtain the first time difference.

[0039] Optionally, the acquisition module includes:

[0040] a first timing unit, configured to start timing when the upstream transducer sends the ultrasonic signal, and stop timing when the downstream transducer receives the ultrasonic signal that meets a preset condition, to obtain the initial first transmission time;

[0041] The second timing unit is configured to start timing when the downstream transducer sends the ultrasonic signal and stop timing when the upstream transducer receives the ultrasonic signal that meets a preset condition, thereby obtaining the initial second transmission time.

[0042] Optionally, the device further comprises:

[0043] an acquisition module, configured to acquire the distance between the upstream transducer and the downstream transducer and the pipe diameter;

[0044] The second calculation module is configured to calculate the flow velocity of the fluid to be measured according to the target time difference, the distance, the pipe diameter, and the propagation velocity of the ultrasonic signal in the stationary fluid to be measured.

[0045] On the other hand, an embodiment of the present invention further discloses an electronic device, which includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to execute the aforementioned time difference calibration method of the measuring device by one or more processors.

[0046] An embodiment of the present invention further discloses a readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the aforementioned time difference calibration method for a measuring device.

[0047] The embodiments of the present invention include the following advantages:

[0048] An embodiment of the present invention provides a time difference calibration method for a metering device. The method first calculates the time difference based on the initial first transmission time of the ultrasonic signal collected in each measurement cycle under the downstream condition and the initial second transmission time under the upstream condition. When the time difference exceeds a preset range, the time difference is adjusted according to the transmission time of the adjacent cycle to reduce the impact of the error wave caused by the fluid flow rate on the time difference accuracy. In addition, the embodiment of the present invention records all time differences that do not exceed the preset range in a time difference array, and calculates the final target time difference based on the various time differences recorded in the time difference array, which can further reduce data errors, improve the time difference measurement accuracy, and thus improve the calculation accuracy of parameters such as the flow rate and flow of the fluid to be measured. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0050] Figure 1 This is a flowchart of an embodiment of a time difference calibration method for a measuring device according to the present invention;

[0051] Figure 2 This is a schematic diagram of the installation of a metering device of the present invention;

[0052] Figure 3 It is a schematic diagram of an ultrasonic time difference measurement cycle of the present invention;

[0053] Figure 4 It is a schematic diagram of collecting the transmission time of an ultrasonic signal of the present invention;

[0054] Figure 5 is a schematic diagram of a time difference calibration method of the present invention;

[0055] Figure 6 It is a structural block diagram of an embodiment of a time difference calibration device of the present invention;

[0056] Figure 7 This is a structural block diagram of an electronic device for time difference calibration provided by an example of the present invention. DETAILED DESCRIPTION

[0057] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0058] Method Example

[0059] Reference Figure 1 , shows a flowchart of a time difference calibration method for a measuring device of the present invention, the method may specifically include the following steps:

[0060] Step 101: respectively collecting an initial first transmission time of an ultrasonic signal from an upstream transducer to a downstream transducer, and an initial second transmission time from the downstream transducer to the upstream transducer within N cycles;

[0061] Step 102: For the nth cycle, determine the initial first transmission time as the first transmission time, determine the initial second transmission time as the second transmission time, and calculate the time difference between the second transmission time and the first transmission time; where n≤N, and n and N are positive integers;

[0062] Step 103: When the time difference is less than a preset range, fill the time difference into a time difference array; otherwise, adjust the first transmission time or the second transmission time according to the error wave, and traverse the next cycle until all N cycles are traversed to obtain a filled time difference array;

[0063] Step 104: determining a target time difference according to each time difference recorded in the time difference array to correct the flow velocity measurement value of the fluid to be measured.

[0064] The time difference calibration method for a metering device provided in an embodiment of the present invention can be applied to a metering device. A metering device calculates information such as the flow velocity and flow rate of the fluid being measured by measuring the time difference of an ultrasonic signal propagating through the fluid. Specifically, an ultrasonic transducer disposed within a pipeline emits ultrasonic signals of a certain frequency. These signals are affected by the fluid's flow rate as they propagate through the fluid being measured, resulting in changes in the propagation speed of the ultrasonic signal. By receiving the returned ultrasonic signal and measuring the time difference of the signal's propagation, the flow velocity of the fluid being measured can be calculated. The flow rate of the fluid being measured can then be determined by multiplying the flow velocity by the cross-sectional area of ​​the pipeline.

[0065] Reference Figure 2 , shows a schematic diagram of the installation of a metering device provided by an embodiment of the present invention. Figure 2As shown, the metering device includes an upstream transducer R1 and a downstream transducer R2, as well as reflectors M1 and M2 installed in the pipeline. Reflector M1 is installed directly below upstream transducer R1, and reflector M2 is installed directly below downstream transducer R2. The centers of reflectors M1 and M2 coincide with the center of the pipeline cross section. The distance between reflectors M1 and M2 is L, which is equal to the distance between upstream transducer R1 and downstream transducer R2. The ultrasonic signal emitted by upstream transducer R1 is reflected by reflector M1 to M2, and then transmitted by reflector M2 to downstream transducer R2. Correspondingly, the ultrasonic signal emitted by downstream transducer R2 is reflected by reflector M2 to M1, and then reflected by reflector M1 to upstream transducer R1.

[0066] Reference Figure 3 , which shows a schematic diagram of an ultrasonic time difference measurement cycle according to an embodiment of the present invention. Transducer 1 is the upstream transducer in this embodiment of the present invention, and transducer 2 is the downstream transducer in this embodiment of the present invention. The time it takes for the ultrasonic signal emitted by transducer 1 to reach transducer 2 is Time_f, and the time it takes for the ultrasonic signal emitted by transducer 2 to reach transducer 1 is Time_b. The time difference Dtof = Time_b - Time_f.

[0067] exist Figure 2 In the U-shaped transducer installation shown, the initial first transmission time (unit: seconds, s) for the ultrasonic signal emitted by the upstream transducer R1 to reach the downstream transducer R2 can be expressed as:

[0068]

[0069] The initial second transmission time (unit: seconds, s) for the ultrasonic signal emitted by the downstream transducer R2 to reach the upstream transducer R1 can be expressed as:

[0070]

[0071] Where D is the pipe diameter (unit: meter, m), L is the distance between the upstream transducer R1 and the downstream transducer R2 (unit: meter, m), which is also the distance between the reflector M1 and the reflector M2; C0 is the propagation speed of the ultrasonic signal in the static fluid (unit: meter per second, m / s), V L The flow rate of the fluid to be measured in the pipeline (unit: meters per second, m / s).

[0072] In the embodiment of the present invention, according to Formula 1 and Formula 2, the difference between the second transmission time and the first transmission time is expressed as Formula 3:

[0073]

[0074] Here, ΔT represents the first difference (unit: seconds, s).

[0075] It should be noted that in actual application scenarios, V in Formula 3 L The unit of is usually meters per second, while the unit of C0 is usually kilometers per second. L is much smaller than C0, so In, V L can be neglected, thus obtaining Formula 4:

[0076]

[0077] According to formula 4, we can get formula 5:

[0078]

[0079] Formula 5 shows that, when the distance L between the upstream transducer R1 and the downstream transducer R2 is fixed, the linear velocity of the fluid is related to the time difference and the propagation speed of the ultrasonic wave in the fluid. Therefore, when determining the first linear velocity of the fluid to be measured, the ultrasonic meter first calculates the difference between the second transmission time and the first transmission time. Then, based on this difference, the propagation speed of the ultrasonic wave in the fluid to be measured, and the distance L between the upstream transducer R1 and the downstream transducer R2, the linear velocity of the fluid to be measured is calculated using Formula (5). The flow rate of the fluid to be measured is then obtained by multiplying the flow velocity by the cross-sectional area of ​​the pipe.

[0080] Since the ultrasonic signal propagating in the fluid is easily affected by the fluid flow rate, the propagation speed of the ultrasonic signal in the fluid changes, and the time difference processing result differs from the actual value by one cycle, affecting the accuracy of subsequent calculation results.

[0081] Based on this, an embodiment of the present invention provides a time difference calibration method for a measuring device, which can correct the time difference measured by the measuring device and improve the time difference measurement accuracy.

[0082] Specifically, in an embodiment of the present invention, the initial first transmission time Time_f of the ultrasonic signal emitted by the upstream transducer to the downstream transducer and the initial second transmission time Time_b of the ultrasonic signal emitted by the downstream transducer to the upstream transducer within N measurement cycles are first collected.

[0083] Exemplarily, the initial first transmission time Time_f and the initial second transmission time Time_b can be determined by using the first wave threshold method. Figure 4 , shows a schematic diagram of collecting the transmission time of an ultrasonic signal. Figure 4As shown, the upstream transducer R1 transmits an ultrasonic signal at a predetermined frequency. When an ultrasonic signal with a signal amplitude equal to a preset threshold is detected at the receiving end of the downstream transducer, the detected ultrasonic signal is determined to be the first wave, and the moment of detection is determined as the exact moment of arrival of the ultrasonic signal. Next, the received ultrasonic signal is analyzed starting from the first wave. For example, the waveform of the ultrasonic signal is zero-bit detected to determine the zero-bit value of the signal amplitude. Based on the zero-bit value, the period value of the received ultrasonic signal, i.e., the echo period, is determined, thereby determining N initial first transmission times Time_f[0..N-1]. In the same manner, the initial second transmission time Time_b[0..N-1] of the ultrasonic signal emitted by the downstream transducer R2 to the upstream transducer R1 is collected.

[0084] After a series of transmission times are collected, the time difference is calculated based on the initial first transmission time and the initial second transmission time measured in each time difference measurement period, and it is determined whether the time difference exceeds a preset range.

[0085] It is understood that the preset range can be determined based on the product performance of the metering device. For example, if the time difference range of household meters DN15, DN20, and DN25 does not exceed 1 μs, then the preset range for household meters DN15, DN20, and DN25 can be set to 0 to 1 μs.

[0086] The time difference within the accuracy range allowed by the metering device can be considered as a normal measurement result. If it exceeds this range, it means that the measurement result is affected by the fluid flow rate, resulting in inconsistent waveforms of the forward and backward first wave threshold positioning, and there is a wrong wave, that is, the first wave detection error. For example, when the wave is transmitted (the ultrasonic signal emitted by the upstream transducer R1 to the downstream transducer R2), the first wave with an amplitude that meets the first wave threshold is the second wave, and when the wave is echoed (the ultrasonic signal emitted by the downstream transducer R2 to the upstream transducer R1), the first wave with an amplitude that meets the first wave threshold is the third wave. At this time, the time difference needs to be calibrated.

[0087] In the embodiment of the present invention, if the time difference exceeds a preset range, the time difference may be adjusted according to the transmission time of adjacent cycles.

[0088] Exemplarily, for the nth cycle, if the measured time difference (ΔT = Time_b[n] - Time_f[n]) exceeds the preset range, it is generally considered that there is a problem of misaligned waves, that is, the first wave determined when measuring the initial first transmission time and the first wave determined when measuring the initial second transmission time are not located within the same wave - emission cycle. If the time difference obtained at this time is positive, it usually means that the first wave located during wave emission is at least one cycle earlier than the first wave located during echo. For example, the first wave located during wave emission is the second wave, that is, n = 2, and the first wave located during echo is the third wave. At this time, the initial first transmission time within the next cycle, that is, the (n + 1)th cycle (the 3rd cycle in this case) of the acquisition, can be used as the first transmission time to recalculate the time difference. The time difference ΔT = Time_b[2] - Time_f[3] obtained at this time is compared with the preset range. If the new time difference ΔT still exceeds the preset range and is positive, the misaligned - wave adjustment of the first transmission time can be continued. Based on the 3rd cycle, the initial first transmission time within the next cycle, that is, the 4th cycle, can be used as the first transmission time and the time difference is recalculated until the time difference is within the preset range. Here, 0 < n ≤ N, and n and N are positive integers.

[0089] Relatively, if the measured time difference (ΔT = Time_b[n] - Time_f[n]) exceeds the preset range and the time difference is negative, it usually means that the first wave located during wave emission is one cycle later than the first wave located during echo, resulting in the measured time difference not conforming to the propagation law of ultrasonic signals in the fluid. For example, the first wave located during wave emission is the third wave, that is, n = 3, and the first wave located during echo is the second wave. At this time, the initial second transmission time within the next cycle, that is, the (n + 1)th cycle of the acquisition, can be used as the second transmission time to recalculate the time difference. The time difference ΔT = Time_b[n + 1] - Time_f[n] obtained at this time.

[0090] If the time difference does not exceed the preset range, it means that the measured time difference is within the error range allowed by the metering device, and no adjustment needs to be made. In this case, the obtained time difference is written into the time - difference array, and the first transmission time and the second transmission time are updated to calculate the time difference corresponding to the next cycle for the next - round analysis.

[0091] In an embodiment of the present invention, according to the aforementioned steps 101 to 104, the time differences corresponding to the N collected periods are traversed until all N periods have been traversed, and a final target time difference is determined based on the time differences recorded in the time difference array. For example, the target time difference can be obtained by averaging the time differences recorded in the time difference array. Alternatively, the time differences in the time difference array can be sorted, the maximum and minimum values ​​filtered out, and then the average is calculated to obtain the target time difference. Alternatively, data analysis can be performed on the time differences in the time difference array, time differences with high dispersion can be filtered out, and then the average is calculated to obtain the target time difference.

[0092] As an example, assuming N=3 (in actual measurement, the value of N is usually greater than 3. Here, a smaller value is used for illustrative purposes for ease of understanding). The initial first transmission time and the initial second transmission time within the three collected periods are recorded as: Time_f[0], Time_b[0], Time_f[1], Time_b[1], Time_f[2], Time_b[2]. Assuming the preset range is 0 to 1 us. According to the time difference calibration method provided in the embodiment of the present invention, the transmission times of these three periods are analyzed in turn. Specifically:

[0093] For the first cycle, the initial first transmission time is determined as the first transmission time, the initial second transmission time is determined as the second transmission time, and the time difference is calculated, Time_f=Time_f[0], Time_b=Time_b[0], and the time difference ΔT0=Time_b[0]-Time_f[0].

[0094] 1) If the time difference exceeds the preset range, for example, ΔT0 is greater than 1us, the time difference is adjusted based on the transmission time of the second cycle. For example, the initial first transmission time of the second cycle is used as the first transmission time, that is, Time_f = Time_f[1], and the time difference is recalculated to obtain a new time difference ΔT0 = Time_b[0] - Time_f[1]. The adjusted time difference is written into the time difference array.

[0095] 2) If the new time difference ΔT0 = Time_b[0] - Time_f[1] is less than the preset range of 1us and greater than 0, the adjusted time difference is written into the time difference array. If the new time difference ΔT0 = Time_b[0] - Time_f[1] is greater than the preset range of 1us, the first transmission time is adjusted, that is, the initial first transmission time of the third cycle is used as the first transmission time, that is, Time_f = Time_f[2], and the time difference is recalculated based on the new first transmission time to obtain a new time difference ΔT0 = Time_b[0] - Time_f[2], and the adjusted time difference is written into the time difference array.

[0096] 3) If the obtained time difference ΔT0 = Time_b[0] - Time_f[2] is less than 0, the second transmission time is adjusted for wave error, that is, the initial second transmission time of the second cycle is used as the second transmission time, that is, Time_b = Time_b[1], and the time difference is recalculated according to the new second transmission time to obtain a new time difference ΔT0 = Time_b[1] - Time_f[2], and the adjusted time difference is written into the time difference array.

[0097] For the second cycle, Time_f = Time_f[1], Time_b = Time_b[0], the first transmission time and the second transmission time are updated and shifted backward by one cycle respectively to obtain Time_f = Time_f[2], Time_b = Time_b[1], and the time difference ΔT1 = Time_b[1]-Time_f[2] is calculated. If the time difference does not exceed the preset range, the time difference is written into the time difference array. If the time difference exceeds the preset range, for example, ΔT1 is less than 0, the time difference is adjusted according to the transmission time of the third cycle. For example, the initial second transmission time of the third cycle is used as the second transmission time, that is, Time_b = Time_b[2], the time difference is recalculated to obtain a new time difference ΔT1 = Time_b[2]-Time_f[2], and the adjusted time difference is written into the time difference array.

[0098] For the third cycle, Time_f = Time_f[2], Time_b = Time_b[2], and the original initial first transmission time and initial second transmission time of the third cycle are used. At this time, it can be determined that the transmission time of the three cycles has been traversed. Next, the target time difference is determined based on the time differences recorded in the time difference array, that is, the target time difference is calculated based on ΔT0 and ΔT1 in the time difference array. For example, the time differences in the time difference array are averaged to obtain the target time difference.

[0099] It should be noted that in embodiments of the present invention, after each adjustment of the time difference, the adjusted time difference can be analyzed to see if it exceeds a preset range. If the adjusted time difference exceeds the preset range, the first transmission time or the second transmission time can be adjusted for wave stagger, and the time difference can be recalculated and analyzed. However, due to the influence of fluid flow rate, the first wave of the downstream ultrasonic signal and the upstream ultrasonic signal can be inconsistent, resulting in a time difference processing result that is usually one or two cycles different from the actual value. If the time difference is adjusted multiple times, calculation errors may be artificially introduced, affecting the accuracy of the calculation result. Therefore, in embodiments of the present invention, the number of time difference adjustments can be limited. For example, for the time difference corresponding to each cycle, if the time difference exceeds a preset range, the number of consecutive wave stagger adjustments for the first transmission time or the second transmission time must be less than a number threshold, such as the number threshold = 2. When the number of consecutive wave stagger adjustments for the first transmission time or the second transmission time is equal to 2, the adjusted time difference is directly written into the time difference array and no further analysis of the adjusted time difference is performed.

[0100] Furthermore, in the process of determining the target time difference based on the time differences recorded in the time difference array, the time differences with higher discreteness in the time difference array can be eliminated, and then the target time difference can be obtained by averaging the remaining data, thereby reducing data errors and improving the accuracy of the calculation results.

[0101] The time difference calibration method for a metering device provided in an embodiment of the present invention first calculates the time difference based on the initial first transmission time of the ultrasonic signal collected in each measurement cycle under the downstream condition and the initial second transmission time under the upstream condition. If the time difference exceeds a preset range, the time difference is adjusted according to the transmission time of the adjacent cycle to reduce the impact of the error wave caused by the fluid flow rate on the time difference accuracy. In addition, the embodiment of the present invention records all time differences that do not exceed the preset range in a time difference array, and calculates the final target time difference based on the various time differences recorded in the time difference array, which can further reduce data errors, improve the time difference measurement accuracy, and thus improve the calculation accuracy of parameters such as the flow rate and flow of the fluid to be measured.

[0102] In an optional embodiment of the present invention, the step 103 of adjusting the first transmission time or the second transmission time by staggering the wavelength includes:

[0103] Step S11: When the time difference is greater than a first threshold, the first transmission time is updated to the initial first transmission time in the (n+1)th cycle of the acquisition, and the time difference between the second transmission time and the first transmission time is recalculated;

[0104] Step S12: When the time difference is less than the second threshold, update the second transmission time to the initial second transmission time in the (n+1)th cycle of collection, and recalculate the time difference between the second transmission time and the first transmission time; wherein the first threshold is greater than the second threshold.

[0105] It is understood that the preset range of the time difference can be determined by two thresholds, for example, by defining the preset range by a first threshold and a second threshold. For example, if the time difference is greater than the first threshold or less than the second threshold, it can be determined that the time difference exceeds the preset range; conversely, if the time difference is greater than or equal to the second threshold and less than or equal to the first threshold, it can be determined that the time difference does not exceed the preset range.

[0106] Reference Figure 5 , shows a schematic diagram of a time difference calibration method provided by an embodiment of the present invention. Figure 5 As shown, after collecting the initial first transmission time Time_f[0..N-1] of the ultrasonic signal emitted by the upstream transducer R1 to the downstream transducer R2 and the initial second transmission time Time_b[0..N-1] of the ultrasonic signal emitted by the downstream transducer R2 to the upstream transducer R1 within N cycles, the time difference ΔT is calibrated.

[0107] In the first round of analysis, i = 0, j = 0. The time difference ΔT is calculated as Time_b[j] - Time_f[i], and a check is performed to determine whether the time difference ΔT is greater than the first threshold. If the time difference ΔT is greater than the first threshold, it means that the first wave located during the transmission is one cycle earlier than the first wave located during the echo. For example, the first wave located during the transmission is the second wave, while the first wave located during the echo is the third wave. In this case, the initial first transmission time collected during the next cycle is used as the first transmission time, that is, i = i + 1, and the time difference is recalculated.

[0108] If the time difference ΔT is less than or equal to the first threshold, the algorithm continues to determine whether it is less than the second threshold. If the time difference ΔT is less than the second threshold, this indicates that the first wave detected during transmission is one cycle later than the first wave detected during echo, causing the measured time difference to not conform to the propagation laws of ultrasonic signals in the fluid. For example, the first wave detected during transmission is the third wave, while the first wave detected during echo is the second wave. In this case, the initial second transmission time collected during the next cycle is used as the second transmission time, i.e., j = j + 1, and the time difference is recalculated; where i and j are integers.

[0109] If the time difference ΔT is less than or equal to the first threshold and greater than or equal to the second threshold, it means that the time difference measured at this time does not exceed the preset range. The time difference is written into the time difference array, and the first transmission time and the second transmission time are updated, that is, i = i + 1, j = j + 1, and the next round of analysis is carried out.

[0110] If the value of i or j is greater than or equal to N, it means that the transmission time within N cycles has been traversed. The loop analysis can be stopped and the target time difference can be determined based on the time differences recorded in the time difference array.

[0111] Optionally, determining the target time difference according to each time difference recorded in the time difference array includes:

[0112] Step S21, filtering each time difference recorded in the time difference array and averaging the filtered time differences to obtain a first time difference;

[0113] Step S22: Convert the first time difference into a unit to obtain a target time difference.

[0114] In an embodiment of the present invention, each time difference recorded in the time difference array can be filtered and then averaged to obtain a first time difference, thereby filtering out random errors in the time difference array, improving data quality, and facilitating improving the accuracy of the target time difference finally obtained.

[0115] Furthermore, the first time difference can be converted to a target time difference based on subsequent calculation requirements. For example, the time difference obtained by measurement is typically measured in microseconds (µs). If the chip is subsequently used to calculate the flow rate or flow rate of the fluid, the unit used is typically picoseconds (ps). To facilitate subsequent calculations, the first time difference in µs can be converted to a target time difference in ps.

[0116] Optionally, filtering the time differences recorded in the time difference array and then averaging the filtered time differences to obtain the first time difference includes:

[0117] Step S31, performing median filtering on each time difference in the time difference array to obtain a target array;

[0118] Step S32: Calculate the average of the time differences in the target array to obtain a first time difference.

[0119] In an embodiment of the present invention, a combined filtering method of median filtering and mean filtering can be used to filter the time differences recorded in the time difference array. Specifically, each time difference in the time difference array is first subjected to median filtering to remove M maximum and minimum values, respectively, to obtain a target array. Then, the target array is subjected to mean filtering, that is, the average value of each element in the target array is calculated to obtain a first time difference. The first time difference is then converted to a target time difference.

[0120] As an example, assume N = 14, with a preset range of 0 to 800,000 µs, i.e., a first threshold of 800,000 µs and a second threshold of 0 µs. The filter value is 3, meaning that the first time difference is calculated by averaging the three maximum and three minimum values ​​of the sorted time difference array. The initial first transmission time Time_f[0..13] and the initial second transmission time Time_b[0..13] collected over the 14 cycles are shown in Table 1:

[0121] Table 1

[0122]

[0123]

[0124] The time difference calibration method provided in the embodiment of the present invention is used to determine the target time difference, specifically comprising the following steps:

[0125] 1) i = 0, j = 0, Time_f[0] = 66325987, Time_b[0] = 67294630, calculate the time difference, Δt = 67294630 - 66325987 = 968643.

[0126] 2) Determine whether the time difference exceeds a preset range. If so, proceed to step 5); if not, proceed to step 4).

[0127] 3) Adjust the time difference according to the transmission time of the adjacent cycles: update the first transmission time Time_f to the initial first transmission time of the next cycle, and recalculate the time difference between the second transmission time Time_b and the first transmission time Time_f. Specifically:

[0128] i=1, j=0, Time_f[1]=67294595, Time_b[0]=67294630, recalculate the time difference, Δt=67294630-67294595=35.

[0129] 4) Write Δt into the time difference array. The first element in the time difference array, dt[0] = 35.

[0130] 5) Update the first transmission time Time_f and the second transmission time Time_b and proceed to the next round of analysis. Specifically:

[0131] i=i+1=2, j=j+1=1, Time_f[j]=68344074, Time_b[i]=68344101, calculate the time difference, Δt=68344101-68344074=27.

[0132] Next, repeat steps 2) to 5) to finally obtain a time difference array with 13 elements, as shown in Table 2:

[0133] Table 2

[0134] 0 1 2 3 4 5 6 7 8 9 10 11 12 dt 35 27 67 53 -47 -20 -5 127 -66 13 -13 88 72

[0135] 6) Filter the time difference array. Specifically, first sort the elements in the time difference array. The sorted array is shown in Table 3:

[0136] Table 3

[0137] 0 1 2 3 4 5 6 7 8 9 10 11 12 dt -66 -47 -20 -13 -5 13 27 35 53 67 72 88 127

[0138] After removing the three maximum values ​​and the three minimum values ​​from the sorted time difference array, the mean is calculated to obtain a first time difference dt_mean=(-13+-5+13+27+35+53+67) / 7=25 us.

[0139] 7) Convert the first time difference into a unit to obtain the target time difference, ΔT=24 ps.

[0140] In an optional embodiment of the present invention, respectively collecting an initial first transmission time of the ultrasonic signal from the upstream transducer to the downstream transducer and an initial second transmission time from the downstream transducer to the upstream transducer within N cycles includes:

[0141] Step S41: start timing when the upstream transducer sends the ultrasonic signal, and stop timing when the downstream transducer receives the ultrasonic signal that meets the preset conditions, to obtain the initial first transmission time;

[0142] Step S42: Start timing when the downstream transducer sends an ultrasonic signal, and stop timing when the upstream transducer receives an ultrasonic signal that meets a preset condition, to obtain the initial second transmission time.

[0143] In an embodiment of the present invention, a timing module can be used to collect the transmission time of an ultrasonic signal in a fluid. Specifically, timing is started when the upstream transducer R1 transmits an ultrasonic signal and stopped when the downstream transducer R2 receives an ultrasonic signal that meets preset conditions, thereby obtaining an initial first transmission time. The ultrasonic signal that meets the preset conditions may be an envelope signal with an amplitude and waveform that meets expectations. For example, when a first wave that meets a preset amplitude is detected using a first wave threshold, it can be considered that an ultrasonic signal that meets the preset conditions has been received.

[0144] Similarly, the timing starts when the downstream transducer R2 transmits an ultrasonic signal, and stops when the upstream transducer R1 receives an ultrasonic signal that meets a preset condition, thereby obtaining an initial second transmission time.

[0145] As an example, a ceramic crystal oscillator can be used as the timing module in the embodiment of the present invention. The ceramic crystal oscillator has the characteristics of short start-up time and low price. The ceramic crystal oscillator is controlled to start oscillating before the transducer transmits the ultrasonic signal, and the ceramic crystal oscillator is controlled to stop working when the transducer on the opposite side receives the ultrasonic signal that meets the preset conditions. It should be noted that the ceramic crystal oscillator has lower accuracy than the quartz crystal oscillator, and the frequency difference at room temperature is as high as 30ppm. Therefore, a wave cycle of each time difference measurement is not accurate to 1us, and the maximum deviation is Therefore, a crystal oscillator calibration process needs to be added during each time difference measurement process.

[0146] Optionally, the method further includes:

[0147] Step S51: obtaining the distance between the upstream transducer and the downstream transducer and the pipe diameter;

[0148] Step S52: Calculate the flow velocity of the fluid to be measured according to the target time difference, the distance, the pipe diameter, and the propagation velocity of the ultrasonic signal in the stationary fluid to be measured.

[0149] In an embodiment of the present invention, after obtaining the calibrated target time difference, the flow velocity of the fluid to be measured can be further calculated based on the distance between the upstream transducer and the downstream transducer, the pipe diameter, and the propagation velocity of the ultrasonic signal in the stationary fluid to be measured. The specific calculation method can refer to the aforementioned formula (5).

[0150] Furthermore, after the flow rate of the fluid to be measured is determined, the flow rate over a period of time can be calculated based on the cross-sectional area of ​​the pipeline.

[0151] In summary, an embodiment of the present invention provides a time difference calibration method for a metering device, which first calculates the time difference based on the initial first transmission time of the ultrasonic signal collected in each measurement cycle under the downstream condition and the initial second transmission time under the upstream condition. When the time difference exceeds a preset range, the time difference is adjusted according to the transmission time of the adjacent cycle to reduce the influence of the error wave caused by the fluid flow rate on the time difference accuracy; and, the embodiment of the present invention records the time differences that do not exceed the preset range in a time difference array, and calculates the final target time difference based on the time differences recorded in the time difference array, which can further reduce data errors and improve the time difference measurement accuracy, thereby improving the calculation accuracy of parameters such as the flow rate and flow of the fluid to be measured.

[0152] Device embodiment

[0153] Reference Figure 6 , shows a structural block diagram of an embodiment of a time difference calibration device of the present invention, wherein the device is applied to a metering device, the metering device includes an upstream transducer and a downstream transducer, and the time difference calibration device includes:

[0154] An acquisition module 201 is configured to respectively acquire an initial first transmission time of an ultrasonic signal from an upstream transducer to a downstream transducer, and an initial second transmission time from the downstream transducer to the upstream transducer within N cycles;

[0155] a first calculation module 202 configured to, for an nth period, determine the initial first transmission time as a first transmission time, determine the initial second transmission time as a second transmission time, and calculate a time difference between the second transmission time and the first transmission time;

[0156] a calibration module 203 configured to fill the time difference into a time difference array if the time difference is less than a preset range; otherwise, adjust the first transmission time or the second transmission time accordingly, and traverse the next cycle until all N cycles are traversed to obtain a filled time difference array;

[0157] The time difference determination module 204 is configured to determine a target time difference according to each time difference recorded in the time difference array, so as to correct the flow velocity measurement value of the fluid to be measured.

[0158] Optionally, the calibration module includes:

[0159] a first adjusting unit, configured to update the first transmission time to an initial first transmission time within the (n+1)th period of acquisition when the time difference is greater than a first threshold, and recalculate the time difference between the second transmission time and the first transmission time;

[0160] A second adjustment unit is used to update the second transmission time to the initial second transmission time within the (n+1)th cycle of collection when the time difference is less than the second threshold, and recalculate the time difference between the second transmission time and the first transmission time; wherein the first threshold is greater than the second threshold.

[0161] Optionally, the time difference determination module includes:

[0162] A first calculation submodule is configured to filter each time difference recorded in the time difference array and then calculate an average value to obtain a first time difference;

[0163] The second calculation submodule is configured to perform unit conversion on the first time difference to obtain a target time difference.

[0164] Optionally, the first calculation submodule includes:

[0165] a filtering unit, configured to perform median filtering on each time difference in the time difference array to obtain a target array;

[0166] A calculation unit is used to calculate the average of the time differences in the target array to obtain the first time difference.

[0167] Optionally, the acquisition module includes:

[0168] a first timing unit, configured to start timing when the upstream transducer sends the ultrasonic signal, and stop timing when the downstream transducer receives the ultrasonic signal that meets a preset condition, to obtain the initial first transmission time;

[0169] The second timing unit is configured to start timing when the downstream transducer sends an ultrasonic signal and stop timing when the upstream transducer receives an ultrasonic signal that meets a preset condition, thereby obtaining the initial second transmission time.

[0170] Optionally, the device further comprises:

[0171] an acquisition module, configured to acquire the distance between the upstream transducer and the downstream transducer and the pipe diameter;

[0172] The second calculation module is configured to calculate the flow velocity of the fluid to be measured according to the target time difference, the distance, the pipe diameter, and the propagation velocity of the ultrasonic signal in the stationary fluid to be measured.

[0173] In summary, an embodiment of the present invention provides a time difference calibration device, which can calculate the time difference based on the initial first transmission time of the ultrasonic signal collected in each measurement cycle under the downstream condition and the initial second transmission time under the upstream condition. When the time difference exceeds the preset range, the time difference is adjusted according to the transmission time of the adjacent cycle to reduce the influence of the error wave caused by the fluid flow rate on the time difference accuracy; and, the embodiment of the present invention records the time differences that do not exceed the preset range in the time difference array, and calculates the final target time difference based on the various time differences recorded in the time difference array, which can further reduce data errors, improve the time difference measurement accuracy, and thus improve the calculation accuracy of fluid parameters such as flow rate and flow rate.

[0174] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0175] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0176] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0177] An embodiment of the present invention provides an electronic device for time difference calibration, the electronic device including a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations:

[0178] respectively collecting an initial first transmission time of an ultrasonic signal from an upstream transducer to a downstream transducer and an initial second transmission time from the downstream transducer to the upstream transducer within N cycles;

[0179] For the nth cycle, respectively determine the initial first transmission time as the first transmission time, determine the initial second transmission time as the second transmission time, and calculate a time difference between the second transmission time and the first transmission time;

[0180] When the time difference is less than a preset range, the time difference is filled into the time difference array; otherwise, the first transmission time or the second transmission time is adjusted according to the error wave, and the next cycle is traversed until all N cycles are traversed to obtain a filled time difference array;

[0181] A target time difference is determined according to each time difference recorded in the time difference array to correct the flow velocity measurement value of the fluid to be measured.

[0182] Figure 7 FIG. 6 is a block diagram showing a structure of an electronic device 600 for time difference calibration according to an exemplary embodiment. For example, the electronic device 600 is a household ultrasonic water meter.

[0183] Reference Figure 7 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .

[0184] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with flow metering and parameter display. The processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the aforementioned method. Furthermore, the processing component 602 may include one or more modules to facilitate interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.

[0185] The memory 604 is configured to store various types of data to support operations on the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, historical data, parameter information, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as an electrically erasable programmable read-only memory (EEPROM) or a non-volatile memory (SPIFLASH) based on the serial peripheral interface (SPI) protocol.

[0186] The power supply assembly 606 provides power to the various components of the electronic device 600. The power supply assembly 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.

[0187] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In household ultrasonic water meters, the screen is generally a liquid crystal display (LCD).

[0188] The I / O interface 612 provides an interface between the processing component 602 and a peripheral interface module, which may be a button, a switch, or the like.

[0189] The sensor assembly 614 includes one or more sensors for providing various status assessments for the electronic device 600. For example, the sensor assembly 614 can detect flow information and temperature information of the electronic device 600. For example, the sensor assembly 614 can detect the flow information and temperature information of the electronic device 600. For example, the sensor assembly 614 can detect the device status of the electronic device 600 or a component of the electronic device 600, the presence or absence of contact between the transducer and the electronic device 600, the current metering information of the electronic device 600, and the temperature change of the electronic device 600.

[0190] The communication component 616 is configured to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as NB, Cat1 or Bluetooth, or a combination thereof. In an exemplary embodiment, the communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near-field communication (infrared) module to facilitate short-range communication.

[0191] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0192] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by the processor 620 of the electronic device 600 to perform the above method.

[0193] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device (server or terminal), enables the processor to perform Figure 1 The time difference calibration method of the measuring device shown.

[0194] The above is a detailed introduction to the time difference calibration method, device and electronic equipment of a measuring device provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A time difference calibration method for a measuring device, characterized in that: The method comprises: respectively collecting an initial first transmission time of an ultrasonic signal from an upstream transducer to a downstream transducer and an initial second transmission time from the downstream transducer to the upstream transducer within N cycles; For the nth period, respectively determining the initial first transmission time as the first transmission time, determining the initial second transmission time as the second transmission time, and calculating a time difference between the second transmission time and the first transmission time; wherein n≤N, and n and N are positive integers; When the time difference is less than a preset range, the time difference is filled into the time difference array; otherwise, the first transmission time or the second transmission time is adjusted according to the error wave, and the next cycle is traversed until all N cycles are traversed to obtain a filled time difference array; A target time difference is determined according to each time difference recorded in the time difference array to correct the flow velocity measurement value of the fluid to be measured.

2. The method according to claim 1, characterized in that The step of adjusting the first transmission time or the second transmission time by staggering the wavelength includes: If the time difference is greater than a first threshold, updating the first transmission time to the initial first transmission time in the (n+1)th cycle of the acquisition, and recalculating the time difference between the second transmission time and the first transmission time; When the time difference is less than a second threshold, the second transmission time is updated to the initial second transmission time in the (n+1)th cycle of collection, and the time difference between the second transmission time and the first transmission time is recalculated; wherein the first threshold is greater than the second threshold.

3. The method according to claim 1, characterized in that Determining the target time difference according to each time difference recorded in the time difference array includes: Filtering each time difference recorded in the time difference array and averaging the result to obtain a first time difference; The first time difference is converted into a unit to obtain a target time difference.

4. The method according to claim 3, characterized in that The filtering of the time differences recorded in the time difference array and then averaging the time differences to obtain the first time difference includes: Performing median filtering on each time difference in the time difference array to obtain a target array; An average of the time differences in the target array is calculated to obtain the first time difference.

5. The method according to claim 1, wherein The respectively collecting of an initial first transmission time of an ultrasonic signal from an upstream transducer to a downstream transducer and an initial second transmission time from the downstream transducer to the upstream transducer within N cycles includes: Starting timing when the upstream transducer sends the ultrasonic signal and stopping timing when the downstream transducer receives the ultrasonic signal that meets a preset condition, to obtain the initial first transmission time; The timing is started when the downstream transducer sends the ultrasonic signal, and is stopped when the upstream transducer receives the ultrasonic signal that meets the preset conditions, to obtain the initial second transmission time.

6. The method according to claim 1, wherein The method further comprises: obtaining the distance between the upstream transducer and the downstream transducer and the pipe diameter; The flow velocity of the fluid to be measured is calculated according to the target time difference, the distance, the pipe diameter, and the propagation velocity of the ultrasonic signal in the stationary fluid to be measured.

7. A time difference calibration device, characterized in that: The time difference calibration device comprises: an acquisition module, configured to respectively acquire an initial first transmission time of an ultrasonic signal from an upstream transducer to a downstream transducer, and an initial second transmission time from the downstream transducer to the upstream transducer within N cycles; a calculation module, configured to, for an nth period, determine the initial first transmission time as a first transmission time, determine the initial second transmission time as a second transmission time, and calculate a time difference between the second transmission time and the first transmission time; wherein n≤N, and n and N are positive integers; a calibration module, configured to fill the time difference into a time difference array if the time difference is less than a preset range; otherwise, adjust the first transmission time or the second transmission time according to the error wave, and traverse the next cycle until all N cycles are traversed to obtain a filled time difference array; The time difference determination module is used to determine a target time difference according to each time difference recorded in the time difference array, so as to correct the flow velocity measurement value of the fluid to be measured.

8. The device according to claim 7, characterized in that The calibration module comprises: a first adjusting unit, configured to update the first transmission time to an initial first transmission time within the (n+1)th period of acquisition when the time difference is greater than a first threshold, and recalculate the time difference between the second transmission time and the first transmission time; A second adjustment unit is used to update the second transmission time to the initial second transmission time within the (n+1)th cycle of collection when the time difference is less than the second threshold, and recalculate the time difference between the second transmission time and the first transmission time; wherein the first threshold is greater than the second threshold.

9. An electronic device, characterized in that: The electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to execute the time difference calibration method for a measuring device according to any one of claims 1 to 6 by one or more processors.

10. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the processor is enabled to perform the time difference calibration method for a measuring device according to any one of claims 1 to 6.