Abstract
The demand for new energy will continue to expand as the environment changes and fossil energy decreases. However, the instability of new energy has slowed down the development of new energy. The joint use of new energy and energy storage modules effectively solves the shortcomings of new energy. The article proposed a lifetime optimization method of new energy storage module based on new artificial fish swarm algorithm. Firstly the life model based on the battery capacity
Introduction
Domestic and foreign scholars are beginning to research the development of new energy technologies.1–3 The energy storage module can solve the problem of instability of the power supply system caused by new energy. At present, most energy storage modules only have single battery pack. Research the single-battery-storage module under new energy in Divya and Østergaard 4 and Rehman et al. 5 Because of new energy have instability. The single battery storage device will face the question of frequent changes function. If the energy storage device frequent change function. The battery storage device will reduce using time. The double battery storage module solves the disadvantages of frequent switching. However, it has a problem of transient voltage during the switching. Transient voltage will damage the load. The problems of single lithium battery module and dual lithium batteries module were solved by the three lithium batteries module.
At present, there are many energy storage system optimization studies. For example, Liu et al. 6 uses composite differential evolution algorithm to optimize energy storage system energy balance, Ma et al. 7 uses particle swarm optimization algorithm to obtain the optimal operation strategy of energy storage battery, Terlouw et al. 8 uses the improved particle swarm algorithm obtains the highest economic benefit of the energy storage system. However, these methods are insufficiently considered the service life of the energy storage system.
In traditional fish school algorithm, if the step length is too long, the convergence accuracy is not high, and the step length is too short, the convergence speed will be too slow. Researchers have improved the fish school algorithm because of considering the limitations in its use. Gao et al. 9 adopts the method of mutation factor to obtain adaptive step size to improve the global optimization ability of fish school algorithm. He et al. 10 analyzes the key optimization steps of the artificial fish school algorithm, and uses the adaptive step size method to improve the global optimization ability.
Taking into the problems of existing energy storage devices, the article proposes to construct a three-lithium battery energy storage module. Three lithium battery power distribution modes of lithium battery modules are also proposed. At the same time, the article uses deep learning for improving the speed and accuracy of algorithm to optimize the step size. Tests show that the service life of the three-lithium battery energy storage module is longer than that of the single lithium battery energy storage module, and the output is more stable than the dual lithium battery energy storage module. The control strategy of the three-lithium battery energy storage module can ensure stable output energy, and the optimization performance of the new fish school algorithm is better than the original fish school algorithm and the firefly algorithm.
System introduction
System structure
The energy storage module in the new energy ship power supply system mainly adopts distributed layout, as shown in Figure 1. Figure 1 is the part of the new energy power supply system. There is mainly includes an energy storage module and load. The three-lithium battery energy storage module mainly includes three lithium batteries (Li-ion1, Li-ion2, and Li-ion3), monitor device, and control device. The monitor includes VM, CM1, CM2, CM3. (VM stands for voltage monitor, CM represents current monitor, CM 1 measure the output current of Li-ion2, CM 2 measure the output current of Li-ion3, CM3 measure the current of the load). The control device judges whether Li-ion2 and Li-ion3 can provide enough energy for the apparatus through the current detection message, and controls the switching of Li-ion2 and Li-ion3. The excess energy of the solar system will be transmitted to the ship’s grid via the electric net when the energy storage module is full of energy.

New energy ship power supply system.
Energy management of energy storage modules
The power distribution of Li-ion1 and Li-ion2 (Li-ion3) is performed by the controller in the tri-lithium battery energy storage module.
In the formula:
Li-ion2 (Li-ion3) designs different expressions of functions according to different capacity intervals of Li-ion1 to control Li-ion2 (Li-ion3) to charge and discharge under different capacity level of Li-ion1. There is a correlation between the battery capacity and current of the lithium battery, and the capacity change of the lithium battery can be obtained by detecting the current.
The mathematical formula of Li-ion2 (Li-ion3) allocated power is:
In the formula:
During the charging phase, the higher current of the new energy power supply system, the more heat will be generated. On the premise of ensuring its own safety and lithium battery performance, 11 the new energy power supply system charges the lithium battery at the fastest speed. The output voltage of the AC/DC converter should make the charging current close to the desired charging current value as much as possible. The value of charging current generally has the following limitations
The capacity of the battery can be obtained by the mathematical formula:
C in the formula is the battery capacity,
The current will exceed the ideal value when the load is too small. In order to ensure the safety of the load, the new energy power supply system will output an appropriate voltage from the AC/DC converter to suppress the discharge current. The discharge current should in the following range. Otherwise it will cause damage to the lithium battery in the new energy power supply system.
The discharge current of the new energy power supply system is determined by the battery capacity and discharge time, where
Working principle
The three-lithium battery energy storage module has four states to support the load without considering the charging and discharging of the energy storage module to the ship’s power net. As shown in Table 1,
State 1 is that Li-ion2 alone provides energy to support the load.
State 2 is that Li-ion1 and Li-ion2 together provide energy to support the load.
State 3 is that Li-ion3 alone provides energy to support the load.
State 4 is that Li-ion1 and Li-ion3 are connected in parallel to provide energy to support the load.
State table.
Switch from state 1 to state 2 as shown in Figure 2. The process of switching from state 3 to state 4 is similar to the process of switching from state 1 to state 2. Switch to Li-ion2 and Li-ion1 to support the load when Li-ion1 can’t provide enough energy.

Flow chart for switching from state 1 to state 2.
Set the ideal current
Switch from state 2 to state 3 as shown in Figure 3. Switch to Li-ion3 to support the load alone when Li-ion2 and Li-ion1 can’t provide enough energy in parallel.

Flow chart for switching from state 2 to state 3.
Figure 4 is a flowchart of the procedure to avoid overcharging of lithium batteries by new energy. The voltage of Li-ion2 (Li-ion3) is

Avoid overcharging program flow chart.
When
Control strategy
Figure 5 is a control strategy for the energy storage module to output steady current in state 2. It is a single loop control strategy. CM represents the current detection device. Calculate the output current of Li-ion1 according to formulas (2) and (4), and give the control signal.

Output current control strategy.
Figure 6 is the control strategy of module output energy to net. VM1 is the voltage detection device in module charging terminal. According to formula (3), judge the output and input of the energy storage module to the net,

Control strategy of module output energy to net.
Research on life optimization of three-lithium battery energy storage module
Establishment of module life model
Because Li-ion1 is used frequently than Li-ion2 (Li-ion3) in the three-lithium battery energy storage module, Li-ion1 is the battery with the shortest lifespan in the energy storage module.12,13 The Arrhenius equation is a formula between temperature and decay rate.
In the formula,
T stands for temperature
Lithium battery capacity reduction
The heat loss of the battery is
Temperature can be calculated according to the thermoelectric model of the lithium battery.
The capacity loss of a lithium battery in a cycle at a non-constant temperature is17–19:
New artificial fish swarm algorithm
The Fish School Algorithm (AFSA) simulates the cooperative behavior of fish schools to achieve the goal of finding the best target.
The behavior of foraging is the fish to find direction of more food. The artificial fish
The perceived distance of individual fish called visual. If it is found the better state
Fish will naturally behave in groups during swimming. The number of buddies in the field of view of artificial fish
The rear-end behavior of artificial fish is an optimal behavior of artificial fish in its visual field. Determine whether the
The crowding factor used to determine the maximum value
In the formula,
Record the variables corresponding to the best state on the bulletin board. 22 The bulletin board is constantly updated in the optimization process.
The position of artificial fish is updated by formulas (19) and (20) in the traditional artificial fish school algorithm. The step control amount of position update affects the efficiency of artificial fish optimization. This article updates the step control amount of artificial fish according to Adam Optimization Algorithm Root Mean Square prop and Gradient Descent with Momentum in deep learning.
Using the idea of momentum gradient descent method to update the step length of the artificial fish, each step length update is determined by the step length change of the previous step and the step length change of the current stage, as shown in formula (23):
The fish school algorithm adopts the root-mean-square algorithm to ensure the balance of artificial fish in the optimization direction. 24 As shown in equation (24):
The Adam optimization algorithm combines the momentum gradient descent method with the root mean square algorithm. 25 The step size update of the fish school algorithm in this paper adopts the Adam algorithm idea, such as formula (25):
w is Adam’s learning rate. Adam has absorbed the advantages of the root mean square algorithm. Ensure the accuracy of the optimization direction. At the same time, the advantages of the momentum gradient descent method are used to improve the efficiency and accuracy in the optimization process.
Function test
In order to ensure the fairness and reliability of the comparison between the proposed algorithm and other algorithms, the experimental result is the average value obtained by the algorithm independently running 20 times. The classic test function f1 is used to compare the algorithm in this paper (the fish school algorithm, and the firefly algorithm 26 ). The test function is a non-linear function. There are many local optimal values around the optimal value. f1 is suitable for verifying the performance of the algorithm.
The new fish school algorithm set the same parameters as the original fish school algorithm, Population size N = 50, fish field visual is 2.5, Weights
From Figure 7 and Table 2, it is known that under the same basic parameters. The convergence speed of the fish school algorithm is better than the original fish school algorithm and the firefly algorithm. The new fish school algorithm has higher accuracy after 20 iterations. The fish school algorithm is two orders of magnitude more accurate than the original fish school algorithm. The firefly algorithm is faster initially, but the optimization convergence speed and accuracy are not good as the fish school algorithm. The step length of the original fish school algorithm is fixed, and the step length of the new fish school algorithm is determined by the previous step change, so the new fish school algorithm optimizes faster in the initial stage of optimization. As the optimization progresses, the step size of the new fish school algorithm becomes shorter and the optimization accuracy increases. The new fish school algorithm only increases the accuracy of the calculation results, and does not enhance the optimization effect in the later stage of optimization (after 100 iterations). Compared with the original fish school algorithm, the new fish school algorithm can appropriately reduce the number of iterations and reduce the use of the processor in practical applications.

Algorithm speed comparison chart.
Algorithm performance comparison table.
It can be seen from the Table 3 that in the iteration of the new fish school algorithm, the accuracy of the values of X1 and X2 and the accuracy of the function value are significantly better than the original fish school algorithm and the firefly algorithm. It shows that the new fish school algorithm has significantly improved the convergence speed and accuracy.
Lithium battery parameters.
Analysis of the complexity
To complete the basic artificial fish swarm algorithm,
In the swarming behavior, N fish need to swarm N times, judge N times according to the crowding factor, and move N times. In the rear-end collision behavior, N fish rear-end N times, and also judge N times and move N times according to the congestion factor. At most
The weight is obtained through deep learning. The step length of the artificial fish is improved. The number of iterations of the algorithm, the number of population size, and the number of foraging attempts do not change. By improving the step length of artificial fish, the new fish school algorithm only achieves the same complexity from the perspective of algorithm parameter improvement. In the new fish school algorithm, each fish must update the step size in each iteration. So the complexity of the new fish school algorithm is
Parametric analysis
The artificial fish in the new fish school algorithm adjusts the step size adaptively, which improves the efficiency of individual utilization. However, the complexity is slightly increased. Each fish has to calculate the step. The new fish school algorithm needs to calculate the root mean square of the distance from each artificial fish to the optimal artificial fish, and at the same time calculate the step change of the fish.
The step length of each fish in the new fish school algorithm is dynamically generated from the root mean square of each fish to the optimal artificial fish distance and the change of the previous two steps. So there is no need to consider how to choose the step size parameter. The parameters are reduced, and the influence of parameter changes on the optimization results becomes sensitive. The new fish school algorithm adjusts the step size through the weight ratio of the step changes and the learning rate. The weight ratio of the step difference is obtained through deep learning, but when the amount of learning data is too small or the training time is too short, the weight will appear unreasonable and affect the step length. So we get data and train through a large number of experiments in a variety of functions.
As the number of iterations increases, artificial fish will continue to gather, the step size will continue to decrease, and the accuracy will continue to increase. Artificial fish will gather at one point, and subsequent iterative optimization has little effect.
Function optimization
The optimization process uses the new fish school algorithm. As shown in Figure 8. The first step is to randomly generate a group of fish. Each fish in the population represents a decision variable (

Block diagram of parameter optimization process.
In this paper, the objective function
The capacity degradation rate can be got by the equation (17). The value of n is set to 1000.
When
Simulation
Simulation experiment environment
Simulation experiment environment: the code is written by MatlabR2014a, the PC parameters are 64-bit windows10 operating system, the processor: intel(R)Core(TIM)i7-6500U CPU@2.50GHz 2.60GHz, 8.00G memory.
Experiment statistics
Figure 9 is the physical diagram of the energy storage module. The picture includes lithium batteries, detection devices, control centers, and solar panels.

Physical image of energy storage module.
The battery parameters before optimization and the corresponding using-time decay rate are shown in Table 4.
Measured battery parameters.
The variable
The C,
Optimized battery parameters.
The simulation compares the service life of the energy storage device determined by the initial parameters with the service life of the energy storage device determined by the optimized parameters. Figure 10 is a comparison diagram of two methods.

Comparison chart.
The abscissa of Figure 10 is the time of using battery, and the ordinate is the capacity of the battery. The capacity of the battery decreases continuously with time.
The capacity attenuation determined by the NASFA optimization decision variable is smaller under one charge and discharge cycle. Therefore, the battery capacity determination variable obtained by the NASFA can optimize the battery life.
The experiment not only used the measured parameters to compare with the optimized parameters of the new fish school algorithm. It also compares the optimization of energy storage systems with different algorithms. The first phase of the experiment began in 2019. In order to speed up the efficiency of the experiment and save the cost of the experiment, the experiment uses a small lithium battery pack. Each phase of the experiment is divided into three groups, each of which has three columns. The first column uses battery parameters optimized by the original fish school algorithm, the second column uses battery parameters optimized by the firefly algorithm, and the third column uses battery parameters optimized by the new fish school algorithm. Record the battery life separately to test the practicality of the new fish school algorithm. It is planned to do the fourth phase of the experiment, and the fourth phase of the experiment is currently being done. The following Table 6 shows the average value of each phase of the experiment.
Experimental statistics.
The cost of energy storage module mainly includes:
Initial investment cost 30 :
C es is the capacity of the energy storage system. kq is the capacity cost coefficient, Zd is the controller cost, JL sensor cost, and kp is the sensor cost coefficient.
Maintenance cost:
k om is the coefficient of operation and maintenance cost per hour per unit capacity. 31
Replacement cost:
a is the average annual decline in battery cost, k is the number of battery replacements, and n is the battery life.
The benefits mainly include:
Reducing electricity bill income E1: using solar energy to reduce the cost of users to obtain electricity from the grid.
Reliability benefits E2 (after the installation of the energy storage module, the benefits due to the stable power supply 32 ):
Loss reduction benefit: The energy storage system reduces the loss benefit of grid peak shaving and valley filling.
NPV calculation
i 0 is the benchmark rate of return. When NPV ≥ 0, the solution using energy storage modules meets the profitability level stated by the benchmark rate of return.33,34
At present, only small-scale experiments have been conducted in the laboratory, and the main benefit is the reduction of electricity bills. The cost is mainly the initial investment cost and replacement cost.
In 2019, Jiangsu Province’s commercial electricity consumption is 0.6215–0.6712 yuan/kWh. The average electricity price is 0.64675 yuan/kWh.
Due to the lack of reliability gains in laboratory experiments, there are less than losses in Table 7.
NPV.
Lithium battery pack comparison
Appsim semi-physical simulation platform is a new simulation application platform. 28 Appsim semi-physical simulation platform can help engineers connect Matlab-based simulation models with actual equipment to jointly carry out accurate and efficient simulations. Appsim semi-physical simulation platform is compatible with all versions of Matlab.
Due to the high cost of equipment installation and disassembly of the ship’s power Electric system. Appsim semi-physical simulation platform is used to test the impact of life parameters on energy storage modules life.
The experiment platform of the lithium-ion battery energy storage module’s life is shown in Figure 11.

Simulation platform.
The platform controls battery capacity,
The terminal current of the lithium battery is shown in Figure 12. The abscissa is the battery usage time, and the ordinate is the terminal current of the lithium battery.
(a) shows the current change of the single lithium battery energy storage module. Due to the randomness and instability of new energy sources, the terminal current of the single lithium battery energy storage module changes greatly, the charging and discharging modes often change. Frequent charge-discharge switching is likely to generate heat in the battery, which poses a safety hazard and is not conducive to the service life of a single lithium battery module.
(b) is the curve of the port current when the internal power mode of the dual lithium battery module changes. The terminal current of the dual lithium battery undergoes a transitional change when the internal working mode of the module changes.
(c) is the terminal current change curve of Li-ion2 (Li-ion3).
(d) is the terminal current change curve of Li-ion1.

Terminal current of lithium battery.
Li-ion2 (Li-ion3) and Li-ion1 cooperate to stabilize the terminal current of the energy storage module.
Figure 13 is a comparison chart of the capacity loss of the lithium battery inside the module. Only one lithium battery is used in the single lithium battery energy storage module. There are two lithium batteries in the dual lithium battery energy storage module. The working states and the capacity loss are similar in the dual lithium battery energy storage module. There are three lithium batteries in the three lithium battery energy storage module. Among them, Li-ion2 and Li-ion3 work states and the capacity loss are similar. Li-ion1 has an independent work state.

Capacity loss chart.
The lithium battery needs to be replaced when the capacity of reduced to 20%. The ordinate in (a) is the process of lithium battery capacity loss in single lithium battery energy storage module and dual lithium battery energy storage module. The ordinate in (b) is the capacity loss process of Li-ion2 (Li-ion3) and Li-ion1 in the triple lithium battery energy storage module.
Through comparison, it is found that the service life of the lithium battery in the dual lithium battery energy storage module is greater than the service life of the lithium battery in the single lithium battery energy storage module. The battery service life in the triple lithium battery energy storage module is similar to dual lithium battery energy storage module.
However, the output current of the three-lithium battery energy storage module is more stable, so the three-lithium battery energy storage module is better than the double lithium battery energy storage module.
Conclusions
The article improves the step size of the fish school algorithm based on deep learning. Experiments and simulations show that the optimization speed and optimization efficiency of the new fish school algorithm have been improved. The article considers the life issue of lithium battery packs for new energy ships. The three-lithium battery energy storage module is proposed and a life model of the lithium battery module is established. At the same time, the lithium battery pack life model is optimized through the new fish school algorithm.
The proposed battery life optimization method can provide an optimized reference for the grid system energy storage capacity, energy storage power, and battery charging protection settings. 35 In addition, it can also carry out applied research on complex optimization problems in power system operation. At the same time, it can also be applied to the operation and maintenance of electric energy metering equipment to improve work efficiency.
The development of electric vehicles and unmanned ships also requires new fish school algorithms. The new fish school algorithm is used to optimize the life of the energy storage system, reduce the cost of electric vehicles, and promote the promotion of electric vehicles.
The simulate results of the simulation platform show that the terminal current of the single lithium battery energy storage module fluctuates greatly. The dual lithium battery energy storage module will have transition current when the lithium battery function is switched. The three-lithium battery energy storage module terminal current is more stable and not have transition current compared with the single-lithium battery simulate results. The three-lithium battery energy storage module is the better energy storage module.
Compare the simulation results after parameter optimization. The simulation results appears that the C,
Footnotes
Acknowledgements
Thanks for the attention of school leaders and the help of tutors.
Handling Editor: James Baldwin
Author contributions
Methodology, Pengfei Zhi; investigation, Wanlu Zhu, Ye Yang; writing—original draft preparation, Yongshuang Qi; writing—review and editing, Weiran Wang; validation, Haiyang Qiu.
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the National Natural Science Foundations of China, grant number 51807198, 51809128, 41906154, 61803185; the Jiangsu Postgraduate Practice Innovation Program [grant number :SJCX21_1741].
