Lithium battery soh estimation method based on multi-scale dual timing mamba

CN121878509BActive Publication Date: 2026-05-29NANJING UNIV OF INFORMATION SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING UNIV OF INFORMATION SCI & TECH
Filing Date
2026-03-23
Publication Date
2026-05-29

Smart Images

  • Figure CN121878509B_ABST
    Figure CN121878509B_ABST
Patent Text Reader

Abstract

The application discloses a lithium battery SOH estimation method based on a multi-scale double timing Mamba, collects original charge-discharge monitoring data, then extracts a multi-dimensional health factor based on a battery degradation mechanism to construct a time characteristic sequence; a multi-scale sparse scanning module is constructed, the time characteristic sequence is segmented, spliced and reconstructed, and an enhanced characteristic sequence is output; a layered double timing attention module is constructed, including two layers of architecture, the first layer is directed to the enhanced characteristic sequence, captures global context through a non-causal path, and the second layer models causal dependency relationship through a causal path; finally, the outputs of the two layers are fused; a state space model is constructed, combined with residual connection and layer normalization processing, high-dimensional features extracted are mapped into normalized health state estimation values through a regression layer, and are restored into final battery health states through inverse normalization transformation; the application aims to realize high-precision and reliable SOH estimation of lithium ion batteries under complex operating conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of neural networks and lithium battery state of health estimation, specifically to a lithium battery SOH estimation method based on multi-scale dual-time series Mamba. Background Technology

[0002] As one of the cornerstones of modern energy storage systems, the health and safety of lithium-ion batteries directly impact the stability of the entire energy ecosystem. Accurate state of health (SOH) estimation is not only crucial for optimizing equipment economics but also a core technical requirement for ensuring system safety.

[0003] Battery degradation is a complex electrochemical-physical coupling process. In actual operation, multidimensional health features extracted from basic monitoring data (voltage, current, temperature) constitute multivariate heterogeneous time series. The dynamics in these series exhibit both slow changing trends (such as capacity decay and increased internal resistance) and transient disturbances (such as current pulses and temperature surges). Therefore, accurately capturing both dynamics simultaneously within a limited observation window remains a core challenge in battery health modeling. Existing battery health management methods are mainly divided into physical models and data-driven models. While physical models based on electrochemical mechanisms have good interpretability, they often face the challenge of difficult parameter identification. On the other hand, deep learning methods, represented by recurrent neural networks (RNNs) and long short-term memory networks (LSTMs), suffer from the gradient vanishing problem when dealing with long sequences. Furthermore, although the Transformer architecture can effectively capture long-term dependencies, it lacks inductive bias for time series data, which limits its ability to model continuous state evolution.

[0004] State-space models (SSMs), particularly structures like Mamba, have recently offered new directions for sequence modeling. Mamba, with its innovative selective state-space scanning mechanism, theoretically bridges the gap between continuous physical dynamics and discrete sequence representations. However, both approaches use relatively general sequence modeling structures. They lack architectural components specifically designed for two challenges inherent in battery data: feature heterogeneity and multi-scale dynamics. This deficiency can prevent models from fully capturing complex battery-specific dynamics, thus limiting the accuracy of estimations. Specifically, current approaches remain constrained by two key bottlenecks: (1) Feature heterogeneity: Multidimensional health features extracted from underlying monitoring data (voltage, current, temperature) exhibit significantly different temporal evolution patterns. Holistic modeling struggles to achieve fine-grained decoupling of these cross-feature dynamics. (2) Multi-scale dynamics: Battery degradation simultaneously contains stable intermediate trends and rapid perturbations. Single-scale models often fail to adequately handle these dynamic patterns at different time resolutions.

[0005] In summary, existing methods for estimating the state of harmonics (SOH) of lithium-ion batteries, whether traditional deep learning models or the Mamba model initially applied to this field, still lack an effective unified modeling mechanism when facing the multivariate heterogeneity and multi-scale temporal dynamics of battery data. Therefore, a novel state-space model architecture that can simultaneously solve the problems of feature decoupling and multi-scale causal feature fusion is urgently needed. Summary of the Invention

[0006] The purpose of this invention is to provide a lithium battery SOH estimation method based on multi-scale dual-time series Mamba, which aims to achieve high-precision and reliable SOH estimation of lithium-ion batteries under complex operating conditions.

[0007] To achieve the above functions, this invention designs a lithium battery SOH estimation method based on multi-scale dual-time series Mamba, which executes the following steps S1-S5 to complete the health state estimation of the target lithium battery:

[0008] Step S1: Collect raw charge and discharge monitoring data of the target lithium battery, including voltage, current, temperature and sampling time index. Then, extract multidimensional health factors based on the battery degradation mechanism and construct a time feature vector. Extract heterogeneous battery feature vectors, standardize them, and construct a time feature sequence using the sliding window method.

[0009] Step S2: Construct a multi-scale sparse scanning module, input the time feature sequence, segment it along the time dimension to obtain each sub-sequence, perform causal feature gating on each sub-sequence, capture the multi-scale battery degradation dynamics, and splice and reconstruct each sub-sequence as the enhanced feature sequence output by the multi-scale sparse scanning module.

[0010] Step S3: Construct a hierarchical dual temporal attention module, which includes a two-layer architecture. The first layer enhances the feature sequence output by the multi-scale sparse scanning module and captures the global context through non-causal paths. The second layer models causal dependencies through causal paths. Finally, an adaptive weighting method is used to combine the outputs of the two layers to obtain the feature sequence output by the hierarchical dual temporal attention module.

[0011] Step S4: Construct a state-space model. Input the feature sequence processed by the hierarchical dual temporal attention module. Based on the discretized evolution process, update the state of the feature sequence to obtain the high-dimensional features output by the state-space model. Finally, combine residual connection and layer normalization processing, and map the extracted high-dimensional features to the normalized health state estimate through the regression layer. Then, restore the final battery health state through inverse normalization transformation.

[0012] Step S5: The battery health state estimation model is composed of a multi-scale sparse scanning module, a hierarchical dual temporal attention module, and a state space model. The battery health state estimation model is trained, and the trained battery health state estimation model is applied to complete the health state estimation of the target lithium battery.

[0013] Beneficial effects: Compared with the prior art, the advantages of the present invention include:

[0014] This invention provides a high-precision lithium battery health state estimation scheme based on a fixed-length observation window (e.g., a sequence length of 20), effectively solving the problem of balancing heterogeneous feature coupling and multi-scale dynamics under limited temporal information. The invention constructs and proposes a multi-scale sparse scanning module, which performs refined multi-scale segmentation on the 20-step sequence. Through deep convolution and causal accumulation gating strategies, it maximizes the extraction of degradation trends and transient perturbation features within the observable window from limited observation data while strictly adhering to temporal causality, overcoming the limitation of sparse sequence information. Furthermore, the invention designs and proposes a hierarchical dual temporal attention module, which implicitly decouples multi-dimensional health features extracted from basic monitoring data (voltage, current, temperature) within short sequences using a grouping interaction strategy, and reconstructs the degradation evolution logic through global causal temporal modeling. Moreover, addressing the problem of feature distortion caused by padding noise in short sequences, the invention uses mask-aware selective scanning technology to block the state propagation of invalid padding data from the underlying mathematical principle (forcing state preservation and input zeroing when the mask is false), completely eliminating the state drift error introduced by variable-length sequences. Furthermore, this method incorporates an ultra-lightweight parameter sharing design, which significantly reduces the number of model parameters while achieving higher SOH estimation accuracy, thus achieving a good balance between model estimation performance and parameter efficiency under the condition of finite observable window length. Attached Figure Description

[0015] Figure 1 This is a flowchart of a lithium battery SOH estimation method based on multi-scale dual-time series Mamba provided according to an embodiment of the present invention;

[0016] Figure 2 This is an overall model architecture and internal structure diagram of the Mamba module provided according to embodiments of the present invention;

[0017] Figure 3 This is a structural diagram of the state-space model provided according to an embodiment of the present invention. Detailed Implementation

[0018] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.

[0019] The lithium battery SOH estimation method based on multi-scale dual-time series Mamba (Mamba-HMS) provided in this embodiment of the invention refers to... Figure 1 Perform the following steps S1-S5 to complete the state of health (SOH) estimation of the target battery:

[0020] Step S1: Collect raw charge and discharge monitoring data of the target lithium battery, including voltage. Current ,temperature and sampling time index Then, based on the battery degradation mechanism, multidimensional health indicators (HIs) are extracted and a time feature vector is constructed; heterogeneous battery feature vectors are extracted, standardized, and a time feature sequence is constructed using the sliding window method.

[0021] The specific steps of step S1 are as follows:

[0022] Step S1.1: Collect raw charge and discharge monitoring data of the target lithium-ion battery, including voltage. Current ,temperature and sampling time index ,in, This represents discrete sampling times arranged chronologically during a single charge or discharge cycle. Multidimensional health factors are extracted based on battery degradation mechanisms, and a temporal feature vector is constructed. Since subsequent feature extraction depends on capacity changes, the ampere-hour integration method (Coulomb Counting) is used. The system processes the raw current and sampling time index data during the charging or discharging process to calculate the cumulative discharge capacity for each cycle. Therefore, a system containing , , , and The complete charge-discharge spectrum is used as a prerequisite for feature extraction.

[0023] The process of extracting battery feature vectors is as follows:

[0024] In each cycle, a quadratic regression model is constructed based on capacity-voltage evolution data within a specific voltage range during the discharge process:

[0025] ;

[0026] in, , These represent the values ​​relative to the discharge voltage within a specific discharge voltage range during the discharge process. The, the The instantaneous cumulative discharge capacity corresponding to each sampling time point It is a sampling time index; This represents the measurement error that follows a normal distribution. For regression coefficients, For the intercept term; V j , V j+1 The first The, the Voltage at each sampling time;

[0027] By fitting the model, regression coefficients are extracted. and intercept term Two features are used to characterize the morphological distortion and kinetic evolution trend of the voltage-capacity curve of the target lithium battery in the partial discharge range.

[0028] IC statistical characteristics are constructed based on process voltage-instantaneous cumulative capacity data: the voltage-cumulative capacity data collected during a single charge or discharge process is numerically differentiated to obtain the incremental capacity. The curve is further analyzed, and the maximum value of the incremental capacity curve is extracted. ), minimum value ( ,variance( As a statistical feature, it is used to characterize the intensity of electrochemical phase transition and reaction peak shape characteristics of the target lithium battery during cycling.

[0029] Macroscopic physical feature extraction based on charging process and full-cycle monitoring data: The duration of the constant current charging phase is statistically recorded as the charging time. This is used to characterize the decrease in the charge acceptance capability of the target lithium battery.

[0030] Cyclic macroscopic characteristics: Calculate the average temperature of a single cycle. Simultaneously, the characteristic DC internal resistance is calculated based on the voltage step at the instant of charge / discharge switching. ).

[0031] Step S1.2: Based on the RobustScaler, the heterogeneous battery feature vectors are standardized to eliminate differences in different physical dimensions, as shown in the following formula:

[0032] ;

[0033] In the formula, This represents the standardized battery feature vector. Represents the original first Each battery feature vector Represents the original battery feature vector the median of , These represent the original battery feature vectors. The first and third quartiles;

[0034] Step S1.3: For all standardized battery feature vectors in the original dataset, construct a time feature sequence using the sliding window method. The window length of the sliding window is fixed at 20 time steps, and the step size is 1. For time feature sequences with fewer than 20 time steps, pad the beginning of the time feature sequence with zeros to ensure that the most recent observation occupies the end position of the sequence.

[0035] Step S1.4: Create a raw Boolean padding mask tensor Tcmask to explicitly identify the padding locations. This excludes these regions during attention calculation and state space modeling, preventing false information from affecting the learning process. Locations of real observation data are marked as valid (True), and locations of padding data are marked as invalid (False). This raw Boolean padding mask tensor Tcmask will be used throughout all subsequent model modules to prevent padding noise from interfering with state estimation.

[0036] Step S2: Construct a multi-scale sparse scanning module (M3S), input the time feature sequence, segment it along the time dimension to obtain each sub-sequence, perform causal feature gating on each sub-sequence to capture multi-scale battery degradation dynamics, and splice and reconstruct each sub-sequence as the enhanced feature sequence output by the multi-scale sparse scanning module.

[0037] Reference Figure 2 , Figure 2 (a) in the diagram is the overall model architecture diagram of the method of the present invention. Figure 2 (b) is the internal structure diagram of the Mamba model; the specific steps in step S2 are as follows:

[0038] Step S2.1: Input the time feature sequence First it is transposed, where... This represents the real number field, where the superscript indicates the corresponding dimension and shape. Indicates batch size. Indicates the length of the time feature sequence. This represents the feature dimension, specifically the extended latent feature dimension in the Mamba architecture. More specifically, it consists of the hidden layer dimension of the base model (…). After linear projection and multiplied by a preset expansion factor (In the example, the dimension is set to 2) and then obtained (i.e. Then, it is segmented along the time dimension to obtain... ( 4) Subsequences ,in This is the subsequence index (i.e., the scale index), and its value range is... .

[0039] when hour, Defined as:

[0040] ;

[0041] when Time (i.e., the last subsequence), Defined as:

[0042] ;

[0043] in, Represents the i-th subsequence (scale) after segmentation and transposition; where, It is the standard segment length. , It is the total number of subsequences (i.e., the total number of scales). It is the time feature sequence after the transpose operation. Indicates the transpose operation; The indexing operator consists of three parts separated by commas, each corresponding to one of the three dimensions of the tensor, including the batch size. Feature Dimension Length of time feature sequence The comma represents the dimension separator, used to distinguish the slicing instructions for the first, second, and third dimensions. The colon represents the slicing operator. A single colon means to retrieve all elements under that dimension. (range start:end) means to retrieve elements from the start index to the end index (excluding end).

[0044] Step S2.2: Perform depthwise convolution enhancement on each subsequence, as shown in the following formula:

[0045] ;

[0046] in, This represents the i-th subsequence (scale) after depthwise convolution enhancement. It is a learnable scalar. This represents a depthwise convolution operation with a kernel size of 3, and the number of groups in the depthwise convolution layer is set to the same as the dimension of the input features. Equal, where each input channel (i.e., each independent feature dimension) is associated with an independent Convolution is performed on the kernel.

[0047] Step S2.3: Extract the global feature vector for each subsequence by performing average pooling along the time dimension:

[0048] ;

[0049] in, It is the i-th subsequence (scale) after depthwise convolution enhancement, that is, the global feature vector of the i-th subsequence. It is the time step index within the subsequence. This represents the actual length of the i-th subsequence; The comma represents the dimension separator, and the colon represents the slicing operator.

[0050] Step S2.4: Calculate the cumulative feature vector of each subsequence based on the global feature vector:

[0051] ;

[0052] ;

[0053] ;

[0054] in, It is the cumulative feature vector of the i-th subsequence. It is the first -1 cumulative feature vectors of subsequences; and , ; It is the global feature vector of the i-th subsequence; This is the initial cumulative feature vector. It is an eigenvector in which all elements are zero (all-zero vector).

[0055] A gating network is used to independently compute the gating weights for each subsequence:

[0056] ;

[0057] in, It is the gating weight of the i-th subsequence. This indicates that global adaptive average pooling will be performed. express Convolutional projection layer; express The function normalizes the weights along the scale dimension; This represents the indexing operators, where the comma indicates the dimension separator and the colon indicates the slicing operator; indexing operations This indicates the gating weights for extracting the current subsequence;

[0058] Based on the gate weights, a weighted operation is performed, as shown in the following formula:

[0059] ;

[0060] in, Represents the i-th gated subsequence. This represents the i-th subsequence after depthwise convolution enhancement. Represents element-wise multiplication, with gated weights. Through broadcasting mechanism and Perform element-wise multiplication;

[0061] Step S2.5: Concatenate the gated subsequences along the time dimension to obtain the concatenated reconstructed sequence:

[0062] ;

[0063] in, Indicates the concatenation and reconstruction of the sequence. This indicates a splicing operation. Indicates the length of the concatenated and reconstructed sequence. , This represents the actual length of the i-th subsequence (scale);

[0064] Subsequently, to match the length of the original time feature sequence, the length of the concatenated and reconstructed sequence is corrected. If it is inconsistent with the length of the time feature sequence, it is updated. Its sliced ​​portion:

[0065] ;

[0066] in, The comma represents the indexing operator, and the colon represents the slicing operator; this truncation method ensures that the output length matches the length of the time feature sequence.

[0067] Step S2.6: Combining residual connections and regularization, obtain the enhanced feature sequence output by the multi-scale sparse scanning module:

[0068] ;

[0069] in, It is the enhanced feature sequence output by the multi-scale sparse scanning module. ; Indicates to Perform a transpose operation to change the shape of a tensor from... Restore to ; For layer normalization function, For the dropout function, The input is a time feature sequence.

[0070] Through step S2, the model can simultaneously capture the degradation trend (large scale) and transient voltage / temperature perturbation (small scale) of the target lithium battery within the observable window in a single forward propagation, and the cumulative gating mechanism ensures that future information is not used during the fusion process, strictly adhering to the causal law.

[0071] Step S3: Construct a hierarchical dual temporal attention module (HDTA), which includes a two-layer architecture. The first layer enhances the feature sequence output by the multi-scale sparse scan module and captures the global context through non-causal paths. The second layer models causal dependencies through causal paths. Finally, an adaptive weighting method is used to fuse the outputs of the two layers to obtain the output feature sequence of the hierarchical dual temporal attention module.

[0072] The specific steps for constructing the first layer of the hierarchical dual temporal attention module are as follows:

[0073] Step S3.1.1: Analyze the enhanced feature sequence output by the multi-scale sparse scanning module. Remodeling into feature groups:

[0074] ;

[0075] in, It refers to the batch size. It is the length of the time feature sequence. Representing feature dimension, It is the number of feature groups, set in the example. , It is the feature dimension within each feature group; It is the tensor obtained after the input feature tensor has undergone dimensionality reshaping;

[0076] Step S3.1.2: The input features of each feature group are transformed using the shared linear projection matrix of the first layer:

[0077] ;

[0078] in, For the first The input features of the feature set are, i.e., from Extracted from the first The feature components corresponding to each feature group It is a linear projection matrix shared by all feature groups. In all feature groups ( arrive The parameters are shared between groups, which means that all groups use the same linear projection matrix for transformation, thus significantly reducing the number of parameters in the model; It is the first Feature representation of a feature group after projection; It is the index variable of the feature group, and its value range is... ,in, The value is 2.

[0079] Step S3.1.3: For each feature group, after projection, perform multi-scale feature enhancement using depthwise convolution:

[0080] ;

[0081] in, Indicates the first layer Each feature group enhances the query features through convolution; Represents a dimension replacement operation. This represents a one-dimensional depthwise convolution operation;

[0082] Step S3.1.4: Based on the query features enhanced by convolution, calculate the attention output features for each feature group:

[0083] ;

[0084] ;

[0085] ;

[0086] in, It is the first The original attention score matrix of each feature group (its dimension is...) Consistent); It is a learnable parameter, initialized to ; It is the first layer of the hierarchical dual temporal attention module. Normalized attention weights for each feature group; This represents the all-one matrix in the first layer of the hierarchical dual temporal attention module (during computation, the matrix...). Extended based on broadcast mechanism to adapt (dimensions) It is by using a query mask and key mask The padding mask generated during the broadcast operation, wherein... It is obtained by extending the original Boolean padding mask tensor Tcmask along the key dimension. It is obtained by expanding the original Boolean padding mask tensor Tcmask on the query dimension; It is the first Attention output features for each feature group; and It is a large negative value used to fill the mask positions to ensure that its softmax weight is close to zero.

[0087] Step S3.1.5: For the attention output features of each feature group, first weight them using learnable parameters normalized by Softmax, then recombine them to recover the original feature dimensions:

[0088] ;

[0089] ;

[0090] ;

[0091] in, It is a learnable original weight vector. This represents the cross-group fusion weight vector. It is the first Normalized weights for each feature group; Indicates the first Attention output features of each feature group According to their corresponding normalized weights The weighted feature set output; This indicates that the weighted feature set will be output. Reshape or stitch along the feature dimension Represents the aggregated feature tensor;

[0092] Step S3.1.6: For the aggregated feature tensor Integration is achieved through internal control mechanisms:

[0093] ;

[0094] in, It is a learnable scalar gating parameter. It is the sigmoid activation function. It is the output of the first layer of the hierarchical dual-temporal attention module; The enhanced feature sequence output by the multi-scale sparse scanning module;

[0095] Step S3.1.7: Apply residual connections after the first layer of the hierarchical dual temporal attention module:

[0096] ;

[0097] in, This represents the normalized output of the first layer of the hierarchical dual temporal attention module. This is the layer normalization function.

[0098] The first layer of the hierarchical dual temporal attention module is based on group-wise temporal attention, which divides the input feature dimension into subspaces (Groups). Within each subspace, projection parameters are shared, and attention scores (generated attention maps) are independently calculated between time steps. By implicitly utilizing feature grouping, heterogeneous physical quantities such as multidimensional health features extracted from raw charge and discharge monitoring data (voltage, current, temperature) are decoupled to different feature subspaces for independent temporal modeling.

[0099] The specific steps for constructing the second layer of the hierarchical dual temporal attention module are as follows:

[0100] Step S3.2.1: First, inject position information using a fixed sine coding scheme:

[0101] ;

[0102] ;

[0103] in, Indicates the time step index within the window sequence. Indicates embedded dimension index, This represents the generated position encoding matrix; , Representing time steps The positional encoding matrix at the time of the first time indivual, The elements at each dimension represent fixed-position feature values ​​generated using the sine function (for even-numbered dimension indices) and the cosine function (for odd-numbered dimension indices), respectively.

[0104] Step S3.2.2: Add the position encoding matrix to the first layer normalized output of the hierarchical dual temporal attention module:

[0105] ;

[0106] in, This represents the normalized output of the first layer of the hierarchical dual temporal attention module. For location-aware feature tensors;

[0107] Step S3.2.3: For position-aware feature tensors The effect of time-dependent gating on position coding is modulated:

[0108] ;

[0109] in, These are the scalar gating parameters for the first layer, initialized to 1.0. For time-enhanced features; It is the sigmoid activation function;

[0110] Step S3.2.4: Add temporal enhancement features Reshape into G feature groups, and obtain the th feature through the shared linear projection matrix and depthwise convolution operation in the second layer. Enhanced query features targeting causal paths. :

[0111] ;

[0112] ;

[0113] ;

[0114] in, It is the first The original causal attention score matrix of each feature group (its dimension is...) Consistent) It is the normalized attention weight of the kth feature group in the second layer of the hierarchical dual temporal attention module; This represents the all-one matrix in the second layer of the hierarchical dual temporal attention module (during computation, the matrix...). Extended based on broadcast mechanism to adapt (dimensions) Indicates the second layer Each feature group enhances the query features through convolution; These are independent learnable parameters in the second layer; It is a causal mask With padding mask The intersection of. Among them, It is constructed by generating an upper triangular Boolean matrix to ensure that the current time step can only focus on itself and information from past times; It is a time-enhanced feature In the The components of each feature group; Indicates the first Attention output features of each feature group;

[0115] Step S3.2.5: For the first Attention output features of each feature group The aggregated feature tensor is obtained by cross-group weight fusion. ,against Integration is achieved through internal control mechanisms:

[0116] ;

[0117] in, These are the scalar gating parameters of the second layer. It is an aggregated feature tensor; It is the output of the second layer of the hierarchical dual-temporal attention module;

[0118] Step S3.2.6: Apply residual connections after the second layer of the hierarchical dual-temporal attention module:

[0119] ;

[0120] in, This represents the normalized output of the second layer of the hierarchical dual temporal attention module; It is the output of the second layer of the hierarchical dual temporal attention module.

[0121] The second layer of the hierarchical dual temporal attention module is strictly causal temporal attention (Global CausalTemporal Attention). Unlike the first layer, this layer introduces additional positional encoding and applies a causal mask when calculating attention, forcing the upper triangular region of the attention matrix to be set to negative infinity, ensuring that the current time step can only focus on information from historical time steps.

[0122] For the normalized output of the first layer and the normalized output of the second layer of the hierarchical dual temporal attention module, an adaptive weighting method is used to combine the normalized outputs of the two layers:

[0123] ;

[0124] ;

[0125] in, and These are the normalized outputs of the first and second layers of the hierarchical dual temporal attention module, respectively. It is an adaptive weighted fusion feature; This is the final output; It is a learnable fusion weight, initialized to 0.5; It is a layer normalization function. It's the dropout function, with the probability set to 0.1.

[0126] The first layer focuses on the temporal correlation (feature decoupling) within the feature subspace and employs bidirectional global information interaction between the various time steps within the window. The second layer focuses on the strict causal evolution (trend modeling) within the feature subspace. Combining the two achieves a progressive temporal representation flow from the whole to the part.

[0127] Step S4: Construct a State-Space Model (SSM). Input the feature sequence processed by the hierarchical dual temporal attention module. Based on the discretized evolution process, update the state of the State-Space Model to obtain the high-dimensional features output by the State-Space Model. Finally, combine residual connections and layer normalization processing, and map the extracted high-dimensional features to normalized health state estimates through a regression layer. Then, restore the final battery health state through inverse normalization transformation.

[0128] The specific steps in step S4 are as follows:

[0129] Step S4.1: Construct the state-space model. Refer to the structure diagram of the state-space model. Figure 3 Its state update follows a discretized evolutionary process, with the core equation as follows:

[0130] ;

[0131] in, and They are time steps and The hidden state at that time; , They correspond to , The discretized dynamic matrix is ​​calculated as follows:

[0132] ;

[0133] ;

[0134] in, It is a learnable diagonal matrix. Represents the matrix exponential function. Indicates the time step. Represents the input matrix, and Based on the current Dynamically generated via linear projection layers;

[0135] In the embodiment, Set it as the identity matrix (which is the value 1 in the diagonalized implementation); then set the input matrix as a matrix of all zeros, that is, the input terms in the equation. Setting it to all zeros aims to ensure that the hidden state of the invalid time step is strictly equal to the state of the previous time step. This prevents feature drift caused by zero-padding data. The formula uses a first-order approximation for computational efficiency.

[0136] This step mathematically prevents invalid padding data from updating and propagating the battery health state (hidden state), thus completely solving the data leakage and state drift problems in variable-length sequence processing.

[0137] Step S4.2: Introduce residual join, as shown in the following equation:

[0138] ;

[0139] in, It is a dynamic output matrix, also composed of Generate information for selectively decoding from the hidden state. This represents the weight vector for through connections; This indicates that the state-space model is at time step Local output;

[0140] Step S4.3: For the state-space model at time step Local output The battery health status is mapped through a regression layer, as shown in the following formula:

[0141] ;

[0142] In the formula, The time step index is Normalized battery health state estimate at time, This is the weight matrix. For bias terms, Based on the current Gated branch signals generated by linear projection layers To output the projection matrix, yes The residual feature components obtained after independent linear transformation layers For learnable adaptive scaling factors, This represents element-wise multiplication. Represents the ReLU activation function. This represents the SiLU activation function. It's worth noting that in practical applications and performance evaluation, the output value needs to undergo inverse normalization. This method utilizes the statistical parameters obtained during the training phase (the maximum and minimum values ​​of the training set) to map them back to the original physical dimensions (i.e., the true SOH percentage) to obtain the final battery health state estimate.

[0143] In this step, the output of the hierarchical dual temporal attention module is input to the improved Mamba backbone layer (Mask-aware Mamba Block). Discretized state space computation is performed using the Parallel Scan algorithm. A key feature is the introduction of a mask-aware mechanism: during the state transition computation, based on the mask generated in step S1, for time steps marked as invalid (False), the state transition matrix is ​​forced to be set to an identity matrix, and the input matrix to an all-zero matrix.

[0144] Step S5: The battery health state estimation model is composed of a multi-scale sparse scanning module, a hierarchical dual temporal attention module, and a state space model. The battery health state estimation model is trained, and the trained battery health state estimation model is applied to complete the health state estimation of the target battery.

[0145] The specific training steps are as follows:

[0146] Step S5.1: Use the relevant random seed interfaces of torch, cuda and numpy to fix the randomness to ensure the reproducibility of experimental results under different hardware environments; then, load and preprocess the raw charge and discharge monitoring data of the target lithium battery to distinguish the training set from the test set and ensure that the data format meets the model input requirements.

[0147] Step S5.2: Use the argparse tool to receive command-line arguments and define the number of training epochs, batch size, learning rate (lr), weight decay (wd), and core structural parameters of the Mamba model (such as sequence length, hidden layer dimension, etc.).

[0148] Step S5.3: Define a class that inherits from torch.nn.Module;

[0149] Step S5.4: Initialize the AdamW optimizer in torch.optim and pass in the set learning rate and weight decay coefficient to optimize the model convergence performance and enhance generalization ability;

[0150] Step S5.5: Train using for epoch in range(num_epochs) iterations. In each iteration, the training data is fed into the model, and the model output bias is calculated by calculating the loss function. Execute loss.backward() and optimizer.step() to complete backpropagation and parameter updates. At the same time, in order to prevent model overfitting, early stopping control is implemented in the training loop by combining validation set performance and patience count.

[0151] Step S5.6: During and after training, use an independent test set for evaluation, calculate the root mean square error (RMSE), root mean square percentage error (RMSPE), and a comparison curve of the model estimate and the true value to quantify the accuracy of the model's estimation of the lithium battery health status / remaining lifespan.

[0152] The formula for calculating the root mean square percentage error (RMSPE) is as follows:

[0153] ;

[0154] This embodiment employs a sliding window strategy (window length of 20), therefore, effective estimation begins from the 20th monitoring period, and all indicators are calculated within the effective estimation domain. This represents the number of samples in the test set that have valid estimates. Indicates the first The true value of each sample This represents the corresponding model estimate; for the battery state of health (SOH) estimation task, this embodiment selects the root mean square percentage error (RMSPE) as the indicator.

[0155] The formula for calculating the root mean square error (RMSE) is as follows:

[0156] ;

[0157] in This represents the number of samples in the test set that have valid estimates. Indicates the first The true value of each sample This represents the corresponding model estimate. For the task of estimating the remaining battery life (RUL), this embodiment selects the root mean square error (RMSE) as the metric.

[0158] Step S5.7: Save the checkpoint at the moment when the validation set performance is optimal, which includes the model parameter dictionary (model_state_dict), normalizer state and configuration information, as a .pt file; during inference, read the checkpoint file and restore the model parameters and data processing state to facilitate subsequent health state estimation;

[0159] Step S5.8: During the training and evaluation process, record the loss value change curve, evaluation index and training time, and analyze the estimation accuracy and stability of the model under different hyperparameter configurations and dataset partitioning schemes, so as to compare and verify the advantages and disadvantages of the model under different configurations.

[0160] The parameter tuning process during training includes:

[0161] This embodiment employs a Bayesian optimization algorithm for hyperparameter tuning. The search space includes the number of network layers: [1, 4], hidden dimensions: {8, 16, 24, 32, 48}, learning rate: [0.0015, 0.1], weight decay: [1e-6, 5e-5], batch size: {64, 128, 256, 512}, dropout rate: [0.15, 0.50], and sequence length: {10, 15, 20, 25, 30}. The optimization objective is to minimize the root mean square error (RMSE) of the validation set, which consists of a 20% subset reserved from the training data. After 100 Bayesian optimization iterations, the configuration with the smallest validation error is selected for final model training and testing.

[0162] In summary, this invention addresses the following specific technical problems in existing battery health state estimation techniques, particularly existing Mamba-type models, when processing multivariate battery monitoring data:

[0163] 1. Addressing the difficulty of decoupling due to feature heterogeneity: This addresses the problem that existing models, which use a holistic modeling approach, cannot effectively distinguish the significantly different temporal evolution patterns between heterogeneous physical quantities such as multidimensional health features extracted from raw charge and discharge monitoring data (voltage, current, temperature), leading to difficulties in fine-grained decoupling of cross-feature dynamics.

[0164] 2. Addressing the challenges of multi-scale dynamic feature fusion and causal inconsistencies: This addresses the problem that existing models cannot simultaneously account for the decay trend and short-term drastic transient disturbances in the observable battery sequence window at a single time scale, and that traditional multi-scale methods easily disrupt the causal consistency of time series during feature fusion, leading to the leakage of future information and thus reducing the reliability of estimation.

[0165] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.

Claims

1. A lithium battery SOH estimation method based on multi-scale dual-time series Mamba, characterized in that, Perform the following steps S1-S5 to complete the health status estimation of the target lithium battery: Step S1: Collect raw charge and discharge monitoring data of the target lithium battery, including voltage, current, temperature and sampling time index. Then, extract multidimensional health factors based on the battery degradation mechanism and construct a time feature vector. Extract heterogeneous battery feature vectors, standardize them, and construct a time feature sequence using the sliding window method. Step S2: Construct a multi-scale sparse scanning module, input the time feature sequence, segment it along the time dimension to obtain each sub-sequence, perform causal feature gating on each sub-sequence, capture the multi-scale battery degradation dynamics, and splice and reconstruct each sub-sequence as the enhanced feature sequence output by the multi-scale sparse scanning module. Step S3: Construct a hierarchical dual temporal attention module, which includes a two-layer architecture. The first layer enhances the feature sequence output by the multi-scale sparse scanning module and captures the global context through non-causal paths. The second layer models causal dependencies through causal paths. Finally, an adaptive weighting method is used to combine the outputs of the two layers to obtain the feature sequence output by the hierarchical dual temporal attention module. Step S4: Construct a state-space model. Input the feature sequence processed by the hierarchical dual temporal attention module. Based on the discretized evolution process, update the state of the feature sequence to obtain the high-dimensional features output by the state-space model. Finally, combine residual connection and layer normalization processing, and map the extracted high-dimensional features to the normalized health state estimate through the regression layer. Then, restore the final battery health state through inverse normalization transformation. Step S5: The battery health state estimation model is composed of a multi-scale sparse scanning module, a hierarchical dual temporal attention module, and a state space model. The battery health state estimation model is trained, and the trained battery health state estimation model is applied to complete the health state estimation of the target lithium battery.

2. The lithium battery SOH estimation method based on multi-scale dual-time series Mamba as described in claim 1, characterized in that, The specific steps of step S1 are as follows: Step S1.1: Collect raw charge and discharge monitoring data of the target lithium-ion battery, including voltage. Current ,temperature and sampling time index ,in, This represents discrete sampling times arranged in chronological order during a single charge or discharge cycle; multidimensional health factors are extracted based on battery degradation mechanisms, and a time feature vector is constructed; the raw current and sampling time index data during the charging or discharging process are processed using the ampere-hour integration method to calculate the cumulative discharge capacity for each cycle. Thus, a system containing , , , and Based on the charge-discharge spectrum, the battery feature vector is extracted as follows: In each cycle, a quadratic regression model is constructed based on capacity-voltage evolution data within a specific voltage range during the discharge process: ; in, , These represent the values ​​relative to the discharge voltage within a specific discharge voltage range during the discharge process. The, the The instantaneous cumulative discharge capacity corresponding to each sampling time point It is a sampling time index; This represents the measurement error that follows a normal distribution. For regression coefficients, For the intercept term; V j , V j+1 The first The, the Voltage at each sampling time; Extracting regression coefficients and intercept term Two features are used to characterize the morphological distortion and kinetic evolution trend of the voltage-capacity curve of the target lithium battery in the partial discharge range. The incremental capacity is obtained by numerically differentiating the voltage-cumulative capacity data collected during a single charge or discharge cycle. Curve, and further extract incremental capacity. maximum value of the curve Minimum value ,variance As a statistical feature, it is used to characterize the intensity of internal electrochemical phase transition and reaction peak shape characteristics of the target lithium battery during cycling. The duration of the constant current charging phase is recorded as the charging time. To characterize the decrease in the charge acceptance capability of the target lithium battery; to calculate the average temperature of a single cycle. ; Calculate characteristic DC internal resistance based on voltage step during charge / discharge switching ; Step S1.2: Based on the robust scaler, the heterogeneous battery feature vectors are standardized, as shown in the following formula: ; In the formula, This represents the standardized battery feature vector. Represents the original first Each battery feature vector Represents the original battery feature vector the median of , These represent the original battery feature vectors. The first and third quartiles; Step S1.3: For all standardized battery feature vectors in the original dataset, construct a time feature sequence using the sliding window method. The window length of the sliding window is fixed at 20 time steps, and the step size is 1. For time feature sequences with fewer than 20 time steps, pad the time feature sequence with zeros. Step S1.4: Create a raw Boolean padding mask tensor Tcmask to explicitly identify the padding position.

3. The lithium battery SOH estimation method based on multi-scale dual-time series Mamba as described in claim 2, characterized in that, The specific steps in step S2 are as follows: Step S2.1: Input the time feature sequence First it is transposed, where This represents the real number field, where the superscript indicates the corresponding dimension and shape. Indicates batch size. Indicates the length of the time feature sequence. Represent the feature dimension; then segment along the time dimension to obtain Subsequences , Where i is the subsequence index, and its value ranges from 1 to 1. ; when hour, Defined as: ; when hour, Defined as: ; in, Denotes the i-th subsequence after splitting and transposing; where, It is the standard segment length. , It is the total number of subsequences; It is the time feature sequence after the transpose operation. This indicates indexing operators, where the comma represents the dimension separator and the colon represents the slicing operator. Indicates the transpose operation; Step S2.2: Perform depthwise convolution enhancement for each subsequence, as shown in the following formula: ; in, This represents the i-th subsequence after depthwise convolution enhancement. It is a learnable scalar. Indicates a depthwise convolution operation; Step S2.3: Extract the global feature vector for each subsequence by performing average pooling along the time dimension: ; in, It is the global feature vector of the i-th subsequence. It is the time step index within the subsequence. This represents the actual length of the i-th subsequence; The comma represents the dimension separator, and the colon represents the slicing operator. Step S2.4: Calculate the cumulative feature vector of each subsequence based on the global feature vector: ; ; ; in, It is the cumulative feature vector of the i-th subsequence. It is the first -1 cumulative feature vectors of subsequences; and , ; It is the global feature vector of the i-th subsequence; This is the initial cumulative feature vector. This is an eigenvector where all elements have zero values; A gating network is used to independently compute the gating weights for each subsequence: ; in, It is the gating weight of the i-th subsequence. This indicates that global adaptive average pooling will be performed. express Convolutional projection layer; express function; This represents the indexing operators, where the comma indicates the dimension separator and the colon indicates the slicing operator; indexing operations This indicates the gating weights for extracting the current subsequence; Based on the gate weights, a weighted operation is performed, as shown in the following formula: ; in, Represents the i-th gated subsequence. This represents the i-th subsequence after depthwise convolution enhancement. Represents element-wise multiplication, with gated weights. Through broadcasting mechanism and Perform element-wise multiplication; Step S2.5: Concatenate the gated subsequences along the time dimension to obtain the concatenated reconstructed sequence: ; in, Indicates the concatenation and reconstruction of the sequence. This indicates a splicing operation. Indicates the length of the concatenated and reconstructed sequence. , This represents the actual length of the i-th subsequence; Length correction is performed on the spliced ​​and reconstructed sequence. If the length is inconsistent with the length of the time feature sequence, then it is updated. Its sliced ​​portion: ; in, The comma represents the dimension separator, and the colon represents the slicing operator. Step S2.6: Combining residual connections and regularization, obtain the enhanced feature sequence output by the multi-scale sparse scanning module: ; in, It is the enhanced feature sequence output by the multi-scale sparse scanning module. ; Indicates to Perform a transpose operation; For layer normalization function, For the dropout function, The input is a time feature sequence.

4. The lithium battery SOH estimation method based on multi-scale dual-time series Mamba as described in claim 3, characterized in that, The specific steps for constructing the first layer of the hierarchical dual temporal attention module in step S3 are as follows: Step S3.1.1: Analyze the enhanced feature sequence output by the multi-scale sparse scanning module. Remodeling into feature groups: ; in, It refers to the batch size. It is the length of the time feature sequence. Representing feature dimension, It is the number of feature groups. It is the feature dimension within each feature group; It is the tensor obtained after the input feature tensor has undergone dimensionality reshaping; Step S3.1.2: The input features of each feature group are transformed using the shared linear projection matrix of the first layer: ; in, For the first The input features of each feature group are specifically from... Extracted from the first The feature components corresponding to each feature group It is a linear projection matrix shared by all feature groups; It is the first Feature representation of a feature group after projection; It is the index variable of the feature group, and its value range is... ; Step S3.1.3: For each feature group, after projection, perform multi-scale feature enhancement using depthwise convolution: ; in, Indicates the first layer Each feature group enhances the query features through convolution; Represents a dimension replacement operation. This represents a one-dimensional depthwise convolution operation; Step S3.1.4: Based on the query features enhanced by convolution, calculate the attention output features for each feature group: ; ; ; in, It is the first The original attention score matrix of each feature group has a dimension of ... Consistent; It is a learnable parameter, initialized to ; It is the first layer of the hierarchical dual temporal attention module. Normalized attention weights for each feature group; express function; This represents a matrix of all 1s in the first layer of the hierarchical dual temporal attention module; It is by using a query mask and key mask The padding mask generated during the broadcast operation, wherein... It is obtained by extending the original Boolean padding mask tensor Tcmask along the key dimension. It is obtained by expanding the original Boolean padding mask tensor Tcmask on the query dimension; It is the first Attention output features of each feature group; Step S3.1.5: For the attention output features of each feature group, first weight them using learnable parameters normalized by Softmax, then recombine them to recover the original feature dimensions: ; ; ; in, It is a learnable original weight vector. This represents the cross-group fusion weight vector. It is the first Normalized weights for each feature group; Indicates the first Attention output features of each feature group According to their corresponding normalized weights The weighted feature set output; This indicates that the weighted feature set will be output. Reshape or stitch along the feature dimension Represents the aggregated feature tensor; Step S3.1.6: For the aggregated feature tensor Integration is achieved through internal control mechanisms: ; in, It is a learnable scalar gating parameter. It is the sigmoid activation function. It is the output of the first layer of the hierarchical dual-temporal attention module; The enhanced feature sequence output by the multi-scale sparse scanning module; Step S3.1.7: Apply residual connections after the first layer of the hierarchical dual temporal attention module: ; in, This represents the normalized output of the first layer of the hierarchical dual temporal attention module. This is the layer normalization function.

5. The lithium battery SOH estimation method based on multi-scale dual-time series Mamba as described in claim 4, characterized in that, The specific steps for constructing the second layer of the hierarchical dual temporal attention module in step S3 are as follows: Step S3.2.1: First, inject position information using a fixed sine coding scheme: ; ; in, Indicates the time step index within the window sequence. Indicates embedded dimension index, This represents the generated position encoding matrix; , Representing time steps The positional encoding matrix at the time of the first time indivual, Elements at a given dimension; Step S3.2.2: Add the position encoding matrix to the first layer normalized output of the hierarchical dual temporal attention module: ; in, This represents the normalized output of the first layer of the hierarchical dual temporal attention module. For location-aware feature tensors; Step S3.2.3: For position-aware feature tensors The effect of time-dependent gating on position coding is modulated: ; in, These are the scalar gating parameters for the first layer, initialized to 1.

0. For time-enhanced features; It is the sigmoid activation function; Step S3.2.4: Add temporal enhancement features Reshape into G feature groups, and obtain the th feature through the shared linear projection matrix and depthwise convolution operation in the second layer. Enhanced query features targeting causal paths. : ; ; ; in, It is the first The original causal attention score matrix of each feature group has a dimension of ... Consistent, It is the normalized attention weight of the kth feature group in the second layer of the hierarchical dual temporal attention module; This represents a matrix of all ones in the second layer of the hierarchical dual temporal attention module. Indicates the second layer Each feature group enhances the query features through convolution; These are independent learnable parameters in the second layer; It is a causal mask With padding mask The intersection; among which, It is constructed by generating an upper triangular Boolean matrix to ensure that the current time step can only focus on itself and information from past times; It is a time-enhanced feature In the The components of each feature group; Indicates the first Attention output features of each feature group; express function; Step S3.2.5: For the first Attention output features of each feature group The aggregated feature tensor is obtained by cross-group weight fusion. ,against Integration is achieved through internal control mechanisms: ; in, These are the scalar gating parameters of the second layer. It is an aggregated feature tensor; It is the output of the second layer of the hierarchical dual-temporal attention module; Step S3.2.6: Apply residual connections after the second layer of the hierarchical dual-temporal attention module: ; in, This represents the normalized output of the second layer of the hierarchical dual temporal attention module; It is the output of the second layer of the hierarchical dual temporal attention module.

6. The lithium battery SOH estimation method based on multi-scale dual-time series Mamba as described in claim 5, characterized in that, In step S3, for the first-layer normalized output of the hierarchical dual-temporal attention module and the second-layer normalized output of the hierarchical dual-temporal attention module, an adaptive weighting method is used to combine the normalized outputs of the two layers: ; ; in, and These are the normalized outputs of the first and second layers of the hierarchical dual temporal attention module, respectively. It is an adaptive weighted fusion feature; This is the final output; It is a learnable fusion weight, initialized to 0.5; It is a layer normalization function. It's the dropout function.

7. The lithium battery SOH estimation method based on multi-scale dual-time series Mamba as described in claim 6, characterized in that, The specific steps in step S4 are as follows: Step S4.1: Construct the state-space model, with the core equations as follows: ; in, and They are time steps and The hidden state at that time; , They correspond to , The discretized dynamic matrix is ​​calculated as follows: ; ; in, It is a learnable diagonal matrix. Represents the matrix exponential function. Indicates the time step. Represents the input matrix, and Based on the current Dynamically generated via linear projection layers; Step S4.2: Introduce residual join, as shown in the following equation: ; in, It is a dynamic output matrix. This represents the weight vector for through connections; This indicates that the state-space model is at time step Local output at that time; Step S4.3: For the state-space model at time step Local output at time The battery health status is mapped through a regression layer, as shown in the following formula: ; In the formula, Represents time step Normalized battery health state estimate at time, This is the weight matrix. For bias terms, Based on the current Gated branch signals generated by linear projection layers To output the projection matrix, yes The residual feature components obtained after independent linear transformation layers For learnable adaptive scaling factors, This represents element-wise multiplication. Represents the ReLU activation function. This represents the SiLU activation function.

Citation Information

Patent Citations

  • Time sequence anomaly detection method and system based on combination of hierarchical adaptive attention and Mama

    CN120508850A

  • Distributed energy storage equipment charge state prediction method and system based on diffusion bridging

    CN121142346A