Lithium ion battery state of charge (SOC) estimation method, device and system and vehicle
By employing a sliding window and loess smoothing algorithm to segment the data in the state of charge (SOC) estimation of lithium-ion batteries and constructing a simplified PSLSTM model, the problems of data leakage and high computational complexity are solved, achieving high-precision and stable estimation under low-temperature conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-05
- Publication Date
- 2026-03-13
AI Technical Summary
Existing machine learning-based methods for estimating the state of charge (SOC) of lithium-ion batteries suffer from data leakage risks during the data preprocessing stage, have complex model structures and high computational costs, and lack robustness and accuracy, especially in low-temperature environments.
The data is segmented into short sequences using a sliding window, and local weighted regression smoothing is performed using the loess smoothing algorithm. A simplified PSLSTM model is constructed, and the model structure is simplified and the computational complexity is reduced by removing the forget gate and introducing a partial least squares regression pruning algorithm.
It effectively reduces the risk of data leakage and improves the estimation accuracy and robustness of the model, especially demonstrating excellent estimation accuracy and computational efficiency in low-temperature environments.
Smart Images

Figure CN121656876A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lithium-ion battery state estimation technology, specifically providing a method, apparatus, system, and vehicle for estimating the state of charge (SOC) of lithium-ion batteries in low-temperature environments. Background Technology
[0002] Currently, machine learning-based methods for estimating battery SOC are common and popular. Machine learning algorithms can learn from large amounts of battery-related data to establish a non-linear relationship between voltage, current, temperature data, and battery SOC without equivalent battery conditions. Many machine learning models exist, such as Support Vector Machines (SVM), Convolutional Neural Networks (CNN), and Long Short-Term Memory Neural Networks (LSTM). The most widespread approach is to use LSTM in combination with other neural networks or to improve and optimize LSTM networks to enhance model accuracy and stability. Although fusing or using LSTM models for battery SOC estimation is one of the most common methods, two significant limitations remain: First, in the data preprocessing stage, most methods use long, continuous data sequences, which may lead to future data leakage, affecting current predictions. Second, the models suffer from complex structures, high computational costs, and large memory requirements, placing high demands on system performance. Summary of the Invention
[0003] To address the aforementioned problems in existing technologies, this invention aims to provide a scheme for estimating the state of charge (SOC) of lithium-ion batteries in low-temperature environments. This scheme enhances the input data through local smoothing and constructs a lightweight LSTM model with simplified pruning, significantly reducing model complexity while maintaining high estimation accuracy, and particularly improving the estimation robustness and accuracy in low-temperature environments.
[0004] In a first aspect, the present invention provides a method for estimating the state of charge (SOC) of a lithium-ion battery, comprising the following steps: acquiring the original time-series data of the battery's voltage and current, dividing it into short sequences using a sliding window, applying a local weighted regression smoothing algorithm to each short sequence, and then concatenating and fusing the smoothed sequence with the original short sequence to form an enhanced input sequence; inputting the enhanced input sequence into a PSLSTM model for processing to obtain an estimated SOC value; wherein the PSLSTM model is a simplified structure that removes the forget gate of the standard long short-term memory network, and introduces a pruning algorithm based on partial least squares regression during training to dynamically merge redundant memory blocks.
[0005] In one technical solution of the above-mentioned lithium-ion battery state of charge (SOC) estimation method, the local weighted regression smoothing using the loess smoothing algorithm is specifically as follows: for each data point in the short sequence, a weight is assigned according to its distance from the point to be smoothed, with the weight being greater for closer distances; a local polynomial is fitted to the point using the weighted least squares method, and the constant term of the polynomial is used as the smoothing result.
[0006] In one technical solution of the above-mentioned lithium-ion battery state of charge (SOC) estimation method, the weighting function used in the weighting step is a cubic function, whose weight value decays with the cube of the distance within a preset bandwidth and is zero outside the bandwidth.
[0007] In one technical solution of the above-mentioned lithium-ion battery state of charge (SOC) estimation method, the simplified structure that removes the forget gate of the standard long short-term memory network is achieved in the following way: the forget gate is removed, and the complement of the current input gate activation value is multiplied element-wise with the cell state of the previous time step to control the degree of retention of historical information.
[0008] In one technical solution of the above-mentioned lithium-ion battery state of charge (SOC) estimation method, the pruning algorithm based on partial least squares regression specifically includes: establishing a mapping relationship between the internal state time series of each memory block and the final output time series of the model using the partial least squares regression method, and calculating the regression coefficient corresponding to each memory block as an importance index of the memory block; calculating the average value of the regression coefficients of all memory blocks, and multiplying the average value by the current total number of memory blocks and a preset pruning strength coefficient to obtain an adaptive pruning threshold; when a memory block has a regression coefficient lower than the adaptive pruning threshold, it is determined to be an unimportant block, the correlation coefficient of the internal state series of the unimportant block with all other blocks is calculated, and it is merged with the memory block with the highest correlation coefficient.
[0009] In one technical solution of the above-mentioned lithium-ion battery state of charge (SOC) estimation method, the method uses a multi-temperature dataset covering both low-temperature and normal-temperature ranges to uniformly train the PSLSTM model. The low-temperature range includes temperature points below zero degrees Celsius.
[0010] In one technical solution of the above-mentioned lithium-ion battery state of charge (SOC) estimation method, the multi-temperature dataset includes at least battery charge and discharge data at -10℃, 0℃, 10℃, and 25℃.
[0011] In a second aspect, the present invention provides a lithium-ion battery state of charge (SOC) estimation device comprising: a memory storing instructions; and a processor configured to, when executing the instructions, implement the method described in the first aspect.
[0012] Thirdly, the present invention provides a battery management system that integrates the lithium-ion battery state of charge (SOC) estimation device as described above.
[0013] Fourthly, the present invention provides an electric vehicle including the aforementioned battery management system.
[0014] The beneficial effects of this invention are as follows: 1. By segmenting long sequences into short sequences using a sliding window, the risk of data leakage due to the use of future information is reduced. Furthermore, the loess smoothing algorithm is employed to locally smooth each short sequence, adaptively filtering out measurement noise and extracting the main trends behind the data. Innovatively, the smoothed data is fused with the original data through feature concatenation, ensuring that the enhanced input sequence simultaneously contains the smoothed trend after denoising and the original detailed fluctuation information. This provides higher-quality, more informative, and more robust input for subsequent neural network models, fundamentally improving the data foundation for model learning.
[0015] 2. This invention makes two key improvements to the standard LSTM model. First, by removing the forget gate and using the complement of the input gate activation values to control the retention of historical cell states, the gating mechanism is simplified, directly reducing model parameters and computational cost. Second, partial least squares regression, a multivariate statistical analysis method, is creatively introduced into the LSTM training process as a dynamic pruning algorithm. This algorithm can scientifically evaluate the contribution (importance) of each memory block to the final output and automatically merge redundant blocks with low contribution with the most relevant blocks, thereby continuously and dynamically reducing the size of the model's hidden layers during training. These two improvements work synergistically, resulting in a PSLSTM model that maintains strong temporal modeling capabilities while having a more compact structure and significantly reduced computational complexity and memory footprint, making it ideal for achieving efficient, real-time SOC estimation in resource-constrained embedded BMS hardware. Attached Figure Description
[0016] The disclosure of this invention will become more readily understood with reference to the accompanying drawings. It will be readily understood by those skilled in the art that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Furthermore, similar numbers in the drawings are used to denote similar components, wherein: Figure 1 This invention presents a method for predicting the state of charge (SOC) of low-temperature lithium-ion batteries based on a loess smoothing algorithm and a PSLSTM model.
[0017] Figure 2 This is a schematic diagram of the loess smoothing algorithm used in an embodiment of the present invention.
[0018] Figure 3 This is the PSLSTM model used in the embodiments of the present invention.
[0019] Figure 4 The image shows the predicted SOC and actual SOC of the trained PSLSTM model at a temperature of 25 degrees Celsius, as provided in this embodiment of the invention.
[0020] Figure 5 The image shows the predicted SOC and actual SOC of the trained PSLSTM model at a temperature of 10 degrees Celsius, as provided in this embodiment of the invention.
[0021] Figure 6 The image shows the predicted SOC and actual SOC of the trained PSLSTM model at 0 degrees Celsius, as provided in this embodiment of the invention.
[0022] Figure 7 The image shows the predicted SOC and actual SOC of the trained PSLSTM model at a temperature of -10 degrees Celsius, as provided in this embodiment of the invention. Detailed Implementation
[0023] Some embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0024] Example 1 like Figure 1-7 As shown, this invention discloses a method for estimating the state of charge (SOC) of a lithium-ion battery, comprising the following steps: Step S101: Data acquisition and sliding window division.
[0025] First, the lithium-ion battery under test was stabilized in a controlled, constant-temperature experimental environment at four temperature points: -10℃, 0℃, 10℃, and 25℃. At each temperature point, standard or custom charge-discharge conditions, including dynamic stress testing and federal city driving schedules, were applied to the battery to simulate real-world application scenarios. Using high-precision data acquisition equipment, the battery's terminal voltage (U), load current (I), and ambient temperature (T) were simultaneously recorded at a sampling frequency of 1Hz, forming raw voltage and current time-series data. Sufficient data collection time was required at each temperature to cover the complete range of SOC from 100% to 0%.
[0026] After data acquisition, the long-sequence data of voltage and current at each temperature were preprocessed. A sliding window technique was used to segment the long sequences into short sequences suitable for model input. Specifically, the fixed length (FL) of the sliding window was set to 100 data points (i.e., a 100-second historical window), and the sliding step size (S) was 1. This means that, starting from the beginning of the sequence, each sliding step extracts a short sequence sample containing the current point and the previous 99 historical points (a total of 100 points). In this way, a large number of continuous, overlapping short sequences were generated. For windows at the end of the sequence that were insufficient to form 100 points, a fixed value (e.g., 1) was inserted to ensure that all input samples had the same length.
[0027] A schematic diagram of the loess smoothing algorithm is shown below. Figure 2 As shown, step S102: Loess smoothing data enhancement.
[0028] Specifically, data augmentation is performed independently on each short sequence sample obtained in step S101. First, the voltage and current data within the short sequence are normalized, linearly transformed to the [0,1] interval to eliminate the influence of dimensions and accelerate neural network training. The normalization formula is: ; After normalization, the main trend of the data is extracted to eliminate noise. The loess smoothing algorithm is used to smooth the short-sequence data. First, the proportion α of data points in each small interval is selected for fitting, and then the weights are calculated.
[0029] ; in, Represents the weighting function. Represents data points, with bandwidth denoted as . If the distance to the observation point exceeds the bandwidth The assigned weight is then 0. Then, the weighted least squares method is used to obtain the quadratic model.
[0030] ; in, The parameters represent the local quadratic model. The weighted sum of squared errors of the quadratic polynomial model is minimized, as shown in the following formula.
[0031] ; The parameters are obtained by solving the normal equation using the weighted least squares method. .
[0032] ; Then we can obtain the smoothed value at a certain point, which is the value of the parameter. After obtaining smoothed selected sequence data from the loess curve, it is merged with the original data to form the final input for model training. This operation is a way to enhance historical data, automatically adjusting the degree of smoothing based on local features of the data, while maintaining a reasonable fit at sequence boundaries. It simultaneously captures short-term fluctuations and long-term trends, which accelerates convergence and improves generalization ability during model training.
[0033] Step S103: PSLSTM model construction, pruning, and training. The PSLSTM model is as follows: Figure 3 As shown.
[0034] The LSTM network used has only one hidden layer and no peephole connections. The hidden layer consists of a set of memory blocks, with 40 blocks used. Each block contains one memory cell and three control gates: an input gate, a forget gate, and an output gate. The input gate controls the information input to the cell, the forget gate controls the amount of information forgotten, and the output gate controls the number of outputs from the model.
[0035] For time series forecasting, given an input time series data, LSTM computes the block output h at time t. t for ; The matrix indices i, f, z, and o correspond to the input gate, forget gate, block input gate, and output gate, respectively. The final output of the LSTM is calculated as follows:
[0036] By removing the forget gate and using the input and output gates as two control gates, the structure of LSTM is simplified, reducing the computational cost of the model while maintaining a certain level of computational complexity. The corresponding formula is as follows: ; Aside from the storage units, its computation is the same as that of the LSTM model. The memory of previous information in the time series is determined by a factor (1- i t It is controlled by the memory cell's forget gate, rather than by the forget gate.
[0037] Furthermore, the computation of the LSTM model can be further simplified by reducing the gate parameters, using only the previously hidden layer outputs and biases for input and output gates, thus minimizing gate redundancy.
[0038] ;
[0039] Simultaneously, a pruning algorithm based on partial least squares regression (PLS) is incorporated into the simplified LSTM model to form a new PSLSTM model. Unimportant memory blocks are merged with their most relevant memory blocks, thereby further reducing the hidden layer size of the model.
[0040] The PLS regression method was used, where the importance of each LSTM block was represented by the corresponding regression coefficient of its internal memory unit. Independent variables... C t With dependent variable Y t The relationship between them is as follows: ; When among them When the conditions are met, block M will be considered an unimportant storage block by the model, thus becoming a target for pruning and removal. It is the average of the PLS regression coefficients of all storage blocks. β The threshold is a custom threshold set within the range (0, 0.1], with a set value of 0.06. After calculation, the model merges unimportant blocks with their most relevant blocks, and calculates and measures the relevance of the merged blocks according to the following formula. ; In the formula and They are t time m and n The cell states in the block, meiosis is their state in t The average at points in time, with the denominator being their average at those points in time. t The time difference is then identified. The storage block region with the highest correlation coefficient is then selected as the most correlated block.
[0041] Next, a less important block is merged with its most relevant block to generate a new block. Then, all inputs, loop weights, and biases of the newly generated block are randomly assigned within the range [-1, 1]. In the early stages of training, the number of stored blocks is relatively large. The block size is relatively large, so the pruning algorithm performs fast pruning, actively merging storage blocks to quickly reduce the number of blocks, with a significant effect, quickly removing redundant blocks. In the middle of training, the number of blocks stabilizes, and the threshold is relatively moderate; pruning then involves moderate merging and fine-tuning, mainly balancing accuracy and complexity. In the later stages of training, the main task is conservative merging, retaining important blocks and minimizing the model while maintaining performance, thereby improving computational efficiency.
[0042] The model was trained using voltage and current sequence data from the training set at different temperatures. The Backpropagation Tolerance (BPTT) algorithm was used to update the parameters of the PSLSTM model's learning algorithm. The PSLSTM model processes battery sequence data, and its output depends not only on the current input but also on the entire historical data. BPTT, a method that backpropagates the final error to every parameter throughout the historical data, was employed.
[0043] The BPTT algorithm uses the chain rule to help construct a path that flows backward from the final error through the time steps, as shown in the following formula: ; This reflects the error originating from a future moment. t+1 Reverse flow back to the current moment t The process involves determining the hidden state. Then, the gradients for specific parameters (weights W, U, and bias b) are obtained by calculating the cell state and the errors of each gate. Finally, the parameters are updated, and the final gradient is calculated. Then, all parameters are updated according to the gradient descent rule. This achieves a complete, automatically adjusting PSLSTM model.
[0044] The trained PSLSTM model is used to estimate the battery's State of Charge (SOC). Voltage and current data from a test set are used to test the model, and the model's predictions are compared with the standard SOC to verify the model's effectiveness and robustness. Figure 4 As shown, the trained PSLSTM model's SOC prediction performance at 25℃ (room temperature) is illustrated. The horizontal axis represents time or test sample points, and the vertical axis represents the SOC value (0%-100%). The predicted curve (red line) almost completely overlaps with the actual SOC curve (black line), visually demonstrating the model's extremely high estimation accuracy under room temperature conditions. The prediction error (actual value - predicted value) is very small and uniformly distributed throughout the entire range. Figure 5 The figure shows a comparison of SOC prediction results at 10°C. At this temperature, battery characteristics begin to differ from those at room temperature. As can be seen from the figure, the prediction curve of this invention still closely tracks the actual SOC changes without significant deviation or lag, indicating that the method has good adaptability to temperature changes. Figure 6 As shown, the comparison of SOC prediction results at 0°C is illustrated. 0°C is a typical low-temperature threshold. The figure shows that although the battery's internal resistance increases and capacity decreases at 0°C, the predicted output of the PSLSTM model remains highly consistent with the actual values, and the estimation error is effectively controlled at a very low level, demonstrating the effectiveness of this invention for low-temperature optimization. Figure 7 The image shows a comparison of SOC prediction results at -10℃. -10℃ is a harsh low-temperature environment. From... Figure 7It can be clearly seen that even under these extreme conditions, the SOC estimation curve (red) provided by the method of this invention can still accurately match the trend of the actual SOC curve (black). Throughout the entire discharge or testing process, there were no sudden jumps or serious deviations in the estimated values, fully verifying that the SOC prediction method proposed in this invention, which integrates loess smoothing data enhancement and a lightweight PSLSTM model, possesses excellent low-temperature robustness and estimation reliability.
[0045] The baseline SOC of the battery is obtained by the ampere-hour integration method. The formula for the ampere-hour integration method is as follows. ; in for t 0 The remaining capacity of the lithium battery at all times. I Let t be the battery's operating current, and Q be the battery's rated capacity. For Coulomb efficiency.
[0046] Example 2 This embodiment provides a lithium-ion battery state of charge (SOC) estimation device for implementing the method described in Embodiment 1. The device includes: The memory is a non-transitory computer-readable storage medium, such as flash memory, EEPROM, SD card, or embedded hard disk. The memory stores computer-executable instructions encoded to implement the data processing and SOC computation logic described in steps S102, S103 (forward propagation portion), and S104 of Embodiment 1. Furthermore, the memory also stores the final parameters (weights and biases) of the trained PSLSTM model.
[0047] A processor is communicatively connected to the memory. The processor can be a microcontroller, digital signal processor, application-specific integrated circuit (ASIC), or system-on-a-chip (SoC). The processor is configured to execute the instructions in the memory. When the instructions are executed, the processor controls the device to: acquire the battery's voltage and current signals via an analog-to-digital converter (ADC); invoke the data processing module in the instructions to perform sliding window partitioning, normalization, loess smoothing calculation, and feature fusion on the acquired time-series data to generate an enhanced input vector; load PSLSTM model parameters, perform neural network forward propagation calculation, and obtain a SOC estimate; finally, output the SOC value via the communication interface. This device can be a standalone hardware box or a core chip or module in a battery management system.
[0048] Example 3 This embodiment provides a battery management system that integrates the lithium-ion battery state of charge (SOC) estimation device described in Embodiment 2.
[0049] This battery management system is a complete hardware and software system for managing the safe and efficient operation of the battery pack. In addition to the SOC estimation device in Example 2, the system typically includes: a voltage detection circuit for acquiring the voltage of each individual battery cell, a current sensor (such as a Hall sensor) for acquiring the total current, a temperature sensor network, a battery equalization circuit (active or passive), a thermal management actuator (such as a heating film or cooling fan), a relay or contactor drive circuit, and a network interface (such as a CAN bus) for communicating with the vehicle controller or other devices.
[0050] In this system, the SOC estimation device of Embodiment 2 continuously operates as its "brain" or core algorithm unit. It uses the collected raw voltage and current data to estimate a high-precision SOC in real time according to the method of Embodiment 1. Based on this accurate SOC value, the system controller executes a series of key management strategies: for example, issuing warnings and limiting discharge power to prevent over-discharge when the SOC is too low; stopping charging to prevent overcharging when the SOC is too high; determining whether to activate low-temperature heating based on SOC and temperature; performing dynamic balancing among individual cells in the battery pack to eliminate SOC differences; calculating and reporting the remaining driving range, etc. Because the SOC estimation method provided by this invention is particularly accurate and reliable at low temperatures, this battery management system can still make correct management decisions in cold climates, greatly improving the availability and safety of electric vehicles or energy storage systems in winter or cold regions.
[0051] Example 4 This embodiment provides a computer-readable storage medium. The computer-readable storage medium is a physical entity containing a computer program. Examples include, but are not limited to: read-only memory, random access memory, solid-state drive, hard disk drive, USB flash drive, portable hard drive, optical disk, and network server storage space.
[0052] The computer-readable storage medium stores a computer program (or instructions, code). This computer program contains a series of instructions executable by a processor. When the computer program is loaded and run by a processor (such as the processor in the device of Embodiment 2, or the main processor of the battery management system in Embodiment 3), it controls the processor or the device containing the processor to automatically and completely execute all steps of the "Lithium-ion Battery State of Charge (SOC) Estimation Method" as described in Embodiment 1, or to execute the steps of the online estimation portion of the method. The program may include subroutines for data preprocessing, a function library implementing the loess smoothing algorithm, a neural network forward computation engine, and other modules.
[0053] Through this storage medium, the technical solution of the present invention can be copied, distributed, installed and upgraded in the form of a software product, which facilitates deployment and application on various different hardware platforms.
[0054] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the original technical features, and the technical solutions resulting from these changes or substitutions will all fall within the scope of protection of the present invention.
Claims
1. A method for estimating the state of charge (SOC) of a lithium-ion battery, characterized in that, Includes the following steps: Obtain the original time-series data of battery voltage and current, divide the original time-series data into short sequences using a sliding window, perform local weighted regression smoothing on each short sequence using the loess smoothing algorithm, and then perform feature splicing and fusion with the original short sequences to form an enhanced input sequence; The enhanced input sequence is fed into the PSLSTM model for processing to obtain the SOC estimate. The PSLSTM model is a simplified structure that removes the forget gate of the standard long short-term memory network and introduces a pruning algorithm based on partial least squares regression during training to dynamically merge redundant memory blocks.
2. The method according to claim 1, characterized in that, The method of using the loess smoothing algorithm for local weighted regression smoothing is as follows: for each data point in the short sequence, a weight is assigned according to its distance from the point to be smoothed, with the weight being greater for closer points; a local polynomial is fitted to the point using the weighted least squares method, and the constant term of the polynomial is used as the smoothing result.
3. The method according to claim 2, characterized in that, In the step of assigning weights, the weighting function used is a cubic function, whose weight value decreases with the cube of the distance within a preset bandwidth and is zero outside the bandwidth.
4. The method according to claim 1, characterized in that, The simplified structure that removes the forget gate of the standard long short-term memory network is achieved by removing the forget gate and multiplying the complement of the current input gate activation value with the cell state of the previous time step element by element to control the degree of retention of historical information.
5. The method according to claim 4, characterized in that, The pruning algorithm based on partial least squares regression specifically includes: establishing a mapping relationship between the internal state time series of each memory block and the final output time series of the model through partial least squares regression, and calculating the regression coefficient corresponding to each memory block as an importance index of the memory block; Calculate the average of the regression coefficients of all memory blocks, and multiply this average by the current total number of memory blocks and a preset pruning strength coefficient to obtain an adaptive pruning threshold; If a memory block has a regression coefficient lower than the adaptive pruning threshold, it is determined to be an unimportant block. The correlation coefficient between the unimportant block and the internal state sequences of all other blocks is calculated, and the unimportant block is merged with the memory block with the highest correlation coefficient.
6. The method according to claim 1, characterized in that, The method uses a multi-temperature dataset covering both low and normal temperature ranges to train the PSLSTM model uniformly. The low temperature range includes temperature points below zero degrees Celsius.
7. The method according to claim 6, characterized in that, The multi-temperature dataset includes at least battery charge and discharge data at -10°C, 0°C, 10°C, and 25°C.
8. A lithium-ion battery state of charge (SOC) estimation device, characterized in that, include: Memory, which stores instructions; A processor, configured to implement the method as described in any one of claims 1 to 7 when executing the instructions.
9. A battery management system, characterized in that, It integrates the lithium-ion battery state of charge (SOC) estimation device as described in claim 8.
10. A vehicle, characterized in that, It is equipped with the battery management system as described in claim 9.