Battery life prediction method and device and related equipment thereof
Through the combination of CEEMDAN algorithm and the convolutional neural network CNN and Transformer network, the characteristics of battery capacity data are extracted, which solves the problem of insufficient accuracy of battery life prediction in the prior art, and improves the robustness and generalization ability of prediction.
Patent Information
- Application Number
- CN202411422332.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2024-12-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing battery residual service life prediction methods cannot adapt to complex working conditions, and the constructed prediction model has poor robustness and generalization capabilities, which affects the accuracy of prediction, especially in the case of capacity regeneration of lithium-ion batteries.
The CEEMDAN algorithm is used to preprocess the original capacity sequence of the battery, extract global characteristic data, and use the life prediction model of the convolutional neural network CNN and the deep learning model Transformer network cascade to extract feature information and generate prediction sequence results.
It improves the prediction accuracy of the remaining battery life, can accurately capture local details and overall trends during battery degradation, and comprehensively considers the global timing information during battery use.
Smart Images

Figure CN119104913A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of energy storage devices, and specifically to a battery life prediction method, device, and related equipment. Background Art
[0002] RUL (Remaining Useful Life) refers to the estimated time that an energy storage device (e.g., a battery, specifically a lithium battery, or a mobile power source) can be used normally in its current state. By predicting the RUL of a battery, the current state of the battery can be evaluated to facilitate efficient use of battery energy. It is also beneficial for preventive maintenance of battery equipment, extending its service life, and effectively ensuring the reliability and economy of the battery equipment.
[0003] However, existing methods for predicting the remaining service life of batteries cannot adapt to the complex working conditions of actual battery use, and cannot build a prediction model with strong robustness and generalization capabilities. Moreover, battery capacity regeneration occurs during use, especially for lithium-ion batteries, which affects the accuracy of the prediction of the remaining service life of the battery.
[0004] In this context, providing a battery life prediction solution to improve the accuracy of predicting the remaining service life of the battery has become a technical problem that technical personnel in this field urgently need to solve. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a battery life prediction method, apparatus and related equipment to improve the accuracy of prediction of the remaining service life of the battery.
[0006] To solve the above problems, the present application provides a battery life prediction method, including:
[0007] Get the original capacity sequence of the battery;
[0008] Preprocessing the original capacity sequence according to the CEEMDAN algorithm to obtain battery capacity data, wherein the battery capacity data reflects the global characteristics of the battery capacity;
[0009] The life prediction model is used to extract features from the battery capacity data to obtain feature information associated with the remaining service life of the battery, and a prediction sequence result is obtained based on the feature information mapping, wherein the prediction sequence result indicates the remaining service life of the battery; wherein the life prediction model is obtained by cascading a convolutional neural network (CNN) and a deep learning model (Transformer) network.
[0010] Optionally, the step of preprocessing the original capacity sequence according to the CEEMDAN algorithm includes:
[0011] According to formula (1), a white noise sequence is added to the original battery capacity sequence:
[0012] C j (t) = C (t) + β k n j (t) (1)
[0013] Where t represents the number of charge and discharge cycles of the battery, C j (t) represents the new capacity sequence of adding white noise for the jth time, n j (t) represents the jth added white noise, β k represents the kth signal-to-noise ratio;
[0014] According to formula (2), the first residual component r1(t) is calculated:
[0015] r1(t)=C(t)-IMF1(t) (2)
[0016] Among them, C(t) is the new capacity sequence C after adding white noise using the EMD algorithm. j (t) is decomposed N times repeatedly; IMF1(t) is the C j (t) The first modal component calculated using ensemble averaging;
[0017] The second mode function is calculated according to formula (3), and the second residual component is calculated according to formula (4):
[0018]
[0019] r2(t)=r1(t)-IMF2(t) (4)
[0020] Among them, E k (·) is the kth component obtained after EMD decomposition, IMF2 is the second modal component and r2(t) is the second residual component, N represents N-th decomposition;
[0021] Formulas (3) and (4) are executed repeatedly until the residual component is a monotonic function, and the final residual component is calculated according to formula (5):
[0022]
[0023] Where n is the total number of modal components and C(t) is the original battery capacity sequence.
[0024] Optionally, the convolutional neural network CNN includes at least: a convolutional layer, a pooling layer and a fully connected layer;
[0025] The convolutional layer is used to extract the features of the input sequence using formula (6):
[0026] c i =f(ω×x i:i+g-1 +b) (6)
[0027] Among them, ω is the convolution kernel, g is the size of the convolution kernel, x i:i+g-1 is the feature vector from i to i+g-1, b is the bias term; based on the obtained multiple C j Constructs the eigenvector matrix G;
[0028] The pooling layer is used to reduce the dimension of the feature vector output by the convolutional layer using formula (7):
[0029] N=max(c1,c2,...,c n-g+1 )=max{G} (7)
[0030] The fully connected layer is used to integrate the local feature vectors of the convolutional layer and the pooling layer using formula (8) to obtain a complete feature vector:
[0031] Y=σ(wc i +b) (8)
[0032] Among them, Y is the final output result of the fully connected layer, w is the weight coefficient, b is the bias term, and σ is the nonlinear activation function.
[0033] Optionally, the deep learning model Transformer network includes a data embedding layer and a linear layer;
[0034] The data embedding layer is used to embed position information into the input vector using formula (9) and formula (10), calculate the weight value and output information of each input vector using formula (11), formula (12) and formula (13), and perform nonlinear transformation using formula (14);
[0035] PE(t,2k)=sin(t / 10000 2k / s ) (9)
[0036] PE(t,2k+1)=cos(t / 10000 2k / s ) (10)
[0037] Where PE represents the position encoding matrix, t represents the position of the position encoding, k is an integer value between 0 and s / 2-1, representing the dimension index of the encoding vector, and s represents the dimension of each vector in the Transformer network;
[0038] MultiHead(Q,K,V)=Concat(head1,...,headh )W o (11)
[0039] Among them, Q stands for Query, which is a vector matrix, K stands for Key, which is a key vector matrix. Q and K are used to calculate the weight of attention, and V stands for Value, which is a value vector matrix. Q (Query), K (Key), and V (Value) are three vectors obtained by three linear mapping layers based on the input sequence, and their dimensions are d q , d k and d v ; W o Represents the linear mapping parameters of the output;
[0040] head i =Attention(QW i Q ,KW i K ,VW i V ) (12)
[0041] Among them, Concat represents the concatenation function, which is used to concatenate the output results of all heads along the last dimension to form the final output; Respectively represent the weight matrices corresponding to the Q, K, and V vectors of the i-th head;
[0042]
[0043] Where h is the number of self-attention heads, usually set to 8, i.e. h = 8; and d k =d v =s / h, then d h =s / h, softmax represents the activation function, K T is the transpose of K, Used for normalization;
[0044] FFN(x)=max(0,xW1+b1)W2+b2 (14)
[0045] Among them, x represents the vector data with input data dimension s; b1 and b2 are bias parameters; W1 and W2 are parameter matrices of linear mapping;
[0046] The linear layer is used to perform feature mapping on the result of formula (14) to obtain the predicted sequence result.
[0047] Optionally, also include:
[0048] Determining an error evaluation parameter according to the prediction sequence result, and performing an error analysis on the life prediction model according to the error evaluation parameter;
[0049] The error evaluation parameters include one or more of relative error, root mean square error, and mean absolute error.
[0050] The present application provides a battery life prediction device, including:
[0051] An acquisition module, used to acquire the original capacity sequence of the battery;
[0052] A preprocessing module, used for preprocessing the original capacity sequence according to the CEEMDAN algorithm to obtain battery capacity data, wherein the battery capacity data reflects the global characteristics of the battery capacity;
[0053] The life prediction module is used to use the life prediction model to extract features from the battery capacity data to obtain feature information associated with the remaining service life of the battery, and obtain a prediction sequence result based on the feature information mapping, wherein the prediction sequence result indicates the remaining service life of the battery; wherein the life prediction model is obtained by cascading a convolutional neural network (CNN) and a deep learning model (Transformer) network.
[0054] Optionally, also include:
[0055] An error analysis module, used to determine an error evaluation parameter according to the prediction sequence result, and perform error analysis on the life prediction model according to the error evaluation parameter;
[0056] The error evaluation parameters include one or more of relative error, root mean square error, and mean absolute error.
[0057] An embodiment of the present application also provides a battery life prediction system, including the battery life prediction device as described above.
[0058] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be executed by the processor, and when the processor runs the computer program, the battery life prediction method as described above is executed.
[0059] An embodiment of the present application also provides a storage medium, which stores one or more computer-executable instructions. When the one or more computer-executable instructions are executed, the battery life prediction method as described above is implemented.
[0060] Compared with the prior art, the technical solution of the embodiment of the present application has the following advantages:
[0061] In the battery life prediction method, device and related equipment provided in the embodiment of the present application, by obtaining the original capacity sequence of the battery, the original capacity sequence can be preprocessed according to the CEEMDAN algorithm to obtain battery capacity data reflecting the global characteristics of the battery capacity, accurately capture the local details and overall trends in the battery degradation process, and provide a rich and accurate data basis for subsequent feature extraction and analysis; using the life prediction model, the battery capacity data is feature extracted to obtain feature information associated with the remaining service life of the battery, and the prediction sequence result indicating the remaining service life of the battery is obtained according to the feature information mapping. Among them, in the case where the life prediction model of the embodiment of the present application is obtained by cascading the convolutional neural network CNN and the deep learning model Transformer network, the life prediction model can be used to extract feature information useful for predicting the remaining service life of the battery, and comprehensively consider the global timing information during the use of the battery, thereby effectively improving the prediction accuracy of the remaining service life of the battery. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0063] Figure 1 is an optional flow chart of a battery life prediction method provided in an embodiment of the present application;
[0064] Figure 2 It is a schematic diagram of the principle of the CEEMDAN algorithm provided in the embodiment of the present application;
[0065] Figure 3 This is a schematic diagram of the structure of the convolutional neural network CNN provided in the embodiment of the present application.
[0066] Figure 4 It is a structural diagram of the deep learning model Transformer network provided in the embodiment of the present application;
[0067] Figure 5 is another optional flow chart of the battery life prediction method provided in the embodiment of the present application;
[0068] Figure 6 It is an optional block diagram of the battery life prediction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0069] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0070] As described in the background technology, existing methods for predicting the remaining service life of batteries cannot adapt to the complex working conditions of actual battery use, and cannot build a prediction model with strong robustness and generalization capabilities. Moreover, the battery will experience capacity regeneration during use, especially lithium-ion batteries, which affects the accuracy of the prediction of the remaining service life of the battery.
[0071] Among them, the existing battery remaining service life prediction methods mainly use physical models or data-driven methods to predict the remaining service life of the battery. When using physical models to predict the remaining service life of the battery, the degradation trend of the battery is predicted by establishing a mathematical model of the electrochemical process and degradation mechanism of the battery. However, this method usually requires accurate estimation of the internal parameters of the battery, and the mathematical model has a certain complexity, and the internal parameters of the battery also have uncertainty, which makes it difficult to adapt to the complex working conditions of the battery in actual use when predicting the remaining service life of the battery using a physical model. When using data-driven methods to predict the remaining service life of the battery, the data-driven methods, such as support vector machines, neural networks, machine learning algorithms, etc., analyze the battery operation data and explore the inherent laws of battery degradation, thereby realizing the prediction of the remaining service life of the battery. Although the use of data-driven methods to predict the remaining service life of the battery can overcome the limitations of the use of physical models to a certain extent, it cannot extract effective features (for example: battery capacity features, battery voltage features, battery cycle times, etc.) from the massive data during the battery operation process, and the robustness of the constructed prediction model is poor, thereby reducing the prediction accuracy of the remaining service life of the battery.
[0072] In view of this, the embodiment of the present application provides an improved battery life prediction solution, which obtains the original capacity sequence of the battery and then pre-processes the original capacity sequence according to the CEEMDAN algorithm to obtain battery capacity data reflecting the global characteristics of the battery capacity, accurately captures the local details and overall trends in the battery degradation process, and provides a rich and accurate data basis for subsequent feature extraction and analysis; using the life prediction model, the battery capacity data is feature extracted to obtain feature information associated with the remaining service life of the battery, and the prediction sequence results indicating the remaining service life of the battery are obtained according to the feature information mapping. Among them, in the case where the life prediction model of the embodiment of the present application is obtained by cascading the convolutional neural network CNN and the deep learning model Transformer network, the life prediction model can be used to extract feature information useful for predicting the remaining battery life, and comprehensively consider the global timing information during the use of the battery, thereby effectively improving the prediction accuracy of the remaining battery life.
[0073] Based on the above ideas, Figure 1 The following is an exemplary diagram of an optional flow chart of a battery life prediction method provided in an embodiment of the present application. Figure 1 As shown, the following steps may be included:
[0074] Step S100, obtaining the original capacity sequence of the battery.
[0075] The original capacity sequence of a battery refers to the standard test results when the battery leaves the factory, which can be obtained through standard testing procedures, such as the mAh value in a fully charged state, which indicates the maximum charge that the battery can provide under specific conditions.
[0076] Step S110, preprocessing the original capacity sequence according to the CEEMDAN algorithm to obtain battery capacity data.
[0077] As an advanced signal processing technology, the CEEMDAN algorithm can effectively decompose nonlinear and non-stationary signals, and decompose the original signal into several modal components (Intrinsic Mode Functions, IMFs) with different time scale characteristics and a residual component (Residual). By preprocessing the original capacity sequence of the battery according to the CEEMDAN algorithm, the local details and overall trends in the battery degradation process can be accurately captured, thereby obtaining battery capacity data, which can reflect the global characteristics of the battery capacity.
[0078] Step S120, using the life prediction model, extracting features from the battery capacity data to obtain feature information associated with the remaining service life of the battery, and obtaining a prediction sequence result based on the feature information mapping.
[0079] The life prediction model is obtained by cascading a convolutional neural network (CNN) and a deep learning model (Transformer) network. The convolutional neural network (CNN) can automatically learn local features in sequence data through its convolutional layer; the deep learning model (Transformer) network has a unique multi-head self-attention mechanism, which can process long sequence data and capture the dependencies between different positions in the sequence, giving it a significant advantage in dealing with time series prediction problems with long-term dependencies.
[0080] The embodiment of the present application is based on a life prediction model obtained by cascading a convolutional neural network CNN and a deep learning model Transformer network. It can perform feature extraction on the battery capacity data after CEEMDAN decomposition to extract feature information useful for predicting the remaining service life of the battery, and comprehensively consider the global timing information during the use of the battery to obtain a prediction sequence result. The prediction sequence result is used to indicate the remaining service life of the battery, thereby effectively improving the prediction accuracy of the remaining service life of the battery.
[0081] It can be seen that the embodiment of the present application obtains the original capacity sequence of the battery, and then can pre-process the original capacity sequence according to the CEEMDAN algorithm to obtain battery capacity data that reflects the global characteristics of the battery capacity, accurately capture the local details and overall trends in the battery degradation process, and provide a rich and accurate data basis for subsequent feature extraction and analysis; using the life prediction model, the battery capacity data is feature extracted to obtain feature information associated with the remaining service life of the battery, and the prediction sequence results indicating the remaining service life of the battery are obtained according to the feature information mapping. Among them, in the case where the life prediction model of the embodiment of the present application is obtained by cascading the convolutional neural network CNN and the deep learning model Transformer network, the life prediction model can be used to extract feature information useful for predicting the remaining service life of the battery, and comprehensively consider the global timing information during the use of the battery, thereby effectively improving the prediction accuracy of the remaining service life of the battery.
[0082] In some embodiments, Figure 2 The schematic diagram of the principle of the CEEMDAN algorithm in the embodiment of the present application is shown as an example. Figure 2 As shown, the CEEMDAN algorithm can add white noise to the original capacity sequence of the battery and iteratively process it to obtain residual components and other contents, thereby completing data decomposition.
[0083] correspond Figure 2 As shown, the step of preprocessing the original capacity sequence according to the CEEMDAN algorithm in the embodiment of the present application may include the following contents:
[0084] First, according to formula (1), a white noise sequence is added to the original battery capacity sequence:
[0085] C j (t) = C (t) + β k n j (t) (1)
[0086] Where t represents the number of charge and discharge cycles of the battery, C j (t) represents the new capacity sequence of adding white noise for the jth time, n j (t) represents the jth added white noise, β k represents the kth signal-to-noise ratio.
[0087] "White noise" refers to random noise artificially added to a signal. It is used in signal processing and data analysis. It is characterized by uniform power spectrum density, that is, it has the same energy intensity at all frequencies. By adding a white noise sequence to the original battery capacity sequence, it can effectively reveal subtle changes in the battery degradation process that may be masked by noise, improve sensitivity to small changes in battery performance, and thus accurately predict the remaining service life of the battery.
[0088] Then, according to formula (2), the first residual component r1(t) is calculated:
[0089] r1(t)=C(t)-IMF1(t) (2)
[0090] Among them, C(t) is the new capacity sequence C after adding white noise using the EMD algorithm. j (t) is decomposed N times repeatedly; IMF1(t) is the C decomposed N times repeatedly. j (t) The first modal component calculated using ensemble averaging.
[0091] And, the second mode function is calculated according to formula (3), and the second residual component is calculated according to formula (4):
[0092]
[0093] r2(t)=r1(t)-IMF2(t) (4)
[0094] Among them, E k (·) is the kth component obtained by EMD decomposition, IMF2 is the second modal component and r2(t) is the second residual component, and N represents N decompositions.
[0095] Finally, formulas (3) and (4) are executed repeatedly until the residual component is a monotonic function, and the final residual component is calculated according to formula (5):
[0096]
[0097] Where n is the total number of modal components and C(t) is the original battery capacity sequence.
[0098] In some embodiments, Figure 3 The structural diagram of the convolutional neural network CNN in the embodiment of the present application is shown as an example. Figure 3 As shown in the figure, the convolutional neural network CNN includes at least a convolutional layer, a pooling layer and a fully connected layer.
[0099] Among them, different types of layers have different functions.
[0100] The main function of the convolution layer is to extract the features of the input sequence, which can be composed of multiple convolution kernels. The multiple convolution kernels move one dimension along the time axis of the input sequence and perform dot product operations with the local part of the sequence to generate new feature representations. Specifically, the convolution layer can extract the features of the input sequence using formula (6):
[0101] c i =f(ω×x i:i+g-1 +b) (6)
[0102] Among them, ω is the convolution kernel, g is the size of the convolution kernel, x i:i+g-1 is the feature vector from i to i+g-1, b is the bias term; based on the obtained multiple C j Constructs the eigenvector matrix G.
[0103] The main function of the pooling layer is to reduce the dimension of the feature vector output by the convolution layer to improve computational efficiency and prevent overfitting. The pooling layer usually applies the average pooling method and the maximum pooling method. Among them, in order to better retain the feature information, the pooling layer of the embodiment of the present application applies the maximum pooling method. Specifically, the pooling layer can use formula (7) to reduce the dimension of the feature vector output by the convolution layer:
[0104] N=max(c1,c2,...,c n-g+1 )=max{G} (7)
[0105] The function of the fully connected layer is to integrate the local feature vectors of the convolutional layer and the pooling layer to obtain a complete feature vector. Specifically, the fully connected layer can use formula (8) to integrate the local feature vectors of the convolutional layer and the pooling layer to obtain a complete feature vector:
[0106] Y=σ(wc i +b) (8)
[0107] Wherein, Y is the final output result of the fully connected layer, w is the weight coefficient, b is the bias term, and σ is the nonlinear activation function. In an optional example, the nonlinear activation function in formula (8) can be a ReLU function. ReLU cannot map negative values to zero, which helps to alleviate the gradient vanishing problem and makes it easy to transfer gradients in back propagation, thereby better updating parameters. The formula of the ReLU function is as follows:
[0108] ReLU(x)=max(0,x)
[0109] It should be noted that the convolutional neural network (CNN) has the characteristics of local perception and weight sharing, so it can be applied to time series modeling. Through the convolution operation, it can effectively capture the local features in the time series, realize the effective abstraction and representation of the data, reduce the number of parameters, and thus improve the learning efficiency of the convolutional neural network for time series data.
[0110] It should be further explained that the convolutional neural network of the embodiment of the present application can be a one-dimensional convolutional neural network, which is mainly composed of a convolutional layer, a pooling layer, and a fully connected layer. For other types of convolutional neural networks, the embodiment of the present application is also applicable, as long as the battery capacity data obtained by preprocessing the original capacity sequence of the battery based on the CEEMDAN algorithm is satisfied, and effective features can be extracted, and the embodiment of the present application is not limited to this.
[0111] In some embodiments, Figure 4 The schematic diagram of the structure of the deep learning model Transformer network in the embodiment of the present application is shown as an example. Figure 4 As shown, the deep learning model Transformer network can include a data embedding layer and a linear layer.
[0112] The convolutional neural network CNN inputs the final output result of the fully connected layer obtained by formula (8) into the Transformer network, and then the Transformer network can use the data embedding layer and the linear layer to process the final output result of the fully connected layer of CNN to obtain the predicted sequence result.
[0113] Among them, in the data embedding layer, position information can be embedded into the input vector through position encoding, so that the network can capture the order of the capacity input sequence. For example, sine and cosine functions of different frequencies are used for position encoding. Specifically, the data embedding layer can use formula (9) and formula (10) to embed the position information into the input vector:
[0114] PE(t,2k)=sin(t / 10000 2k / s ) (9)
[0115] PE(t,2k+1)=cos(t / 10000 2k / s ) (10)
[0116] Among them, PE represents the position encoding matrix, t represents the position of the position encoding, k is an integer value between 0 and s / 2-1, representing the dimension index of the encoding vector, and s represents the dimension of each vector in the Transformer network.
[0117] Then, the similarity between each input vector and all input vectors is calculated through multi-head self-attention, and the weighted sum is used to obtain the new representation of each input vector. Among them, the multi-head self-attention mechanism enables the network to focus on multiple key areas at the same time and ignore the distance between sequences. Its core process is: use the query vector matrix Q and the key vector matrix K to calculate the attention weight, and then apply it to the value vector matrix V to obtain the entire weight and output. Specifically, the data embedding layer can use formula (11), formula (12) and formula (13) to calculate the weight value and output information of each input vector:
[0118] MultiHead(Q,K,V)=Concat(head1,...,head h )W o (11)
[0119] Among them, Q stands for Query, which is a vector matrix, K stands for Key, which is a key vector matrix. Q and K are used to calculate the weight of attention, and V stands for Value, which is a value vector matrix. Q (Query), K (Key), and V (Value) are three vectors obtained by three linear mapping layers based on the input sequence, and their dimensions are d q , d k and d v ; W o Represents the linear mapping parameters of the output.
[0120] head i =Attention(QW i Q ,KW i K ,VW i V ) (12)
[0121] Among them, Concat represents the concatenation function, which is used to concatenate the output results of all heads along the last dimension to form the final output; Respectively represent the weight matrices corresponding to the Q, K, and V vectors of the i-th head.
[0122]
[0123] Where h is the number of self-attention heads, usually set to 8, i.e. h = 8; and d k =d v =s / h, then d h =s / h, softmax represents the activation function, K T is the transpose of K, Used for normalization. Through normalization, the gradient can be kept stable during training, thus avoiding the gradient vanishing problem.
[0124] Then, the vector after self-attention processing is transformed nonlinearly through the feedforward network. The feedforward neural network can be composed of two layers of fully connected networks and an activation function Relu. Specifically, the data embedding layer can be transformed nonlinearly using formula (14):
[0125] FFN(x)=max(0,xW1+b1)W2+b2 (14)
[0126] Among them, x represents the vector data with input data dimension s; b1 and b2 are bias parameters; W1 and W2 are parameter matrices of linear mapping.
[0127] Based on the nonlinear transformation results of the data embedding layer, the linear layer of the Transformer network can perform feature mapping on it to obtain a prediction sequence result to indicate the remaining battery life.
[0128] In some embodiments, based on the obtained prediction sequence results, an error analysis can be performed on the life prediction model to obtain an error evaluation parameter for evaluating the performance of the life prediction model. Figure 5 Another optional flow chart of the battery life prediction method according to an embodiment of the present application is shown as an example. Figure 5 As shown, after step S120, step S130 may be further included, determining an error evaluation parameter according to the prediction sequence result, and performing an error analysis on the life prediction model according to the error evaluation parameter.
[0129] The error evaluation parameter may include one or more of relative error (Realtive Error, RE), root mean square error (Root Mean Squared Error, RMSE), and mean absolute error (Mean Absolute Error, MAE). In a specific example, the relative error, root mean square error, and mean absolute error may be calculated based on the real value of the battery capacity to be predicted and the corresponding prediction sequence result. The calculation formula of the relative error is shown in formula (15); the calculation formula of the root mean square error is shown in formula (16); the calculation formula of the mean absolute error is shown in formula (17):
[0130]
[0131] Where N is the total number of battery cycles; y i and Respectively represent the actual capacity and predicted capacity of the battery at the i-th cycle; RUL p and RUL R They represent the RUL predicted value and actual value when the battery capacity reaches the failure threshold. The smaller the three values, the better the prediction effect. Among them, since the RE value is highly correlated with the RUL result of the battery, it can be used as the main evaluation indicator of the life prediction model.
[0132] In order to verify the practicality of the battery life prediction method of the present application, the embodiments of the present application select two sets of open source data sets, namely the lithium-ion battery data set disclosed by the Ames Research Center of the National Aeronautics and Space Administration (NASA) and the lithium-ion battery data set disclosed by the Center for Advanced Life Cycle Engineering (CALCE) of the University of Maryland for battery life prediction.
[0133] The first set of data is composed of the capacity degradation data of batteries B0005, B0006, B0007 and B0018 provided by NASA. These batteries are all commercial 18650 ternary lithium-ion batteries, with a positive material of lithium nickel cobalt aluminum oxide and a cathode material of graphite, with a rated capacity of 2Ah, a rated voltage of 3.6V, and a charging cut-off voltage of 4.2V.
[0134] The second data set consists of capacity degradation data for batteries CS2_35, CS2_36, CS2_37, and CS2_38 provided by CALCE. The CS2 series batteries are lithium cobalt oxide batteries, with anodes made of LiCoO2 mixed with carbon conductive additives and cathodes made of layered graphite combined with polypropylene fluoride.
[0135] By training the first and second data sets using the method of the embodiment of the present application, different prediction starting point comparison experiments, different prediction network comparison experiments, generalization experiments and ablation experiments were conducted. Among them, the experimental environment for running all codes is: the operating system uses GNU / Linux, the network framework uses Pytorch1.7.0, the JupyterNotebook language uses Python3.6.8, CUDA11.0 version, and NVIDIA GeForce RTX 2080Ti.
[0136] The performance of the life prediction model is evaluated using mean absolute error (MAE), root mean square error (RMSE) and relative error (RE). The convolutional neural network (CNN) in the life prediction model is set with four convolutional layers and one fully connected layer. The deep learning model Transformer network uses the ReLU activation function, and the multi-head self-attention number is set to four. The root mean square error is used as the loss function to measure the error between the model prediction value and the true value. At the same time, the adaptive moment estimation optimizer Adam is used to implement the back propagation process, accurately calculate the parameter gradient, and update the model parameters in real time. The initial learning rate is set to 0.001 to ensure that the model can converge quickly in the early stage of training. The training cycle is 1000 times to ensure that the model has enough learning and optimization time to improve the prediction accuracy. The first 80% of the data is used as the training set, and 20% is used as the test set.
[0137] The experimental results based on the above settings are as follows:
[0138] 1) The comparison of different prediction starting points is shown in Table 1:
[0139]
[0140] Table 1
[0141] From the various indicators in Table 1, it can be seen that the prediction of battery B0006 is the best, with an RE value below 0.001, and the various indicators do not change with the increase of the starting point, showing stable performance. As the prediction starting point increases, the prediction effect of battery B0005 and battery B0018 gradually weakens, but at the three starting points, the RE values of the three batteries are all within 0.012. The above experimental results show that the prediction method of the embodiment of the present application has a high degree of fit to the degradation trend of the pre-processed battery capacity data under different prediction starting points, and has excellent prediction performance.
[0142] 2) The comparison of different prediction networks is shown in Table 2:
[0143]
[0144] Table 2
[0145] As can be seen from Table 2, on the B0005 battery, the RE values of the CEEMDAN-CNN-Transformer network and the LSTM network are smaller, which are better than other networks. On the B0006 and B0018 batteries, the CEEMDAN-CNN-Transformer network has the smallest error. Compared with the other four traditional networks, the RE of the CEEMDAN-CNN-Transformer network is the smallest, and the RE improvement is greatly improved, and the performance improvement is very obvious.
[0146] 3) The generalization experimental verification is shown in Table 3:
[0147]
[0148] Table 3
[0149] It can be seen from Table 3 that, except for the large fluctuation in the RUL prediction accuracy of the CS2_37 battery, the other three batteries maintained a high accuracy on the CALCE data set. The average RUL prediction accuracy of the four batteries reached 97.7%. It can be seen that the battery life prediction method of the embodiment of the present application has high prediction accuracy and generalization.
[0150] 4) Ablation experiment verification is shown in Table 4:
[0151]
[0152]
[0153] Table 4
[0154] As shown in Table 4, the effect of a single CNN is better than that of a single Transformer, and the effect of combining the advantages of the two is better than that of each single network, which proves that the life prediction model of the embodiment of the present application has a beneficial effect on the prediction of the remaining service life of the battery. Moreover, after combining the data preprocessing of CEEMDAN, the RUL prediction accuracy can be greatly improved, not only the prediction of local fluctuations is more accurate, but also the overall prediction error has been significantly improved.
[0155] In summary, the battery life prediction method provided in the embodiments of the present application can effectively improve the prediction accuracy of the remaining battery life.
[0156] It can be seen that the embodiment of the present application obtains the original capacity sequence of the battery, and then can pre-process the original capacity sequence according to the CEEMDAN algorithm to obtain battery capacity data that reflects the global characteristics of the battery capacity, accurately capture the local details and overall trends in the battery degradation process, and provide a rich and accurate data basis for subsequent feature extraction and analysis; using the life prediction model, the battery capacity data is feature extracted to obtain feature information associated with the remaining service life of the battery, and the prediction sequence results indicating the remaining service life of the battery are obtained according to the feature information mapping. Among them, in the case where the life prediction model of the embodiment of the present application is obtained by cascading the convolutional neural network CNN and the deep learning model Transformer network, the life prediction model can be used to extract feature information useful for predicting the remaining service life of the battery, and comprehensively consider the global timing information during the use of the battery, thereby effectively improving the prediction accuracy of the remaining service life of the battery.
[0157] The following is an introduction to the battery life prediction device provided in the embodiment of the present application. The device content described below can be considered as a chip device or a computing device, which is a functional module required to implement the battery life prediction method provided in the embodiment of the present application. The device content described below can be referenced to the method content described above.
[0158] Figure 6 FIG. 2 shows an optional block diagram of a battery life prediction device provided by an embodiment of the present application. Figure 6 As shown, the device may include:
[0159] An acquisition module 61 is used to acquire an original capacity sequence of a battery;
[0160] A preprocessing module 62, configured to preprocess the original capacity sequence according to the CEEMDAN algorithm to obtain battery capacity data, wherein the battery capacity data reflects the global characteristics of the battery capacity;
[0161] The life prediction module 63 is used to use the life prediction model to extract features from the battery capacity data to obtain feature information associated with the remaining service life of the battery, and obtain a prediction sequence result based on the feature information mapping, wherein the prediction sequence result indicates the remaining service life of the battery; wherein the life prediction model is obtained by cascading a convolutional neural network CNN and a deep learning model Transformer network.
[0162] Optionally, the preprocessing module 62 preprocesses the original capacity sequence according to the CEEMDAN algorithm, including:
[0163] According to formula (1), a white noise sequence is added to the original battery capacity sequence:
[0164] C j (t) = C (t) + β k n j (t) (1)
[0165] Where t represents the number of charge and discharge cycles of the battery, C j (t) represents the new capacity sequence of adding white noise for the jth time, n j (t) represents the jth added white noise, β k represents the kth signal-to-noise ratio;
[0166] According to formula (2), the first residual component r1(t) is calculated:
[0167] r1(t)=C(t)-IMF1(t) (2)
[0168] Among them, C(t) is the new capacity sequence C after adding white noise using the EMD algorithm. j(t) is decomposed N times repeatedly; IMF1(t) is the C decomposed N times repeatedly. j (t) The first modal component calculated using ensemble averaging;
[0169] The second mode function is calculated according to formula (3), and the second residual component is calculated according to formula (4):
[0170]
[0171] r2(t)=r1(t)-IMF2(t) (4)
[0172] Among them, E k (·) is the kth component obtained after EMD decomposition, IMF2 is the second modal component and r2(t) is the second residual component, N represents N-th decomposition;
[0173] Formulas (3) and (4) are executed repeatedly until the residual component is a monotonic function, and the final residual component is calculated according to formula (5):
[0174]
[0175] Where n is the total number of modal components and C(t) is the original battery capacity sequence.
[0176] Optionally, the convolutional neural network CNN in the life prediction model of the life prediction module 63 includes at least: a convolution layer, a pooling layer and a fully connected layer;
[0177] The convolutional layer is used to extract the features of the input sequence using formula (6):
[0178] c i =f(ω×x i:i+g-1 +b) (6)
[0179] Among them, ω is the convolution kernel, g is the size of the convolution kernel, x i:i+g-1 is the feature vector from i to i+g-1, b is the bias term; based on the obtained multiple C j Constructs the eigenvector matrix G;
[0180] The pooling layer is used to reduce the dimension of the feature vector output by the convolutional layer using formula (7):
[0181] N=max(c1,c2,...,c n-g+1 )=max{G} (7)
[0182] The fully connected layer is used to integrate the local feature vectors of the convolutional layer and the pooling layer using formula (8) to obtain a complete feature vector:
[0183] Y=σ(wc i +b) (8)
[0184] Among them, Y is the final output result of the fully connected layer, w is the weight coefficient, b is the bias term, and σ is the nonlinear activation function.
[0185] Optionally, the deep learning model Transformer network in the life prediction model of the life prediction module 63 includes a data embedding layer and a linear layer;
[0186] The data embedding layer is used to embed position information into the input vector using formula (9) and formula (10), calculate the weight value and output information of each input vector using formula (11), formula (12) and formula (13), and perform nonlinear transformation using formula (14);
[0187] PE(t,2k)=sin(t / 10000 2k / s ) (9)
[0188] PE(t,2k+1)=cos(t / 10000 2k / s ) (10)
[0189] Where PE represents the position encoding matrix, t represents the position of the position encoding, k is an integer value between 0 and s / 2-1, representing the dimension index of the encoding vector, and s represents the dimension of each vector in the Transformer network;
[0190] MultiHead(Q,K,V)=Concat(head1,...,head h )W o (11)
[0191] Among them, Q stands for Query, which is a vector matrix, K stands for Key, which is a key vector matrix. Q and K are used to calculate the weight of attention, and V stands for Value, which is a value vector matrix. Q (Query), K (Key), and V (Value) are three vectors obtained by three linear mapping layers based on the input sequence, and their dimensions are d q , d k and d v ; W o Represents the linear mapping parameters of the output;
[0192] head i =Attention(QW i Q ,KW i K ,VW i V) (12)
[0193] Among them, Concat represents the concatenation function, which is used to concatenate the output results of all heads along the last dimension to form the final output; Respectively represent the weight matrices corresponding to the Q, K, and V vectors of the i-th head;
[0194]
[0195] Where h is the number of self-attention heads, usually set to 8, i.e. h = 8; and d k =d v =s / h, then d h =s / h, softmax represents the activation function, K T is the transpose of K, Used for normalization;
[0196] FFN(x)=max(0,xW1+b1)W2+b2 (14)
[0197] Among them, x represents the vector data with input data dimension s; b1 and b2 are bias parameters; W1 and W2 are parameter matrices of linear mapping;
[0198] The linear layer is used to perform feature mapping on the result of formula (14) to obtain the predicted sequence result.
[0199] Optionally, the battery life prediction device further includes:
[0200] An error analysis module 64 is used to determine an error evaluation parameter according to the prediction sequence result, and perform error analysis on the life prediction model according to the error evaluation parameter;
[0201] The error evaluation parameters include one or more of relative error, root mean square error, and mean absolute error.
[0202] The battery life prediction device of the embodiment of the present application can accurately capture the local details and overall trends in the battery degradation process, thereby improving the prediction accuracy of the remaining battery life.
[0203] An embodiment of the present application also provides a battery life prediction system, including a battery life prediction device as provided in the embodiment of the present application.
[0204] An embodiment of the present application also provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program that can be executed by the processor, and when the processor runs the computer program, it executes the battery life prediction method provided in the embodiment of the present application.
[0205] An embodiment of the present application also provides a storage medium, which stores one or more computer-executable instructions. When the one or more computer-executable instructions are executed, the battery life prediction method provided in the embodiment of the present application is implemented.
[0206] The above describes multiple implementation schemes provided by the embodiments of the present application. The various optional methods introduced in each implementation scheme can be combined and cross-referenced with each other without conflict, thereby extending a variety of possible implementation schemes, which can all be considered as implementation schemes disclosed and open in the embodiments of the present application.
[0207] Although the embodiments of the present application are disclosed above, the present application is not limited thereto. Any person skilled in the art may make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be subject to the scope defined by the claims.
Claims
1. A battery life prediction method, characterized in that: include: Get the original capacity sequence of the battery; Preprocessing the original capacity sequence according to the CEEMDAN algorithm to obtain battery capacity data, wherein the battery capacity data reflects the global characteristics of the battery capacity; The life prediction model is used to extract features from the battery capacity data to obtain feature information associated with the remaining service life of the battery, and a prediction sequence result is obtained based on the feature information mapping, wherein the prediction sequence result indicates the remaining service life of the battery; wherein the life prediction model is obtained by cascading a convolutional neural network (CNN) and a deep learning model (Transformer) network.
2. The method according to claim 1, characterized in that The step of preprocessing the original capacity sequence according to the CEEMDAN algorithm comprises: According to formula (1), a white noise sequence is added to the original battery capacity sequence: C j (t)=C(t)+β k n j (t) (1) Where t represents the number of charge and discharge cycles of the battery, C j (t) represents the new capacity sequence of adding white noise for the jth time, n j (t) represents the jth added white noise, β k represents the kth signal-to-noise ratio; According to formula (2), the first residual component r1(t) is calculated: r1(t)=C(t)-IMF1(t) (2) Among them, C(t) is the new capacity sequence C after adding white noise using the EMD algorithm. j (t) is decomposed N times repeatedly; IMF1(t) is the C j (t) The first modal component calculated using ensemble averaging; The second mode function is calculated according to formula (3), and the second residual component is calculated according to formula (4): r2(t)=r1(t)-IMF2(t) (4) Among them, E k (·) is the kth component obtained after EMD decomposition, IMF2 is the second modal component and r2(t) is the second residual component, N represents N-th decomposition; Formulas (3) and (4) are executed repeatedly until the residual component is a monotonic function, and the final residual component is calculated according to formula (5): Where n is the total number of modal components and C(t) is the original battery capacity sequence.
3. The method according to claim 2, characterized in that The convolutional neural network CNN at least includes: a convolutional layer, a pooling layer and a fully connected layer; The convolutional layer is used to extract the features of the input sequence using formula (6): c i =f(ω×x i:i+g-1 +b) (6) Among them, ω is the convolution kernel, g is the size of the convolution kernel, x i:i+g-1 is the feature vector from i to i+g-1, b is the bias term; based on the obtained multiple C j Constructs the eigenvector matrix G; The pooling layer is used to reduce the dimension of the feature vector output by the convolutional layer using formula (7): N=max(c1,c2,...,c n-g+1 )=max{G} (7) The fully connected layer is used to integrate the local feature vectors of the convolutional layer and the pooling layer using formula (8) to obtain a complete feature vector: Y=σ(wc i +b) (8) Among them, Y is the final output result of the fully connected layer, w is the weight coefficient, b is the bias term, and σ is the nonlinear activation function.
4. The method according to claim 3, characterized in that: The deep learning model Transformer network includes a data embedding layer and a linear layer; The data embedding layer is used to embed position information into the input vector using formula (9) and formula (10), calculate the weight value and output information of each input vector using formula (11), formula (12) and formula (13), and perform nonlinear transformation using formula (14); PE(t,2k)=sin(t / 10000 2k / s ) (9) PE(t,2k+1)=cos(t / 10000 2k / s ) (10) Where PE represents the position encoding matrix, t represents the position of the position encoding, k is an integer value between 0 and s / 2-1, representing the dimension index of the encoding vector, and s represents the dimension of each vector in the Transformer network; MultiHead(Q,K,V)=Concat(head1,...,head h )W o (11) Among them, Q stands for Query, which is a vector matrix, K stands for Key, which is a key vector matrix. Q and K are used to calculate the weight of attention, and V stands for Value, which is a value vector matrix. Q (Query), K (Key), and V (Value) are three vectors obtained by three linear mapping layers based on the input sequence, and their dimensions are d q , d k and d v ; W o Represents the linear mapping parameters of the output; head i =Attention(QW i Q ,KW i K ,VW i V ) (12) Among them, Concat represents the concatenation function, which is used to concatenate the output results of all heads along the last dimension to form the final output; Respectively represent the weight matrices corresponding to the Q, K, and V vectors of the i-th head; Where h is the number of self-attention heads, usually set to 8, i.e. h = 8; and d k =d v =s / h, then d h =s / h, soft max represents the activation function, K T is the transpose of K, Used for normalization; FFN(x)=max(0,xW1+b1)W2+b2 (14) Among them, x represents the vector data with input data dimension s; b1 and b2 are bias parameters; W1 and W2 are parameter matrices of linear mapping; The linear layer is used to perform feature mapping on the result of formula (14) to obtain the predicted sequence result.
5. The method according to claim 1, characterized in that Also includes: Determining an error evaluation parameter according to the prediction sequence result, and performing an error analysis on the life prediction model according to the error evaluation parameter; The error evaluation parameters include one or more of relative error, root mean square error, and mean absolute error.
6. A battery life prediction device, characterized in that: include: An acquisition module, used to acquire the original capacity sequence of the battery; A preprocessing module, used for preprocessing the original capacity sequence according to the CEEMDAN algorithm to obtain battery capacity data, wherein the battery capacity data reflects the global characteristics of the battery capacity; The life prediction module is used to use the life prediction model to extract features from the battery capacity data to obtain feature information associated with the remaining service life of the battery, and obtain a prediction sequence result based on the feature information mapping, wherein the prediction sequence result indicates the remaining service life of the battery; wherein the life prediction model is obtained by cascading a convolutional neural network (CNN) and a deep learning model (Transformer) network.
7. The battery life prediction device according to claim 6, characterized in that: Also includes: An error analysis module, used to determine an error evaluation parameter according to the prediction sequence result, and perform error analysis on the life prediction model according to the error evaluation parameter; The error evaluation parameters include one or more of relative error, root mean square error, and mean absolute error.
8. A battery life prediction system, characterized in that: The battery life prediction device comprises the battery life prediction device as described in any one of claims 7 to 6.
9. An electronic device, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program executable by the processor, and the processor executes the battery life prediction method as claimed in any one of claims 1 to 5 when running the computer program.
10. A storage medium, characterized in that: The storage medium stores one or more computer executable instructions, and when the one or more computer executable instructions are executed, the battery life prediction method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Lithium ion battery life prediction method and system based on deep learning
CN117113056A
Lithium battery residual life multi-step prediction method based on CCLATt network and medium
CN117665594A
Traffic flow prediction method based on space-time attention mechanism
CN117972633A
KR20240078690A
