Encoder-decoder battery SOC estimation method based on attention mechanism
Through the encoder-decoder method based on attention mechanism, the SOC estimation accuracy problem of lithium-ion batteries under complex ambient temperatures is solved. Through the combination of Bi-LSTM and the sequence mode attention layer, the healthy status of lithium-ion batteries is achieved. The accurate estimation of the model improves the perception and prediction accuracy of the model.
Patent Information
- Application Number
- CN202411504381.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-26
- Publication Date
- 2024-11-26
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for SOC estimation of lithium-ion batteries are difficult to accurately estimate under complex ambient temperature conditions, especially due to the reduction in accuracy caused by continuous changes in ambient temperature.
Using an encoder-decoder method based on attention mechanism, the forward and backward dependencies of the input sequence are learned through the Bi-LSTM encoder, and combined with the sequence mode attention layer and the LSTM decoder, the importance of the input sequence is adaptively recognized and the importance of the input sequence is adaptively recognized and Perform weighting processing to mitigate the impact of non-important time series information and improve the model's perception of key information.
The accurate estimation of lithium-ion battery SOC under complex ambient temperatures is achieved, the estimation accuracy and model stability are improved, and the complex dynamic interdependence between sequences and target variables can be effectively captured and analyzed.
Smart Images

Figure CN119024187A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery SOC estimation, and in particular to an encoder-decoder battery SOC estimation method based on an attention mechanism. Background Art
[0002] In recent years, lithium-ion batteries have become an important energy storage device for electronic products such as robots and electric vehicles due to their light weight, low discharge rate, and high energy density. However, as the use time increases, the performance of lithium-ion batteries will gradually decline. Once they fail, they will not only cause huge economic losses, but may also lead to catastrophic accidents.
[0003] There are two current SOC estimation methods for lithium-ion batteries: model-based methods and data-driven methods. Model-based methods focus on the internal working mechanism of the lithium-ion battery system, establish a mathematical model that reflects the physical laws of the system, and ultimately predict the degradation trend. However, in most practical applications, it is difficult to establish an accurate mathematical model, especially when the degradation process is complex and the degradation mechanism is not fully understood. Therefore, a large amount of expert knowledge is required, which poses a major challenge to accurately estimate the SOC. Data-driven methods, especially machine learning methods, show great promise in battery state of charge estimation, which can alleviate the underfitting problem caused by small and noisy samples and make fast models of aging batteries possible. Although these existing data-driven methods can achieve satisfactory estimation accuracy, they focus on improving the accuracy of the underlying model under the assumption that the ambient temperature is constant. However, in practical scenarios, the ambient temperature of lithium-ion batteries usually changes continuously, which directly affects the accurate estimation of SOC; therefore, it is necessary to consider the SOC estimation of lithium-ion batteries under more complex temperature conditions. Summary of the invention
[0004] In response to the needs in the prior art, the present invention provides an encoder-decoder battery SOC estimation method based on the attention mechanism, which aims to solve the SOC estimation of lithium-ion batteries under complex ambient temperatures and can capture and analyze the complex dynamic interdependencies between sequences and target variables; at the same time, the attention mechanism is introduced to mitigate the impact of non-important time series information and enhance the model's perception of key information, thereby achieving accurate estimation.
[0005] The encoder-decoder battery SOC estimation method based on the attention mechanism includes the following steps: Step 1: Obtain the voltage, current and ambient temperature data in the battery state and use them as input features; Step 2: Feed the input features into the Bi-LSTM based encoder and output the context vector; Step 3: Transfer the context vector to the sequential mode attention layer and perform weighted processing to obtain the weight matrix; Step 4: Obtain its trainable weight matrix according to the weight matrix; Step 5: Get the hidden state vector at the current moment and obtain its trainable weight matrix; Step 6: Fuse the trainable weight matrix in step 4 with the trainable weight matrix in step 5 to obtain key information features; Step 7: After the key information features pass through the LSTM decoder and the fully connected layer in sequence, the estimated health status of the lithium-ion battery is obtained.
[0006] Further, step 1 also includes processing the input features by using the Min-Max normalization method, and sending the normalized input features to step 2, and the calculation formula is as follows: In the formula, , They are the original values and normalized values in the data set respectively; , are the maximum and minimum values in the sequence respectively.
[0007] Further: The encoder trains two LSTM networks on the input sequence at the same time, one of which processes the original input sequence and learns the forward hidden state vector ; Another LSTM network processes the reverse copy of the input sequence, learns and obtains the backward hidden state vector ; The forward hidden state vector and the backward hidden state vector Combined to get the hidden state vector at the current moment , the calculation formula is as follows: The encoder then encodes the hidden state vector obtained at each moment into the context vector of the input sequence .
[0008] Further: The sequence mode attention layer receives the context vector After that, the hidden state vector at the current moment As the key of the sequential pattern attention layer, the hidden state vector at the previous moment is used as the query of the sequential pattern attention layer; the query is convolved to obtain the sequential pattern , the calculation formula is as follows: in, Indicates The row input feature vector is The result of the interaction of the convolution kernels; Represents the convolution operation; Then, the hidden state vector at the current moment is With Sequence Mode Each row vector in interacts with each other, and the scoring function Calculate the hidden state vector at the current moment based on the extracted model matrix The weights of the variables in the equation are normalized using the Sigmoid function to obtain the weight matrix , the calculation formula is as follows: in, Represents the score function; represents a trainable weight matrix; Indicates the weight of the query.
[0009] Further: In step 6, key information features The calculation formula is as follows: In the formula, , Respectively represent the weight matrix and the hidden state vector at the current moment The trainable weight matrix of .
[0010] Further: The LSTM decoder includes an input gate, a forget gate, an output gate and a memory unit, wherein, The input-output function relationship between the input gate, forget gate, and output gate is as follows: In the formula, is the output of the input gate; is the output of the forget gate; is the output of the output gate; , and The input gate, forget gate and output gate are the input quantities at the current moment respectively. The weight matrix of , and The input gate, forget gate and output gate are the input quantities of the previous moment respectively. The weight matrix of , and They are the biases of the input gate, forget gate, and output gate respectively; Represents the Sigmoid activation function; The value stored in the memory cell at the current moment is , the calculation formula is as follows In the formula, express The value stored in the memory cell at that moment; tanh is the Tanh activation function; The input quantity of the memory unit at the current moment and the input at the previous moment The weight matrix of is the bias of the memory cell.
[0011] After the memory unit updates the value stored in the unit, the output of the encoder LSTM network at the current moment is obtained. The calculation formula is as follows: In the formula, Represents the output of the LSTM network at the current moment.
[0012] Further: After the key information features are processed by the LSTM decoder, the target sequence is obtained , Li-ion battery health status for: in, is the fully connected operation of the fully connected layer.
[0013] The beneficial effects of the present invention are as follows: the forward and backward dependencies of the input sequence are learned through the Bi-LSTM encoder, and then the sequence pattern attention layer connecting the encoder and the decoder is used to distinguish the response relationship between the input sequence and the target variable, adaptively identify the importance of the input sequence, and perform weighted processing; finally, the continuity between the estimated values is maintained through the LSTM decoder to obtain the final accurate SOC estimation result, which can effectively solve the accurate estimation of the SOC of lithium-ion batteries under complex ambient temperatures. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 is a flow chart of the present invention; Figure 2 It is a schematic diagram of the present invention. DETAILED DESCRIPTION
[0015] The present invention is described in detail below in conjunction with the accompanying drawings. The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention. The directional terms such as left, middle, right, top, and bottom in the embodiments of the present invention are only relative concepts or are based on the normal use state of the product, and should not be considered as restrictive.
[0016] The encoder-decoder battery SOC estimation method based on the attention mechanism includes the following steps: Step 1: Use the Pearson correlation coefficient analysis method to screen the input features in the data set, and use the Min-Max normalization method to preprocess the screened data. As the input features of the model; the data set of the present invention is selected from the University of Wisconsin-Madison, and the characteristics of the battery state in the data set, such as voltage, current, ambient temperature of the battery pack, and working time of the battery pack, are selected, and the characteristics in the selected battery state are analyzed by using the Pearson correlation coefficient analysis method; the analysis finds that the voltage, current and ambient temperature in the battery state are highly correlated with the SOC value of the battery, so the present invention selects the voltage, current and ambient temperature in the battery state as the input features of the model; In order to eliminate the problem of uneven weight distribution of features in the model caused by the dimensional differences between different feature information and to avoid the influence of outliers on the model, the input features are processed by the Min-Max normalization method, and the normalized input features are sent to step 2. The calculation formula is as follows: In the formula, , They are the original values and normalized values in the data set respectively; , are the maximum and minimum values in the sequence respectively; then, the normalized input features are vectorized To express, that is ,in Indicates the battery voltage per second; Indicates the current of the battery per second; Indicates the ambient temperature of the battery. The numerical ranges of the three selected features, voltage, current and ambient temperature, are mapped to the same scale through the Min-Max normalization method, which reduces the influence of outliers and makes the prediction model more stable. Step 2: Feed the input features into the Bi-LSTM based encoder and output the context vector; The encoder of the present invention is composed of a Bi-LSTM network, and the feature vector time series group obtained after preprocessing is expressed as , and Input is into the encoder based on the Bi-LSTM network; further: the encoder trains two LSTM networks on the input sequence at the same time, one LSTM network processes the original input sequence and learns the forward hidden state vector ; Another LSTM network processes the reverse copy of the input sequence, learns and obtains the backward hidden state vector ; The forward hidden state vector and the backward hidden state vector Combined to get the hidden state vector at the current moment , the calculation formula is as follows: The encoder then encodes the hidden state vector obtained at each moment into the context vector of the input sequence The encoder uses the Bi-LSTM network as the overall framework, which can capture and analyze the complex dynamic interdependence between the time series group of batteries and the normal battery group, and avoids the information loss caused by excessive sequence data in traditional encoders, thus improving the prediction accuracy of the model; Step 3: Transform the context vector Transmit to the sequence mode attention layer and perform weighted processing to obtain the weight matrix; The sequence mode attention layer receives the context vector After that, the hidden state vector at the current moment As the key of the sequential pattern attention layer, the hidden state vector at the previous moment is used as the query of the sequential pattern attention layer; the query is convolved to obtain the sequential pattern , the calculation formula is as follows: in, Indicates The row input feature vector is The result of the interaction of the convolution kernels; Represents the convolution operation; Then, the hidden state vector at the current moment is With Sequence Mode Each row vector in interacts with each other, and the scoring function Calculate the hidden state vector at the current moment based on the extracted model matrix The weights of the variables in the equation are normalized using the Sigmoid function to obtain the weight matrix ; This weight matrix reflects Each row in The interaction strength, that is, the impact of each sequence on the target variable, is calculated as follows: in, Represents the score function; represents a trainable weight matrix; Represents the weight of the query; introduces a sequence mode attention layer to distinguish the context vector output by the encoder The hidden state at the current time step The response relationship between them can selectively select a small amount of important information from a large amount of information, focus on key information, and improve the system's computing speed; Step 4: Obtain its trainable weight matrix according to the weight matrix; Step 5: Get the hidden state vector at the current moment and obtain its trainable weight matrix; Step 6: Fuse the trainable weight matrix in step 4 with the trainable weight matrix in step 5 to obtain key information features; The weight matrix and the hidden state vector at the current moment Combined, a richer representation is obtained, which integrates context information and sequence pattern information, expressed as key information features The calculation formula is as follows: In the formula, , Respectively represent the weight matrix and the hidden state vector at the current moment The trainable weight matrix of Step 7: The key information features are sequentially passed through the LSTM decoder and the fully connected layer to obtain the estimated health status of the lithium-ion battery; The present invention adopts LSTM network as the network framework of the decoder.) The LSTM decoder includes an input gate, a forget gate, an output gate and a memory unit, wherein: The input-output function relationship between the input gate, forget gate, and output gate is as follows: In the formula, is the output of the input gate; is the output of the forget gate; is the output of the output gate; , and The input gate, forget gate and output gate are the input quantities at the current moment respectively. The weight matrix of , and The input gate, forget gate and output gate are the input quantities of the previous moment respectively. The weight matrix of , and They are the biases of the input gate, forget gate, and output gate respectively; Represents the Sigmoid activation function; The value stored in the memory cell at the current moment is , the calculation formula is as follows In the formula, express The value stored in the memory cell at that moment; tanh is the Tanh activation function; The input quantity of the memory unit at the current moment and the input at the previous moment The weight matrix of is the bias of the memory cell.
[0017] After the memory unit updates the value stored in the unit, the output of the encoder LSTM network at the current moment is obtained. The calculation formula is as follows: In the formula, Represents the output of the LSTM network at the current moment; the key information features are processed by the LSTM decoder to obtain the target sequence , Li-ion battery health status for: in, is the fully connected operation of the fully connected layer.
[0018] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. Encoder-decoder battery SOC estimation method based on attention mechanism, characterized by: The following steps are involved: Step 1: Obtain the voltage, current and ambient temperature data in the battery state and use them as input features; Step 2: Feed the input features into the Bi-LSTM based encoder and output the context vector; Step 3: Transfer the context vector to the sequential mode attention layer and perform weighted processing to obtain the weight matrix; Step 4: Obtain its trainable weight matrix according to the weight matrix; Step 5: Get the hidden state vector at the current moment and obtain its trainable weight matrix; Step 6: Fuse the trainable weight matrix in step 4 with the trainable weight matrix in step 5 to obtain key information features; Step 7: After the key information features pass through the LSTM decoder and the fully connected layer in sequence, the estimated health status of the lithium-ion battery is obtained.
2. The encoder-decoder battery SOC estimation method based on the attention mechanism according to claim 1, characterized in that: Step 1 also includes processing the input features by the Min-Max normalization method, and sending the normalized input features to step 2. The calculation formula is as follows: ; In the formula, , They are the original values and normalized values in the data set respectively; , are the maximum and minimum values in the sequence respectively.
3. The encoder-decoder battery SOC estimation method based on the attention mechanism according to claim 1, characterized in that: The encoder trains two LSTM networks on the input sequence at the same time, where one LSTM network processes the original input sequence and learns the forward hidden state vector ; Another LSTM network processes the reverse copy of the input sequence, learns and obtains the backward hidden state vector ; The forward hidden state vector and the backward hidden state vector Combined to get the hidden state vector at the current moment , the calculation formula is as follows: ; The encoder then encodes the hidden state vector obtained at each moment into the context vector of the input sequence .
4. The encoder-decoder battery SOC estimation method based on the attention mechanism according to claim 3, characterized in that: The sequence mode attention layer receives the context vector After that, the hidden state vector at the current moment As the key of the sequential pattern attention layer, the hidden state vector at the previous moment is used as the query of the sequential pattern attention layer; the query is convolved to obtain the sequential pattern , the calculation formula is as follows: ; in, Indicates The row input feature vector is The result of the interaction of the convolution kernels; Represents the convolution operation; Then, the hidden state vector at the current moment is With Sequence Mode Each row vector in interacts with each other, and the scoring function Calculate the hidden state vector at the current moment based on the extracted model matrix The weights of the variables in the equation are normalized using the Sigmoid function to obtain the weight matrix , the calculation formula is as follows: ; ; ; in, Represents the score function; represents a trainable weight matrix; Indicates the weight of the query.
5. The encoder-decoder battery SOC estimation method based on the attention mechanism according to claim 4, characterized in that: In step 6, key information features The calculation formula is as follows: ; In the formula, , Respectively represent the weight matrix and the hidden state vector at the current moment The trainable weight matrix of .
6. The encoder-decoder battery SOC estimation method based on the attention mechanism according to claim 1, characterized in that: The LSTM decoder consists of an input gate, a forget gate, an output gate, and a memory unit, where: The input-output function relationship between the input gate, forget gate, and output gate is as follows: ; ; ; In the formula, is the output of the input gate; is the output of the forget gate; is the output of the output gate; , and The input gate, forget gate and output gate are the input quantities at the current moment respectively. The weight matrix of , and The input gate, forget gate and output gate are the input quantities of the previous moment respectively. The weight matrix of , and They are the biases of the input gate, forget gate, and output gate respectively; Represents the Sigmoid activation function; The value stored in the memory cell at the current moment is , the calculation formula is as follows ; In the formula, express The value stored in the memory cell at that moment; tanh is the Tanh activation function; The input quantity of the memory unit at the current moment and the input at the previous moment The weight matrix of is the bias of the memory unit; After the memory unit updates the value stored in the unit, the output of the encoder LSTM network at the current moment is obtained. The calculation formula is as follows: ; In the formula, Represents the output of the LSTM network at the current moment.
7. The encoder-decoder battery SOC estimation method based on the attention mechanism according to claim 6, characterized in that: After the key information features are processed by the LSTM decoder, the target sequence is obtained , Li-ion battery health status for: ; in, is the fully connected operation of the fully connected layer.
Citation Information
Patent Citations
Battery state estimation method and device, terminal equipment and storage medium
CN115186587A
Time sequence prediction method fusing long short-term memory network and attention mechanism
CN116432697A
Method for predicting SOH based on deep learning and battery current, voltage and temperature
CN117192380A
Battery state of charge (SOC) prediction method combining convolutional network and sequence-to-sequence model
CN117787074A
Deep learning lithium battery SOH prediction method based on transformer architecture
CN118131044A
Cited By
Method and system for estimating SOC (State of Charge) of full-life-cycle lithium ion battery, terminal and medium
CN119471398A
Energy storage equipment charging state prediction method and system based on gating fusion and attention mechanism
CN119807824A
