Battery life prediction method and device based on state diagram and self-attention mechanism

By adopting a battery life prediction method based on state diagrams and self-attention mechanisms, the limitations of existing lead-acid battery prediction methods in feature engineering, time-series dynamic modeling, and utilization of state structure information are overcome. This method achieves more accurate and robust battery life prediction, improving the prediction accuracy and adaptability of battery health status.

CN122449376APending Publication Date: 2026-07-24709TH RESEARCH INSTITUTE CHINA STATE SHIPBUILDING CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610524951.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-21
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing methods for health management and life prediction of lead-acid batteries have limitations in feature engineering, time-series dynamic modeling, and utilization of state structure information. They are difficult to deeply integrate time-series dynamics and system structure information, resulting in low prediction accuracy and insufficient robustness.

Method used

A battery life prediction method based on state graphs and self-attention mechanisms is adopted. By constructing cascaded feature extraction and prediction modules, information propagation is carried out in the local topological space using graph convolutional networks, and attention weighting is performed in the global sequence space through the Transformer architecture to integrate state graph information. A phase-aware weight function is designed to optimize the loss function.

Benefits of technology

It improves the accuracy and robustness of battery life prediction, can more comprehensively capture the complex dynamic changes and degradation patterns of battery performance, enhances adaptability to noise and small sample sizes, and ensures battery safety and prediction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122449376A_ABST
    Figure CN122449376A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of battery life prediction, in particular to a battery life prediction method and device based on a state diagram and a self-attention mechanism, which comprises the following steps: acquiring battery state parameter values in a preset time window, and constructing the battery state parameter values into a time sequence feature graph; a battery life prediction model is constructed, wherein the battery life prediction model comprises a cascaded feature extraction module and a prediction module; information propagation of the time sequence feature graph is carried out on a local topological space through the feature extraction module, so that a feature enhancement matrix is obtained; attention weighting of the feature enhancement matrix is carried out on a global sequence space through the prediction module, so that a secondary feature sequence is obtained, and the battery health state is obtained through prediction based on the secondary feature sequence. The application can simultaneously deeply fuse an end-to-end prediction framework of time sequence dynamics and system structure information, improve the prediction accuracy, and guarantee the safety of the battery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of battery life prediction technology, and in particular to a battery life prediction method and apparatus based on state diagrams and self-attention mechanisms. Background Technology

[0002] In the field of lead-acid battery health management and life prediction, building high-precision and robust prediction models is crucial for achieving predictive maintenance. However, existing prediction methods still have significant limitations in feature engineering, model architecture, and data utilization, specifically in the following aspects: First, at the feature construction and representation level, current mainstream methods heavily rely on expert experience for manual feature engineering, typically extracting statistical features from data such as charge-discharge curves, voltage, temperature, and cycle count. This approach has two inherent drawbacks: first, it struggles to fully capture the complex nonlinear coupling relationships between parameters and their dynamic evolution during battery degradation; second, the manually designed feature selection process is highly subjective, easily overlooking key degradation characterization information hidden in the data, thus limiting the feature representation capability and consequently restricting the upper limit of model performance.

[0003] Secondly, at the level of time-series dynamic modeling, battery life degradation is a typical time-dependent process, with historical states profoundly influencing future performance trends. Shallow models such as linear regression and support vector machines are inherently incapable of characterizing this long-range, complex time-series dependency. While recurrent neural networks and their variants (such as LSTM) have made improvements in this area, their sequential processing mechanisms often face gradient vanishing or exploding problems, and their ability to model long-term dependencies in long sequences remains inadequate. This makes it difficult for existing models to fully explore and utilize the deep correlation between historical states and future trends.

[0004] Furthermore, regarding the utilization of state structure information, the operating state of a lead-acid battery is essentially a complex system composed of the interaction of multiple parameters. Its internal variables (such as current, voltage, and temperature) exhibit a strongly correlated topological structure. However, traditional methods generally treat these parameters as independent or simple, flat features, completely ignoring their inherent structured interactions. This neglect of system mechanism information prevents the model from grasping the battery's health state from a holistic system perspective.

[0005] Furthermore, in terms of robustness in practical applications, traditional solutions are less adaptable. Many existing models are sensitive to data quality and the size of labeled samples. In industrial scenarios with measurement noise, outliers, or limited labeled data, their predictive performance and generalization ability will significantly degrade, limiting their reliable deployment in real and complex environments.

[0006] In summary, existing methods cannot simultaneously and deeply integrate end-to-end prediction frameworks with temporal dynamics and system structure information, resulting in low prediction accuracy.

[0007] Therefore, overcoming the shortcomings of the existing technology is an urgent problem to be solved in this technical field. Summary of the Invention

[0008] To address the aforementioned deficiencies or improvement needs of existing technologies, this invention proposes a battery life prediction method and device based on state diagrams and self-attention mechanisms. This end-to-end prediction framework can simultaneously and deeply integrate temporal dynamics and system structure information to improve prediction accuracy and ensure battery safety.

[0009] The embodiments of the present invention adopt the following technical solutions: In a first aspect, the present invention provides a battery life prediction method based on state graphs and self-attention mechanisms, specifically: obtaining battery state parameter values ​​within a preset time window, and constructing the battery state parameter values ​​into a time-series feature graph; A battery life prediction model is constructed, wherein the battery life prediction model includes a cascaded feature extraction module and a prediction module; The feature extraction module performs information propagation on the temporal feature map in the local topological space to obtain the feature enhancement matrix. The prediction module applies attention weights to the feature enhancement matrix in the global sequence space to obtain a secondary feature sequence, and then makes a prediction based on the secondary feature sequence to obtain the battery health status.

[0010] Preferably, the method further includes: Based on the actual degradation patterns of batteries, a weighting function is designed during the design phase; The stage-aware weight function is incorporated into the mean squared error loss function to obtain the total loss function; During the training process of the battery life prediction model, the total loss value is calculated based on the actual remaining lifespan of the training samples and the lifespan prediction value output by the battery life prediction model, and the network parameters are updated iteratively multiple times based on the total loss value.

[0011] Preferably, the stage-aware weight function is as follows: ; in, Indicates the first The weights of each training sample at the current time. , and These are adjustable hyperparameters. Indicates the first The SOH of each training sample at the current time. and These are capacity thresholds for different stages of battery degradation.

[0012] Preferably, the total loss function is as follows:

[0013] in, This represents the total loss value. Indicates batch size. Indicates the first The true remaining lifetime of each training sample Indicates the first Lifetime prediction values ​​for each training sample. Indicates the first The SOH of each training sample at the current time. Indicates the first The weights of each training sample at the current time.

[0014] Preferably, the step of acquiring battery state parameter values ​​within a preset time window and constructing a time-series feature map from the battery state parameter values ​​includes: Different categories of battery state parameter values ​​are defined as node entities in the time sequence graph network; All battery state parameter values ​​are divided according to category to obtain a set of time series data corresponding to each node; Each set of time-series data is vectorized to obtain the feature vector corresponding to each node; Calculate the correlation value between the feature vectors corresponding to any two nodes, and use the correlation value as the weight of the edge connecting the two nodes in the time series feature graph.

[0015] Preferably, the step of propagating information from the temporal feature map in the local topological space through the feature extraction module to obtain the feature enhancement matrix includes: Construct a node feature matrix based on the feature vectors of all nodes; Construct an adjacency matrix based on the weights of the edges connecting two nodes in the temporal feature graph; Using the adjacency matrix and the node feature matrix, multi-level neighbor information aggregation is performed on each node in the time-series feature graph to obtain a feature enhancement matrix, wherein each row of the feature enhancement matrix is ​​a feature enhancement vector for each node.

[0016] Preferably, the step of performing attention weighting on the feature enhancement matrix in the global sequence space through the prediction module to obtain a secondary feature sequence, and then predicting the battery health status based on the secondary feature sequence, includes: Flatten the feature enhancement matrix into a sequence, where each element in the sequence is the feature enhancement vector of each node; A learnable positional code is introduced for each element in the sequence to obtain a positional feature sequence; The positional feature sequence is learned using a multi-head attention mechanism to obtain a secondary feature sequence; The secondary feature sequence is compressed into a global feature vector of fixed size, and the global feature vector is mapped to the battery health status.

[0017] Preferably, the step of learning the positional feature sequence using a multi-head attention mechanism to obtain a secondary feature sequence includes: For each first feature vector in the location feature sequence, calculate the attention weight between the first feature vector and all first feature vectors in the location feature sequence; The second feature vector corresponding to the first feature vector is obtained by weighted aggregation based on the attention weight and all first feature vectors. The second feature vectors are combined to obtain the quadratic feature sequence.

[0018] In a second aspect, the present invention provides a battery life prediction device based on state diagrams and self-attention mechanisms, the device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the processor to perform the battery life prediction method based on state diagrams and self-attention mechanisms in the first aspect.

[0019] Thirdly, the present invention also provides a non-volatile computer storage medium storing computer-executable instructions that are executed by one or more processors to perform the battery life prediction method based on state diagrams and self-attention mechanisms described in the first aspect.

[0020] Compared with existing technologies, the advantages of this invention are as follows: By cascading the feature extraction module and the prediction module to build a battery life prediction model, the feature extraction module performs information propagation in the local topological space (parameter relationship graph), solving the problem of traditional methods ignoring the intrinsic relationships between parameters; and by using the prediction module to perform attention weighting in the global sequence space, a progressive feature learning from local correlation enhancement to global feature focusing is achieved. This design can overcome the limitations of traditional methods, more comprehensively and accurately capture the complex dynamic changes and degradation patterns of battery performance, and by integrating state graph information, it can extract key characteristics from multi-dimensional variables, making full use of the structured information and global temporal relationships implicit in the data, thereby improving prediction accuracy and ensuring battery safety. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0022] Figure 1 This is a schematic flowchart of a battery life prediction method based on state diagrams and self-attention mechanisms provided in an embodiment of the present invention. Figure 2 This is an overall model structure diagram of a battery life prediction system based on state diagrams and self-attention mechanisms provided in an embodiment of the present invention. Figure 3 This is a flowchart of a battery life prediction model training method provided in an embodiment of the present invention, which is based on a state diagram and a self-attention mechanism for battery life prediction. Figure 4 This is a flowchart of the preprocessing process in a battery life prediction method based on state diagrams and self-attention mechanism provided in an embodiment of the present invention. Figure 5 This is a flowchart of the feature extraction module in a battery life prediction method based on state diagrams and self-attention mechanism provided in an embodiment of the present invention. Figure 6 This is a flowchart of the prediction module in a battery life prediction method based on state diagrams and self-attention mechanism provided in an embodiment of the present invention. Figure 7 This is a flowchart of a method for obtaining a secondary feature sequence in a battery life prediction method based on a state diagram and a self-attention mechanism, provided in an embodiment of the present invention. Figure 8 This is a schematic diagram of a battery life prediction device based on a state diagram and self-attention mechanism, provided in an embodiment of the present invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0024] Unless the context otherwise requires, throughout the specification and claims, the term "comprising" is interpreted as openly inclusive, meaning "including, but not limited to." In the description of the specification, terms such as "one embodiment," "some embodiments," "exemplary embodiment," "example," "specific example," or "some examples" are intended to indicate that a particular feature, structure, material, or characteristic associated with that embodiment or example is included in at least one embodiment or example of this disclosure. The illustrative representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics mentioned may be included in any suitable manner in any one or more embodiments or examples; that is, although they may be incorporated into embodiments or examples using the above terms for reasons such as order and position, it does not limit them to be incorporated in combination by a single embodiment or example.

[0025] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this disclosure, unless otherwise stated, "a plurality of" means two or more. Furthermore, for example, the description may use the prefix "A" or "B" to describe the same type of nouns as two independent entities. In this case, the corresponding features defined with "A" and "B" are used only to distinguish between similar entities and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features.

[0026] In the description of this invention, the expression “A and / or B” (where A and B are used to formally represent specific features) will be used. The corresponding expression includes the following three combinations: only A, only B, and a combination of A and B.

[0027] As used in this invention, “about,” “approximately,” or “approximately” includes the stated value and the average value within an acceptable range of deviation from a particular value, wherein the acceptable range of deviation is determined by a person skilled in the art taking into account the measurement under discussion and the error associated with the measurement of the particular quantity (i.e., the limitations of the measurement system).

[0028] Furthermore, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0029] Example 1: like Figure 1 As shown, Embodiment 1 of the present invention provides a battery lifetime prediction method based on state diagrams and self-attention mechanisms. The method specifically includes the following steps: Step 101: Obtain the battery status parameter values ​​within a preset time window, and construct a time-series feature map from the battery status parameter values.

[0030] In one embodiment, based on chemical composition, batteries can be classified into alkaline batteries, lithium batteries, nickel-metal hydride batteries, and lead-acid batteries. The battery life prediction method in this invention is mainly for predicting the remaining life of lead-acid batteries. The battery state parameter values ​​include each state parameter of the battery (including voltage, current, and temperature, etc.).

[0031] Specifically, the battery state parameter values ​​are converted into time-series feature maps. This approach leverages the expressive power of graph structures to enhance the potential relationships between battery state parameter values, thereby comprehensively characterizing the evolution of lead-acid battery state parameters over time and the dynamic changes in their correlations.

[0032] Each time-series feature map , V represents Node set, Represents the node feature vector. E indicates In the graph structure constructed in this embodiment of the invention, each node represents a feature vector of a time step, and the edges represent the correlation between different time steps.

[0033] Step 102: Construct a battery life prediction model, wherein the battery life prediction model includes a cascaded feature extraction module and a prediction module.

[0034] In one embodiment, the Transformer architecture, with its self-attention mechanism, demonstrates superior global dependency capture capabilities in the field of temporal modeling. Meanwhile, graph neural networks, due to their powerful representation capabilities for non-Euclidean space data, provide new approaches to modeling complex relationships between parameters. Therefore, this embodiment of the invention uses the Transformer architecture as the foundation for the prediction module and the graph neural network as the foundation for the feature extraction module. (See reference...) Figure 2The battery life prediction model is built by cascading the feature extraction and prediction modules. In its application, the original battery state parameter values ​​are used to construct a time-series feature map. Features from this map are extracted by the feature extraction module, and the output of the feature extraction module is used as the input to the prediction module. The output of the prediction module is then mapped through a fully connected layer to obtain the final predicted value. Specifically, a graph convolutional network is used to aggregate neighbor information in the fixed time-series feature map layer by layer to achieve local smoothing, capturing the short-range dependency information of the battery parameter network and obtaining enhanced features. The enhanced features are processed using a Transformer architecture, which directly calculates the global correlation between all node pairs within a single layer using a self-attention mechanism. This allows for a macroscopic understanding of the key factors affecting lifespan. This architecture design, by introducing the Transformer's self-attention mechanism, effectively models long-range dependencies, improves prediction accuracy, and reduces reliance on large-scale labeled data, thus lowering actual deployment costs.

[0035] Step 103: The feature extraction module performs information propagation on the temporal feature map in the local topological space to obtain the feature enhancement matrix.

[0036] In one embodiment, based on the temporal feature map constructed in step 102, in order to establish the temporal correlation between different data and extract their potential feature information, this embodiment of the invention uses a graph convolutional network (GCN) to process the temporal feature map. After multi-layer GCN processing, the feature extraction module outputs a feature enhancement matrix. Its dimensions are [N, F], where F is the feature dimension after GCN enhancement. This matrix is ​​the result of the diffusion and condensation of the original node features in the battery parameter relationship graph.

[0037] Step 104: The prediction module performs attention weighting on the feature enhancement matrix in the global sequence space to obtain a secondary feature sequence, and makes a prediction based on the secondary feature sequence to obtain the battery health status.

[0038] In this embodiment of the invention, the remaining capacity or remaining effective cycle time of the battery is used to characterize the battery health state. That is, the battery life prediction model outputs the historical battery health state (SOH) and the historical battery state of charge (SOC).

[0039] In one embodiment, the Transformer architecture employs a multi-layer encoder stack structure to enhance the feature matrix output by the GCN module. As input to this module, the feature enhancement matrix is ​​further refined and focused using the Transformer's self-attention mechanism. The use of a Transformer architecture based on state graph information for lead-acid battery lifetime prediction overcomes the limitations of traditional methods, capturing the complex dynamic changes and degradation patterns of battery performance more comprehensively and accurately. By integrating state graph information, this method can extract key characteristics from multi-dimensional variables, fully utilizing the structured information and global temporal relationships implicit in the data, providing a more reliable solution for battery lifetime prediction. The design of this method improves its adaptability to small sample sizes and noisy data.

[0040] In this embodiment, the feature extraction module and the prediction module are cascaded to build a battery life prediction model. The feature extraction module performs information propagation in the local topological space (parameter relationship graph), solving the problem of traditional methods ignoring the intrinsic relationships between parameters. The prediction module performs attention weighting in the global sequence space, realizing progressive feature learning from local correlation enhancement to global feature focus. This design can overcome the limitations of traditional methods, more comprehensively and accurately capture the complex dynamic changes and degradation patterns of battery performance, and by integrating state graph information, it can extract key characteristics from multi-dimensional variables, making full use of the structured information and global temporal relationships hidden in the data, thereby improving prediction accuracy and ensuring battery safety.

[0041] By integrating the feature extraction module, the prediction module, and the loss function, the model not only gains insight into the microstructure of the battery parameter network but also grasps the key factors affecting lifespan from a macroscopic perspective, thereby significantly improving the accuracy, generalization, and interpretability of the prediction model.

[0042] Because the degradation process of lead-acid batteries is non-linear, it is typically divided into a healthy period, a slow degradation period, and an accelerated degradation period. The training samples for each of these different degradation processes contain different information. Traditional methods for training models generally use Mean Squared Error (MSE) as the loss function, measuring model accuracy by calculating the average of the squared errors between predicted and true values. However, MSE treats all training samples equally and cannot accurately reflect the non-linear degradation process of lead-acid batteries. (See [reference needed]). Figure 3 The battery life prediction method based on state diagrams and self-attention mechanisms also includes training the battery life prediction model, specifically including the following steps: Step 201: Based on the actual degradation patterns of the battery, design the phase perception weight function.

[0043] Since the inflection point and accelerated degradation phase in the battery degradation process are most critical for accurately predicting remaining lifespan, small errors in the early stages can lead to large deviations in the later stages. To make the battery life prediction model pay more attention to the prediction accuracy near the inflection point and accelerated degradation phase during training, this embodiment of the invention constructs a stage-aware weight function related to the actual battery capacity or cycle life to dynamically adjust the importance of each training sample in the loss function. Here, "near the inflection point" refers to the inflection point from the healthy period to the slow degradation period, and the inflection point from the slow degradation period to the accelerated degradation period. The stage-aware weight function is shown in the following formula: ; in, Indicates the first The weights of each training sample at the current time. , and These are adjustable hyperparameters. Indicates the first The SOH of each training sample at the current time. and These are capacity thresholds for different stages of battery degradation.

[0044] , and The three parameters correspond to low weights for training samples during the healthy period, medium weights for training samples during the slow decline period, and high weights for training samples during the accelerated decline period. For example, [the following is an example of a parameter related to weighting training samples during the healthy period]. , and The values ​​are set to 1, 3, and 5 respectively to dynamically adjust the importance of training samples at different degradation stages during the training process; and The percentages were set to 90% and 80% respectively to distinguish the different degradation processes of the training samples.

[0045] Step 202: Integrate the stage-aware weight function into the mean squared error loss function to obtain the total loss function.

[0046] In one embodiment, the total loss function is shown in the following equation:

[0047] in, This represents the total loss value. Indicates batch size. Indicates the first The true remaining lifetime of each training sample Indicates the first Lifetime prediction values ​​for each training sample. Indicates the first The SOH of each training sample at the current time. Indicates the first The weights of each training sample at the current time.

[0048] Step 203: During the training process of the battery life prediction model, the total loss value is calculated based on the actual remaining lifespan of the training samples and the lifespan prediction value output by the battery life prediction model, and the network parameters are updated iteratively multiple times based on the total loss value.

[0049] In one embodiment, long-term battery state parameter values ​​are extracted from the long-term operation records of lead-acid batteries, and the battery state parameter values ​​are fragmented by a sliding window to obtain multiple time-series feature maps of battery changes over time. A dataset is constructed using multiple time-series feature maps, and the dataset is divided into training set, validation set and test set according to a certain ratio to ensure that the data distribution of each part is balanced and there is no information leakage.

[0050] Specifically, the sliding window moves across the aforementioned long-term series at a certain time step, generating multiple partially overlapping time segments to preserve the continuity of the time series. To further integrate the spatial and temporal information of the time series, each time segment is transformed into a temporal feature map. .

[0051] During the training of the battery life prediction model, a supervised learning method was adopted, using historical battery state data as input and SOH and SOC as prediction targets. A total loss function was defined to optimize the model. To prevent overfitting, regularization techniques and early stopping strategies were also used during training. The model performance was evaluated in real time through the validation set, while the test set was used to evaluate the model's generalization ability and prediction accuracy.

[0052] It is important to note that during model training, the battery state parameter values ​​of the long-term series are divided into multiple segments, allowing the battery life prediction model to learn the remaining lifespan of the current battery based on a small segment of feature data. When applying the model, a small segment of past battery state parameter values ​​is input, and then the remaining lifespan of the current battery is predicted.

[0053] Based on the stage-aware weight function designed above, the battery life prediction model can be forced to focus its limited attention resources on predicting the most difficult and important life stage (mid-to-late stage of degradation), thereby significantly improving the prediction accuracy in these key stages. At the same time, this loss function effectively reduces the interference of early noise on the overall optimization of the model by reducing the weight of this stage, making the training process more stable.

[0054] In one embodiment, the battery life prediction model obtained after training is deployed in a battery detection system. The actually collected battery state parameters are preprocessed and then input into the deployed battery life prediction model. The model predicts the current SOH and SOC values. In addition, to improve the deployment efficiency, the battery life prediction model is quantized and optimized on an edge device to ensure that large-scale data can still be processed in real time under limited computing resources. Furthermore, the deployed battery life prediction model runs in long-term linkage with the battery device to generate SOH and SOC trend curves, providing a scientific basis for the health assessment, maintenance plan, and life management of the battery.

[0055] The inference process of the battery life prediction model for processing the time series feature map to obtain the life prediction value is the same as the training process. The inference process of the battery life prediction model includes a preprocessing process, the processing process of the feature extraction module, and the processing process of the prediction module. Refer to Figure 4 The battery life prediction method based on the state graph and self-attention mechanism further includes a preprocessing process, which specifically includes the following steps: Step 301: Define the battery state parameter values of different categories as node entities in the time series graph network.

[0056] In one embodiment, each category of battery state parameter values refers to voltage, current, temperature, etc. Each category is a node entity in the graph structure. Let the node set be where each v represents a specific battery parameter, and

[0057] is the total number of nodes.

[0058] In one embodiment, interpolation and normalization processing are performed on the battery state parameter values to eliminate missing values and dimensional differences, thereby improving data consistency. The collected battery state parameter values are processed separately according to their types. A set of time series data corresponding to each node refers to the data of the state parameter changing with time. For example, a node entity corresponds to voltage, and the corresponding time series data is the voltage value changing with time.

[0059] Step 303: Perform vectorization processing on each set of time series data to obtain the feature vector corresponding to each node.

[0060] In one embodiment, for each node , extract the data series of this node within a preset time window length T and perform vectorization processing on the data series to form the feature vector of this node, where the preset time window length TThe settings are based on the actual data sampling frequency and prediction requirements.

[0061] Step 304: Calculate the correlation value between the feature vectors corresponding to any two nodes, and use the correlation value as the weight of the edge connecting the two nodes in the time series feature graph.

[0062] In one embodiment, to quantify the dynamic association strength between nodes, a set of edges between nodes is constructed. E, Calculate the correlation coefficient between any two nodes using the Pearson correlation coefficient and eigenvectors and The correlation between the nodes is used as the edge connecting the two nodes. weight The formula for calculating the correlation value is as follows: ; in, This indicates connecting any two nodes. and The weight of the edge. Representing the eigenvector and covariance, and denoted as the standard deviation of its eigenvectors.

[0063] See Figure 5 The battery life prediction method based on state diagrams and self-attention mechanisms also includes a feature extraction module, specifically comprising the following steps: Step 401: Construct a node feature matrix based on the feature vectors of all nodes.

[0064] The node feature matrix is ​​an N×F matrix, where each row of the node feature matrix is ​​a feature vector of a node.

[0065] Step 402: Construct an adjacency matrix based on the weights of the edges connecting two nodes in the time-series feature graph.

[0066] The adjacency matrix can be represented by 0 and 1 to indicate whether nodes are connected, or by specific data. In this embodiment, the weights of the edges connecting two nodes are recorded in the corresponding positions of the adjacency matrix to construct the adjacency matrix. In addition, this method assumes that there is a connection between each node, but the strength of the connection varies.

[0067] Step 403: Using the adjacency matrix and the node feature matrix, perform multi-level neighbor information aggregation processing on each node in the time-series feature graph to obtain a feature enhancement matrix, wherein each row of the feature enhancement matrix is ​​a feature enhancement vector for each node.

[0068] Unlike existing technologies that treat battery parameters as independent feature vectors, this invention explicitly models and enhances the intrinsic correlation between battery parameters through graph convolutional networks (GCNs). Each layer of the GCN enables the features of each node to aggregate information from its neighbors (i.e., other parameters that are strongly correlated with the current node). This process simulates the transmission effect of multi-physics coupling within the battery. After multiple layers of stacked GCNs, the features contained in each node are no longer isolated, but carry contextual information within the entire parameter relationship network, thereby generating a set of deeply correlated and enhanced node features.

[0069] Specifically, the temporal feature map from step 102 is used as the input to the feature extraction module. After multi-layer processing by the graph neural network, a feature enhancement matrix is ​​obtained. In this embodiment, the feature extraction module includes 3 layers of GCN, and the graph convolution operation of each layer is shown in the following formula:

[0070] in, Represents the node features of the (l+1)th layer. Indicates the first The node feature matrix of the layer It is a normalized adjacency matrix. It is a trainable parameter weight matrix. It is the ReLU activation function.

[0071] See Figure 6 The battery life prediction method based on state diagrams and self-attention mechanisms also includes a prediction module processing procedure, specifically comprising the following steps: Step 501: Flatten the feature enhancement matrix into a sequence, where each element in the sequence is the feature enhancement vector of each node.

[0072] In one embodiment, the feature enhancement matrix is ​​an N×F matrix. The prediction module extracts features using a Transformer architecture and combines it with a fully connected layer to output the lifetime prediction. Since the Transformer architecture processes sequence data, the feature enhancement matrix needs to be... Flattened, it is a sequence of length N, where each element is an F-dimensional feature vector.

[0073] Step 502: Introduce a learnable positional code for each element in the sequence to obtain a positional feature sequence.

[0074] To adapt to the sequence processing mode of Transformer, this embodiment of the invention treats the flattened sequence as an unordered set. To provide the necessary sequence order information for the battery life prediction model, each element in the sequence is introduced into a learnable positional encoding, which is then combined with the enhanced node features. The summation yields a sequence of location features, a design that provides flexibility to the model without requiring a predefined fixed order of parameters.

[0075] Step 503: Perform multi-head attention mechanism learning on the position feature sequence to obtain a secondary feature sequence.

[0076] In one embodiment, the feature sequence with embedded location information is input into a multi-layer Transformer encoder. The core of each encoder layer is a multi-head self-attention mechanism, which enables the battery life prediction model to automatically focus on the key parameters and their combinations that are most sensitive to capacity decay or end of life (e.g., the correlation between changes in a specific voltage range and temperature rise). In addition, through the multi-head mechanism, the battery life model can learn a variety of complex dependencies in parallel in different representation subspaces, thereby achieving secondary refinement and focusing of the enhanced features.

[0077] Step 504: Compress the secondary feature sequence into a global feature vector of fixed size, and map the global feature vector to the battery health status.

[0078] Specifically, a global average pooling layer is used before the prediction output layer to aggregate the secondary feature sequence output by the Transformer and compress it into a global feature vector of a fixed size. This global feature vector is then mapped to the final predicted value through a fully connected layer. The predicted value includes the remaining battery capacity or the remaining effective cycle time.

[0079] See Figure 7 The step of learning the positional feature sequence using a multi-head attention mechanism to obtain a secondary feature sequence specifically includes the following steps: Step 601: For each first feature vector in the location feature sequence, calculate the attention weight between the first feature vector and all first feature vectors in the location feature sequence.

[0080] In one embodiment, for each first feature vector in the location feature sequence, when calculating the current first feature vector, the information of other first feature vectors in the sequence is aggregated for the current first feature vector by calculating the attention weight between the current first feature vector and other first feature vectors in the location feature sequence. The magnitude of the attention weight can characterize the importance of other information to the current first feature vector. Therefore, the attention weight enables the battery life prediction model to automatically focus on the key parameters and their combinations that are most sensitive to capacity decay or end of life (e.g., the correlation pattern between changes in a specific voltage range and temperature rise).

[0081] Step 602: Perform weighted aggregation based on attention weights and all first feature vectors to obtain the second feature vector corresponding to the first feature vector.

[0082] In one embodiment, for the current first feature vector, the attention weight calculated above is used as a weight, and a weighted sum is performed with each first feature vector in the position feature sequence to obtain the second feature vector.

[0083] Step 603: Combine all the second feature vectors to obtain the secondary feature sequence.

[0084] The secondary feature sequence is a sequence of length N, and each element in the sequence is an F-dimensional feature vector (that is, based on the first feature vector, it aggregates the information of other first feature vectors in the sequence).

[0085] Example 2: Based on the battery life prediction method based on state diagrams and self-attention mechanisms provided in the foregoing embodiments, the present invention also provides an apparatus for implementing the above-mentioned method based on state diagrams and self-attention mechanisms for battery life prediction, such as... Figure 8 The diagram shown is a schematic representation of the device architecture according to an embodiment of the present invention. The battery life prediction device based on state diagrams and self-attention mechanisms in this embodiment includes one or more processors 21 and a memory 22. Figure 8 Take a processor 21 as an example.

[0086] Processor 21 and memory 22 can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.

[0087] The memory 22, as a non-volatile computer-readable storage medium for the battery life prediction method based on state diagrams and self-attention mechanisms, can be used to store non-volatile software programs and non-volatile computer-executable programs, such as the battery life prediction method based on state diagrams and self-attention mechanisms in the foregoing embodiments. The processor 21 executes various functional applications and data processing of the battery life prediction device based on state diagrams and self-attention mechanisms by running the non-volatile software programs, instructions, and modules stored in the memory 22, thereby implementing the battery life prediction method based on state diagrams and self-attention mechanisms in the foregoing embodiments.

[0088] Memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 22 may include memory remotely located relative to processor 21, which can be connected to processor 21 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0089] The program instructions / modules are stored in memory 22. When executed by one or more processors 21, they execute the battery life prediction method based on state diagrams and self-attention mechanisms described in the foregoing embodiments.

[0090] This invention also provides a non-volatile computer storage medium storing computer-executable instructions that are executed by one or more processors, for example... Figure 8 One of the processors 21 enables the one or more processors to execute the battery life prediction method based on state graphs and self-attention mechanisms in the foregoing embodiments.

[0091] It is worth noting that the information interaction and execution process between the modules and units in the above-mentioned device and system are based on the same concept as the processing method embodiment of the present invention. For details, please refer to the description in the method embodiment of the present invention, and will not be repeated here.

[0092] Those skilled in the art will understand that all or part of the steps in the various methods of the embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0093] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A battery lifetime prediction method based on state diagrams and self-attention mechanisms, characterized in that, include: Obtain battery status parameter values ​​within a preset time window, and construct a time-series feature map from the battery status parameter values; A battery life prediction model is constructed, wherein the battery life prediction model includes a cascaded feature extraction module and a prediction module; The feature extraction module performs information propagation on the temporal feature map in the local topological space to obtain the feature enhancement matrix. The prediction module applies attention weights to the feature enhancement matrix in the global sequence space to obtain a secondary feature sequence, and then makes a prediction based on the secondary feature sequence to obtain the battery health status.

2. The battery lifetime prediction method based on state diagrams and self-attention mechanisms according to claim 1, characterized in that, The method further includes: Based on the actual degradation patterns of batteries, a weighting function is designed during the design phase; The stage-aware weight function is incorporated into the mean squared error loss function to obtain the total loss function; During the training process of the battery life prediction model, the total loss value is calculated based on the actual remaining lifespan of the training samples and the lifespan prediction value output by the battery life prediction model, and the network parameters are updated iteratively multiple times based on the total loss value.

3. The battery lifetime prediction method based on state diagrams and self-attention mechanisms according to claim 2, characterized in that, The stage-aware weight function is shown in the following formula: ; in, Indicates the first The weights of each training sample at the current time. , and These are adjustable hyperparameters. Indicates the first The SOH of each training sample at the current time. and These are capacity thresholds for different stages of battery degradation.

4. The battery lifetime prediction method based on state diagrams and self-attention mechanisms according to claim 2, characterized in that, The total loss function is shown in the following formula: in, This represents the total loss value. Indicates batch size. Indicates the first The true remaining lifetime of each training sample Indicates the first Lifetime prediction values ​​for each training sample. Indicates the first The SOH of each training sample at the current time. Indicates the first The weights of each training sample at the current time.

5. The battery lifetime prediction method based on state diagrams and self-attention mechanisms according to claim 1, characterized in that, The step of acquiring battery state parameter values ​​within a preset time window and constructing a time-series feature map from the battery state parameter values ​​includes: Different categories of battery state parameter values ​​are defined as node entities in the time sequence graph network; All battery state parameter values ​​are divided according to category to obtain a set of time series data corresponding to each node; Each set of time-series data is vectorized to obtain the feature vector corresponding to each node; Calculate the correlation value between the feature vectors corresponding to any two nodes, and use the correlation value as the weight of the edge connecting the two nodes in the time series feature graph.

6. The battery lifetime prediction method based on state diagrams and self-attention mechanisms according to claim 1, characterized in that, The step of propagating information from the temporal feature map in the local topological space through the feature extraction module to obtain the feature enhancement matrix includes: Construct a node feature matrix based on the feature vectors of all nodes; Construct an adjacency matrix based on the weights of the edges connecting two nodes in the temporal feature graph; Using the adjacency matrix and the node feature matrix, multi-level neighbor information aggregation is performed on each node in the time-series feature graph to obtain a feature enhancement matrix, wherein each row of the feature enhancement matrix is ​​a feature enhancement vector for each node.

7. The battery lifetime prediction method based on state diagrams and self-attention mechanisms according to claim 1, characterized in that, The step of performing attention weighting on the feature enhancement matrix in the global sequence space through the prediction module to obtain a secondary feature sequence, and then predicting the battery health status based on the secondary feature sequence, includes: Flatten the feature enhancement matrix into a sequence, where each element in the sequence is the feature enhancement vector of each node; A learnable positional code is introduced for each element in the sequence to obtain a positional feature sequence; The positional feature sequence is learned using a multi-head attention mechanism to obtain a secondary feature sequence; The secondary feature sequence is compressed into a global feature vector of fixed size, and the global feature vector is mapped to the battery health status.

8. The battery lifetime prediction method based on state diagrams and self-attention mechanisms according to claim 7, characterized in that, The process of learning the positional feature sequence using a multi-head attention mechanism to obtain a secondary feature sequence includes: For each first feature vector in the location feature sequence, calculate the attention weight between the first feature vector and all first feature vectors in the location feature sequence; The second feature vector corresponding to the first feature vector is obtained by weighted aggregation based on the attention weight and all first feature vectors. The second feature vectors are combined to obtain the quadratic feature sequence.

9. A battery life prediction device based on state diagrams and self-attention mechanisms, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the processor for performing the battery life prediction method based on state diagrams and self-attention mechanisms as described in any one of claims 1-8.

10. A non-volatile computer storage medium, characterized in that, The computer storage medium stores computer-executable instructions, which are executed by one or more processors to perform the battery life prediction method based on state diagrams and self-attention mechanisms as described in any one of claims 1-8.