State of charge prediction method for optical energy storage battery based on CNN-LSTM-SA

By adopting the CNN-LSTM-SA method in the state of charge prediction of photoelectric energy storage cells, spatial characteristics are extracted and time-dependent models are established, and a self-attention mechanism is introduced, the accuracy and adaptability problems of the existing prediction methods are solved, and more efficient and accurate state-of-charge prediction is achieved.

CN119780725APending Publication Date: 2025-04-08STATE GRID (WENZHOU) COMPREHENSIVE ENERGY SERVICES CO LTD
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202411866709.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing photoelectric energy storage battery state-of-charge prediction methods have problems such as insufficient prediction accuracy, poor timing-dependent modeling capabilities, ignoring the complex influence of multiple factors, and low computational efficiency and poor adaptability.

Method used

Using a CNN-LSTM-SA method, the spatial characteristics of battery state of charge change are extracted through a convolutional neural network, a time-dependent model is established in combination with a long and short-term memory network, and a self-attention mechanism is introduced for feature-weighted fusion to calculate the state of charge predicted value.

Benefits of technology

It significantly improves the accuracy and real-time prediction capabilities of state of charge prediction, and can effectively combine multiple influencing factors to adapt to dynamically changing battery state, reduce overcharge and overdischarge, extend battery life and reduce maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119780725A_ABST
    Figure CN119780725A_ABST
Patent Text Reader

Abstract

The invention relates to the field of optical energy storage technology, and discloses a method for predicting the state of charge of an optical energy storage battery based on CNN-LSTM-SA. The key points of the technical solution include the following steps: collecting all state data of an optical energy storage battery; standardizing the state data to obtain a standardized state data matrix, performing feature extraction, and obtaining a time series data matrix; inputting the time series data matrix into a convolutional neural network to extract a spatial feature vector sequence; inputting the spatial feature vector sequence into a long short-term memory network to establish a model of the time dependence of the battery state of charge, and obtaining time-varying trend data; taking the spatial feature vector sequence and the time-varying trend data as inputs, citing them for processing by an attention mechanism, and obtaining a feature output after attention weighting; and calculating a state of charge prediction value by applying a weighted fusion algorithm based on the spatial feature vector sequence, the time-varying trend data, and the feature output after attention weighting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of optical energy storage technology, and more specifically, to a method for predicting the state of charge of an optical energy storage battery based on CNN-LSTM-SA. Background Art

[0002] In the field of online state of charge prediction of solar energy storage batteries, existing technologies mainly rely on traditional prediction methods, such as statistical models, traditional neural networks (such as BP neural networks) and simple machine learning algorithms. However, these methods have some limitations when facing highly nonlinear and dynamically changing systems such as solar energy storage batteries:

[0003] (1) Insufficient prediction accuracy: Traditional statistical models usually rely on fixed assumptions and rules, and it is difficult to accurately capture the complex nonlinear dynamic changes of solar energy storage batteries under different environmental and load conditions. Traditional neural networks improve prediction accuracy to a certain extent, but their learning and memory capabilities for long time series are weak, resulting in large errors in long-term prediction of battery state of charge.

[0004] (2) Poor modeling of time series dependency: The change in battery state of charge has significant time series characteristics. Traditional methods often ignore the deep use of time series information and cannot fully learn the impact of the battery's historical state on the current state. Even if a simple machine learning model is used, it lacks accurate modeling of time series dependency, resulting in poor prediction results.

[0005] (3) Ignoring the complex influence of multiple factors: The state of charge of solar energy storage batteries is affected by multiple factors, including solar radiation intensity, temperature, load fluctuations, etc. These factors interact with each other and have nonlinear relationships. Traditional methods fail to effectively consider these factors and usually use a single input feature for prediction, which cannot fully capture the changing laws of the battery state of charge.

[0006] (4) Low computational efficiency and poor adaptability: Existing prediction models mostly rely on traditional training methods, which are inefficient when processing large-scale data and difficult to adapt to the online real-time prediction needs of large-scale solar energy storage battery systems. In addition, existing models have poor adaptability to changes in battery status and are difficult to continuously optimize in practical applications.

[0007] In order to solve the above problems, some studies in the prior art have attempted to combine convolutional neural networks (CNN) and long short-term memory networks (LSTM) to predict the battery state of charge. However, the technical solutions of the prior art only focus on a single feature, such as spatial features or temporal features, and fail to effectively combine the advantages of both, resulting in a large accuracy problem in the actual battery state of charge prediction results. In addition, some existing studies often ignore the introduction of the self-attention mechanism (SA) to further optimize the model's attention to key features, resulting in a large room for improvement in prediction accuracy and model adaptability.

[0008] Therefore, in order to obtain better prediction accuracy, it is necessary to integrate various technologies in the existing technology and overcome the defects of existing battery state of charge prediction. Summary of the invention

[0009] The purpose of the present invention is to provide a method for predicting the state of charge of a light energy storage battery based on CNN-LSTM-SA, which can improve the prediction accuracy and enhance the real-time prediction capability.

[0010] The above technical objectives of the present invention are achieved through the following technical solutions: A method for predicting the state of charge of a light energy storage battery based on CNN-LSTM-SA comprises the following steps:

[0011] S1, collect all status data of the light energy storage battery;

[0012] S2. Standardizing the state data to obtain a standardized state data matrix;

[0013] S3, extracting features from the standardized state data matrix to obtain a time series data matrix;

[0014] S4, inputting the time series data matrix into the convolutional neural network to extract the spatial feature vector sequence of the battery state of charge change;

[0015] S5. Input the spatial feature vector sequence into the long short-term memory network to establish a model of the time dependence of the battery state of charge, and obtain the state change trend of the battery at different times, that is, the time change trend data, through model learning;

[0016] S6, taking the spatial feature vector sequence and the time change trend data as input, referencing the self-attention mechanism for processing, and obtaining the feature output after attention weighting;

[0017] S7. Based on the spatial feature vector sequence, time change trend data and attention-weighted feature output, a weighted fusion algorithm is applied to calculate the charge state prediction value.

[0018] As a preferred technical solution of the present invention, it also includes S8, which is: updating and adjusting the parameters of the model through a loss function and an optimization algorithm.

[0019] As a preferred technical solution of the present invention, the state data includes operation data of the solar energy storage battery, external environment data, equipment characteristic data, and historical working mode data;

[0020] The operating data includes photovoltaic power generation power, voltage, current, temperature and historical state of charge;

[0021] The external environment data includes light intensity, temperature, and humidity;

[0022] The equipment characteristic data includes discharge rate, capacity decay curve, and charge and discharge efficiency;

[0023] The historical operating mode data includes actual operating curves and scheduling strategies of the battery under different loads.

[0024] 5. As a preferred technical solution of the present invention, S2 includes the following sub-steps:

[0025] S21, perform outlier detection on all status data and remove outliers;

[0026] S22, filling in the missing data values ​​generated after the outliers are removed;

[0027] S23, normalizing the state data with the missing values ​​filled in. The normalization process is: normalizing the state data to 0-1, and the formula is: X norm is the normalized state data matrix, X is the original state data matrix, the size of the original state data matrix is ​​N×F, N is the time step, F is the number of features, min(X) is the minimum value of each feature dimension, and max(X) is the maximum value of each feature dimension.

[0028] As a preferred technical solution of the present invention, the feature extraction process in S3 is as follows: applying the fast Fourier transform algorithm to the standardized state data matrix, extracting the frequency characteristics of the battery load change, and mapping the time domain signal to the frequency domain; using the wavelet transform to decompose the non-stationary characteristics of the voltage and current data, extracting the detail signal and the trend signal, and obtaining the time series data matrix.

[0029] As a preferred technical solution of the present invention, in S4, the convolutional neural network adopts ReLU as the activation function, wherein the expression of ReLU is: ReLU(z)=max(0,z), z is the linear combination result of the convolution layer output, that is, the result of the input signal after convolution and weighting; ReLU(Z) represents the output after activation, if Z is negative, the output is 0, if Z is positive, the output is Z itself.

[0030] As a preferred technical solution of the present invention, in S5, the long short-term memory network includes a forget gate, an input gate, a memory unit, and an output gate, and the memory unit includes a candidate memory unit and an update memory unit;

[0031] The expression of the forget gate is: t =σ(W f ·[h t-1 , x t ]+b f );

[0032] The expression of the input gate is: t =σ(W i ·[h t-1 , x t ]+b i );

[0033] The expression of the candidate memory unit is:

[0034] The expression for updating the memory unit is:

[0035] The expression of the output gate is: t =o t tanh(C t );

[0036] Among them, f t Indicates the degree of forgetting of the memory at the previous time step;

[0037] W f Represents the weight matrix of the forget gate;

[0038] h t-1 Represents the hidden state of the previous time step, that is, the network output at the previous moment;

[0039] x t Indicates the current input data;

[0040] b f Represents the bias term of the forget gate;

[0041] i t Indicates the degree of update of the memory unit by the current input data;

[0042] W i represents the weight matrix of the input gate;

[0043] b i represents the bias term of the input gate;

[0044] Indicates the impact of the current input data on the memory unit;

[0045] W C represents the weight matrix of the memory unit, b C Represents the bias term of the memory unit;

[0046] C t Represents the state of all information memory units that need to be retained at the current time step;

[0047] C t-1 Represents the state of all information memory units that need to be retained in the previous real time step;

[0048] o t Indicates that the current memory unit affects the output content;

[0049] h t Represents the hidden state, which is the final output of LSTM, i.e., the time-varying trend data.

[0050] As a preferred technical solution of the present invention, in S6, the process of citing the self-attention mechanism for processing includes the following sub-steps:

[0051] S61, calculate the query, key and value. For the input sequence Xnorm, the query Q, key K and value V are calculated respectively through three weight matrices;

[0052] Q=X norm ·W q ; K = X norm ·W k ; V = X norm ·W v ;

[0053] Among them, W q is the query weight matrix, used to generate the query vector; W k is the key weight matrix used to generate the key vector, W v is the value weight matrix, used to generate the value vector;

[0054] S62. Calculate attention weight: Calculate the relevance of query Q and key K, and use dot product to measure their similarity scores Attention Scores, which are expressed as: d k is the dimension K of the key vectorT Represents the transpose of the key matrix K, which is mainly used to perform dot product operations with the query matrix Q to scale the dot product results;

[0055] The similarity score Attention Scores is converted into a probability distribution through the Softmax function to represent the attention weight, Attention Weights = Softmax (Attention Scores). The Softmax function converts all attention scores into positive numbers and makes their sum 1, which is used to represent the relative importance between each position;

[0056] S63. Generate a weighted feature matrix: Combine the attention weight A and the value matrix V to calculate the weighted feature matrix B = A×V.

[0057] As a preferred technical solution of the present invention, S8 includes the following sub-steps: S81, using mean square error MSE as a loss function to calculate the error between the predicted value and the true value, the formula of MSE is: Where N is the number of samples; y i is the true label of the i-th sample, i.e., the actual state of charge of the battery; is the predicted value of the i-th sample, that is, the state of charge output by the model;

[0058] S82. Use the Adam optimizer to minimize the mean square error (MSE) during the training process. Update the model parameters by iteratively optimizing the model parameters. The specific update rules are as follows:

[0059] First moment estimate of the gradient:

[0060]

[0061] Second moment estimate of the gradient:

[0062]

[0063] Parameter update rules:

[0064]

[0065]

[0066]

[0067] Among them, m t is the first-order momentum estimate for the t-th iteration, representing the exponentially weighted average of the gradient, v tis the second-order momentum estimate for the t-th iteration, which represents the exponentially weighted average of the squared gradient; β1, β2 are the decay hyperparameters of the first-order and second-order momentum; α is the learning rate, which is used to control the step size of parameter update; ò is the numerical stability term; θ t is the model parameter of the tth iteration, which is gradually updated during the optimization process. is the gradient of the model parameter 0, that is, the derivative of the loss function with respect to the parameter.

[0068] In summary, the present invention has the following beneficial effects:

[0069] Improve prediction accuracy: Through deep learning and self-attention mechanism, it can better capture the complex time series and spatial characteristics of battery state of charge, significantly improving prediction accuracy. Improve real-time prediction capabilities. The LSTM network can handle the time dependence of the battery state of charge. Combined with CNN and SA, it can make predictions more accurately in real-time environments and adapt to dynamically changing battery states. It can effectively combine multiple influencing factors such as solar radiation intensity, ambient temperature, and load fluctuations to make the prediction of battery state of charge more comprehensive and accurate. Through dynamic optimization and adjustment, the prediction model can be continuously optimized in actual operation, the overall performance of the battery management system can be improved, and the stable operation of the battery under different load and environmental conditions can be ensured. By improving the accuracy of battery state of charge prediction, it can effectively reduce battery overcharge and over-discharge, extend battery life, reduce maintenance costs, and have good economic benefits. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 It is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0071] The present invention is further described in detail below in conjunction with the accompanying drawings.

[0072] like Figure 1 As shown, the present invention provides a method for predicting the state of charge of a light energy storage battery based on CNN-LSTM-SA, that is, a prediction method based on a convolutional neural network, a long short-term memory network, and a self-attention mechanism, comprising the following steps:

[0073] S1, collect all status data of the light energy storage battery;

[0074] Status data includes the operation data of the solar energy storage battery, external environment data, equipment characteristic data, and historical working mode data;

[0075] The operating data includes indicators such as photovoltaic power generation power, voltage, current, temperature and historical charge state of the energy storage battery; when the actual data is acquired, the operating data is collected through the monitoring system of the photovoltaic power generation and energy storage system.

[0076] External environmental data includes light intensity, temperature, humidity, etc. The data sources are the light sensors of the photovoltaic system and the meteorological data interface;

[0077] Equipment characteristic data includes equipment characteristics such as discharge rate, capacity decay curve, and charge and discharge efficiency of energy storage batteries, which are obtained through laboratory tests or equipment specifications;

[0078] The historical working mode data includes the actual operating curve and scheduling strategy of the battery under different loads.

[0079] When collecting data in S1, the data is collected according to a preset collection timing frequency, and the collection timing frequency does not exceed 1 second / time, so as to ensure that detailed information of dynamic changes of the battery is captured to form high-resolution time series data.

[0080] S2. Performing a standardization process on the state data to obtain a standardized state data matrix; wherein the standardization process includes an outlier detection process, a missing value filling process, and a normalization process.

[0081] Specifically, S2 includes the following sub-steps:

[0082] S21. Use the 3σ principle to detect outliers in all state data and remove outliers;

[0083] S22, using the autoregressive moving average (ARIMA) algorithm of time series to fill in the missing data values ​​generated after the outliers are removed;

[0084] S23, normalizing the state data with missing values ​​filled in. The normalization process is: normalizing the state data to 0-1. The formula is:

[0085]

[0086] Among them, X norm is the normalized state data matrix;

[0087] X is the original state data matrix, the size of the original state data matrix is ​​N×F, N is the time step, F is the number of features, that is, the feature dimension of each element;

[0088] min(X) is the minimum value of each feature dimension;

[0089] max(X) is the maximum value of each feature dimension.

[0090] The purpose of normalization is to unify the data range after the data is complete.

[0091] S3, extracting features from the standardized state data matrix to obtain a time series data matrix;

[0092] The feature extraction process in S3 is as follows: the fast Fourier transform algorithm is applied to the standardized state data matrix to extract the frequency characteristics of the battery load change and map the time domain signal to the frequency domain; the wavelet transform is used to decompose the non-stationary characteristics of the voltage and current data, extract the detail signal and trend signal, and obtain a standardized, high-resolution time series data matrix, which contains various battery performance indicators (voltage, current, temperature, SOC) and external environment data (light intensity, temperature, humidity), as the input feature matrix of the CNN model.

[0093] S4, inputting the time series data matrix into a convolutional neural network, i.e., CNN, to extract a spatial feature vector sequence of battery state of charge change;

[0094] Input: Normalized and feature-extracted time series data matrix. The data matrix is ​​in the shape of N×F, where N represents the time step and F represents the number of features. The input features of each time step include the battery voltage, current, temperature, SOC, and external environment data.

[0095] The purpose of using a convolutional neural network is to extract the spatial correlation between features and use multiple convolution kernels (kernel size = 3, stride = 1) to capture local patterns.

[0096] Specifically, the convolutional neural network uses ReLU, or rectified linear unit, as the activation function, where the expression of ReLU is:

[0097] ReLU(z)=max(0,z);

[0098] Z is the linear combination result of the convolution layer output, that is, the result of the input signal after convolution and weighting; ReLU(z) represents the output after activation. If z is negative, the output is 0, and if z is positive, the output is z itself.

[0099] S5. Input the spatial feature vector sequence into a long short-term memory network, i.e., LSTM, to establish a model of the time dependency of the battery state of charge, and obtain the state change trend of the battery at different times, i.e., time change trend data, through model learning;

[0100] In S5, the long short-term memory network includes a forget gate, an input gate, a memory unit, and an output gate. The memory unit includes a candidate memory unit and an update memory unit. The flow of information is controlled by three gating mechanisms: the forget gate, the input gate, and the output gate.

[0101] The expression of the forget gate Forget Gate is:

[0102] f t =σ(W f ·[ht-1 , x t ]+b f );

[0103] The input gate determines the impact of the current input and the hidden state of the previous time step on the current memory unit, and controls which new information needs to be written into the memory unit. The expression of the input gate is:

[0104] i t =σ(W i ·[h t-1 , x t ]+b i );

[0105] The candidate memory cell is used to generate new candidate memory information, which will then be input into the memory cell. The expression of the candidate memory cell is:

[0106]

[0107] Updated memory unit C t It is the weighted sum of the memory of the previous time step and the current candidate memory controlled by the forget gate and the input gate. The expression for updating the memory cell is:

[0108]

[0109] The final hidden state h t It is calculated based on the updated memory unit and output gate, representing the output of the model. The expression of the output gate is:

[0110] h t =o t tanh(C t );

[0111] Among them, f t Indicates the degree of forgetting of the memory at the previous time step;

[0112] W f Represents the weight matrix of the forget gate;

[0113] h t-1 Represents the hidden state of the previous time step, that is, the network output at the previous moment;

[0114] x t Indicates the current input data;

[0115] b f Represents the bias term of the forget gate;

[0116] i tIndicates the degree of update of the memory unit by the current input data;

[0117] W i represents the weight matrix of the input gate;

[0118] b i represents the bias term of the input gate;

[0119] Indicates the impact of the current input data on the memory unit;

[0120] W C represents the weight matrix of the memory unit, b C Represents the bias term of the memory unit;

[0121] C t Represents the state of all information memory units that need to be retained at the current time step;

[0122] C t-1 Represents the state of all information memory units that need to be retained in the previous real time step;

[0123] o t Indicates that the current memory unit affects the output content;

[0124] h t Represents the hidden state, which is the final output of LSTM, that is, the time-varying trend data, which is used for subsequent calculations or passed to the next time step.

[0125] σ(·): Sigmoid activation function, which compresses the input value into the range of [0,1] and is used to determine the passing ratio of information;

[0126] tanh(·): Hyperbolic tangent function, which maps the input value to the range [-1,1] and is used to generate candidate memory values ​​and hidden states.

[0127] S6, taking the spatial feature vector sequence and the time change trend data as input, referencing the self-attention mechanism for processing, and obtaining the feature output after attention weighting;

[0128] The self-attention mechanism is a mechanism for capturing the dependencies between elements in an input sequence and can be used to process sequence data. Its core is to weight the information of other elements by calculating the correlation between each input element and other elements.

[0129] In S6, the process of processing by the self-attention mechanism includes the following sub-steps:

[0130] S61, calculate the query, key and value. For the input sequence Xnorm, the query Q, key K and value V are calculated respectively through three weight matrices;

[0131] Q is the query vector, which represents the feature representation of the current element, K is the key vector, which represents the feature representation of other elements in the sequence, and V is the value vector, which represents the actual information of other elements in the sequence.

[0132] Q=X norm ·W q ; K = X norm ·W k ; V = X norm ·W v ;

[0133] Among them, W q is the query weight matrix, used to generate the query vector; W k is the key weight matrix used to generate the key vector, W v is the value weight matrix, used to generate the value vector;

[0134] S62. Calculate the attention weights: Calculate the relevance of the query Q and the key K, and use the dot product to measure their similarity scores. The expression is:

[0135]

[0136] d k is the dimension K of the key vector T Represents the transpose of the key matrix K, which is mainly used to perform dot product operations with the query matrix Q to scale the dot product results to avoid gradient vanishing due to excessive values;

[0137] The similarity score Attention Scores is converted into a probability distribution through the Softmax function to represent the attention weight, which is expressed as:

[0138] Attention Weights=Softmax(Attention Scores);

[0139] The Softmax function is used to convert the attention scores into weights, convert all attention scores into positive numbers, and make their sum 1, which is used to represent the relative importance between each position;

[0140] S63. Generate a weighted feature matrix: Combine the attention weight A and the value matrix V to calculate the weighted feature matrix B = A×V.

[0141] It should be noted that step S6 is the core of the present invention, which captures the implicit global dependencies in the time series data by calculating the query (Q), key (K), and value (V) using the self-attention mechanism. Compared with traditional methods, the self-attention mechanism can more accurately allocate feature weights, improve the prediction ability of the model in complex dynamic systems, and thus make the prediction results of the final model more accurate.

[0142] S7. Based on the spatial feature vector sequence, time change trend data and attention-weighted feature output, a weighted fusion algorithm is applied to calculate the state of charge prediction value, i.e., the battery SOC value.

[0143] It should be noted that the contents of S4-7 of the present invention involving CNN, LSTM, SA and weighted fusion algorithm together constitute the prediction model of the present invention, so that after S3 is executed to obtain the time series data matrix, it can be used as input and input into the prediction model, and the steps of S4-7 are automatically run through the model to obtain the final state of charge prediction value.

[0144] It should be noted that the weighted fusion algorithm of the present invention is an existing general algorithm. It calculates the state of charge prediction value by weighted summation according to the spatial feature vector sequence, time change trend data and attention-weighted feature output, and the weight is determined based on the result of parameter optimization during the model training process.

[0145] S8. Update and adjust the parameters of the model through loss function and optimization algorithm.

[0146] S8 includes the following sub-steps: S81, using mean square error MSE as a loss function to calculate the error between the predicted value and the true value. The formula of MSE is:

[0147]

[0148] Where N is the number of samples; y i is the true label of the i-th sample, i.e., the actual state of charge of the battery; is the predicted value of the i-th sample, that is, the state of charge output by the model;

[0149] S82. Using the Adam optimizer, during the training process, with the goal of minimizing the mean square error (MSE), the model parameters are optimized and updated through iterations, so that the model can more accurately predict the battery state of charge. The specific update rules are as follows:

[0150] First moment estimate of the gradient:

[0151]

[0152] Second moment estimate of the gradient:

[0153]

[0154] Parameter update rules:

[0155]

[0156]

[0157]

[0158] Among them, m t is the first-order momentum estimate for the t-th iteration, representing the exponentially weighted average of the gradient;

[0159] v t is the second-order momentum estimate for the t-th iteration, which represents the exponentially weighted average of the squared gradient;

[0160] β1, β2 are the decay hyperparameters of the first-order and second-order momentum, usually set to 0.9 and 0.999;

[0161] α is the learning rate, which is used to control the step size of parameter update;

[0162] ò is a numerical stabilization term used to avoid the denominator being zero;

[0163] θ t is the model parameter of the tth iteration, which is gradually updated during the optimization process;

[0164] is the gradient of the model parameter 0, that is, the derivative of the loss function with respect to the parameter.

[0165] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for predicting the state of charge of a light energy storage battery based on CNN-LSTM-SA, characterized by: The steps include: S1, collect all status data of the light energy storage battery; S2. Standardizing the state data to obtain a standardized state data matrix; S3, extracting features from the standardized state data matrix to obtain a time series data matrix; S4, inputting the time series data matrix into the convolutional neural network to extract the spatial feature vector sequence of the battery state of charge change; S5. Input the spatial feature vector sequence into the long short-term memory network to establish a model of the time dependence of the battery state of charge, and obtain the state change trend of the battery at different times, that is, the time change trend data, through model learning; S6, taking the spatial feature vector sequence and the time change trend data as input, referencing the self-attention mechanism for processing, and obtaining the feature output after attention weighting; S7. Based on the spatial feature vector sequence, time change trend data and attention weighted feature output, a weighted fusion algorithm is applied to calculate the charge state prediction value.

2. The method for predicting the state of charge of a light energy storage battery based on CNN-LSTM-SA according to claim 1 is characterized in that: It also includes S8, which is: updating and adjusting the parameters of the model through a loss function and an optimization algorithm.

3. The method for predicting the state of charge of a light energy storage battery based on CNN-LSTM-SA according to claim 1 is characterized in that: The status data includes the operation data of the solar energy storage battery, external environment data, equipment characteristic data, and historical working mode data; The operating data includes photovoltaic power generation power, voltage, current, temperature and historical state of charge; The external environment data includes light intensity, temperature, and humidity; The equipment characteristic data includes discharge rate, capacity decay curve, and charge and discharge efficiency; The historical operating mode data includes actual operating curves and scheduling strategies of the battery under different loads.

4. The method for predicting the state of charge of a light energy storage battery based on CNN-LSTM-SA according to claim 1 is characterized in that: S2 includes the following sub-steps: S21, perform outlier detection on all status data and remove outliers; S22, filling in the missing data values ​​generated after the outliers are removed; S23, normalizing the state data with the missing values ​​filled in. The normalization process is: normalizing the state data to 0-1, and the formula is: X norm is the normalized state data matrix, X is the original state data matrix, the size of the original state data matrix is ​​N×F, N is the time step, F is the number of features, min(X) is the minimum value of each feature dimension, and max(X) is the maximum value of each feature dimension.

5. The method for predicting the state of charge of a light energy storage battery based on CNN-LSTM-SA according to claim 4 is characterized in that: The feature extraction process in S3 is as follows: applying the fast Fourier transform algorithm to the standardized state data matrix, extracting the frequency characteristics of the battery load change, and mapping the time domain signal to the frequency domain; using the wavelet transform to decompose the non-stationary characteristics of the voltage and current data, extracting the detail signal and the trend signal, and obtaining the time series data matrix.

6. The method for predicting the state of charge of a light energy storage battery based on CNN-LSTM-SA according to claim 5 is characterized in that: In S4, the convolutional neural network uses ReLU as the activation function, wherein the expression of ReLU is: ReLU(z)=max(0,z), Z is the linear combination result of the convolution layer output, that is, the result of the input signal after convolution and weighting; ReLU(z) represents the output after activation, if Z is negative, the output is 0, if Z is positive, the output is Z itself.

7. The method for predicting the state of charge of a light energy storage battery based on CNN-LSTM-SA according to claim 6 is characterized in that: in S5, the long short-term memory network includes a forget gate, an input gate, a memory unit, and an output gate, and the memory unit includes a candidate memory unit and an update memory unit; The expression of the forget gate is: t =σ(W f ·[h t-1 , x t ]+b f ); The expression of the input gate is: t =σ(W i ·[h t-1 , x t ]+b i ); the expression of the candidate memory unit is: The expression for updating the memory unit is: The expression of the output gate is: ht=o t tanh(C t ); in, f t Indicates the degree of forgetting of the memory at the previous time step; W f Represents the weight matrix of the forget gate; h t-1 Represents the hidden state of the previous time step, that is, the network output at the previous moment; x t Indicates the current input data; b f Represents the bias term of the forget gate; i t Indicates the degree of update of the memory unit by the current input data; W i represents the weight matrix of the input gate; b i represents the bias term of the input gate; Indicates the impact of the current input data on the memory unit; W C represents the weight matrix of the memory unit, b C Represents the bias term of the memory unit; C t Represents the state of all information memory units that need to be retained at the current time step; C t-1 Represents the state of all information memory units that need to be retained in the previous real time step; o t Indicates that the current memory unit affects the output content; h t Represents the hidden state, which is the final output of LSTM, i.e., the time-varying trend data.

8. According to claim 7, the method for predicting the state of charge of a light energy storage battery based on CNN-LSTM-SA, The feature is that: in S6, the process of citing the self-attention mechanism for processing includes the following sub-steps: S61, calculate the query, key and value. For the input sequence Xnorm, the query Q, key K and value V are calculated respectively through three weight matrices; Q=X morm ·W q ;K=X norm ·W k ;V=X norm ·W v ; Among them, W q is the query weight matrix; W k is the key weight matrix, W v is the value weight matrix; S62. Calculate the attention weight: Calculate the similarity score Attention Scores of the dot product of the query Q and the key K, which is expressed as: Among them, d k represents the dimension of the key vector, K T represents the transpose of the key matrix K; The similarity score Attention Scores is converted into a probability distribution through the Softmax function, expressed as the attention weight A, expressed as: Attention Weights=Softmax(Attention Scores); S63. Calculate the weighted feature matrix B=A×V.

9. The method for predicting the state of charge of a light energy storage battery based on CNN-LSTM-SA according to claim 2 is characterized in that: S8 includes the following sub-steps: S81, using mean square error MSE as the loss function to calculate the error between the predicted value and the true value, the expression is: Where N is the number of samples; y i is the true label of the i-th sample, i.e., the actual state of charge of the battery; is the predicted value of the i-th sample, that is, the state of charge output by the model; S82. Use the Adam optimizer to minimize the mean square error (MSE) during the training process. Update the model parameters by iteratively optimizing the model parameters. The specific update rules are as follows: First moment estimate of the gradient: Second moment estimate of the gradient: Parameter update rules: Among them, m t is the first-order momentum estimate for the t-th iteration, representing the exponentially weighted average of the gradient, v t is the second-order momentum estimate for the t-th iteration, which represents the exponentially weighted average of the squared gradient; β1 is the decay hyperparameter of the first-order momentum, and β2 is the decay hyperparameter of the second-order momentum; α is the learning rate; ò is the numerical stability term; θ t is the model parameter of the tth iteration, is the gradient of the model parameter 0, that is, the derivative of the loss function with respect to the parameter.

Citation Information

Cited By

  • Method for predicting controlled quantity of biochemical pool of sewage plant based on space-time prediction

    CN121386637A

  • A sewage plant biochemical tank control quantity prediction method based on space-time prediction

    CN121386637B

  • Battery health state prediction method and device, electronic equipment and storage medium

    CN121578165A

  • Battery SOC online simulation method and device, electronic equipment and storage medium

    CN121679365A

  • A battery SOC online simulation method and device, electronic equipment and storage medium

    CN121679365B