Method and apparatus for correcting temperature in battery pack

By using particle swarm optimization algorithm to set a linear correction coefficient for the temperature acquisition channel in the lithium battery pack, the problems of uneven temperature data and sensor error in the lithium battery pack are solved, achieving accurate correction of temperature data and improved reliability, thus ensuring the safety and performance evaluation of the battery.

CN121922767BActive Publication Date: 2026-07-21BEIJING VICTORY ELECTRICAL TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING VICTORY ELECTRICAL TECH DEV CO LTD
Filing Date
2025-12-01
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies in lithium battery PACKs suffer from uneven temperature data acquisition, sensor accuracy differences, and error amplification issues, leading to deviations in performance evaluation and safety warnings, low reliability of temperature data, and impacting safe battery operation.

Method used

A linear correction coefficient is set for each temperature acquisition channel using the particle swarm optimization algorithm, a parameter optimization population is constructed, the correction coefficient is optimized using the fitness function, the sensor error is accurately compensated, and the fitness function is constructed to minimize the error between the corrected temperature and the true temperature.

Benefits of technology

It achieves precise correction of the temperature inside the lithium battery pack, improves the stability and accuracy of temperature data, provides a reliable basis for battery performance evaluation and safety monitoring, and reduces the efficiency of error compensation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121922767B_ABST
    Figure CN121922767B_ABST
Patent Text Reader

Abstract

The application discloses a kind of correction method and device of temperature in battery pack, and the original temperature data of lithium battery PACK is collected by temperature sensor in the method;Corresponding linear correction coefficient is set for each channel;A certain number of particles are introduced, and parameter optimization population is constructed;Fitness function is constructed and the parameters of parameter optimization population are initialized;According to speed update formula and position update formula, the speed and position of each particle are sequentially updated;The updated fitness value of each particle is calculated and obtained;The individual historical optimal position and individual optimal fitness value and group historical optimal position and group optimal fitness value are updated and obtained;Group optimal fitness value is compared with the set error value, and the group optimal position matrix is output, the original temperature data is matched with the corresponding optimal correction coefficient, and the corrected temperature data is obtained.The application solves the problems of existing technology, such as performance evaluation and safety warning deviation, low temperature data reliability and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of new energy battery technology, and specifically to a method and apparatus for correcting the temperature inside a battery pack. Background Technology

[0002] In the new energy field, temperature monitoring of lithium battery packs is a core component for ensuring safe battery operation and performance evaluation. Existing technologies generally employ multiple NTC sensors to acquire temperature data. In specific applications, 3-6 NTC sensors are typically placed at different locations within the battery pack to collect real-time temperature data of the lithium battery during charging and discharging. The raw temperature data, after simple processing, is directly used to determine whether the battery is within its normal operating temperature range, evaluate charging and discharging efficiency, and trigger over-temperature protection mechanisms. It serves as the fundamental data source for the Battery Management System (BMS) to achieve intelligent control.

[0003] However, existing technologies have significant drawbacks in practical applications: On the one hand, due to differences in cell arrangement and heat distribution during charging and discharging, uneven temperature distribution is easily observed inside lithium battery packs. Existing technologies often process multi-channel temperature data by simply averaging or selecting extreme values, failing to accurately reflect the true temperature field distribution within the battery pack. This leads to deviations in performance evaluation and safety warnings based on temperature data. On the other hand, the acquisition accuracy of multiple NTC sensors varies due to differences in manufacturing processes, aging after long-term use, and environmental electromagnetic interference. Furthermore, the nonlinear characteristics of the sensors themselves further amplify the errors. Existing technologies lack personalized correction schemes for each sensor, making it difficult to accurately compensate for acquisition errors. Ultimately, this reduces the reliability of temperature data, posing potential risks to the safe operation of lithium batteries.

[0004] Therefore, there is an urgent need for a method to correct the temperature inside the battery pack to address the problems of deviations in performance evaluation and safety warnings, and low reliability of temperature data in existing technologies, thereby improving the safety of battery operation. Summary of the Invention

[0005] To address these issues, the present invention provides a method and apparatus for correcting the temperature inside a battery pack, thereby resolving problems such as deviations in performance evaluation and safety warnings, and low reliability of temperature data in existing technologies.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for correcting the temperature inside a battery pack, comprising:

[0007] Raw temperature data from several temperature acquisition channels of the lithium battery PACK are collected using temperature sensors.

[0008] A corresponding linear correction coefficient is set for each of the temperature acquisition channels, and the linear correction coefficient is used as the parameter to be identified;

[0009] Based on the number of parameters to be identified, a set number of particles are introduced to construct a parameter optimization population, transforming the optimization of correction coefficients into a population search problem.

[0010] Based on the original temperature data and the actual temperature data, a fitness function is constructed with the goal of minimizing the error between the corrected temperature data and the actual temperature data.

[0011] The particle number, particle dimension, maximum number of iterations, inertia weight, and learning factor of the parameter optimization population are initialized to obtain the initialization parameters of the parameter optimization population.

[0012] Based on the initialization parameters, the velocity and position of each particle are updated sequentially according to the velocity update formula and the position update formula; based on the updated velocity and position of each particle, the updated fitness value of each particle is calculated through the fitness function.

[0013] The individual's historical best position and individual best fitness value are updated by comparing the updated fitness value of each particle with the historical best fitness value of each particle; the group's historical best position and group best fitness value are updated by comparing the updated fitness values ​​of all particles with the group's historical best fitness value.

[0014] The optimal fitness value of the population is compared with a set error value. If it is less than the set error value, the optimal position matrix of the population is output as the optimal correction coefficient. If it is not less than the set error value, it is determined whether the number of iterations has reached the maximum number of iterations. If the maximum number of iterations has been reached, the current optimal position matrix of the population is output as the optimal correction coefficient. If the maximum number of iterations has not been reached, the velocity, position, and optimal value data of each particle are iteratively updated.

[0015] The original temperature data for each channel is matched and calculated with the corresponding optimal correction coefficient to obtain the corrected temperature data.

[0016] As a preferred method for correcting the temperature inside a battery pack, in the process of transforming the optimization of correction coefficients into a swarm search problem by constructing the parameter optimization swarm, the dimension of each particle is consistent with the number of parameters to be identified; each dimension value of the particle corresponds to a specific value of a correction coefficient; by constructing the parameter optimization swarm, the "individual search" of a single parameter combination is extended to a "swarm search" in which multiple particles simultaneously explore different parameter combinations; each particle moves closer to a better solution by adjusting its own position during iteration, while particles within the swarm cooperate to optimize by sharing optimal information, and finally find the globally or nearly globally optimal combination of correction coefficients through the overall search capability of the swarm.

[0017] As a preferred embodiment of a method for correcting the temperature inside a battery pack, the fitness function is expressed as follows:

[0018] ;

[0019] In the formula, The fitness value is denoted by n; n is the number of temperature acquisition channels. For particles; To collect temperature; This is the actual temperature.

[0020] As a preferred embodiment of a method for correcting the temperature inside a battery pack, the expression for the speed update formula is:

[0021] ;

[0022] In the formula, Let be the velocity of the j-th particle after k+1 iterations; w is the inertia weight. Let be the velocity of the j-th particle in the k-th iteration; , For learning factors; , A random number between [0, 1]; Let be the position of the j-th particle after k iterations; Let be the optimal position of the j-th particle in k iterations; This represents the optimal position of the particle swarm in k iterations.

[0023] As a preferred embodiment of a method for correcting the temperature inside a battery pack, the expression for the position update formula is:

[0024] ;

[0025] In the formula, Let be the position of the j-th particle after k+1 iterations.

[0026] The present invention also provides a battery pack internal temperature correction device, based on the above-mentioned battery pack internal temperature correction method, comprising:

[0027] The raw temperature data acquisition module is used to acquire raw temperature data from several temperature acquisition channels of the lithium battery PACK through temperature sensors.

[0028] The linear correction coefficient setting module is used to set a corresponding linear correction coefficient for each of the temperature acquisition channels and to use the linear correction coefficient as a parameter to be identified.

[0029] The parameter optimization population construction module is used to introduce a set number of particles based on the number of parameters to be identified, and construct a parameter optimization population, thereby transforming the optimization of the correction coefficient into a population search problem.

[0030] The fitness function construction module is used to construct a fitness function based on the original temperature data and the actual temperature data, with the goal of minimizing the error between the corrected temperature data and the actual temperature data.

[0031] The parameter initialization module of the parameter optimization group is used to initialize the number of particles, particle dimension, maximum number of iterations, inertia weight and learning factor of the parameter optimization group to obtain the initialization parameters of the parameter optimization group.

[0032] The fitness value update module is used to update the velocity and position of each particle sequentially according to the velocity update formula and the position update formula based on the initialization parameters; and to calculate the updated fitness value of each particle based on the updated velocity and position of each particle through the fitness function.

[0033] The optimal value data update module is used to update the individual's historical optimal position and individual optimal fitness value by comparing the updated fitness value of each particle with the historical optimal fitness value of each particle; and to update the group's historical optimal position and group optimal fitness value by comparing the updated fitness values ​​of all particles with the group's historical optimal fitness value.

[0034] The optimal fitness value and set error value comparison module is used to compare the optimal fitness value of the population with the set error value; if it is less than the set error value, the optimal position matrix of the population is output as the optimal correction coefficient; if it is not less than the set error value, it is determined whether the number of iterations has reached the maximum number of iterations; if the maximum number of iterations has been reached, the current optimal position matrix of the population is output as the optimal correction coefficient; if the maximum number of iterations has not been reached, the velocity, position and optimal value data of each particle are iteratively updated.

[0035] The corrected data acquisition module is used to match and calculate the original temperature data of each channel with the corresponding optimal correction coefficient to obtain the corrected temperature data.

[0036] As a preferred embodiment of a battery pack temperature correction device, in the parameter optimization group construction module, during the process of transforming the correction coefficient optimization into a group search problem by constructing the parameter optimization group, the dimension of each particle is consistent with the number of parameters to be identified; each dimension value of the particle corresponds to a specific value of a correction coefficient; by constructing the parameter optimization group, the "individual search" of a single parameter combination is extended to a "group search" in which multiple particles simultaneously explore different parameter combinations; each particle moves closer to a better solution by adjusting its own position during iteration, while particles within the group cooperate to optimize by sharing optimal information, and finally find the globally or nearly globally optimal correction coefficient combination through the overall search capability of the group.

[0037] In a preferred embodiment of a battery pack internal temperature correction device, the fitness function in the fitness function construction module is expressed as follows:

[0038] ;

[0039] In the formula, The fitness value is denoted by n; n is the number of temperature acquisition channels. For particles; To collect temperature; This is the actual temperature.

[0040] As a preferred embodiment of a battery pack internal temperature correction device, the expression for the speed update formula in the fitness value update module is:

[0041] ;

[0042] In the formula, Let be the velocity of the j-th particle after k+1 iterations; w is the inertia weight. Let be the velocity of the j-th particle in the k-th iteration; , For learning factors; , A random number between [0, 1]; Let be the position of the j-th particle after k iterations; Let be the optimal position of the j-th particle in k iterations; This represents the optimal position of the particle swarm in k iterations.

[0043] In a preferred embodiment of a battery pack internal temperature correction device, the expression for the position update formula in the fitness value update module is:

[0044] ;

[0045] In the formula, Let be the position of the j-th particle after k+1 iterations.

[0046] This invention has the following advantages: It acquires raw temperature data from several temperature acquisition channels of a lithium battery PACK using a temperature sensor; sets a corresponding linear correction coefficient for each temperature acquisition channel and uses this linear correction coefficient as a parameter to be identified; based on the number of parameters to be identified, a set number of particles are introduced to construct a parameter optimization population, transforming the correction coefficient optimization into a population search problem; based on the raw temperature data and the actual temperature data, a fitness function is constructed with the goal of minimizing the error between the corrected temperature data and the actual temperature data; the number of particles, particle dimension, maximum number of iterations, inertia weight, and learning factor of the parameter optimization population are initialized to obtain the initialization parameters of the parameter optimization population; based on the initialization parameters, the velocity and position of each particle are updated sequentially according to the velocity update formula and the position update formula; based on the updated velocity and position of each particle, the fitness function is used to calculate the value of each particle. The process involves: updating the fitness value of each particle; comparing the updated fitness value of each particle with its historical best fitness value to obtain the individual's historical best position and individual best fitness value; comparing the updated fitness values ​​of all particles with the group's historical best fitness value to obtain the group's historical best position and group best fitness value; comparing the group's best fitness value with a set error value; if it is less than the set error value, outputting the group's best position matrix as the optimal correction coefficient; if it is not less than the set error value, determining whether the iteration count has reached the maximum iteration count; if the maximum iteration count has been reached, outputting the current group's best position matrix as the optimal correction coefficient; if the maximum iteration count has not been reached, iteratively updating the velocity, position, and best value data of each particle; and matching and calculating the original temperature data for each path with the corresponding optimal correction coefficient to obtain the corrected temperature data. This invention configures corresponding linear correction coefficients for each of the multiple temperature acquisition channels of a lithium battery pack, accurately matching the characteristic differences of each NTC sensor and specifically compensating for acquisition errors caused by sensor nonlinearity, process differences, and environmental interference. Compared to existing technologies that lack channel-specific correction schemes, this invention offers more efficient error compensation. Furthermore, by constructing a fitness function with the goal of minimizing the error between the corrected temperature and the actual temperature, the correction effect is transformed into a quantifiable index, making the correction results closer to the actual battery pack temperature and avoiding temperature data deviations caused by the lack of clear optimization targets in existing technologies. Moreover, by setting reasonable dynamic parameters such as particle swarm size, iteration count, and inertia weight, the correction coefficients can be continuously optimized in scenarios where lithium battery charging and discharging temperatures change dynamically. Compared to static acquisition and processing methods, this invention is more adaptable to the dynamic temperature distribution characteristics of the battery pack, significantly improving the stability and accuracy of temperature data and providing a more reliable basis for battery performance evaluation and safety monitoring. Attached Figure Description

[0047] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.

[0048] The structures, proportions, sizes, etc. illustrated in this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed herein, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.

[0049] Figure 1 This is a schematic flowchart of a method for correcting the temperature inside a battery pack provided in Embodiment 1 of the present invention;

[0050] Figure 2 This is a schematic diagram of the architecture of a battery pack temperature correction device provided in Embodiment 2 of the present invention. Detailed Implementation

[0051] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0052] Example 1

[0053] See Figure 1 Embodiment 1 of the present invention provides a method for correcting the temperature inside a battery pack, comprising the following steps:

[0054] S1. Collect raw temperature data from several temperature acquisition channels of the lithium battery PACK using temperature sensors;

[0055] S2. Set a corresponding linear correction coefficient for each of the temperature acquisition channels, and use the linear correction coefficient as the parameter to be identified;

[0056] S3. Based on the number of parameters to be identified, a set number of particles are introduced to construct a parameter optimization population, transforming the optimization of the correction coefficient into a population search problem;

[0057] S4. Based on the original temperature data and the actual temperature data, construct a fitness function with the goal of minimizing the error between the corrected temperature data and the actual temperature data;

[0058] S5. Initialize the number of particles, particle dimension, maximum number of iterations, inertia weight and learning factor of the parameter optimization group to obtain the initialization parameters of the parameter optimization group.

[0059] S6. Based on the initialization parameters, update the velocity and position of each particle sequentially according to the velocity update formula and the position update formula; based on the updated velocity and position of each particle, calculate the updated fitness value of each particle through the fitness function.

[0060] S7. By comparing the updated fitness value of each particle with the historical best fitness value of each particle, the historical best position and the individual best fitness value are updated and obtained; by comparing the updated fitness values ​​of all particles with the historical best fitness value of the population, the historical best position and the population best fitness value are updated and obtained.

[0061] S8. Compare the optimal fitness value of the population with a set error value; if it is less than the set error value, output the optimal position matrix of the population as the optimal correction coefficient; if it is not less than the set error value, determine whether the number of iterations has reached the maximum number of iterations; if the maximum number of iterations has been reached, output the current optimal position matrix of the population as the optimal correction coefficient; if the maximum number of iterations has not been reached, iteratively update the velocity, position, and optimal value data of each particle.

[0062] S9. Match and calculate the original temperature data of each channel with the corresponding optimal correction coefficient to obtain the corrected temperature data.

[0063] In this embodiment, in step S1, the raw temperature data of several temperature acquisition channels of the lithium battery PACK are collected by a temperature sensor.

[0064] Specifically, the temperature sensor is preferably an NTC sensor. Based on the number, arrangement, and thermal distribution characteristics of the lithium battery pack cells, 3-6 temperature acquisition channels are arranged at different locations within the battery pack to ensure coverage of critical areas where temperature differences may occur, such as the central cells, edge cells, and areas near heat dissipation channels. During the acquisition process, the sensor obtains the temperature signal in real time through the signal acquisition circuit of the battery management system (BMS), and after analog-to-digital conversion, obtains the raw digital temperature data, denoted as:

[0065] ;

[0066] In the formula, n is the number of acquisition channels; The data is the raw temperature data; the acquisition frequency is dynamically adjusted according to the battery charging and discharging status, usually 1-10Hz, to balance data real-time performance and system power consumption.

[0067] In this embodiment, in step S2, a corresponding linear correction coefficient is set for each of the temperature acquisition channels, and the linear correction coefficient is used as the parameter to be identified.

[0068] Specifically, for the n temperature acquisition channels determined in step S1, each channel is configured with a separate linear correction coefficient, denoted as . ,in (i=1,2,...,n) corresponds to the correction coefficient of the i-th channel. This correction coefficient is used to compensate for the nonlinear error of the sensor itself, the installation position deviation, and the systematic deviation caused by environmental interference. Its physical meaning is a linear scaling factor that maps the original temperature data to the true temperature. Using these correction coefficients as parameters to be identified means that their optimal values ​​need to be solved through optimization algorithms to make the corrected temperature data as close as possible to the true value.

[0069] In this embodiment, in step S3, based on the number of parameters to be identified, a set number of particles are introduced to construct a parameter optimization population, transforming the optimization of the correction coefficient into a population search problem;

[0070] Specifically, based on the number n of parameters to be identified in step S2, the dimension of each particle is determined to be n, that is, each particle is an n-dimensional vector. Each element in the vector corresponds to a set of candidate values ​​for the parameters to be identified, i.e., a set of possible combinations of correction coefficients. A parameter optimization swarm containing this number of particles is constructed, with a swarm size of 30-100 particles. This construction process transforms the traditional optimization problem of "finding a single optimal set of correction coefficients" into a search process where multiple particles within the swarm simultaneously explore different combinations of correction coefficients. By leveraging information sharing and collaborative iteration among particles, the optimization efficiency and the ability to obtain the global optimum are improved.

[0071] In this embodiment, in step S4, a fitness function is constructed based on the original temperature data and the actual temperature data, with the goal of minimizing the error between the corrected temperature data and the actual temperature data.

[0072] Specifically, the actual temperature data is pre-collected under the same operating conditions using high-precision temperature measuring equipment and recorded as follows:

[0073] ;

[0074] The fitness function aims to minimize the sum of squared errors between the corrected temperature and the true temperature, and its expression is:

[0075] ;

[0076] In the formula, The fitness value is denoted by n; n is the number of temperature acquisition channels. For particles; To collect temperature; This represents the actual temperature. The smaller the value of this function, the better the correction effect of the current combination of correction coefficients, providing a clear optimization direction for subsequent particle swarm iterations.

[0077] In this embodiment, in step S5, the number of particles, particle dimension, maximum number of iterations, inertia weight and learning factor of the parameter optimization group are initialized to obtain the initialization parameters of the parameter optimization group.

[0078] Specifically, the number of particles is the population size set in step S3 (e.g., 50), and the particle dimension is consistent with the number of parameters to be identified, n; the maximum number of iterations is set to 50-100 times according to the optimization accuracy requirements, used to limit the maximum cycle of the population search; the inertia weight w is initialized to 0.5-0.9, used to balance the global exploration capability and local convergence capability of the particles; the learning factor... and Both are set to constants within the interval [0,2], which respectively adjust the weights for particles to learn towards their individual optimal positions and the group optimal positions. At the same time, the initial position of each particle, i.e., the initial candidate value of the correction coefficient, is randomly initialized, typically within the range [0.8,1.2], along with the initial velocity, which is a small random value to avoid excessive initial fluctuations and to provide an initial state for subsequent iterative calculations.

[0079] In this embodiment, in step S6, based on the initialization parameters, the velocity and position of each particle are updated sequentially according to the velocity update formula and the position update formula; based on the updated velocity and position of each particle, the updated fitness value of each particle is calculated through the fitness function.

[0080] Specifically, the expression for the speed update formula is:

[0081] ;

[0082] In the formula, Let be the velocity of the j-th particle after k+1 iterations; w is the inertia weight. Let be the velocity of the j-th particle in the k-th iteration; , For learning factors; , A random number between [0, 1]; Let be the position of the j-th particle after k iterations; Let be the optimal position of the j-th particle in k iterations; This represents the optimal position of the particle swarm in k iterations.

[0083] The expression for the position update formula is:

[0084] ;

[0085] In the formula, Let be the position of the j-th particle after k+1 iterations. After updating the velocity and position of all particles, substitute the new position of each particle, i.e., the new combination of correction coefficients, into the fitness function constructed in step S4 to calculate the corresponding updated fitness value, thus quantifying the optimization effect of the current particle.

[0086] In this embodiment, in step S7, the individual's historical best position and individual best fitness value are updated by comparing the updated fitness value of each particle with the historical best fitness value of each particle; the group's historical best position and group best fitness value are updated by comparing the updated fitness values ​​of all particles with the group's historical best fitness value.

[0087] Specifically, for each particle, if its updated fitness value is less than its historical best fitness value, then the particle's individual historical best position is updated to its current position, and its individual best fitness value is updated accordingly. The updated fitness values ​​of all particles are then iterated over; if any particle's fitness value is less than the swarm's historical best fitness value, then the swarm's historical best position is updated to that particle's current position, and the swarm's best fitness value is updated accordingly. This dynamic updating of individual and swarm best values ​​ensures that the particle swarm always evolves towards a better combination of correction coefficients.

[0088] In this embodiment, in step S8, the optimal fitness value of the population is compared with a set error value; if it is less than the set error value, the optimal position matrix of the population is output as the optimal correction coefficient; if it is not less than the set error value, it is determined whether the number of iterations has reached the maximum number of iterations; if the maximum number of iterations has been reached, the current optimal position matrix of the population is output as the optimal correction coefficient; if the maximum number of iterations has not been reached, the velocity, position, and optimal value data of each particle are iteratively updated.

[0089] Specifically, the error value is set according to the temperature monitoring accuracy requirements. If the optimal fitness value of the population is less than the threshold, it means that the current optimal correction coefficient has met the accuracy requirements, and the optimal position matrix of the population is directly output as the final optimal correction coefficient. If it is not met, it is checked whether the current iteration number k has reached the maximum iteration number set in step S5. If it has, the iteration is terminated and the current optimal position matrix of the population is output. If it has not, it is returned to step S6, and the next round of iteration is updated based on the current particle velocity, position and optimal value data until the termination condition is met.

[0090] In this embodiment, in step S9, the original temperature data of each channel is matched and calculated with the corresponding optimal correction coefficient to obtain the corrected temperature data.

[0091] Specifically, the optimal correction coefficient output in step S8 is used. The original temperature data collected in step S1 is corrected and calculated according to the following formula to obtain the corrected temperature data.

[0092] (i=1,2,...,n);

[0093] In the formula, This is the corrected temperature. The corrected temperature data more accurately reflects the true temperature at various locations within the lithium battery pack. It can be directly used for core functions of the battery management system, such as adjusting charging and discharging strategies, triggering over-temperature protection, and assessing battery health status, thereby improving the safety and reliability of battery operation.

[0094] The application scenarios of this invention are as follows:

[0095] In the field of new energy vehicles (pure electric and hybrid vehicles), the power battery pack, as the core energy source, directly affects driving range, charging and discharging efficiency, and safety performance due to its temperature stability. This invention can be integrated into the vehicle's battery management system (BMS). Addressing the temperature distribution differences within the multi-cell array of the battery pack—such as higher temperatures in the center cells during fast charging or lower temperatures near the heat dissipation channels in low-temperature winter environments—it collects raw temperature data using 5-6 NTC sensors. After particle swarm optimization, a correction coefficient accurately compensates for sensor nonlinearity errors and environmental interference, outputting near-realistic temperature field data. Based on this corrected temperature data, the BMS can dynamically adjust the charging and discharging current, avoiding overcharging and over-discharging risks caused by temperature misjudgments. Simultaneously, it optimizes the thermal management system, extends battery life, and ensures overall vehicle safety.

[0096] In commercial, residential, and grid-connected energy storage systems, lithium-ion battery packs often require prolonged high-rate charging and discharging, and the operating environment can easily lead to uneven temperature distribution within the battery pack. This invention adapts to the multi-channel temperature acquisition requirements of energy storage systems. For the typically configured 3-4 temperature monitoring channels in energy storage battery packs, it constructs a particle swarm optimization group to optimize correction coefficients in real time, resolving the acquisition bias caused by sensor aging over long-term operation. The corrected temperature data can be used for charge / discharge scheduling and fault early warning in energy storage systems, while also providing reliable data support for the state of health (SOH) assessment of the energy storage system, avoiding accelerated energy storage capacity degradation or safety accidents caused by distorted temperature data.

[0097] For portable electronic devices such as laptops, drones, and power tools that rely on lithium batteries for power, the small built-in lithium battery packs are limited by size, resulting in densely packed cells that are prone to localized temperature accumulation during charging and discharging. Furthermore, ambient temperature fluctuations during device movement exacerbate sensor acquisition errors. This invention addresses this issue by simplifying particle swarm optimization parameter settings to suit the low-power requirements of portable devices. For the 2-3 temperature acquisition channels configured in the device's battery pack, it quickly outputs the optimal correction coefficient, accurately compensating for sensor errors caused by space constraints. The corrected temperature data can be used for device power consumption control, preventing battery life reduction, bulging, leakage, and other safety issues caused by temperature misjudgments, thus improving the stability of portable devices and extending battery life.

[0098] It should be noted that the method of this disclosure embodiment can be executed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method of this disclosure embodiment, and the multiple devices will interact with each other to complete the method described.

[0099] It should be noted that the above description describes some embodiments of this disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0100] Example 2

[0101] See Figure 2 Embodiment 2 of the present invention also provides a device for correcting the temperature inside a battery pack, comprising:

[0102] The raw temperature data acquisition module 001 is used to acquire raw temperature data from several temperature acquisition channels of the lithium battery PACK through temperature sensors.

[0103] The linear correction coefficient setting module 002 is used to set a corresponding linear correction coefficient for each of the temperature acquisition channels and use the linear correction coefficient as a parameter to be identified.

[0104] The parameter optimization population construction module 003 is used to introduce a set number of particles based on the number of parameters to be identified, and construct a parameter optimization population, thereby transforming the optimization of the correction coefficient into a population search problem.

[0105] The fitness function construction module 004 is used to construct a fitness function based on the original temperature data and the real temperature data, with the goal of minimizing the error between the corrected temperature data and the real temperature data.

[0106] The parameter initialization module 005 of the parameter optimization group is used to initialize the number of particles, particle dimension, maximum number of iterations, inertia weight and learning factor of the parameter optimization group to obtain the initialization parameters of the parameter optimization group.

[0107] The fitness value update module 006 is used to update the velocity and position of each particle sequentially according to the velocity update formula and the position update formula based on the initialization parameters; and to calculate the updated fitness value of each particle based on the updated velocity and position of each particle through the fitness function.

[0108] The optimal value data update module 007 is used to update the individual's historical optimal position and individual optimal fitness value by comparing the updated fitness value of each particle with the historical optimal fitness value of each particle; and to update the group's historical optimal position and group optimal fitness value by comparing the updated fitness values ​​of all particles with the group's historical optimal fitness value.

[0109] The optimal fitness value and set error value comparison module 008 is used to compare the optimal fitness value of the population with the set error value; if it is less than the set error value, the optimal position matrix of the population is output as the optimal correction coefficient; if it is not less than the set error value, it is determined whether the number of iterations has reached the maximum number of iterations; if the maximum number of iterations has been reached, the current optimal position matrix of the population is output as the optimal correction coefficient; if the maximum number of iterations has not been reached, the velocity, position and optimal value data of each particle are iteratively updated.

[0110] The corrected data acquisition module 009 is used to match and calculate the original temperature data of each channel with the corresponding optimal correction coefficient to obtain the corrected temperature data.

[0111] In this embodiment, in the parameter optimization group construction module 003, during the process of transforming the optimization of correction coefficients into a group search problem by constructing the parameter optimization group, the dimension of each particle is consistent with the number of parameters to be identified; each dimension value of the particle corresponds to a specific value of a correction coefficient; by constructing the parameter optimization group, the "individual search" of a single parameter combination is extended to a "group search" in which multiple particles simultaneously explore different parameter combinations; each particle moves closer to a better solution by adjusting its own position during iteration, while particles within the group optimize collaboratively by sharing optimal information, and finally find the globally or nearly globally optimal combination of correction coefficients through the overall search capability of the group.

[0112] In this embodiment, in the fitness function construction module 004, the expression of the fitness function is:

[0113] ;

[0114] In the formula, The fitness value is denoted by n; n is the number of temperature acquisition channels. For particles; To collect temperature; This is the actual temperature.

[0115] In this embodiment, the expression for the velocity update formula in the fitness value update module 006 is:

[0116] ;

[0117] In the formula, Let be the velocity of the j-th particle after k+1 iterations; w is the inertia weight. Let be the velocity of the j-th particle in the k-th iteration; , For learning factors; , A random number between [0, 1]; Let be the position of the j-th particle after k iterations; Let be the optimal position of the j-th particle in k iterations; This represents the optimal position of the particle swarm in k iterations.

[0118] In this embodiment, the expression for the position update formula in the fitness value update module 006 is:

[0119] ;

[0120] In the formula, Let be the position of the j-th particle after k+1 iterations.

[0121] It should be noted that the information interaction and execution process between the modules of the above system are based on the same concept as the method embodiment in Embodiment 1 of this application, and the resulting technical effects are the same as those in the method embodiment of this application. For details, please refer to the description in the method embodiment shown above in this application, and it will not be repeated here.

[0122] Example 3

[0123] Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium storing program code for a method of correcting the temperature inside a battery pack. The program code includes instructions for executing the method of correcting the temperature inside a battery pack according to Embodiment 1 or any possible implementation thereof.

[0124] Computer-readable storage media can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

[0125] Example 4

[0126] Embodiment 4 of the present invention provides an electronic device, including: a memory and a processor;

[0127] The processor and the memory communicate with each other via a bus; the memory stores program instructions that can be executed by the processor, and the processor can execute a method for correcting the temperature inside a battery pack according to Embodiment 1 or any possible implementation thereof by calling the program instructions.

[0128] Specifically, a processor can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. This memory can be integrated into the processor or located outside the processor and exist independently.

[0129] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable system. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0130] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing systems. They can be centralized on a single computing system or distributed across a network of multiple computing systems. Optionally, they can be implemented using program code executable by a computing system, thereby storing them in a storage system for execution by the computing system. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0131] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.

Claims

1. A method for correcting the temperature inside a battery pack, characterized in that, include: Raw temperature data from several temperature acquisition channels of the lithium battery PACK are collected using temperature sensors. A corresponding linear correction coefficient is set for each of the temperature acquisition channels, and the linear correction coefficient is used as the parameter to be identified; Based on the number of parameters to be identified, a set number of particles are introduced to construct a parameter optimization population, transforming the optimization of correction coefficients into a population search problem. Based on the original temperature data and the actual temperature data, a fitness function is constructed with the goal of minimizing the error between the corrected temperature data and the actual temperature data. The particle number, particle dimension, maximum number of iterations, inertia weight, and learning factor of the parameter optimization population are initialized to obtain the initialization parameters of the parameter optimization population. Based on the initialization parameters, the velocity and position of each particle are updated sequentially according to the velocity update formula and the position update formula; based on the updated velocity and position of each particle, the updated fitness value of each particle is calculated through the fitness function. The individual's historical best position and individual best fitness value are updated by comparing the updated fitness value of each particle with the historical best fitness value of each particle; the group's historical best position and group best fitness value are updated by comparing the updated fitness values ​​of all particles with the group's historical best fitness value. The optimal fitness value of the population is compared with a set error value; if it is less than the set error value, the optimal position matrix of the population is output as the optimal correction coefficient; if it is not less than the set error value, it is determined whether the number of iterations has reached the maximum number of iterations. If the maximum number of iterations is reached, the current optimal position matrix of the group is output as the optimal correction coefficient; if the maximum number of iterations is not reached, the velocity, position, and optimal value data of each particle are iteratively updated. The original temperature data for each channel is matched and calculated with the corresponding optimal correction coefficient to obtain the corrected temperature data.

2. The method for correcting the temperature inside a battery pack according to claim 1, characterized in that, In the process of transforming the optimization of correction coefficients into a swarm search problem by constructing the parameter optimization swarm, the dimension of each particle is consistent with the number of parameters to be identified; each dimension value of the particle corresponds to a specific value of a correction coefficient; by constructing the parameter optimization swarm, the "individual search" of a single parameter combination is extended to a "swarm search" in which multiple particles simultaneously explore different parameter combinations; each particle moves closer to a better solution by adjusting its own position during iteration, while particles within the swarm optimize collaboratively by sharing optimal information, and finally find the globally or near-globally optimal combination of correction coefficients through the overall search capability of the swarm.

3. The method for correcting the temperature inside a battery pack according to claim 2, characterized in that, The expression for the fitness function is: ; In the formula, The fitness value is denoted by n; n is the number of temperature acquisition channels. For particles; To collect temperature; This is the actual temperature.

4. The method for correcting the temperature inside a battery pack according to claim 3, characterized in that, The expression for the speed update formula is: ; In the formula, Let be the velocity of the j-th particle after k+1 iterations; w is the inertia weight. Let be the velocity of the j-th particle in the k-th iteration; , For learning factors; , A random number between [0, 1]; Let be the position of the j-th particle after k iterations; Let be the optimal position of the j-th particle in k iterations; This represents the optimal position of the particle swarm in k iterations.

5. The method for correcting the temperature inside a battery pack according to claim 4, characterized in that, The expression for the position update formula is: ; In the formula, Let be the position of the j-th particle after k+1 iterations.

6. A battery pack internal temperature correction device, employing the battery pack internal temperature correction method according to any one of claims 1-5, characterized in that, include: The raw temperature data acquisition module is used to acquire raw temperature data from several temperature acquisition channels of the lithium battery PACK through temperature sensors. The linear correction coefficient setting module is used to set a corresponding linear correction coefficient for each of the temperature acquisition channels and to use the linear correction coefficient as a parameter to be identified. The parameter optimization population construction module is used to introduce a set number of particles based on the number of parameters to be identified, and construct a parameter optimization population, thereby transforming the optimization of the correction coefficient into a population search problem. The fitness function construction module is used to construct a fitness function based on the original temperature data and the actual temperature data, with the goal of minimizing the error between the corrected temperature data and the actual temperature data. The parameter initialization module of the parameter optimization group is used to initialize the number of particles, particle dimension, maximum number of iterations, inertia weight and learning factor of the parameter optimization group to obtain the initialization parameters of the parameter optimization group. The fitness value update module is used to update the velocity and position of each particle sequentially according to the velocity update formula and the position update formula based on the initialization parameters; and to calculate the updated fitness value of each particle based on the updated velocity and position of each particle through the fitness function. The optimal value data update module is used to update the individual's historical optimal position and individual optimal fitness value by comparing the updated fitness value of each particle with the historical optimal fitness value of each particle; and to update the group's historical optimal position and group optimal fitness value by comparing the updated fitness values ​​of all particles with the group's historical optimal fitness value. The optimal fitness value and set error value comparison module is used to compare the optimal fitness value of the population with the set error value; if it is less than the set error value, the optimal position matrix of the population is output as the optimal correction coefficient; if it is not less than the set error value, it is determined whether the number of iterations has reached the maximum number of iterations. If the maximum number of iterations is reached, the current optimal position matrix of the group is output as the optimal correction coefficient; if the maximum number of iterations is not reached, the velocity, position, and optimal value data of each particle are iteratively updated. The corrected data acquisition module is used to match and calculate the original temperature data of each channel with the corresponding optimal correction coefficient to obtain the corrected temperature data.

7. The battery pack temperature correction device according to claim 6, characterized in that, In the parameter optimization population construction module, during the process of transforming the optimization of correction coefficients into a population search problem by constructing the parameter optimization population, the dimension of each particle is consistent with the number of parameters to be identified; each dimension value of the particle corresponds to a specific value of a correction coefficient; by constructing the parameter optimization population, the "individual search" of a single parameter combination is extended to a "population search" in which multiple particles simultaneously explore different parameter combinations; each particle moves closer to a better solution by adjusting its own position during iteration, while particles within the population cooperate to optimize by sharing optimal information, and finally find the globally or nearly globally optimal combination of correction coefficients through the overall search capability of the population.

8. The battery pack temperature correction device according to claim 7, characterized in that, In the fitness function construction module, the expression of the fitness function is: ; In the formula, The fitness value is denoted by n; n is the number of temperature acquisition channels. For particles; To collect temperature; This is the actual temperature.

9. The battery pack temperature correction device according to claim 8, characterized in that, In the fitness value update module, the expression for the velocity update formula is: ; In the formula, Let be the velocity of the j-th particle after k+1 iterations; w is the inertia weight. Let be the velocity of the j-th particle in the k-th iteration; , For learning factors; , A random number between [0, 1]; Let be the position of the j-th particle after k iterations; Let be the optimal position of the j-th particle in k iterations; This represents the optimal position of the particle swarm in k iterations.

10. A battery pack temperature correction device according to claim 9, characterized in that, In the fitness value update module, the expression for the position update formula is: ; In the formula, Let be the position of the j-th particle after k+1 iterations.