Lithium ion battery health state estimation method, system, equipment and medium
By combining the LSTM-Transformer hybrid model with specific health characteristic indicators, the dynamic adaptability and accuracy of lithium-ion battery health status estimation under complex operating conditions are solved, realizing high-precision battery degradation monitoring and life management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-29
- Publication Date
- 2026-04-03
AI Technical Summary
Existing methods for estimating the state of health of lithium-ion batteries are insufficient in terms of dynamic adaptability and accuracy, making it difficult to accurately identify battery degradation modes under different operating conditions. In particular, the estimation accuracy is limited when temperature and charge/discharge rate change.
A hybrid LSTM-Transformer model is adopted, which combines two health feature indicators: constant current charging time and discharge amount within a specified voltage range. Input sequence samples are constructed using a sliding window method, and global dependency modeling and temporal dynamic capture are performed using a multi-head self-attention mechanism and LSTM layers to generate high-precision health state estimates.
It achieves high-precision and robust state of health estimation for lithium-ion batteries, accurately capturing short-term fluctuations and long-term trends in battery degradation under complex operating conditions, thus improving the accuracy and generalization ability of SOH estimation.
Smart Images

Figure CN121784564A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of battery management systems and artificial intelligence technology, specifically to a method, system, device, and medium for estimating the health status of a lithium-ion battery. Background Technology
[0002] State of health (SOH) estimation of lithium-ion batteries is a core technology for achieving safe and efficient operation of battery management systems (BMS). Currently, the technical solutions in this field are mainly divided into model-based methods and data-driven methods.
[0003] Model-based methods describe the internal reaction processes of batteries using equivalent circuit models or electrochemical models. However, they rely on complex battery material parameters and reaction kinetic equations for parameter identification, and the experimental calibration process is cumbersome and easily affected by environmental factors. At the same time, these methods have poor dynamic adaptability and are difficult to respond quickly to performance fluctuations caused by changes in temperature and charge / discharge rate, which poses a challenge to the estimation accuracy under actual working conditions.
[0004] Existing State of Health (SOH) estimation methods generally rely on time-domain or capacity-based indicators that are susceptible to operating conditions, making it difficult to simultaneously characterize both local dynamic changes and long-term degradation patterns during battery degradation. This results in insufficient ability of models to identify degradation patterns under different rates, temperature fluctuations, or non-standard charge-discharge conditions, limiting estimation accuracy. Traditional health indicators such as total charge-discharge time and terminal voltage characteristics are often strongly influenced by rate, temperature, and operating protocols; their changes are not entirely driven by battery aging, making it difficult for models to learn stable degradation information. In application scenarios with significant variations in actual operating conditions, the transferability and generalization ability of these indicators are poor. Summary of the Invention
[0005] The purpose of this invention is to provide a method, system, device, and medium for estimating the state of health (SOH) of lithium-ion batteries. This method achieves high-precision, robust, and cross-dataset and cross-battery generalization capabilities for SOH estimation of lithium-ion batteries, meeting the needs of real-time monitoring, lifespan management, and safety control of battery health in scenarios such as new energy vehicles and grid energy storage systems.
[0006] To achieve the above objectives, embodiments of the present invention provide a method for estimating the health status of a lithium-ion battery, comprising: Obtain raw charge-discharge cycle data of lithium-ion batteries and preprocess them to obtain time-series data; Based on the electrochemical mechanism of lithium-ion battery charging and discharging process, two types of health characteristic indicators are extracted from the time series data to characterize the aging state of lithium-ion batteries. Two types of health characteristic indicators are constructed into a feature sequence in chronological order, and input sequence samples and their corresponding health status label samples are constructed based on the sliding window method; The input sequence samples are input into a pre-trained battery health state estimation model, which outputs a health state estimate; wherein, the battery health state estimation model is an LSTM-Transformer neural network hybrid model.
[0007] Optionally, the two types of health characteristic indicators include constant current charging time and discharge amount within a specified voltage range; wherein, the constant current charging time is the time required for the voltage of the lithium-ion battery to rise from the initial value to the cutoff voltage during the constant current charging stage; and the discharge amount within the specified voltage range is the amount of electricity released by the battery within a preset voltage window during the discharge stage.
[0008] Optionally, the constant current charging time can be calculated using the following formula: ; In the formula, This indicates the time corresponding to the cutoff voltage during the constant current charging phase of a lithium-ion battery. This indicates the time corresponding to the initial voltage during the constant current charging phase of a lithium-ion battery. Calculate the discharge amount within a specified voltage range using the following formula:
[0009] In the formula, This represents the discharge current of the lithium-ion battery in the voltage range of 3.8V to 3.4V at time t.
[0010] Optionally, the two types of health characteristic indicators are constructed into a feature sequence in chronological order, and input sequence samples and their corresponding health status label samples are constructed based on the sliding window method, including: For each lithium-ion battery charge-discharge cycle, a feature vector sequence containing the aforementioned health characteristic indicators is generated; Arrange all the eigenvectors of the loops in chronological order to form a feature matrix; The feature matrix is truncated using a sliding window of a preset window length. The sequence of feature vectors that are continuously looped within each window is taken as an input sequence sample, and the health status value corresponding to the loop at the next time step of the window is taken as the estimated target label of the sample.
[0011] Optionally, the battery health state estimation model includes: a Transformer encoder, an LSTM layer, a Transformer decoder, and a fully connected regression layer; wherein, The Transformer encoder is used to model the global dependency relationship of the input sequence samples and extract global degradation features by employing a multi-head self-attention mechanism. The LSTM layer, located after the multi-head self-attention mechanism of the Transformer encoder and Transformer decoder, is used to further filter, memorize and combine the global features extracted by the multi-head self-attention mechanism in the time dimension. Through its gating mechanism, it captures short-term dynamic changes and local temporal features in the battery degradation process and generates a hidden state sequence containing local dynamic information. The Transformer decoder is used to combine with the hidden state sequence output by the LSTM layer to extract higher-level representations; The fully connected regression layer is used to map the output of the Transformer decoder to a health state estimate.
[0012] Optionally, the Transformer encoder specifically includes: an input embedding layer, a position encoding layer, a multi-head self-attention mechanism layer, an LSTM layer, a first residual connection and normalization layer, a feedforward neural network layer, and a second residual connection and normalization layer; wherein, the input embedding layer is used to convert the input battery health indicator sequence into a dense vector representation, the position encoding layer is used to add position information to each position in the sequence, the multi-head self-attention mechanism layer is used to compute multiple attention heads in parallel to mine the global dependencies and long-term degradation patterns between features at different time steps from the entire input sequence, the first residual connection and normalization layer is used to perform residual connection and layer normalization on the output of the LSTM layer again, the feedforward neural network layer is used to perform nonlinear transformation on the features at each time step to increase the expressive power of the model, and the second residual connection and normalization layer is used to perform residual connection and layer normalization again; The Transformer decoder specifically includes: an output embedding layer, a position encoding layer, a first multi-head self-attention mechanism layer, a first LSTM layer, a first residual connection and normalization layer, a second multi-head self-attention mechanism layer, a second LSTM layer, a second residual connection and normalization layer, a feedforward neural network layer, a third residual connection and normalization layer, and a feature flattening and projection layer; wherein, the output embedding layer is used to convert the target sequence or generated sequence into a vector representation; the first multi-head self-attention mechanism layer is used to perform mask self-attention calculation on the target sequence or generated sequence portion; the first LSTM layer is used to receive the feature sequence processed by the first multi-head self-attention mechanism layer, and utilize... The LSTM gating mechanism is used to smooth, memorize, and filter the extracted internal patterns of the sequence; the second multi-head self-attention mechanism layer is used to perform encoder-decoder attention, using the current decoder state as the query and the integer historical sequence features output by the encoder as the key and value for attention calculation; the second LSTM layer is used to perform temporal dynamic modeling again on the information output by the second multi-head self-attention mechanism layer, which has been fused with global context, to generate the hidden state sequence; the feature flattening and projection layer is used to map the high-dimensional feature tensor output by the third residual connection and normalization layer to the target dimension through linear transformation and project it as the SOH value estimated at that time step.
[0013] Optionally, the training process of the battery health state estimation model is as follows: The input sequence samples are fed into the Transformer encoder of the LSTM-Transformer neural network hybrid model, and global features are calculated through a multi-head self-attention mechanism. The global features are then fed into the LSTM layer for temporal dynamic modeling and output a hidden state sequence containing short-term degradation information. The hidden state sequence is then fed into the Transformer decoder for feature integration and transformation. The output of the Transformer decoder is passed to the fully connected regression layer to generate a health state estimate. The mean squared error loss function is used to calculate the error between the health status estimate output by the LSTM-Transformer neural network hybrid model and the corresponding true health status label. Using the Adam optimizer, the gradients of the parameters of each layer of the LSTM-Transformer neural network hybrid model are calculated based on the error using the backpropagation algorithm, and the parameters of the Transformer encoder, LSTM layer, Transformer decoder and fully connected regression layer are iteratively updated to minimize the loss function. Repeat the above steps until the performance of the LSTM-Transformer neural network hybrid model converges on the validation set or reaches the preset number of training rounds, thereby obtaining a trained battery health state estimation model.
[0014] In a second aspect, the present invention also provides a health status estimation system for lithium-ion batteries, comprising: The data acquisition module is used to acquire raw data of the charge and discharge cycles of lithium-ion batteries and preprocess it to obtain time-series data. The feature extraction module is used to extract two types of health feature indicators from the time series data based on the electrochemical mechanism of the lithium-ion battery charging and discharging process, which are used to characterize the aging state of the lithium-ion battery. The feature sequence construction module is used to construct two types of health feature indicators into feature sequences in chronological order, and to construct input sequence samples and their corresponding health status label samples based on the sliding window method. The state estimation module is used to input the input sequence samples into a pre-trained battery health state estimation model and output a health state estimate; wherein, the battery health state estimation model is an LSTM-Transformer neural network hybrid model.
[0015] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described lithium-ion battery health state estimation method.
[0016] Fourthly, the present invention also provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described method for estimating the health status of a lithium-ion battery.
[0017] The above technical solution, based on the LSTM-Transformer hybrid model, combines two health indicators: constant current charging time and discharge amount in the 3.8–3.4 V discharge range. It successfully captures the short-term fluctuations and long-term trends in the battery degradation process. Compared with traditional deep learning methods based on the original capacity sequence, the proposed health features are more stable and have stronger physical interpretability. They can effectively reduce the interference of non-stationarity and noise disturbances on the model, making it easier for the model to learn the true law of battery degradation, and significantly improving the SOH estimation accuracy.
[0018] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0019] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a method for estimating the health status of a lithium-ion battery according to an embodiment of the present invention; Figure 2 This is an architecture diagram of an LSTM-Transformer hybrid model provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a lithium-ion battery health status estimation system provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0020] Various embodiments of this disclosure will be described more fully in the following detailed description. This disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of this disclosure to the specific embodiments disclosed herein, but rather this disclosure should be understood to cover all adjustments, equivalents, and / or alternatives falling within the spirit and scope of the various embodiments of this disclosure.
[0021] In the following, the terms “comprising” or “may include”, which may be used in various embodiments of this disclosure, indicate the presence of the disclosed functions or operations and do not limit the addition of one or more functions or operations. Furthermore, as used in various embodiments of this disclosure, the terms “comprising,” “having,” and their cognates are intended only to indicate a specific feature, number, step, operation, or combination of the foregoing and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, or combinations of the foregoing, or the possibility of adding one or more features, numbers, steps, operations, or combinations of the foregoing.
[0022] In various embodiments of this disclosure, the expression "or" or "at least one of A and / or B" includes any combination or all combinations of the words listed simultaneously. For example, the expression "A or B" or "at least one of A and / or B" may include A, may include B, or may include both A and B.
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] See Figure 1 The diagram shows a flowchart of a lithium-ion battery health status estimation method in a specific embodiment, including the following execution steps: Step 100: Obtain the raw charge-discharge cycle data of the lithium-ion battery and preprocess it to obtain time-series data.
[0025] Specifically, the battery datasets used include, but are not limited to, those from NASA and CALCE. These datasets contain information such as battery charging and discharging current, voltage, and capacity, recording the battery degradation process under various operating conditions. The datasets include charging and discharging current (mA), voltage (V), capacity (Ah), and time (h:min:s.ms) for each battery. For ease of processing, the data is labeled and organized according to the number of cycles. Outliers are removed: negative capacity, duplicate records, and unreasonable voltage values are deleted from the battery data.
[0026] Data preprocessing ensures the robustness of subsequent health indicator calculations, enabling the model to receive data inputs with a uniform structure and free from abnormal interference.
[0027] Step 101: Based on the electrochemical mechanism of the lithium-ion battery charging and discharging process, extract two types of health characteristic indicators from the time series data to characterize the aging state of the lithium-ion battery.
[0028] Specifically, the two types of health characteristic indicators include constant current charging time and discharge amount within a specified voltage range; wherein, the constant current charging time is the time required for the voltage of the lithium-ion battery to rise from the initial value to the cutoff voltage during the constant current charging stage; and the discharge amount within the specified voltage range is the amount of electricity released by the battery within a preset voltage window during the discharge stage.
[0029] During the constant current charging phase, the time required for the voltage to rise from the initial value to the cutoff voltage is recorded to stably reflect the charging polarization growth trend, demonstrating strong noise immunity. During the discharging phase, a voltage range of 3.8–3.4 V is selected, and the current-time curve is integrated to directly characterize the reversible capacity decay trend, showing insensitivity to rate and temperature changes.
[0030] More specifically, the constant current charging time is calculated using the following formula: ; In the formula, This indicates the time corresponding to the cutoff voltage during the constant current charging phase of a lithium-ion battery. This indicates the time corresponding to the initial voltage during the constant current charging phase of a lithium-ion battery. Calculate the discharge amount within a specified voltage range using the following formula: ; In the formula, This represents the discharge current of the lithium-ion battery in the voltage range of 3.8V to 3.4V at time t.
[0031] Step 102: Construct a feature sequence from the two types of health characteristic indicators in chronological order, and construct input sequence samples and their corresponding health status label samples based on the sliding window method.
[0032] Specifically, when executing step 102, the following steps can be performed: S1020: For each lithium-ion battery charge-discharge cycle, generate a feature vector sequence containing the health characteristic indicators.
[0033] For example, a health metric vector is generated for each loop: .
[0034] S1021: Arrange all the eigenvectors of the cycle in chronological order to form the feature matrix.
[0035] For example, the feature matrix is as follows:
[0036] S1022: The feature matrix is truncated using a sliding window of a preset window length. The sequence of multiple consecutive cyclic feature vectors within each window is taken as an input sequence sample, and the health status value corresponding to the cycle at the next time step of the window is taken as the estimated target label of the sample.
[0037] Specifically, let the window length be... =5, then the first Each training sample contains: Input sequence: using data points from the first 5 cycles as the input sequence:
[0038] According to nominal capacity Calculate the SOH for each cycle: .
[0039] Each cycle corresponds to a [CCCT, ΔQ] vector. The input sequence consists of the data from the first 5 cycles, and the SOH value of the 6th cycle is used as the estimation target.
[0040] Step 103: Input the input sequence sample into the pre-trained battery health status estimation model and output the health status estimate.
[0041] The battery health state estimation model is an LSTM-Transformer neural network hybrid model.
[0042] In one specific embodiment, the battery health state estimation model includes: a Transformer encoder, an LSTM layer, a Transformer decoder, and a fully connected regression layer. The Transformer encoder employs a multi-head self-attention mechanism to model global dependencies in the input sequence samples and extract global degradation features. The LSTM layer, positioned after the multi-head self-attention mechanism of the Transformer encoder and decoder, further filters, memorizes, and combines the global features extracted by the multi-head self-attention mechanism in the temporal dimension. Through its gating mechanism, it captures short-term dynamic changes and local temporal features during battery degradation and generates a hidden state sequence containing local dynamic information. The Transformer decoder combines with the hidden state sequence output by the LSTM layer to extract a higher-level representation. The fully connected regression layer maps the output of the Transformer decoder to a health state estimate.
[0043] Specifically, the Transformer encoder includes: an input embedding layer, a position encoding layer, a multi-head self-attention mechanism layer, an LSTM layer, a first residual connection and normalization layer, a feedforward neural network layer, and a second residual connection and normalization layer. The input embedding layer converts the input battery health indicator sequence into a dense vector representation. The position encoding layer adds positional information to each position in the sequence. The multi-head self-attention mechanism layer computes multiple attention heads in parallel to mine global dependencies and long-term degradation patterns between features at different time steps from the entire input sequence. The first residual connection and normalization layer performs residual connection and layer normalization again on the output of the LSTM layer. The feedforward neural network layer performs nonlinear transformations on the features at each time step to increase the model's expressive power. The second residual connection and normalization layer performs residual connection and layer normalization again. The Transformer decoder specifically includes: an output embedding layer, a position encoding layer, a first multi-head self-attention mechanism layer, a first LSTM layer, a first residual connection and normalization layer, a second multi-head self-attention mechanism layer, a second LSTM layer, a second residual connection and normalization layer, a feedforward neural network layer, a third residual connection and normalization layer, and a feature flattening and projection layer; wherein, the output embedding layer is used to convert the target sequence or generated sequence into a vector representation; the first multi-head self-attention mechanism layer is used to perform mask self-attention calculation on the target sequence or generated sequence portion; the first LSTM layer is used to receive the feature sequence processed by the first multi-head self-attention mechanism layer, and utilize... The LSTM gating mechanism is used to smooth, memorize, and filter the extracted internal patterns of the sequence; the second multi-head self-attention mechanism layer is used to perform encoder-decoder attention, using the current decoder state as the query and the integer historical sequence features output by the encoder as the key and value for attention calculation; the second LSTM layer is used to perform temporal dynamic modeling again on the information output by the second multi-head self-attention mechanism layer, which has been fused with global context, to generate the hidden state sequence; the feature flattening and projection layer is used to map the high-dimensional feature tensor output by the third residual connection and normalization layer to the target dimension through linear transformation and project it as the SOH value estimated at that time step.
[0044] The model proposed in this invention adopts a fusion structure of LSTM and Transformer, combining the advantages of both to achieve unified modeling of local dynamics and global degradation trends.
[0045] Transformer Encoder (Capturing Global Degradation Dependencies): Function: To learn long-term degradation trends, the intrinsic structural relationships between aging patterns, and global dependencies across cycles through a multi-head self-attention mechanism. Processing: In the Transformer encoder, the input feature sequence undergoes global feature extraction through a multi-head self-attention layer. Features at each time step interact with features from other time steps to learn the global trend of the battery throughout the degradation process.
[0046] LSTM Layer (Capturing Local Temporal Dynamics): Role: The LSTM layer is inserted after the multi-head self-attention mechanism within the Transformer encoder and decoder to enhance the model's ability to model short-term dynamic changes in battery degradation. The multi-head self-attention mechanism extracts global dependencies across cycles, and the LSTM then models these attention outputs temporally, thereby better identifying fine-grained dynamic features such as short-term changes in CCCT and local fluctuations in ΔQ. The LSTM's gating mechanism allows the model to retain or forget information at different time scales when processing sequential signals, thus supplementing the Transformer's shortcomings in short-term dynamic modeling. Processing: The output of the Transformer's multi-head self-attention mechanism layer serves as the input to the LSTM. The LSTM further filters, memorizes, and combines the global features extracted by the multi-head self-attention mechanism in the temporal dimension, generating a hidden state sequence containing local dynamic information. This hidden state is then passed to the Transformer decoder to generate SOH estimates that better reflect actual degradation patterns.
[0047] Transformer Decoder (Generates Final SOH Representation): Function: The Transformer decoder receives the output features from the LSTM layers and further transforms these features, which already contain information about global dependencies and local temporal dynamics, making them more suitable for the final SOH estimation. Processing: The LSTM layers have already performed temporal modeling on the global features extracted by the multi-head self-attention mechanism and captured short-term degradation changes. The Transformer decoder further encodes the sequence features, extracting higher-level representations, and passes them to the regression layer to generate the final SOH estimate.
[0048] Fully connected regression layer: Function: To convert the output of the Transformer decoder into a SOH estimate. Processing: The fully connected layer maps the decoder output to the SOH estimation space and outputs the final estimate.
[0049] The encoder and decoder are composed of multiple cascaded Attention-LSTM base units, meaning that features undergo multiple cycles of "global analysis → local optimization." Shallow fusion units may capture obvious trends and fluctuations, while deep fusion units can discover more complex cross-scale patterns in a more abstract feature space. This achieves layer-by-layer alignment and refinement of features, ensuring that the features used for regression are saturated with both long-term dependencies and short-term dynamic information. This LSTM-Transformer hybrid architecture enables the model to maintain stable performance under various operating conditions while significantly improving SOH estimation accuracy and generalization ability. The Transformer captures global degradation patterns and long-term trends, while the LSTM is responsible for supplementing short-term dynamic changes; the final combination enhances the model's understanding of complex battery degradation processes.
[0050] In one specific embodiment, the training process of the battery health state estimation model includes the following steps: S1: Input the input sequence samples into the Transformer encoder of the LSTM-Transformer neural network hybrid model, and calculate global features through a multi-head self-attention mechanism; the global features are then input into the LSTM layer to perform temporal dynamic modeling and output a hidden state sequence containing short-term degradation information; the hidden state sequence is then input into the Transformer decoder for feature integration and transformation; the output of the Transformer decoder is passed to the fully connected regression layer to generate a health state estimate.
[0051] For example, the input format is a [CCCT, ΔQ] vector corresponding to each cycle. The input sequence consists of the data from the first 5 cycles, with the SOH value of the 6th cycle serving as the estimation target.
[0052] S2: Using the mean squared error loss function, calculate the error between the health status estimate output by the LSTM-Transformer neural network hybrid model and the corresponding true health status label.
[0053] S3: Using the Adam optimizer, based on the error, calculate the gradient of the parameters of each layer of the LSTM-Transformer neural network hybrid model through the backpropagation algorithm, and iteratively update the parameters of the Transformer encoder, LSTM layer, Transformer decoder and fully connected regression layer to minimize the loss function.
[0054] S4: Repeat the above steps until the performance of the LSTM-Transformer neural network hybrid model converges on the validation set or reaches the preset number of training rounds, thereby obtaining a trained battery health state estimation model.
[0055] For example, the model is trained using a batch size of 16, 900 training epochs, and a learning rate of 0.001.
[0056] In one specific implementation, when performing step 103, the following process may be specifically executed: (See attached document) Figure 2 As shown, the left side represents the encoder, and the right side represents the decoder, working together to map the input sequence to the output sequence. "Create dataset" refers to constructing sequence samples for training or estimation from the raw battery data; that is, the input sequence, such as health indicators from the past N cycles, and the output sequence, such as the corresponding SOH value. The encoding process: The input sequence is converted into a dense vector representation through the Input Embedding layer, and then enters the encoder, which consists of multiple stacked identical layers. The core of the encoder is a combination module of Multi-Head Attention + LSTM, rather than the traditional Multi-Head Attention + FFN. Furthermore, FFN is a position-wise feedforward network. It performs identical and independent fully connected transformations and non-linear activations on the feature vectors at each time step in the sequence; FFN lacks temporal modeling capabilities. Replacing FFN with LSTM transforms the further transformation of the Attention output features into a context-sensitive intelligent process with temporal memory. LSTM can determine how to "understand" and "transform" the global features at the current moment based on past degradation patterns. After receiving the global features highlighted by Attention, the LSTM's input gate can decide to store a large amount of this abnormal fluctuation information into the cell state, while the forget gate decides to retain this information for multiple time steps. In this way, this crucial short-term warning signal is strengthened and propagated, directly affecting subsequent SOH estimation. Conversely, FFN will transform this outlier, but it cannot actively decide to "remember it" and continue to use it in subsequent steps; the signal may be smoothed or diluted.
[0057] Decoding process: After the output sequence is embedded in the output, it enters the decoder. The decoder also consists of multiple stacked layers, each containing two core modules: the first is a Masked Multi-Head Attention layer, which focuses on the generated output; the second is another Multi-Head Attention layer, which focuses on the encoder's output. The final output of the decoder is then processed by linear layers to generate the final estimation result. A cascaded structure of Multi-Head Attention and LSTM replaces the original Multi-Head Attention and Feed Forward Network (FFN) in the Transformer. In cascading, FFN lacks a memory mechanism and cannot actively retain or utilize historical information from generated sequences (although the attention mechanism provides cross-step interaction, FFN itself does not save state). The decoder LSTM receives features processed by two attention sub-layers (masked self-attention and encoder-decoder attention), which have fused the context of historical output sequences and global information from the encoder. LSTM further processes these features temporally, capturing subtle local change patterns in the output sequence. For example, in the later stages of battery degradation, capacity decay may accelerate; LSTM can learn this local acceleration pattern and accurately reflect it when generating estimates for the corresponding time steps. Although multi-head self-attention mechanisms can handle long-range dependencies, in actual generation, as sequences become longer, attention may focus more on recent information and ignore key decisions made in earlier generation. LSTM's cell state provides a supplementary memory mechanism, preserving important information from earlier generation steps (such as the determination of degradation stages) in a compressed form and continuously influencing subsequent generation throughout the entire generation process.
[0058] Both the encoder and decoder employ a cascaded "Attention + LSTM" approach, forming a fully temporally-aware Seq2Seq model. The encoder (LSTM) performs temporal filtering and memorization while understanding the input historical sequence, outputting a feature representation rich in global context and refined temporally. The decoder (LSTM) performs temporal coherence constraints and local dynamic generation when generating future sequences, outputting a smooth estimated sequence that conforms to degradation patterns. Through an encoder-decoder attention connection, they achieve deep collaboration between global degradation patterns and local dynamic generation.
[0059] In the Add & Norm residual connections (Add) and normalization (Norm) layers of the encoder and decoder, the output of each sub-layer is residually connected to the input, and then layer normalization is performed. This helps alleviate the gradient vanishing problem in deep networks and stabilizes training. Multi-Head Attention: The core of the Transformer, used to capture global dependencies within a sequence. Its role in the encoder: Analyzing the health indicator sequence of the input, allowing the model to focus on the correlations between different cycles, such as discovering early small voltage plateau changes and long-term patterns of capacity decay. Its role in the decoder: The first attention layer implements autoregression, ensuring that estimation only considers information from the current position and previous points; the second attention layer focuses the decoding process on the most relevant information from the encoder output. LSTM (Long Short-Term Memory): Serves as a temporal dynamic processor for the output features of Multi-HeadAttention. LSTM, with its gating mechanism, excels at capturing local temporal patterns, short-term fluctuations, and sequence dependencies in sequences. Simplified FFN: Appearing after the LSTM module, it is a position-level feedforward neural network that typically contains two linear transformations and an activation function. Its purpose is to perform nonlinear transformations and dimensionality adjustments on the features at each time step, thereby increasing the model's expressive power.
[0060] In summary, by cascading Attention and LSTM, global relation mining and local temporal filtering are performed sequentially within the same information flow, achieving "unified modeling of cross-scale degradation features," rather than simple parallel or serial connections. By placing LSTM after Attention, it can directly process features that already contain global contextual information, thereby more accurately identifying short-term fluctuations in battery degradation and compensating for the shortcomings of pure Transformers. The Add&Norm mechanism ensures gradient flow, enabling this deeply coupled hybrid structure to be effectively trained and avoiding the problem of "coarse feature fusion."
[0061] In one specific implementation, the hardware device involved in executing this method is a computer configuration: This invention runs on a desktop computer equipped with an Intel Core i5-12400 processor, an NVIDIA GeForce RTX 4060 Ti graphics card, and 32 GB of RAM. Operating system: Windows 10 64-bit operating system. Development environment: Developed using Python 3.8, relying on PyTorch 1.10, NumPy 1.21, pandas 1.3, and matplotlib 3.4 libraries. Software tools: Deep learning framework: PyTorch 2.0.1 for building and training LSTM-Transformer models. Data processing tools: pandas for data processing and health indicator extraction, and matplotlib for result visualization.
[0062] In this embodiment, the proposed LSTM-Transformer-based hybrid model combines two health indicators: constant current charging time and discharge capacity within the 3.8–3.4 V discharge range. This successfully captures both short-term fluctuations and long-term trends during battery degradation. Compared to traditional deep learning methods based on the original capacity sequence, the proposed health features are more stable and physically interpretable, effectively reducing the interference of non-stationarity and noise disturbances on the model. This allows the model to more easily learn the true patterns of battery degradation, significantly improving the accuracy of SOH estimation.
[0063] While traditional Transformers can capture long-range dependencies, they are insufficient in handling dynamic changes such as minute capacity fluctuations and sudden voltage plateaus during battery degradation. This invention introduces an LSTM layer after the multi-head self-attention mechanism layer to enhance the model's short-term dynamic modeling capabilities, better cope with rapid changes between cycles, and maintain stable performance under complex operating conditions such as temperature variations and rate fluctuations.
[0064] This invention employs a cascaded mechanism of "Transformer global dependency modeling + LSTM sequence dynamic filtering," rather than the simple parallel or serial connections used in existing technologies, thus structurally achieving cross-scale feature alignment. This fusion approach avoids problems such as feature redundancy, dimensionality mismatch, and weak gradient propagation found in traditional hybrid models, making the model sensitive to degradation patterns at different stages of the battery lifecycle.
[0065] By employing two health metrics, CCCT and ΔQ, the model of this invention can effectively cope with external disturbances such as temperature drift, changes in charge / discharge rate, and sampling noise. Under different datasets, battery types, and charge / discharge conditions, the model exhibits relatively stable performance.
[0066] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0067] like Figure 3 As shown, the following are embodiments of the lithium-ion battery health status estimation system provided in this disclosure. The lithium-ion battery health status estimation method belongs to the same inventive concept as the lithium-ion battery health status estimation method in the above embodiments. For details not described in detail in the embodiments of the lithium-ion battery health status estimation system, please refer to the embodiments of the lithium-ion battery health status estimation method described above.
[0068] A health status estimation system for lithium-ion batteries, including: The data acquisition module is used to acquire raw data of the charge and discharge cycles of lithium-ion batteries and preprocess it to obtain time-series data. The feature extraction module is used to extract two types of health feature indicators from the time series data based on the electrochemical mechanism of the lithium-ion battery charging and discharging process, which are used to characterize the aging state of the lithium-ion battery. The feature sequence construction module is used to construct two types of health feature indicators into feature sequences in chronological order, and to construct input sequence samples and their corresponding health status label samples based on the sliding window method. The state estimation module is used to input the input sequence samples into a pre-trained battery health state estimation model and output a health state estimate; wherein, the battery health state estimation model is an LSTM-Transformer neural network hybrid model.
[0069] Figure 4 This is a schematic diagram of the hardware structure of an electronic device that implements various embodiments of the present invention.
[0070] The lithium-ion battery health status estimation method provided in this application embodiment can be applied to electronic devices. Those skilled in the art will understand that the electronic device structure involved in the embodiments of this invention does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. In the embodiments of this invention, the electronic device includes, but is not limited to, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of this application described and / or claimed herein.
[0071] Electronic devices may include processors, external memory interfaces, internal memory, universal serial bus (USB) interfaces, charging management modules, power management modules, batteries, wireless communication modules, audio modules, speakers, microphones, sensor modules, buttons, cameras, displays, and SIM card interfaces, etc.
[0072] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0073] A processor may include one or more processing units, such as: a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0074] The processor can serve as the nerve center and command center of an electronic device. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.
[0075] The processor may also include memory for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. This memory can store instructions or data that the processor has just used or that are used repeatedly. If the processor needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces processor latency, and thus improves system efficiency.
[0076] An external storage interface (ESI) can be used to connect external memory cards, such as microSD cards, to expand the storage capacity of electronic devices. The external memory card communicates with the processor through the ESI to perform data storage functions, such as saving music and video files on the external memory card.
[0077] Internal memory can be used to store computer executable program code, which includes instructions. The processor executes various functional applications and data processing of electronic devices by running the instructions stored in internal memory. Internal memory can include a program storage area and a data storage area. Internal memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0078] Wireless communication functionality in electronic devices can be achieved through antennas, wireless communication modules, modem processors, and baseband processors.
[0079] Wireless communication modules can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.
[0080] Electronic devices can implement audio functions through audio modules, speakers, receivers, microphones, headphone jacks, and application processors.
[0081] Electronic devices can achieve shooting functions through ISPs, cameras, video codecs, GPUs, displays, and application processors.
[0082] Electronic devices can achieve display functions through GPUs, displays, and application processors.
[0083] A GPU is a microprocessor for image processing, connected to the display screen and application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. A processor may include one or more GPUs, which execute program instructions to generate or modify display information.
[0084] A display screen is used to display images, videos, etc. A display screen includes a display panel.
[0085] The storage medium provided in this application stores a program product capable of implementing a method for estimating the state of health of lithium-ion batteries.
[0086] The method for estimating the health status of lithium-ion batteries includes: acquiring raw charge-discharge cycle data of lithium-ion batteries and preprocessing it to obtain time-series data; extracting two types of health characteristic indicators from the time-series data based on the electrochemical mechanism of the lithium-ion battery charge-discharge process to characterize the aging state of the lithium-ion battery; constructing a feature sequence of the two types of health characteristic indicators in chronological order, and constructing input sequence samples and their corresponding health status label samples based on the sliding window method; inputting the input sequence samples into a pre-trained battery health status estimation model and outputting the health status estimate; wherein, the battery health status estimation model is an LSTM-Transformer neural network hybrid model.
[0087] In some possible implementations, the subject matter of this disclosure, namely, the method and system for estimating the state of health of a lithium-ion battery, can be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.
[0088] The storage medium disclosed herein may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0089] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for estimating the state of health of a lithium-ion battery, characterized in that, include: Obtain raw charge-discharge cycle data of lithium-ion batteries and preprocess them to obtain time-series data; Based on the electrochemical mechanism of lithium-ion battery charging and discharging process, two types of health characteristic indicators are extracted from the time series data to characterize the aging state of lithium-ion batteries. Two types of health characteristic indicators are constructed into a feature sequence in chronological order, and input sequence samples and their corresponding health status label samples are constructed based on the sliding window method; The input sequence samples are input into a pre-trained battery health state estimation model, which outputs a health state estimate; wherein, the battery health state estimation model is an LSTM-Transformer neural network hybrid model.
2. The method for estimating the state of health of a lithium-ion battery according to claim 1, characterized in that, The two types of health characteristic indicators include constant current charging time and discharge amount within a specified voltage range; wherein, the constant current charging time is the time required for the voltage of the lithium-ion battery to rise from the initial value to the cutoff voltage during the constant current charging stage; and the discharge amount within the specified voltage range is the amount of electricity released by the battery within a preset voltage window during the discharge stage.
3. The method for estimating the health status of a lithium-ion battery according to claim 2, characterized in that, Calculate the constant current charging time using the following formula: ; In the formula, This indicates the time corresponding to the cutoff voltage during the constant current charging phase of a lithium-ion battery. This indicates the time corresponding to the initial voltage during the constant current charging phase of a lithium-ion battery. Calculate the discharge amount within a specified voltage range using the following formula: ; In the formula, This represents the discharge current of the lithium-ion battery in the voltage range of 3.8V to 3.4V at time t.
4. The method for estimating the health status of a lithium-ion battery according to claim 1, characterized in that, Two types of health characteristic indicators are constructed into a feature sequence in chronological order, and input sequence samples and their corresponding health status label samples are constructed based on the sliding window method, including: For each lithium-ion battery charge-discharge cycle, a feature vector sequence containing the aforementioned health characteristic indicators is generated; Arrange all the eigenvectors of the loops in chronological order to form a feature matrix; The feature matrix is truncated using a sliding window of a preset window length. The sequence of feature vectors that are continuously looped within each window is taken as an input sequence sample, and the health status value corresponding to the loop at the next time step of the window is taken as the estimated target label of the sample.
5. The method for estimating the health status of a lithium-ion battery according to claim 1, characterized in that, The battery health state estimation model includes: a Transformer encoder, an LSTM layer, a Transformer decoder, and a fully connected regression layer; wherein... The Transformer encoder is used to model the global dependency relationship of the input sequence samples and extract global degradation features by employing a multi-head self-attention mechanism. The LSTM layer, located after the multi-head self-attention mechanism of the Transformer encoder and Transformer decoder, is used to further filter, memorize and combine the global degradation features extracted by the multi-head self-attention mechanism in the time dimension. Through its gating mechanism, it captures the short-term dynamic changes and local temporal features in the battery degradation process and generates a hidden state sequence containing local dynamic information. The Transformer decoder is used to combine with the hidden state sequence output by the LSTM layer to extract higher-level representations; The fully connected regression layer is used to map the output of the Transformer decoder to a health state estimate.
6. The method for estimating the state of health of a lithium-ion battery according to claim 5, characterized in that, The Transformer encoder specifically includes: an input embedding layer, a position encoding layer, a multi-head self-attention mechanism layer, an LSTM layer, a first residual connection and normalization layer, a feedforward neural network layer, and a second residual connection and normalization layer. Specifically, the input embedding layer converts the input battery health indicator sequence into a dense vector representation; the position encoding layer adds positional information to each position in the sequence; the multi-head self-attention mechanism layer computes multiple attention heads in parallel to mine global dependencies and long-term degradation patterns between features at different time steps from the entire input sequence; the first residual connection and normalization layer performs residual connection and layer normalization again on the output of the LSTM layer; the feedforward neural network layer performs nonlinear transformations on the features at each time step to increase the model's expressive power; and the second residual connection and normalization layer performs residual connection and layer normalization again. The Transformer decoder specifically includes: an output embedding layer, a position encoding layer, a first multi-head self-attention mechanism layer, a first LSTM layer, a first residual connection and normalization layer, a second multi-head self-attention mechanism layer, a second LSTM layer, a second residual connection and normalization layer, a feedforward neural network layer, a third residual connection and normalization layer, and a feature flattening and projection layer; wherein, the output embedding layer is used to convert the target sequence or generated sequence into a vector representation; the first multi-head self-attention mechanism layer is used to perform mask self-attention calculation on the target sequence or generated sequence portion; the first LSTM layer is used to receive the feature sequence processed by the first multi-head self-attention mechanism layer, and utilize... The LSTM gating mechanism is used to smooth, memorize, and filter the extracted internal patterns of the sequence; the second multi-head self-attention mechanism layer is used to perform encoder-decoder attention, using the current decoder state as the query and the integer historical sequence features output by the encoder as the key and value for attention calculation; the second LSTM layer is used to perform temporal dynamic modeling again on the information output by the second multi-head self-attention mechanism layer, which has been fused with global context, to generate the hidden state sequence; the feature flattening and projection layer is used to map the high-dimensional feature tensor output by the third residual connection and normalization layer to the target dimension through linear transformation and project it as the SOH value estimated at that time step.
7. The method for estimating the state of health of a lithium-ion battery according to claim 5, characterized in that, The training process of the battery health state estimation model is as follows: The input sequence samples are fed into the Transformer encoder of the LSTM-Transformer neural network hybrid model, and global features are calculated through a multi-head self-attention mechanism; The global features are then input into the LSTM layer for temporal dynamic modeling and output a hidden state sequence containing short-term degradation information; the hidden state sequence is then input into the Transformer decoder for feature integration and transformation. The output of the Transformer decoder is passed to the fully connected regression layer to generate a health status estimate. The mean squared error loss function is used to calculate the error between the health status estimate output by the LSTM-Transformer neural network hybrid model and the corresponding true health status label. Using the Adam optimizer, the gradients of the parameters of each layer of the LSTM-Transformer neural network hybrid model are calculated based on the error using the backpropagation algorithm, and the parameters of the Transformer encoder, LSTM layer, Transformer decoder and fully connected regression layer are iteratively updated to minimize the loss function. Repeat the above steps until the performance of the LSTM-Transformer neural network hybrid model converges on the validation set or reaches the preset number of training rounds, thereby obtaining a trained battery health state estimation model.
8. A health status estimation system for a lithium-ion battery, characterized in that, include: The data acquisition module is used to acquire raw data of the charge and discharge cycles of lithium-ion batteries and preprocess it to obtain time-series data. The feature extraction module is used to extract two types of health feature indicators from the time series data based on the electrochemical mechanism of the lithium-ion battery charging and discharging process, which are used to characterize the aging state of the lithium-ion battery. The feature sequence construction module is used to construct two types of health feature indicators into feature sequences in chronological order, and to construct input sequence samples and their corresponding health status label samples based on the sliding window method. The state estimation module is used to input the input sequence samples into a pre-trained battery health state estimation model and output a health state estimate; wherein, the battery health state estimation model is an LSTM-Transformer neural network hybrid model.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the health status estimation method for lithium-ion batteries as described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the health status estimation method for lithium-ion batteries as described in any one of claims 1 to 7.