Research on Economic Optimization of Microgrid Cluster Based on Chaos Sparrow Search Algorithm

With the deepening of the power market reform on the retail side, it is of great significance to study the economic optimization of the microgrid cluster system. Aiming at the economics of the microgrid cluster, comprehensively considering the degradation cost of energy storage battery, the compensation cost of demand-side controllable loads dispatch, the electricity transaction cost between the microgrids, and the electricity transaction cost between the microgrid and the power distribution network of the microgrid cluster, we establish an optimal dispatch model for the microgrid cluster including wind turbines, photovoltaics, and energy storage batteries. At the same time, in view of the problem that the population diversity of the basic sparrow search algorithm decreases and it is easy to fall into local extremes in the later iterations of the basic sparrow search algorithm, a chaos sparrow search algorithm based on Bernoulli chaotic mapping, dynamic adaptive weighting, Cauchy mutation, and reverse learning is proposed, and different types of test functions are used to analyze the convergence effect of the algorithm, and the calculation effects of the sparrow algorithm, the particle swarm algorithm, the chaotic particle swarm, and the genetic algorithm are compared. The algorithm has higher convergence speed, higher accuracy, and better global optimization ability. Finally, through the calculation example, it is concluded that the benefit of the microgrid cluster is increased by nearly 20%, which verifies the effectiveness of the improvement.


Introduction
With the current energy shortage and environmental problems in power supply becoming more and more serious, the microgrid composed of renewable energy sources has been widely used [1][2][3], which can not only improve the energy efficiency but also protect the environment, reduce costs, and meet the requirements of economy, environmental protection, and stability [4][5][6][7][8][9][10]. However, due to the poor antidisturbance capacity of a single microgrid, multiple microgrids in a local area are interconnected to form a microgrid cluster system. By coordinating the energy output of each microgrid in the cluster, the dynamic balance of supply and demand within the cluster is achieved, and the reliability and economy of the system is effectively improved. However, due to differences in the capacity configuration and load characteristics of each microgrid, when electric energy is exchanged between microgrids, it will affect the operation of microgrids [11]. erefore, considering the exchange of electricity between microgrids, how to coordinate and optimize the microgrid cluster according to the supply and demand characteristics of each microgrid is very important.
At present, research on coordination and optimization of a microgrid cluster has achieved certain results. Literature [12] proposed a multi-microgrid coordinated and optimized dispatching model based on double auction to optimize the sum of interactive power between each microgrid and other microgrids and power distribution network. Although this model optimized the electricity transaction volume between microgrids, it did not take into account the influence of demand-side controllable loads on the electrical energy interaction between microgrids. Literature [13] established a market transaction model based on cooperative game theory and carried out research on the benefit distribution and settlement rules of the microgrid cluster cooperative alliance. Although the electricity transaction price between microgrids was optimized, the influence of the demand-side controllable loads on the microgrids was not considered. Literature [14] studied the optimal dispatching problem of photovoltaic microgrid based on the consideration of timeof-use electricity price, with the goal of minimizing the exchange volume of the grid. Although the time-of-use electricity prices and optimized transaction volumes were considered, only the optimal dispatch of a single microgrid was considered, and the optimization of the microgrid cluster system was not considered. Literature [15] considered the installation cost, operating cost, and environmental benefits of the multi-microgrid system to establish an economic dispatch model and used a particle swarm optimization algorithm combined with Monte Carlo simulation to solve it. Although a centralized optimization algorithm was adopted, each microgrid needed to fully share internal privacy information, which requires higher communication and makes it difficult to optimize dispatch. Literature [16] achieved minimum operation cost through a few iterations by combining the Newton-type second-order algorithm and a consensus-based information exchange. Literature [17] took the adjustment cost of each microgrid as the consensus variables and used the consensus algorithm to solve the power distribution problem of island microgrid clusters. Although literature [16] and [17] had realized the economic operation of microgrid clusters, they only considered peak shaving and valley filling from the power generation side, without considering the response effect of electricity load. Literature [18] was based on the particle swarm algorithm to study the economic optimization dispatch of the microgrid. Although the optimal solution of the microgrid operating cost was obtained, the particle swarm algorithm had limited global optimization capability and is easy to fall into the local optimal solution. Literature [19] proposed a chaotic starling particle swarm optimization algorithm. e additions of the inertial weights and the chaotic logistic mapping strategy improved the algorithm to have better convergence and stronger global search capabilities. However, when applied to multiple local optima, it may fall into local optima and cause stagnation. Literature [20] proposed a new type of swarm intelligence optimization algorithm, the sparrow search algorithm. Compared with other algorithms, its solution efficiency was better; however, it was also easy to fall into the problem of local extremum in the later iteration.
Based on the abovementioned problems, this paper improves the optimization model of the microgrid cluster and comprehensively considers the degradation cost of energy storage battery, the compensation cost of demandside controllable loads dispatch, the electricity transaction cost between the microgrids, and the electricity transaction between the microgrid and the power distribution network of the microgrid cluster, establishes a dynamic energy trading model for the microgrid cluster, promotes the balance of supply and demand within the cluster by continuously coordinating the electricity transaction volume between microgrids, and reduces system operating costs. At the same time, taking into account the Bernoulli chaotic map, dynamic adaptive weights can effectively avoid the algorithm from falling into the local optimum and improve the algorithm's global optimization ability, and the Cauchy mutation and reverse learning can effectively jump out of the local optimum.
is paper proposes a chaotic sparrow search algorithm (ISSA). We use different types of test functions to analyze the convergence effect of the algorithm and compare them with sparrow algorithm (SSA), particle swarm algorithm (PSO), chaotic particle swarm algorithm (CPSO), and genetic algorithm (GA). e effectiveness of the improvement of the proposed ISSA algorithm is verified, and the algorithm is applied to solve the operating cost of the microgrid cluster system. Finally, a calculation example is used to verify the operating economy of the microgrid cluster with demand-side controllable loads participating in the dispatch. e organization structure of this paper is as follows. Section 2 introduces the basic structure of the microgrid cluster and demand-side response model. In Section 3, the optimal dispatch model of the microgrid cluster is introduced. In Section 4, the improved sparrow algorithm is introduced. Section 5 uses the test function analysis to verify the effectiveness of the algorithm improvements. In Section 6, the microgrid cluster composed of three microgrids is taken as an example, and the ISSA algorithm is used to conduct simulation experiments. Section 7 gives the conclusion and describes the future of the proposed algorithm.

Electric Energy Trading Structure of the Microgrid
Cluster. e microgrid cluster electric energy transaction structure is shown in Figure 1; n microgrids are interconnected to form a microgrid cluster system, and each microgrid in the community contains different types of distributed power generation units and loads. e energy flow in Figure 1 represents the power interaction between the microgrid and the power distribution network, and the information flow represents the two-way interaction of information between the microgrid and the cluster adjustment/cluster control system. It can be seen from Figure 1 that, in the process of optimal dispatch of the microgrid cluster, the cluster adjustment/cluster control system conducts two-way information interaction with the microgrid and continuously optimizes the electric energy transaction volume by adding controllable loads to realize the optimal dispatch of the microgrid cluster.

Demand-Side Response Model.
ere are many different forms of loads in the microgrid. e classification of loads is helpful for energy management and dispatch. e demandside management model of this paper mainly takes controllable loads as the research object. Based on the reliability of power supply, it is divided into three types: shiftable load, transferable load, and interruptible load.

Shiftable Load.
e microgrid can flexibly change the operating period of the shiftable load, so that it can choose to use electricity in the appropriate electricity price time period. e microgrid can control the shiftable load from the peak period of power consumption to the general period, thereby reducing the pressure of dispatching and reducing the operating cost. e mathematical model is as follows [21]: where C P shift i represents the dispatch compensation cost of unit power of the shiftable load in MGi, P shift i,k represents the power of the k-th translatable load in MGi, d shift i,k,t represents the state of the k-th translatable load of MGi in period t, if t ∈ [t shift i,k , t shift i,k + D shift i,k ], then when the value is 1, it means it is in the running state; when the value is 0, it means it is in the interrupt state, t shift i,k represents the original power consumption period of the k-th shiftable load in MGi, and D shift i,k represents the continuous power consumption period of the k-th shiftable load in MGi.

Transferable Load.
e transferable load has a certain degree of flexibility in the way of power supplies, its controllability is very strong, and the power supply time can be changed as planned. e power sector estimates the transferable load capacity and signs contracts with users to increase the economy of the microgrid. e mathematical model is as follows: where C P trans i represents the dispatch compensation cost of unit power of the shiftable load in MGi, P trans

Interruptible Load.
e microgrid can cut off the interruptible load at any time without any negative impact on its operation, thus making the microgrid's energy management system more flexible. Cutting off the interruptible load requires consideration of the user's wishes and carries on certain compensation to the user. When the compensation cost for removing the interruptible load is lower than the cost of dispatching other units, it can choose to remove the interruptible load. e mathematical model is as follows: where f i,k,t represents the state of the k-th interruptible load of the MGi in the t period, when the value is 1, it means it is in the running state, when the value is 0, it means it is in the interrupt state, and C P inter i and P inter i,k , respectively, represent the dispatch compensation cost of unit power of the interrupted load in MGi and the power of the k-th interruptible load.
When the user side participates in demand management, the power department should provide economic compensation to the user. is article comprehensively considers the dispatch compensation cost of the three controllable loads: shiftable load, transferable load, and interruptible load. e specific mathematical model is as follows: where C shift i,k,t represents the dispatch compensation cost of the k-th shiftable load of MGi in period t, C trans i,k,t represents the dispatch compensation cost of the k-th shiftable load of MGi in period t, C inter i,k,t represents the dispatch compensation cost of the k-th interruptible load of MGi in period t, N shift   e degradation cost of the energy storage battery is the cost of life reduction caused by the battery being recycled due to discharge, which is determined by the depth of discharge and the price of the battery. When the energy storage battery is deeply discharged, its recycling will lead to a reduction in life and an increase in degradation costs. In this paper, the battery discharge depth function [22] is used to express the degradation cost of the energy storage battery. e specific function can be expressed as where S max i represents the maximum state of charge of the energy storage battery of MGi, S i,t represents the state of charge of the energy storage battery of MGi in the period t, C i,bat represents the initial investment cost of the energy storage battery of MGi, P ch i,t represents the charging power of the energy storage battery of the MGi in the period t, P dis i,t represents the discharge power of the energy storage battery of the MGi in the period t, N ESS i represents the rated capacity of the energy storage battery of the MGi, η ch i,t represents the charging efficiency of the energy storage battery of the MGi in the period t, η dis i,t represents the discharge efficiency of the energy storage battery of the MGi in the period t, and Δt is the time interval.
From equation (5), it can be seen that the initial investment cost of the energy storage battery is constant. erefore, as long as the charge and discharge power of the energy storage battery are optimized to obtain the battery state of charge, the degradation cost of the energy storage battery can be obtained.

Electricity Transaction Cost between Microgrids.
e electricity transaction cost between microgrids refers to the cost incurred when multiple microgrids exchange electricity, which is generally expressed as where P MN i,t represents the power of MGi interacting with other microgrids in period t, the purchase of electricity is a positive value, the sale of electricity is a negative value, and λ MN i,t represents the electricity price of MGi in period t.

Electricity Transaction Cost between the Microgrid and Power Distribution
Network. e electricity transaction cost between the microgrid and the distribution network refers to the cost generated when the microgrid and the power distribution network interact with electricity, which is generally expressed as where P DN i,t is the interactive power between the MGi and the power distribution network in t period, the purchase of electricity is a negative value, the sale of electricity is a positive value, and λ DN i,t is the electricity price of the power distribution network in t period.

Optimal Dispatch Objective Function of the Microgrid Cluster.
is paper takes the lowest operating cost of the microgrid cluster as the optimization goal and establishes the optimal dispatch model of the microgrid cluster. During the operation of the microgrid cluster, the costs are mainly composed of the compensation cost of the demand-side controllable load dispatch, the degradation cost of the energy storage battery, the electricity transaction cost between the microgrids, and the electricity transaction cost between the microgrid and power distribution network. e optimization objective function can be expressed as where C CL i,t represents the dispatch compensation cost of the controllable loads of the MGi in period t, C BD i,t represents the degradation cost of the energy storage battery of the MGi in period t, C MN i,t represents the electricity transaction cost between the microgrids of the MGi in period t, C DN i,t represents the electricity transaction cost between the microgrid and the power distribution network of MGi in period t, and T is the dispatch period.

Constraints of Power Balance.
e power balance constraint of the microgrid clusters system is generally expressed as where P IL i,t is the electric power of the key load of MGi in t period and P RE i,t is the renewable energy output of MGi in t period.
e interactive power balance constraint between microgrids is expressed as

Constraints of Energy Storage Battery Operation.
Since the energy storage battery cannot be charged and discharged at the same time, the energy storage battery charge and discharge power constraint is expressed as where P max i represents the maximum charge and discharge power of the energy storage battery of the MGi.
For energy storage battery, their initial and final capacities should be consistent (excluding charge and discharge power constraints) and the energy storage capacity of each period needs to be controlled within a reasonable range. e following is the specific expression: where S min i is the minimum state of charge of the energy storage battery of MGi.

Transaction Constraints of the Microgrid Cluster.
(1) Trading electricity price constraints between microgrids: when directly trading electrical energy between microgrids, the price should be above the purchase price of the power distribution network and remain below the sale price of the power distribution network, so it is expressed as where λ EB t and λ ES t are the electricity purchase and sale prices of the power distribution network.
(2) Constraints on the balance of electricity transaction costs between microgrids: the balance constraint of electricity transaction cost between microgrids is expressed as (3) Interactive power constraints between microgrids: the interactive power constraint between microgrids is expressed as where P MN max is the maximum value of interactive power between microgrids.
(4) Interactive power constraints between the microgrid and power distribution network: the interactive power constraint between the microgrid and the power distribution network is expressed as where P DN max is the maximum value of the interactive power between the MGi and the power distribution network.

Constraints of Demand-Side Controllable Loads.
e shiftable load needs to be translated as a whole to maintain the continuity of its electricity consumption, so the shiftable load constraint is expressed as where t S shift i,k represents the initial dispatch period of the k-th shiftable load in MGi and t E shift i,k represents the end dispatch period of the k-th shiftable load in MGi. e dispatch period of the transferable load is within the acceptable range, indicating that its operation has high flexibility, so the transferable load constraint is expressed as where t S trans i,k and t E trans i,k , respectively, are the beginning and end dispatch periods of the k-th transferable load of MGi.
According to different degrees of importance, the maximum interruptible duration constraint of the interruptible load is implemented. In addition, the maximum and minimum duration constraints are also included in the interruptible load [23], and the constraints are expressed as where t S inter i,k represents the initial operating period of the k-th interruptible load in MGi, t E inter i,k represents the end operating period of the k-th interruptible load in MGi, and D inter i,k represents the k-th maximum interruptible duration in MGi in a day.

Basic Sparrow Search Algorithm.
e sparrow search algorithm is a swarm intelligence optimization algorithm that simulates the foraging behavior of sparrows. It contains three types of individuals, discoverer, follower, and alerter, and updates their locations according to their own rules. e location of the discoverer is updated as follows: Computational Intelligence and Neuroscience where t represents the current iteration number, j � (1, 2, . . . , d), and X t+1 i,j represents the position of the i-th sparrow of the t + 1 generation in the j-th dimension, MaxIter represents the maximum number of iterations, ξ is a random number in the range of (0, 1), R 2 ∈ [0, 1] represents the warning value, ST ∈ [0.5, 1] represents the safety value, Q is a random number and obeys [0, 1] normal distribution, and L is a row of multidimensional matrix where all elements are 1. If R 2 < ST, it means that there are no natural enemies nearby, the search environment is safe, and the discoverer implements an extensive search mode; if R 2 ≥ ST, it means that sparrows detect natural enemies, and the entire population adjusts its search strategy and quickly moves to a safe area. e follower's location update formula is as follows: where X t w,j represents the worst position of the sparrow in the j-th dimension at the t-th iteration, X t+1 b,j represents the best position of the sparrow in the j-th dimension at the t + 1 iteration, and A is a 1 × d matrix with randomly assigned values of 1 or −1 for each element. If i > N/2, it means that the i-th follower did not get food and has low adaptability and needs to fly to other areas to find food to obtain energy. If i ≤ N/2, it means that the i-th follower will randomly select a location nearby X t+1 b,j for foraging. e position update formula of the alerter is as follows: where X t b,j represents the optimal position of the sparrow in the j-th dimension at the t-th iteration, β is the step size control parameter, k is a random number within [−1, 1], f i is the fitness value of the current sparrow, f g represents the current global optimal fitness value, f w represents the current global worst fitness value, and ε is a very small constant to avoid denominator becoming 0. If f i > f g , it means that the sparrow is on the edge of the population and is easily attacked by natural enemies; if f i � f g , it means that the sparrow is in the center of the population and, due to being aware of the threat of being attacked by natural enemies, approaches other sparrows in time to avoid danger.

Initial Population of the Bernoulli Chaotic Map.
Chaotic variables are ergodic, which can effectively improve the algorithm's global optimization capability. e chaotic map used in this paper is the Bernoulli equation [24].

Improved Finder Update Formula.
Introducing the global optimal solution of the previous generation and the dynamic weight factor ω into the discoverer update formula can avoid the algorithm falling into local optimal and improve the convergence speed [25]. e improved formula is as follows: In formula (24), ω max and ω min are the inertia weights at the beginning and end of the iteration, respectively, t is the current iteration number, MaxIter is the maximum number of iterations, and when ω max � 0.95 and ω min � 0.4, the algorithm optimization performance is the best. As the number of iterations increases, the inertia weight will gradually decrease nonlinearly because at the beginning of the iteration, using a larger inertia weight can improve the search ability of the algorithm and at the end of the iteration, using a smaller inertia weight can enhance the development ability of the algorithm.
In formula (25), f t j,g is the optimal solution of the sparrow in the j-th dimension at the t-th iteration.

Improved Alerter Update Formula.
e improved alerter update formula is shown in equation (26), which means that if the sparrow is in the optimal position, it will randomly fly to any position between the optimal position and the worst position. If the sparrow is not in the optimal position, then it will randomly fly to any position between the current position and the optimal position. 6 Computational Intelligence and Neuroscience

Combining the Cauchy Mutation and Reverse Learning
Strategy. Gaussian mutation has a weak ability to guide individuals out of better local solutions, which is not conducive to global convergence; therefore, this paper uses the Cauchy mutation [26][27][28]. e Cauchy mutation comes from the Cauchy distribution, and the standard Cauchy distribution function formula is as follows: Introducing the Cauchy mutation into the target position update method and exerting the perturbation ability of the Cauchy operator can improve the global optimization ability of the algorithm.
where cauchy(0, 1) is the standard Cauchy distribution. e Cauchy distribution random variable generating function is Reverse learning can effectively improve the efficiency of the algorithm in solving the global optimum. e solution idea is: in the search process, based on the current solution, the reverse learning strategy is used to calculate the reverse solution relative to the center, and then, a better solution is selected after the corresponding comparative evaluation, thereby improving the global optimization capability of the algorithm, and the calculation formula is as follows: where X b,j ′ (t) is the reverse solution of the optimal solution of the t-th generation, ub, lb are the upper and lower bounds, r is a 1 * d random number matrix, which obeys the (0, 1) standard uniform distribution, and k 1 represents the information exchange control parameters. e formula is as follows: (31) e reverse learning strategy can expand the global optimization ability of the algorithm, and the Cauchy mutation strategy can improve the algorithm to avoid falling into the local optimal solution. erefore, in order to further improve the algorithm optimization performance, the Cauchy mutation strategy and the reverse learning strategy are exchanged under the condition of selection probability P s , and the target position is dynamically updated. e calculation formula is as follows: where θ is the adjustment parameter, and its value can be 0.05. e process of selecting strategy 1 is as follows: (1) If rand < P s (2) Select the reverse learning strategy of formulas (29)-(31) to update the position (3) If rand ≥ P s (4) Select the Cauchy mutation strategy of formula (28) to update the target position e Cauchy perturbation strategy and reverse learning strategy can improve the ability of the algorithm to jump out of local space; however, it is impossible to compare whether the fitness value of the new position obtained after these two disturbance strategies is better than the fitness value of the previous position. erefore, the greedy rule is added to compare the fitness value of the new position after the disturbance mutation with the fitness value of the previous position. If the fitness value of the new location is better than the fitness value of the old location, the location is updated; otherwise, it is not updated. e process of selecting strategy 2 is as follows:

e Steps of the Algorithm.
e steps of the chaos sparrow algorithm are as follows: (1) Initialize the parameters, and use the Bernoulli chaotic map of equation (23) to initialize the sparrow population (2) Calculate the fitness value of each sparrow and sort it to find the current optimal and worst fitness value individual (3) According to equations (25), (21), and (26), the positions of the finder, follower, and alerter are updated, respectively (4) According to selection strategy 1, the current optimal solution is disturbed and a new solution is generated (5) According to strategy 2, compare the pros and cons of the fitness values before and after the disturbance to determine whether the location is updated (6) Iteration termination judgment: if it meets the iteration termination condition, then jump out of the loop and output the optimal result; if not, then jump to step (2) and continue the iteration until it meets the iteration termination condition and output the optimal result.
Computational Intelligence and Neuroscience 7

Parameter Setting.
Based on 12 benchmark test functions, we compare the performance of the improved sparrow algorithm, sparrow algorithm, particle swarm algorithm, chaotic particle swarm algorithm, and genetic algorithm. e test function is shown in Table 1, and the parameters of each algorithm are shown in Table 2.
e parameter selection was based on the parameters used by the original author in the article or the parameters widely used by various researchers. e simulation is written and completed by MATLAB2018a. In the test, the population size of each algorithm is set to 50, the number of iterations is set to 400, and each algorithm runs independently 50 times.

Comparison and Analysis of Algorithm Performance
Results.
e average values and standard deviations obtained by optimizing 12 benchmark test functions by five algorithms are shown in Table 3. It can be seen that, for the unimodal function F1-F7, the ISSA algorithm has the best optimization effect, and the average value and standard deviation reach the global optimal solution. For the multimodal function F8-F12, ISSA algorithm and SSA algorithm have the same optimization effect and are better than PSO, CPSO, and GA algorithm. When solving F8 and F10, ISSA and SSA can reach the theoretical optimal solution stably. When solving F9, F11, and F12, although ISSA and SSA cannot converge to the theoretical optimal solution, their convergence effect and convergence accuracy are better than those of PSO, CPSO, and GA.

Comparison and Analysis of Algorithm Convergence
Curves. e convergence curve obtained by optimizing 12 benchmark test functions by five algorithms is shown in Figure 2. It can be seen that when solving different test functions, the convergence speed of ISSA is better than SSA, PSO, CPSO, and GA algorithms, and it has better convergence speed and convergence accuracy. e horizontal axis represents update algebra, and the vertical axis represents the logarithm of fitness value log.

Basic Data.
is article takes the microgrid cluster system constructed by the three microgrids shown in Figure 1 as an example. e renewable energy output of each microgrid is shown in Figure 3, and the load curve is shown in Figure 4. e power of the controllable loads is 25 kW, and the dispatch compensation prices for the shiftable load, the transferable load, and the interruptible load, respectively, are 0.05 Yuan/kWh, 0.08 Yuan/kWh, and 0.3 Yuan/kWh. e initial operating period and allowable scheduling period of the controllable loads are shown in Table 4. e rated capacity of the microgrid energy storage system is 300 kWh, the maximum allowable charge and discharge power is 100 kW, and the maximum and small states of charge are divided into 0.9 and 0.2. e purchase and sale price of the power distribution network is shown in Table 5. e scheduling period of the calculation example is 24 hours a day, divided into 24 time periods, and the scheduling time is selected as 00 : 00-24 : 00.

Analysis of the Results of Electricity Trading between
Microgrids. e electric energy exchange between microgrids is shown in Table 6. It can be seen that when the market is in equilibrium, electricity can be purchased and sold in various periods of time through the trade of electricity between microgrids.
It can be seen from Table 6 that when controllable loads participate in dispatching, at 14 : 00, 15 : 00, and 17 : 00, since the power generation of the microgrid cluster cannot meet the load demand, the power interaction between the microgrids in the cluster cannot be carried out, and electricity needs to be purchased from the power distribution network. From 10 : 00 to 13 : 00, MG1 sells electricity to MG2 that has insufficient power at the target time due to its own renewable energy output to meet its own load demand while still having electricity surplus. During the time periods of 08 : 00-09 : 00, 11 : 00-12 : 00, and 18 : 00, MG2 cannot meet its own load demand due to its insufficient output. erefore, MG2 needs to purchase electricity from MG1 or MG3 that has too much power at the target time. During the time period from 19 : 00 to 24 : 00, MG3 sells electricity to the MG1 whose power is insufficient at the target time due to its own renewable energy output to meet its own load demand while still having electricity surplus.

Analysis of the Results of Electric Energy Trading between the Microgrid and Power Distribution Network.
e electric energy exchange between the microgrid and the power distribution network is shown in Table 7. It can be seen that when MG1, MG2, and MG3 exchange electric energy, the interactive electric energy between each microgrid and the power distribution network can be reduced.
It can be seen from Table 7 that when controllable loads participate in the dispatch, during the time period of 14 : 00-18 : 00, MG1 cannot meet its own needs due to its insufficient output; therefore, it needs to purchase electricity from the power distribution network. During the time period of 01 : 00-05 : 00 and 19 : 00-24 : 00, MG2 has been selling electric energy to the power distribution network due to its overcapacity. During the time period of 10 : 00-17 : 00, MG3 cannot meet its own needs due to its insufficient output, and needs to purchase electricity from the power distribution network to meet its own needs. It can be seen from the abovementioned phenomenon that electricity trading between microgrids can completely eliminate excess renewable energy and balance the supply and demand of the system.

Analysis of the Results before and after Controllable Loads.
e controllable load scheduling results are shown in Figure 5. It can be seen from Figure (a-c) that the overall loads of MG1 increase from 09 : 00 to 15 : 00, the loads of MG2 decrease from 10 : 00 to 15 : 00, and the loads increase from  u(x i , 10, 100, 4)

Algorithm
Parameter settings GA   18 : 00 to 24 : 00, the loads of MG3 increase during the time period of 00 : 00-08 : 00 and 18 : 00-24 : 00, and the loads decrease from 09 : 00 to 15 : 00. e total loads of the microgrid cluster can be seen from Figure (d), after adding the demand-side controllable loads schedule; the loads in the low period of 23 : 00-07 : 00 increase, and the loads in the peak period of 11 : 00-15 : 00 decreases. e peak-valley difference of the loads is reduced.

Economic Analysis of the Microgrid Cluster.
e costs of the microgrid cluster in the two cases where the microgrid cluster has demand-side controllable loads participating in the dispatch and the uncontrollable loads participating in the dispatch are compared, as shown in Table 8.
It can be seen from Table 8 that, in the two cases where there are controllable loads participating in the dispatch and the uncontrollable load participating in the dispatch, the cost change of energy storage system is relatively small. When controllable loads are involved in dispatching, the total cost of MG1 is 1067.4864 Yuan, the total revenue of MG2 is 520.6545 Yuan, and the total cost of MG3 is 107.4852 Yuan. Compared with when there is no controllable load involved in dispatching, the economic cost of MG1 is reduced by 87.0533 Yuan, the revenue of MG2 is reduced by 33.1091 Yuan, and the revenue of MG3 is increased by 109.9848           Yuan. erefore, the economic cost of the entire microgrid cluster is reduced by 163.9284 Yuan. It can be seen that when the controllable loads participate in dispatching, the microgrid cluster can effectively reduce the operating cost of the system.

Analysis of Optimization Algorithm Results.
is paper proposes a chaotic sparrow search algorithm. is algorithm is used to optimize the operating cost of the microgrid cluster system, and it compares with sparrow algorithm, particle swarm algorithm, chaotic particle swarm algorithm, and genetic algorithm. e basic parameters of the algorithm are shown in Table 2.
It can be seen from Figure 6 that the objective function values of the five algorithms of GA, PSO, CPSO, SSA, and ISSA decrease continuously and become stable as the number of iterations increases, indicating that these five algorithms are all moving towards the optimal cost. It can be found by comparing GA, PSO, CPSO, SSA, and ISSA that when the demand-side controllable loads participate in dispatching, the number of iterations for ISSA algorithm to converge to the optimal solution is similar to CPSO algorithm, and its optimal solution is better than the convergence solutions of GA, PSO, CPSO, and SSA algorithms. When there is no demand-side controllable load participating in dispatching, the number of iterations for ISSA algorithm to converge to the optimal solution is higher than GA, PSO, CPSO, and SSA, and its optimal solution is better than the convergence solution of GA, PSO, and SSA algorithm.

Conclusions
is paper sets the optimization goal as the operating cost of the microgrid cluster system, constructs the microgrid cluster operation optimization model considering demandside response, and discusses the costs of the microgrid cluster with and without controllable loads dispatch. en a chaos sparrow search algorithm based on Bernoulli chaotic mapping, dynamic adaptive weighting, Cauchy mutation, and reverse learning is constructed, which is used to optimize the operating cost of the microgrid cluster system and compare with the optimized results of sparrow algorithm, particle swarm algorithm, chaotic particle swarm algorithm, and genetic algorithm.
(1) rough the proposed strategy, electric energy transactions between microgrids and between microgrids and power distribution networks are realized. On the one hand, the impact caused by the connection between the microgrid cluster and power distribution networks is minimized, and on the other hand, it ensures the safety and stability of system operation. (2) When there is demand-side controllable loads participating in dispatching, on the one hand, the level of energy mutual benefit between microgrids is improved, and the excess renewable energy can be completely absorbed; on the other hand, due to the controllable loads participating in dispatching, the operating cost of the microgrid cluster dropped from 818.2455 Yuan to 654.3171 Yuan, the cost was reduced by 163.9284 Yuan, and the overall benefit has increased by nearly 20%, which effectively improved the economic benefits of the microgrid cluster. (3) is paper proposes a chaos sparrow search algorithm based on Bernoulli chaotic mapping, dynamic adaptive weighting, Cauchy mutation, and reverse learning. Based on 12 benchmark test functions, it shows that ISSA algorithm is superior to SSA, PSO, CPSO, and GA algorithms in terms of solution quality, which proves the effectiveness of the algorithm improvement. At the same time, ISSA algorithm has better performance when solving microgrid cluster optimization problems. e global optimization ability is stronger than SSA, PSO, CPSO, and GA algorithms, and the optimization cost is lower than SSA, PSO, CPSO, and GA algorithms. In future works, the ISSA algorithm will be applied to other fields, such as energy storage capacity configuration optimization, and face recognition. It can also be combined with other algorithms to form a hybrid algorithm to improve algorithm performance.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.