Battery state estimation method based on multivariable time sequence context attention

By using a combination model of PatchTST module, two-stage attention module and feedforward neural network in the lithium battery health status estimation, the problems of high complexity, insufficient accuracy and poor generalization in the existing technology are solved, and higher accuracy and generalization are achieved in the lithium battery health status estimation.

CN120044397APending Publication Date: 2025-05-27FUJIAN NEBULA ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411701462.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In the prior art, in the estimation of the health status of lithium batteries, the model has high complexity, insufficient accuracy and poor generalization capabilities, and it is impossible to effectively capture the timing context relationship of multivariate signals.

Method used

The health status estimation model based on the PatchTST module, the two-stage attention module and the feedforward neural network is adopted. The multivariate timing signals are patched through the PatchTST module. The two-stage attention module constructs the timing context attention, and the feedforward neural network outputs the SOH value of the estimated health status of the lithium battery.

Benefits of technology

It improves the accuracy and generalization of lithium battery health status estimation, can effectively capture the timing context relationship of multivariable signals, and is suitable for battery SOH estimation based on full charge voltage curve and online charging any SOC interval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120044397A_ABST
    Figure CN120044397A_ABST
Patent Text Reader

Abstract

The invention provides a battery state estimation method based on multivariable time sequence context attention in the technical field of lithium battery detection, and the method comprises the following steps: S1, obtaining a large amount of historical charging condition data of a lithium battery, the historical charging condition data including voltage, current, temperature, SOC and time; s2, constructing a multivariate time sequence signal based on the historical charging condition data; s3, creating a health state estimation model based on a PatchTST module, a two-stage attention module and a feedforward neural network, and setting a loss function of the health state estimation model; s4, training a health state estimation model based on the multivariate time sequence signal through a warm-up learning rate strategy and an Adam optimizer; and S5, performing health state estimation on the lithium battery based on the trained health state estimation model. The lithium battery health state estimation method has the advantages that the lithium battery health state estimation precision and generalization are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of lithium battery detection, and particularly to a battery state estimation method based on multi-variable time series context attention. Background Art

[0002] During the charge and discharge cycle of a lithium battery, some irreversible chemical reactions will occur inside, resulting in the aging or safety hazards of the lithium battery. Therefore, it is very important to estimate the health state of the lithium battery. The state of health (SOH) of a lithium battery is generally characterized by the percentage of the current available capacity of the lithium battery relative to the initial capacity.

[0003] For the estimation of the health state of lithium batteries, traditional model-based estimation methods not only require a large amount of expert knowledge for feature mining and feature screening (such as constant current charging duration, maximum and minimum values, mean values, etc.), cannot guarantee the final accuracy of the model and also require a lot of manpower, but also the model has a high complexity. Affected by the actual outdoor temperature and outdoor environment during the actual application process, the model accuracy is insufficient. Therefore, the estimation accuracy (prediction effect) of battery data from different sources will be uneven and the generalization ability is poor.

[0004] During the operation of the battery, sensing data such as voltage, current, and temperature of the battery will be collected in real time. Therefore, battery data is a typical multi-variable time series data; and during the operation of the battery, sensing data such as voltage, current, and temperature affect and restrict each other. For example, during the charging process of the battery, a sudden decrease in the charging rate (corresponding to a decrease in current) will cause a sudden drop in voltage and then a slow rise, and different health states of the battery are also reflected in the amplitude and rate of the voltage relaxation effect. Therefore, there is a correlation between different variables. In recent years, feature extraction of multi-variable time series data based on Transformer has become a mainstream method. However, due to the computational complexity of the self-attention mechanism of Transformer, the input data length of the Transformer structure is limited to a certain extent. And PatchTST can focus on longer historical sequence information by splitting the time series into sub-sequence-level patches as the input tokens of Transformer, and reduces the model calculation amount of the self-attention mechanism of Transformer (from O(N 2 2) is reduced to O((N / S) 2 2)), but PatchTST only performs the time series attention mechanism independently on each time series, and cannot well capture the time series context relationship of battery multi-variable signals, resulting in poor accuracy when directly applied to battery state estimation.

[0005] Therefore, how to provide a battery state estimation method based on multi-variable time-series context attention to improve the accuracy and generalization of lithium battery health state estimation has become an urgent technical problem to be solved. Summary of the Invention

[0006] The technical problem to be solved by the present invention is to provide a battery state estimation method based on multi-variable time-series context attention to improve the accuracy and generalization of lithium battery health state estimation.

[0007] The present invention is implemented as follows: A battery state estimation method based on multi-variable time-series context attention includes the following steps:

[0008] Step S1: Obtain a large amount of historical charging condition data of lithium batteries, where the historical charging condition data includes voltage, current, temperature, SOC, and time;

[0009] Step S2: Construct a multi-variable time-series signal based on each piece of the historical charging condition data;

[0010] Step S3: Create a health state estimation model based on the PatchTST module, the two-stage attention module, and the feed-forward neural network, and set the loss function of the health state estimation model;

[0011] Step S4: Train the health state estimation model based on the multi-variable time-series signal through the warm-up learning rate strategy and the Adam optimizer;

[0012] Step S5: Estimate the health state of the lithium battery based on the trained health state estimation model.

[0013] Further, the specific content of step S2 is as follows:

[0014] Construct a multi-variable time-series signal with a duration of T based on each piece of the historical charging condition data represents a real number; dim represents the dimension of the time-series variable, with a value of 4, that is, the 4 time-series variables of voltage, current, temperature, and SOC; T represents the duration; 1:T represents T time sampling points.

[0015] Further, in step S3, the PatchTST module is used to perform data patching operations on the multi-variable time-series signal to obtain a number of patch signals, that is:

[0016] Set the patch parameters and perform data patching operations on the multi-variable time-series signal to convert it into patch signals

[0017] The patch parameters include P, T, S, and L; P represents the number of patches, P = 64; T represents the duration, T = 512; S represents the step size, S = 8; L represents the patch length, L = 16; that is, S = 8 in each patch is the overlapping part, and the length of each finally generated patch is 16.

[0018] Further, in step S3, the two-stage attention module is used to construct temporal context attention from each temporal variable in the patch signals to obtain a first temporal segment embedding vector, and then construct temporal context attention across temporal variables based on the first temporal segment embedding vector to obtain a second temporal segment embedding vector;

[0019] The calculation formula for the first temporal segment embedding vector is:

[0020]

[0021]

[0022] The calculation formula for the second temporal segment embedding vector is:

[0023]

[0024]

[0025] Among them, LayerNorm() represents the layer normalization function; MSA time () represents the self-attention function in Transformer; represents all of the d-th dimension of time d = 1,..., dim; represents the patch after layer normalization; represents all of different dimensions arranged into a matrix; Z time represents the first temporal segment embedding vector of each variable dimension after capturing Cross-TimeAttention; represents all of the d-th dimension of time of Z time ; represents the patch after layer normalization; represents all of different dimensions arranged into a matrix; Z dimRepresents the second temporal segment embedding vectors of each variable dimension after capturing Cross-Time Attention and Cross-Dimension Attention.

[0026] Further, in the step S3, the calculation formula of the feedforward neural network is:

[0027] soh predict = FFN(Z dim ) = max(0, Z dim W 1 + b 1 )W 2 + b 2 ;

[0028] where, soh predict represents the SOH value of the lithium battery health state estimation; FFN() represents the feedforward neural network; Z dim represents the second temporal segment embedding vector output by the two-stage attention module; max() represents the maximum value function; W 1 represents the first weight term of the feedforward neural network; W 2 represents the second weight term of the feedforward neural network; b 1 represents the first bias term of the feedforward neural network; b 2 represents the second bias term of the feedforward neural network.

[0029] Further, in the step S3, the formula of the loss function is:

[0030]

[0031] where, Loss() represents the loss function; soh predict represents the SOH value of the lithium battery health state estimation; soh ground_truth represents the true SOH value corresponding to each charging curve in the multi-temporal signal; n represents the training sample size; cosh() represents the hyperbolic cosine function; represents soh at the i-th moment predict ; represents soh at the i-th moment ground _ truth .

[0032] The advantages of the present invention are:

[0033] By acquiring a large amount of historical charging condition data including voltage, current, temperature, SOC, and time, a multivariate time series signal is constructed based on each piece of historical charging condition data; then, a health state estimation model is created based on the PatchTST module, the two-stage attention module, and the feedforward neural network, and the loss function of the health state estimation model is set; the PatchTST module is used to perform data patching operations on the multivariate time series signal to obtain several patch signals; the two-stage attention module is used to construct temporal context attention on each temporal variable in each patch signal to obtain the first temporal segment embedding vector, and then based on the first temporal segment embedding vector, temporal context attention across temporal variables is constructed to obtain the second temporal segment embedding vector; the feedforward neural network is used to output the SOH value of the lithium battery health state estimation; then, through the warm-up learning rate strategy and the Adam optimizer, the health state estimation model is trained based on the multivariate time series signal, and finally, the health state of the lithium battery is estimated based on the trained health state estimation model; that is, the health state is estimated based on the health state estimation model created by the PatchTST module, the two-stage attention module, and the feedforward neural network. The PatchTST module uses the PatchTST method to construct the self-attention mechanism of the temporal context, which can support the input of longer historical sequence information (multivariate time series signal), enabling the health state estimation model to learn the semantic information at the Patch level of the multivariate time series signal, and the computational complexity of the self-attention will also be reduced; through the multi-variable temporal context attention mechanism of the two-stage attention module, the problem that PatchTST cannot capture the correlation relationship between variables when applied to the field of lithium battery detection technology is solved, which is not only applicable to the battery SOH estimation based on the full charge voltage curve, but also applicable to the battery SOH estimation based on any SOC interval of online charging, ultimately greatly improving the accuracy and generalization of the lithium battery health state estimation. Description of the Drawings

[0034] The present invention will be further described below with reference to the drawings in conjunction with embodiments.

[0035] Figure 1 It is a flowchart of a battery state estimation method based on multi-variable temporal context attention of the present invention.

[0036] Figure 2 It is a schematic diagram of feature extraction by the two-stage attention module (multi-variable temporal context attention) of the present invention.

[0037] Figure 3 It is a schematic diagram of feature extraction by traditional temporal context attention. Detailed Embodiments

[0038] The overall idea of the technical solution in the embodiments of this application is as follows: Based on the health state estimation model created by the PatchTST module, the two-stage attention module, and the feedforward neural network, health state estimation is performed. The PatchTST module uses the PatchTST method to construct a self-attention mechanism for temporal context, which can support the input of longer historical sequence information (multivariate time series signals), enabling the health state estimation model to learn the semantic information at the Patch level on multivariate time series signals, and the computational complexity of self-attention will also be reduced; through the multivariate temporal context attention mechanism of the two-stage attention module, the problem that PatchTST cannot capture the correlation relationship between variables when applied to the field of lithium battery detection technology is solved, which is not only applicable to the battery SOH estimation based on the full charge voltage curve, but also applicable to the battery SOH estimation based on any SOC interval of online charging, so as to improve the accuracy and generalization of lithium battery health state estimation.

[0039] Please refer to Figures 1 to 3 As shown, a preferred embodiment of a battery state estimation method based on multivariate temporal context attention of the present invention includes the following steps:

[0040] Step S1: Obtain a large amount of historical charging condition data of lithium batteries, where the historical charging condition data includes voltage (Volt), current (Cur), temperature (Temp), SOC, and time; since the discharge condition of lithium batteries is often more complex than the charging condition in actual applications, and the charging condition data set is also easier to obtain (for example, obtaining charging condition data when a new energy vehicle is charging), the historical charging condition data is adopted in the present invention;

[0041] Specifically, the voltage, current, and temperature can be converted into a temporal change curve relative to the SOC, or dQ / dV or Q-V temporal data, etc. can be used as the subsequent data input according to the obtained data;

[0042] Step S2: Construct a multivariate time series signal based on each of the historical charging condition data;

[0043] Step S3: Create a health state estimation model based on the PatchTST module, the two-stage attention module, and the feedforward neural network, and set the loss function of the health state estimation model;

[0044] Step S4: Based on the warm-up learning rate strategy and the Adam optimizer, train the health state estimation model based on the multivariate time series signal; before training, divide the multivariate time series signal into a training set and a validation set, train the health state estimation model through the training set until the loss function is less than a preset loss threshold, and then use the validation set to verify the trained health state estimation model;

[0045] Step S5: Estimate the health state of the lithium battery based on the trained health state estimation model.

[0046] The specific content of step S2 is as follows:

[0047] Construct a multivariate time series signal with a duration of T based on each piece of historical charging condition data represents a real number; dim represents the dimension of the time series variable, and its value is 4, that is, the 4 time series variables of voltage, current, temperature, and SOC; T represents the duration. After setting the time series sampling frequency, T can be directly generalized to represent the number of time series sampling points; 1:T represents T time sampling points. Label the true SOH value corresponding to each charging curve in the multivariate time series signal.

[0048] In step S3, the PatchTST module is used to perform data patching operations on the multivariate time series signal to obtain a number of patch signals, that is:

[0049] Set the patch parameters, and perform data patching operations on the multivariate time series signal based on the patch parameters to convert it into a patch signal

[0050] The patch parameters include P, T, S, and L; P represents the number of patches, P = 64, that is, PatchTST / 64 is adopted; T represents the duration (look-back window length), T = 512; S represents the step size, S = 8; L represents the patch length, L = 16; that is, S = 8 in each patch is the overlapping part, and the length of each finally generated patch is 16.

[0051] In step S3, the two-stage attention module is used to construct cross-time attention on each time series variable in each patch signal to obtain the first time series segment embedding vector, and then construct cross-dimension attention across time series variables based on the first time series segment embedding vector to obtain the second time series segment embedding vector;

[0052] The calculation formula for the first time series segment embedding vector is:

[0053]

[0054]

[0055] In the field of lithium battery detection technology, the value of dim is generally small. Therefore, a self-attention operation is performed on the obtained first time-series segment embedding vector to achieve information fusion between different variable dimensions.

[0056] The calculation formula of the second time-series segment embedding vector is:

[0057]

[0058]

[0059] Among them, LayerNorm() represents the layer normalization function; MSA time () represents the self-attention function in Transformer; represents all of the d-th dimension time series d = 1,..., dim; represents the patch after layer normalization; represents all of different dimensions arranged into a matrix; Z time represents the first time-series segment embedding vector of each variable dimension after capturing Cross-TimeAttention; represents all of the d-th dimension time series of Z time ; represents the patch after layer normalization; represents all of different dimensions arranged into a matrix; Z dim represents the second time-series segment embedding vector of each variable dimension after capturing Cross-Time Attention and Cross-Dimension Attention.

[0060] Feature extraction is performed separately for each variable dimension. Each variable uses a unified channel-independence Transformer network structure and shares weights. Finally, each embedding output by the Transformer-encoder is concatenated, and then passed through an MLP layer to achieve battery SOH estimation. It can be seen that there is no information fusion between different input variables, but for the battery, each variable is related. Therefore, the present invention constructs the two-stage attention module as Figure 3 shown.

[0061] In the step S3, the calculation formula of the feed-forward neural network (FeedForward) is:

[0062] soh predict = FFN(Z dim ) = max(0, Z dim W 1 + b 1 )W 2 + b 2 ;

[0063] Among them, soh predict represents the SOH value for estimating the health state of the lithium battery; FFN() represents the feedforward neural network; Z dim represents the second temporal segment embedding vector output by the two-stage attention module; max() represents the maximum value function; W 1 represents the first weight term of the feedforward neural network; W 2 represents the second weight term of the feedforward neural network; b 1 represents the first bias term of the feedforward neural network; b 2 represents the second bias term of the feedforward neural network.

[0064] In the step S3, the formula of the loss function is:

[0065]

[0066] Among them, Loss() represents the loss function; soh predict represents the SOH value for estimating the health state of the lithium battery; soh ground_truth represents the true SOH value corresponding to each charging curve in the multi-temporal signal; n represents the number of training samples; cosh() represents the hyperbolic cosine function; represents soh at the i-th moment predict ; represents soh at the i-th moment ground_truth .

[0067] That is, the loss function adopts Log-Cosh Loss, which is a loss function applied to regression tasks and is smoother than the L2 loss function.

[0068] In summary, the advantages of the present invention are:

[0069] By obtaining a large amount of historical charging condition data including voltage, current, temperature, SOC, and time, a multivariate time series signal is constructed based on each piece of historical charging condition data; then, a health state estimation model is created based on the PatchTST module, the two-stage attention module, and the feedforward neural network, and the loss function of the health state estimation model is set; the PatchTST module is used to perform data patching operations on the multivariate time series signal to obtain a number of patch signals; the two-stage attention module is used to construct temporal context attention on each temporal variable in each patch signal to obtain the first temporal segment embedding vector, and then construct temporal context attention across temporal variables based on the first temporal segment embedding vector to obtain the second temporal segment embedding vector; the feedforward neural network is used to output the SOH value of the lithium battery health state estimation; then, through the warm-up learning rate strategy and the Adam optimizer, the health state estimation model is trained based on the multivariate time series signal, and finally, the health state of the lithium battery is estimated based on the trained health state estimation model; that is, the health state is estimated based on the health state estimation model created by the PatchTST module, the two-stage attention module, and the feedforward neural network. The PatchTST module uses the PatchTST method to construct the self-attention mechanism of the temporal context, which can support the input of longer historical sequence information (multivariate time series signal), enabling the health state estimation model to learn the semantic information at the Patch level of the multivariate time series signal, and the computational complexity of the self-attention will also be reduced; through the multi-variable temporal context attention mechanism of the two-stage attention module, the problem that PatchTST cannot capture the correlation relationship between variables when applied to the field of lithium battery detection technology is solved, which is not only applicable to the battery SOH estimation based on the full charge voltage curve, but also applicable to the battery SOH estimation based on any SOC interval of online charging, ultimately greatly improving the accuracy and generalization of the lithium battery health state estimation.

[0070] Although the specific implementation manners of the present invention have been described above, those skilled in the art of this technology should understand that the specific embodiments we described are illustrative rather than used to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should all be covered by the scope protected by the claims of the present invention.

Claims

1. A battery state estimation method based on multivariate temporal context attention, characterized in that: The steps include: Step S1, obtaining a large amount of historical charging condition data of lithium batteries, wherein the historical charging condition data includes voltage, current, temperature, SOC and time; Step S2, constructing a multivariate time series signal based on each of the historical charging condition data; Step S3, creating a health state estimation model based on the PatchTST module, the two-stage attention module and the feedforward neural network, and setting the loss function of the health state estimation model; Step S4, training the health state estimation model based on the multivariate time series signal through a warm-up learning rate strategy and an Adam optimizer; Step S5: Estimating the health state of the lithium battery based on the trained health state estimation model.

2. A battery state estimation method based on multivariate temporal context attention as claimed in claim 1, characterized in that: The step S2 is specifically as follows: Based on the historical charging condition data, a multivariate time series signal with a duration of T is constructed. represents a real number; dim represents the dimension of the time series variable, which is 4, namely the four time series variables of voltage, current, temperature and SOC; T represents the duration; 1: T represents T time sampling points.

3. The method for estimating a battery state based on multivariate temporal context attention according to claim 1, characterized in that: In step S3, the PatchTST module is used to perform data patching operations on the multivariate time series signal to obtain a plurality of patch signals, namely: Set patch parameters and perform patching on the multivariate time series signal based on the patch parameters. Perform data patching operations to convert into patch signals The patch parameters include P, T, S, and L; P represents the number of patches, P=64; T represents the duration, T=512; S represents the step length, S=8; L represents the patch length, L=16; that is, each patch has S=8 as an overlapping part, and the length of each patch finally generated is 16.

4. The method for estimating a battery state based on multivariate temporal context attention according to claim 3, characterized in that: In step S3, the two-stage attention module is used to obtain the Constructing a temporal context attention on each temporal variable in to obtain a first temporal segment embedding vector, and then constructing a temporal context attention across temporal variables based on the first temporal segment embedding vector to obtain a second temporal segment embedding vector; The calculation formula of the first time sequence segment embedding vector is: The calculation formula of the second time sequence segment embedding vector is: Among them, LayerNorm() represents the layer normalization function; MSA time ( ) represents the self-attention function in Transformer; Represents all the time series of the dth dimension d=1,...,dim; Express The patch after layer normalization; Represents all different dimensions Arranged matrix; Z time Indicates the first time segment embedding vector of each variable dimension after Cross-Time Attention has been captured; All Z representing the time series of the dth dimension time ; Express The patch after layer normalization; Represents all different dimensions Arranged matrix; Z dim Represents the second time segment embedding vector of each variable dimension after Cross-Time Attention and Cross-Dimension Attention have been captured.

5. A battery state estimation method based on multivariate temporal context attention as claimed in claim 4, characterized in that: In step S3, the calculation formula of the feedforward neural network is: soh predict =FFN(Z dim )=max(0,Z dim W1+b1)W2+b2; Among them, soh predict Represents the SOH value of the health status estimation of the lithium battery; FFN() represents the feedforward neural network; Z dim Represents the embedding vector of the second time series segment output by the two-stage attention module; max() represents the maximum value function; W1 represents the first weight term of the feedforward neural network; W2 represents the second weight term of the feedforward neural network; b1 represents the first bias term of the feedforward neural network; b2 represents the second bias term of the feedforward neural network.

6. The method for estimating battery state based on multivariate temporal context attention according to claim 1, characterized in that: In step S3, the formula of the loss function is: Among them, Loss () represents the loss function; soh predict Indicates the SOH value of the estimated health status of the lithium battery; ground_truth represents the true SOH value corresponding to each charging curve in the multivariate timing signal; n represents the number of training samples; cosh() represents the hyperbolic cosine function; Indicates soh at time i predict ; Indicates soh at time i ground _ truth .