Instrument calibration method and device, electronic equipment and storage medium
By performing stepwise filtering on the time-of-flight difference of the ultrasonic flow meter, the problem of large memory usage during zero-point calibration was solved, thus improving accuracy and cost-effectiveness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GOLDEN CARD WATER TECH CO LTD
- Filing Date
- 2021-12-31
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies for zero-point calibration of ultrasonic flow meters suffer from the problems of large memory usage and high cost.
By periodically acquiring the time-of-flight difference of the instrument to be calibrated, filtering is performed step by step, including median filtering, Kalman filtering, and interval mean filtering, to gradually determine the zero-point compensation value, thereby reducing memory usage and lowering costs.
This achieves improved accuracy and reduced cost of zero-point calibration without increasing memory, thereby reducing the cost of MCU selection.
Smart Images

Figure CN116412877B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of instrument calibration technology, and in particular to an instrument calibration method, apparatus, electronic device and storage medium. Background Technology
[0002] In recent years, with the advancement of technology, intelligent flow meters have developed rapidly. Ultrasonic flow meters, due to their advantages such as large range ratio, small starting flow, low pressure loss and bidirectional measurement, have been increasingly used in the field of flow detection.
[0003] Ultrasonic flow meters generally use the time-of-flight method for measurement. This method calculates flow rate information based on the time difference of ultrasonic waves propagating in the measured medium under both downstream and upstream conditions. In practical applications, ultrasonic flow meters exhibit a zero-point deviation, which can cause flow rate errors when measuring small flow rates. Therefore, it is necessary to calibrate this zero-point deviation.
[0004] Currently, when calibrating the zero-point deviation of ultrasonic flow meters, the average time-of-flight difference over a period of time is typically used as the zero-point correction value. However, this method requires a large amount of memory during zero-point calibration, which increases the selection cost of the microcontroller unit (MCU). Summary of the Invention
[0005] This application provides a calibration method, apparatus, electronic device, and storage medium for an instrument, which solves the problems of large memory usage and high cost in the prior art when calibrating the zero point of an ultrasonic flow meter.
[0006] In a first aspect, this application provides a calibration method for an instrument, comprising:
[0007] The first flight time difference corresponding to the instrument to be calibrated is periodically acquired.
[0008] Whenever the number of first flight time differences reaches a first preset number, the first preset number of first flight time differences are filtered to obtain the second flight time difference.
[0009] Whenever the number of second flight time differences reaches a second preset number, a third flight time difference is determined based on the second preset number of second flight time differences.
[0010] Whenever the number of third flight time differences reaches the third preset number, the zero-point compensation value is determined based on the third preset number of third flight time differences.
[0011] Zero-point calibration is performed on the instrument to be calibrated based on the zero-point compensation value.
[0012] Optionally, the first preset number of first flight time differences are filtered to obtain the second flight time difference, including:
[0013] The median value is filtered on the first preset number of first flight time differences to obtain the fourth flight time difference.
[0014] The second flight time difference is obtained by applying Kalman filtering to the fourth flight time difference.
[0015] Optionally, a third flight time difference is determined based on a second preset number of second flight time differences, including:
[0016] Sort the second flight time differences according to the size of the second preset number of second flight time differences.
[0017] The third flight time difference is determined based on the third preset number of second flight time differences located at a preset position among the sorted second preset number of second flight time differences.
[0018] Optionally, the third flight time difference is determined based on the third preset number of second flight time differences located at a preset position among the sorted second preset number of second flight time differences, including:
[0019] Determine the average of a third preset number of second flight time differences at a preset location, and use the average as the third flight time difference.
[0020] Optionally, a zero-point compensation value is determined based on a third preset number of third flight time differences, including:
[0021] Determine the average of the third preset number of third flight time differences, and set the average as the zero-point compensation value.
[0022] Optionally, the first flight time difference is stored in a first preset array.
[0023] Whenever the number of first flight time differences reaches a first preset number, the first preset number of first flight time differences are filtered to obtain the second flight time difference. The method further includes:
[0024] Clear the first flight time difference stored in the first preset array, and store the subsequently obtained first flight time difference in the cleared first preset array.
[0025] Optionally, the third flight time difference is stored in a second preset array.
[0026] Whenever the number of third flight time differences reaches a third preset number, after determining the zero-point compensation value based on the third preset number of third flight time differences, the method further includes:
[0027] Clear the third flight time difference stored in the second preset array, and store the subsequently determined third flight time difference in the cleared second preset array.
[0028] Secondly, this application provides a calibration device for an instrument, comprising:
[0029] The acquisition module is used to periodically acquire the first flight time difference corresponding to the instrument to be calibrated.
[0030] The processing module is used to filter the first preset number of first flight time differences whenever the number of first flight time differences reaches a first preset number, so as to obtain the second flight time difference.
[0031] The determination module is used to determine the third flight time difference based on the second preset number of second flight time differences whenever the number of second flight time differences reaches the second preset number.
[0032] The determination module is also used to determine the zero-point compensation value based on the third preset number of third flight time differences whenever the number of third flight time differences reaches the third preset number.
[0033] The calibration module is used to perform zero-point calibration on the instrument to be calibrated based on the zero-point compensation value.
[0034] Optional, processing module, specifically used for:
[0035] The median value is filtered on the first preset number of first flight time differences to obtain the fourth flight time difference.
[0036] The second flight time difference is obtained by applying Kalman filtering to the fourth flight time difference.
[0037] Optional, determine the module, specifically used for:
[0038] Sort the second flight time differences according to the size of the second preset number of second flight time differences.
[0039] The third flight time difference is determined based on the third preset number of second flight time differences located at a preset position among the sorted second preset number of second flight time differences.
[0040] Optional, determine the module, specifically used for:
[0041] Determine the average of a third preset number of second flight time differences at a preset location, and use the average as the third flight time difference.
[0042] Optional, determine the module, specifically used for:
[0043] Determine the average of the third preset number of third flight time differences, and set the average as the zero-point compensation value.
[0044] Optionally, the device also includes a storage module, wherein the first flight time difference is stored in a first preset array.
[0045] The storage module is used to filter the first preset number of first flight time differences whenever the number of first flight time differences reaches the first preset number, obtain the second flight time difference, clear the first flight time differences stored in the first preset array, and store the subsequently obtained first flight time differences in the cleared first preset array.
[0046] Optionally, the third flight time difference is stored in a second preset array.
[0047] The storage module is also used to, whenever the number of third flight time differences reaches the third preset number, determine the zero-point compensation value based on the third preset number of third flight time differences, clear the third flight time differences stored in the second preset array, and store the subsequently determined third flight time differences in the cleared second preset array.
[0048] Thirdly, this application provides an electronic device, including: a memory and a processor;
[0049] Memory is used to store computer programs.
[0050] The processor is used to read the computer program stored in the memory and execute the calibration method of the instrument described in the first aspect according to the computer program in the memory.
[0051] Fourthly, this application provides a readable storage medium having a computer program stored thereon, the computer program storing computer execution instructions, which, when executed by a processor, are used to implement the calibration method of the instrument as described in the first aspect above.
[0052] Fifthly, embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the calibration method for the instrument described in the first aspect.
[0053] The calibration method, apparatus, electronic device, and storage medium provided in this application periodically acquire the first time-of-flight difference (TOF) corresponding to the instrument to be calibrated. Whenever the number of TOFs reaches a first preset number, the first preset number of TOFs are filtered to obtain a second TOF. Whenever the number of second TOFs reaches a second preset number, a third TOF is determined based on the second preset number of second TOFs. Whenever the number of third TOFs reaches a third preset number, a zero-point compensation value is determined based on the third preset number of third TOFs. Zero-point calibration is then performed on the instrument to be calibrated based on the zero-point compensation value. In this application, each time a first preset number of TOFs is acquired, a second TOF is obtained after filtering, then a second preset number of second TOFs are filtered to obtain a third TOF, then a third preset number of third TOFs are filtered to obtain a zero-point compensation value, which is then used to compensate for the zero point. This method, by periodically acquiring the TOF of the instrument to be calibrated in real time and dividing the TOF into multiple groups for step-by-step filtering, avoids acquiring a large number of TOFs at once, thus solving the problem of large memory usage and reducing costs. Attached Figure Description
[0054] Figure 1 A schematic flowchart illustrating the calibration method for the instrument provided in this application embodiment;
[0055] Figure 2 The flight time difference waveform obtained during the actual zero-point calibration process provided in this application embodiment;
[0056] Figure 3 A schematic flowchart illustrating the calibration method for the instrument provided in this application embodiment;
[0057] Figure 4 This is a schematic diagram of the structure of the calibration device for the instrument provided in the embodiments of this application;
[0058] Figure 5 This is a schematic diagram of the structure of the calibration device for the instrument provided in the embodiments of this application;
[0059] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0060] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0061] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0062] The technical solution provided in this application can be applied to zero-point calibration of flow meters, especially for ultrasonic flow meters used in low-flow-rate measurement. Because the instrument is affected by various factors, the pointer often deviates from zero, so zero-point calibration is necessary before measurement to improve accuracy. Such flow meters include ultrasonic flow meters and acoustic (shock wave) flow meters.
[0063] Currently, when calibrating the zero-point deviation of ultrasonic flow meters, the average time-of-flight difference over a period of time is typically used as the zero-point correction value. However, to improve the accuracy of zero-point calibration, a large number of time-of-flight differences need to be collected to obtain an average value, resulting in a more accurate zero-point correction value. This large number of time-of-flight differences requires significant memory, leading to high memory consumption and increased MCU selection costs. Therefore, choosing a suitable zero-point calibration method is crucial.
[0064] To address the above issues, this application proposes a calibration method for instruments. Each time, a first preset number of time-of-flight differences are acquired, filtered to obtain a second time-of-flight difference, and then filtered again for a second preset number of these differences to obtain a third time-of-flight difference. This is followed by filtering a third preset number of these third time-of-flight differences to obtain a zero-point compensation value, which is then used to compensate for the zero point. This method periodically acquires the time-of-flight differences of the instrument to be calibrated in real time and filters these differences using a multi-filter fusion algorithm to obtain the zero-point compensation value. In this application, when long-term zero-point calibration is required, the parallel processing of multiple arrays effectively decomposes the large amount of data stored in a single array, dividing the time-of-flight differences into multiple groups for step-by-step filtering. This avoids acquiring a large number of time-of-flight differences at once, solving the problem of high memory consumption and reducing costs.
[0065] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0066] Figure 1This is a flowchart illustrating a calibration method for an instrument provided in an embodiment of this application. The calibration method can be performed by software and / or hardware devices, such as electronic devices like terminals or servers. For example, please refer to [link to example]. Figure 1 As shown, the calibration method for this instrument may include:
[0067] S101. Periodically acquire the first flight time difference corresponding to the instrument to be calibrated.
[0068] In this step, the first time-of-flight difference can be understood as the time-of-flight difference measured in real time. The time-of-flight difference can be understood as the difference in propagation time of the measured substance in the measured medium under two conditions: downstream and upstream. In addition, the period for obtaining the first time-of-flight difference can be set according to the actual situation or experience. For example, it can be set to obtain the first time-of-flight difference every 5 seconds or 10 seconds. The specific value of the period is not limited in this embodiment of the application.
[0069] S102. Whenever the number of first flight time differences reaches a first preset number, the first preset number of first flight time differences are filtered to obtain the second flight time difference.
[0070] In this step, the second flight time difference can be understood as the flight time difference after filtering. The first preset number can be set according to actual conditions or experience, for example, it can be set to 7 or 11, etc. The specific value of the first preset number is not limited in this embodiment.
[0071] For example, filtering the first preset number of first flight time differences may include performing median filtering on the first preset number of first flight time differences to obtain a fourth flight time difference, and then performing Kalman filtering on the fourth flight time difference to obtain a second flight time difference.
[0072] Furthermore, since the first flight time difference is acquired periodically and can be stored in a first preset array, once the number of first flight time differences stored in the first preset array reaches a first preset number, and after filtering the first preset number of first flight time differences, the first preset number of first flight time differences stored in the first preset array can be cleared, and the subsequently acquired first flight time differences can be stored in the cleared first preset array.
[0073] Specifically, the acquired first flight time differences are filled into a first preset array in real time according to time sequence. The size of the first preset array is a first preset quantity. Data is placed in the first preset array according to the first-in-first-out principle until it is full. After the first preset array is full, it is sorted in descending or ascending order. The median value of the sorted first preset array is taken as the fourth flight time difference. The fourth flight time difference is used as the input of a Kalman filter to obtain the second flight time difference. After obtaining the second flight time difference, the first flight time differences stored in the first preset array are cleared, and the first flight time difference obtained in the next cycle is stored in the cleared first preset array.
[0074] Furthermore, the fourth flight time difference is subjected to Kalman filtering using the following formulas (1)-(5):
[0075] X k|k-1 =AX k-1|k-1 +Bu k (1)
[0076] P k|k-1 =A·P k-1|k-1 A T +Q (2)
[0077]
[0078] X k|k =X k|k-1 +K k (Z k -HX k|k-1 (4)
[0079] P k|k =(IK k H)P k|k-1 (5)
[0080] Formula (1) is the state prediction equation, Formula (2) is the mean square error prediction equation, Formula (3) is the filter gain equation, Formula (4) is the filter estimation equation, and Formula (5) is the filter mean square error update matrix.
[0081] In the above formula: X k|k-1 It is the result of predicting the current state at time k-1; X k-1|k-1 It is the optimal value at time k-1; A is the value acting on X. k-1|k-1 The transformation matrix under the state; B is the transformation matrix acting on the control variable; u k It is the control gain of the current state; P k|k-1 It is X k|k-1 The corresponding error covariance matrix; P k-1|k-1 It is Xk-1|k-1 The corresponding error covariance matrix; A T Q is the transpose of A; Q is the process noise covariance matrix of the system; K k H is the Kalman gain at time k; H is the prediction matrix at time k; H T X is the transpose of H; R is the measurement noise covariance matrix of the system; k|k Z is the optimal estimate of the state variables at time k, i.e., the output value of the Kalman filter; k It is the system's measured value, i.e., the Kalman filter input value; P k|k It is X k|k The corresponding error covariance matrix is used for the next Kalman filter; I is the identity matrix.
[0082] In this scheme, median filtering is applied to the first preset number of first flight time differences, which can initially filter out the flight time difference jumps caused by noise problems with minimal memory space; Kalman filtering is applied to the fourth flight time difference, which can smooth the fluctuation of the flight time difference and thus obtain a relatively stable flight time difference.
[0083] In addition, once the number of first flight time differences in the first preset array reaches the first preset number, and after filtering the first preset number of first flight time differences, the first flight time differences in the first preset array will be cleared to store the subsequently obtained first flight time differences. This allows a fixed array to be used to store different flight time differences, saving memory space.
[0084] S103. Whenever the number of second flight time differences reaches the second preset number, determine the third flight time difference based on the second preset number of second flight time differences.
[0085] In this step, since the first flight time difference can be obtained periodically, after processing the first flight time difference in the first preset array multiple times, a second preset number of second flight time differences can be obtained. The second preset number can be set according to actual conditions or experience; for example, it can be set to 7 or 11. This embodiment of the application does not limit the specific value of the second preset number.
[0086] For example, when determining the third flight time difference, the second preset number of second flight time differences can be sorted according to their magnitude, and the third flight time difference can be determined based on the third preset number of second flight time differences that are located at a preset position among the sorted second preset number of second flight time differences.
[0087] Specifically, the average of a third preset number of second flight time differences at a preset position can be determined, and the average value can be used as the third flight time difference.
[0088] In this step, the third preset number of second flight time differences at the preset position can be the second preset number of second flight time differences in the middle position, arranged in order. The third preset number can be odd or even. When the second preset number is odd, the third preset number is odd; when the second preset number is even, the third preset number is even. The third preset number can be set according to actual conditions or experience, but it cannot be greater than the value of the second preset number. The specific value of the third preset number is not limited in this embodiment.
[0089] Specifically, the second preset number of second flight time differences are sorted in descending or ascending order, and the third preset number of second flight time differences at preset positions are taken and averaged. This average is the third flight time difference.
[0090] In this scheme, after median filtering and Kalman filtering, interval mean filtering is then performed to further filter out the jumps in flight time difference caused by external interference, thereby smoothing the fluctuations in flight time difference.
[0091] S104. Whenever the number of third flight time differences reaches the third preset number, determine the zero-point compensation value based on the third preset number of third flight time differences.
[0092] For example, the average of a third preset number of third flight time differences is determined, and the average is set as the zero-point compensation value.
[0093] Furthermore, the obtained third flight time difference is stored in the second preset array. Once the number of third flight time differences stored in the second preset array reaches the third preset number, and the zero-point compensation value is determined based on the third preset number of third flight time differences, the third flight time differences stored in the second preset array can be cleared, and the subsequently determined third flight time differences can be stored in the cleared second preset array.
[0094] In this step, the third flight time difference is stored in a second preset array. The size of the second preset array can be a third preset number. Whenever the number of third flight time differences reaches the third preset number, that is, when the second preset array is full, the average value of the third preset number of third flight time differences can be determined, and this average value is determined as the zero-point compensation value. After determining the zero-point compensation value, the third flight time differences stored in the second preset array are cleared, and the subsequently obtained third flight time differences are stored in the cleared second preset array.
[0095] Furthermore, prediction algorithms such as linear regression, exponential smoothing, and moving average can be used instead of the multi-filter fusion algorithm in this scheme. Different prediction algorithms will produce different results. Using linear regression instead of the multi-filter fusion algorithm will make the code logic simpler and easier to implement.
[0096] In this scheme, after median filtering, Kalman filtering, and interval mean filtering, mean filtering is applied again to make the compensation value of the flight time difference more accurate. When zero-point correction is performed, the flight time difference is acquired in real time. By combining filtering algorithms such as median filtering, Kalman filtering, and mean filtering, the flight time difference jumps caused by external interference (such as noise interference) can be filtered out. This method has high stability, is suitable for real-time filtering, and the logic of each filtering algorithm is relatively simple.
[0097] S105. Perform zero-point calibration on the instrument to be calibrated based on the zero-point compensation value.
[0098] In this step, the zero-point compensation value is the zero-point calibration value obtained after multiple filtering processes, and it can be a positive or negative number.
[0099] Figure 2 The flight time difference obtained during the actual zero-point calibration process, such as Figure 2 As shown, when using the existing zero-point calibration algorithm, the zero-point compensation value is 46.02 ps due to noise; when using the zero-point calibration algorithm of this scheme, the zero-point compensation value is 26.88 ps. Figure 2 It can be seen that the zero-point compensation value obtained by the zero-point calibration algorithm of this scheme is more accurate.
[0100] The document content processing method provided in this application involves periodically acquiring the first time-of-flight difference (TOF) corresponding to the instrument to be calibrated. Whenever the number of TOFs reaches a first preset number, the first preset number of TOFs are filtered to obtain a second TOF. Whenever the number of second TOFs reaches a second preset number, a third TOF is determined based on the second preset number of second TOFs. Whenever the number of third TOFs reaches a third preset number, a zero-point compensation value is determined based on the third preset number of third TOFs. Based on the zero-point compensation value, the instrument to be calibrated is zero-point calibrated. In this application, each time a first preset number of TOFs is acquired, a second TOF is obtained after filtering, then a second preset number of second TOFs are filtered to obtain a third TOF, then a third preset number of third TOFs are filtered to obtain a zero-point compensation value, which is then used to compensate for the zero point. This method, by periodically acquiring the TOF of the instrument to be calibrated in real time and dividing the TOF into multiple groups for step-by-step filtering, avoids acquiring a large number of TOFs at once, thus solving the problem of large memory usage and reducing costs. In addition, by using median filtering, Kalman filtering, interval mean filtering, and mean filtering to smooth the fluctuations in flight time difference, the accuracy of flight time difference compensation values can be improved, making zero-point calibration more accurate.
[0101] Figure 3 A schematic flowchart of another instrument calibration method provided in this application embodiment is shown below. Figure 3 As shown, the basic procedure for zero-point calibration of an ultrasonic flow meter is as follows:
[0102] S301. Periodically obtain the flight time difference corresponding to the instrument to be calibrated.
[0103] S302. Perform median filtering on the obtained flight time difference. Specifically, set an array x[t], where t≥3. Fill the obtained flight time difference into the array x[t] in real time according to the time order. The array x[t] is arranged according to the first-in-first-out principle. After it is full, sort the data in the array x[t] in order of size. Then take the median value of the sorted array x[t], which is the median-filtered flight time difference, and clear the array x[t].
[0104] S303. The time-of-flight difference after median filtering obtained in the previous step is used as the input value of Kalman filtering and input into formula (1)-formula (5) in the previous embodiment to obtain the time-of-flight difference after Kalman filtering. The time-of-flight difference is then placed into array A, which can hold P data.
[0105] S304. Sort the P data in array A, remove the first and last (PN) / 2 values of the sorted sequence to get the N data in the middle of the sequence, and take the average of these N data to get the time difference of flight after interval mean filtering, and then clear array A.
[0106] S305. Using the flight time difference obtained in the previous step after interval mean filtering as the input value, fill array B. Array B can hold T data points. When array B is full, take the average of the flight time differences in the array to obtain the zero-point compensation value, and then clear array B.
[0107] S306. Perform zero-point calibration on the instrument to be calibrated based on the zero-point compensation value.
[0108] In this application, the flight time difference of the instrument to be calibrated is acquired periodically in real time. By employing median filtering, Kalman filtering, interval mean filtering, and mean filtering, fluctuations in the flight time difference are smoothed, improving the accuracy of the flight time difference compensation value and resulting in more accurate zero-point calibration. Furthermore, after reasonably allocating the sizes of arrays A and B, the memory footprint can be reduced by at least 10 times compared to traditional zero-point calibration algorithms. For example, a traditional zero-point calibration algorithm requires 400 bits of data to achieve relatively accurate zero-point calibration, while in this application, only 20 bits of data need to be allocated to arrays A and B respectively to achieve the same effect as traditional zero-point calibration, or even better.
[0109] Figure 4 This is a schematic diagram of the structure of a calibration device 40 for an instrument provided in an embodiment of this application. For example, please refer to [link to example]. Figure 4 As shown, the calibration device 40 of the instrument includes:
[0110] The acquisition module 401 is used to periodically acquire the first flight time difference corresponding to the instrument to be calibrated.
[0111] The processing module 402 is used to filter the first preset number of first flight time differences whenever the number of first flight time differences reaches a first preset number, so as to obtain the second flight time difference.
[0112] The determining module 403 is used to determine a third flight time difference based on the second preset number of second flight time differences whenever the number of second flight time differences reaches a second preset number.
[0113] The determination module 403 is also used to determine the zero-point compensation value based on the third preset number of third flight time differences whenever the number of third flight time differences reaches the third preset number.
[0114] The calibration module 404 is used to perform zero-point calibration on the instrument to be calibrated based on the zero-point compensation value.
[0115] Optionally, processing module 402 is specifically used for:
[0116] The median value is filtered on the first preset number of first flight time differences to obtain the fourth flight time difference.
[0117] The second flight time difference is obtained by applying Kalman filtering to the fourth flight time difference.
[0118] Optionally, module 403 is defined, specifically for:
[0119] Sort the second flight time differences according to the size of the second preset number of second flight time differences.
[0120] The third flight time difference is determined based on the third preset number of second flight time differences located at a preset position among the sorted second preset number of second flight time differences.
[0121] Optionally, module 403 is defined, specifically for:
[0122] Determine the average of a third preset number of second flight time differences at a preset location, and use the average as the third flight time difference.
[0123] Optionally, module 403 is defined, specifically for:
[0124] Determine the average of the third preset number of third flight time differences, and set the average as the zero-point compensation value.
[0125] For an example, please see Figure 5 As shown, the calibration device 40 of the instrument also includes a storage module 405.
[0126] Optionally, the first flight time difference is stored in a first preset array. The storage module 405 is used to clear the first flight time difference stored in the first preset array and store the subsequently obtained first flight time difference in the cleared first preset array.
[0127] Optionally, the third flight time difference is stored in the second preset array. The storage module 405 is also used to clear the third flight time difference stored in the second preset array and store the subsequently determined third flight time difference in the cleared second preset array.
[0128] The calibration device 40 of the instrument shown in this application embodiment can execute the technical solution of the instrument calibration method in the above embodiment. Its implementation principle and beneficial effects are similar to those of the instrument calibration method. Please refer to the implementation principle and beneficial effects of the instrument calibration method. It will not be repeated here.
[0129] Figure 6 This is a schematic diagram of the structure of an electronic device 60 provided in an embodiment of this application. For example, please refer to [link to example diagram]. Figure 6 As shown, the electronic device 60 may include a processor 601 and a memory 602; wherein,
[0130] Memory 602 is used to store computer programs.
[0131] The processor 601 is used to read the computer program stored in the memory 602 and execute the instrument calibration method in the above embodiment according to the computer program in the memory 602.
[0132] Optionally, the memory 602 can be either standalone or integrated with the processor 601. When the memory 602 is a device independent of the processor 601, the electronic device 60 may further include a bus for connecting the memory 602 and the processor 601.
[0133] Optionally, this embodiment also includes a communication interface, which can be connected to the processor 601 via a bus. The processor 601 can control the communication interface to realize the acquisition and transmission functions of the aforementioned electronic device 60.
[0134] For example, in this embodiment of the application, the electronic device 60 can be a terminal or a server, which can be set according to actual needs.
[0135] The electronic device 60 shown in this application embodiment can execute the technical solution of the instrument calibration method in the above embodiment. Its implementation principle and beneficial effects are similar to those of the instrument calibration method. Please refer to the implementation principle and beneficial effects of the instrument calibration method. It will not be repeated here.
[0136] This application also provides a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the technical solution of the instrument calibration method in the above embodiments. Its implementation principle and beneficial effects are similar to those of the instrument calibration method, and can be found in the implementation principle and beneficial effects of the instrument calibration method, which will not be repeated here.
[0137] This application also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the technical solution of the instrument calibration method in the above embodiments. Its implementation principle and beneficial effects are similar to those of the instrument calibration method. Please refer to the implementation principle and beneficial effects of the instrument calibration method, which will not be repeated here.
[0138] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0139] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or in a combination of hardware and software functional units.
[0140] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0141] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0142] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0143] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0144] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.
[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A calibration method for an instrument, characterized in that, include: The first flight time difference corresponding to the instrument to be calibrated is periodically acquired; Whenever the number of the first flight time differences reaches a first preset number, the first preset number of first flight time differences are filtered to obtain the second flight time difference; Whenever the number of second flight time differences reaches a second preset number, the second preset number of second flight time differences are sorted according to their magnitude. Based on the sorted second preset number of second flight time differences, the fourth preset number of second flight time differences located at a preset position are used to determine the third flight time difference, including: determining the average of the fourth preset number of second flight time differences located at the preset position, and determining the average as the third flight time difference; Whenever the number of the third flight time differences reaches a third preset number, a zero-point compensation value is determined based on the third preset number of the third flight time differences; The instrument to be calibrated is zero-point calibrated based on the zero-point compensation value.
2. The method according to claim 1, characterized in that, The step of filtering the first preset number of first flight time differences to obtain the second flight time difference includes: The median value is filtered on the first preset number of first flight time differences to obtain the fourth flight time difference; The second time difference is obtained by performing Kalman filtering on the fourth time difference.
3. The method according to claim 1 or 2, characterized in that, The step of determining the zero-point compensation value based on the third preset number of the third flight time differences includes: The average of the third preset number of third flight time differences is determined, and the average value is determined as the zero-point compensation value.
4. The method according to claim 1 or 2, characterized in that, The first flight time difference is stored in a first preset array; The method further includes, after filtering the first preset number of first flight time differences to obtain the second flight time difference whenever the number of the first flight time differences reaches a first preset number, the method further includes: Clear the first flight time difference stored in the first preset array, and store the subsequently obtained first flight time difference in the cleared first preset array.
5. The method according to claim 1 or 2, characterized in that, The third flight time difference is stored in the second preset array; When the number of the third flight time differences reaches a third preset number, after determining the zero-point compensation value based on the third preset number of the third flight time differences, the method further includes: Clear the third flight time difference stored in the second preset array, and store the subsequently determined third flight time difference in the cleared second preset array.
6. A calibration device for an instrument, characterized in that, include: The acquisition module is used to periodically acquire the first flight time difference corresponding to the instrument to be calibrated; The processing module is used to filter the first preset number of first flight time differences whenever the number of the first flight time differences reaches a first preset number, so as to obtain the second flight time difference; The determining module is used to sort the second preset number of second flight time differences according to the size of the second preset number of second flight time differences whenever the number of second flight time differences reaches the second preset number; Based on the sorted second preset number of second flight time differences, the fourth preset number of second flight time differences located at a preset position are used to determine the third flight time difference, including: determining the average of the fourth preset number of second flight time differences located at the preset position, and determining the average as the third flight time difference; The determining module is further configured to determine a zero-point compensation value based on the third preset number of the third flight time differences whenever the number of the third flight time differences reaches a third preset number. The calibration module is used to perform zero-point calibration on the instrument to be calibrated based on the zero-point compensation value.
7. An electronic device, characterized in that, include: Memory and processor; The memory is used to store computer programs; The processor is configured to read the computer program stored in the memory and execute the calibration method of the instrument according to any one of claims 1-5 based on the computer program in the memory.
8. A readable storage medium having a computer program stored thereon, characterized in that, The computer program stores computer execution instructions, which, when executed by a processor, are used to implement the calibration method of the instrument as described in any one of claims 1-5.
9. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, is used to implement the calibration method of the instrument according to any one of claims 1-5.