A calibration method and storage medium

By employing recursive thinking and sampling point optimization, combined with translation-zero correction, high accuracy and efficiency of current calibration are achieved, solving the problems of insufficient accuracy and high computational complexity in existing methods.

CN119693465BActive Publication Date: 2025-11-11NINGBO PREH JOYSON AUTOMOTIVE ELECTRONICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411488096.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-11-11
Estimated Expiration
2044-10-23

AI Technical Summary

Technical Problem

Existing current calibration methods have room for improvement in accuracy, especially when using the same gain. The multi-segment one-dimensional line fitting method increases the computational complexity of the MCU and may not necessarily fit a result better than the combination of multi-segment one-dimensional lines.

Method used

Using a recursive approach, by setting sampling points that conform to a normal distribution and a second sampling point determined based on multiple actual sampling samples, effective segmentation points are found, minimum approach line fitting is performed, and combined with translation and zeroing correction, the relationship between the internal detection current feedback and the actual current is obtained.

Benefits of technology

It improves the accuracy of current calibration, reduces errors, simplifies the calculation process, and enhances the reliability and efficiency of the calibration method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693465B_ABST
    Figure CN119693465B_ABST
Patent Text Reader

Abstract

The application provides a calibration method and a storage medium. Compared with the existing calibration method, the calibration method provided by the application has higher accuracy and smaller error. The calibration method comprises the following steps: S1: setting a sampling point and collecting detection data; S2: fitting according to the detection data; S3: searching for an effective segmentation point; S4: fitting again to obtain a plurality of minimum approaching straight lines and determine a polyline segment; S5: repeating steps S3 and S4 for each minimum approaching straight line in the polyline segment until the number of sampling points on each minimum approaching straight line in the polyline segment is less than 3 or there is no effective segmentation point on each minimum approaching straight line in the polyline segment, and a first final polyline segment is obtained; S6: judging and correcting the slope of each minimum approaching straight line in the first final polyline segment, fitting again to determine a new minimum approaching straight line, and obtaining a second final polyline segment; and S7: performing parameter inverse transformation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent information processing technology, and in particular to a calibration method. Background Technology

[0002] The Battery Management System (BMS) is a crucial component of modern battery technology, widely used in electric vehicles, energy storage systems, and portable electronic devices. Current calibration is an important method within BMS, helping to calibrate the current measurement devices and ensure accurate monitoring and display of the actual battery pack current. It also improves the efficiency of the BMS in detecting anomalies such as overcharging and over-discharging, thus preventing battery damage and safety hazards. For example, when the current exceeds a set threshold, the BMS can trigger alarms or take protective measures to maintain battery pack stability.

[0003] For current calibration, a segmented approach is generally used, converting values ​​in different current segments to their actual values ​​using different scaling factors. Typically, the scaling factors calculated differ for different op-amp gains, but in practical applications, the same scaling factor is often used for the same gain. Using the same scaling factor allows for simpler fitting of multiple one-dimensional linear combinations, as well as more complex curve fitting with more sampling. However, curve fitting is less practical for production, increases the complexity of MCU calculations and processing time, and doesn't necessarily yield better results than the combination of multiple one-dimensional linear combinations. Therefore, one-dimensional linear fitting is more widely used in practice. The commonly used formula for one-dimensional linear fitting is y = kx + b, where y is the actual current value, and x is the current value obtained from the ADC acquired by the MCU and calculated using sampling resistors, etc. To reduce errors in calculating k and b, samples are typically taken from positions as close as possible to the start and end of the current segment, and then the corresponding k and b are calculated. While existing current calibration methods can calibrate current, there is still room for improvement in accuracy. Summary of the Invention

[0004] The advantage of this application is that it provides a calibration method that can calibrate the current more accurately than existing calibration methods.

[0005] Based on this, in order to achieve at least one of the above advantages or other benefits and objectives of this application, this application provides a calibration method, comprising the following steps:

[0006] S1: Set sampling points and collect corresponding detection data from the output source based on the sampling points;

[0007] S2: Based on the detection data, perform fitting to determine the minimum approach line of the detection data, and determine the starting point and ending point based on the minimum approach line, the preset initial point X-axis coordinate X1 and the ending point X-axis coordinate X2.

[0008] S3: Find valid segmentation points based on the minimum approach line and the sampling points. Among the sampling points, find the sampling point with the largest distance A1 from the minimum approach line and the distance A1 ≥ the preset segmentation threshold A. If it cannot be found, find the sampling point with the relative error B1 ≥ the preset relative error threshold B and the farthest distance from the minimum approach line. The found sampling point is the valid segmentation point. The segmentation threshold A and the relative error threshold B are set based on multiple pre-sampled samples.

[0009] S4: Based on the starting point, the ending point, the effective segment point, and the detection data, perform fitting to obtain the minimum approaching straight line between the starting point, the ending point, and the effective segment point, and determine the broken line segment of the detection data;

[0010] S5: Detect whether the number of sampling points on each minimum approach line in the broken line segment is less than 3. If it is not less than 3, then detect whether there are no valid segmentation points on each minimum approach line in the broken line segment. If there are valid segmentation points, then repeat steps S3 and S4 until the number of sampling points on each minimum approach line in the broken line segment is less than 3 or there are no valid segmentation points on each minimum approach line in the broken line segment, and obtain the first final broken line segment.

[0011] S6: Calculate the slope of each minimum approach line in the first final broken line segment and compare it with zero. If there is a minimum approach line with a slope less than zero, then refit the detection data of the minimum approach line and the detection data of the minimum approach line adjacent to the minimum approach line to determine a new minimum approach line and obtain the second final broken line segment.

[0012] S7: Perform inverse parametric transformation on the expressions of each minimum approaching line in the second final segment to obtain the relationship between the internal detection current feedback and the actual current.

[0013] With this setting, compared to the scheme that does not calculate the minimum approach line, the scheme provided in this application adopts a recursive approach, calculates the minimum approach line, and uses the segmentation threshold A and the relative error threshold B set according to multiple pre-sampled samples to make the obtained line segment closer to the theoretical standard curve image of the sampled output source.

[0014] According to one embodiment of this application, the sampling points set include a first sampling point conforming to a normal distribution and a second sampling point determined based on samples from multiple actual samplings.

[0015] This setup, with the first sampling point conforming to a normal distribution, allows the sampling points to reflect the approximate location of each point, ultimately making the fitting result closer to the actual situation. Setting the second sampling point, determined based on multiple actual samples, makes the location of the subsequent effective segmentation points more reasonable. Compared to the scheme that only sets the first sampling point conforming to a normal distribution, this scheme can reduce the error caused by calibration and improve accuracy.

[0016] According to one embodiment of this application, the process of setting the second sampling point is as follows: based on the estimated position of the segment point from multiple pre-sampled samples, the second sampling point is set around the estimated position of the segment point.

[0017] This setting makes the location of the effective segmentation points found later more reasonable, thereby reducing the gap between the determined polyline and the theoretical standard curve image of the sampled output source and improving the sampling accuracy.

[0018] According to one embodiment of this application, the fitting process is as follows: based on the positions of the sampling points in the region, a straight line is calculated such that the sum of the squares of the distances from the sampling points in the region to the straight line is minimized, and the straight line is the minimum approach line.

[0019] Compared to the scheme that directly determines the approaching line based on the two farthest points among the sampling points, this scheme determines the minimum approaching line based on all sampling points in the region. The position of the obtained minimum approaching line is more reasonable, which improves the accuracy of calibration using the calibration method.

[0020] According to one embodiment of this application, the step S6 further includes the following steps:

[0021] S61: Compare the distance C1 between each sampling point and the minimum approach line with a preset relative line deviation threshold C. Discard each sampling point whose distance C1 is greater than the relative line deviation threshold C. Then, according to the order from the start point to the end point, refit the detection data between two adjacent points in the start point, the effective segment point, and the end point to obtain each minimum approach line and determine a new second final line segment. The relative line deviation threshold C is: the allowable upper limit threshold of the distance between the sampling point and the minimum approach line, set according to the multiple pre-sampled samples.

[0022] S62: Determine whether the distance C1 between each sampling point in the second final line segment and the minimum approach line is less than the relative line deviation threshold C. If they are not all less than the relative line deviation threshold C, repeat S61 until the distance C1 between each sampling point and the minimum approach line is less than the relative line deviation threshold C.

[0023] This setup, while including a first sampling point conforming to a normal distribution and a second sampling point determined from multiple actual samples, does not preclude the possibility of unreasonable sampling point positions. Therefore, the above steps can screen the sampling points based on a preset relative straight line deviation threshold C, eliminating sampling points with unreasonable positions, thereby refitting and determining a second final line segment that more closely resembles the theoretical standard curve image of the sampled output source. This further improves the accuracy of calibration using the calibration method. Furthermore, analyzing multiple pre-sampled samples to determine the relative straight line deviation threshold C makes its setting more reasonable, preventing the elimination of reasonably positioned sampling points or the failure to eliminate unreasonable sampling points. This further reduces the gap between the second final line segment and the theoretical standard curve image of the sampled output source, thus making the provided calibration method more accurate.

[0024] According to one embodiment of this application, after S6, the method further includes the following step: S63, detecting whether each of the minimum approaching lines in the second final broken line segment passes through the zero point, and correcting the minimum approaching lines that pass through the zero point.

[0025] With this setting, since the minimum approach line obtained by fitting may not pass through all sampling points, it may not coincide with the actual zero point at the zero point position. Therefore, the minimum approach line that passes through the zero point can further reduce the gap between the second final line segment and the theoretical standard curve image of the sampled output source.

[0026] According to one embodiment of this application, the process of correcting the minimum approaching line passing through the zero point uses a translation-to-zero method to correct the minimum approaching line passing through the zero point.

[0027] With this setup, this scheme calibrates the zero point by translation and zeroing, achieving zero point calibration with controllable error. Compared to schemes that use other zero point calibration methods (such as manual calibration) instead of translation and zeroing, the scheme of calibrating the zero point by translation and zeroing is not only simple, fast, and effective, but also can control the error within an acceptable range, thereby improving the reliability and accuracy of the calibration method.

[0028] According to one embodiment of this application, during the execution of S6, if the minimum approach line that needs to be refitted is not the first minimum approach line of the first final polyline segment, then it is refitted together with the first minimum approach line of the minimum approach line that needs to be refitted; if the minimum approach line that needs to be refitted is the first minimum approach line of the first final polyline segment, then it is refitted together with the second minimum approach line of the minimum approach line that needs to be refitted.

[0029] This configuration avoids the situation where, if the minimum approaching line that needs to be refitted is the first minimum approaching line of the first final broken line segment, it cannot be refitted together with the adjacent previous minimum approaching line.

[0030] According to one embodiment of this application, the S7 process is as follows: the independent variables in the original expressions of each minimum approach line are regarded as dependent variables, and the formula is transformed to obtain the relationship between the original independent variables and the original dependent variables.

[0031] With this setup, the expression for each minimum approach line in the broken line segment obtained by the calibration method is the correspondence between the actual current value (independent variable) and the internally detected current (dependent variable). However, in practical applications, it is necessary to transform this correspondence into the relationship between the internally detected current value and the actual current.

[0032] In another aspect, this application also provides a storage medium including a stored program.

[0033] During program execution, the device containing the storage medium is controlled to perform the aforementioned calibration method.

[0034] This configuration allows the program stored on the storage medium to automatically execute complex tasks, reducing human intervention and thus improving overall efficiency while ensuring operational reliability and trustworthiness. Furthermore, the program is repeatable and scalable, enabling repeated execution of the same program in different environments and at different times, and facilitating expansion to adapt to new needs, enhancing its adaptability and flexibility. In addition, running the program can automate the processing of large amounts of data and tasks, significantly optimizing resource utilization and reducing manpower and error costs. Finally, the program also possesses traceability and security; by recording and tracking every step of program execution, it ensures operational auditability and security, reducing the risks associated with human error.

[0035] Beneficial Effects: The calibration method provided in this application first collects detection data from the output source through set sampling points, laying the foundation for subsequent fitting of the detection data to obtain the minimum approach line. Then, the detection data is fitted to obtain the minimum approach line. Next, the starting point and ending point are determined based on the minimum approach line, the preset initial point X-axis coordinate X1, and the ending point X-axis coordinate X2. Then, based on the idea of ​​recursion, according to the preset segmentation threshold A and relative error threshold B, effective segmentation points are continuously determined, and the detection data between the starting point, ending point, and the effective segmentation points are fitted to obtain the minimum approach line until the number of sampling points on each minimum approach line is less than 3 or there are no effective segmentation points on each minimum approach line in the broken line segment, thus obtaining the first final broken line segment. Then, the first final broken line segment is corrected with a negative slope to obtain the second final broken line segment, thereby further reducing the difference between the obtained broken line segment and the theoretical standard curve image of the sampled output source. Finally, the expression of each minimum approach line is subjected to inverse parameter transformation to obtain the relationship between the internal detection current feedback and the actual current. Attached Figure Description

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

[0037] Figure 1 A schematic flowchart of a calibration method provided in one embodiment of this application;

[0038] Figure 2 This is a flowchart illustrating a calibration method provided for another embodiment of this application. Detailed Implementation

[0039] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application are described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.

[0040] While existing calibration methods can be used for calibration, their accuracy has room for improvement and they contain certain errors. To address this issue, this application provides a calibration method that offers higher accuracy and lower error compared to existing methods.

[0041] For details, please refer to the appendix. Figure 1 One embodiment of this application provides a calibration method, including the following steps:

[0042] S1: Set sampling points and collect corresponding detection data from the output source based on the sampling points;

[0043] S2: Based on the detection data, perform fitting to determine the minimum approach line of the detection data, and determine the starting point and ending point based on the minimum approach line, the preset initial point X-axis coordinate X1 and the ending point X-axis coordinate X2.

[0044] Specifically, compared to the scheme that directly uses the two points furthest apart from the sampling point where the minimum approach line intersects the sampling point as the starting point and the ending point, this scheme determines the starting point and the ending point based on the preset X-axis coordinates X1 of the initial point and X-axis coordinates X2 of the ending point. This ensures that the distance between the starting point and the ending point on the X-axis is a fixed value, preventing the situation where the minimum approach line does not intersect the sampling point, thus making it impossible to determine the starting point and the ending point.

[0045] S3: Find valid segmentation points based on the minimum approach line and the sampling points. Among the sampling points, find the sampling point with the largest distance A1 from the minimum approach line and the distance A1 ≥ the preset segmentation threshold A. If it cannot be found, find the sampling point with the relative error B1 ≥ the preset relative error threshold B and the farthest distance from the minimum approach line. The found sampling point is the valid segmentation point. The segmentation threshold A and the relative error threshold B are set based on multiple pre-sampled samples.

[0046] It should be noted that sampling points with the largest distance A1 to the minimum approach line and whose distance A1 is greater than or equal to the preset segmentation threshold A, and sampling points with relative error B1 greater than or equal to the preset relative error threshold B and farthest from the minimum approach line are all considered valid segmentation points. In this embodiment, the former has a higher priority than the latter. That is, if a sampling point with the largest distance A1 to the minimum approach line and whose distance A1 is greater than or equal to the preset segmentation threshold A is found, then the sampling point with relative error B1 greater than or equal to the preset relative error threshold B and farthest from the minimum approach line is not searched. However, in another embodiment of this application, there is also an embodiment where the former has a lower priority than the latter. That is, the sampling point with relative error B1 greater than or equal to the preset relative error threshold B and farthest from the minimum approach line is searched first. If it is not found, then the sampling point with the largest distance A1 to the minimum approach line and whose distance A1 is greater than or equal to the preset segmentation threshold A is searched.

[0047] S4: Based on the starting point, the ending point, the effective segment point, and the detection data, perform fitting to obtain the minimum approaching straight line between the starting point, the ending point, and the effective segment point, and determine the broken line segment of the detection data;

[0048] S5: Detect whether the number of sampling points on each minimum approach line in the broken line segment is less than 3. If it is not less than 3, then detect whether there are no valid segmentation points on each minimum approach line in the broken line segment. If there are valid segmentation points, then repeat steps S3 and S4 until the number of sampling points on each minimum approach line in the broken line segment is less than 3 or there are no valid segmentation points on each minimum approach line in the broken line segment, and obtain the first final broken line segment.

[0049] S6: Calculate the slope of each minimum approach line in the first final broken line segment and compare it with zero. If there is a minimum approach line with a slope less than zero, then refit the detection data of the minimum approach line and the detection data of the minimum approach line adjacent to the minimum approach line to determine a new minimum approach line and obtain the second final broken line segment.

[0050] S7: Perform inverse parametric transformation on the expressions of each minimum approaching line in the second final segment to obtain the relationship between the internal detection current feedback and the actual current.

[0051] Specifically, S5 uses a recursive algorithm to continuously search for valid segmentation points and recalculate each minimum approach line until the number of sampling points on each minimum approach line is less than 3 or there are no valid segmentation points on each minimum approach line in the broken line segment, thereby obtaining the first final broken line segment.

[0052] Specifically, the detection data is the data obtained by sampling the output source using the sampling points and then performing Kalman filtering, low-pass filtering, moving average filtering, and other processing on the original data.

[0053] Specifically, the Kalman filter is an efficient recursive estimation algorithm based on a state-space model, primarily used to estimate the state of dynamic systems. Its basic idea is to update the state estimate at each time step by combining the system's predictive model and actual observation data, using Bayesian theory. The Kalman filter assumes that both the system state and observations are noisy, typically considered to be Gaussian distributed. The Kalman filter process mainly consists of two stages: a prediction stage and an update stage. Prediction stage: Predicting the next state based on the system's dynamic model and calculating the prediction covariance. Update stage: Correcting the predicted state using actual observations, and calculating the Kalman gain to balance the contributions of the predicted and actual observations, thereby obtaining a more accurate state estimate.

[0054] A low-pass filter is a filter that allows low-frequency signals to pass through while suppressing high-frequency signals. Its basic function is to remove high-frequency noise from a signal, thereby smoothing the signal and preserving important low-frequency components. Low-pass filtering can be implemented in various ways, including through analog circuits (such as RC filters) and digital signal processing techniques.

[0055] The moving average filtering is a simple and effective smoothing technique, primarily used to reduce random noise and enhance signal readability. Its principle is to smooth the signal by calculating the average value over a window of a certain length. The window can be of a fixed size; common types include simple moving averages and weighted moving averages. A simple moving average is the simple average of all data points within the window. A weighted moving average assigns different weights to different data points within the window, typically with points closer to the current point receiving a larger weight.

[0056] It is worth noting that, compared to the scheme that does not calculate the minimum approach line, the scheme provided in this application adopts a recursive approach. By calculating the minimum approach line and by using the segmentation threshold A and the relative error threshold B set according to multiple pre-sampled samples, the obtained line segment can be made closer to the theoretical standard curve image of the sampled output source.

[0057] In particular, in the calibration method provided in other embodiments of this application, in S3, if no sampling point is found that has the largest distance A1 from the minimum approach line and the distance A1 ≥ a preset segmentation threshold A, then the sampling point that has the relative error B1 ≥ a preset relative error threshold B, the distance A1 from the minimum approach line is greater than a preset second segmentation threshold A2, and the sampling point that is farthest from the minimum approach line is found. The found sampling point is a valid segmentation point. The preset second segmentation threshold A2 is also set based on multiple pre-sampled samples.

[0058] In particular, the location of the sampling points is set based on multiple pre-sampled samples, and efforts are made to ensure that the number of sampling points for each straight line segment constituting the polyline segment is ≥3.

[0059] Optionally, the sampling points set include a first sampling point that conforms to a normal distribution and a second sampling point determined based on samples from multiple actual samplings.

[0060] It is worth noting that setting a first sampling point that conforms to a normal distribution allows the sampling points to reflect the approximate situation of their respective locations, and ultimately makes the fitting result more in line with reality. Setting a second sampling point determined based on multiple actual samples can make the location of the effective segment points found later more reasonable. Compared with the scheme of only setting a first sampling point that conforms to a normal distribution, this scheme can reduce the error caused by calibration and improve accuracy.

[0061] Optionally, the process of setting the second sampling point is as follows: based on the estimated position of the segment point from multiple pre-sampled samples, the second sampling point is set around the estimated position of the segment point. This setting makes the position of the effective segment point found later more reasonable, thereby reducing the gap between the determined line segment and the theoretical standard curve image of the sampled output source and improving the sampling accuracy.

[0062] Optionally, the fitting process is as follows: based on the positions of the sampling points in the region, a straight line is calculated such that the sum of the squares of the distances from the sampling points in the region to the straight line is minimized, and the straight line is the minimum approach line.

[0063] It is worth noting that, compared to the scheme that directly determines the approaching line based on the two points farthest apart among the sampling points, this scheme determines the minimum approaching line based on all sampling points in the region. The position of the obtained minimum approaching line is more reasonable, which improves the accuracy of calibration using the calibration method.

[0064] In particular, the above fitting process is based on the least squares method, a mathematical optimization technique that calculates a set of parameters that minimizes the sum of squared errors between the model determined by these parameters and the actual observed data.

[0065] Optionally, such as Figure 2 As shown, in another embodiment of the calibration method provided in this application, the step S6 further includes the following steps:

[0066] S61: Compare the distance C1 between each sampling point and the minimum approach line with a preset relative line deviation threshold C. Discard each sampling point whose distance C1 is greater than the relative line deviation threshold C. Then, according to the order from the start point to the end point, refit the detection data between two adjacent points in the start point, the effective segment point, and the end point to obtain each minimum approach line and determine a new second final line segment. The relative line deviation threshold C is: the allowable upper limit threshold of the distance between the sampling point and the minimum approach line, set according to the multiple pre-sampled samples.

[0067] S62: Determine whether the distance C1 between each sampling point in the second final line segment and the minimum approach line is less than the relative line deviation threshold C. If they are not all less than the relative line deviation threshold C, repeat S61 until the distance C1 between each sampling point and the minimum approach line is less than the relative line deviation threshold C.

[0068] It is worth noting that although the sampling points include a first sampling point that conforms to a normal distribution and a second sampling point determined based on multiple actual samples, there is a possibility that the sampling points may be set in an unreasonable position. Therefore, the above steps can screen the sampling points according to a preset relative straight line deviation threshold C, remove sampling points with unreasonable positions, and then refit to determine the second final broken line segment of the theoretical standard curve image that is closer to the sampled output source, thereby further improving the accuracy of calibration using the calibration method.

[0069] Specifically, in another embodiment of this application, after removing all sampling points whose distance C1 from the minimum approach line is greater than the relative line deviation threshold C, the system does not refit the minimum approach lines based on the detection data between the starting point, the ending point, and the effective segmentation points to determine the new second final line segment. Instead, it fits the remaining detection data to obtain a new minimum approach line, where the remaining detection data is the detection data collected from the minimum approach lines originally corresponding to the removed sampling points, excluding the removed sampling points. This presents a problem: the positions of the two effective segmentation points where the two minimum approach lines originally adjacent to the minimum approach line to be refitted may need to be redefined. In this embodiment, the Schmitt trigger function implemented by the software algorithm is used to solve for the intersection point of the two intersecting lines, which is the new effective segmentation point.

[0070] It is worth noting that by analyzing the samples obtained from multiple pre-sampled samples, the relative straight line deviation threshold C can be obtained. This makes the setting of the relative straight line deviation threshold C more reasonable, preventing the situation where reasonably set sampling points are removed or unreasonable sampling points are not removed. This improves the robustness of the fitting, thereby further reducing the gap between the second final line segment and the theoretical standard curve image of the sampled output source, and thus making the accuracy of the provided calibration method higher.

[0071] In particular, the minimum approach line obtained by fitting using the least squares method may have a zero-point offset problem, so the zero point needs to be corrected to further improve the accuracy of the calibration method. Therefore, in another embodiment of the calibration method provided in this application, such as Figure 2 As shown, after S62, the method further includes the following step: S63, detecting whether each minimum approaching line in the second final broken line segment passes through the zero point, and correcting the minimum approaching lines that pass through the zero point.

[0072] It is worth noting that since the minimum approach line obtained by fitting may not pass through all the sampling points, it may not coincide with the actual zero point at the zero point position. Therefore, the minimum approach line that passes through the zero point can further reduce the gap between the second final line segment and the theoretical standard curve image of the sampled output source.

[0073] Optionally, the process of correcting the minimum approaching line passing through the zero point uses a translation-to-zero method to correct the minimum approaching line passing through the zero point.

[0074] It is worth noting that this scheme calibrates the zero point by translation and zeroing, achieving zero point calibration with controllable error. Compared to schemes that use other zero point calibration methods (such as manual calibration) instead of translation and zeroing, the scheme of calibrating the zero point by translation and zeroing is not only simple, fast and effective, but also can control the error within an acceptable range, thereby improving the reliability and accuracy of the calibration method.

[0075] Optionally, during the execution of S6, if the minimum approach line that needs to be refitted is not the first minimum approach line of the first final polyline segment, then it is refitted together with the first minimum approach line of the minimum approach line that needs to be refitted; if the minimum approach line that needs to be refitted is the first minimum approach line of the first final polyline segment, then it is refitted together with the second minimum approach line of the minimum approach line that needs to be refitted.

[0076] It is worth noting that if the minimum approaching line that needs to be refitted is the first minimum approaching line of the first final broken line segment, it is impossible to refit it together with the adjacent previous minimum approaching line.

[0077] Optionally, the S7 process is as follows: the independent variables in the original expressions of each minimum approach line are regarded as dependent variables, and the formula is transformed to obtain the relationship between the original independent variables and the original dependent variables.

[0078] It is worth noting that the expressions for the minimum approach lines in the broken line segments obtained using the calibration method represent the correspondence between the actual current value (independent variable) and the internally detected current (dependent variable). However, in practical applications, it is necessary to transform this correspondence into a relationship between the internally detected current value and the actual current. For example, the original expression is y = kx + b, and the new relationship obtained after the inverse parameter transformation is x = y / kb / k.

[0079] In other embodiments of this application, a computer program is provided, which can be run to perform the above-described calibration method.

[0080] Other embodiments of this application also provide a storage device, wherein the storage medium includes a stored program, wherein the program controls the device where the storage medium is located to execute the above-described calibration method when it is running.

[0081] It is worth noting that the program stored on the storage medium can automatically execute complex tasks, reducing human intervention and thus improving overall efficiency, ensuring operational reliability and trustworthiness. Furthermore, the program is repeatable and scalable, allowing the same program to be executed repeatedly in different environments and at different times, and is easily expanded to adapt to new needs, enhancing the program's adaptability and flexibility. In addition, running the program can automate the processing of large amounts of data and tasks, greatly optimizing resource utilization and reducing manpower and error costs. Finally, the program also possesses traceability and security; by recording and tracking every step of program execution, it ensures operational auditability and security, reducing the risks associated with human error.

[0082] Other embodiments of this application also provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the calibration method described above.

[0083] It is worth noting that the computer program is flexible and adaptable, enabling it to adjust execution steps according to different inputs and conditions, thereby adapting to constantly changing needs and technological environments, and maintaining the computer program's advanced nature and practicality. Furthermore, the architecture of the computer device allows for the implementation of multiple functions, enabling the program in memory to contain various functional modules. The execution of the computer program by the processor satisfies different application requirements, enhancing the functionality of the computer program and strengthening the integration of the computer device.

[0084] Other embodiments of this application also provide an apparatus, which includes: a sampling module, a fitting module, a search module, a storage module, a detection module, a calculation module, and an inverse transformation module.

[0085] The sampling module is used to set sampling points and collect corresponding detection data from the output source based on the sampling points;

[0086] The fitting module is used to fit the detection data and determine the minimum approach line of the detection data. The two points that are farthest apart from the sampling point where the minimum approach line intersects the sampling point are the starting point and the ending point.

[0087] The search module is used to find valid segmentation points based on the minimum approach line and the sampling points. Among the sampling points, it searches for the sampling point with the largest distance A1 from the minimum approach line and the distance A1 ≥ a preset segmentation threshold A. If it cannot find the sampling point, it searches for the sampling point with the relative error B1 ≥ a preset relative error threshold B and the farthest distance from the minimum approach line. The found sampling point is the valid segmentation point.

[0088] The storage module is used to store the minimum approach line;

[0089] The detection module is used to detect whether the number of sampling points on each minimum approach line in the broken line segment is less than 3. If it is not less than 3, it detects whether there are no valid segmentation points on each minimum approach line in the broken line segment.

[0090] The calculation module is used to calculate the slope of each minimum approaching straight line in the first final polyline segment;

[0091] The inverse transformation module is used to perform inverse parametric transformation on the expressions of each minimum approaching line in the second final piecewise linear segment to obtain the relationship between the internal detection current feedback and the actual current.

[0092] The sampling module, the fitting module, the search module, the storage module, the detection module, the calculation module, and the inverse transformation module cooperate with each other to execute the above calibration method.

[0093] It should be noted that when a component is referred to as being "fixed to" or "set on" another component, it can be directly on the other component or there may be an intermediate component. When a component is considered to be "connected to" another component, it can be directly connected to the other component or there may be an intermediate component present. The terms "vertical," "horizontal," "upper," "lower," "left," "right," and similar expressions used in this application's specification are for illustrative purposes only and do not represent the only possible implementation.

[0094] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or devices.

[0095] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature and the second feature are in indirect contact through an intermediate medium. Furthermore, "above," "over," and "on top" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.

[0096] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The term "and / or" as used in this application includes any and all combinations of one or more of the associated listed items.

[0097] The technical features of the above embodiments can be combined without changing the basic principles of this application. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

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

Claims

1. A calibration method, characterized in that, Includes the following steps: S1: Set sampling points and collect corresponding detection data from the output source based on the sampling points; S2: Based on the detection data, perform fitting to determine the minimum approach line of the detection data, and determine the starting point and ending point based on the minimum approach line, the preset initial point X-axis coordinate X1 and the ending point X-axis coordinate X2. S3: Find valid segmentation points based on the minimum approach line and the sampling points. Among the sampling points, find the sampling point with the largest distance A1 from the minimum approach line and the distance A1 ≥ the preset segmentation threshold A. If it cannot be found, find the sampling point with the relative error B1 ≥ the preset relative error threshold B and the farthest distance from the minimum approach line. The found sampling point is the valid segmentation point. The segmentation threshold A and the relative error threshold B are set based on multiple pre-sampled samples. S4: Based on the starting point, the ending point, the effective segment point, and the detection data, perform fitting to obtain the minimum approaching straight line between the starting point, the ending point, and the effective segment point, and determine the broken line segment of the detection data; S5: Detect whether the number of sampling points on each minimum approach line in the broken line segment is less than 3. If it is not less than 3, then detect whether there are no valid segmentation points on each minimum approach line in the broken line segment. If there are valid segmentation points, then repeat steps S3 and S4 until the number of sampling points on each minimum approach line in the broken line segment is less than 3 or there are no valid segmentation points on each minimum approach line in the broken line segment, and obtain the first final broken line segment. S6: Calculate the slope of each minimum approach line in the first final broken line segment and compare it with zero. If there is a minimum approach line with a slope less than zero, then refit the detection data of the minimum approach line and the detection data of the minimum approach line adjacent to the minimum approach line to determine a new minimum approach line and obtain the second final broken line segment. S7: Perform inverse parametric transformation on the expressions of each minimum approaching line in the second final segment to obtain the relationship between the internal detection current feedback and the actual current.

2. The calibration method according to claim 1, characterized in that, The sampling points set include a first sampling point that conforms to a normal distribution and a second sampling point determined based on samples from multiple actual samplings.

3. The calibration method according to claim 2, characterized in that, The process of setting the second sampling point is as follows: based on the estimated position of the segment point from multiple pre-sampled samples, the second sampling point is set around the estimated position of the segment point.

4. The calibration method according to claim 1, characterized in that, The fitting process is as follows: Based on the location of the sampling points within the region, a straight line is calculated such that the sum of the squares of the distances from the sampling points within the region to the straight line is minimized; this straight line is the minimum approach line.

5. The calibration method according to claim 1, characterized in that, The step following step S6 is as follows: S61: Compare the distance C1 between each sampling point and the minimum approach line with a preset relative line deviation threshold C. Discard each sampling point whose distance C1 is greater than the relative line deviation threshold C. Then, according to the order from the start point to the end point, refit the detection data between two adjacent points in the start point, the effective segment point, and the end point to obtain each minimum approach line and determine a new second final line segment. The relative line deviation threshold C is: the allowable upper limit threshold of the distance between the sampling point and the minimum approach line, set according to the multiple pre-sampled samples. S62: Determine whether the distance C1 between each sampling point in the second final line segment and the minimum approach line is less than the relative line deviation threshold C. If they are not all less than the relative line deviation threshold C, repeat S61 until the distance C1 between each sampling point and the minimum approach line is less than the relative line deviation threshold C.

6. The calibration method according to claim 1, characterized in that, The step S6 is followed by the following step: S63, detecting whether each minimum approaching line in the second final broken line segment passes through the zero point, and correcting the minimum approaching lines that pass through the zero point.

7. The calibration method according to claim 6, characterized in that, The process of correcting the minimum approach line that passes through the zero point uses a translation-to-zero method to correct the minimum approach line that passes through the zero point.

8. The calibration method according to claim 1, characterized in that, During the execution of S6, if the minimum approach line that needs to be refitted is not the first minimum approach line of the first final broken line segment, then it is refitted together with the first minimum approach line of the minimum approach line that needs to be refitted. If the minimum approach line that needs to be refitted is the first minimum approach line of the first final broken line segment, then it is refitted together with the second minimum approach line of the minimum approach line that needs to be refitted.

9. The calibration method according to claim 1, characterized in that, The process in S7 is as follows: the independent variables in the original expressions of each minimum approach line are regarded as dependent variables, and the formula is transformed to obtain the relationship between the original independent variables and the original dependent variables.

10. A storage medium, characterized in that, The storage medium includes stored programs. During the execution of the program, the device containing the storage medium is controlled to perform the calibration method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Online adaptive segmentation algorithm suitable for power curve of living electrical appliance

    CN109857978A

  • Signal impact response cluster information acquisition method and device, equipment and storage medium

    CN110071882A