Battery charge state prediction method based on Hemma optimization algorithm

By combining temporal convolutional networks and Transformer models, and optimizing the hyperparameters of the model using the Hippo optimization algorithm, the problem of low accuracy in state of charge prediction in existing technologies is solved, achieving high-precision prediction under complex dynamic conditions, with stronger robustness and engineering applicability.

CN121522470APending Publication Date: 2026-02-13ANHUI UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511624614.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Existing state of charge prediction methods neglect key sequence-related features and long-term dependencies in battery behavior under complex and ever-changing real-world conditions, resulting in low prediction accuracy and difficulty in adapting to dynamic operating environments.

Method used

An architecture combining a temporal convolutional network (TCN) and an encoder Transformer model is adopted. The hyperparameters of the model are optimized by combining the Hippo optimization algorithm. The temporal convolutional network captures multi-scale local features of the battery, the encoder network captures global features, and prediction is performed through a fully connected network. The model parameters are optimized by the Hippo optimization algorithm.

Benefits of technology

It significantly improves the accuracy of state of charge prediction, can adapt to complex dynamic conditions, reduces training and inference latency, and has stronger robustness and engineering deployability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121522470A_ABST
    Figure CN121522470A_ABST
Patent Text Reader

Abstract

The invention provides a battery state-of-charge prediction method based on a Hemma optimization algorithm, and relates to the technical field of battery management, and the method comprises the steps: obtaining a historical time sequence data set; dividing the historical time sequence data set to obtain a plurality of sample sets; constructing a charge state prediction model; the charge state prediction model comprises a time domain convolutional network, an encoder network and a full connection network; the time domain convolutional network, the encoder network and the full connection network are connected in sequence; based on each sample set, carrying out optimization training on parameters of the charge state prediction model by adopting a He-horse optimization algorithm to obtain a trained charge state prediction model; and acquiring real-time time sequence data of the battery, and combining with the trained state-of-charge prediction model to obtain a state-of-charge prediction value. The method can effectively capture the local and global features of the battery time sequence data, optimizes the hyper-parameters of the model based on the Hemma optimization algorithm, improves the estimation precision, and can adapt to complex dynamic working conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of battery management technology, and in particular to a method for predicting the state of charge of a battery based on the Hippo optimization algorithm. Background Technology

[0002] With the continuous and rapid development of the new energy industry, lithium-ion batteries have become core energy storage devices. Accurately predicting the state of charge (SOC) of a battery is one of the key technologies of a battery management system (BMS), directly affecting the safety and reliability of the battery. In complex and ever-changing real-world operating conditions, batteries face dynamic operating environments such as temperature fluctuations and drastic changes in charging and discharging currents. Existing SOC prediction methods neglect key sequence-related features and long-term dependencies in battery behavior. Summary of the Invention

[0003] The purpose of this invention is to provide a battery state of charge prediction method based on the Hippo optimization algorithm. By combining the temporal convolutional network TCN and the encoder Transformer model, it can effectively capture the local and global features of battery time-series data. The hyperparameters of the model are optimized based on the Hippo optimization algorithm to improve the estimation accuracy and adapt to complex dynamic working conditions.

[0004] A battery state-of-charge prediction method based on the hippo optimization algorithm, comprising:

[0005] Obtain a historical time series dataset; divide the historical time series dataset into several sample sets;

[0006] A state-of-charge prediction model is constructed; the state-of-charge prediction model includes a temporal convolutional network, an encoder network, and a fully connected network.

[0007] The temporal convolutional network, the encoder network, and the fully connected network are connected sequentially.

[0008] The temporal convolutional network is used to process the input temporal data to obtain multi-scale local features; the encoder network is used to process the multi-scale local features to obtain global features; and the fully connected network is used to obtain prediction results based on the global features.

[0009] The temporal convolutional network includes several residual networks; the encoder network includes several encoders; the residual networks are connected in series; the encoders are connected in series.

[0010] Based on the aforementioned sample sets, the parameters of the state of charge prediction model are optimized and trained using the Hippo optimization algorithm to obtain the trained state of charge prediction model.

[0011] Real-time time series data of the battery is acquired, and combined with the trained state of charge prediction model, the predicted state of charge value is obtained.

[0012] Optionally, the historical time series dataset includes historical time series data of battery current, battery voltage, battery temperature, and battery state of charge.

[0013] Optionally, the residual network includes a first causal dilated convolutional layer, a first normalization layer, a first activation function layer, a first regularization layer, a second causal dilated convolutional layer, a second normalization layer, a second activation function layer, a second regularization layer, and a residual bypass; the residual bypass is a 1×1 convolutional layer;

[0014] The first causal dilated convolutional layer, the first normalization layer, the first activation function layer, the first regularization layer, the second causal dilated convolutional layer, the second normalization layer, the second activation function layer, and the second regularization layer are connected in sequence;

[0015] Both the first causal dilated convolutional layer and the residual bypass process process the input data; the outputs of the second regularization layer and the residual bypass are added together to obtain the output.

[0016] Optionally, the expansion coefficient of the i-th residual network is 2^(i-1).

[0017] Optionally, the convolution stride of both the first causal dilated convolutional layer and the second causal dilated convolutional layer is 1.

[0018] Optionally, the encoder includes a position encoding layer, an addition unit, a multi-head self-attention layer, a first residual connection and layer normalization sublayer, a feedforward fully connected sublayer, and a second residual connection and layer normalization sublayer.

[0019] The location encoding layer is used to perform location encoding on the multi-scale local features to obtain encoded data;

[0020] The addition unit is used to add the encoded data and the multi-scale local features element by element at the corresponding time step to obtain the encoded temporal features;

[0021] The multi-head self-attention sublayer is used to linearly map the encoded temporal features to obtain query Q, key K and value V, and to compute self-attention in parallel with h attention heads to output attention features;

[0022] The first residual connection and layer normalization sublayer are used to add the attention features and the encoded temporal features by residual addition, and perform layer normalization on the addition result to obtain the first normalized feature;

[0023] The feedforward fully connected sublayer uses two linear transformations sandwiched with a nonlinear activation function to perform positional feature transformation on the first normalized feature to obtain the transformed feature.

[0024] The second residual connection and layer normalization sublayer are used to add the transformed feature and the first normalized feature by residual addition, and perform layer normalization on the addition result to obtain the global feature.

[0025] Optionally, the position encoding is a sine-cosine position encoding calculated based on the sequence number.

[0026] Optionally, the parameters of the state of charge prediction model include the number of residual networks, the number of encoders, the learning rate, the kernel size, and the number of convolutional layers.

[0027] Optionally, the step of optimizing and training the parameters of the state of charge prediction model using the Hippo optimization algorithm based on each of the sample sets to obtain the trained state of charge prediction model specifically involves:

[0028] Define the population size N, the maximum number of iterations τ, and the number of parameters to be optimized m, and give the upper limit and lower limit of the parameters to be optimized;

[0029] N individuals of hippopotamus are randomly generated according to the population size described above;

[0030] The population is iteratively optimized according to the state update rule of individual hippos until the maximum number of iterations is reached. In each generation, the position of each hippo in the population is updated sequentially, and the fitness is calculated after the update. The position vector corresponding to the hippo with the best fitness is selected as the parameter value of the state of charge prediction model.

[0031] The state update rules include updating to a safe zone, escaping predators, and updating the safe zone.

[0032] Optionally, the update expression for the safe region is:

[0033]

[0034] in, Indicates the updated position of the hippopotamus after moving to the safe zone, x ij H represents the position of the i-th candidate solution. i In the j-th dimension component, h1 represents the element-wise step size, and u is the current iteration number. A value greater than 0.6 indicates that the hippopotamus has begun to roam; otherwise, the hippopotamus remains within the population. Y represents the center of the safe zone, I2 represents the diagonal selection matrix, and MG... i E refers to the average value of a random selection of several hippopotamus individuals, where E represents the hippopotamus maintaining its current position.

[0035] The update expression for the escaped predator is:

[0036]

[0037] Among them, P k Let f be the position of the k-th predator, D be the distance between the hippopotamus and the predator, f be a uniformly random number between 2 and 4, c be a uniformly random number between 1 and 1.5, d be a uniformly random number between 2 and 3, g be a uniformly random number between -1 and 1, g be a Levy-distributed random vector following the hippopotamus, r9 be an m-dimensional random vector, RL be a Levy-distributed random vector representing the positional change when the predator attacks the hippopotamus, M represent the dimensional injection of random perturbations during position updates, and F be a random vector. prk Let F represent the objective function value of the k-th predator. i Let represent the objective function value of the i-th hippopotamus individual. This indicates the updated location of the individual hippopotamus after escaping its predator.

[0038] The security zone update expression is:

[0039]

[0040] i=1,2,...,N; j=1,2,...m;

[0041] For the i-th hippopotamus individual, r is the updated safe zone. 10 s1 represents a random number generated in the range of 0 to 1, where s1 is the random scaling factor.

[0042]

[0043] Where, r 11 r is a random vector between 0 and 1 12 A random number r that follows a normal distribution. 13 A random number between 0 and 1.

[0044] Beneficial effects:

[0045] This invention presents a battery state of charge (SOC) prediction method based on the Hippo optimization algorithm. It adopts a TCN-Transformer fusion architecture, which takes into account both local temporal and long-range dependencies, and significantly improves the accuracy of SOC estimation. The introduction of Hippo optimization (HO) automatically optimizes hyperparameters to avoid getting trapped in local optima. Parallel computation of convolution and self-attention reduces training / inference latency and does not require open-circuit voltage rest or precise equivalent model parameters, thus exhibiting stronger robustness and engineering deployability. Attached Figure Description

[0046] Figure 1This is a flowchart of the battery state of charge prediction method based on the hippo optimization algorithm of this invention;

[0047] Figure 2 This is a diagram of the encoder structure;

[0048] Figure 3 This is a diagram of the residual network structure;

[0049] Figure 4 These are the predicted SOC trajectories at different temperatures (0℃ / 25℃ / 45℃) under DST conditions;

[0050] Figure 5 These are the predicted SOC trajectories at different temperatures under US06 operating conditions;

[0051] Figure 6 These are the SOC prediction trajectories at different temperatures under FUDS conditions. Detailed Implementation

[0052] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings.

[0053] Figure 1 This is a flowchart of the battery state-of-charge prediction method based on the hippo optimization algorithm of this invention. Figure 1 As shown, this invention provides a battery state of charge prediction method based on the hippo optimization algorithm, which includes:

[0054] S1. Obtain the historical time-series dataset; divide the historical time-series dataset into several sample sets. Specifically, the historical time-series dataset includes historical time-series data of battery current, battery voltage, battery temperature, and battery state of charge. Specifically, the initially acquired data is cleaned using Matlab data cleaning tools. Missing and outlier values ​​are filled or replaced with the mean. After transposing to form a new dataset, the input variables are normalized to obtain the historical time-series dataset.

[0055] S2, Construct a state of charge prediction model. Preferably, the state of charge prediction model includes a temporal convolutional network, an encoder network, and a fully connected network.

[0056] The temporal convolutional network, encoder network, and fully connected network are connected in sequence.

[0057] Temporal convolutional networks process the input temporal data to obtain multi-scale local features. Encoder networks process these multi-scale local features to obtain global features. Fully connected networks then use these global features to obtain prediction results. The output of a temporal convolutional network has the same temporal length as the input. The output of an encoder network also has the same temporal length as the input.

[0058] The temporal convolutional network consists of several residual networks; the encoder network consists of several encoders; the residual networks are connected in series; and the encoders are connected in series.

[0059] Specifically, such as Figure 2 As shown, the encoder includes an encoder part and a decoder part. The encoder part includes a position encoding layer, an addition unit, a multi-head self-attention layer, a first residual connection and layer normalization sub-layer, a feedforward fully connected sub-layer, and a second residual connection and layer normalization sub-layer. The decoder part includes output position encoding, a masked multi-head self-attention mechanism, a multi-head self-attention mechanism, a residual connection and layer normalization mechanism, a feedforward neural network, a linear layer, and a Softmax layer.

[0060] The positional encoding layer is used to encode the positional characteristics of multi-scale local features to obtain encoded data. Preferably, the positional encoding is a sine-cosine positional encoding based on the index.

[0061] The addition unit is used to add the encoded data and multi-scale local features element by element at the corresponding time step to obtain the encoded temporal features.

[0062] The multi-head self-attention sublayer is used to linearly map the encoded temporal features to obtain the query Q, key K and value V, and to compute self-attention in parallel with h attention heads to output attention features.

[0063] The first residual connection and layer normalization sublayer are used to add the attention features and the encoded temporal features by residual addition, and then perform layer normalization on the addition result to obtain the first normalized feature.

[0064] The feedforward fully connected sublayer employs two linear transformations sandwiched with a nonlinear activation function to perform position-by-position feature transformation on the first normalized feature, thereby obtaining the transformed feature.

[0065] The second residual connection and layer normalization sublayer are used to add the transformed features and the first normalized features by residual addition, and then perform layer normalization on the addition result to obtain the global features.

[0066] Temporal positional information is injected into the input through positional encoding; multi-head self-attention sublayer is used to model the dependencies between time steps and perform context aggregation in the global time range; nonlinear feature transformation is completed through feedforward fully connected sublayer, and the stability and generalization ability of deep training are improved by two residual connections and layer normalization sublayer.

[0067] The following relationships exist between the internal units of a Transformer:

[0068]

[0069] Here, pos represents the position in the sequence, i represents the dimension, and dmodel is the total number of encoder dimensions. This encoding method captures the relationships between different positions in the input sequence. In the Transformer architecture, the self-attention mechanism is used to model the dependencies between different elements within the sequence. This mechanism can effectively reveal the inherent connections by dynamically adjusting the attention weights of each element in the sequence, thereby capturing complex dependencies.

[0070]

[0071] Where Q represents the query, K represents the key, V represents the value, and d k The features represent the query, key, and value dimensions. Softmax represents the normalization of attention scores into a probability distribution to reflect the degree of attention between elements in the sequence, thereby improving the model's ability to understand and process the input sequence.

[0072] S3. Based on each sample set, the parameters of the state of charge prediction model are optimized and trained using the Hippo Optimization Algorithm to obtain a trained state of charge prediction model. Preferably, the parameters of the state of charge prediction model include the number of residual networks, the number of encoders, the learning rate, the kernel size, and the number of convolutional layers.

[0073] Specifically, we set the population size N, the maximum number of iterations τ, and the number of parameters to be optimized m, and give the upper and lower limits of the parameters to be optimized. The purpose of this step is to determine the search range and convergence conditions of the algorithm, ensuring that all subsequent solutions fall within the feasible interval.

[0074] N individual hippos are randomly generated according to the population size. The purpose of this step is to provide a sufficient number of uniformly distributed initial candidate solutions within the search space. Initial positions are generated using uniformly random numbers, and values ​​outside the range are pruned according to their upper and lower bounds.

[0075] The population is iteratively optimized according to the state update rules of individual hippos until the maximum number of iterations is reached. In each generation, the position of each hippo in the population is updated sequentially, and the fitness is calculated after the update. The position vector corresponding to the hippo with the best fitness is selected as the parameter value of the state of charge prediction model.

[0076] The status update rules include updating to a safe zone, escaping predators, and updating the safe zone.

[0077] The expression for updating the safe zone is:

[0078]

[0079] in, Indicates the updated position of the hippopotamus after moving to the safe zone, x ijH represents the position of the i-th candidate solution. i In the j-th dimension component, h1 represents the element-wise step size, which is randomly adjusted on the input vector to control the exploration intensity, and u is the current iteration number. A value greater than 0.6 indicates that the hippopotamus has begun to roam; otherwise, the hippopotamus remains within the population. Y represents the center of the safe zone, and all hippopotamus update towards the safe zone. I2 represents the diagonal selection matrix, used to randomly select whether to move towards the population mean according to a dimension, in order to balance exploration and exploitation. MG i E represents the average value of a randomly selected number of hippopotamus individuals, where E indicates that the hippopotamus remains in its current position.

[0080] The update expression for escaping predators is:

[0081]

[0082] Among them, P k Let be the position of the k-th predator, D be the distance between the hippopotamus and the predator, f be a uniformly random number between 2 and 4, c be a uniformly random number between 1 and 1.5, d be a uniformly random number between 2 and 3, g be a uniformly random number between -1 and 1, g be a Levy-distributed random vector following the hippopotamus, r9 be an m-dimensional random vector, RL be a Levy-distributed random vector representing the positional abrupt change when the predator attacks the hippopotamus, and M represent the injection of random perturbations dimension-wise during position updates to adjust the step size and exploration intensity. Let F represent the objective function value of the k-th predator. i Let represent the objective function value of the i-th hippopotamus individual. This indicates the updated location of the individual hippopotamus after escaping its predator.

[0083] The safe zone update expression is:

[0084]

[0085] i=1,2,...,N; j=1,2,...m;

[0086] For the i-th hippopotamus individual, r is the updated safe zone. 10 s1 represents a random number generated in the range of 0 to 1, where s1 is the random scaling factor.

[0087]

[0088] Where, r 11 r is a random vector between 0 and 1 12 A random number r that follows a normal distribution. 13 A random number between 0 and 1.

[0089] Specifically, such as Figure 3 As shown, the residual network includes a first causal dilated convolutional layer, a first normalization layer, a first activation function layer, a first regularization layer, a second causal dilated convolutional layer, a second normalization layer, a second activation function layer, a second regularization layer, and a residual bypass; the residual bypass is a 1×1 convolutional layer. Both the first and second activation function layers use ReLU. The first and second regularization layers deactivate neurons with a certain probability during training, i.e., the output is 0, which improves the model's generalization ability, reduces overfitting, and balances the difference between training and testing. In the real-world testing phase, the first and second regularization layers are turned off.

[0090] The first causal dilated convolutional layer, the first normalization layer, the first activation function layer, the first regularization layer, the second causal dilated convolutional layer, the second normalization layer, the second activation function layer, and the second regularization layer are connected in sequence.

[0091] The first causal dilated convolutional layer and the residual bypass both process the input data; the outputs of the second regularization layer and the residual bypass are added together as the output.

[0092] Preferably, the dilation coefficient of the i-th residual network is 2^(i-1). The convolution stride of both the first and second causal dilated convolutional layers is 1.

[0093] S4. Obtain real-time time series data of the battery and combine it with the trained state of charge prediction model to obtain the predicted state of charge value.

[0094] Specifically, the method of the present invention will be described below through specific examples.

[0095] The operating conditions include Dynamic Stress Test (DST), Supplemental Federal Test Procedure (US06), and Federal Urban Driving Program (FUDS).

[0096] The tests were conducted at three temperatures: 0℃, 25℃, and 45℃, with discharge initiation points of 0.8SOC and 0.5SOC, respectively, until the low cutoff voltage.

[0097] The predicted dataset is combined with the test set, and the scaling is inverted. The scale of the test dataset is inverted using the predicted SOC values. The model's error score is calculated using the predicted and true values, along with the root mean square error (RMSE) and mean absolute error (MAE) that contribute error in the same units as the variable itself.

[0098] Division of test set and training set: When US06 is the test set, 1C constant current discharge data and FUDS data constitute the training set; when FUDS is the test set, 1C constant current discharge data and US06 data constitute the training set.

[0099] The formulas for the root mean square error (RMSE) and the mean absolute error (MAE) are as follows:

[0100]

[0101] like Figure 4 As shown, under DST conditions, the model's coefficient of determination R at different temperatures... 2 All are close to 99.30%, with R at 0℃ 2 The accuracy was 99.2898% at 25℃, 99.3036% at 45℃, and 99.3113% at 25℃. The corresponding root mean square error (RMSE) was 0.693%, 0.501%, and 0.590%, respectively, and the mean absolute error (MAE) was 0.588%, 0.510%, and 0.560%, respectively.

[0102] like Figure 5 As shown, under US06 operating condition, the model's R values ​​at three temperatures are... 2 All are greater than 99.20%, of which R at 0℃ 2 The value was 99.2976%, with a maximum of 99.3396% at 25℃ and 99.2296% at 45℃. The corresponding RMSEs were 0.549%, 0.521%, and 0.556%, and the MAEs were 0.532%, 0.437%, and 0.461%, respectively.

[0103] like Figure 6 As shown, under FUDS conditions, the model's R-values ​​at three temperatures are... 2 All are greater than 99.20%, of which R at 0℃ 2 The value was 99.2957%, with a maximum of 99.3202% at 25℃ and 99.3101% at 45℃. The corresponding RMSEs were 0.565%, 0.539%, and 0.537%, respectively, and the MAEs were 0.532%, 0.418%, and 0.428%, respectively.

[0104] The results show that the method of the present invention can achieve accurate prediction of battery SOC at different temperatures, with a determination coefficient R0. 2 The values ​​are all close to 1, especially at 25℃, where the root mean square error and mean absolute error are the smallest. The prediction results under the three different working conditions are similar, indicating that the present invention has good robustness in realizing SOC prediction.

[0105] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A method for predicting the state of charge of a battery based on the hippopotamus optimization algorithm, characterized in that, It includes: Obtain historical time series datasets; The historical time series dataset is divided into several sample sets; A state-of-charge prediction model is constructed; the state-of-charge prediction model includes a temporal convolutional network, an encoder network, and a fully connected network. The temporal convolutional network, the encoder network, and the fully connected network are connected sequentially. The temporal convolutional network is used to process the input temporal data to obtain multi-scale local features; the encoder network is used to process the multi-scale local features to obtain global features; and the fully connected network is used to obtain prediction results based on the global features. The temporal convolutional network includes several residual networks; the encoder network includes several encoders; the residual networks are connected in series; the encoders are connected in series. Based on the aforementioned sample sets, the parameters of the state of charge prediction model are optimized and trained using the Hippo optimization algorithm to obtain the trained state of charge prediction model. Real-time time series data of the battery is acquired and combined with the trained state of charge prediction model to obtain the predicted state of charge value.

2. The battery state of charge prediction method based on the hippo optimization algorithm according to claim 1, characterized in that, The historical time series dataset includes historical time series data of battery current, battery voltage, battery temperature, and battery state of charge.

3. The battery state-of-charge prediction method based on the hippopotamus optimization algorithm according to claim 1, characterized in that, The residual network includes a first causal dilated convolutional layer, a first normalization layer, a first activation function layer, a first regularization layer, a second causal dilated convolutional layer, a second normalization layer, a second activation function layer, a second regularization layer, and a residual bypass; the residual bypass is a 1×1 convolutional layer; The first causal dilated convolutional layer, the first normalization layer, the first activation function layer, the first regularization layer, the second causal dilated convolutional layer, the second normalization layer, the second activation function layer, and the second regularization layer are connected in sequence; Both the first causal dilated convolutional layer and the residual bypass process process the input data. The output of the second regularization layer and the output of the residual bypass are added together to obtain the output.

4. The battery state of charge prediction method based on the hippo optimization algorithm according to claim 3, characterized in that, The expansion coefficient of the i-th residual network is 2^(i-1).

5. The battery state of charge prediction method based on the hippo optimization algorithm according to claim 3, characterized in that, The convolution stride of both the first causal dilated convolutional layer and the second causal dilated convolutional layer is 1.

6. The battery state of charge prediction method based on the hippo optimization algorithm according to claim 1, characterized in that, The encoder includes a position encoding layer, an addition unit, a multi-head self-attention layer, a first residual connection and layer normalization sublayer, a feedforward fully connected sublayer, and a second residual connection and layer normalization sublayer. The location encoding layer is used to perform location encoding on the multi-scale local features to obtain encoded data; The addition unit is used to add the encoded data and the multi-scale local features element by element at the corresponding time step to obtain the encoded temporal features; The multi-head self-attention sublayer is used to linearly map the encoded temporal features to obtain query Q, key K and value V, and to compute self-attention in parallel with h attention heads to output attention features; The first residual connection and layer normalization sublayer are used to add the attention features and the encoded temporal features by residual addition, and perform layer normalization on the addition result to obtain the first normalized feature; The feedforward fully connected sublayer uses two linear transformations sandwiched with a nonlinear activation function to perform positional feature transformation on the first normalized feature to obtain the transformed feature. The second residual connection and layer normalization sublayer are used to add the transformed feature and the first normalized feature by residual addition, and perform layer normalization on the addition result to obtain the global feature.

7. The battery state-of-charge prediction method based on the hippopotamus optimization algorithm according to claim 6, characterized in that, The position encoding is a sine-cosine position encoding calculated based on the sequence number.

8. The battery state of charge prediction method based on the hippo optimization algorithm according to claim 1, characterized in that, The parameters of the state of charge prediction model include the number of residual networks, the number of encoders, the learning rate, the kernel size, and the number of convolutional layers.

9. The battery state-of-charge prediction method based on the hippopotamus optimization algorithm according to claim 1, characterized in that, Based on each of the aforementioned sample sets, the parameters of the state of charge prediction model are optimized and trained using the Hippo Optimization Algorithm to obtain the trained state of charge prediction model, specifically as follows: Define the population size N, the maximum number of iterations τ, and the number of parameters to be optimized m, and give the upper limit and lower limit of the parameters to be optimized; N individuals of hippopotamus are randomly generated according to the population size described above; The population is iteratively optimized according to the state update rule of individual hippos until the maximum number of iterations is reached. In each generation, the position of each hippo in the population is updated sequentially, and the fitness is calculated after the update. The position vector corresponding to the hippo with the best fitness is selected as the parameter value of the state of charge prediction model. The state update rules include updating to a safe zone, escaping predators, and updating the safe zone.

10. The battery state-of-charge prediction method based on the hippo optimization algorithm according to claim 9, characterized in that, The update expression for the safe zone is: in, Indicates the updated position of the hippopotamus after moving to the safe zone, x ij H represents the position of the i-th candidate solution. i In the j-th dimension component, h1 represents the element-wise step size, and u is the current iteration number. A value greater than 0.6 indicates that the hippopotamus has begun to roam; otherwise, the hippopotamus remains within the population. Y represents the center of the safe zone, I2 represents the diagonal selection matrix, and MG... i E refers to the average value of a random selection of several hippopotamus individuals, where E represents the hippopotamus maintaining its current position. The update expression for the escaped predator is: Among them, P k Let be the position of the k-th predator, D be the distance between the hippopotamus and the predator, f be a uniformly random number between 2 and 4, c be a uniformly random number between 1 and 1.5, d be a uniformly random number between 2 and 3, g be a uniformly random number between -1 and 1, g be a Levy-distributed random vector following the hippopotamus, r9 be an m-dimensional random vector, RL be a Levy-distributed random vector representing the positional abrupt change when the predator attacks the hippopotamus, and M represent the dimensional injection of random perturbations during position updates. Let F represent the objective function value of the k-th predator. i Let represent the objective function value of the i-th hippopotamus individual. This indicates the updated location of the individual hippopotamus after escaping its predator. The security zone update expression is: For the i-th hippopotamus individual, r is the updated safe zone. 10 s1 represents a random number generated in the range of 0 to 1, where s1 is the random scaling factor. Where, r 11 r is a random vector between 0 and 1 12 A random number r that follows a normal distribution. 13 A random number between 0 and 1.