A lithium battery state of health prediction method and system
By combining a Transformer encoder, a multilayer KAN network, and an unscented Kalman filter, the shortcomings of long-term dependence and nonlinear characteristics in lithium battery SoH prediction are addressed, achieving high-precision and stable health state prediction and supporting the optimization of battery management systems.
Patent Information
- Application Number
- CN202510037139.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-01-09
AI Technical Summary
Existing lithium battery state of health (SoH) prediction methods lack sufficient accuracy and stability when dealing with long-term dependence and strong nonlinear characteristics, and cannot meet the needs of complex battery datasets.
A model is developed that uses a Transformer layer encoder, a multi-layer KAN network as a decoder, and an unscented Kalman filter. By combining forward propagation, backpropagation algorithms, and hyperparameter tuning, a lithium battery health state prediction model is trained. The prediction accuracy and stability are improved by smoothing the output through a multi-head attention mechanism and an unscented Kalman filter.
It significantly improves the accuracy and stability of lithium battery SoH prediction, ensures the reliability of battery health state prediction, and is suitable for battery management systems.
Smart Images

Figure CN119438958B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of lithium battery state of health management, more specifically to a lithium battery state of health prediction method and system. BACKGROUND
[0002] With the popularity of electric vehicles, drones and portable electronic devices, the importance of lithium battery state of health (SoH) prediction is increasingly prominent. SoH is usually defined as the ratio of the current capacity of the battery to the initial rated capacity, and is a key factor in optimizing battery management systems and prolonging battery life. However, existing SoH prediction methods, such as equivalent circuit models and traditional machine learning algorithms, have shortcomings in analyzing the characteristics of battery input and output signals, especially in combining advanced signal processing techniques and deep learning algorithms, which limits their prediction accuracy on complex battery datasets.
[0003] Traditional SoH prediction techniques can be divided into two categories: physics-based methods and data-driven methods. The former relies on mathematical models to simulate the electrochemical behavior and aging process of the battery, but due to the complexity of the nonlinear mechanisms inside the battery, these models are difficult to accurately capture all changes, and the model parameters will drift with changes in working conditions, causing prediction errors. The latter, such as linear regression and support vector machines (SVM), although they can be trained with a large amount of historical data, their prediction ability is limited when faced with high-dimensional, nonlinear battery data, and they are prone to underfitting or overfitting problems.
[0004] In recent years, the development of neural network technology has brought new opportunities for SoH prediction. Recurrent Neural Network (RNN) and Transformer models have been widely used in SoH prediction due to their strong feature extraction capabilities and advantages in processing sequence data. In particular, Transformer can effectively capture long-term dependencies in the battery charging and discharging cycle. However, since the battery SoH is a smooth decline process, Transformer may produce fluctuating prediction results when dealing with such data with long-term dependencies and nonlinear characteristics, which poses a challenge to practical applications. Existing Chinese patent CN115032540A introduces a lithium-ion battery health state estimation scheme. This scheme first establishes an equivalent impedance circuit model, then obtains electrochemical impedance spectrum data and corresponding battery capacity information under different charge and discharge times to identify model parameters. Finally, a support vector machine regression model is used for training to achieve accurate estimation of SoH. Another Chinese patent CN117007977A proposes a flow of energy storage battery health state diagnosis, which collects various parameters of the battery running under extreme conditions, and uses an improved wavelet transform technique to extract features. Then, through label processing and generating a differentiated subset, the Euclidean distance is calculated as diagnostic evidence. Finally, the D-S evidence theory is used to fuse the results of online prediction model and offline diagnosis to complete the evaluation of battery health state. Another Chinese patent CN118731717A introduces an innovative SoH prediction method that combines trend-aware attention mechanism and Transformer encoder. Specifically, it first preprocesses the data set of lithium-ion batteries, then designs a special trend-aware attention module to capture trend features in the data, and then passes these features to the Transformer encoder to further mine deep features. After sufficient training, this model can provide more accurate and smooth SoH prediction results to meet the needs of practical applications.
[0005] In summary, although there are various SoH prediction technologies, the above existing technologies fail to fully combine the needs of handling long-time dependencies, strong nonlinear features, and smooth outputs.
[0006] Therefore, it is necessary to design a new method to improve the accuracy and smoothness of SoH prediction. SUMMARY
[0007] The purpose of the present application is to overcome the defects of the prior art and provide a lithium battery health state prediction method and system.
[0008] To achieve the above purpose, the technical scheme adopted by the present application is as follows: a lithium battery health state prediction method, characterized in that it comprises:
[0009] acquiring lithium battery operation data;
[0010] inputting the lithium battery operation data into a lithium battery state of health prediction model for state of health prediction to obtain a prediction result; wherein the lithium battery state of health prediction model is obtained by training a basic model with historical battery operation data as a sample set, the training process adopts a forward propagation, a backward propagation algorithm and hyperparameter tuning, and the basic model is a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder and a connection of an unscented Kalman filter;
[0011] outputting the prediction result.
[0012] A further technical solution is that the lithium battery state of health prediction model is obtained by training a basic model with historical battery operation data as a sample set, the training process adopts a forward propagation, a backward propagation algorithm and hyperparameter tuning, and the basic model is a model composed of an encoder of a Transformer layer as an encoder of the model, a multilayer KAN network as a decoder and a connection of an unscented Kalman filter, comprising:
[0013] acquiring historical battery operation data, and pre-processing corresponding time values to obtain a sample set;
[0014] constructing a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder and a connection of an unscented Kalman filter to obtain a basic model;
[0015] training the basic model with the sample set, a forward propagation, a backward propagation algorithm and hyperparameter tuning to obtain a lithium battery state of health prediction model.
[0016] A further technical solution is that the model comprises an encoder of a Transformer layer as an encoder of the model, a multilayer KAN network as a decoder and an unscented Kalman filter for smoothing output, wherein the encoder comprises a plurality of stacked encoding layers, each encoding layer comprises a multi-head attention mechanism and a feedforward neural network, a residual connection and layer normalization are added after each encoding layer; the decoder comprises a plurality of KAN decoding layers.
[0017] A further technical solution is that an expression of the multi-head attention mechanism is: ; ; Q represents a predicted value of SoH, K represents information related to Q, including voltage, current and temperature, values and actual data containing corresponding keys, by calculating each query and all keys, the Transformer layer assigns weights to the values, and obtains a corresponding output value through weighted summation; is the dimension of each head, is the total model dimension; h is the number of heads in the multi-head attention mechanism.
[0018] Further technical solutions are as follows: the mathematical expression of the KAN layer is: ; wherein, and is a one-dimensional nonlinear function that can be learned, and n is the dimension of the input variable.
[0019] Further technical solutions are as follows: the unscented Kalman filter layer directly predicts the state mean and covariance by propagating a set of weighted Sigma points, so as to smooth the output of the lithium battery health state prediction model.
[0020] Further technical solutions are as follows: the training process of the lithium battery health state prediction model adopts mean square error as a loss function, and the expression of the loss function is: , wherein, is an actual value, is a predicted value, and N is the number of samples.
[0021] Further technical solutions are as follows: the performance evaluation index of the training process of the lithium battery health state prediction model adopts root mean square percentage error, and the expression is: ; wherein, is an actual value, is a predicted value, and N is the number of samples.
[0022] The application further provides a lithium battery health state prediction system, comprising:
[0023] a data acquisition unit configured to acquire lithium battery operation data;
[0024] a prediction unit configured to input the lithium battery operation data into a lithium battery health state prediction model to perform health state prediction, so as to obtain a prediction result; wherein the lithium battery health state prediction model is obtained by training a basic model by taking historical battery operation data as a sample set, the training process adopts a forward propagation, a backward propagation algorithm and hyperparameter optimization, and the basic model is a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder and an unscented Kalman filter connection.
[0025] an output unit configured to output the prediction result.
[0026] The application further provides a computer device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the above method when executing the computer program.
[0027] Compared with the prior art, the present application has the beneficial effects that: the present application collects historical running data of lithium batteries, and trains a health state prediction model using the data, to ensure that the model can accurately predict the health state of the battery. During the training process, forward propagation, back propagation algorithm and hyperparameter tuning are used to optimize the performance of the model. The basic structure of the model is composed of an encoder of a Transformer, a multilayer KAN network as a decoder and an unscented Kalman filter, which can more effectively capture the nonlinear characteristics of battery operation. The Transformer layer processes sequence data, the KAN layer extracts nonlinear key features, and the UKF enhances the stability of the model output, stabilizing the prediction results. Finally, through this combination method, the accuracy and stability of the SoH prediction are greatly improved, ensuring the reliability of the battery health state prediction.
[0028] The present application will be further described below in conjunction with the drawings and specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0030] Figure 1 An application scenario schematic diagram of a lithium battery health state prediction method provided by the embodiment of the present application is shown in the figure.
[0031] Figure 2 A flowchart of the lithium battery health state prediction method provided by the embodiment of the present application is shown in the figure. Figure 1
[0032] Figure 3 A flowchart of the lithium battery health state prediction method provided by the embodiment of the present application is shown in the figure. Figure 2
[0033] Figure 4 A schematic block diagram of the lithium battery health state prediction system provided by the embodiment of the present application is shown in the figure.
[0034] Figure 5 A schematic block diagram of the computer device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0035] With reference to the accompanying drawings, the technical solutions in the embodiments of the present application will be clearly and completely described below. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts are within the scope of the present application.
[0036] It should be understood that the terms "comprise" and "include" as used in the specification and the appended claims indicate the presence of the described features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0037] It should also be understood that the terms used in the present application specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the present application specification and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0038] It should be further understood that the term "and / or" used in the present application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations thereof, and includes these combinations.
[0039] Please refer to Figure 1 and Figure 2 , Figure 1 The application scenario diagram of the lithium battery state of health prediction method provided by the embodiments of the present application. Figure 2 The schematic flowchart of the lithium battery state of health prediction method provided by the embodiments of the present application. The lithium battery state of health prediction method is applied to a server. The server performs data interaction with a terminal, and the method of the present embodiment connects an encoder of a Transformer layer as a model encoder, a multi-layer KAN network as a decoder, and an unscented Kalman filter in sequence to improve the accuracy of SoH prediction. Among them, the Transformer can process the long-time dependence of battery data, the KAN network relies on the learning of the non-linear activation function, which can help to process the strong non-linearity of data, and the unscented Kalman filter is used to smooth the output, so that the output SoH is more in line with the physical law.
[0040] Figure 2 is a flowchart of a lithium battery state of health prediction method provided by the embodiments of the present application. As Figure 2 shown, the method comprises the following steps S110 to S130.
[0041] S110, acquiring lithium battery operation data.
[0042] In this embodiment, the lithium battery operation data refers to various key parameters related to battery performance, specifically including the following:
[0043] Average temperature: Calculate the average temperature of the battery within each discharge segment to monitor the thermal characteristics of the battery under different working conditions, ensuring it operates within a safe temperature range and avoids performance degradation or safety hazards caused by overheating.
[0044] Average voltage: Measure the average voltage within the discharge segment to assess the health status and capacity loss of the battery at different discharge stages.
[0045] Average current: Record the average current of the battery during the discharge process to understand its charge and discharge efficiency and power output, providing data support for battery performance evaluation.
[0046] Charging time: Calculate the charging time of each charging segment to assess the charging efficiency of the battery and determine its degradation trend.
[0047] Discharge capacity: Extract the discharge capacity of the battery within a certain discharge voltage range as a key indicator for evaluating battery health, helping to predict its remaining service life.
[0048] Health status: Calculate the health status of the battery based on each discharge cycle to comprehensively evaluate the overall performance of the battery and predict its remaining life and reliability.
[0049] By comprehensively collecting and processing these data, a reliable foundation can be provided for subsequent analysis and processing, ensuring accurate evaluation and management of battery performance.
[0050] S120, input the lithium battery operation data into the lithium battery health state prediction model for health state prediction to obtain a prediction result; wherein the lithium battery health state prediction model is obtained by training a basic model using historical battery operation data as a sample set, the training process uses forward propagation, back propagation algorithm and hyperparameter tuning, and the basic model is a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder, and a connection of an unscented Kalman filter.
[0051] In this embodiment, the prediction result refers to the prediction result of the SoH state of the lithium battery. The entire prediction process is as shown in Figure 3 .
[0052] For Figure 3 , the model obtained after training the model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder, and a connection of an unscented Kalman filter is used for prediction.
[0053] In an embodiment, the lithium battery state of health prediction model described above is obtained by collecting historical battery operation data as a sample set to train a base model, the training process uses forward propagation, back propagation algorithm and hyperparameter tuning, and the base model is a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder, and a connection of an unscented Kalman filter, including steps S121-S123.
[0054] S121, collect historical battery operation data, and preprocess corresponding time values to obtain a sample set.
[0055] In the present embodiment, the running data of the battery is collected, including current, voltage, temperature and battery state of health. For the original charging data segment, the average temperature, voltage, current and charging time of the battery are calculated, and the discharge capacity of the battery within a certain discharge voltage range is extracted to form a data set. Different charging protocols divide the data into training set, test set and validation set. Then normalize the data to ensure the effectiveness of model training and evaluation, so that the data of all dimensions can be analyzed in a unified framework to form a sample set.
[0056] Specifically, for each charging cycle or segment, the average temperature, average voltage, average current and total charging time in that period are calculated. For a specific discharge voltage range, the corresponding discharge capacity is measured and recorded as an important indicator for evaluating battery capacity degradation. By calculating these statistics, the data dimension can be reduced while retaining characteristics closely related to the battery state of health, facilitating subsequent analysis.
[0057] According to different charging protocols or experimental settings, the data set is reasonably divided into training set, test set and validation set. Usually, the ratio between the three can be set according to actual conditions, for example, 70% of the data is used for training, 15% for validation, and the remaining 15% for final testing. Ensure that each subset has similar distribution characteristics, that is, maintain the consistency and representativeness of the data, and avoid overfitting problems.
[0058] Since data from different sensors may be in different orders of magnitude, directly using the original values may cause some features to dominate in the model training process, affecting the importance of other features. Use appropriate methods (such as min-max normalization, Z-score standardization, etc.) to adjust all features to the same scale range (such as the [0, 1] interval), so that the data in each dimension can be compared and analyzed under a unified standard. Not only improves the speed and stability of model training, but also enhances the generalization ability of the model, ensuring its performance on new data is more reliable.
[0059] After the above preprocessing steps are completed, the processed features are combined into a structured sample set, where each row represents an observation point (or a charge / discharge cycle), and the columns correspond to the extracted features and labels (such as SoH values). This sample set can be directly input into the machine learning model for training and evaluation, providing a solid foundation for accurate battery health prediction.
[0060] Through such a systematic preprocessing process, not only can the battery operation data be effectively organized and prepared, but also the model constructed can have good performance and reliability, thereby providing strong support for battery health management.
[0061] S122, a model composed of an encoder of a Transformer layer, a multi-layer KAN network as a decoder, and a unscented Kalman filter connection is constructed to obtain a basic model.
[0062] In the embodiment, the model includes an encoder of a Transformer layer as the encoder of the model, a multi-layer KAN network as a decoder, and a unscented Kalman filter for smoothing the output, wherein the encoder includes a plurality of stacked encoding layers, each of the encoding layers includes a multi-head attention mechanism and a feed-forward neural network, a residual connection and layer normalization are added after each encoding layer; the decoder includes a plurality of KAN decoding layers.
[0063] Specifically, the Transformer layer is used to process time series data, aiming to capture long-term dependencies in battery sensor input data and extract global features. In order to enhance the processing capability of the model for nonlinear input, the KAN layer is introduced as a decoder, which uses the learning ability of the activation function to enable the model to more accurately fit the complex nonlinear characteristics in the battery operation data. In addition, in order to smooth the output of the model and reduce the volatility of the prediction results, the UKF layer is applied to the model, so that the SoH (State of Health) prediction results are more consistent with the physical characteristics of the battery, and the stability of the model is improved.
[0064] Specifically, the Transformer layer is introduced to more effectively capture global dependencies in battery time series data, thereby improving the accuracy of battery health prediction. The encoder part of the Transformer layer is composed of a plurality of stacked encoding layers, each encoding layer contains two core sublayers: a multi-head attention mechanism and a feed-forward neural network sublayer. In order to ensure smooth flow of information and improve the stability of model training, residual connections and layer normalization are added after each sublayer. This design helps to preserve the original features of the input data and effectively alleviates the overfitting problem, thereby improving the generalization ability of the model on the battery data set.
[0065] The multi-head attention mechanism in the encoder is used to capture global features during the battery charging process. The model can extract the potential patterns of the charging data from different angles in parallel by dividing the input sequence into multiple subspaces, thereby comprehensively understanding the dependencies in the time series. The combination of residual connections and layer normalization further ensures the stable transmission of information between layers, which helps to improve the performance of the model on high-dimensional complex battery data, especially when the sample is small, and can maintain the stability of the prediction results.
[0066] The decoder part of the Transformer layer is composed of multiple stacked decoding layers. Each decoding layer contains a multi-head attention and a feed-forward network sublayer, in addition to an encoder-decoder attention sublayer. This sublayer uses the output of the encoder to enable the decoder to focus on key features in the input sequence when generating predictions. In the battery health prediction task, this mechanism enables the decoder to effectively capture important information during the charging process, resulting in more accurate and consistent prediction results.
[0067] The multi-head attention mechanism, as the core component of the Transformer layer, plays an important role in both the encoder and the decoder. By mapping the input sequence to multiple different representation spaces, the model can independently calculate the attention weights in each subspace, thereby more deeply mining the potential features of the time series.
[0068] Specifically, the expression of the multi-head attention mechanism is: ; ; Q represents the predicted value of SoH, K represents information related to Q, including voltage, current and temperature, and values containing actual data corresponding to the key, by calculating each query and all keys, the Transformer layer assigns weights to the values, and obtains the corresponding output value by weighted summation; d_k is the dimension of each head, d_model is the total model dimension; h is the number of heads in the multi-head attention mechanism.
[0069] In addition, considering the strong nonlinear characteristics of the battery data set, the KAN layer is introduced as the model decoder to improve the model's ability to model nonlinear relationships. In the battery health prediction task, charging data often exhibits complex nonlinear patterns and long-term temporal dependencies, and traditional Transformer decoders cannot effectively capture deep features in the data. By introducing the KAN layer as the model decoder, the model's nonlinear fitting ability in processing battery data can be significantly enhanced, making the model more suitable for capturing complex dynamic features in the battery health prediction task.
[0070] Specifically, the mathematical expression of the KAN layer is: ; where, and is a learnable one-dimensional nonlinear function, and n is the dimension of the input variable.
[0071] In theory, any multivariate continuous function can be approximated by a set of univariate continuous functions and their linear combinations. Under this theoretical framework, the KAN layer generates appropriate spline functions through training, aiming to capture complex time series data relationships. This approach makes the KAN layer more efficient in handling high-dimensional and nonlinear battery charging data, better modeling the complex dependence of battery health status, and thus improving the fitting ability.
[0072] The core of the KAN layer is to approximate the nonlinear characteristics of the input data by training adaptive spline functions. Its mathematical expression is: where represents the i-th learnable nonlinear activation function.
[0073] In practical implementation, the KAN layer will perform nonlinear transformation on the input features through multiple parallel spline basis functions, and adjust the coefficients of each spline basis function to enable the model to capture the subtle changes of data in different regions. These spline basis functions include piecewise linear, polynomial spline, and B-spline, etc. Through the training process, the model will automatically select the optimal combination of basis functions to minimize the prediction error.
[0074] Specifically, the KAN layer generates a set of spline basis functions according to the input data during training, and dynamically generates the optimal nonlinear function by adjusting the node positions and coefficients of these splines. This method not only captures the global trend in battery data, but also finely describes local nonlinear changes, making the results of battery health prediction more accurate and stable.
[0075] In this implementation, a multi-layer KAN network is introduced as the decoder, making the Transformer encoder layer further enhance the ability to capture complex nonlinear features based on the multi-head attention mechanism. Specifically, the multi-head attention mechanism is used to capture global dependencies in battery time series data, while the KAN layer performs nonlinear transformation on the attention output to extract deeper implicit features and output the prediction results. This synergy ensures that the model can effectively capture long-term dependencies and high nonlinear changes when processing charging data segments, thereby improving the accuracy of battery health prediction.
[0076] To address the issue of potential drastic fluctuations in the SoH results output by the Transformer layer, an unscented Kalman filter (UKF) is introduced. Although the Transformer layer has strong feature extraction capabilities when processing time series data, its output results can have large fluctuations, especially in response to small changes in input data, leading to SoH prediction results that do not conform to physical laws. Although these fluctuations may cancel each other out in terms of positive and negative errors, keeping the loss function (such as mean squared error) low, this volatility does not conform to the physical characteristics of SoH, which should change smoothly.
[0077] To solve this problem, UKF is introduced to smooth the results output by the Transformer layer. UKF is a filtering algorithm based on state estimation of nonlinear systems, which can effectively deal with uncertainties in nonlinear systems by directly propagating the mean and covariance of the state. Unlike traditional Kalman filters, UKF does not need to linearize the approximation of nonlinear functions, and can provide higher estimation accuracy and stability.
[0078] For the UKF, i.e., the unscented Kalman filter layer, it directly predicts the state mean and covariance by propagating a set of weighted Sigma points to smooth the output of the lithium battery state of health prediction model.
[0079] First, the state is weighted and summed according to the weight ω to predict the mean . Next, the covariance matrix is calculated, where Q is the process noise. First, the covariance matrix of the observation is calculated, and the Kalman gain is calculated. Then, the state is updated using the Kalman gain K to obtain the corrected state . Finally, the covariance matrix is updated.
[0080] UKF and KAN-based Transformer model complement each other, together improving the accuracy and stability of battery health (SoH) prediction. The model composed of the Transformer encoder as the model encoder and the multi-layer KAN network as the model decoder is mainly responsible for extracting features from battery operation data and performing nonlinear mapping to generate preliminary SoH prediction results. These prediction results may sometimes have large fluctuations, especially when dealing with complex battery data. To ensure that the prediction results are smooth and conform to physical laws, UKF is used to post-process these preliminary prediction results. Specifically, UKF can effectively smooth the SoH prediction curve, reducing fluctuations caused by excessive model prediction responses, thereby improving the stability and accuracy of the prediction.
[0081] S123, using the sample set, using forward propagation, back propagation algorithm and hyperparameter tuning to train the base to obtain a lithium battery state of health prediction model.
[0082] In this embodiment, the training process of the lithium battery state of health prediction model uses mean square error as the loss function, and the expression of the loss function is: , wherein, is the actual value, is the predicted value, and N is the number of samples.
[0083] The performance evaluation index of the training process of the lithium battery state of health prediction model uses root mean square percentage error, and the expression is: ; wherein, is the actual value, is the predicted value, and N is the number of samples.
[0084] During the training process, MAE (Mean Absolute Error) and RMSPE (Relative Mean Square Percentage Error) are used as evaluation indicators to measure the performance of the model. The model combines the encoder module of the Transformer and the KAN layer as the decoder, and is further processed by the Unscented Kalman Filter (UKF) to generate the final battery state of health prediction value. Through hyperparameter tuning and training, the accuracy and stability of the prediction results are ensured, so that the subsequent battery management system can efficiently and intelligently use these prediction results.
[0085] The model is first trained using the training set data and its performance is evaluated on the test set, recording the MAE and RMSPE indicators.
[0086] After the MAE and RMSPE meet the set requirements, the trained model is used for online prediction of the state of health of the lithium battery.
[0087] The method of this embodiment significantly improves the accuracy and stability of lithium battery state of health (SoH) prediction by combining the encoder of the Transformer, the KAN layer with nonlinear activation function as the decoder, and the Unscented Kalman Filter (UKF) model. This method has important application value for optimizing the battery management system and promoting the development of related technologies.
[0088] In summary, the training process of the model is as follows: the original battery operation data is integrated and preliminarily processed, the key feature values of each charging period are calculated, and the normalization alignment operation is implemented. This step not only eliminates the noise in the data, but also ensures the scale consistency between different features, laying a solid foundation for the subsequent deep learning model training.
[0089] The preprocessed data is then fed into a multi-head attention module built on a Transformer encoder architecture. This module consists of multiple stacked encoders, each containing two main sub-layers: a multi-head self-attention mechanism and a feedforward neural network. In this way, the model is able to capture global dependencies in time series, performing particularly well when dealing with data spanning long periods. The multi-head self-attention mechanism allows the model to analyze charging data in parallel from different perspectives, identifying complex interactions between variables, thereby enhancing the understanding of long-term dependencies.
[0090] To more accurately fit the complex nonlinear relationships present in battery operating data, we introduced a multi-layer KAN network as a decoder after using a Transformer layer encoder as the model encoder. The KAN network utilizes an adaptive spline function for nonlinear transformation, enabling the model to delve deeper into the latent patterns within the data. This design enhances the model's sensitivity to nonlinear changes, particularly its ability to perceive subtle changes reflecting battery aging trends. Therefore, the KAN layer, as the model decoder, can more accurately depict the intrinsic characteristics of battery health.
[0091] Finally, to smooth the prediction results and reduce unnecessary fluctuations, we used an unscented Kalman filter (UKF) module to post-process the final SoH prediction values. The UKF module not only ensures the statistical optimality of the prediction results but also guarantees that these results conform to the actual physical behavior of the battery, making the SoH predictions more stable and continuous. Through the smoothing process of the UKF, we can effectively suppress prediction oscillations caused by small changes in the model response data, further improving the consistency and reliability of the predictions.
[0092] This model combines the Transformer's ability to capture global dependencies, the KAN layer's strong fitting ability for nonlinear features, and the smoothing capabilities provided by UKF. This approach is particularly suitable for handling battery datasets with strong time dependencies and complex nonlinear characteristics, demonstrating outstanding performance in improving SoH prediction accuracy. The entire process includes multiple stages such as data collection, preprocessing, model training, and hyperparameter tuning; all these efforts collectively contribute to a significant improvement in the performance of the battery management system.
[0093] S130, Output the prediction result.
[0094] The prediction results are output to the terminal for display.
[0095] The method of the embodiment collects the running data of lithium batteries during actual use, including but not limited to parameters such as voltage, current and temperature, as basic information for model input. A prediction model based on the Transformer architecture is constructed and trained, which is particularly characterized by using the KAN layer as the model decoder and combined with the unscented Kalman filter (UKF) to enhance the learning ability of nonlinear features and ensure that the prediction results conform to the physical laws. Using historical battery running data as the training sample set, the model parameters are iteratively optimized through the forward propagation and back propagation algorithms, and the hyperparameters are optimized, so that the model can effectively capture the global dependence relationship and complex nonlinear changes in the data. The real-time acquired lithium battery running data is input into the fully trained prediction model to perform SoH prediction, thereby obtaining the prediction result reflecting the current health status of the battery; in this process, the KAN layer is responsible for deep modeling of the nonlinear characteristics in the data, and the UKF is used for smoothing processing of the prediction output to reduce fluctuations. The final output is the SoH prediction result after optimization and smoothing processing, which not only improves the accuracy of the prediction, but also ensures the continuity and stability of the prediction trend, providing reliable technical support for lithium battery management.
[0096] The above-mentioned lithium battery health state prediction method collects historical running data of lithium batteries and trains a health state prediction model using these data to ensure that the model can accurately predict the health state of the battery. During the training process, the forward propagation, back propagation algorithm and hyperparameter optimization are used to optimize the performance of the model. The basic structure of the model is composed of a Transformer layer encoder, a multi-layer KAN network as a decoder and a UKF connection, which can more effectively capture the nonlinear characteristics of battery operation. The Transformer layer processes sequence data, the KAN layer extracts key features, and the UKF enhances the robustness of the model to noise and stabilizes the prediction results. Ultimately, through this combination of methods, the accuracy and smoothness of SoH prediction are greatly improved, ensuring the reliability of battery health state prediction.
[0097] Figure 4 is a schematic block diagram of a lithium battery health state prediction system 300 provided by an embodiment of the present application. As Figure 4 shown, corresponding to the above-mentioned lithium battery health state prediction method, the present application also provides a lithium battery health state prediction system. The lithium battery health state prediction system 300 includes units for performing the above-mentioned lithium battery health state prediction method, and the system can be configured in a server. Specifically, referring to Figure 4 , the lithium battery health state prediction system 300 includes a data acquisition unit 301, a prediction unit 302 and an output unit 303.
[0098] The data acquisition unit 301 is configured to acquire lithium battery operation data; the prediction unit 302 is configured to input the lithium battery operation data into a lithium battery health state prediction model to perform health state prediction, so as to obtain a prediction result; wherein the lithium battery health state prediction model is obtained by training a basic model by taking historical battery operation data as a sample set, and the training process adopts a forward propagation, a backward propagation algorithm and hyperparameter tuning, and the basic model is a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder and a connection of an unscented Kalman filter; and the output unit 303 is configured to output the prediction result.
[0099] In an embodiment, the system further comprises a model training unit, configured to collect historical battery operation data, and pre-process the historical battery operation data in combination with corresponding time point values, so as to obtain a sample set; construct a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder and a connection of an unscented Kalman filter, so as to obtain a basic model; and train the basic model by using the sample set, by using a forward propagation, a backward propagation algorithm and hyperparameter tuning, so as to obtain a lithium battery health state prediction model.
[0100] It should be noted that the specific implementation process of the lithium battery health state prediction system 300 and each unit can be clearly understood by those skilled in the art, and can refer to the corresponding description in the foregoing method embodiments, and will not be described here again for the convenience and brevity of description.
[0101] The lithium battery health state prediction system 300 described above can be realized in the form of a computer program, which can run on a computer device as shown in the computer device. Figure 5
[0102] Please refer to Figure 5 , Figure 5 is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 500 can be a server, wherein the server can be a stand-alone server or a server cluster composed of multiple servers.
[0103] Referring to Figure 5 , the computer device 500 includes a processor 502, a memory and a network interface 505 connected through a system bus 501, wherein the memory can include a non-volatile storage medium 503 and an internal memory 504.
[0104] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, which, when executed, can cause the processor 502 to perform a lithium battery health state prediction method.
[0105] The processor 502 is configured to provide computing and control capabilities to support the operation of the entire computer device 500.
[0106] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503, which, when executed by the processor 502, causes the processor 502 to perform a lithium battery state of health prediction method.
[0107] The network interface 505 is configured to perform network communication with other devices. Those skilled in the art can understand that the network interface 505 can be implemented in various forms, such as a network card, a modem, a wireless Local Area Network (LAN) card, or the like. Figure 5 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device 500 to which the scheme of the present application is applied. The specific computer device 500 can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0108] The processor 502 is configured to run the computer program 5032 stored in the memory to implement the following steps:
[0109] acquiring lithium battery operation data; inputting the lithium battery operation data into a lithium battery state of health prediction model to perform state of health prediction to obtain a prediction result; wherein the lithium battery state of health prediction model is obtained by training a base model using historical battery operation data as a sample set, the training process uses a forward propagation, a backward propagation algorithm and hyperparameter tuning, and the base model is a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder, and a unscented Kalman filter connection; and outputting the prediction result.
[0110] In an embodiment, when the processor 502 implements the step of training the base model using historical battery operation data as a sample set, the training process uses a forward propagation, a backward propagation algorithm and hyperparameter tuning, and the base model is a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder, and a unscented Kalman filter connection, the following steps are implemented:
[0111] acquiring historical battery operation data, and pre-processing corresponding time values to obtain a sample set; constructing a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder, and a unscented Kalman filter connection to obtain a base model; training the base model using the sample set, a forward propagation, a backward propagation algorithm and hyperparameter tuning to obtain a lithium battery state of health prediction model.
[0112] The model comprises an encoder of a Transformer layer as an encoder of the model, a multi-layer KAN network as a decoder, and an unscented Kalman filter for smoothing the output, wherein the encoder comprises a plurality of stacked encoding layers, each of the encoding layers comprising a multi-head attention mechanism and a feed-forward neural network, and a residual connection and layer normalization are added after each encoding layer; the decoder comprises a plurality of KAN decoding layers.
[0113] The expression of the multi-head attention mechanism is: ; Q represents the predicted value of SoH, K represents information related to Q, including voltage, current and temperature, values and actual data containing corresponding keys, by calculating each query and all keys, the Transformer layer assigns weights to the values, and obtains the corresponding output value by weighted summation; is the dimension of each head, is the total model dimension; h is the number of heads in the multi-head attention mechanism.
[0114] The mathematical expression of the KAN layer is: ; wherein, and are one-dimensional nonlinear functions that can be learned, and n is the dimension of the input variable.
[0115] The unscented Kalman filter layer directly predicts the state mean and covariance by propagating a set of weighted Sigma points, to smooth the output of the lithium battery state of health prediction model.
[0116] The training process of the lithium battery state of health prediction model uses mean square error as the loss function, and the expression of the loss function is: , wherein, is the actual value, is the predicted value, and N is the number of samples.
[0117] The performance evaluation index of the training process of the lithium battery state of health prediction model uses the root mean square percentage error, and the expression is: ; wherein, is the actual value, is the predicted value, and N is the number of samples.
[0118] It should be understood that, in the embodiments of the present application, the processor 502 can be a central processing unit (CPU), and the processor 502 can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0119] It can be understood by those skilled in the art that all or part of the processes in the method of the above-mentioned embodiments can be completed by instructing the relevant hardware by a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the above-mentioned embodiments of the method.
[0120] Therefore, the present application also provides a storage medium. The storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program is executed by a processor to make the processor perform the following steps:
[0121] obtaining lithium battery operation data; inputting the lithium battery operation data into a lithium battery health state prediction model to perform health state prediction to obtain a prediction result; wherein the lithium battery health state prediction model is obtained by training a basic model by collecting historical battery operation data as a sample set, the training process adopts a forward propagation, a backward propagation algorithm and hyperparameter optimization, and the basic model is a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder and a connection of an unscented Kalman filter; and outputting the prediction result.
[0122] In an embodiment, when the processor executes the computer program to implement the step of obtaining the lithium battery health state prediction model by training a basic model by collecting historical battery operation data as a sample set, the training process adopts a forward propagation, a backward propagation algorithm and hyperparameter optimization, and the basic model is a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder and a connection of an unscented Kalman filter, the following steps are specifically implemented:
[0123] The historical battery operation data is collected and preprocessed in combination with the corresponding time value to obtain a sample set; a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder and a connection of an unscented Kalman filter is constructed to obtain a basic model; the sample set is used to train the basic model by using a forward propagation algorithm, a backward propagation algorithm and hyperparameter tuning to obtain a lithium battery health state prediction model.
[0124] The model includes an encoder of a Transformer layer as an encoder of the model, a multilayer KAN network as a decoder, and an unscented Kalman filter for smoothing output, wherein the encoder includes a plurality of stacked encoding layers, each of which includes a multi-head attention mechanism and a feedforward neural network, and a residual connection and layer normalization are added after each encoding layer; the decoder includes a plurality of KAN decoding layers.
[0125] The expression of the multi-head attention mechanism is: ; Q represents the predicted value of SoH, K represents information related to Q, including voltage, current and temperature, values and actual data containing keys, by calculating each query and all keys, the Transformer layer assigns weights to the values, and obtains the corresponding output value by weighted summation; is the dimension of each head, is the total model dimension; h is the number of heads in the multi-head attention mechanism.
[0126] The mathematical expression of the KAN layer is: ; wherein, and is a one-dimensional learnable nonlinear function, and n is the dimension of the input variable.
[0127] The unscented Kalman filter layer directly predicts the state mean and covariance by propagating a set of weighted Sigma points to smooth the output of the lithium battery health state prediction model.
[0128] The training process of the lithium battery health state prediction model uses mean square error as the loss function, and the expression of the loss function is: , wherein, is the actual value, is the predicted value, and N is the sample number.
[0129] The performance evaluation index of the training process of the lithium battery health state prediction model uses the root mean square percentage error, and the expression is: ; wherein, is the actual value, is the predicted value, and N is the sample number.
[0130] The storage medium can be a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and the like various computer readable storage media that can store program codes.
[0131] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been described in the above description in general terms. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0132] In several embodiments provided by the present application, it should be understood that the disclosed system and method can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of each unit is only a logical functional division, and actual implementation can have another division. For example, a plurality of units or components can be combined or integrated into another system, or some features can be omitted or not executed.
[0133] The steps in the method of the embodiments of the present application can be adjusted, combined and deleted in sequence according to actual needs. The units in the system of the embodiments of the present application can be combined, divided and deleted according to actual needs. In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0134] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part of the prior art that makes a contribution, or the whole or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a terminal or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.
[0135] The above merely illustrates the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any skilled person in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements shall be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A lithium battery state of health prediction method, characterized by, The method comprises: acquiring lithium battery operation data; inputting the lithium battery operation data into a lithium battery health state prediction model for health state prediction to obtain a prediction result; wherein the lithium battery health state prediction model is obtained by training a basic model using historical battery operation data as a sample set, and the training process adopts a forward propagation, a backward propagation algorithm and hyperparameter tuning; the basic model is a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder and a unscented Kalman filter connection; the unscented Kalman filter layer directly predicts state mean and covariance by propagating a set of weighted Sigma points to smooth the output of the lithium battery health state prediction model; outputting the prediction result; the lithium battery health state prediction model is obtained by training a basic model using historical battery operation data as a sample set, and the training process adopts a forward propagation, a backward propagation algorithm and hyperparameter tuning; the basic model is a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder and a unscented Kalman filter connection, comprising: acquiring historical battery operation data and pre-processing corresponding time values to obtain a sample set; constructing a basic model; training the basic model using the sample set, a forward propagation, a backward propagation algorithm and hyperparameter tuning to obtain a lithium battery health state prediction model; the model comprises an encoder of a Transformer layer as the encoder of the model, a multilayer KAN network as a decoder and a unscented Kalman filter for smoothing the output; wherein the encoder comprises a plurality of stacked encoding layers, each encoding layer comprises a multi-head attention mechanism and a feedforward neural network, and a residual connection and layer normalization are added after each encoding layer; this design helps to retain the original features of the input data and effectively alleviates the overfitting problem, thereby improving the generalization ability of the model on the battery data set; the decoder comprises a plurality of KAN decoding layers; The expression of the multi-head attention mechanism is: ; ; Q represents the predicted value of SoH, K represents information related to Q, including voltage, current and temperature, values and actual data containing corresponding keys, by calculating each query and all keys, the Transformer layer assigns weights to the values, and obtains the corresponding output value through weighted summation; is the dimension of each head, is the total model dimension; is the number of heads in the multi-head attention mechanism; the mathematical expression of the KAN layer is: ; wherein, and are one-dimensional nonlinear functions that can be learned, and n is the dimension of the input variable; by introducing a KAN layer as the model decoder, the nonlinear fitting ability of the model in processing battery data is significantly enhanced, so that the model is more suitable for capturing complex dynamic characteristics in the battery health degree prediction task; the Transformer layer processes sequence data, the KAN layer extracts nonlinear key features, and the unscented Kalman filter enhances the stability of the model output to stabilize the prediction result.
2. The method of claim 1, wherein, The training process of the lithium battery health state prediction model adopts mean square error as a loss function, and the expression of the loss function is: wherein, is an actual value, is a predicted value, and N is a sample number.
3. The method of claim 2, wherein the step of determining the state of health of the lithium battery is performed by using a machine learning algorithm. The performance evaluation index of the training process of the lithium battery health state prediction model adopts root mean square percentage error, and the expression is: ; wherein, is the actual value, is the predicted value, and N is the sample number.
4. A lithium battery state of health prediction system characterized by, The system uses the lithium battery health state prediction method according to any one of claims 1 to 3, comprising: a data acquisition unit for acquiring lithium battery operation data; A prediction unit is configured to input the lithium battery operation data into a lithium battery state of health prediction model to perform state of health prediction and obtain a prediction result; wherein the lithium battery state of health prediction model is obtained by collecting historical battery operation data as a sample set to train a basic model, a forward propagation and a backward propagation algorithm and hyperparameter tuning are used in the training process, and the basic model is a model composed of an encoder of a Transformer layer, a multilayer KAN network as a decoder and a connection of an unscented Kalman filter; an expression of the multi-head attention mechanism is as follows: ; ; Q represents a predicted value of SoH, K represents information related to Q, including voltage, current and temperature, values and actual data containing keys, by calculating each query and all keys, the Transformer layer assigns weights to the values, and the corresponding output value is obtained through weighted summation; is the dimension of each head, is the total model dimension; is the number of heads in the multi-head attention mechanism; a mathematical expression of the KAN layer is as follows: ; wherein, and are one-dimensional nonlinear functions that can be learned, and n is the dimension of the input variable. the unscented Kalman filter layer directly predicts state mean and covariance by propagating a set of weighted Sigma points to smooth the output of the lithium battery health state prediction model; an output unit for outputting the prediction result.
5. A computer device, comprising: The computer device comprises a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Lithium ion battery health state estimation method, apparatus and device, and medium
CN115032540A
Energy storage battery health state diagnosis method
CN117007977A
Lithium ion battery health state estimation method based on trend perception attention and Transform encoder
CN118731717A
Lithium ion battery health state estimation method based on Bayesian optimization CNN-Transformer
CN119104900A
Lithium battery charge state estimation method and system
CN119270099A