Storage battery capacity prediction method and system based on sparrow search algorithm optimization

The initial weight and bias of the BPNN network model are optimized through the sparrow search algorithm, and the problems of long-term discharge loss and local optimal solutions in traditional methods are solved, achieving high efficiency and accuracy of battery capacity prediction.

CN120490820APending Publication Date: 2025-08-15STATE GRID ANHUI ELECTRIC POWER CO LTD ELECTRIC POWER SCI RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510573941.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The traditional battery capacity monitoring method has long-term discharge loss, complex testing environment and poor repeatability, making it difficult to ensure the accuracy of the prediction results. In addition, traditional BP neural networks are easily trapped in local optimal solutions during training, affecting model performance.

Method used

The sparrow search algorithm is used to optimize the initial weight and bias of the BPNN network model, the data set is obtained through static discharge test, the backpropagation neural network model is established, and the network parameters are optimized through the sparrow search algorithm, and the model is trained to improve prediction accuracy and robustness.

Benefits of technology

It improves the training efficiency and generalization ability of the BPNN network model, significantly improves the accuracy and robustness of battery capacity prediction, and performs superiorly in the face of complex nonlinear data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120490820A_ABST
    Figure CN120490820A_ABST
Patent Text Reader

Abstract

The invention provides a storage battery capacity prediction method and system based on sparrow search algorithm optimization, and the method comprises the steps: employing a conventional static discharge test method, obtaining a time-based data set of the discharge voltage and current of a storage battery pack and the discharge capacity of a storage battery through sampling, and building a BPNN model as a backbone network; adopting a sparrow search SSA algorithm to optimize the initial weight and bias of the BPNN network model; based on the optimized initial weight and bias, training a BPNN network model to obtain a storage battery capacity prediction model, and evaluating the prediction accuracy of the storage battery capacity prediction model; and finally, predicting the discharge capacity of the storage battery in real time based on the measured known discharge voltage and current data. Through the method, the training efficiency and the model performance of the BPNN network model are improved, and the precision and the robustness of predicting the capacity of the storage battery are further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of battery capacity calculation, and in particular to a battery capacity prediction method and system based on sparrow search algorithm optimization. Background Art

[0002] With the rapid development of smart grids and renewable energy systems, batteries, as energy storage devices, are playing an increasingly important role in various power systems. The battery's state of health, remaining charge (SoC), and discharge capacity are key indicators for measuring battery performance, directly affecting system stability and safety. Traditional battery monitoring methods rely primarily on static discharge tests and dynamic tests. While these methods can provide information on battery capacity and health status to a certain extent, they have many limitations in practical applications. For example, static discharge tests often require long discharge times, which can lead to battery loss and make it difficult to quickly obtain accurate capacity data. While dynamic tests can obtain data under actual load conditions, the test environment is complex and has poor repeatability, making it difficult to guarantee the accuracy of the prediction results.

[0003] In recent years, with the continuous development of machine learning and deep learning technologies, data-driven battery state estimation methods have garnered widespread attention. Backpropagation (BP) neural networks, in particular, have demonstrated excellent performance in handling nonlinear regression problems. However, traditional BP neural networks are prone to falling into local optimal solutions during training, and the initialization of network parameters (such as weights and biases) has a significant impact on the final model's performance. Therefore, optimizing the BP neural network training process and improving the model's prediction accuracy and generalization capabilities have become important issues in battery state estimation. Summary of the Invention

[0004] The technical problem to be solved by the present invention is how to improve the training efficiency and model performance of the BPNN network model, thereby improving its accuracy and robustness in predicting battery capacity.

[0005] The present invention solves the above technical problems through the following technical means:

[0006] The present invention provides a battery capacity prediction method based on sparrow search algorithm optimization, comprising:

[0007] S1. Using a traditional static discharge test method, obtain a time-based data set of the battery pack's discharge voltage, current, and battery discharge capacity by sampling, and divide the data set into a training data set and a validation data set;

[0008] S2. Establish a back propagation neural network (BPNN) model as the backbone network. The network structure includes an input layer, a hidden layer, and an output layer.

[0009] S3, using the sparrow search SSA algorithm to optimize the initial weights and biases of the BPNN network model;

[0010] S4, based on the optimized initial weights and biases obtained in S3, a BPNN network model is trained using a training data set to obtain a battery capacity prediction model;

[0011] S5. Evaluating the prediction accuracy of the battery capacity prediction model using a validation data set;

[0012] S6. Using the above battery capacity prediction model, based on the measured known discharge voltage and current data, the discharge capacity of the battery is predicted in real time.

[0013] Furthermore, the step S3 includes the following steps:

[0014] S31, initialize the population size and maximum number of iterations of the sparrow search SSA algorithm;

[0015] S32, using the weight and bias of the BPNN network model as optimization variables of the SSA algorithm, so that the position of each sparrow individual in the SSA algorithm is a vector of the BPNN network weight and bias parameters;

[0016] S33. Feedback the error value between the predicted data and the real data to the SSA algorithm as the fitness value; continuously iteratively update the individual positions of the sparrows through the SSA algorithm to obtain the initial parameters that optimize the BPNN network structure.

[0017] Furthermore, the S32 specifically includes:

[0018] (1) The weights and biases of the BPNN network model include: the weight w1 from the input layer to the hidden layer, the weight w2 from the hidden layer to the output layer, the hidden layer bias b1, and the output layer bias b2;

[0019] (2) The position of the individual sparrow is a high-dimensional vector X, X = [w1, b1, w2, b2].

[0020] Furthermore, the updating of the position of the individual sparrow in S33 includes:

[0021] (1) Update the discoverer's location;

[0022] (2) Update the location of the joiner;

[0023] (3) Update awareness of the location of dangerous persons.

[0024] Furthermore, the update strategy for the location of the update discoverer is specifically as follows:

[0025]

[0026] Among them, R2 is a random number in [0,1], which represents the warning value; ST is a constant in [0.5,1], which represents the safety value; X t ij is the j-th dimension position information of the i-th sparrow in the t-th iteration; α is a random number in [0,1]; iter max is the maximum number of iterations; Q is a random number that obeys the normal distribution; L is a 1×d matrix of all 1s, d is the total number of optimization variables; X best is the current optimal solution; is an exponential function, that is, e x ; rand(0,1) generates a random number in the interval [0,1].

[0027] Furthermore, the update strategy for updating the location of the joiner is specifically as follows:

[0028]

[0029] Among them, X t ij is the j-th dimension position information of the i-th sparrow in the t-th iteration; iter max is the maximum number of iterations; Q is a random number that obeys the normal distribution; Q init is the initial value of Q; L is a 1×d matrix of all 1s, d is the total number of optimization variables; X t worst is the worst individual in the tth iteration; X P is the position of the current best discoverer; A + is the generalized inverse of A, A is a randomly generated 1 or -1 matrix, and A + =A T (AA T ) -1 ; n is the number of participants.

[0030] Furthermore, the updating strategy for updating the location of the dangerous person is specifically as follows:

[0031]

[0032] Among them, X t ij is the j-th dimension position information of the i-th sparrow in the t-th iteration; β is a random number that obeys the normal distribution with mean 0 and variance 1; K is a random number in the range [-1, 1], where the positive and negative values indicate the direction of the sparrow's movement, and the size indicates the step size control parameter; f i is the fitness value of the current individual; f g is the current maximum fitness value; f w is the current minimum fitness value; γ is the adaptive learning factor.

[0033] The present invention also provides a battery capacity prediction system based on sparrow search algorithm optimization. When the system is running, the above method is executed, including the following modules:

[0034] The data acquisition module is used to obtain a time-based data set of the battery pack's discharge voltage, current, and battery discharge capacity by sampling using a traditional static discharge test method, and divide the data set into a training data set and a validation data set;

[0035] The network model building module is used to build a back propagation neural network BPNN model as the backbone network. The network structure includes input layer, hidden layer and output layer.

[0036] Model parameter optimization module, used to optimize the initial weights and biases of the BPNN network model using the sparrow search SSA algorithm;

[0037] The model training module is used to train the BPNN network model using the training data set based on the optimized initial weights and biases obtained by the model parameter optimization module to obtain a battery capacity prediction model;

[0038] A model performance evaluation module, configured to evaluate the prediction accuracy of the battery capacity prediction model using a validation data set;

[0039] The output module is used to use the above battery capacity prediction model to predict the discharge capacity of the battery in real time based on the measured known discharge voltage and current data.

[0040] Furthermore, the model parameter optimization module includes the following units:

[0041] Initialization unit, used to initialize the population size and maximum number of iterations of the sparrow search SSA algorithm;

[0042] An optimization variable construction unit is used to use the weights and biases of the BPNN network model as optimization variables of the SSA algorithm, so that the position of each sparrow individual in the SSA algorithm is a vector of BPNN network weights and bias parameters;

[0043] The initial parameter optimization unit is used to feed back the error value between the predicted data and the real data as the fitness value to the SSA algorithm; the individual positions of the sparrows are continuously updated through the SSA algorithm to obtain the initial parameters that optimize the BPNN network structure.

[0044] Furthermore, the optimization variable construction unit is specifically implemented in the following manner:

[0045] (1) The weights and biases of the BPNN network model include: the weight w1 from the input layer to the hidden layer, the weight w2 from the hidden layer to the output layer, the hidden layer bias b1, and the output layer bias b2;

[0046] (2) The position of the individual sparrow is a high-dimensional vector X, X = [w1, b1, w2, b2].

[0047] The advantages of the present invention are:

[0048] The present invention optimizes the initialization parameters of the BPNN network model by introducing the sparrow search SSA algorithm, and improves the efficiency of model training through a "coarse first, fine later" approach; at the same time, based on the strong global search capability and adaptability of the SSA algorithm, the present invention optimizes the position update formula of the SSA algorithm, which can effectively avoid the problem that the traditional BPNN network model is prone to falling into the local optimal solution during the training process. Compared with the traditional gradient descent method, the optimization strategy of the present invention significantly improves the generalization ability and robustness of the model, especially when facing complex nonlinear data, it demonstrates superior prediction ability, and thus improves the accuracy of SoC prediction through this model. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 The figure is a flow chart of a battery capacity prediction method based on sparrow search algorithm optimization according to an embodiment of the present invention. DETAILED DESCRIPTION

[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with 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. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0051] Example 1

[0052] This embodiment provides a battery capacity prediction method based on sparrow search algorithm optimization, such as Figure 1 As shown, the specific implementation steps include:

[0053] S1. Using a traditional static discharge test method, a time-based dataset of the battery pack's discharge voltage, current, and battery discharge capacity is obtained through sampling. The dataset is then divided into a training dataset and a validation dataset. In this embodiment, discharge data, including voltage, current, and battery discharge capacity data, is obtained from n batteries during the traditional static discharge test. The data spans 11 hours, with the first 2.2 hours of data serving as the training set and the last 8.8 hours of data serving as the test set. The battery voltage and current data are normalized to ensure uniform input scaling, facilitating subsequent neural network model training and prediction.

[0054] S2. Establish a back propagation neural network BPNN model as the backbone network. The network structure includes an input layer, a hidden layer, and an output layer. The network input is the voltage and current data of the battery, and the output is the discharge capacity of the battery.

[0055] S3. Use the Sparrow Search SSA algorithm to optimize the initial weights and biases of the BPNN network model. Specifically, the following steps are included:

[0056] S31, initialize the population size and maximum number of iterations of the sparrow search SSA algorithm;

[0057] S32. Using the weights and biases of the BPNN network model as optimization variables of the SSA algorithm, so that the position of each sparrow individual in the SSA algorithm is a vector of the BPNN network weights and bias parameters; specifically including:

[0058] (1) The weights and biases of the BPNN network model include: the weight w1 from the input layer to the hidden layer, the weight w2 from the hidden layer to the output layer, the hidden layer bias b1, and the output layer bias b2;

[0059] (2) The position of the individual sparrow is a high-dimensional vector X, X = [w1, b1, w2, b2]. Continuously updating the individual position through SSA is equivalent to searching for the optimal neural network structure in the parameter space.

[0060] S33, feeding back the error between the predicted data and the actual data as the fitness value to the SSA algorithm; continuously iteratively updating the position of the individual sparrows through the SSA algorithm, and optimizing the position update formula of the sparrow search algorithm to obtain the initial parameters that optimize the BPNN network structure. The updating of the position of the individual sparrows includes:

[0061] (1) Update the position of the discoverer; when the warning value R2 ≥ the safety value ST, design a local search mechanism for the later iterations. When the iteration is nearing the end, reduce the global search disturbance and focus more on local refinement. The specific update strategy is as follows:

[0062]

[0063] Among them, R2 is a random number in [0,1], which represents the warning value; ST is a constant in [0.5,1], which represents the safety value; X t ij is the j-th dimension position information of the i-th sparrow in the t-th iteration; α is a random number in [0,1]; iter max is the maximum number of iterations; Q is a random number that obeys the normal distribution; L is a 1×d matrix of all 1s, d is the total number of optimization variables; X best is the current optimal solution; is an exponential function, that is, e xrand(0,1) generates a random number in the interval [0,1]. Using the above formula, we update the position of the discoverer, i.e., optimize the corresponding set of parameters [w1,b1,w2,b2].

[0064] (2) Update the position of the joiner; when the joiner is the better joiner in the first half, a normal perturbation factor Q that decays with the iteration step size is used to dynamically control the search range, so that the individual can adaptively switch between local fine search and global jump. The specific update strategy is:

[0065]

[0066] Among them, X t ij is the j-th dimension position information of the i-th sparrow in the t-th iteration; iter max is the maximum number of iterations; Q is a random number that obeys the normal distribution; Q init is the initial value of Q; L is a 1×d matrix of all 1s, d is the total number of optimization variables; X t worst is the worst individual in the tth iteration; X P is the position of the current best discoverer; A + is the generalized inverse of A, A is a randomly generated 1 or -1 matrix, and A + =A T (AA T ) -1 ;n is the number of participants. In the above formula, the worst individual X worst The difference with the current joiner is used as the disturbance direction; or through matrix transformation A + =A T (AA T ) -1 Guide the individual to jump to the current optimal point Xbest.

[0067] (3) Update the location of the individuals aware of the danger; introduce an adaptive learning factor γ into the formula to dynamically adjust the update amplitude according to the difference between the individual fitness and the current optimal / worst fitness. The adaptive learning factor allows individuals with poor performance to have a greater improvement, while individuals with good performance remain relatively stable, thereby effectively improving the convergence efficiency of the algorithm; the specific update strategy is:

[0068]

[0069] Among them, X t ij is the j-th dimension position information of the i-th sparrow in the t-th iteration; β is a random number that obeys the normal distribution with mean 0 and variance 1; K is a random number in the range [-1, 1], where the positive and negative values indicate the direction of the sparrow's movement, and the size indicates the step size control parameter; fi is the fitness value of the current individual; f g is the current maximum fitness value; f w is the current minimum fitness value; γ is the adaptive learning factor. Through the above formula, inferior individuals can significantly jump out of the current solution domain and search for new weight combinations, further improving the diversity of the initial structure of BPNN network training.

[0070] After the iteration, SSA outputs the position vector of the current optimal individual, that is, The optimal solution is the optimal initial neural network parameter structure.

[0071] S4, based on the optimized initial weights and biases obtained in S3, a BPNN network model is trained using a training data set to obtain a battery capacity prediction model;

[0072] S5. Use the validation data set to evaluate the prediction accuracy of the battery capacity prediction model; the root mean square error (RMSE), mean absolute percentage error (MAPE) and correlation coefficient (R 2 ) and other indicators to evaluate the prediction results. Through these accuracy indicators, the error of the prediction results can be accurately evaluated, providing a reliable basis for practical applications.

[0073] S6. Using the above battery capacity prediction model, based on the measured known discharge voltage and current data, the discharge capacity of the battery is predicted in real time.

[0074] This embodiment also provides a comparison of the errors of the traditional BPNN, SSA-BPNN and the novel SSA-BPNN of this method for SoC prediction as shown in the following table:

[0075]

[0076] As can be seen from the above table, this method optimizes the position update formula of the sparrow search SSA algorithm, which greatly improves the prediction accuracy compared with the unoptimized method and the traditional BPNN network.

[0077] Example 2

[0078] It should be further explained that, based on the same inventive concept, this embodiment also provides a battery capacity prediction system optimized based on a sparrow search algorithm. When the system is running, the method described in Example 1 is used, and the system includes the following modules:

[0079] The data acquisition module is used to obtain a time-based data set of the battery pack's discharge voltage, current, and battery discharge capacity by sampling using a traditional static discharge test method, and divide the data set into a training data set and a validation data set;

[0080] The network model building module is used to build a back propagation neural network BPNN model as the backbone network. The network structure includes input layer, hidden layer and output layer.

[0081] The model parameter optimization module is used to optimize the initial weights and biases of the BPNN network model using the sparrow search SSA algorithm. The model parameter optimization module includes the following units:

[0082] Initialization unit, used to initialize the population size and maximum number of iterations of the sparrow search SSA algorithm;

[0083] The optimization variable construction unit is used to use the weight and bias of the BPNN network model as the optimization variables of the SSA algorithm, so that the position of each sparrow individual in the SSA algorithm is the vector of the BPNN network weight and bias parameters; the optimization variable construction unit is specifically implemented in the following manner:

[0084] (1) The weights and biases of the BPNN network model include: the weight w1 from the input layer to the hidden layer, the weight w2 from the hidden layer to the output layer, the hidden layer bias b1, and the output layer bias b2;

[0085] (2) The position of the individual sparrow is a high-dimensional vector X, X = [w1, b1, w2, b2].

[0086] The initial parameter optimization unit is used to feed back the error value between the predicted data and the real data as the fitness value to the SSA algorithm; the individual positions of the sparrows are continuously updated through the SSA algorithm to obtain the initial parameters that optimize the BPNN network structure.

[0087] The model training module is used to train the BPNN network model using the training data set based on the optimized initial weights and biases obtained by the model parameter optimization module to obtain a battery capacity prediction model;

[0088] A model performance evaluation module, configured to evaluate the prediction accuracy of the battery capacity prediction model using a validation data set;

[0089] The output module is used to use the above battery capacity prediction model to predict the discharge capacity of the battery in real time based on the measured known discharge voltage and current data.

[0090] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A battery capacity prediction method based on sparrow search algorithm optimization is characterized in that: include: S1. Using a traditional static discharge test method, obtain a time-based data set of the battery pack's discharge voltage, current, and battery discharge capacity by sampling, and divide the data set into a training data set and a validation data set; S2. Establish a back propagation neural network (BPNN) model as the backbone network. The network structure includes an input layer, a hidden layer, and an output layer. S3, using the sparrow search SSA algorithm to optimize the initial weights and biases of the BPNN network model; S4, based on the optimized initial weights and biases obtained in S3, a BPNN network model is trained using a training data set to obtain a battery capacity prediction model; S5. Evaluating the prediction accuracy of the battery capacity prediction model using a validation data set; S6. Using the above battery capacity prediction model, based on the measured known discharge voltage and current data, the discharge capacity of the battery is predicted in real time.

2. The battery capacity prediction method based on sparrow search algorithm optimization according to claim 1 is characterized in that: The S3 includes the following steps: S31, initialize the population size and maximum number of iterations of the sparrow search SSA algorithm; S32, using the weight and bias of the BPNN network model as optimization variables of the SSA algorithm, so that the position of each sparrow individual in the SSA algorithm is a vector of the BPNN network weight and bias parameters; S33. Feedback the error value between the predicted data and the real data to the SSA algorithm as the fitness value; continuously iteratively update the individual positions of the sparrows through the SSA algorithm to obtain the initial parameters that optimize the BPNN network structure.

3. The battery capacity prediction method based on sparrow search algorithm optimization according to claim 2 is characterized in that: The S32 specifically includes: (1) The weights and biases of the BPNN network model include: the weight w1 from the input layer to the hidden layer, the weight w2 from the hidden layer to the output layer, the hidden layer bias b1, and the output layer bias b2; (2) The position of the individual sparrow is a high-dimensional vector X, X = [w1, b1, w2, b2].

4. The battery capacity prediction method based on sparrow search algorithm optimization according to claim 2 is characterized in that: The updating of the position of the individual sparrow in S33 includes: (1) Update the discoverer's location; (2) Update the location of the joiner; (3) Update awareness of the location of dangerous persons.

5. The battery capacity prediction method based on sparrow search algorithm optimization according to claim 4 is characterized in that: The update strategy of the update discoverer's location is specifically as follows: Among them, R2 is a random number in [0,1], which represents the warning value; ST is a constant in [0.5,1], which represents the safety value; X t ij is the j-th dimension position information of the i-th sparrow in the t-th iteration; α is a random number in [0,1]; iter max is the maximum number of iterations; Q is a random number that obeys the normal distribution; L is a 1×d matrix of all 1s, d is the total number of optimization variables; X best is the current optimal solution; is an exponential function, that is, e x ; rand(0,1) generates a random number in the interval [0,1].

6. The battery capacity prediction method based on sparrow search algorithm optimization according to claim 4 is characterized in that: The update strategy for updating the location of the joiner is specifically: Among them, X t ij is the j-th dimension position information of the i-th sparrow in the t-th iteration; iter max is the maximum number of iterations; Q is a random number that obeys the normal distribution; Q init is the initial value of Q; L is a 1×d matrix of all 1s, d is the total number of optimization variables; X t worst is the worst individual in the tth iteration; X P is the position of the current best discoverer; A + is the generalized inverse of A, A is a randomly generated 1 or -1 matrix, and A + =A T (AA T ) -1 ; n is the number of participants.

7. The battery capacity prediction method based on sparrow search algorithm optimization according to claim 4 is characterized in that: The update strategy for updating the location of the dangerous person is specifically as follows: Among them, X t ij is the j-th dimension position information of the i-th sparrow in the t-th iteration; β is a random number that obeys the normal distribution with mean 0 and variance 1; K is a random number in the range [-1, 1], where the positive and negative values indicate the direction of the sparrow's movement, and the size indicates the step size control parameter; f i is the fitness value of the current individual; f g is the current maximum fitness value; f w is the current minimum fitness value; γ is the adaptive learning factor.

8. The battery capacity prediction system based on sparrow search algorithm optimization is characterized by: When the system is running, the method according to any one of claims 1 to 7 is executed, including the following modules: The data acquisition module is used to obtain a time-based data set of the battery pack's discharge voltage, current, and battery discharge capacity by sampling using a traditional static discharge test method, and divide the data set into a training data set and a validation data set; The network model building module is used to build a back propagation neural network BPNN model as the backbone network. The network structure includes input layer, hidden layer and output layer. Model parameter optimization module, used to optimize the initial weights and biases of the BPNN network model using the sparrow search SSA algorithm; The model training module is used to train the BPNN network model using the training data set based on the optimized initial weights and biases obtained by the model parameter optimization module to obtain a battery capacity prediction model; A model performance evaluation module, configured to evaluate the prediction accuracy of the battery capacity prediction model using a validation data set; The output module is used to use the above battery capacity prediction model to predict the discharge capacity of the battery in real time based on the measured known discharge voltage and current data.

9. The battery capacity prediction system based on sparrow search algorithm optimization according to claim 8, characterized in that: The model parameter optimization module includes the following units: Initialization unit, used to initialize the population size and maximum number of iterations of the sparrow search SSA algorithm; An optimization variable construction unit is used to use the weights and biases of the BPNN network model as optimization variables of the SSA algorithm, so that the position of each sparrow individual in the SSA algorithm is a vector of BPNN network weights and bias parameters; The initial parameter optimization unit is used to feed back the error value between the predicted data and the real data as the fitness value to the SSA algorithm; the individual positions of the sparrows are continuously updated through the SSA algorithm to obtain the initial parameters that optimize the BPNN network structure.

10. The battery capacity prediction system based on sparrow search algorithm optimization according to claim 9, characterized in that: The optimization variable construction unit is specifically implemented in the following manner: (1) The weights and biases of the BPNN network model include: the weight w1 from the input layer to the hidden layer, the weight w2 from the hidden layer to the output layer, the hidden layer bias b1, and the output layer bias b2; (2) The position of the individual sparrow is a high-dimensional vector X, X = [w1, b1, w2, b2].