Lithium battery remaining life and health status prediction method and system based on LSTM+Mamba
By adopting the multi-layer neural network model of LSTM+Mamba in lithium battery prediction, the problems of low prediction accuracy and unused later data in the prior art are solved, and higher prediction accuracy and model performance are achieved.
Patent Information
- Application Number
- CN202411840548.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-08
AI Technical Summary
The prior art has problems with low accuracy and insufficient utilization of battery charging and discharging data in the prediction of the remaining life and health status of lithium batteries.
The multi-layer neural network model based on LSTM+Mamba is adopted, and the time series characteristics of lithium battery aging data are extracted through the LSTM layer. The multi-head attention mechanism is weighted to process the characteristics, the Mamba module makes predictions, and the model is trained using a combined weighted loss function.
It significantly improves the prediction accuracy of the health status and remaining life of lithium batteries, can better capture the dynamic characteristics and nonlinear changes in the aging process of battery, and improves the generalization ability and performance of the model.
Smart Images

Figure CN119780766A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of lithium battery life and status prediction, and more specifically, relates to a method and system for predicting the remaining life and health status of a lithium battery based on LSTM+Mamba. Background Art
[0002] In today's rapid development of the power Internet of Things, lithium batteries, as key energy storage components, are widely used in various electronic devices and systems to ensure the continuity of power supply and the normal operation of equipment. Lithium batteries have become an indispensable choice for many industrial and consumer applications due to their high energy density, wide temperature adaptability range and long-term stability. However, these batteries will gradually degrade during long-term use. Accurately predicting the remaining useful life (RUL) and state of health (SOH) of lithium batteries is particularly important for optimizing battery management, extending the service life of equipment, and reducing maintenance and replacement costs. In practical applications, the degradation process of lithium batteries is affected by many factors, such as temperature, charge and discharge cycles, and load conditions. The interaction of these factors makes it challenging to predict the RUL and SOH of batteries. Accurately evaluating these parameters is of great significance for improving battery performance, extending service life, and ensuring stable operation of equipment.
[0003] Although traditional physical modeling methods can provide a deep understanding of the chemical behavior of batteries, they are often difficult to implement in practical applications due to the complexity of model parameters and the need for a large amount of computing resources. Therefore, data-driven prediction methods, such as machine learning and deep learning, have gradually become the research focus of lithium battery remaining life and health status prediction methods. These data-driven methods can automatically learn the battery degradation mode by mining and analyzing a large amount of historical data, providing higher accuracy and real-time performance for battery status assessment and prediction.
[0004] CN118759379A proposes a method and device for predicting the remaining life of a lithium battery based on an MLP-LSTM classification model, including the following steps: performing a charge and discharge experiment on a lithium battery to obtain various battery observation data and establish an original aging data set; removing abnormal charge and discharge observation data according to the calculated battery capacity to obtain a lithium battery data set with abnormal values removed; calculating the battery state of health (SOH), dividing the data set into two categories with SOH=80% as the boundary; using the MLP-LSTM model to perform binary classification training on the data set to obtain the optimal model weight; using the optimal model to calculate the number of charge and discharge cycles when the new lithium battery data set SOH=80%, thereby obtaining the remaining battery life (RUL). However, the patent does not take into account that the later data of battery charge and discharge are more important for judging the remaining life of lithium batteries, and the accuracy of using the MLP-LSTM classification model is still slightly low. Summary of the invention
[0005] In order to solve the deficiencies in the prior art, the present invention provides an unsupervised, highly efficient and accurate assessment method and system for risk assessment of power customer demand services based on unsupervised learning.
[0006] The present invention adopts the following technical solution.
[0007] The first aspect of the present invention proposes a method for predicting the remaining life and health status of a lithium battery based on LSTM+Mamba, comprising the following contents:
[0008] Perform charge and discharge cycles on lithium batteries, collect and calculate various lithium battery aging data during the cycle, and preprocess the data to form an input data set with the preprocessed lithium battery aging data;
[0009] Construct a multi-layer neural network consisting of an LSTM layer, a multi-head attention mechanism, and a Mamba module; input the input data set into the LSTM layer to extract the time series features of the lithium battery aging data; input the time series features into the multi-head attention layer, perform weighted processing on different features in the time series, and fuse the features in the time series features that are strongly related to the remaining life and health status of the lithium battery; input the features that are strongly related to the remaining life and health status of the lithium battery into the Mamba module to predict the remaining life and health status of the lithium battery;
[0010] A combined weighted loss function with optimized weights is constructed to train a multi-layer neural network; the multi-layer neural network is used to predict the remaining life and health status of lithium batteries.
[0011] Preferably, the preprocessing is to normalize each lithium battery aging data;
[0012] The i-th data z in the p-th lithium battery aging datapi The normalized formula is:
[0013]
[0014] Among them, x pi is the i-th data in the p-th lithium battery aging data, μ p is the mean value of the p-th lithium battery aging data, σ p is the standard deviation of the p-th lithium battery aging data.
[0015] Preferably, the use of the LSTM layer to extract the time series features of the lithium battery aging data is specifically as follows:
[0016] When the LSTM layer propagates forward, it passes through the forget gate, input gate, and output gate in sequence; the formula of the forget gate of the LSTM layer is:
[0017] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0018] Among them, W f represents the weight matrix of the forget gate; b f represents the bias of the forget gate; h t-1 represents the hidden state of the previous time step; σ represents the activation function of the forget gate; x t Indicates the current time step input of the forget gate; when t is 1, x t represents the input data set;
[0019] The formula for the input gate of the LSTM layer is:
[0020] i t =σ(W n ·[h t-1 ,x t ]+b n )
[0021]
[0022] Among them, i t is the output of the input gate; is the state of the candidate cell at the current time step; W n is the weight matrix of the input gate; b n is the bias of the input gate; W C is the weight matrix of candidate cell calculation; b C is the bias of candidate cell calculation;
[0023] The formula for the output gate of the LSTM layer is:
[0024] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0025] h t =o t *tanh(C t )
[0026] Among them, t is the output of the output gate at the current time step; h t represents the hidden state of the current time step; C t is the state of the cell at the current time step; W o is the weight matrix of the output gate; b o is the bias of the output gate;
[0027] The formula for updating the LSTM cell state is:
[0028]
[0029] Among them, f t is the output of the forget gate; C t-1 is the cell state at the previous time step.
[0030] Preferably, the time series features are input into the multi-head attention layer, and different features in the sequence are weighted to fuse the features in the time series features that are strongly correlated with the remaining life and health status of the lithium battery, specifically:
[0031] The calculation formula for the attention score matrix based on each head is:
[0032] Q e =XW eq ,K e =XW ek ,V e =XW ev
[0033]
[0034] Head e =σ′(A e )V e
[0035] Among them, A e is the attention score matrix of the e-th head, σ′(·) is the activation function of the multi-head attention layer
[0036] Number; Q e , K e 、Ve are the query matrix, key matrix, and value matrix of the e-th head respectively; d eq Head is the vector dimension of the value vector of the e-th head; e is the output of the e-th head; W eq , W ek , W ev Q e , K e 、V e The weight matrix of ; X is the matrix composed of the time series features of the input multi-head attention layer;
[0037] The features that are strongly correlated with the remaining life and health status of the lithium battery in the fused time series features are specifically:
[0038] MH=Concat(Head1,…,Head E )W o
[0039] Among them, W o is the weight matrix of multi-head attention, and E is the number of heads set.
[0040] Preferably, the Mamba module is specifically:
[0041] The formula for the Mamba module is:
[0042]
[0043] y t′ =M t′ h t′
[0044] Among them, x t′ represents the input of the Mamba module at the current time step; G t′ , B t′ 、M t′ , I represent parameter matrices of size D×N, B×L×N, B×L×N, and B×L×N, respectively; Δ represents a Laplacian matrix of size B×L×D; B represents the batch size, L represents the time step, and D represents x t′ Dimension, N represents the set dimension; Respectively represent G t′ , B t′ The result of discretization; h t′ 、h t′-1 represents the hidden state of the current time step in the Mamba model, y t′ Represents the output of the current time step; y t′ is a two-dimensional vector, each of which represents the predicted remaining life and health status of the lithium battery.
[0046] Preferably, the construction of the combined weighted loss function is specifically:
[0047] L C =αL SL1 +βL WMSE
[0048]
[0049] Among them, ω j represents the weight of the jth data in the training sample; y j Represents the true label of the jth data in the training sample; represents the predicted value of the jth data in the training sample; m represents the total number of data in the training sample; α and β represent two loss functions L respectively. SL1 and L WMSE The weight of , α+β=1.
[0050] Preferably, the weight ω of the jth data in the training sample is j , specifically:
[0051] The lithium battery is charged and discharged for a cycle. The lithium battery aging data collected after the cycle exceeds 800 is defined as late data, and the rest is early data. The importance of all early data and late data is set between 0 and 1 respectively. The importance of all early data is 0.4, and the importance of all late data is greater than or equal to 0.6. The greater the number of charge and discharge cycles, the greater the importance value. Normalizing all importances is the corresponding weight.
[0052] Preferably, the two loss functions L SL1 and L WMSE The weights α and β are as follows:
[0053] If the setting range of α is between 0.25 and 0.4, the setting range of β is between 0.6 and 0.75. The weights in the range are selected in turn with the set step size for prediction. The mean square error MSE, root mean square error RMSE, mean absolute error MAE, and determination coefficient R2 of the predicted remaining life and health status of the lithium battery are calculated. The evaluation index score formula for each weight is calculated as follows:
[0054]
[0055] Among them, f a represents the evaluation index score corresponding to the a-th weight; f φ,a1 、f φ,a2They are the φth indicators of the predicted remaining life and health status of lithium batteries, φ={1,2,3,4}; the indicators represented by φ from 1 to 4 are mean square error MSE, root mean square error RMSE, mean absolute error MAE, and determination coefficient R2;
[0056] Select the smallest f a The corresponding two loss functions L SL1 and L WMSE The weight is taken as the final weight.
[0057] The second aspect of the present invention proposes a lithium battery remaining life and health status prediction system based on LSTM+Mamba using the prediction method described in the first aspect of the present invention, including an acquisition module, a multi-layer neural network building module, a loss function building module, and a prediction module, specifically:
[0058] Acquisition module: used to charge and discharge lithium batteries, collect various lithium battery aging data during the cycle, and pre-process them;
[0059] Multi-layer neural network building module: used to build a multi-layer neural network, which consists of an LSTM layer, a multi-head attention mechanism and a Mamba module; use the LSTM layer to extract the time series features of lithium battery aging data; input the time series features into the multi-head attention layer, perform weighted processing on different features in the sequence, and fuse the features in the time series features that are strongly related to the remaining life and health status of the lithium battery; input the features that are strongly related to the remaining life and health status of the lithium battery into the Mamba module to predict the remaining life and health status of the lithium battery;
[0060] Loss function building module: used to build a combined weighted loss function to optimize weights for training multi-layer neural networks;
[0061] Prediction module: used to predict the remaining life and health status of lithium batteries using a trained multi-layer neural network.
[0062] The beneficial effect of the present invention is that, compared with the prior art, a hybrid network model combining LSTM layer, multi-head attention mechanism and Mamba module is designed; LSTM layer can capture the dynamic change pattern in the process of battery charging and discharging, and effectively capture the dynamic characteristics of lithium battery in the aging process; multiple attention heads dynamically pay attention to the input from different angles, weight the most critical information, highlight the features closely related to battery life and health status, filter out irrelevant noise, and significantly improve the prediction accuracy of battery health status and remaining life; Mamba module deeply extracts and enhances features through its unique selection mechanism and feature scanning, especially in dealing with nonlinear and complex features in the process of lithium battery degradation, significantly improving the prediction accuracy and generalization ability of the model; in addition, a weighted loss function of two loss functions is used in the training process. One loss function shows high robustness in dealing with outliers, while the other loss function gives higher weights to samples in the late stage of battery life cycle, ensuring that the model can better fit the feature changes in the late stage of degradation process so that the model maintains high performance in different scenarios. In summary, the present invention significantly improves the prediction accuracy of remaining life and health status in the face of the highly nonlinear situation of lithium battery degradation process. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 It is a flowchart of the lithium battery remaining life and health status prediction algorithm based on LSTM+Mamba in the method of the present invention;
[0064] Figure 2 It is a block diagram of the lithium battery remaining life and health status prediction algorithm based on LSTM+Mamba in the method of the present invention;
[0065] Figure 3 It is a schematic diagram of the structure of a multi-layer network model based on LSTM+Mamba in the method of the present invention;
[0066] Figure 4 It is a visualization result diagram of the remaining life RUL prediction of the lithium battery in the method of the present invention;
[0067] Figure 5 It is a visualization result diagram of the health status SOH prediction in the method of the present invention. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in this application are only embodiments of a part of the present invention, rather than all embodiments. Based on the spirit of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the protection scope of the present invention.
[0069] like Figure 1 and Figure 2 As shown, Embodiment 1 of the present invention proposes a method for predicting the remaining life and health status of a lithium battery based on LSTM+Mamba, including the following contents:
[0070] Perform charge and discharge cycles on lithium batteries, collect and calculate various lithium battery aging data during the cycle, and preprocess the data to form an input data set with the preprocessed lithium battery aging data;
[0071] Construct a multi-layer neural network, such as Figure 3 As shown in the figure, the neural network consists of an LSTM layer, a multi-head attention mechanism and a Mamba module; the input data set is input into the LSTM layer to extract the time series features of the lithium battery aging data; the time series features are input into the multi-head attention layer, and different features in the time series are weighted to fuse the features in the time series features that are strongly related to the remaining life and health status of the lithium battery; the features that are strongly related to the remaining life and health status of the lithium battery are input into the Mamba module to predict the remaining life and health status of the lithium battery;
[0072] A combined weighted loss function with optimized weights is constructed to train a multi-layer neural network; the multi-layer neural network is used to predict the remaining life and health status of lithium batteries.
[0073] Preferably, the preprocessing is to normalize each lithium battery aging data;
[0074] The i-th data z in the p-th lithium battery aging data pi The normalized formula is:
[0075]
[0076] Among them, x pi is the i-th data in the p-th lithium battery aging data, μ p is the mean value of the p-th lithium battery aging data, σ p is the standard deviation of the p-th lithium battery aging data.
[0077] Preferably, the use of the LSTM layer to extract the time series features of the lithium battery aging data is specifically as follows:
[0078] When the LSTM layer propagates forward, it passes through the forget gate, input gate, and output gate in sequence; the formula of the forget gate of the LSTM layer is:
[0079] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0080] Among them, W f represents the weight matrix of the forget gate; b f represents the bias of the forget gate; h t-1 represents the hidden state of the previous time step; σ represents the activation function of the forget gate; x t Represents the current time step input of the forget gate;
[0081] The formula for the input gate of the LSTM layer is:
[0082] i t =σ(W n ·[h t-1 ,x t ]+b n )
[0083]
[0084] Among them, i t is the output of the input gate; is the state of the candidate cell at the current time step; W n is the weight matrix of the input gate; b n is the bias of the input gate; W C is the weight matrix of candidate cell calculation; b C is the bias of candidate cell calculation;
[0085] The formula for the output gate of the LSTM layer is:
[0086] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0087] h t =o t *tanh(C t )
[0088] Among them, t is the output of the output gate at the current time step; h t represents the hidden state of the current time step; C t is the state of the cell at the current time step; Wo is the weight matrix of the output gate; b o is the bias of the output gate;
[0089] The formula for updating the LSTM cell state is:
[0090]
[0091] Among them, f t is the output of the forget gate; C t-1 is the cell state at the previous time step.
[0092] Preferably, the time series features are input into the multi-head attention layer, and different features in the sequence are weighted to fuse the features in the time series features that are strongly correlated with the remaining life and health status of the lithium battery, specifically:
[0093] The calculation formula for the attention score matrix based on each head is:
[0094] Q e =XW eq ,K e =XW ek ,V e =XW ev
[0095]
[0096] Head e =σ′(A e )V e
[0097] Among them, A e is the attention score matrix of the e-th head, σ′(·) is the activation function of the multi-head attention layer; Q e , K e 、V e are the query matrix, key matrix, and value matrix of the e-th head respectively; d eq Head is the vector dimension of the value vector of the e-th head; e is the output of the e-th head; W eq , W ek , W ev Q e , K e 、V e The weight matrix of ; X is the matrix composed of the time series features of the input multi-head attention layer;
[0098] The features that are strongly correlated with the remaining life and health status of the lithium battery in the fused time series features are specifically:
[0099] MH=Concat(Head1,…,Head E )W o
[0100] Among them, W o is the weight matrix of multi-head attention, and E is the number of heads set.
[0101] Preferably, the Mamba module is specifically:
[0102] The formula for the Mamba module is:
[0103]
[0104]
[0105] y t′ =M t′ h t′
[0106] Among them, x t′ represents the input of the Mamba module at the current time step; G t′ , B t′ 、M t′ , I represent parameter matrices of size D×N, B×L×N, B×L×N, and B×L×N, respectively; Δ represents a Laplacian matrix of size B×L×D; B represents the batch size, L represents the time step, and D represents x t′ Dimension, N represents the set dimension; Respectively represent G t′ , B t′ The result of discretization; h t′ 、h t′-1 represents the hidden state of the current time step in the Mamba model, y t′ Represents the output of the current time step; y t′ is a two-dimensional vector, each of which represents the predicted remaining life and health status of the lithium battery.
[0107] Preferably, the construction of the combined weighted loss function is specifically:
[0108] L C =αL SL1 +βL WMSE
[0109]
[0110] Among them, ω j represents the weight of the jth data in the training sample; y j Represents the true label of the jth data in the training sample; represents the predicted value of the jth data in the training sample; m represents the total number of data in the training sample; α and β represent two loss functions L respectively. SL1 and L WMSE The weight of , α+β=1.
[0111] Preferably, the weight ω of the jth data in the training sample is j , specifically:
[0112] The lithium battery is charged and discharged for a cycle. The lithium battery aging data collected after the cycle exceeds 800 is defined as late data, and the rest is early data. The importance of all early data and late data is set between 0 and 1 respectively. The importance of all early data is 0.4, and the importance of all late data is greater than or equal to 0.6. The greater the number of charge and discharge cycles, the greater the importance value. Normalizing all importances is the corresponding weight.
[0113] Preferably, the two loss functions L SL1 and L WMSE The weights α and β are as follows:
[0114] If the setting range of α is between 0.25 and 0.4, the setting range of β is between 0.6 and 0.75. The weights in the range are selected in turn with the set step size for prediction. The mean square error MSE, root mean square error RMSE, mean absolute error MAE, and determination coefficient R2 of the predicted remaining life and health status of the lithium battery are calculated. The evaluation index score formula for each weight is calculated as follows:
[0115]
[0116] Among them, f a represents the evaluation index score corresponding to the a-th weight; f φ,a1 、f φ,a2 They are the φth indicators of the predicted remaining life and health status of lithium batteries, φ={1,2,3,4}; the indicators represented by φ from 1 to 4 are mean square error MSE, root mean square error RMSE, mean absolute error MAE, and determination coefficient R2;
[0117] Select the smallest f a The corresponding two loss functions L SL1 and L WMSE The weight is taken as the final weight.
[0118] Specifically, the step size of the present invention is selected as 0.05, that is, four weights of α of 0.25, 0.3, 0.35, and 0.4 are used for prediction; the predicted remaining life of the lithium battery is as follows: Figure 4 and Table 1; the predicted health status is as follows Figure 5 And as shown in Table 2.
[0119] Table 1 Experimental results for predicting the remaining life (RUL) of lithium batteries
[0120]
[0121] Table 2 Experimental results for predicting the health status SOH of lithium batteries
[0122]
[0123] The calculated f1, f2, f3, and f4 are 2.0039.9, 1.50019, 1.926508, and 1.579409 respectively; therefore, α is selected as 0.3 and β is selected as 0.7;
[0124] It can be seen that the model can well reflect the overall trend of RUL and SOH.
[0125] Embodiment 2 of the present invention proposes a lithium battery remaining life and health status prediction system based on LSTM+Mamba using the prediction method described in Embodiment 1 of the present invention, including an acquisition module, a multi-layer neural network construction module, a loss function construction module, and a prediction module, specifically:
[0126] Acquisition module: used to charge and discharge lithium batteries, collect various lithium battery aging data during the cycle, and pre-process them;
[0127] Multi-layer neural network building module: used to build a multi-layer neural network, which consists of an LSTM layer, a multi-head attention mechanism and a Mamba module; use the LSTM layer to extract the time series features of lithium battery aging data; input the time series features into the multi-head attention layer, perform weighted processing on different features in the sequence, and fuse the features in the time series features that are strongly related to the remaining life and health status of the lithium battery; input the features that are strongly related to the remaining life and health status of the lithium battery into the Mamba module to predict the remaining life and health status of the lithium battery;
[0128] Loss function building module: used to build a combined weighted loss function to optimize weights for training multi-layer neural networks;
[0129] Prediction module: used to predict the remaining life and health status of lithium batteries using a trained multi-layer neural network.
[0130] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0131] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0132] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0133] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for predicting the remaining life and health status of lithium batteries based on LSTM+Mamba, characterized in that: Includes the following: Perform charge and discharge cycles on lithium batteries, collect and calculate various lithium battery aging data during the cycle, and preprocess the data to form an input data set with the preprocessed lithium battery aging data; Construct a multi-layer neural network consisting of an LSTM layer, a multi-head attention mechanism, and a Mamba module; input the input data set into the LSTM layer to extract the time series features of the lithium battery aging data; input the time series features into the multi-head attention layer, perform weighted processing on different features in the time series, and fuse the features in the time series features that are strongly related to the remaining life and health status of the lithium battery; input the features that are strongly related to the remaining life and health status of the lithium battery into the Mamba module to predict the remaining life and health status of the lithium battery; A combined weighted loss function with optimized weights is constructed to train a multi-layer neural network; the multi-layer neural network is used to predict the remaining life and health status of lithium batteries.
2. According to claim 1, a method for predicting the remaining life and health status of a lithium battery based on LSTM+Mamba is characterized in that: The lithium battery aging data specifically collects the instantaneous values of voltage, current and temperature of the lithium battery during the charge and discharge cycle, and calculates the average value, maximum value, minimum value and standard deviation of the voltage, current and temperature in a set unit time.
3. According to claim 2, a method for predicting the remaining life and health status of a lithium battery based on LSTM+Mamba is characterized in that: The preprocessing is to normalize each lithium battery aging data; The i-th data z in the p-th lithium battery aging data pi The normalized formula is: Among them, x pi is the i-th data in the p-th lithium battery aging data, μ p is the mean value of the p-th lithium battery aging data, σ p is the standard deviation of the p-th lithium battery aging data.
4. According to claim 1, a method for predicting the remaining life and health status of a lithium battery based on LSTM+Mamba is characterized in that: The time series features of lithium battery aging data are extracted using the LSTM layer, specifically: When the LSTM layer propagates forward, it passes through the forget gate, input gate, and output gate in sequence; the formula of the forget gate of the LSTM layer is: f t =σ(W f ·[h t-1 ,x t ]+b f ) Among them, W f represents the weight matrix of the forget gate; b f represents the bias of the forget gate; h t-1 represents the hidden state of the previous time step; σ represents the activation function of the forget gate; x t Indicates the current time step input of the forget gate; when t is 1, x t represents the input data set; The formula for the input gate of the LSTM layer is: i t =σ(W n ·[h t-1 ,x t ]+b n ) Among them, i t is the output of the input gate; is the state of the candidate cell at the current time step; W n is the weight matrix of the input gate; b n is the bias of the input gate; W C is the weight matrix of candidate cell calculation; b C is the bias of candidate cell calculation; The formula for the output gate of the LSTM layer is: the t =σ(W o ·[h t-1 ,x t ]+b o ) h t =o t *tanh(C t ) Among them, t is the output of the output gate at the current time step; h t represents the hidden state of the current time step; C t is the state of the cell at the current time step; W o is the weight matrix of the output gate; b o is the bias of the output gate; The formula for updating the LSTM cell state is: Among them, f t is the output of the forget gate; C t-1 is the cell state at the previous time step.
5. According to claim 1, a method for predicting the remaining life and health status of a lithium battery based on LSTM+Mamba is characterized in that: The time series features are input into the multi-head attention layer, and different features in the sequence are weighted to fuse the features in the time series features that are strongly related to the remaining life and health status of the lithium battery, specifically: The calculation formula for the attention score matrix based on each head is: Q e =XW eq ,K e =XW ek ,V e =XW ev Head e =σ′(A e )V e Among them, A e is the attention score matrix of the e-th head, σ′(·) is the activation function of the multi-head attention layer; Q e , K e 、V e are the query matrix, key matrix, and value matrix of the e-th head respectively; d eq Head is the vector dimension of the value vector of the e-th head; e is the output of the e-th head; W eq , W ek , W ev Q e , K e 、V e The weight matrix of ; X is the matrix composed of the time series features of the input multi-head attention layer; The features that are strongly correlated with the remaining life and health status of the lithium battery in the fused time series features are specifically: MH=Concat(Head1,…,Head E )W o Among them, W o is the weight matrix of multi-head attention, and E is the number of heads set.
6. According to claim 1, a method for predicting the remaining life and health status of a lithium battery based on LSTM+Mamba is characterized in that: The Mamba module is specifically: The formula for the Mamba module is: y t′ =M t′ h t′ Among them, x t′ represents the input of the Mamba module at the current time step; G t′ , B t′ 、M t′ , I represent parameter matrices of sizes D×N, B×L×N, B×L×N, and B×L×N, respectively; Δ represents a Laplacian matrix of size B×L×D; B represents the batch size, L represents the time step, and D represents x t′ Dimension, N represents the set dimension; Respectively represent G t′ , B t′ The result of discretization; h t′ 、h t′-1 represents the hidden state of the current time step in the Mamba model, y t′ Represents the output of the current time step, y t′ is a two-dimensional vector, each of which represents the predicted remaining life and health status of the lithium battery.
7. The method for predicting the remaining life and health status of a lithium battery based on LSTM+Mamba according to claim 1, characterized in that: The construction of the combined weighted loss function is specifically: L C =αL SL1 +βL WMSE Among them, ω j represents the weight of the jth data in the training sample; y j Represents the true label of the jth data in the training sample; represents the predicted value of the jth data in the training sample; m represents the total number of data in the training sample; α and β represent two loss functions L respectively. SL1 and L WMSE The weight of , α+β=1.
8. The method for predicting the remaining life and health status of a lithium battery based on LSTM+Mamba according to claim 7 is characterized in that: The weight ω of the jth data in the training sample j , specifically: The lithium battery is charged and discharged for a cycle. The lithium battery aging data collected after the cycle exceeds 800 is defined as late data, and the rest is early data. The importance of all early data and late data is set between 0 and 1 respectively. The importance of all early data is 0.4, and the importance of all late data is greater than or equal to 0.
6. The greater the number of charge and discharge cycles, the greater the importance value. Normalizing all importances is the corresponding weight.
9. The method for predicting the remaining life and health status of a lithium battery based on LSTM+Mamba according to claim 6, characterized in that: The two loss functions L SL1 and L WMSE The weights α and β are as follows: If the setting range of α is between 0.25 and 0.4, the setting range of β is between 0.6 and 0.
75. The weights in the range are selected in turn with the set step size for prediction. The mean square error MSE, root mean square error RMSE, mean absolute error MAE, and determination coefficient R2 of the predicted remaining life and health status of the lithium battery are calculated. The evaluation index score formula for each weight is calculated as follows: Among them, f a represents the evaluation index score corresponding to the a-th weight; f φ,a1 、f φ,a2 They are the φth indicators of the predicted remaining life and health status of lithium batteries, φ={1,2,3,4}; the indicators represented by φ from 1 to 4 are mean square error MSE, root mean square error RMSE, mean absolute error MAE, and determination coefficient R2; Select the smallest f a The corresponding two loss functions L SL1 and L WMSE The weight is taken as the final weight.
10. A lithium battery remaining life and health status prediction system based on LSTM+Mamba using the prediction method according to any one of claims 1 to 9, comprising an acquisition module, a multi-layer neural network building module, a loss function building module, and a prediction module, characterized in that: Acquisition module: used to charge and discharge lithium batteries, collect and calculate various lithium battery aging data during the cycle process, and pre-process them; Multi-layer neural network building module: used to build a multi-layer neural network, which consists of an LSTM layer, a multi-head attention mechanism and a Mamba module; use the LSTM layer to extract the time series features of lithium battery aging data; input the time series features into the multi-head attention layer, perform weighted processing on different features in the sequence, and fuse the features in the time series features that are strongly related to the remaining life and health status of the lithium battery; input the features that are strongly related to the remaining life and health status of the lithium battery into the Mamba module to predict the remaining life and health status of the lithium battery; Loss function building module: used to build a combined weighted loss function to optimize weights for training multi-layer neural networks; Prediction module: used to predict the remaining life and health status of lithium batteries using a trained multi-layer neural network.
Citation Information
Cited By
Method and system for predicting residual service life of engine based on space-time state selection
CN120372297A
Battery state prediction method and device, electronic equipment and storage medium
CN120761863A
Method for predicting residual service life of lithium ion battery of spacecraft based on Mamba diffusion model
CN120802102A
Multi-source parameter fusion battery system intelligent grading early warning method and device
CN121008175A
Method and system for predicting service life of stainless steel pipe
CN121031391A