Instrument calibration method, apparatus and device, and storage medium

By calculating the difference between the expected value and the fit value in the instrument calibration method, filtering the maximum difference value and fitting the correction coefficient in segments, the problem of insufficient calibration accuracy of the instrument is solved, and low-cost high-precision calibration is achieved.

CN120333520APending Publication Date: 2025-07-18STELIGHT INSTR CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510553484.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In the prior art, conventional linear fitting of instrument calibration methods cannot meet the accuracy requirements, resulting in insufficient calibration accuracy.

Method used

By calculating the difference between the expected value and the fitted value, filter out the maximum difference value, and when the difference exceeds the maximum allowable error, the elements are excluded in sequence and the correction coefficients are fitted in segments until the accuracy requirements are met, and the fitting function is determined using at least 2 target segment sequences and corresponding correction coefficients.

Benefits of technology

It achieves low cost to improve the calibration accuracy of instruments and instruments, meets the nonlinear characteristic calibration requirements in different measurement intervals, and improves measurement accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120333520A_ABST
    Figure CN120333520A_ABST
Patent Text Reader

Abstract

The invention discloses an instrument calibration method and device, equipment and a storage medium, and relates to the technical field of instrument calibration. The method comprises the following steps: acquiring a test sequence corresponding to equipment to be calibrated and a fitting value sequence corresponding to the test sequence; the test sequence comprises an expected value sequence and an actual value sequence; calculating a difference value between an expected value and a fitting value which have a corresponding relationship in the expected value sequence and the fitting value sequence, and screening out a first maximum difference value; judging whether the first maximum difference value is greater than a maximum allowable error or not; if yes, element exclusion is carried out on the test sequence according to the sequence order to obtain a first target segment sequence, and a corresponding correction coefficient is determined through fitting; a second maximum difference value obtained after fitting based on the first target segmented sequence is not greater than the maximum allowable error; and obtaining at least two fitting functions corresponding to the test sequence according to the at least two target segment sequences corresponding to the test sequence and the corresponding at least two groups of correction coefficients. According to the invention, the calibration precision of instruments and meters can be improved at low cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of instrument calibration, and particularly relates to an instrument calibration method, device, equipment and storage medium. Background Art

[0002] Instrument calibration refers to determining the relationship between the value indicated by a measuring instrument or measuring system and the value reproduced by a standard through a series of operations under specified conditions; its purpose is to determine the indication error of the measuring device by comparing it with the standard to ensure the accuracy and reliability of the quantity value. In the prior art, proportional calibration is often used, and by adjusting the proportional factor of the instrument, its output is made linearly related to the input signal, but conventional linear fitting may not be able to normally meet the accuracy requirements. How to achieve accurate proportional calibration at low cost is an urgent problem to be solved at present. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide an instrument calibration method, device, equipment and storage medium, which can improve the calibration accuracy of instruments and meters at low cost. The specific scheme is as follows:

[0004] In a first aspect, the present application discloses an instrument calibration method, including:

[0005] Obtaining a test sequence corresponding to the device to be calibrated and a sequence of fitting values corresponding to the test sequence; the test sequence includes an expected value sequence and an actual value sequence;

[0006] Calculating the difference between the expected value and the fitting value in the expected value sequence and the fitting value sequence that have a corresponding relationship, and screening out the first maximum difference;

[0007] Judging whether the first maximum difference is greater than the maximum allowable error;

[0008] If so, excluding elements from the test sequence in sequence order to obtain a first target segmented sequence and fitting to determine the corresponding correction coefficient; the second maximum difference obtained after fitting based on the first target segmented sequence is not greater than the maximum allowable error;

[0009] According to at least two target segmented sequences corresponding to the test sequence and the corresponding at least two sets of correction coefficients, at least two fitting functions corresponding to the test sequence are obtained.

[0010] Optionally, the excluding elements from the test sequence in sequence order to obtain a first target segmented sequence and fitting to determine the corresponding correction coefficient includes:

[0011] Performing at least one element exclusion on the test sequence in sequence order to obtain a first target segmented sequence, where the second largest difference corresponding to the first target segmented sequence is not greater than the maximum allowable error;

[0012] Determining a correction coefficient corresponding to the first target segmented sequence based on the actual value sequence and the expected value sequence corresponding to the first target segmented sequence.

[0013] Optionally, after performing element exclusion on the test sequence in sequence order to obtain a first target segmented sequence and fitting to determine the corresponding correction coefficient, it further includes:

[0014] Obtaining a second target segmented sequence and a correction coefficient corresponding to the second target segmented sequence based on a new test sequence; the new test sequence includes the last element of the first target segmented sequence and the remaining sequence of the test sequence except the first target segmented sequence;

[0015] The obtaining of the second target segmented sequence and the correction coefficient corresponding to the second target segmented sequence based on the new test sequence includes:

[0016] Performing at least one element exclusion on the new test sequence in sequence order until the third largest difference corresponding to the second target segmented sequence obtained after element exclusion is not greater than the maximum allowable error;

[0017] Determining a correction coefficient corresponding to the second target segmented sequence based on the actual value sequence and the expected value sequence corresponding to the second target segmented sequence.

[0018] Optionally, the performing at least one element exclusion on the test sequence in sequence order to obtain a first target segmented sequence, where the second largest difference corresponding to the first target segmented sequence is not greater than the maximum allowable error, includes:

[0019] Performing element exclusion on the test sequence in sequence order to obtain a first subsequence after element exclusion;

[0020] Determining the third largest difference of the first subsequence based on the expected value sequence and the fitted value sequence corresponding to the first subsequence;

[0021] Judging whether the third largest difference corresponding to the first subsequence is greater than the maximum allowable error;

[0022] If so, performing element exclusion on the first subsequence to obtain a second subsequence;

[0023] If not, taking the first subsequence as the first target segmented sequence.

[0024] Optionally, the step of excluding elements from the test sequence in sequence order to obtain a first target segmented sequence and fitting to determine a corresponding correction coefficient includes:

[0025] Taking the element at the first endpoint of the sequence as the exclusion starting point, or taking the element at the second endpoint of the sequence as the exclusion starting point, and excluding elements from the test sequence in sequence order.

[0026] Optionally, performing at least one element exclusion on the test sequence in sequence order includes:

[0027] Based on the corresponding relationship between the preset difference value and the number of excluded elements, determining the number of excluded elements according to the difference value between the first maximum difference value and the maximum allowable error; the difference value is positively correlated with the number of excluded elements.

[0028] Optionally, before obtaining the second target segmented sequence and the correction coefficient corresponding to the second target segmented sequence based on the new test sequence, it further includes:

[0029] Judging whether the last element of the first target segmented sequence is the last element of the test sequence;

[0030] If not, using the last element of the first target segmented sequence as the first element, combining the remaining sequence of the test sequence except the first target segmented sequence to obtain a new test sequence, and repeating the calibration operation on the new test sequence until the last element of the latest obtained segmented sequence is the last element of the test sequence;

[0031] If so, ending the calibration operation.

[0032] Optionally, obtaining the test sequence corresponding to the device to be calibrated and the fitting value sequence corresponding to the test sequence includes:

[0033] Testing the device to be calibrated according to the calibration process to obtain a test sequence; the calibration process includes test gears and steps;

[0034] Performing linear fitting on the test sequence, and determining an initial correction coefficient according to the fitting result; the initial correction coefficient includes a slope and an intercept;

[0035] Determining the fitting value sequence according to the actual value sequence and the initial correction coefficient.

[0036] In a second aspect, the present application discloses an instrument calibration device, including:

[0037] A sequence acquisition module, configured to acquire a test sequence corresponding to the device to be calibrated and a fitting value sequence corresponding to the test sequence; the test sequence includes an expected value sequence and an actual value sequence;

[0038] A difference calculation module, configured to calculate the differences between the expected values and the fitted values in the expected value sequence and the fitted value sequence that have corresponding relationships, and screen out the first maximum difference;

[0039] A judgment module, configured to judge whether the first maximum difference is greater than the maximum allowable error;

[0040] A sequence segmentation module, configured to, if so, perform element exclusion on the test sequence in sequence order to obtain a first target segmented sequence and fit to determine the corresponding correction coefficient; the second maximum difference obtained after fitting based on the first target segmented sequence is not greater than the maximum allowable error;

[0041] A fitting function determination module, configured to obtain at least two fitting functions corresponding to the test sequence according to at least two target segmented sequences corresponding to the test sequence and the corresponding at least two sets of correction coefficients.

[0042] In a third aspect, the present application discloses an electronic device, including:

[0043] A memory, configured to store a computer program;

[0044] A processor, configured to execute the computer program to implement the foregoing instrument calibration method.

[0045] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program; wherein the computer program, when executed by a processor, implements the foregoing instrument calibration method.

[0046] In the present application, a test sequence corresponding to a device to be calibrated and a fitted value sequence corresponding to the test sequence are obtained; the test sequence includes an expected value sequence and an actual value sequence; the differences between the expected values and the fitted values in the expected value sequence and the fitted value sequence that have corresponding relationships are calculated, and the first maximum difference is screened out; it is judged whether the first maximum difference is greater than the maximum allowable error; if so, element exclusion is performed on the test sequence in sequence order to obtain a first target segmented sequence and fit to determine the corresponding correction coefficient; the second maximum difference obtained after fitting based on the first target segmented sequence is not greater than the maximum allowable error; at least two fitting functions corresponding to the test sequence are obtained according to at least two target segmented sequences corresponding to the test sequence and the corresponding at least two sets of correction coefficients. It can be seen that by calculating the differences between the expected values and the fitted values, it is judged whether the fitting accuracy is reached according to the magnitude relationship between the first maximum difference and the maximum allowable error. If the first maximum difference is greater than the maximum allowable error, that is, when the fitting accuracy is not reached, the fitting range is reduced by excluding elements and refitting is performed until the accuracy requirement is met. By performing cyclic operations until all element ratios in the test sequence are calibrated to meet the accuracy requirement, the calibration accuracy of the instrument can be improved at low cost. Description of the Drawings

[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on the provided drawings.

[0048] Figure 1 It is a flowchart of an instrument calibration method provided by this application;

[0049] Figure 2 It is a schematic diagram of an instrument calibration method in the case of no meter;

[0050] Figure 3 It is a schematic diagram of an instrument calibration method in the case of no power source;

[0051] Figure 4 It is a specific flowchart of an instrument calibration method provided by this application;

[0052] Figure 5 It is a specific broken line graph of a difference sequence provided by this application;

[0053] Figure 6 It is a specific broken line graph of a difference sequence provided by this application;

[0054] Figure 7 It is a specific broken line graph of a difference sequence provided by this application;

[0055] Figure 8 It is a specific broken line graph of a difference sequence provided by this application;

[0056] Figure 9 It is a schematic diagram of the structure of an instrument calibration device provided by this application;

[0057] Figure 10 It is a structural diagram of an electronic device provided by this application. Specific embodiments

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0059] In the prior art, proportional calibration is often adopted. By adjusting the proportional factor of the instrument, its output is made linearly related to the input signal. However, conventional linear fitting may not be able to meet the accuracy requirements normally. To overcome the above technical problems, the present application proposes an instrument calibration method that can improve the calibration accuracy of instruments at low cost.

[0060] An embodiment of the present application discloses an instrument calibration method. Refer to Figure 1 As shown, the method may include the following steps:

[0061] Step S11: Obtain a test sequence corresponding to the device to be calibrated, and a fitting value sequence corresponding to the test sequence; the test sequence includes an expected value sequence and an actual value sequence.

[0062] In this embodiment, first, a test sequence generated by testing the device to be calibrated is obtained. The test sequence includes an expected value sequence and an actual value sequence, as well as an initial correction coefficient obtained by linear fitting based on the test sequence, and a fitting value sequence obtained according to the initial correction coefficient and the actual value sequence. Instruments usually need to perform source calibration and meter calibration. Calibration consists of two parts: calibration process control and calibration algorithm calculation. Calibration process control controls the instrument or the reference device by the calibration program, mainly for collecting the expected value sequence and the actual value sequence. Linear fitting can be performed using a linear equation, such as y = kx + b, where x is the actual value sequence. At this time, the correction coefficient includes k and b, k is the fitting slope, and b is the intercept. The purpose is to make the y value after fitting the x sequence through k and b within the actually expected accuracy range.

[0063] In some embodiments, obtaining a test sequence corresponding to the device to be calibrated, and a fitting value sequence corresponding to the test sequence may include: testing the device to be calibrated according to the calibration process to obtain a test sequence; the calibration process includes a test gear and a step; performing linear fitting on the test sequence, and determining an initial correction coefficient according to the fitting result; the initial correction coefficient includes a slope and an intercept; determining a fitting value sequence according to the actual value sequence and the initial correction coefficient. That is, the calibration process program controls the device to be calibrated to enter the calibration mode, configures the output gear, the output value, and the sampling gear of the reference device.

[0064] For example, in the case of no meter, that is, without a standard meter as a reference, but through a reference device to complete the calibration. For example Figure 2 As shown, the device to be calibrated is the instrument that needs to be calibrated, and the goal is to make its output voltage accurate. The reference device is a device for providing a reference value and is used to measure the output of the device to be calibrated. The goal is to adjust the output of the device to be calibrated to approach the expected value (standard value). Assume that the device to be calibrated enters the 10V gear, that is, the output range of the device is set to 10 V. The reference device also enters the appropriate range (assumed to be 10 V as well) for measuring the output of the device under calibration. The device under calibration outputs voltages according to the specified step value (such as 0.5 V). The voltage values output by the device in sequence, for example, from -10 V to +10 V with a step of 0.5 V, i.e., -10, -9.5, -9, -8.5,..., 9.5, 10 V, which is the expected value sequence (y sequence), and these values are the values that the device should theoretically output. When the reference device samples at each voltage value output by the device under calibration, the reference device measures and records the actual output values. Such as -10.1, -9.6, -9.1,..., 9.4, 9.9 V, which is the actual value sequence (x sequence), and these values are the actually measured output values of the device and may deviate from the expected values. Based on the actual value sequence (x sequence) and the expected value sequence (y sequence), subsequent calibration algorithms are used to calculate the parameters (k and b) for correcting the output value of the device.

[0065] For example, in the passive case, that is, there is no standard source directly outputting known voltage values, but the reference device is used to simulate the function of the standard source. The device under calibration enters the 10 V range, that is, the measurement range of the device is set to 10 V. The reference device enters the appropriate range (assumed to be 10 V as well) for outputting known voltage values. Control the reference device to output voltages according to the specified step value (such as 0.5 V). The expected value sequence (y sequence) is the sequence of voltage values output by the reference device, which is -10, -9.5, -9, -8.5,..., 9.5, 10 V. The sequence of voltage values sampled and recorded by the device under calibration gives the actual value sequence (x sequence). In the case of both active and under the meter, the calibration sequences of the source and the meter can be collected simultaneously and then passed to the calibration algorithm part.

[0066] Step S12: Calculate the differences between the expected values and the fitted values with corresponding relationships in the expected value sequence and the fitted value sequence, and screen out the first maximum difference.

[0067] The expected values and fitted values in the expected value sequence and the fitted value sequence that have a corresponding relationship refer to the values with the same position in the sequence. Taking the expected value sequence -10, -9.5, -9, -8.5,..., 9.5, 10V and the actual value sequence -10.1, -9.6, -9.1,..., 9.4, 9.9V as examples, -10 and -10.1 are the expected value and the actual value with a corresponding relationship. Substituting -10.1 into the linear fitting formula gives the corresponding fitted value, and this fitted value has a corresponding relationship with -10. Specifically, a difference calculation operation can be performed based on the expected value sequence and the fitted value sequence to obtain the difference between the expected values and the fitted values in the expected value sequence and the fitted value sequence that have a corresponding relationship. Based on all the differences, a difference sequence is obtained, and the first maximum difference is selected from the difference sequence. The difference between the corresponding expected value and the fitted value can reflect the accuracy of the linear fitting, and the first maximum difference is selected for the fitting accuracy judgment.

[0068] Step S13: Determine whether the first maximum difference is greater than the maximum allowable error.

[0069] That is, after obtaining the maximum difference, first judge the numerical size relationship between the maximum difference and the maximum allowable error. The maximum allowable error can be preset and adjusted according to the accuracy requirements. If the first maximum difference corresponding to the test sequence is greater than the maximum allowable error, it indicates that the current correction coefficient of the test sequence does not meet the accuracy requirements. If the first maximum difference is not greater than the maximum allowable error, it indicates that the current correction coefficient of the test sequence does not meet the accuracy requirements.

[0070] Step S14: If so, perform element exclusion on the test sequence in sequence order to obtain a first target segmented sequence and fit to determine the corresponding correction coefficient; the second maximum difference obtained after fitting based on the first target segmented sequence is not greater than the maximum allowable error.

[0071] Among them, performing element exclusion on the test sequence in sequence order to obtain a first target segmented sequence and fit to determine the corresponding correction coefficient includes: performing at least one element exclusion on the test sequence in sequence order to obtain a first target segmented sequence, and the second maximum difference corresponding to the first target segmented sequence is not greater than the maximum allowable error; determining the correction coefficient corresponding to the first target segmented sequence based on the actual value sequence and the expected value sequence corresponding to the first target segmented sequence. That is, perform at least one element exclusion to obtain a first target segmented sequence that meets the maximum allowable error.

[0072] Among them, obtaining a first target segmented sequence by performing at least one element exclusion on the test sequence in sequence order, where the second largest difference corresponding to the first target segmented sequence is not greater than the maximum allowable error, includes: performing element exclusion on the test sequence in sequence order to obtain a first subsequence after element exclusion; determining the third largest difference of the first subsequence based on the expected value sequence corresponding to the first subsequence and the fitted value sequence; determining whether the third largest difference corresponding to the first subsequence is greater than the maximum allowable error; if so, performing element exclusion on the first subsequence to obtain a second subsequence; if not, taking the first subsequence as the first target segmented sequence. That is, sometimes multiple element exclusion operations may be required for the correction coefficient of the obtained subsequence to be not greater than the maximum allowable error.

[0073] The maximum allowable error can be preset and adjusted according to the precision requirements. If the first largest difference is greater than the maximum allowable error, it indicates that the current correction coefficient does not meet the precision requirements. To make the correction coefficient meet the requirements, the range is narrowed by removing some elements and the correction coefficient is recalculated. An element is a single value in the sequence. For example, in the sequence -10, -9.5, -9, -8.5,..., 9.5, 10V, -10 is an element. The exclusion of elements is carried out in sequence order, that is, in the order from start to end or from end to start, and it needs to be excluded one by one. By excluding until the second largest difference of the subsequence obtained after element exclusion is less than the maximum allowable error, this subsequence is the target segmented sequence. That is to say, for the actual value subsequence of this subsequence combined with the current correction coefficient, the obtained fitted value subsequence, the difference between this fitted value subsequence and the expected value subsequence meets the error requirements. In this way, the entire test sequence is divided into multiple segmented sequences, and each element in the test sequence belongs to a segmented sequence. This can be used to process the non-linear characteristics of the device in different measurement intervals, and the measurement error can be adjusted and corrected more precisely through segmented calibration.

[0074] At the same time, record the relevant information of the segmented sequence, such as the element information included in this segmented sequence, that is, the number of elements and the start and end elements, and the segmented number corresponding to this segmented sequence, the memory start address of the final correction coefficient corresponding to this segmented sequence, etc.

[0075] In some embodiments, after obtaining the first target segmented sequence by excluding elements from the test sequence in sequence order and fitting to determine the corresponding correction coefficient, the following steps are further included: obtaining a second target segmented sequence and a correction coefficient corresponding to the second target segmented sequence based on a new test sequence; the new test sequence includes the last element of the first target segmented sequence and the remaining sequence of the test sequence except the first target segmented sequence. Among them, obtaining the second target segmented sequence and the correction coefficient corresponding to the second target segmented sequence based on the new test sequence includes: excluding elements from the new test sequence in sequence order at least once until the third maximum difference corresponding to the second target segmented sequence obtained after element exclusion is not greater than the maximum allowable error; determining the correction coefficient corresponding to the second target segmented sequence based on the actual value sequence and the expected value sequence corresponding to the second target segmented sequence. That is, first judge the numerical size relationship between the first maximum difference and the maximum allowable error. If the first maximum difference is greater than the maximum allowable error, perform the operations of element exclusion and recalculating the maximum difference of the subsequence. If the first maximum difference is less than the maximum allowable error, that is, the current initial correction coefficient already meets the accuracy requirements and can be directly used as the final correction coefficient. After the final correction coefficient of the segmented sequence has been determined, use the remaining sequence, that is, the sequence for which the final correction coefficient has not been determined, as the new test sequence. Similarly, the new test sequence includes a new expected value sequence and a new actual value sequence. That is, the new expected value sequence is a part of the original expected value sequence, and the new actual value sequence is a part of the original actual value sequence. Then, perform segmentation on the new test sequence to determine a segmented sequence that meets the requirements.

[0076] In some embodiments, before obtaining the second target segmented sequence and the correction coefficient corresponding to the second target segmented sequence based on the new test sequence, the following steps are further included: determining whether the last element of the latest obtained segmented sequence is the last element of the test sequence; if not, use the last element of the first target segmented sequence as the first element, combine it with the remaining sequence of the test sequence except the first target segmented sequence to obtain a new test sequence, and repeat the calibration operation on the new test sequence until the last element of the latest obtained segmented sequence is the last element of the test sequence; if so, end the calibration operation. That is, to ensure the continuity of elements, the last element of the segmented sequence needs to be used as the first element of the new test sequence. Taking the sequence x: x1, x2, x3, x4, x5, x6, x7, x8, x9, x 10 as an example, if the first segmented sequence is x1, x2, x3, then the new test sequence is x3, x4, x5, x6, x7, x8, x9, x 10 .

[0077] In some embodiments, performing element exclusion on the test sequence in sequence order to obtain a first target segmented sequence and fitting to determine a corresponding correction coefficient includes: using the element at the first end point of the sequence as the exclusion starting point, or using the element at the second end point of the sequence as the exclusion starting point, and performing element exclusion on the test sequence in sequence order to obtain a subsequence after element exclusion. That is, the sequence includes two end points, and element exclusion can start from one of the end points or from the other end point, but all exclusion operations for a single test sequence need to start from the same end point.

[0078] In some embodiments, performing at least one element exclusion on the test sequence in sequence order includes: based on the corresponding relationship between the preset difference value and the number of excluded elements, determining the number of excluded elements according to the difference value between the first maximum difference value and the maximum allowable error; the difference value is positively correlated with the number of excluded elements. It can be understood that if the difference value is relatively large, excluding only one element each time may increase the number of operations. If the difference value is relatively small, excluding multiple elements at a time may result in mis-exclusion. Therefore, the corresponding relationship between the difference value and the number of elements can be pre-constructed, and the number of elements to be excluded this time can be judged according to the difference value, thereby improving the calibration speed.

[0079] Illustrate the above steps by way of example. The maximum allowable error tolerance = 0.0005, y sequence, y

[41] = {-20.00, -19.00, -18.00, -17.00, -16.00, -15.00, -14.00, -13.00, -12.00, -11.00, -10.00, -9.00, -8.00, -7.00, -6.00, -5.00, -4.00, -3.00, -2.00, -1.00, 0.00, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00, 11.00, 12.00, 13.00, 14.00, 15.00, 16.00, 17.00, 18.00, 19.00, 20.00}. x sequence, x

[41] = {-20.000523, -19.000244, -18.000671, -17.000845, -16.000129, -15.000453, -14.000678, -13.000892, -12.000311, -11.000741, -10.000125, -9.000399, -8.000832, -7.000273, -6.000614, -5.000984, -4.000157, -3.000876, -2.000213, -1.000759, 0.000523, 1.000244, 2.000671, 3.000845, 4.000129, 5.000453, 6.000678, 7.000892, 8.000311, 9.000741, 10.000125, 11.000399, 12.000832, 13.000273, 14.000614, 15.000984, 16.000157, 17.000876, 18.000213, 19.000759, 20.000347}. Calculate that the first maximum difference is greater than 0.0005, and calculate the difference between the first maximum difference and 0.0005 (i.e., the above difference value).For example, if the difference value is 0.0001, query the corresponding relationship between the preset difference value and the number of elements, determine that the number of elements to be excluded is 5, and obtain the y sequence after exclusion, y

[36] = {-20.00, -19.00, -18.00, -17.00, -16.00, -15.00, -14.00, -13.00, -12.00, -11.00, -10.00, -9.00, -8.00, -7.00, -6.00, -5.00, -4.00, -3.00, -2.00, -1.00, 0.00, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00, 11.00, 12.00, 13.00, 14.00, 15.00}. The x sequence is obtained in the same way as x

[36] . Recalculate the first maximum difference for y

[36] and x

[36] . If the first maximum difference is greater than 0.0005, recalculate the difference value. For example, if the difference value is 0.00005, query the corresponding relationship between the preset difference value and the number of elements, and determine that the number of elements to be excluded is 2. And so on, until the maximum difference of the sequence after exclusion is less than 0.00005. It should be noted that the above values are only for illustration and not actual data.

[0080] Among them, if the first maximum difference is greater than the maximum allowable error, element exclusion is performed on the test sequence in the sequence order, including: if the first maximum difference is greater than the maximum allowable error, exclude the last element of the expected value sequence to obtain the expected value sequence after exclusion, and exclude the last element of the actual value sequence to obtain the actual value sequence after exclusion; obtain the subsequence after element exclusion based on the expected value sequence after exclusion and the actual value sequence after exclusion. In a specific embodiment, the last element of the sequence can be excluded each time. For the sequence x: x1, x2, x3, x4, x5, x6, x7, x8, x9, x 10 For example, the initial correction coefficient of the sequence does not meet the requirements, and x 10 is excluded to obtain the subsequence x1, x2, x3, x4, x5, x6, x7, x8, x9. The correction coefficient of the subsequence also does not meet the requirements, so x9 is excluded to obtain the subsequence x1, x2, x3, x4, x5, x6, x7, x8. Repeat the operation until the obtained target subsequence x1, x2, x3, x4, x5 meets the requirements, and this target subsequence is the first segmented sequence.

[0081] Step S15: Obtain at least two fitting functions corresponding to the test sequence according to at least two target segmented sequences corresponding to the test sequence and the corresponding at least two sets of correction coefficients.

[0082] That is, the operations in steps S11 - S14 are repeated for the new test sequence until all elements in the test sequence belong to the segmented sequence, that is, each element has a corresponding final correction coefficient, and the fitting function is determined based on the correction coefficient. Thus, according to the accuracy requirements, the most suitable segmentation interval is adaptively found and the segmentation is automatically completed, ending the calibration. That is, linear fitting is performed on x and y according to the fitting formula. After the fitting is completed, all the x data are verified with the calculated k and b; if it is not within the accuracy range, the fitting interval is narrowed and refitted until the accuracy meets the set requirements; after one segment is verified, the linear fitting of the remaining sequence is automatically performed until all data meet the accuracy requirements.

[0083] For example Figure 4 The following shows a flowchart of a specific instrument calibration method. S21: Calculate k and b based on sequence x and sequence y. S22: Starting from the first element of the x sequence, obtain the fitting value sequence according to result (fitting value) = kx + b respectively. S23: Perform data preprocessing, and save the difference between each element of the fitting value sequence and the y sequence as the difference sequence. S24: Directly find the element with the largest absolute value in the difference sequence. If the comparison fails, exclude the last element and refit. Then repeat the processes of S22, S23, and S24. Until it passes and enters process S25. S25: Verify whether the end information of the segmented information is at the last element of the sequence. If not, enter process S26. S26: The segmentation is not completed. Record the start segment information, end segment information, and the values of k and b that have passed the verification; use the end segment position of this segment as the start position of the next segment. Continue to repeat process S22. Until all segments are automatically verified. For example, if the segmentation from 1 to 4 is verified, the segmented information block is obtained: {mix:0 max:3 k:1.xxxb:0.9xxx}, that is, the 0th element to the 3rd element is a segmented sequence, and the starting point of the next segment is x[3]. After all segments are verified, output the segmented information memory and calculate the number of segments for the convenience of the application layer.

[0084] An example is given for the above steps. For the y sequence, y

[41] = {-20.00, -19.00, -18.00, -17.00, -16.00, -15.00, -14.00, -13.00, -12.00, -11.00, -10.00, -9.00, -8.00, -7.00, -6.00, -5.00, -4.00, -3.00, -2.00, -1.00, 0.00, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00, 11.00, 12.00, 13.00, 14.00, 15.00, 16.00, 17.00, 18.00, 19.00, 20.00}.

[0085] The x sequence, x

[41] = {-20.000523, -19.000244, -18.000671, -17.000845, -16.000129, -15.000453, -14.000678, -13.000892, -12.000311, -11.000741, -10.000125, -9.000399, -8.000832, -7.000273, -6.000614, -5.000984, -4.000157, -3.000876, -2.000213, -1.000759, 0.000523, 1.000244, 2.000671, 3.000845, 4.000129, 5.000453, 6.000678, 7.000892, 8.000311, 9.000741, 10.000125, 11.000399, 12.000832, 13.000273, 14.000614, 15.000984, 16.000157, 17.000876, 18.000213, 19.000759, 20.000347}。

[0086] If the maximum allowable error tolerance = 0.0005, with element numbers from -20 to 20, three segmented sequences are obtained: Min: -20 to Max: -1, k: 0.999996, b: -0.000579016; Min: -1 to Max: 0, k: 1.00128, b: 0.000523; Min: 0 to Max: 20, k: 1, b: 0.000516069. At this time, the broken line of the difference sequence is as Figure 5 shown. If the maximum allowable error tolerance = 0.0004, 15 segmented sequences are obtained, and at this time, the broken line of the difference sequence is as Figure 6 shown. If the maximum allowable error tolerance = 0.0003, 28 segmented sequences are obtained, and at this time, the broken line of the difference sequence is as Figure 7 shown. If the maximum allowable error tolerance = 0.0002, 30 segmented sequences are obtained, and at this time, the broken line of the difference sequence is as Figure 8 shown. It can be seen that the present application can perform adaptive piecewise linear fitting on the input data. The higher the accuracy requirement, the more automatic segmentation is, and both the memory space and accuracy requirements can achieve adaptive optimization.

[0087] As can be seen from the above, in this embodiment, a test sequence corresponding to the device to be calibrated and a sequence of fitting values corresponding to the test sequence are obtained; the test sequence includes an expected value sequence and an actual value sequence; the differences between the expected values and the fitting values with corresponding relationships in the expected value sequence and the fitting value sequence are calculated, and the first maximum difference is screened out; it is determined whether the first maximum difference is greater than the maximum allowable error; if so, elements of the test sequence are excluded in sequence order to obtain a first target segmented sequence and the corresponding correction coefficient is determined by fitting; the second maximum difference obtained by fitting based on the first target segmented sequence is not greater than the maximum allowable error; at least two fitting functions corresponding to the test sequence are obtained according to at least two target segmented sequences corresponding to the test sequence and the corresponding at least two sets of correction coefficients. It can be seen that by calculating the differences between the expected values and the fitting values, it is determined whether the fitting accuracy is achieved according to the magnitudes of the first maximum difference and the maximum allowable error. If the first maximum difference is greater than the maximum allowable error, that is, when the fitting accuracy is not achieved, the fitting range is reduced by excluding elements and refitting is performed until the accuracy requirement is met. By performing cyclic operations until all element ratios in the test sequence are calibrated to meet the accuracy requirement, the calibration accuracy of the instrument can be improved at low cost.

[0088] Correspondingly, an embodiment of the present application also discloses an instrument calibration device, as shown in Figure 9 The device includes:

[0089] A sequence acquisition module 11, configured to acquire a test sequence corresponding to the device to be calibrated and a sequence of fitting values corresponding to the test sequence; the test sequence includes an expected value sequence and an actual value sequence;

[0090] A difference calculation module 12, configured to calculate the differences between the expected values and the fitting values with corresponding relationships in the expected value sequence and the fitting value sequence, and screen out the first maximum difference;

[0091] A judgment module 13, configured to judge whether the first maximum difference is greater than the maximum allowable error;

[0092] A sequence segmentation module 14, configured to, if so, exclude elements of the test sequence in sequence order to obtain a first target segmented sequence and determine the corresponding correction coefficient by fitting; the second maximum difference obtained by fitting based on the first target segmented sequence is not greater than the maximum allowable error;

[0093] A fitting function determination module 15, configured to obtain at least two fitting functions corresponding to the test sequence according to at least two target segmented sequences corresponding to the test sequence and the corresponding at least two sets of correction coefficients.

[0094] As can be seen from the above, in this embodiment, a test sequence corresponding to the device to be calibrated and a sequence of fitting values corresponding to the test sequence are obtained; the test sequence includes an expected value sequence and an actual value sequence; the differences between the expected values and the fitting values with corresponding relationships in the expected value sequence and the fitting value sequence are calculated, and the first maximum difference is screened out; it is determined whether the first maximum difference is greater than the maximum allowable error; if so, the elements of the test sequence are excluded in sequence order to obtain a first target segmented sequence and the corresponding correction coefficient is determined by fitting; the second maximum difference obtained by fitting based on the first target segmented sequence is not greater than the maximum allowable error; at least two fitting functions corresponding to the test sequence are obtained according to at least two target segmented sequences corresponding to the test sequence and the corresponding at least two sets of correction coefficients. It can be seen that by calculating the difference between the expected value and the fitting value, it is judged whether the fitting accuracy is reached according to the magnitude of the first maximum difference and the maximum allowable error. If the first maximum difference is greater than the maximum allowable error, that is, when the fitting accuracy is not reached, the fitting range is narrowed by excluding elements and fitting is performed again until the accuracy requirement is met. By performing cyclic operations until all element ratios in the test sequence meet the accuracy requirement after calibration, the calibration accuracy of the instrument can be improved at low cost.

[0095] In some specific embodiments, the sequence segmentation module 14 may specifically include:

[0096] A first target segmented sequence determination unit, configured to perform at least one element exclusion on the test sequence in sequence order to obtain a first target segmented sequence, and the second maximum difference corresponding to the first target segmented sequence is not greater than the maximum allowable error;

[0097] A correction coefficient determination unit, configured to determine the correction coefficient corresponding to the first target segmented sequence based on the actual value sequence and the expected value sequence corresponding to the first target segmented sequence.

[0098] In some specific embodiments, the sequence segmentation module 14 may specifically include:

[0099] A segmentation unit, configured to, after performing element exclusion on the test sequence in sequence order to obtain a first target segmented sequence and determining the corresponding correction coefficient by fitting, obtain a second target segmented sequence and the correction coefficient corresponding to the second target segmented sequence based on a new test sequence; the new test sequence includes the last element of the first target segmented sequence and the remaining sequence of the test sequence except the first target segmented sequence;

[0100] The segmentation unit is specifically configured to perform at least one element exclusion on the new test sequence in sequence order until the third maximum difference corresponding to the second target segmented sequence obtained after the element exclusion is not greater than the maximum allowable error; and determine the correction coefficient corresponding to the second target segmented sequence based on the actual value sequence and the expected value sequence corresponding to the second target segmented sequence.

[0101] In some specific embodiments, the first target segmented sequence determination unit may specifically include:

[0102] The element exclusion unit is configured to perform element exclusion on the test sequence in sequence order to obtain a first subsequence after the element exclusion;

[0103] The difference determination unit is configured to determine the third maximum difference of the first subsequence based on the expected value sequence and the fitted value sequence corresponding to the first subsequence;

[0104] The judgment unit is configured to judge whether the third maximum difference corresponding to the first subsequence is greater than the maximum allowable error;

[0105] The element exclusion unit is configured to, if so, perform element exclusion on the first subsequence to obtain a second subsequence;

[0106] The sequence determination unit is configured to, if not, use the first subsequence as the first target segmented sequence.

[0107] In some specific embodiments, the sequence segmentation module 14 may specifically include:

[0108] The element exclusion unit is configured to perform element exclusion on the test sequence in sequence order starting from the element at the first end point of the sequence or starting from the element at the second end point of the sequence.

[0109] In some specific embodiments, the first target segmented sequence determination unit may specifically include:

[0110] The excluded element quantity determination unit is configured to determine the excluded element quantity based on the corresponding relationship between the preset difference value and the excluded element quantity according to the difference value between the first maximum difference and the maximum allowable error; the difference value is positively correlated with the excluded element quantity.

[0111] In some specific embodiments, the segmentation unit may specifically include:

[0112] The judgment unit is configured to judge whether the last element of the first target segmented sequence is the last element of the test sequence before obtaining the second target segmented sequence and the correction coefficient corresponding to the second target segmented sequence;

[0113] A new test sequence determination unit, which, if the answer is no, uses the last element of the first target segmented sequence as the first element, combines the remaining sequence in the test sequence except the first target segmented sequence to obtain a new test sequence, and repeats the calibration operation on the new test sequence until the last element of the latest obtained segmented sequence is the last element of the test sequence;

[0114] A calibration end unit, which, if the answer is yes, ends the calibration operation.

[0115] In some specific embodiments, the sequence acquisition module 11 may specifically include:

[0116] A test sequence acquisition unit, which is used to obtain a test sequence by testing the device to be calibrated according to the calibration process; the calibration process includes test gears and steps;

[0117] A linear fitting unit, which is used to perform linear fitting on the test sequence and determine an initial correction coefficient according to the fitting result; the initial correction coefficient includes a slope and an intercept;

[0118] A fitted value sequence determination unit, which is used to determine a fitted value sequence according to the actual value sequence and the initial correction coefficient.

[0119] Furthermore, an embodiment of the present application also discloses an electronic device. Refer to Figure 10 as shown. The content in the figure cannot be regarded as any limitation on the scope of use of the present application.

[0120] Figure 10 is a schematic structural diagram of an electronic device 20 provided by an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the instrument calibration method disclosed in any of the foregoing embodiments.

[0121] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.

[0122] In addition, as a carrier for storing resources, the memory 22 can be a read-only memory, a random access memory, a magnetic disk, an optical disc, etc. The resources stored thereon include an operating system 221, a computer program 222, data 223 including test sequences, etc. The storage method can be temporary storage or permanent storage.

[0123] Among them, the operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to enable the processor 21 to perform operations and processing on the massive data 223 in the memory 22. It can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the instrument calibration method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.

[0124] Furthermore, an embodiment of the present application also discloses a computer storage medium. When the computer-executable instructions stored in the computer storage medium are loaded and executed by a processor, the steps of the instrument calibration method disclosed in any of the foregoing embodiments are implemented.

[0125] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts between the various embodiments, reference can be made to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple. For the relevant parts, reference can be made to the description of the method part.

[0126] The steps of the method or algorithm described in combination with the embodiments disclosed in this article can be directly implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0127] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0128] The above has introduced in detail a method, device, equipment and storage medium for calibrating an instrument provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. An instrument calibration method, characterized in that, Including: Obtain a test sequence corresponding to the device to be calibrated, and a sequence of fitting values corresponding to the test sequence; The test sequence includes an expected value sequence and an actual value sequence; Calculate the difference between the expected value and the fitting value with a corresponding relationship in the expected value sequence and the fitting value sequence, and screen out the first maximum difference; Determine whether the first maximum difference is greater than the maximum allowable error; If so, exclude elements from the test sequence in sequence order to obtain a first target segmented sequence and fit to determine the corresponding correction coefficient; the second maximum difference obtained after fitting based on the first target segmented sequence is not greater than the maximum allowable error; According to at least two target segmented sequences corresponding to the test sequence and at least two sets of corresponding correction coefficients, obtain at least two fitting functions corresponding to the test sequence.

2. The instrument calibration method according to claim 1, characterized in that The excluding elements from the test sequence in sequence order to obtain a first target segmented sequence and fitting to determine the corresponding correction coefficient includes: Exclude elements from the test sequence in sequence order at least once to obtain a first target segmented sequence, and the second maximum difference corresponding to the first target segmented sequence is not greater than the maximum allowable error; Determine the correction coefficient corresponding to the first target segmented sequence based on the actual value sequence and the expected value sequence corresponding to the first target segmented sequence.

3. The instrument calibration method according to claim 2, wherein After excluding elements from the test sequence in sequence order to obtain a first target segmented sequence and fitting to determine the corresponding correction coefficient, it further includes: Obtain a second target segmented sequence and the correction coefficient corresponding to the second target segmented sequence based on a new test sequence; the new test sequence includes the last element of the first target segmented sequence and the remaining sequence of the test sequence except the first target segmented sequence; The obtaining a second target segmented sequence and the correction coefficient corresponding to the second target segmented sequence based on the new test sequence includes: Exclude elements from the new test sequence in sequence order at least once until the third maximum difference corresponding to the second target segmented sequence obtained after element exclusion is not greater than the maximum allowable error; Determine the correction coefficient corresponding to the second target segmented sequence based on the actual value sequence and the expected value sequence corresponding to the second target segmented sequence.

4. The instrument calibration method according to claim 2, wherein The excluding elements from the test sequence in sequence order at least once to obtain a first target segmented sequence, and the second maximum difference corresponding to the first target segmented sequence is not greater than the maximum allowable error includes: Exclude elements from the test sequence in sequence order to obtain a first subsequence after element exclusion; Determine the third maximum difference of the first subsequence based on the expected value sequence and the fitting value sequence corresponding to the first subsequence; Determine whether the third maximum difference corresponding to the first subsequence is greater than the maximum allowable error; If so, exclude elements from the first subsequence to obtain a second subsequence; If not, use the first subsequence as the first target segmented sequence.

5. The instrument calibration method according to claim 2, characterized in that, The excluding elements from the test sequence in sequence order to obtain a first target segmented sequence and fitting to determine the corresponding correction coefficient includes: Exclude elements from the test sequence in sequence order, starting from the element at the first end point of the sequence or the element at the second end point of the sequence.

6. The instrument calibration method according to claim 2, wherein The at least one element exclusion from the test sequence in sequence order includes: Based on the correspondence between the preset difference value and the number of excluded elements, determine the number of excluded elements according to the difference value between the first maximum difference value and the maximum allowable error; the difference value is positively correlated with the number of excluded elements.

7. The instrument calibration method according to claim 3, characterized in that Before obtaining the second target segmented sequence corresponding to the new test sequence and the correction coefficient corresponding to the second target segmented sequence, it further includes: Judge whether the last element of the first target segmented sequence is the last element of the test sequence; If not, use the last element of the first target segmented sequence as the first element, combine the remaining sequence of the test sequence except the first target segmented sequence to obtain a new test sequence, and repeat the calibration operation on the new test sequence until the last element of the latest obtained segmented sequence is the last element of the test sequence; If so, end the calibration operation.

8. The instrument calibration method according to any one of claims 1 to 7, characterized in that, Obtain the test sequence corresponding to the device to be calibrated and the fitted value sequence corresponding to the test sequence, including: Obtain the test sequence by testing the device to be calibrated according to the calibration process; the calibration process includes test gears and steps; Perform linear fitting on the test sequence, and determine the initial correction coefficient according to the fitting result; the initial correction coefficient includes the slope and the intercept; Determine the fitted value sequence according to the actual value sequence and the initial correction coefficient.

9. An instrument calibration device, characterized in that, It includes: A sequence acquisition module for obtaining the test sequence corresponding to the device to be calibrated and the fitted value sequence corresponding to the test sequence; The test sequence includes an expected value sequence and an actual value sequence; A difference calculation module for calculating the difference between the expected value and the fitted value corresponding to each other in the expected value sequence and the fitted value sequence, and screening out the first maximum difference value; A judgment module for judging whether the first maximum difference value is greater than the maximum allowable error; A sequence segmentation module for, if so, exclude elements from the test sequence in sequence order to obtain a first target segmented sequence and fit to determine the corresponding correction coefficient; the second maximum difference value obtained based on the fitting of the first target segmented sequence is not greater than the maximum allowable error; A fitting function determination module for obtaining at least two fitting functions corresponding to the test sequence according to at least two target segmented sequences corresponding to the test sequence and the corresponding at least two sets of correction coefficients.

10. An electronic device, characterized in that, It includes: A memory for storing computer programs; A processor for executing the computer program to implement the instrument calibration method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, For storing computer programs; wherein the computer program, when executed by the processor, implements the instrument calibration method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Calibration model establishment method and device, equipment, medium and instrument calibration method

    CN121683297A

  • Calibration model establishment method, device, equipment, medium and instrument calibration method

    CN121683297B