Energy storage equipment charging state prediction method and system based on gating fusion and attention mechanism
Through a method based on the gated fusion and attention mechanism, a one-dimensional convolutional neural network and an LSTM network are used to construct noise perturbation and time characteristic attention modules, which solves the accuracy of SOC estimation in lithium-ion batteries, and realizes accurate SOC prediction at different temperatures and initial states.
Patent Information
- Application Number
- CN202510293612.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to accurately and in real time to estimate the state of charge (SOC) of lithium-ion batteries, especially at different temperatures and initial states, affecting the service life and safety of the batteries.
The charging state prediction method of energy storage equipment based on gated fusion and attention mechanism is adopted, and the noise perturbation attention module and the time feature attention module are constructed through a one-dimensional convolutional neural network, an LSTM network and a multi-head attention mechanism to obtain the mapping relationship between feature information and SOC prediction values.
Improves the accuracy and stability of SOC estimation, and can accurately estimate SOC under untrained ambient temperature and aging, enhancing the model's anti-interference and generalization capabilities.
Smart Images

Figure CN119807824A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery health management, and more specifically to a method and system for predicting the charging state of an energy storage device based on gated fusion and attention mechanism. Background Art
[0002] Distributed energy storage equipment is one of the ways to store clean energy. Lithium-ion batteries have the characteristics of long cycle life, high energy density, small size and good performance, and have been widely used in distributed energy storage equipment.
[0003] However, due to the long service life of lithium-ion batteries, their performance tends to deteriorate over time. Therefore, advanced battery management systems (BMS) are needed to ensure the safety and reliability of distributed energy storage equipment. SOC (state-of-charge) is one of the most critical states in BMS, which is defined as the ratio of the remaining battery power to the total battery power. Accurate estimation of SOC can prevent lithium-ion batteries from overcharging and discharging, effectively extend battery life, and reduce resource waste. However, due to the complex time series relationship of monitoring data (such as voltage, current, and temperature), accurate and real-time estimation of SOC remains a challenging task.
[0004] Therefore, how to monitor the state of charge is an urgent problem that technicians in this field need to solve. Summary of the invention
[0005] In view of this, the present invention provides a method and system for predicting the charging state of an energy storage device based on gated fusion and attention mechanism, which can accurately estimate the charge state at different temperatures and initial conditions.
[0006] In order to achieve the above object, the present invention adopts the following technical solution: The energy storage device charging state prediction method based on gated fusion and attention mechanism includes: Acquire original charge and discharge data, and pre-process the original charge and discharge data; the original charge and discharge data includes current data, voltage data and temperature data; The pre-processed raw charge and discharge data is split and expanded using a one-dimensional convolutional neural network to obtain a feature map; Adding noise disturbance to the feature graph, and constructing a noise disturbance attention module for the feature graph after adding noise by defining a query matrix, a key matrix and a value matrix and combining a multi-head attention mechanism; The output data of the noise disturbance attention module is subjected to residual normalization processing, the output data after residual normalization processing is used as input, and the LSTM network is used as a feature embedding block to perform feature fusion on each input to obtain fused data; Apply a multi-scale convolution kernel to the fused data to obtain a feature vector, calculate the attention score of each time step feature of the feature vector through a preset scoring function, and highlight the feature information of the key time step; A mapping relationship between the characteristic information and the SOC prediction value is obtained, and the SOC prediction is performed according to the mapping relationship.
[0007] Preferably, the preprocessing specifically includes: performing data preprocessing through a sliding time window, the input is defined as , and , are the voltage, current and temperature of the original charge and discharge data of time step K, respectively.
[0008] Preferably, the obtaining of the feature map specifically includes sending three sets of data into a one-dimensional neural network for learning and extracting features: ; ; ; in, , , The original charge and discharge data is split into specific original data of voltage, current and temperature. A network built for a single-layer 1D-CNN with a sigmoid function. , , is the extracted features corresponding to the input data.
[0009] Preferably, the adding noise disturbance to the feature map specifically includes: ; ; ; Add the noise perturbation feature to the original feature to get , , ; ; in, is a set of prior random variables that obey the normal distribution, represents the convolution operation, , , is the input feature, , , To learn the noise characteristics of voltage, current and temperature of the original data features, , , It is the output feature of adding the noise disturbance feature and the original data feature.
[0010] Preferably, the construction of the noise perturbation attention module specifically includes: ; ; ; ; in, is the query matrix, is the key matrix, is the value matrix, , , is the input feature, , , is the weight matrix, is the attention mechanism, represents the feature channel, is a multi-head attention mechanism, is the learnable output projection matrix, , , is the output feature of the attention mechanism.
[0011] Preferably, the feature embedding block specifically includes: ; ; ; in, is the voltage hidden layer, is the current hidden layer, is the temperature hidden layer, , , are the weights of voltage, current and temperature at time step t, To fuse the data, represents element-wise multiplication, is the input feature, is the LSTM network mechanism, is the weight matrix, is the bias vector.
[0012] Preferably, the step of obtaining the feature vector specifically includes using three 1-dimensional convolution kernels with step sizes of 3, 5, and 7. Convolution is performed, and the features obtained are concatenated along the time feature dimension to obtain : ; in, is the input feature after fusion, , , represents the convolution operation with kernel size of 3, 5, and 7. For splicing operation, for The output features are concatenated after convolution with different convolution kernels.
[0013] Preferably, the step of calculating the attention score of each time step feature of the feature vector by using a preset scoring function specifically includes: calculating by a multiplication scoring function The attention score α at time t t ; Use the softmax function to obtain the exponentially normalized attention score β at time t t ; Through β t and Multiply, redistribute The weight of each element in is as follows: ; in, are learnable weights, is the inner product at time t, for The output features are concatenated after convolution with different convolution kernels. H is the size of the hidden layer of the LSTM model. is the output of the self-attention layer at time t, , and The k, l, m, and n in the table are all indices. t is the attention score, β t is the exponentially normalized attention score, is the multiplicative scoring function.
[0014] Preferably, the obtaining of the mapping relationship between the characteristic information and the SOC prediction value specifically includes: After flattening, the tensor is , expressed as a formula ; where i, j, k represent the sample index, time step index and hidden state dimension index respectively, and l represents the one-dimensional index after flattening. ; After flattening, , Entering the fully connected layer, each neuron in the fully connected layer is connected to all neurons in the input layer through the weight matrix and the bias vector Perform linear transformation; the formula is expressed as: ; The dimension of is determined by the number of input and output neurons.
[0015] The energy storage device charging state prediction system based on gated fusion and attention mechanism includes: A raw data acquisition module, which acquires raw charge and discharge data and pre-processes the raw charge and discharge data; the raw charge and discharge data includes current data, voltage data and temperature data; A feature map acquisition module is used to split the preprocessed raw charge and discharge data and expand it using a one-dimensional convolutional neural network to acquire a feature map; A construction module is provided to add noise disturbance to the feature graph, and a noise disturbance attention module is constructed by defining a query matrix, a key matrix and a value matrix respectively and combining a multi-head attention mechanism with the feature graph after adding noise; A fusion module performs residual normalization on the output data of the noise perturbation attention module, takes the output data after residual normalization as input, adopts an LSTM network as a feature embedding block, performs feature fusion on each input, and obtains fused data; A scoring module applies a multi-scale convolution kernel to the fused data to obtain a feature vector, calculates the attention score of each time step feature of the feature vector through a preset scoring function, and highlights the feature information of the key time step; The prediction module obtains a mapping relationship between the characteristic information and the SOC prediction value, and performs SOC prediction according to the mapping relationship.
[0016] It can be seen from the above technical solutions that compared with the prior art, the present invention discloses a method and system for predicting the charging state of energy storage equipment based on gated fusion and attention mechanism. Compared with the traditional LSTM model, the proposed LSTM-dual attention model shows better estimation accuracy and faster convergence ability, and the model can be extended to untrained ambient temperature and aging degree, sort out the time series relationship between current, voltage and temperature, and can accurately and real-time estimate SOC. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0018] Figure 1 A schematic diagram of the structure provided by the present invention; Figure 2 The present invention provides a discharge estimation diagram of SOC at 100% power at 25︒C; Figure 3 The present invention provides a discharge estimation diagram of SOC at 80% power at 25︒C; Figure 4 The present invention provides a discharge estimation diagram of SOC at 60% power at 25︒C; Figure 5 A comparison diagram of MAE and RSME errors at different temperatures for 100% discharge provided by the present invention; Figure 6 A comparison diagram of MAE and RSME errors at different temperatures for 80% discharge provided by the present invention; Figure 7 The MAE and RSME error comparison at different temperatures for 60% discharge provided by the present invention. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] like Figure 1 As shown, the architecture designed in this application includes a noise perturbation attention module, an LSTM module, a time feature attention module, and a fully connected layer regression module. The advantage of this structure is that the noise attention module before the LSTM module performs attention operations on the current, voltage, and temperature data respectively. This mechanism can adaptively learn the noise influence coefficient and distinguish noise features from key data features through the attention mechanism. The time attention module after the LSTM module provides the feature attention effect of the time dimension for the fused features, and then assigns different weights to the features of each time dimension, comprehensively considers the influence of the fused features, and improves the accuracy of estimating SOC.
[0021] The noise perturbation attention module adds noise perturbation to the attention module for the first time. The perturbation starts from a set of normal distributions and is learned through a convolutional network. Features that conform to real diverse data are obtained from the learning. After adding it, the framework of this article can be better protected from disturbances and the generalization ability can be improved.
[0022] The temporal feature attention module processes the fused features output by the long short-term memory network (LSTM), and performs multi-scale processing on the fused overall features by calculating the attention of convolution kernels of different scales on the features of each time dimension, forming different weights, and fusing the multi-scale features through adaptive weights. It also provides different degrees of attention to the multi-scale features through the attention mechanism, thereby improving the overall feature extraction effect and enhancing the stability and accuracy of SOC estimation.
[0023] pass Figure 1 It can be seen that the data of voltage, current and temperature are , , First, the above three are also the input of the next convolutional layer. After the one-dimensional convolutional neural network (CNN), the original space is transformed into a new multi-dimensional space. The up-projection process of the convolutional layer can expand the original data into a feature map with rich information. The output features are , , At the same time, the noise perturbation module next to it converts a set of prior random variables that obey the normal distribution Respectively , , Combined with the input data of the convolutional network used for voltage, current, and temperature noise perturbation feature extraction. Similarly, the original data is expanded into a feature map containing rich information through the up-projection process of the convolutional layer. The output features are , , Then the noise perturbation feature , , With the original data characteristics , , Add together to get the mixed characteristics of noise disturbance and original data , , .
[0024] Secondly, , , As the input of the attention mechanism, the attention layer can more clearly distinguish the characteristics of the noise data through learning the original data and the noise data, which improves the accuracy and anti-interference ability of the model. , , are the outputs of each attention layer. Then the output of the attention layer , , As the input of the residual normalization layer, residual normalization can prevent the degradation of deep network training, accelerate convergence, and enhance training stability. is the output of the residual normalization layer.
[0025] again, As the input of the LSTM network layer, the grouped voltage, current, and temperature features are integrated through the gating mechanism in the LSTM network, which can better utilize the overall simplicity of the data in subsequent research. is the fusion output feature after passing through the LSTM layer. As the input to the multi-scale convolution kernel layer, after being processed by convolution kernels of different dimensions, it can stack scale features and enrich feature expressions. It is the output feature concatenated after convolution with different convolution kernels.
[0026] Then, It is also the input feature of the self-attention layer. After the self-attention layer mechanism reduces the dimension and highlights the important features in the hidden layer, it can make the SOC estimation faster and more accurate. is the output after the self-attention layer and the residual normalization layer at time t.
[0027] at last, Before entering the full connection, it is used as the input of flattening (pre-operation before entering the full connection layer). After flattening, the full connection layer can process the information of the entire sequence without distinguishing the time step. The output after flattening is . Then As the input of the fully connected layer, through linear changes, the model as a whole can learn the input features The effect of the complex mapping relationship between the SOC value, is the output of the fully connected layer. This vector integrates the parameters learned through model training and maps the input features to the range of SOC values to obtain the estimated value of SOC.
[0028] The embodiment of the present invention discloses a method for predicting the charging state of an energy storage device based on gated fusion and attention mechanism, comprising: Obtaining original charge and discharge data, and preprocessing the original charge and discharge data; the original charge and discharge data includes current data, voltage data and temperature data; The preprocessed raw charge and discharge data is split and expanded using a one-dimensional convolutional neural network to obtain a feature map; Add noise perturbation to the feature graph, and build a noise perturbation attention module by defining the query matrix, key matrix and value matrix of the feature graph after adding noise and combining it with the multi-head attention mechanism; The output data of the noise perturbation attention module is subjected to residual normalization, and the output data after residual normalization is used as input. The LSTM network is used as the feature embedding block to fuse the features of each input to obtain fused data; Apply multi-scale convolution kernels to the fused data to obtain feature vectors, calculate the attention score of each time step feature of the feature vector through a preset scoring function, and highlight the feature information of key time steps; The mapping relationship between the characteristic information and the SOC prediction value is obtained, and the SOC prediction is performed according to the mapping relationship.
[0029] In a specific embodiment, the preprocessing specifically includes: performing data preprocessing through a sliding time window, and the input is defined as , and , are the voltage, current and temperature of the original charge and discharge data of time step K, respectively.
[0030] In a specific embodiment, obtaining the feature map specifically includes sending three sets of data into a one-dimensional neural network to learn and extract features: ; ; ; in, , , The original charge and discharge data is split into specific original data of voltage, current and temperature. A network built for a single-layer 1D-CNN with a sigmoid function. , , is the extracted features corresponding to the input data.
[0031] In a specific embodiment, adding noise disturbance to the feature map specifically includes: ; ; ; Add the noise perturbation feature to the original feature to get , , ; ; in, is a set of prior random variables that obey the normal distribution, represents the convolution operation, , , is the input feature, , , To learn the noise characteristics of voltage, current and temperature of the original data features, , , It is the output feature of adding the noise disturbance feature and the original data feature.
[0032] In a specific embodiment, constructing a noise perturbation attention module specifically includes: ; ; ; ; in, is the query matrix, is the key matrix, is the value matrix, , , is the input feature, , , is the weight matrix, is the attention mechanism, represents the feature channel, is a multi-head attention mechanism, is the learnable output projection matrix, , , is the output feature of the attention mechanism.
[0033] In a specific embodiment, the residual normalization process specifically includes: ; in, , , is the input feature, , , is the output feature of the attention mechanism, is the residual normalization mechanism, is the output feature of the residual normalization mechanism.
[0034] In a specific embodiment, the feature embedding block specifically includes: ; ; ; in, is the voltage hidden layer, is the current hidden layer, is the temperature hidden layer, , , are the weights of voltage, current and temperature at time step t, To fuse the data, represents element-wise multiplication, is the input feature, is the LSTM network mechanism, is the weight matrix, is the bias vector.
[0035] In a specific embodiment, obtaining the feature vector specifically includes using three 1-dimensional convolution kernels with step sizes of 3, 5, and 7. Convolution is performed, and the features obtained are concatenated along the time feature dimension to obtain : ; in, is the input feature after fusion, , , represents the convolution operation with kernel size of 3, 5, and 7. For splicing operation, for The output features are concatenated after convolution with different convolution kernels.
[0036] In a specific embodiment, calculating the attention score of each time step feature of the feature vector by using a preset scoring function specifically includes: calculating by multiplying the scoring function The attention score α at time t t ; Use the softmax function to obtain the exponentially normalized attention score β at time t t ; Through β t and Multiply, redistribute The weight of each element in is as follows: ; in, are learnable weights, is the inner product at time t, for The output features are concatenated after convolution with different convolution kernels. H is the size of the hidden layer of the LSTM model. is the output of the self-attention layer at time t, , and The k, l, m, and n in the table are all indices. t is the attention score, β t is the exponentially normalized attention score, is the multiplicative scoring function.
[0037] In a specific embodiment, obtaining the mapping relationship between the characteristic information and the SOC prediction value specifically includes: After flattening, the tensor is , expressed as a formula ; where i, j, k represent the sample index, time step index and hidden state dimension index respectively, and l represents the one-dimensional index after flattening. ; After flattening, , Entering the fully connected layer, each neuron in the fully connected layer is connected to all neurons in the input layer through the weight matrix and the bias vector Perform linear transformation; the formula is expressed as: ; The dimension of is determined by the number of input and output neurons.
[0038] The energy storage device charging state prediction system based on gated fusion and attention mechanism includes: A raw data acquisition module acquires raw charge and discharge data and pre-processes the raw charge and discharge data; the raw charge and discharge data includes current data, voltage data and temperature data; The feature map acquisition module splits the preprocessed raw charge and discharge data and expands it using a one-dimensional convolutional neural network to obtain a feature map; The construction module adds noise perturbation to the feature map, and constructs the noise perturbation attention module by defining the query matrix, key matrix and value matrix of the feature map after adding noise and combining it with the multi-head attention mechanism; The fusion module performs residual normalization on the output data of the noise perturbation attention module, takes the output data after residual normalization as input, uses the LSTM network as the feature embedding block, performs feature fusion on each input, and obtains fused data; The scoring module applies multi-scale convolution kernels to the fused data to obtain feature vectors, and calculates the attention score of each time step feature of the feature vector through a preset scoring function to highlight the feature information of key time steps; The prediction module obtains the mapping relationship between the feature information and the SOC prediction value, and performs SOC prediction based on the mapping relationship.
[0039] In specific embodiment 1, it includes: Step 1: In the preprocessing stage, following the data-driven approach, the raw charge and discharge data including voltage, current and temperature are obtained from the dataset. The difference is that a "many-to-one" sliding time window is introduced to preprocess the raw data, which enables the network to process long time series. The input is defined as the voltage, current and temperature of the raw data of time step K (K is set to 50 in all experiments). At the same time, the output is defined as the predicted SOC of the current time step.
[0040] Step 2: Convert the original data , and , respectively, are the voltage, current, and temperature of the original charge and discharge data of time step K. In order to perform deep operations on these low-dimensional data, an up-projection process is applied. , a one-dimensional convolutional neural network (CNN) is used to transform the original space into a new multi-dimensional space. According to this projection, the original data is expanded into a feature map containing rich information, which can be formulated as: , where δ[Conv(·)] represents a single-layer 1D-CNN network constructed with a sigmoid function, and the output Similarly, and Applied to split current and temperature data, output separately and .
[0041] Step 3: This method adds a new noise adding process to define a set of prior random variables that obey a multidimensional normal distribution , combined with the existing , Feed it into a set of convolutional networks for learning: ; ; ; Add the noise model to the original features to get , , , ; Step 4: Define three matrices: query matrix (Q), key matrix (K), and value matrix (V). They are all obtained by performing matrix operations: , , , the self-attention using Q, K and V time can be expressed as: , where d k Represents the feature channel. Then, a multi-head attention mechanism is used to promote the learning of various forms of attention, thereby improving the accuracy of the model. Multi-head attention can be expressed in mathematical form as: ,in, In order to prevent the degradation problem during deep network training, a residual block is included based on the features processed after the above operations. In addition, in order to speed up convergence, normalization operations are used to enhance training stability and speed up the process. Its mathematical expression is: .
[0042] The same reason Perform the same operation: , ,
[0043] The same reason Perform the same operation , ,
[0044] The noise perturbation attention module designed in this part adds noise perturbation for the first time. The perturbation starts from a set of normal distributions and is learned through a convolutional network. Features that conform to the real diversity data are obtained from the learning. After addition, the anti-disturbance function can be increased.
[0045] Step 5: Given input features , using LSTM network as the feature embedding block to efficiently learn time series information in a long-term memory manner. The feature embedding block can be expressed as follows , , LSTM itself has a gated structure, including input gate, forget gate and output gate. These gated mechanisms can be used to fuse the grouped current, voltage and temperature features, so as to better utilize the overall simplicity of the data in subsequent research and achieve the purpose of fast, efficient and accurate data processing. Assume that the hidden layers of the three groups of current, voltage and temperature features in the LSTM network are , , At each time step t, a new gating mechanism can be designed to control the fusion of these three hidden states. The new gate is a weight vector obtained by a simple linear transformation and a sigmoid activation function. and , , Connect them and then pass the sigmoid function to get the gate vector, that is, ,in , , They are the weights of current, voltage, and temperature at time step t. After obtaining the feature weights, we can perform feature fusion. The hidden state after fusion is as follows: ; in, Represents element-wise multiplication.
[0046] Step 6: Use multi-scale convolution kernels to perform 1D convolution on the features in the lower layer of the LSTM long short-term memory network. Three 1D convolution kernels with step sizes of 3, 5, and 7 are used. Convolution is performed, and the features obtained are concatenated along the time feature dimension to obtain : ; Then use a layer of self-attention mechanism to capture the time dimension feature attention weight of the overall data. First, calculate the multiplication score function The attention score α at time t t Then, the softmax function is used to obtain the exponentially normalized attention score β at time t t Next, through β t and Multiply, redistribute The weight of each element in . This process can be expressed by the following formula: ; in, are learnable weights, is the inner product at time t, H is the size of the hidden layer of the LSTM model, is the output of the self-attention layer at time t. , and The k, l, m, and n in the table all refer to indexes, which means at time t, for this The element at the kth row and lth column and the element at the mth row and nth column in the tensor.
[0047] Step 7: Output of the self-attention layer Before entering the fully connected layer, it needs to be flattened, that is, the three-dimensional data tensor (for example: [batch_size, sequence_length, hidden_size]) is converted into a two-dimensional tensor (for example: [batch_size, sequence_length*hidden_size]). This step enables the fully connected layer to process the information of the entire sequence without distinguishing the time step, and to treat all the hidden states in the sequence as a whole for subsequent processing. is the output tensor of the self-attention layer, and the flattened tensor is , then it can be expressed by the formula .
[0048] Where i, j, k represent the sample index, time step index and hidden state dimension index respectively, and l represents the one-dimensional index after flattening. . After flattening, , Entering the fully connected layer, each neuron in the fully connected layer is connected to all neurons in the input layer through the weight matrix and the bias vector Perform a linear transformation.
[0049] The formula is expressed as: In this process The dimensions of are determined by the number of input and output neurons. For example, if the input ( ) dimension is m (i.e. sequence_length*hidden_size), and the output dimension is n (for example, the final SOC value can be regarded as one dimension), then The dimension is , through this linear transformation, the model can learn the input features ( ) and the complex mapping relationship between SOC value.
[0050] Output of the fully connected layer After the above linear transformation, a new vector representation is obtained , this vector integrates and maps the input features to the range of SOC values through the parameters learned by model training. During the training process, the model continuously adjusts the weights and biases of the fully connected layer according to the actual SOC value in the training data, so that the SOC estimate output by the model is as close to the actual value as possible. These parameters are optimized by minimizing the loss function (such as the root mean square error RMSE), so that the model can accurately extract information from it and convert it into SOC estimation results.
[0051] Step 8: In order to simulate the dynamic real working conditions of lithium-ion batteries in distributed energy storage devices, the lithium iron phosphate (LFP) battery is discharged for 0 minutes, 10 minutes, 25 minutes, 30 minutes, 40 minutes and 50 minutes. For each charge and discharge process, the battery is first fully charged in constant current (1C) and constant voltage mode. When the current is less than the charge cutoff current, the charging process is stopped, and the discharge is continued according to one of the above dynamic working conditions until the power is exhausted. When the terminal voltage is lower than the discharge cutoff voltage, the battery is considered to be fully discharged. During the above process, the current, voltage and surface temperature signals of the battery are recorded every 1 second. At the same time, due to the influence of temperature, this experiment tests the SOC and error value of lithium-ion batteries at various temperatures at 100%, 80%, and 60%.
[0052] Step 9: To evaluate the proposed method, the mean absolute error (MAE) and root mean square error (RMSE) are used as evaluation metrics: ; In the formula, n is the number of all test samples, and are the actual and estimated values of SOC at time step k, respectively. In addition, the r-squared metric is used as an evaluation metric to evaluate the fitting performance of the evaluation method. The higher the value, the better the model fit. The mathematical expression of the r-squared metric is: ; in, It is the arithmetic mean of the actual SOC value.
[0053] Step 10: Experimental results show that the method proposed in the present invention can estimate the SOC under different temperatures and initial conditions more accurately.
[0054] First pass Figure 2 , Figure 3 and Figure 4It is relatively intuitive to see how this model estimates SOC at different battery capacities. Among them, the model's SOC estimation is more accurate at 80% and 100% initial capacity than at 60% initial capacity. But overall, the model's SOC estimation effect is very significant in all three cases, reflecting the model's strong generalization ability at different initial capacities.
[0055] Secondly, through Figure 5 , Figure 6 and Figure 7 It is relatively clear to see the error of this model at different temperatures in different initial capacity tests. The mean error (MAE) is within 1.5% and the root mean square error (RSME) is within 2% under the three initial capacities, which reflects the strong stability, accuracy and generalization ability of this model for SOC estimation at different initial capacities and temperatures.
[0056] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0057] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for predicting the charging state of energy storage equipment based on gated fusion and attention mechanism, characterized in that: include: Acquire original charge and discharge data, and pre-process the original charge and discharge data; The original charge and discharge data includes current data, voltage data and temperature data; The pre-processed raw charge and discharge data is split and expanded using a one-dimensional convolutional neural network to obtain a feature map; Adding noise disturbance to the feature graph, and constructing a noise disturbance attention module for the feature graph after adding noise by defining a query matrix, a key matrix and a value matrix and combining a multi-head attention mechanism; The output data of the noise disturbance attention module is subjected to residual normalization processing, the output data after residual normalization processing is used as input, and the LSTM network is used as a feature embedding block to perform feature fusion on each input to obtain fused data; Apply a multi-scale convolution kernel to the fused data to obtain a feature vector, calculate the attention score of each time step feature of the feature vector through a preset scoring function, and highlight the feature information of the key time step; A mapping relationship between the characteristic information and the SOC prediction value is obtained, and the SOC prediction is performed according to the mapping relationship.
2. According to claim 1, the method for predicting the charging state of energy storage equipment based on gated fusion and attention mechanism is characterized in that: The preprocessing specifically includes: performing data preprocessing through a sliding time window, and the input is defined as , and , are the voltage, current and temperature of the original charge and discharge data of time step K, respectively.
3. The method for predicting the charging state of energy storage equipment based on gated fusion and attention mechanism according to claim 1 is characterized in that: The acquisition of the feature map specifically includes sending three sets of data into a one-dimensional neural network for learning and feature extraction: ; ; ; in, , , The original charge and discharge data is split into specific original data of voltage, current and temperature. A network built for a single-layer 1D-CNN with a sigmoid function. , , is the extracted features corresponding to the input data.
4. The method for predicting the charging state of energy storage equipment based on gated fusion and attention mechanism according to claim 1 is characterized in that: The adding of noise disturbance to the feature map specifically includes: ; ; ; Add the noise perturbation feature to the original feature to get , , ; ; in, is a set of prior random variables that obey the normal distribution, represents the convolution operation, , , is the input feature, , , To learn the noise characteristics of voltage, current and temperature of the original data features, , , It is the output feature of adding the noise disturbance feature and the original data feature.
5. The method for predicting the charging state of energy storage equipment based on gated fusion and attention mechanism according to claim 4 is characterized in that: The construction of the noise perturbation attention module specifically includes: ; ; ; ; in, is the query matrix, is the key matrix, is the value matrix, , , is the input feature, , , is the weight matrix, is the attention mechanism, represents the feature channel, is a multi-head attention mechanism, is the learnable output projection matrix, , , is the output feature of the attention mechanism.
6. The method for predicting the charging state of energy storage equipment based on gated fusion and attention mechanism according to claim 1 is characterized in that: The feature embedding block specifically includes: ; ; ; in, is the voltage hidden layer, is the current hidden layer, is the temperature hidden layer, , , are the weights of voltage, current and temperature at time step t, To fuse the data, represents element-wise multiplication, is the input feature, is the LSTM network mechanism, is the weight matrix, is the bias vector.
7. The method for predicting the charging state of energy storage equipment based on gated fusion and attention mechanism according to claim 6 is characterized in that: The method of obtaining the feature vector specifically includes using three 1-dimensional convolution kernels with step sizes of 3, 5, and 7. Convolution is performed, and the features obtained are concatenated along the time feature dimension to obtain : ; in, is the input feature after fusion, , , represents the convolution operation with kernel size of 3, 5, and 7. For splicing operation, for The output features are concatenated after convolution with different convolution kernels.
8. The method for predicting the charging state of energy storage equipment based on gated fusion and attention mechanism according to claim 1 is characterized in that: The method of calculating the attention score of each time step feature of the feature vector by using a preset scoring function specifically includes: calculating by a multiplication scoring function The attention score α at time t t ; Use the softmax function to obtain the exponentially normalized attention score β at time t t ; Through β t and Multiply, redistribute The weight of each element in is as follows: ; in, are learnable weights, is the inner product at time t, for The output features are concatenated after convolution with different convolution kernels. H is the size of the hidden layer of the LSTM model. is the output of the self-attention layer at time t, , and The k, l, m, and n in the table are all indices. t is the attention score, β t is the exponentially normalized attention score, is the multiplicative scoring function.
9. The method for predicting the charging state of energy storage equipment based on gated fusion and attention mechanism according to claim 8, characterized in that: The step of obtaining the mapping relationship between the characteristic information and the SOC prediction value specifically includes: After flattening, the tensor is , expressed as a formula ; where i, j, k represent the sample index, time step index and hidden state dimension index respectively, and l represents the one-dimensional index after flattening. ; After flattening, , Entering the fully connected layer, each neuron in the fully connected layer is connected to all neurons in the input layer through the weight matrix and the bias vector Perform linear transformation; the formula is expressed as: ; The dimension of is determined by the number of input and output neurons.
10. A system for predicting the charging state of an energy storage device based on gated fusion and attention mechanism, applying the method for predicting the charging state of an energy storage device based on gated fusion and attention mechanism as described in any one of claims 1 to 9, characterized in that: include: A raw data acquisition module, which acquires raw charge and discharge data and pre-processes the raw charge and discharge data; The original charge and discharge data includes current data, voltage data and temperature data; A feature map acquisition module is used to split the preprocessed raw charge and discharge data and expand it using a one-dimensional convolutional neural network to acquire a feature map; A construction module is provided to add noise disturbance to the feature graph, and a noise disturbance attention module is constructed by defining a query matrix, a key matrix and a value matrix respectively and combining a multi-head attention mechanism with the feature graph after adding noise; A fusion module performs residual normalization on the output data of the noise perturbation attention module, takes the output data after residual normalization as input, adopts an LSTM network as a feature embedding block, performs feature fusion on each input, and obtains fused data; A scoring module applies a multi-scale convolution kernel to the fused data to obtain a feature vector, calculates the attention score of each time step feature of the feature vector through a preset scoring function, and highlights the feature information of the key time step; The prediction module obtains a mapping relationship between the characteristic information and the SOC prediction value, and performs SOC prediction according to the mapping relationship.
Citation Information
Patent Citations
SEMG signal classification method and system based on time convolution neural network
CN112507881A
Lithium ion battery SOC estimation method based on neural network
CN117313532A
AI auxiliary assessment method and system for pregnancy mental health
CN118352083A
Encoder-decoder battery SOC estimation method based on attention mechanism
CN119024187A
Reconstruction and prediction-based time sequence anomaly detection method
CN119089342A
Cited By
Distributed energy storage equipment charge state prediction method and system based on diffusion bridging
CN121142346A
Diffusion bridge-based distributed energy storage device state of charge prediction method and system
CN121142346B