Current zero drift compensation method, device and electronic equipment

CN122592301APending Publication Date: 2026-08-18BYD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610370113.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-24
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0004]然而,上述方法因无法适应工况的动态变化,进而存在补偿精度低的缺陷

Benefits of technology

[0035] This application provides a current zero-drift compensation method, device, and electronic device. The method proposes to dynamically acquire the zero-drift current value under the current first temperature parameter when the actual battery current is zero, and to dynamically determine the corresponding zero-drift current value based on the real-time detected second temperature parameter when the actual battery current is not zero. The zero-drift current value is then used to compensate the sampling current of the shunt. This scheme acquires the actual zero-drift current matching the current temperature under real zero-current conditions, instead of using a fixed offline calibration value. At the same time, it dynamically matches the corresponding zero-drift current for compensation based on the real-time temperature during normal operation. This allows it to adapt to changes in operating conditions and temperature, thereby fundamentally improving the compensation accuracy and sampling accuracy of current zero drift.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122592301A_ABST
    Figure CN122592301A_ABST
Patent Text Reader

Abstract

The application provides a current zero drift compensation method and device and electronic equipment, and relates to battery management technology; the method comprises the following steps: when the actual current of the battery is zero, a zero drift current value under a current first temperature parameter is dynamically acquired; when the actual current of the battery is not zero, a corresponding zero drift current value is dynamically determined according to a second temperature parameter detected in real time, and the zero drift current value is used to compensate the sampling current of a shunt. Through the application, the current sampling precision can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to battery management technology, and more particularly to a method, apparatus and electronic device for zero current drift compensation. Background Technology

[0002] In battery management systems, electric vehicles, and energy storage devices, shunts are key components for current sampling. Due to factors such as temperature and material properties, shunts are prone to current drift, causing sampling errors and affecting the control accuracy and operational safety of the battery system. Therefore, real-time and accurate current drift compensation for shunts is necessary.

[0003] Currently, in known technologies, the current zero-drift compensation method typically involves obtaining the zero-drift current value at room temperature through offline calibration during the equipment manufacturing or initialization phase, and then writing it into the system as a fixed compensation value. During normal operation of the equipment, this fixed compensation value is directly used to uniformly correct the shunt sampling current.

[0004] However, the above methods cannot adapt to dynamic changes in working conditions, resulting in low compensation accuracy. Summary of the Invention

[0005] This application provides a current zero drift compensation method, apparatus, and electronic device to improve the accuracy of current zero drift compensation.

[0006] In a first aspect, this application provides a current zero-drift compensation method, the method comprising:

[0007] When the actual battery current is zero, the zero-drift current value under the current first temperature parameter is dynamically obtained;

[0008] When the actual current of the battery is not zero, the corresponding zero-drift current value is dynamically determined based on the real-time detected second temperature parameter, and the zero-drift current value is used to perform zero-drift compensation on the sampling current of the shunt.

[0009] In one possible implementation, the first temperature parameter and the second temperature parameter are of the same type, both including at least one of the following: the center temperature of the shunt, the temperature difference between the two ends of the shunt, and the temperature of the sampling circuit board.

[0010] In one possible implementation, the scenario where the actual current of the battery is zero includes at least one of the following: standby mode before the target device is subjected to high voltage and shutdown mode after the target device is subjected to low voltage.

[0011] In one possible implementation, dynamically determining the corresponding zero-drift current value based on the real-time detected second temperature parameter includes:

[0012] Call the existing mapping table; the mapping table stores the correspondence between temperature parameters and zero-drift current values;

[0013] The target temperature parameter that matches the second temperature parameter is found in the mapping table, and the zero drift current value corresponding to the target temperature parameter is used as the zero drift current value corresponding to the second temperature parameter.

[0014] In one possible implementation, the method further includes:

[0015] After dynamically obtaining the zero-drift current value under the current first temperature parameter, if there is no temperature parameter in the mapping table that is consistent with the first temperature parameter, then the first temperature parameter and the corresponding zero-drift current value are entered into the mapping table.

[0016] If a temperature parameter that matches the first temperature parameter exists in the mapping table, then the mapping table is updated according to the zero drift current value under the first temperature parameter.

[0017] In one possible implementation, updating the mapping table based on the zero-drift current value at the first temperature parameter includes:

[0018] Calculate the deviation between the dynamically acquired zero-drift current value under the first temperature parameter and the zero-drift current value corresponding to the first temperature parameter in the mapping table, and when the deviation is greater than a preset threshold for n consecutive times, update the zero-drift current value under the first temperature parameter in the mapping table to the dynamically acquired zero-drift current value.

[0019] And / or,

[0020] The first temperature parameter is input into the prediction model to obtain the zero drift current prediction value. When the deviation between the zero drift current prediction value and the zero drift current value corresponding to the first temperature parameter in the mapping table is greater than the preset threshold, the zero drift current value under the first temperature parameter in the mapping table is updated to the dynamically acquired zero drift current value. The prediction model is a prediction model trained with historically collected temperature parameters as input and the corresponding zero drift current value as output.

[0021] In one possible implementation, the method further includes:

[0022] The temperature at the center of the shunt, the temperature difference between the two ends of the shunt, and the temperature fluctuation of the sampling circuit board are acquired in real time, and their respective impacts on the zero drift current value are also acquired.

[0023] Based on the fluctuation amplitude and the influence amount, the temperature parameter is adaptively determined to be one or more of the following: the center temperature of the shunt, the temperature difference between the two ends of the shunt, and the temperature of the sampling circuit board.

[0024] In one possible implementation, the zero-drift compensation of the shunt's sampled current using the zero-drift current value includes:

[0025] Obtain the raw sampled current value collected in real time by the shunt;

[0026] Subtract the dynamically determined zero-drift current value from the original sampled current value to obtain the compensated actual current value.

[0027] Secondly, this application provides a current zero-drift compensation device, the device comprising:

[0028] The acquisition module is used to dynamically acquire the zero-drift current value under the current first temperature parameter when the actual current of the battery is zero.

[0029] The compensation module is used to dynamically determine the corresponding zero-drift current value based on the real-time detected second temperature parameter when the actual current of the battery is not zero, and to use the zero-drift current value to perform zero-drift compensation on the sampling current of the shunt.

[0030] Thirdly, this application provides an electronic device, including at least one processor and a memory communicatively connected to the processor;

[0031] The memory stores computer-executed instructions;

[0032] The processor executes computer execution instructions stored in the memory to implement the method as described in any of the first aspects.

[0033] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.

[0034] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method as described in any of the first aspects.

[0035] This application provides a current zero-drift compensation method, device, and electronic device. The method proposes to dynamically acquire the zero-drift current value under the current first temperature parameter when the actual battery current is zero, and to dynamically determine the corresponding zero-drift current value based on the real-time detected second temperature parameter when the actual battery current is not zero. The zero-drift current value is then used to compensate the sampling current of the shunt. This scheme acquires the actual zero-drift current matching the current temperature under real zero-current conditions, instead of using a fixed offline calibration value. At the same time, it dynamically matches the corresponding zero-drift current for compensation based on the real-time temperature during normal operation. This allows it to adapt to changes in operating conditions and temperature, thereby fundamentally improving the compensation accuracy and sampling accuracy of current zero drift. Attached Figure Description

[0036] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0037] Figure 1 This is a schematic diagram illustrating an application scenario of a current zero-drift compensation method provided in an embodiment of this application.

[0038] Figure 2 A flowchart illustrating a current zero-drift compensation method provided in this application embodiment. Figure 1 ;

[0039] Figure 3 A schematic diagram illustrating the principle of obtaining temperature parameters provided in an embodiment of this application;

[0040] Figure 4 A flowchart illustrating a current zero-drift compensation method provided in this application embodiment. Figure 2 ;

[0041] Figure 5 This is a schematic diagram of the structure of a current zero-drift compensation device provided in an embodiment of this application;

[0042] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0043] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0044] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0045] In applications such as battery management systems, electric vehicles, and energy storage devices, the shunt is a core component for sampling charging and discharging current. Due to factors such as the material properties of the shunt itself, changes in operating temperature, and device aging, it will still output a weak sampling current even when no actual current is flowing through it, i.e., current zero drift. Current zero drift directly leads to an increase in current sampling error, affecting energy calculation, protection strategy execution, and system control accuracy. Therefore, real-time and accurate zero drift compensation of the shunt output current is a critical step in ensuring the safe and reliable operation of the battery system.

[0046] Currently, known technologies for shunt current drift compensation typically involve obtaining the drift current value under normal temperature conditions through offline calibration during the equipment manufacturing or system power-on initialization phase. This value is then written into the system control program as a fixed compensation value. During subsequent normal operation, regardless of changes in actual operating temperature, environment, or duration, this fixed compensation value is directly used to uniformly correct the current signal collected by the shunt, without updating or adjusting the compensation value based on actual operating conditions. Furthermore, most existing compensation methods do not consider the impact of real-time temperature changes on the drift current, nor do they utilize the actual zero current of the battery to obtain a drift current matching the current temperature; they rely solely on a single fixed value for compensation.

[0047] As can be seen from the above, the zero-drift compensation methods currently known in the technology have the drawback of low compensation accuracy because they cannot adapt to the dynamic changes in working conditions.

[0048] Therefore, embodiments of this application provide a current zero-drift compensation method, apparatus, and electronic device to solve the above-mentioned problems. Specifically, the method of this application proposes to dynamically acquire the zero-drift current value corresponding to the current first temperature parameter when the actual battery current is zero, and to dynamically determine the corresponding zero-drift current value based on the real-time detected second temperature parameter when the actual battery current is not zero, and then use the zero-drift current value to perform zero-drift compensation on the sampling current output by the shunt.

[0049] It is understood that the current zero-drift compensation method of this application is applicable to any scenario where battery current is sampled based on a shunt. For example, the method of this application can be used in the battery management process of electric vehicle power batteries. Figure 1 This is a schematic diagram illustrating an application scenario of a current zero-drift compensation method provided in an embodiment of this application, such as... Figure 1 As shown, the method of this application is executed by the vehicle controller in the electric vehicle.

[0050] Specifically, under conditions where the actual battery current is zero before and after the electric vehicle is powered on and off, the vehicle controller collects the first temperature parameter of the current shunt and obtains the actual zero-drift current value at that temperature. When the vehicle is driving normally and the battery has charging and discharging current, the controller detects the second temperature parameter in real time, dynamically matches the corresponding zero-drift current value according to the temperature, and then uses the zero-drift current value to compensate the sampled current in real time.

[0051] In the above process, by acquiring zero-drift current that matches the temperature under real zero-current conditions, and dynamically adjusting the compensation value according to the real-time temperature during the working phase, the zero-drift compensation can adapt to changes in operating conditions and temperature, thereby improving the accuracy of zero-drift compensation and effectively improving the current sampling accuracy and the reliability of the battery management system.

[0052] It should be understood that, in the above process, the executing entity of the method of this application can also be any device with data processing and control functions, such as a battery manager or a cloud server, and this embodiment does not limit this. Furthermore, the application scenarios of the method of this application can also be other scenarios, such as battery management in energy storage power stations, portable power current detection, and industrial battery pack monitoring, and this embodiment does not limit this.

[0053] The following detailed description, with reference to the accompanying drawings and using any electronic device as the implementing entity, outlines some embodiments of the current zero-drift compensation method of this application. Where the embodiments do not conflict, the following embodiments and features thereof can be combined with each other.

[0054] This application provides a current zero-drift compensation method. Figure 2 A flowchart illustrating a current zero-drift compensation method provided in this application embodiment. Figure 1 ,like Figure 2 As shown, the method in this application embodiment includes:

[0055] S201. When the actual current of the battery is zero, dynamically obtain the zero-drift current value under the current first temperature parameter.

[0056] The electronic device determines whether the actual current of the battery is zero by monitoring the operating status of the target device. When the battery is determined to be in a zero-current state, the current first temperature parameter is collected synchronously, and the sampled value output by the shunt in the zero-current state is read. This sampled value is the true zero-drift current value under the current first temperature parameter.

[0057] S202. When the actual current of the battery is not zero, the corresponding zero drift current value is dynamically determined based on the real-time detected second temperature parameter, and the zero drift current value is used to perform zero drift compensation on the sampling current of the shunt.

[0058] In this embodiment, the scenario where the actual battery current is zero includes at least one of the following: the standby condition before the target device is charged with high voltage, and the shutdown condition after the target device is charged with low voltage. The target device is an electrical device or energy storage device equipped with a battery system, such as an electric vehicle, energy storage cabinet, or portable power supply. The electronic device monitors the operating condition of the target device in real time by detecting signals such as the device's power-on status, power-off status, relay status, and operating level.

[0059] In this embodiment, when the electronic device detects that the target device enters a standby state before high voltage is applied or a shutdown state after high voltage is applied, it determines that there is no actual current flowing in the battery circuit, that is, the actual battery current is zero.

[0060] In practical applications, in addition to judging the operating conditions, the actual current of the battery can also be confirmed to be zero by directly detecting the voltage across the shunt and the current in the sampling circuit. It can also be combined with the vehicle status, charging status, and dormant status for comprehensive judgment. This application does not limit this.

[0061] In this embodiment, the scenario where the actual battery current is zero is limited to standby before high voltage is applied and shutdown after high voltage is applied. This allows for the collection of zero-drift current in a true zero-drift state where the system is stable, interference-free, and without charging or discharging current, thus avoiding interference caused by data collection during operation and ensuring that the collected values ​​are true and reliable.

[0062] In this embodiment, the first temperature parameter and the second temperature parameter are the same type of temperature parameter, both including at least one of the following: the center temperature of the shunt, the temperature difference between the two ends of the shunt, and the temperature of the sampling circuit board.

[0063] First, it should be clarified that in this embodiment, the shunt body is mounted on a PCB carrier board, and the PCB carrier board and the sampling circuit board are electrically connected and together form a current sampling loop; the shunt body is used to collect the current signal of the battery, the sampling circuit board is used to process and convert the collected signal, and the PCB carrier board provides structural support and electrical connection for the shunt body.

[0064] Based on this, Figure 3 This is a schematic diagram illustrating the principle of obtaining temperature parameters provided in an embodiment of this application, as shown below. Figure 3 As shown, temperature monitoring points on both sides of the shunt are used to obtain the temperature at both ends of the shunt, and a temperature monitoring point at the center of the shunt is used to obtain the temperature at the center of the shunt. In this embodiment, temperature sensors installed on both sides of the shunt body or PCB carrier are used to obtain the temperature at the center of the shunt and the temperature difference between the two ends of the shunt, and a temperature sensor installed on the sampling circuit board is used to obtain the temperature of the sampling circuit board.

[0065] More specifically, the electronic device first obtains the temperature on both sides by interacting with temperature sensors located on both sides of the shunt body or PCB carrier board, obtains the temperature difference between the two ends of the shunt by subtracting the temperature on both sides, and obtains the center temperature of the shunt by averaging the temperature on both sides.

[0066] In practical applications, the center temperature of the shunt can also be obtained by a temperature sensor at the center of the shunt body or the center of the PCB carrier. In addition, in practical applications, various temperature values ​​can be collected by setting multiple sampling points. For example, multiple temperature sensors can be set on both sides of the shunt, and the temperature of the corresponding side can be obtained by averaging the detection values ​​of multiple sensors on each side. This application does not limit this.

[0067] In this embodiment, the first temperature parameter and the second temperature parameter contain exactly the same temperature indices. That is, if the first temperature parameter is selected as the center temperature of the shunt and the temperature difference between the two ends, then the second temperature parameter also uses the same two indices.

[0068] It is understandable that the temperature of the shunt itself, the temperature difference between its two ends, and the temperature of the sampling circuit board all have a direct impact on the shunt's on-resistance and sampling zero drift, and are key factors in determining the magnitude of the zero drift current. Therefore, keeping the first temperature parameter and the second temperature parameter consistent and including at least one of the above temperatures can ensure that the same temperature reference is used for zero drift acquisition and compensation, thereby improving the matching degree and compensation accuracy.

[0069] As a preferred example, the electronic device acquires in real time the fluctuation amplitude and influence of the shunt center temperature, the temperature difference between the two ends of the shunt, and the sampling circuit board temperature, respectively, on the zero drift current value; and adaptively determines the temperature parameter as one or more of the shunt center temperature, the temperature difference between the two ends of the shunt, and the sampling circuit board temperature based on the fluctuation amplitude and influence.

[0070] Specifically, the fluctuation range refers to the range of temperature change within a unit of time, reflecting whether the temperature is stable; the influence refers to the magnitude of the change in zero drift current when the temperature changes by a unit value, reflecting the degree of influence of the temperature on zero drift.

[0071] Furthermore, if a certain temperature index has the greatest impact on zero drift and the fluctuation range is small, then that index should be selected first; if two temperature indices have a large and similar impact on zero drift, then both should be selected; if all three temperature indices have a significant impact on zero drift, then all three temperature parameters should be used.

[0072] More specifically, in this embodiment, "maximum influence" means that the zero drift coefficient corresponding to this temperature is greater than 50% of the coefficient corresponding to any other temperature; "close influence" means that the difference between the zero drift coefficients corresponding to the two temperatures is within 20%; and "small fluctuation" means that the temperature change within a unit of time does not exceed a preset temperature threshold. It should be understood that the specific judgment threshold can be adjusted according to needs.

[0073] In practical applications, the number of temperature parameters can be adaptively selected based on indicators such as temperature change rate, temperature stability, and system computing power. Alternatively, weighting coefficients can be set, and one or more parameters can be selected based on a comprehensive weighting decision. This embodiment does not impose any limitations on this. For example, a weight of 0.6 can be set for the center temperature of the shunt, 0.3 for the temperature difference between the two ends, and 0.1 for the sampling plate temperature. The parameter or parameters with the highest weighted score can be used as the final selected temperature parameters.

[0074] Furthermore, in practical applications, temperature parameters can be pre-specified by the user or automatically filtered according to equipment operating conditions and modes; this application does not impose such limitations. For example, the temperature difference between the two ends of the shunt can be considered as a necessary factor, and then, depending on the actual operating conditions, it can be selected whether to further introduce temperature parameters such as the shunt center temperature and / or the sampling circuit board temperature.

[0075] In this embodiment, the adaptive selection of the number of temperature items can dynamically adjust the number of temperature indicators involved in the calculation based on the actual temperature changes and the system's computing power. When the temperature changes are gradual and the influence of a single temperature is significant, the amount of calculation is reduced, improving the system's operating efficiency. When the temperature changes drastically and multiple temperatures jointly affect zero drift, the number of temperature indicators is increased to ensure compensation accuracy, thereby helping to achieve a balance between accuracy and efficiency.

[0076] It should be understood that the electronic device can determine the specific indicators included in the temperature parameter in real time based on the above process. When the included indicators are determined and the actual battery current is detected to be zero, the device dynamically acquires the current first temperature parameter and its corresponding zero-drift current value. The first temperature parameter can be acquired by combining its included specific indicators with the acquisition methods corresponding to each indicator mentioned above. The zero-drift current value is acquired through the following process: the electronic device directly reads the output sampling value of the shunt in the zero-current state, which is the true zero-drift current value under the current first temperature parameter.

[0077] Based on this, when the electronic device detects that the actual battery current is not zero, that is, when the battery enters the normal charging and discharging state and the target device enters the driving or working state, it indicates that the system needs to perform high-precision current sampling to realize functions such as power estimation, overcurrent protection, and power control. Therefore, real-time current zero drift compensation is required.

[0078] In this embodiment, the electronic device first obtains the values ​​of each index of the current second temperature parameter in the aforementioned manner, then dynamically determines the corresponding zero drift current value based on the second temperature parameter, and finally performs zero drift compensation on the sampling current of the shunt based on the zero drift current value at this time.

[0079] Specifically, the electronic device uses the first temperature parameter, which has the same value as each index of the second temperature parameter, as the current zero drift current value for subsequent compensation calculations.

[0080] In practical applications, multiple historical sets of first temperature parameters can be fitted with zero-drift current values ​​to obtain a temperature-zero-drift function. This function can then be substituted into the second temperature parameter to calculate the real-time zero-drift current value. Alternatively, interpolation, table lookup weighting, or moving average methods can be used to determine the zero-drift current value; this application does not limit the specific methods used. For example, the least squares method can be used to linearly fit multiple sets of temperature and zero-drift data to obtain a function of the form I_offset=kT+b. Substituting the real-time temperature into this function yields the corresponding zero-drift current value.

[0081] Specifically, the electronic device acquires the raw sampled current value collected in real time by the shunt; the dynamically determined zero-drift current value is subtracted from the raw sampled current value to obtain the compensated actual current value. The calculation formula is: Izero-drift compensated = Icollected - Izero-drift. More specifically, in this embodiment, after zero-drift compensation is completed, temperature drift compensation is performed on the zero-drift compensated current value using the TCR compensation coefficient to obtain the final actual current value. The calculation formula is: Iactual = Izero-drift compensated / kT, where kT is the TCR compensation coefficient, used to compensate for the additional sampling error caused by the change in shunt resistance due to temperature changes, ensuring that the final output actual current value is more accurate and more closely matches the actual working state of the shunt.

[0082] It should be understood that the compensation calculation can also be adjusted according to the sampling loop gain, amplification factor, and calibration coefficient, or implemented by addition, weighted correction, etc., and this embodiment does not limit this. For example, the actual current value = (original sampling current value − zero drift current value) / amplification factor × calibration coefficient.

[0083] In this embodiment, by using the zero-drift current collected under real operating conditions combined with the TCR temperature compensation coefficient for dual compensation, both the fixed zero-drift deviation is eliminated and the dynamic error caused by the change of shunt resistance with temperature is compensated. The compensation logic fits the physical characteristics of the shunt, and the calculation is simple and reliable, which is conducive to improving the current sampling accuracy in the whole temperature range and under all operating conditions.

[0084] In the method provided in this embodiment, the real zero-drift current matching the first temperature parameter is obtained under the zero-current condition of the battery, and the corresponding zero-drift current is dynamically matched and compensated according to the real-time second temperature parameter when the battery is working normally. This allows the zero-drift compensation value to always follow the dynamic changes of the actual temperature and operating conditions, avoiding the defect that the fixed compensation value cannot adapt to temperature changes. This fundamentally improves the accuracy, adaptability and robustness of current zero-drift compensation, which is conducive to ensuring that the battery management system can achieve high-precision current sampling throughout the entire life cycle and under all environmental conditions.

[0085] This application also provides an embodiment of a current zero-drift compensation method. Figure 4 A flowchart illustrating a current zero-drift compensation method provided in this application. Figure 2 ,like Figure 4 As shown, the method in this embodiment includes:

[0086] S401, Call the currently existing mapping table.

[0087] The mapping table stores the correspondence between temperature parameters and zero-drift current values.

[0088] Specifically, in this embodiment, the electronic device internally stores and maintains a temperature parameter-zero drift current mapping table. When a set of first temperature parameters and the corresponding actual zero drift current value are obtained under the zero current condition of the battery, the set of data is synchronously written into the mapping table for storage.

[0089] It should be understood that the dimensions of the mapping table correspond to the number of indicators included in the temperature parameter: when the temperature parameter contains only one item, the mapping table is a two-dimensional table that stores the one-to-one correspondence between temperature values ​​and zero drift current values; when the temperature parameter contains two or three items, the mapping table is a multi-dimensional mapping relationship that stores the correspondence between multiple temperature combinations and zero drift current values.

[0090] S402. Find the target temperature parameter that matches the second temperature parameter in the mapping table, and use the zero drift current value corresponding to the target temperature parameter as the zero drift current value corresponding to the second temperature parameter.

[0091] In this embodiment, the electronic device compares the second temperature parameter detected in real time with all temperature parameters stored in the mapping table one by one to find the target temperature parameter that is completely consistent with the second temperature parameter or consistent within the allowable error range.

[0092] In practical applications, nearest neighbor interpolation, linear interpolation, weighted matching, and other methods can also be used to find and calculate the corresponding zero-drift current value. This embodiment does not limit this method.

[0093] In addition, in practical applications, after finding the corresponding zero-drift current value, the zero-drift current value can be slightly corrected by combining the status information such as the equipment running time, the aging degree of the shunt, and the sampling channel gain. This application does not limit this.

[0094] The method in this embodiment enables rapid lookup and matching of the zero-drift current value based on a calibrated mapping table when determining the zero-drift current value of the second temperature parameter. This eliminates the need for complex fitting calculations in real time, resulting in fast response, low resource consumption, and the ability to meet real-time requirements while ensuring compensation accuracy.

[0095] It should be understood that the above mapping table is dynamically updated. As a preferred example, after the electronic device dynamically obtains the zero-drift current value under the current first temperature parameter, if there is no temperature parameter in the mapping table that matches the first temperature parameter, then the first temperature parameter and the corresponding zero-drift current value are entered into the mapping table; if there is a temperature parameter in the mapping table that matches the first temperature parameter, then the mapping table is updated according to the zero-drift current value under the first temperature parameter.

[0096] Specifically, if there is no record of the same temperature parameter in the mapping table, it means that the temperature point has not been calibrated. In this case, the new temperature-zero drift data can be directly added to the mapping table. If there is already a record of the same temperature parameter in the mapping table, the latest collected zero drift current value is compared with the original value to determine whether it needs to be updated, so as to ensure that the mapping table data always reflects the current true zero drift characteristics.

[0097] As a further design, when updating the mapping table based on the zero-drift current value under the first temperature parameter, the electronic device specifically implements the update through the following process: calculating the deviation between the dynamically acquired zero-drift current value under the first temperature parameter and the zero-drift current value corresponding to the first temperature parameter in the mapping table, and when the deviation is greater than a preset threshold for n consecutive times, updating the zero-drift current value under the first temperature parameter in the mapping table to the dynamically acquired zero-drift current value.

[0098] More specifically, the electronic device collects zero-drift current values ​​n times consecutively under the same first temperature parameter, calculates the deviation between each collected value and the old value in the mapping table, and if the deviation exceeds a preset threshold for n consecutive times, the original data is determined to be invalid, and the latest collected real zero-drift current value is used to overwrite and update it.

[0099] Where n is the number of consecutive valid samples, which can be set to 3 to 10 times according to the system stability requirements; the preset threshold is the upper limit of the allowable zero drift current deviation, which can be set to the microampere or milliampere level threshold according to the sampling accuracy requirements.

[0100] In another possible implementation, the electronic device updates the data through the following process: the first temperature parameter is input into the prediction model to obtain the zero drift current prediction value; when the deviation between the zero drift current prediction value and the zero drift current value corresponding to the first temperature parameter in the mapping table is greater than a preset threshold, the zero drift current value under the first temperature parameter in the mapping table is updated to the dynamically acquired zero drift current value; the prediction model is a prediction model trained with historically collected temperature parameters as input and the corresponding zero drift current value as output.

[0101] More specifically, the prediction model learns the variation law of shunt zero drift with temperature through historical temperature-zero drift data, and outputs the theoretical zero drift value based on the input temperature; when the predicted value deviates too much from the value stored in the mapping table, it indicates that the stored value deviates from the actual characteristics, and the latest collected real value is used for updating.

[0102] In this embodiment, the mapping table update operation can be performed when at least one of the two update conditions, namely, multiple consecutive deviations exceeding the limit and prediction model deviations exceeding the limit, is met, thus balancing anti-interference capability and update timeliness.

[0103] In practical applications, deviation can be judged using methods such as absolute deviation, relative deviation, and moving average deviation; prediction models can employ linear fitting, polynomial fitting, lightweight neural networks, etc., and this embodiment does not impose any limitations on these methods. For example, a lightweight linear regression model is selected as the prediction model. The input of this linear regression model is the first temperature parameter collected historically (if there are three temperature parameters, the inputs are the shunt center temperature T1, the temperature difference between the two ends of the shunt T2, and the sampling circuit board temperature T3), and the output is the corresponding zero-drift current value I_offset. The model training process is as follows:

[0104] The first step is to collect all first temperature parameters and corresponding zero-drift current values ​​collected by electronic devices under zero-current battery conditions over the past 3-6 months to form a training dataset, removing abnormal data (such as data with sudden temperature changes or abnormal current sampling). The second step is to divide the training dataset into a training set and a validation set in an 8:2 ratio. The training set is used for model parameter fitting, and the validation set is used to verify model accuracy. The third step is to fit the model parameters using the least squares method, i.e., I_offset=a1×T1+a2×T2+a3×T3+b (where a1, a2, and a3 are the weighting coefficients of each temperature parameter, and b is a constant term). The fourth step is to input the temperature parameters from the validation set into the trained model and calculate the deviation between the predicted value and the actual zero-drift current value. If the deviation is less than a preset accuracy threshold (e.g., 5 mA), the model training is complete and put into use; if the deviation is greater than the threshold, the dataset is re-optimized and the model parameters are adjusted until the accuracy requirements are met. After training is complete, each time a new first temperature parameter is obtained, inputting it into the model will yield the zero-drift current prediction value. The deviation is then compared with the stored value in the mapping table to determine whether the mapping table needs to be updated.

[0105] In addition, in practical applications, the mapping table can be updated directly each time a new zero-drift current value is collected, or it can be updated in batches at fixed time periods; a timestamp can also be added to each data entry, and the most recent valid data can be used first when looking up the table. This application does not limit this.

[0106] In this embodiment, by first determining whether a record matching the current first temperature parameter exists in the mapping table, and then distinguishing between adding a new record or updating the calibration, the duplicate storage of the same temperature point data can be avoided, reducing storage resource consumption and improving temperature retrieval efficiency. Adding unrecorded temperature points directly expands the temperature coverage of the mapping table, allowing for matching more operating conditions during subsequent compensation. Updating existing temperature points only when conditions are met avoids interference from single abnormal sampling with existing valid data, ensuring the overall stability and reliability of the mapping table. This ensures that the query and compensation of zero drift current are always based on real, accurate, and up-to-date calibration data.

[0107] Furthermore, by combining continuous sampling deviation judgment with prediction model trend judgment for mapping table updates, it can effectively filter out abnormal data caused by accidental factors such as instantaneous noise and electromagnetic interference, ensuring that the mapping table is not updated incorrectly. It can also promptly identify real zero drift changes in the shunt due to temperature drift and component aging, ensuring that the mapping table data always closely matches the actual hardware characteristics. In addition, the two judgment methods complement each other, ensuring stable and reliable updates while improving the response speed to zero drift changes. This allows the entire compensation process to maintain high accuracy and robustness under long-term use, complex operating conditions, and changes in component characteristics.

[0108] As an example, considering the temperature difference across the shunt and the shunt center temperature, a mapping table is used to achieve zero-drift current compensation. Specifically, temperature sensors are placed on the shunt body or PCB substrate, positioned on both sides of the shunt. The center temperature is obtained by averaging the temperatures on both sides. A mapping table is preset between the zero-drift current and the shunt center temperature and the temperature difference between the two ends (the initial value can be the zero-drift current measured at room temperature or a typical value). Based on this, the zero-drift current compensation specifically includes:

[0109] S11: When the electric vehicle is only connected to the low voltage and not the high voltage, the actual battery current is 0A. Read the current sampling current result of the shunt I zero drift, the center temperature of the shunt T center, and the temperature difference between the two ends T temperature difference.

[0110] S12: Update the above records I zero drift, T center, and T temperature difference to the corresponding parameters in the mapping table, while keeping the other zero drift current values ​​in the table unchanged;

[0111] S13: During normal use of electric vehicles, the real-time current zero drift under the corresponding operating conditions is determined by referring to the table based on the center temperature of the shunt and the temperature difference between the two ends, and zero drift compensation is performed using this value. I after zero drift compensation = I collected - I zero drift, I actual = I after zero drift compensation / kT, where kT is the TCR compensation coefficient.

[0112] S14: When the electric vehicle is subjected to high voltage, the actual current of the battery is 0A. Read the current sampling current result of the shunt I zero drift, the center temperature of the shunt T center, and the temperature difference between the two ends T temperature difference.

[0113] S15: Update the above records I zero drift, T center, and T temperature difference to the corresponding parameters in the mapping table, while keeping other zero drift current values ​​in the table unchanged; conditions can be set during the update, such as updating if the deviation from the corresponding value in the table reaches more than 10% for n consecutive times, to avoid introducing random errors and achieve dynamic calibration of the mapping table.

[0114] As another example, further considering the impact of sampling circuit board temperature on zero drift, current zero drift compensation is achieved by combining a three-dimensional mapping table. Specifically, temperature sensors are placed on the shunt body or PCB carrier (placed on both sides of the shunt, with the center temperature obtained by averaging the temperatures on both sides), and a temperature sensor is also placed on the sampling circuit board; a three-dimensional mapping table is preset (i.e., a multi-dimensional mapping table of zero drift current with the shunt center temperature and the temperature difference between the two ends under different sampling circuit board temperature ranges; each temperature range can be adjusted according to the actual product situation, and the initial value can be the zero drift current measured at room temperature or a typical value). Based on this, current zero drift compensation specifically includes:

[0115] S21: When the electric vehicle is only connected to the low voltage and not the high voltage, the actual battery current is 0A. Read the current sampling current result of the shunt I zero drift, the center temperature of the shunt T center, the temperature difference between the two ends T temperature difference, and the sampling circuit board temperature T board temperature.

[0116] S22: Update the above records I zero drift, T center, T temperature difference, and T plate temperature to the corresponding parameters in the three-dimensional mapping table, while keeping the other zero drift current values ​​in the table unchanged;

[0117] S23: During normal use of electric vehicles, the real-time current zero drift under the corresponding operating conditions is determined by referring to the table based on the shunt center temperature, the temperature difference between the two ends, and the sampling circuit board temperature, and zero drift compensation is performed using this value. I zero drift compensation = I sampling - I zero drift, I actual = I zero drift compensation / kT, where kT is the TCR compensation coefficient.

[0118] S24: When the electric vehicle is subjected to high voltage, the actual current of the battery is 0A. Read the current sampling current result of the shunt I zero drift, the center temperature of the shunt T center, the temperature difference between the two ends T temperature difference, and the sampling circuit board temperature T board temperature.

[0119] S25: Update the above records I (zero drift), T (center), T (temperature difference), and T (plate temperature) to the corresponding parameters in the three-dimensional mapping table. Other zero drift current values ​​in the table remain unchanged. When updating, conditions can be set, such as updating if the deviation from the corresponding value in the table reaches more than 10% for n consecutive times, to avoid introducing random errors. At the same time, the values ​​in the table can be continuously updated and corrected based on the real data during vehicle operation, so that the mapping table is always up-to-date and further improves the current sampling accuracy under different operating conditions.

[0120] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0121] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0122] The above embodiments introduce a current zero-drift compensation method from the perspective of process flow. The following embodiments introduce a current zero-drift compensation device from the perspective of virtual module or virtual unit. For details, please refer to the following embodiments.

[0123] This application also provides a current zero-drift compensation device for implementing the method described in the above method embodiments. Figure 5 This is a schematic diagram of the structure of a current zero-drift compensation device provided in an embodiment of this application, as shown below. Figure 5 As shown, in this embodiment, the current zero-drift compensation device may include:

[0124] The acquisition module 51 is used to dynamically acquire the zero drift current value under the current first temperature parameter when the actual current of the battery is zero.

[0125] The compensation module 52 is used to dynamically determine the corresponding zero-drift current value based on the real-time detected second temperature parameter when the actual battery current is not zero, and to use the zero-drift current value to perform zero-drift compensation on the sampling current of the shunt.

[0126] In one possible implementation of this application, the first temperature parameter and the second temperature parameter are the same type of temperature parameter, both including at least one of the following: the center temperature of the shunt, the temperature difference between the two ends of the shunt, and the temperature of the sampling circuit board.

[0127] In one possible implementation of this application, the scenario where the actual battery current is zero includes at least one of the following: standby mode before the target device is charged with high voltage and shutdown mode after the target device is charged with low voltage.

[0128] In one possible implementation of this application embodiment, the compensation module 52 is specifically used for:

[0129] Call the existing mapping table; the mapping table stores the correspondence between temperature parameters and zero-drift current values;

[0130] Find the target temperature parameter that matches the second temperature parameter in the mapping table, and use the zero drift current value corresponding to the target temperature parameter as the zero drift current value corresponding to the second temperature parameter.

[0131] In one possible implementation of this application embodiment, the compensation module 52 is further configured to:

[0132] After dynamically obtaining the zero-drift current value under the current first temperature parameter, if there is no temperature parameter in the mapping table that matches the first temperature parameter, then the first temperature parameter and the corresponding zero-drift current value are entered into the mapping table.

[0133] If a temperature parameter that matches the first temperature parameter exists in the mapping table, then the mapping table is updated according to the zero drift current value under the first temperature parameter.

[0134] In one possible implementation of this application embodiment, the compensation module 52 is specifically used for:

[0135] Calculate the deviation between the zero drift current value under the dynamically acquired first temperature parameter and the zero drift current value corresponding to the first temperature parameter in the mapping table, and update the zero drift current value under the first temperature parameter in the mapping table to the dynamically acquired zero drift current value when the deviation is greater than the preset threshold for n consecutive times.

[0136] And / or,

[0137] The first temperature parameter is input into the prediction model to obtain the zero drift current prediction value. When the deviation between the zero drift current prediction value and the zero drift current value corresponding to the first temperature parameter in the mapping table is greater than a preset threshold, the zero drift current value under the first temperature parameter in the mapping table is updated to the dynamically acquired zero drift current value. The prediction model is a prediction model trained with historically collected temperature parameters as input and the corresponding zero drift current value as output.

[0138] In one possible implementation of this application embodiment, the acquisition module 51 is specifically used for:

[0139] Real-time acquisition of the shunt center temperature, the temperature difference between the two ends of the shunt, the temperature fluctuation of the sampling circuit board, and their respective impact on the zero drift current value;

[0140] Based on the fluctuation amplitude and the amount of influence, the temperature parameters are adaptively determined to be one or more of the following: the center temperature of the shunt, the temperature difference between the two ends of the shunt, and the temperature of the sampling circuit board.

[0141] In one possible implementation of this application embodiment, the compensation module 52 is specifically used for:

[0142] Obtain the raw sampling current value collected in real time by the shunt;

[0143] Subtract the dynamically determined zero-drift current value from the original sampled current value to obtain the compensated actual current value.

[0144] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.

[0145] This application provides an electronic device. Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 6 As shown, Figure 6 The illustrated electronic device includes at least one processor 61 and a memory 62. The processor 61 and the memory 62 are connected, for example, via a bus 63. Optionally, the electronic device may also include a transceiver 64. It should be noted that in practical applications, the transceiver 64 is not limited to one, and the structure of this electronic device does not constitute a limitation on the embodiments of this application.

[0146] Processor 61 may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 61 may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0147] Bus 63 may include a pathway for transmitting information between the aforementioned components. Bus 63 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 63 may be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0148] The memory 62 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0149] The memory 62 stores computer execution instructions for implementing the scheme of this application, and the processor 61 controls the execution. The processor 61 executes the computer execution instructions stored in the memory 62 to implement the content shown in the foregoing method embodiments.

[0150] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Specifically, the computer-readable storage medium stores computer-executable instructions, which are used to implement the methods in the above embodiments.

[0151] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the technical solution of the above method embodiments. Its implementation principle and technical effects are similar, and will not be repeated here.

[0152] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.

[0153] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0154] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A current zero-drift compensation method, characterized in that, The method includes: When the actual battery current is zero, the zero-drift current value under the current first temperature parameter is dynamically obtained; When the actual current of the battery is not zero, the corresponding zero-drift current value is dynamically determined based on the real-time detected second temperature parameter, and the zero-drift current value is used to perform zero-drift compensation on the sampling current of the shunt.

2. The method according to claim 1, characterized in that, The first temperature parameter and the second temperature parameter are of the same type, both including at least one of the following: the center temperature of the shunt, the temperature difference between the two ends of the shunt, and the temperature of the sampling circuit board.

3. The method according to claim 1 or 2, characterized in that, The scenario in which the actual current of the battery is zero includes at least one of the following: the standby condition before the target device is subjected to high voltage, and the shutdown condition after the target device is subjected to low voltage.

4. The method according to claim 1 or 2, characterized in that, The step of dynamically determining the corresponding zero-drift current value based on the real-time detected second temperature parameter includes: Call the existing mapping table; the mapping table stores the correspondence between temperature parameters and zero-drift current values; The target temperature parameter that matches the second temperature parameter is found in the mapping table, and the zero drift current value corresponding to the target temperature parameter is used as the zero drift current value corresponding to the second temperature parameter.

5. The method according to claim 4, characterized in that, The method further includes: After dynamically obtaining the zero-drift current value under the current first temperature parameter, if there is no temperature parameter in the mapping table that is consistent with the first temperature parameter, then the first temperature parameter and the corresponding zero-drift current value are entered into the mapping table. If a temperature parameter that matches the first temperature parameter exists in the mapping table, then the mapping table is updated according to the zero drift current value under the first temperature parameter.

6. The method according to claim 5, characterized in that, The step of updating the mapping table based on the zero-drift current value under the first temperature parameter includes: Calculate the deviation between the dynamically acquired zero-drift current value under the first temperature parameter and the zero-drift current value corresponding to the first temperature parameter in the mapping table, and when the deviation is greater than a preset threshold for n consecutive times, update the zero-drift current value under the first temperature parameter in the mapping table to the dynamically acquired zero-drift current value. And / or, The first temperature parameter is input into the prediction model to obtain the zero drift current prediction value. When the deviation between the zero drift current prediction value and the zero drift current value corresponding to the first temperature parameter in the mapping table is greater than the preset threshold, the zero drift current value under the first temperature parameter in the mapping table is updated to the dynamically acquired zero drift current value. The prediction model is a prediction model trained with historically collected temperature parameters as input and the corresponding zero drift current value as output.

7. The method according to claim 2, characterized in that, The method further includes: The temperature at the center of the shunt, the temperature difference between the two ends of the shunt, and the temperature fluctuation of the sampling circuit board are acquired in real time, and their respective impacts on the zero drift current value are also acquired. Based on the fluctuation amplitude and the influence amount, the temperature parameter is adaptively determined to be one or more of the following: the center temperature of the shunt, the temperature difference between the two ends of the shunt, and the temperature of the sampling circuit board.

8. The method according to claim 1 or 2, characterized in that, The step of using the zero-drift current value to perform zero-drift compensation on the sampling current of the shunt includes: Obtain the raw sampled current value collected in real time by the shunt; Subtract the dynamically determined zero-drift current value from the original sampled current value to obtain the compensated actual current value.

9. A current zero-drift compensation device, characterized in that, The device includes: The acquisition module is used to dynamically acquire the zero-drift current value under the current first temperature parameter when the actual current of the battery is zero. The compensation module is used to dynamically determine the corresponding zero-drift current value based on the real-time detected second temperature parameter when the actual current of the battery is not zero, and to use the zero-drift current value to perform zero-drift compensation on the sampling current of the shunt.

10. An electronic device, characterized in that, It includes at least one processor and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-8.