Current calibration method and device, controller and electric equipment
The current samples are amplified through data augmentation algorithm SMOTE and generative adversarial networks, which solves the problem of insufficient sample number in current calibration, improves current accuracy and the accuracy of the battery management system, and ensures battery safety and applicability.
Patent Information
- Application Number
- CN202510406072.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-09-05
AI Technical Summary
In the prior art, the current calibration method has low current accuracy due to insufficient sample size, which affects the accuracy and safety of the battery management system.
Using the data augmentation algorithm SMOTE and a generative adversarial network, the current sample is amplified by acquiring the current data of the battery at different temperatures and powers, and the fitting function is determined to improve the current accuracy.
It improves the accuracy of current calibration, ensures the accuracy of the battery management system and the safe use of the battery, and expands the scope of application of the battery in different environments.
Smart Images

Figure CN120600962A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of battery management technology, and in particular to a current calibration method, device, controller and electrical equipment. Background Art
[0002] The Battery Management System (BMS) bridges the gap between the battery and the user. Current sampling accuracy, or current precision, is a crucial issue in BMS operations and a key challenge for the sampling module. Inaccurate current precision can lead to a range of problems. For example, it can disrupt various control strategies during battery operation, or even cause irreversible errors, such as premature or delayed current protection.
[0003] Currently, existing technologies use a programmable power supply and load instrument to charge and discharge the BMS. By recording the current data during the charge and discharge process, a functional relationship is established between the inaccurate current sampled by the BMS and the accurate current generated by the programmable power supply and load instrument. However, due to the small number of samples generated during the data fitting process, the fitted equation is not accurate enough, resulting in limitations in obtaining high-precision currents using this method. Summary of the Invention
[0004] The embodiments of the present application provide a current calibration method, apparatus, controller, and electrical equipment, which are used to solve the technical problem of low current accuracy caused by a small number of samples in current calibration in the prior art.
[0005] In a first aspect, the present application provides a current calibration method, comprising:
[0006] Obtaining a first current during battery charging and discharging;
[0007] calibrating the first current according to a fitting function to obtain a second current;
[0008] monitoring a charge and discharge process of the battery according to the second current;
[0009] The fitting function is determined by a current data set obtained by a data enhancement algorithm, wherein the data enhancement algorithm includes a SMOTE algorithm and a generative adversarial network, the SMOTE algorithm integrates Euclidean distance and Mahalanobis distance, and the generative adversarial network includes a generator and a discriminator.
[0010] In a possible implementation manner, before calibrating the first current according to the fitting function, the method further includes:
[0011] Acquire first current data through a battery test bench, where the first current data includes current values of a simulated cell of the battery when charging and discharging at different temperatures and different powers;
[0012] Performing data enhancement on the first current data according to the data enhancement algorithm to obtain second current data;
[0013] determining the fitting function according to the second current data and a preset fitting tool;
[0014] The current data set includes the second current data.
[0015] In a possible implementation, enhancing the first current data according to the data enhancement algorithm to obtain the second current data includes:
[0016] Determine a neighbor K of the first current data according to the first current data and the fusion distance to obtain intermediate sample data, where the sample data includes variables of the SMOTE algorithm;
[0017] Determine new current data based on the sample data and the SMOTE algorithm;
[0018] The first current data and the new current data are determined to be the second current data.
[0019] In a possible implementation manner, before determining the neighboring K of the first current data according to the first current data and the SMOTE algorithm, the method further includes:
[0020] The generative adversarial network is iterated according to the first current data to determine a parameter of the fusion distance.
[0021] In a possible implementation, the discriminator is a binary classifier.
[0022] In a possible implementation, obtaining first current data through a battery stand includes:
[0023] After the simulated cell is powered on, the zero drift value is obtained after the current value of the simulated cell is in a stable state at zero drift;
[0024] charging the simulated battery cell using a charging device at a low temperature with a negative first current and a negative second current, respectively, to obtain a first charging current and a second charging current, wherein the first current is less than the second current;
[0025] discharging the simulated battery cell at the low temperature using a discharge device with a positive first current and a positive second current, respectively, to obtain a first discharge current and a second discharge current;
[0026] charging the simulated battery cell using the charging device at room temperature with the negative first current and the negative second current, respectively, to obtain a third charging current and a fourth charging current;
[0027] discharging the simulated battery cell with the first positive current and the second positive current at room temperature through the discharge device to obtain a third discharge current and a fourth discharge current;
[0028] determining the first current data according to the zero-drift value, the first charging current, the second charging current, the first discharging current, the second discharging current, the third charging current, the fourth charging current, the third discharging current, and the fourth discharging current;
[0029] Wherein, the battery rack includes the charging device, the discharging device and the simulated battery cell.
[0030] In a possible implementation manner, the first current is 15A, and the second current is 30A.
[0031] In one possible embodiment, the low temperature is minus 25°C.
[0032] In a possible implementation, the battery rack further includes a main control microcontroller connected to the analog battery cell via IIC or SPI communication;
[0033] The main control microcontroller is used to determine the fitting function offline.
[0034] In a possible implementation, the preset fitting tool includes a linear fitting model.
[0035] In a second aspect, the present application provides a current calibration device, comprising:
[0036] An acquisition module, configured to acquire a first current during charging and discharging of the battery;
[0037] a calibration module, configured to calibrate the first current according to a fitting function to obtain a second current;
[0038] a control module, configured to monitor the charging and discharging process of the battery according to the second current;
[0039] The fitting function is determined by a current data set obtained by a data enhancement algorithm, wherein the data enhancement algorithm includes a SMOTE algorithm and a generative adversarial network, the SMOTE algorithm integrates Euclidean distance and Mahalanobis distance, and the generative adversarial network includes a generator and a discriminator.
[0040] In a possible implementation, the calibration module is further configured to:
[0041] Acquire first current data through a battery test bench, where the first current data includes current values of a simulated cell of the battery when charging and discharging at different temperatures and different powers;
[0042] Performing data enhancement on the first current data according to the data enhancement algorithm to obtain second current data;
[0043] determining the fitting function according to the second current data and a preset fitting tool;
[0044] The current data set includes the second current data.
[0045] In a possible implementation, the calibration module is further configured to:
[0046] Determine a proximity K of the first current data according to the first current data and the fusion distance to obtain sample data, where the sample data includes variables of the SMOTE algorithm;
[0047] Determine new current data based on the sample data and the SMOTE algorithm;
[0048] The first current data and the new current data are determined to be the second current data.
[0049] In a possible implementation, the calibration module is further configured to:
[0050] The generative adversarial network is iterated according to the first current data to determine a parameter of the fusion distance.
[0051] In a possible implementation, the discriminator is a binary classifier.
[0052] In a possible implementation, the calibration module is further configured to:
[0053] After the simulated cell is powered on, the zero drift value is obtained after the current value of the simulated cell is in a stable state at zero drift;
[0054] charging the simulated battery cell using a charging device at a low temperature with a negative first current and a negative second current, respectively, to obtain a first charging current and a second charging current, wherein the first current is less than the second current;
[0055] discharging the simulated battery cell at the low temperature using a discharge device with a positive first current and a positive second current, respectively, to obtain a first discharge current and a second discharge current;
[0056] charging the simulated battery cell using the charging device at room temperature with the negative first current and the negative second current, respectively, to obtain a third charging current and a fourth charging current;
[0057] discharging the simulated battery cell with the first positive current and the second positive current at room temperature through the discharge device to obtain a third discharge current and a fourth discharge current;
[0058] determining the first current data according to the zero-drift value, the first charging current, the second charging current, the first discharging current, the second discharging current, the third charging current, the fourth charging current, the third discharging current, and the fourth discharging current;
[0059] Wherein, the battery rack includes the charging device, the discharging device and the simulated battery cell.
[0060] In a possible implementation manner, the first current is 15A, and the second current is 30A.
[0061] In one possible embodiment, the low temperature is minus 25°C.
[0062] In a possible implementation, the battery rack further includes a main control microcontroller connected to the analog battery cell via IIC or SPI communication;
[0063] The main control microcontroller is used to determine the fitting function offline.
[0064] In a possible implementation, the preset fitting tool includes a linear fitting model.
[0065] In a third aspect, the present application provides a controller, comprising: a memory, a processor;
[0066] The memory stores computer-executable instructions;
[0067] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.
[0068] In a fourth aspect, the present application provides an electrical device comprising: a battery and a controller, wherein the battery comprises a plurality of single cells; and the controller is used to execute the first aspect and / or various possible implementations of the first aspect.
[0069] In a fifth aspect, the present application provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect and / or various possible implementation methods of the first aspect as described above.
[0070] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the first aspect and / or various possible implementation methods of the first aspect.
[0071] The current calibration method, device, controller, and electrical equipment provided in this application first obtain a first current during battery charging and discharging, then calibrate the first current according to a fitting function to obtain a second current, and then monitor the battery charging and discharging process based on the second current. The fitting function is determined by a current data set obtained by a data enhancement algorithm. The data enhancement algorithm includes a SMOTE algorithm and a generative adversarial network. When determining the fitting function, the current samples used are amplified, making the fitting function more accurate, thereby improving current accuracy, ensuring the accuracy of BMS current sampling, improving battery utilization, and ensuring the safety of electrical equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0073] Figure 1 Schematic diagram of the current calibration method provided in this application Figure 1 ;
[0074] Figure 2 Schematic diagram of the current calibration method provided in this application Figure 2 ;
[0075] Figure 3 A schematic diagram of the structure of the battery stand provided for this application;
[0076] Figure 4 A schematic diagram of the data enhancement process in the current calibration method provided in this application;
[0077] Figure 5 Schematic diagram of the generative adversarial network structure provided for this application;
[0078] Figure 6 A flowchart of the data enhancement algorithm provided in this application;
[0079] Figure 7 A schematic diagram of the structure of the current calibration device provided in this application;
[0080] Figure 8 This is a schematic diagram of the structure of the controller provided in this application.
[0081] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0082] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0083] Existing technologies use a programmable power supply and load instrument to charge and discharge the BMS. By recording current data during the charge and discharge process, a functional relationship is established between the inaccurate current sampled by the BMS and the accurate current generated by the programmable power supply and load instrument. However, due to the small number of samples generated during the data fitting process, the resulting fitted equation is inaccurate, resulting in limitations in obtaining high-precision currents using this method.
[0084] To address the above-mentioned problems in the prior art, the current calibration method provided in this application calibrates the first current collected by the BMS through a fitting function to obtain a second current, which is then used for battery monitoring. The fitting function is determined by a current dataset obtained using a data enhancement algorithm. The data enhancement algorithm includes the SMOTE (Synthetic Minority Oversampling Technique) algorithm and a generative adversarial network. The current samples used in determining the fitting function are amplified, making the fitting function more accurate, thereby improving the accuracy of current calibration and ensuring safe battery use.
[0085] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0086] Figure 1 Schematic diagram of the current calibration method provided in this application Figure 1 ,like Figure 1 As shown, the method includes:
[0087] S101: Obtain a first current during battery charging and discharging.
[0088] The actual current value of the battery during charging and discharging is collected to obtain a first current.
[0089] S102: Calibrate the first current according to the fitting function to obtain a second current.
[0090] The collected actual current value is calibrated using a fitting function, and the calibrated first current is the second current.
[0091] Among them, the fitting function is determined by the current data set obtained by the data enhancement algorithm, which enriches the amount of current data in the fitting function fitting process and overcomes the defect of inaccurate fitting caused by small data samples in the fitting function fitting process in the prior art.
[0092] In addition, data augmentation algorithms include the SMOTE algorithm and the generative adversarial network. Among them, the SMOTE algorithm is a data augmentation algorithm that can add artificial samples to the new dataset by analyzing and simulating a small number of samples, thereby increasing the amount of data.
[0093] Generative Adversarial Nets (GAN) is a zero-sum game (two-player game) in game theory. In GAN, the two players a and b in game theory are respectively processed as a generative model (generative model, i.e., generator) and a discriminative model (discriminative model, i.e., discriminator), that is, the generative adversarial network includes a generator and a discriminator. The generative model is used to calculate the distribution of sample data and generates a sample (normal distribution, Poisson distribution, etc.) similar to the real training data using noise z that obeys the distribution, ultimately achieving an effect almost identical to the real data. The main purpose of the discriminant model is to identify whether the data in the generative model is true. In addition, the discriminator described in the embodiment of the present application is essentially a classifier that distinguishes real data from generated data. The proportion of the classification accuracy of the classifier needs to reflect the dependence of the data on Mahalanobis distance or Euclidean distance to a certain extent. What is used in the discriminator of the present application is Mahalanobis distance.
[0094] In some embodiments, the generator is obtained by using the SMOTE algorithm that combines Euclidean distance and Mahalanobis distance, and the discriminator is obtained based on K-Nearest Neighbors (KNN) of Mahalanobis distance.
[0095] S103: Monitor the charging and discharging process of the battery according to the second current.
[0096] The second current obtained after calibration is used as the sampling current of the BMS to monitor the battery charging and discharging process.
[0097] The current calibration method provided in an embodiment of the present application first obtains a first current during battery charging and discharging, then calibrates the first current according to a fitting function to obtain a second current, and then monitors the battery charging and discharging process based on the second current. The fitting function is determined by a current dataset obtained using a data enhancement algorithm. The data enhancement algorithm includes a SMOTE algorithm and a generative adversarial network. When determining the fitting function, the current samples used are amplified, making the fitting function more accurate. This can improve current precision, ensure the accuracy of BMS current sampling, thereby improving battery utilization and the safety of electrical equipment.
[0098] In a possible implementation, before step S102, the following is also included: Figure 2 The steps shown determine the fitting function. Figure 2 Schematic diagram of the current calibration method provided in this application Figure 2 .like Figure 2 As shown, the method includes:
[0099] S201. Obtain first current data through a battery stand.
[0100] The first current data includes current values of the simulated battery cells when they are charged and discharged at different temperatures and different powers.
[0101] Figure 3 The schematic diagram of the battery rack provided in this application is based on the battery rack through Figure 2 The steps shown can determine the fitting function offline. Figure 3 As shown, the battery stand 10 provided in this application includes: a simulated battery cell 11, i.e., a sampling analog front end, a main control microcontroller 12, a charging device 13, and a discharging device 14.
[0102] The simulated cell 11 is a simulated cell of a battery. The simulated cell 11 and the main control microcontroller 12 can be connected to each other through relevant communication methods such as IIC, SPI, etc. The main control microcontroller 12 can execute Figure 2 The steps shown determine the fitting function offline. The charging device 12 can be, for example, a large power supply to charge the simulated battery cell 11. The discharging device 13 can be, for example, a discharge load meter to discharge the simulated battery cell 11. It is worth noting that the battery rack 10 is assembled by connecting the battery rack 10 with a wiring harness.
[0103] Specifically, this step can obtain the first current data based on the battery stand. Specifically, the simulated battery cell 11 is charged and discharged at different temperatures and different powers, and the corresponding current values are collected.
[0104] In some embodiments, for example, after the simulated battery cell 11 is powered on, for example, after waiting for 5 seconds after power-on, the zero drift value is obtained after the current value of the simulated battery cell 11 is in a stable state in zero drift. Specifically, the zero drift value is obtained by current sampling when power is just turned on, and the stable value of the last current sampled is obtained as the zero drift value.
[0105] For charging at low temperatures, the simulated battery cell 11 is charged at low temperatures using the charging device 13 with a negative first current and a negative second current, respectively, to obtain a first charging current and a second charging current, wherein the first current is less than the second current. That is, the battery rack 10 is charged at low temperatures using the charging device 13 (such as a large power supply) with a negative first current until the main control microcontroller 12 can read a stable current, and the data is recorded to obtain the first charging current; and the battery rack 10 is charged at low temperatures using the charging device 13 (such as a large power supply) with a negative second current until the main control microcontroller 12 can read a stable current, and the data is recorded to obtain the second charging current.
[0106] For discharge at low temperature, the simulated battery cell 11 is discharged at low temperature with a positive first current and a positive second current, respectively, by the discharge device 14 to obtain a first discharge current and a second discharge current. That is, the battery rack 10 is discharged at low temperature with a positive first current using the discharge device 14 (such as a discharge load meter) until the main control microcontroller 12 can read a stable current, and the data is recorded to obtain the first discharge current; and the battery rack 10 is discharged at low temperature with a positive second current using the discharge device 14 (such as a discharge load meter) until the main control microcontroller 12 can read a stable current, and the data is recorded to obtain the second discharge current.
[0107] After completing the current collection corresponding to charging and discharging at low temperature, the current during charging and discharging at normal temperature can also be collected.
[0108] For charging at room temperature, the simulated battery cell is charged at room temperature using the charging device 13 with a negative first current and a negative second current, respectively, to obtain a third charging current and a fourth charging current. Specifically, the battery rack 10 is charged at room temperature using the charging device 13 (e.g., a large power supply) with a negative first current until the main control microcontroller 12 can read a stable current, and the data is recorded to obtain the third charging current; and the battery rack 10 is charged at room temperature using the charging device 13 (e.g., a large power supply) with a negative second current until the main control microcontroller 12 can read a stable current, and the data is recorded to obtain the fourth charging current.
[0109] For discharge at room temperature, the simulated battery cell 11 is discharged at room temperature using the discharge device 14 with a positive first current and a positive second current, respectively, to obtain a third discharge current and a fourth discharge current. Specifically, the battery rack 10 is discharged at room temperature using the discharge device 14 (e.g., a discharge load meter) with a positive first current until the main control microcontroller 12 can read a stable current, and the data is recorded to obtain the third discharge current; and the battery rack 10 is discharged at low temperature using the discharge device 14 (e.g., a discharge load meter) with a positive second current until the main control microcontroller 12 can read a stable current, and the data is recorded to obtain the fourth discharge current.
[0110] Furthermore, the first current data is determined according to the zero drift value, the first charging current, the second charging current, the first discharging current, the second discharging current, the third charging current, the fourth charging current, the third discharging current, and the fourth discharging current.
[0111] For example, suppose the zero drift value is denoted as b0;
[0112] In the low current segment, i.e., the first current, the charging current (negative current) collected at room temperature, i.e., the third charging current, and the actual current set to the first current are recorded as (x1, y1);
[0113] In the low current segment, i.e., the first current, the discharge current (positive current) collected at room temperature, i.e., the third discharge current, and the first current actually set are recorded as (x2, y2);
[0114] In the high current section, i.e., the second current, the charging current (negative current) collected at room temperature, i.e., the fourth charging current, and the actual setting current, i.e., the second current, are recorded as (x3, y3);
[0115] In the large current section, i.e., the second current, the discharge current (positive current) collected at room temperature, i.e., the fourth discharge current, and the actual setting current, i.e., the second current, are recorded as (x4, y4);
[0116] In the low current segment, i.e., the first current, the charging current (negative current) collected at low temperature, i.e., the first charging current, and the actual current set to the first current are recorded as (x5, y5);
[0117] In the low current segment, i.e., the first current, the discharge current (positive current) collected at low temperature, i.e., the first discharge current, and the actual current set to the first current are recorded as (x6, y6);
[0118] In the high current section, i.e., the second current, the charging current (negative current) collected at low temperature, i.e., the second charging current, and the actual setting current, i.e., the second current, are recorded as (x7, y7);
[0119] In the large current section, also known as the second current, the discharge current (positive current) collected at low temperature, namely the second discharge current, and the actual current set to the second current are recorded as (x8, y8).
[0120] The above data b0, (x1, y1), (x2, y2), (x3, y3), (x4, y4), (x5, y5), (x6, y6), (x7, y7), and (x8, y8) are determined as first current data.
[0121] In some embodiments, the first current may be, for example, 15 A, and the second current may be, for example, 30 A. It should be noted that in actual working conditions, the corresponding current may be selected for charging and discharging according to the application scenario.
[0122] In some embodiments, the low temperature can be, for example, minus 25°C. In actual operating conditions, the low temperature can also be selected according to the application scenario. The purpose of collecting the corresponding current at low temperature as a data sample of the fitting function is to enable the current calibration provided in this application to take into account the impact of temperature on current accuracy, thereby improving the adaptability of the battery when used in cold or coastal climate areas.
[0123] S202: Enhance the first current data according to a data enhancement algorithm to obtain second current data.
[0124] The first current data is amplified by using a data enhancement algorithm, and the amplified current data is the second circuit data.
[0125] The data enhancement algorithm includes the SMOTE algorithm and the generative adversarial network. The data enhancement algorithm can amplify the first current data to obtain a set of data points near the first current data.
[0126] For example, when b0 is brought into the data enhancement algorithm, the corresponding data point set is {0, bn}; when the data point (x1, y1) is brought into the data enhancement algorithm, the data point set near the data point is recorded as {x1n, y1n}; when the data point (x2, y2) is brought into the data enhancement algorithm, the data point set near the data point is recorded as {x2n, y2n}; when the data point (x3, y3) is brought into the data enhancement algorithm, the data point set near the data point is recorded as {x3n, y3n}; when the data point (x4, y4) is brought into the data enhancement algorithm, the data point set near the data point is recorded as {x4n, y4n}. The data point set is denoted as {x4n, y4n}; the data point (x5, y5) is brought into the data enhancement algorithm, and the data point set near the data point is denoted as {x5n, y5n}; the data point (x6, y6) is brought into the data enhancement algorithm, and the data point set near the data point is denoted as {x6n, y6n}; the data point (x7, y7) is brought into the data enhancement algorithm, and the data point set near the data point is denoted as {x7n, y7n}; the data point (x8, y8) is brought into the data enhancement algorithm, and the data point set near the data point is denoted as {x8n, y8n}.
[0127] The current data set includes second current data.
[0128] S203 : Determine a fitting function according to the second current data and a preset fitting tool.
[0129] The above data point set is divided into two cases, low temperature and normal temperature, and the function is fitted using the preset fitting tool to obtain the fitting function flt(x) at low temperature and the fitting function fht(x) at normal temperature.
[0130] In some embodiments, the preset fitting tool can be selected to be as simple and quick as possible, such as a linear fitting model, etc. The embodiments of the present application do not limit the specific content of the linear fitting model.
[0131] The determination of the fitting function in the current calibration method provided in the embodiment of the present application can be implemented based on the battery test bench through the main control microcontroller, wherein, first, the current value of the simulated battery cell when charging and discharging at different temperatures and different powers is obtained, that is, the first current data, and then the first current data is enhanced by the data enhancement algorithm to obtain a set of data points attached to the data points of the first current data, that is, the second current data, and the data volume of the first current data is amplified. Then, a preset fitting tool such as a linear fitting model is used to fit the data according to the second current data to determine the fitting function at different temperatures, thereby determining the fitting function. Among them, the data enhancement algorithm includes the SMOTE algorithm and the generative adversarial network, and the amount of data used for fitting is amplified by the data enhancement algorithm to fit a more accurate fitting function, and offline fitting can be performed. In addition, the corresponding fitting function can be determined for different temperatures. Without affecting the robustness of the current accuracy calculation, the current calibration using the fitting function can improve the adaptability of battery products in cold or severe climate regions, thereby making the BMS sampled current have higher accuracy at both high and low temperatures, which not only improves battery utilization but also makes the application scenarios more extensive.
[0132] In some embodiments, the battery rack collects current data points corresponding to normal temperature at room temperature, and the collection of current data points at low temperature can be performed in a temperature box.
[0133] In specific implementations, the selected charging and discharging equipment can be replaced according to the requirements under different powers. The specific current segmentation, such as the first current and the second current described above, can be replaced according to the current segment used by the battery product to ensure that at least two current fitting functions are guaranteed during charging and discharging.
[0134] In some embodiments, the battery rack 10 may further include a resistor 15 and an electronic device 16, which is used to enable the BMS to interact with the battery rack 10. Figure 3 As shown in FIG, the electronic device 16 may be a computer, and the computer and the BMS may communicate with each other using a Controller Area Network (CAN) and a Universal Asynchronous Receiver / Transmitter (UART).
[0135] In some embodiments, for example, when a battery is ready to ship, a calibration coefficient can be automatically calculated based on a fitting function determined by the battery rack 10 using the first current data, and the current coefficient of the battery product can be calibrated using CAN or UART. After calibration, the current value used by the battery product is the current value output by the fitting function, i.e., the second current.
[0136] In a possible implementation, the data enhancement in step S202 may be implemented as follows: Figure 4 shown. Figure 4 This is a flow chart of data enhancement in the current calibration method provided in this application. Figure 4 As shown, the method includes:
[0137] S301. Iterate a generative adversarial network according to first current data to determine parameters of a fusion distance.
[0138] Among them, the generative adversarial network includes the generator obtained by the SMOTE algorithm and the discriminator obtained by the KNN algorithm. The SMOTE algorithm integrates the Euclidean distance and the Mahalanobis distance.
[0139] S302 : Determine the proximity K of the first current data according to the first current data and the fusion distance to obtain sample data.
[0140] The sample data includes variables of the SMOTE algorithm.
[0141] S303: Determine new current data based on the sample data and the SMOTE algorithm.
[0142] S304: Determine the first current data and the new current data as second current data.
[0143] The Euclidean distance formula (1) below can calculate the distance from the nearest K samples to a small sample set, but the Euclidean distance has certain limitations in solving multivariate data analysis problems. First, the Euclidean distance does not consider the impact of the population variance on the distance. When solving multivariate data analysis problems, the impact of the population variance on "distance" is more complex and is proportional to the sample size. A population with a small variance may not have the closest Euclidean distance, but it may be closer to other samples; second, the Euclidean distance is easily affected by the variable dimension, making it difficult to play a role in multivariate data processing.
[0144]
[0145] Where x, y are the positions of the samples in space, and d(x, y) is used to find the nearest neighbors.
[0146] Mahalanobis distance, also known as Mahalanobis distance, can effectively calculate the similarity between two unknown samples and is a covariance distance used to represent data. Compared with Euclidean distance, it takes into account the relationship between different features. If the covariance matrix is the identity matrix, then the Mahalanobis distance becomes the Euclidean distance. The Mahalanobis distance is calculated using the following formula (2):
[0147]
[0148] in,
[0149] The Mahalanobis distance is calculated based on a population sample. If the same two samples are placed into two different populations with different covariance matrices, the resulting Mahalanobis distances will generally be different. The Mahalanobis distance calculation requires that the population sample size be greater than the sample dimension; otherwise, the covariance matrix will be irreversible. In most cases, the Mahalanobis distance is relatively stable; the main factor causing the instability of the Mahalanobis distance lies in the covariance matrix.
[0150] Figure 5 The schematic diagram of the generative adversarial network structure provided for this application is as follows: Figure 5 As shown in the figure, a generative model and a discriminative model form a generative adversarial network. The generative model (also known as the generator) generates data samples, which are then classified by the discriminative model (also known as the discriminator). A Nash equilibrium is reached when the discriminative model cannot determine whether a sample is true or false, for example, when the classification accuracy is 0.5. In actual working conditions, the classification accuracy can be 0.5±m, where m is a value as close to 0.5 as possible. The specific value is customized according to the actual situation.
[0151] In GAN, both the generative model and the discriminative model are composed of neural networks, and the objective function is calculated by formula (3):
[0152] m G inm D axV(D,G)=m G inm D ax(E x~μ [logD(x)]+E z~γ [log(1-D(G(z)))]) (3)
[0153] In formula (3), E is the expectation of the distribution indicated by the subscript, x in formula (3) represents the real sample, z represents the white noise, G is the generating function, and D is the discriminant function.
[0154] During the GAN training process, when training D, D(x) is maximized, that is, the discriminator judges the real data to be true, and D(G(z)) is minimized, that is, log(1-D(G(z))) is maximized, and the discriminator judges the generated data to be false; when training G, the optimal solution is x=z, that is, D(G(z)) is maximized, and log(1-D(G(z))) is minimized. When the training is completed, D(G(z))=0.5.
[0155] This application uses the SMOTE algorithm that combines Mahalanobis distance and Euclidean distance with the generative adversarial network to form a data enhancement algorithm. The flow chart of the data enhancement algorithm is as follows: Figure 6 As shown, the SMOTE algorithm is first used to generate raw current data, such as the first current data. The generated data is then judged using the discriminator. If Nash equilibrium is not reached (i.e., the classification accuracy of the raw and generated data is not around 50%), the parameters are updated based on the classification accuracy ratio, and the generation and judgment are repeated until Nash equilibrium is reached. The parameters a and b used in the current iteration when Nash equilibrium is reached are determined as the parameters of the SMOTE algorithm.
[0156] The main idea of KNN is to calculate the distance (similarity) between the test sample and each training sample using a distance function (such as Euclidean distance and Mahalanobis distance). The K samples closest to the training sample are selected as the K nearest neighbors of the classification sample. Finally, the category of the classification sample is determined by the category to which the majority of the K nearest neighbors of the classification sample belong. KNN is arguably the most straightforward classification algorithm.
[0157] When the discriminator performs the nth discrimination, it will get the accuracy between the original data and the generated data. Let parameter a' be the accuracy of the true discrimination, and parameter b' be the accuracy of the false discrimination. The parameter equation is shown in formula (4):
[0158] u=a′d e +b′d m (4)
[0159] Where u is the distance of the fusion of Mahalanobis distance and Euclidean distance, i.e., the fusion distance, a′ and b′ are the parameters of the fusion distance, and d e , d m They are Mahalanobis distance and Euclidean distance respectively.
[0160] The iterative equation is shown in formula (5):
[0161]
[0162] Where a′ is the accuracy rate of the true answer and b′ is the accuracy rate of the false answer.
[0163] Since the discriminator is essentially a binary classifier, b′ is calculated according to formula (6):
[0164] b′=1-a′ (6)
[0165] At the beginning of the iteration, a′ and b′ can be given as 0.5 respectively and the generator data generation can be completed using formulas (7) and (8). Then, the discriminator is used to perform the discrimination, so as to iterate through the iterative equation. The iterative equation is iterated until a Nash equilibrium is reached. The iteration ends and the parameters of the fusion distance used by the generator at the end of the iteration are obtained, which are the parameters a and b of the fusion distance to be determined. In other words, the iterative process of the generative adversarial network is to determine the parameters a and b in formula (7) to perform step S302.
[0166] After the data is enhanced according to the above method, the data volume is expanded and then the recognition is performed. Since the data enhancement algorithm has a large amount of computation in the optimization process, the iteration process can be set to 500 times, for example, which is not limited in the embodiment of the present application.
[0167] It should be noted that when the first current data is used for iteration, that is, in the generative adversarial network, the generator uses the following formulas (7) and (8) to generate data.
[0168] For the generator G, for the current data, i.e., the first current data Q, the fusion distance is calculated according to the following formula (7) to calculate the nearest neighbor K of all samples in the minority class sample set, and the sample data d(x, y) is the desired neighbor
[0169]
[0170] For each sample point, a new sample is constructed according to the SMOTE algorithm shown in formula (8), that is, new current data is determined based on the sample data and the SMOTE algorithm.
[0171] x new =x+rand(0,1)·(xx n ) (8)
[0172] Where x is the sample point, i.e. the first current data, and x n To randomly select N samples from K nearest neighbors, record them as x n , x n is the variable in the SMOTE algorithm, that is, the sample data includes the variable x of the SMOTE algorithm n , the variable is determined by the fusion distance.
[0173] The data generated by (7) and (8) above are classified using the discriminator and iterated until a Nash equilibrium is reached. When a Nash equilibrium is reached, the parameters of the fusion distance used by the generator in this iteration are the parameters a and b determined in step S301, and the parameters are then used to perform step S302 to obtain sample data.
[0174] After determining a and b in formula (7), the first current data and the fusion distance shown in formula (7) are used to determine its nearest neighbors K to all samples in the minority class sample set, i.e., the sample data. Furthermore, a new data point set, i.e., the new current data, is constructed based on the sample data and the SMOTE algorithm shown in formula (8). The first current data and the new current data are then determined as the second current data, completing the data amplification of the first current data.
[0175] In the current calibration method provided in the embodiment of the present application, the generative adversarial network is first iterated to determine the parameters of the fusion distance required by the SMOTE algorithm, and then the sample data is first determined according to the fusion distance, and then the new current data constructed by the sample data and the SMOTE algorithm, and then the first current data and the new current data are determined to be the second current data, and by analyzing and simulating a small number of samples, artificial samples are added to the new data set to achieve the amplification of the first current data. Among them, the data enhancement algorithm used in the data enhancement process includes the SMOTE algorithm and the generative adversarial network. The SMOTE algorithm combines the Euclidean distance and the Mahalanobis distance, and has the advantages of both the Euclidean distance and the Mahalanobis distance, making the data enhancement process more stable. The combination of the generator and the discriminator in the generative adversarial network can make the samples artificially added in the amplification process very close to the real data. The combination of the two can improve the accuracy of data amplification, so that the fitting function determined by the data after data enhancement is more accurate.
[0176] Figure 7 The schematic diagram of the current calibration device provided in this application is as follows: Figure 7 As shown, the current calibration device 40 provided in the embodiment of the present application includes:
[0177] An acquisition module 401 is configured to acquire a first current during charging and discharging of the battery;
[0178] A calibration module 402 is configured to calibrate the first current according to a fitting function to obtain a second current;
[0179] A control module 403 is configured to monitor the charging and discharging process of the battery according to the second current;
[0180] The fitting function is determined by a current data set obtained through a data enhancement algorithm. The data enhancement algorithm includes a SMOTE algorithm and a generative adversarial network. The SMOTE algorithm integrates Euclidean distance and Mahalanobis distance. The generative adversarial network includes a generator and a discriminator.
[0181] In a possible implementation, the calibration module 402 is further configured to:
[0182] Acquire first current data through a battery test bench, the first current data including current values of simulated battery cells when charging and discharging at different temperatures and different powers;
[0183] Performing data enhancement on the first current data according to a data enhancement algorithm to obtain second current data;
[0184] determining a fitting function according to the second current data and a preset fitting tool;
[0185] The current data set includes second current data.
[0186] In a possible implementation, the calibration module 402 is further configured to:
[0187] Determine a neighbor K of the first current data according to the first current data and the fusion distance to obtain sample data, where the sample data includes variables of the SMOTE algorithm;
[0188] Determine new current data based on sample data and SMOTE algorithm;
[0189] The first current data and the new current data are determined to be second current data.
[0190] In a possible implementation, the calibration module 402 is further configured to:
[0191] The generative adversarial network is iterated based on the first current data to determine parameters of the fusion distance.
[0192] In a possible implementation, the discriminator is a binary classifier.
[0193] In a possible implementation, the calibration module 402 is further configured to:
[0194] After the simulated cell is powered on, the zero drift value is obtained after the current value of the simulated cell is in a stable state at zero drift.
[0195] The simulated battery cell is charged with a negative first current and a negative second current at a low temperature by a charging device to obtain a first charging current and a second charging current, wherein the first current is smaller than the second current.
[0196] discharging the simulated battery cell at a low temperature using a discharge device with a positive first current and a positive second current, respectively, to obtain a first discharge current and a second discharge current;
[0197] Charging the simulated battery cell with a negative first current and a negative second current at room temperature using a charging device to obtain a third charging current and a fourth charging current;
[0198] Discharging the simulated battery cell with a positive first current and a positive second current at room temperature using a discharge device to obtain a third discharge current and a fourth discharge current;
[0199] determining first current data according to the zero drift value, the first charging current, the second charging current, the first discharging current, the second discharging current, the third charging current, the fourth charging current, the third discharging current, and the fourth discharging current;
[0200] Among them, the battery rack includes charging equipment, discharging equipment and simulated battery cells.
[0201] In a possible implementation, the first current is 15A, and the second current is 30A.
[0202] In one possible embodiment, the low temperature is minus 25°C.
[0203] In one possible embodiment, the battery rack further includes a main control microcontroller connected to the analog battery cell via IIC or SPI communication;
[0204] The main control microcontroller is used to determine the fitting function offline.
[0205] In a possible implementation, the preset fitting tool includes a linear fitting model.
[0206] The current calibration device provided in the embodiment of the present application can execute the method provided in the above method embodiment. Its implementation principle and technical effects are similar, and are not described in detail in this embodiment.
[0207] Figure 8 The schematic diagram of the controller provided in this application is as follows: Figure 8 As shown, the controller 50 provided in this embodiment includes: at least one processor 501 and a memory 502 .
[0208] Optionally, the controller 50 further includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus.
[0209] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that the at least one processor 501 performs the above method.
[0210] The specific implementation process of the processor 501 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0211] When the battery is used in a vehicle, the controller can be a BMS or a vehicle controller.
[0212] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.
[0213] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory.
[0214] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be classified into address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0215] The present application also provides an electrical device, including: a battery and a controller, the battery including a plurality of single cells; the controller is used to execute the method of the above method embodiment.
[0216] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0217] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0218] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0219] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0220] The division of units is merely a logical functional division; actual implementations may employ alternative divisions, such as combining or integrating multiple units or components into another system, or omitting or disabling certain features. Furthermore, any direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units, either through an interface, electrical, mechanical, or other means.
[0221] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0222] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0223] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0224] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0225] Finally, it should be noted that those skilled in the art will readily identify other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein. The present invention is not limited to the precise structure described above and illustrated in the accompanying drawings, and various modifications and variations may be made without departing from the scope thereof. The scope of the present invention is limited solely by the appended claims.
Claims
1. A current calibration method, characterized in that: include: Obtaining a first current during battery charging and discharging; calibrating the first current according to a fitting function to obtain a second current; monitoring a charge and discharge process of the battery according to the second current; The fitting function is determined by a current data set obtained by a data enhancement algorithm, wherein the data enhancement algorithm includes a SMOTE algorithm and a generative adversarial network, the SMOTE algorithm integrates Euclidean distance and Mahalanobis distance, and the generative adversarial network includes a generator and a discriminator.
2. The method according to claim 1, characterized in that Before calibrating the first current according to the fitting function, the method further includes: Acquire first current data through a battery test bench, where the first current data includes current values of a simulated cell of the battery when charging and discharging at different temperatures and different powers; Performing data enhancement on the first current data according to the data enhancement algorithm to obtain second current data; determining the fitting function according to the second current data and a preset fitting tool; The current data set includes the second current data.
3. The method according to claim 2, characterized in that The step of enhancing the data volume of the first current data according to the data enhancement algorithm to obtain second current data includes: Determine a proximity K of the first current data according to the first current data and the fusion distance to obtain sample data, where the sample data includes variables of the SMOTE algorithm; Determine new current data based on the sample data and the SMOTE algorithm; The first current data and the new current data are determined to be the second current data.
4. The method according to claim 3, characterized in that Before determining the neighboring K of the first current data according to the first current data, the method further includes: The generative adversarial network is iterated according to the first current data to determine a parameter of the fusion distance.
5. The method according to claim 4, characterized in that The discriminator is a binary classifier.
6. The method according to any one of claims 2 to 5, characterized in that: The obtaining of first current data by using a battery stand includes: After the simulated cell is powered on, the zero drift value is obtained after the current value of the simulated cell is in a stable state at zero drift; charging the simulated battery cell using a charging device at a low temperature with a negative first current and a negative second current, respectively, to obtain a first charging current and a second charging current, wherein the first current is less than the second current; discharging the simulated battery cell at the low temperature using a discharge device with a positive first current and a positive second current, respectively, to obtain a first discharge current and a second discharge current; charging the simulated battery cell using the charging device at room temperature with the negative first current and the negative second current, respectively, to obtain a third charging current and a fourth charging current; discharging the simulated battery cell with the first positive current and the second positive current at room temperature through the discharge device to obtain a third discharge current and a fourth discharge current; determining the first current data according to the zero-drift value, the first charging current, the second charging current, the first discharging current, the second discharging current, the third charging current, the fourth charging current, the third discharging current, and the fourth discharging current; Wherein, the battery rack includes the charging device, the discharging device and the simulated battery cell.
7. The method according to claim 6, characterized in that The first current is 15A, and the second current is 30A.
8. The method according to claim 6, characterized in that The low temperature is minus 25°C.
9. The method according to claim 6, characterized in that The battery stand also includes a main control microcontroller connected to the analog battery cell via IIC or SPI communication; The main control microcontroller is used to determine the fitting function offline.
10. The method according to claim 2, characterized in that The preset fitting tool includes a linear fitting model.
11. A current calibration device, characterized in that: include: An acquisition module, configured to acquire a first current during charging and discharging of the battery; a calibration module, configured to calibrate the first current according to a fitting function to obtain a second current; a control module, configured to monitor the charging and discharging process of the battery according to the second current; The fitting function is determined by a current data set obtained by a data enhancement algorithm, wherein the data enhancement algorithm includes a SMOTE algorithm and a generative adversarial network, the SMOTE algorithm integrates Euclidean distance and Mahalanobis distance, and the generative adversarial network includes a generator and a discriminator.
12. A controller, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 10.
13. An electrical device, characterized in that: include: A battery and a controller, wherein the battery comprises a plurality of single cells; The controller is configured to execute the method according to any one of claims 1 to 10.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 10 when executed by a processor.
15. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 10 when executed by a processor.
Citation Information
Cited By
Method and system for dynamically correcting null drift of current sensor
CN121432300A