Beetle Swarm Optimization Algorithm-Based Load Control with Electricity Storage

Based on the intelligent bidirectional interactive technology, this paper studies the ﬂexible working mode and optimal power consumption strategy of several typical power consumption loads including energy storage equipment. Based on the real-time price scheme, the objective function and constraints are obtained, and the adaptive algorithm for beetle swarm optimization with variable whisker length is used to optimize so that the electric equipment can automatically change its power load through the intelligent terminal and even work in the way of reverse power transmission. The proposed optimal scheduling algorithm can not only maximize the interests of users but also ensure the minimum peak to average ratio so as to realize peak shaving and valley ﬁlling. Simulation results verify the eﬀectiveness of the algorithm.


Introduction
With the continuous increase in power demand and the deepening of power market reform, the demand side management (DSM) based on orderly power consumption is more and more adopted by power grid enterprises [1]. However, the traditional orderly power consumption management, no matter what kind of technology, or by imposing restrictions on the user's power load in a certain period of time, or through the electricity price incentive policy to let the user limit the power consumption load in a certain period of time, for a single power consumption equipment, is rigid to participate in the peak shaving and valley filling of the power grid in the way of work or outage.
is traditional and mandatory DSM model often leads to the lack of flexibility in the electricity market, which deepens the interest conflict between the supply side and the demand side.
In order to solve the shortage of power supply and reduce the load peak valley difference, an effective way is used to increase the elasticity of power demand and introduce a competition mechanism on the power demand side. e demand side is no longer the traditional and passive receiver but can respond according to the price signal or incentive mechanism, actively change the demand of electricity, participate in the power management, and obtain corresponding benefits, namely, demand response (DR) [2]. Different from the traditional and passive DSM mode, intelligent DSM adopts intelligent bidirectional interaction technology. With the access of intelligent terminal equipment, the development of power communication technology, and the increase in the proportion of intelligent controllable load in the family, the intelligent two-way interactive technology of power consumption becomes possible [3]. e two-way interaction technology provides a technical basis for residents to participate in automatic demand response and realize intelligent power consumption. It can not only effectively improve the utilization rate of electric energy and the operation efficiency of the power grid but also achieve the purpose of maintaining the stability and reliability of the power system and market. e theory of demand-side management (DSM) has been developed for decades in the world [4]. However, it was not until the blackout in California in 2001 that many countries paid attention to and developed DSM based on the market. Compared with developed countries in Europe and America, the development of intelligent electricity technology and theory in China is relatively slow. Song [5] first introduces the concept and implementation principles of demand-side response and the implementation plan of demand response in the United States. en, Zhang et al. [6] give a comprehensive introduction to the demand side response in combination with the actual situation in China and give relevant suggestions and assumptions.
In order to solve the specific automation demand response technology, various software and hardware design schemes have been proposed, such as the software and hardware design and implementation scheme of the user side energy management prototype system [7], the management and control scheme of smart appliances based on user comfort [3], the massive data storage problem of smart grid based on Hadoop cloud computing platform [8], and the designer of smart grid two-way interactive platform system case [9]. In addition, how to optimize the load regulation and control algorithm has been proposed constantly, such as the residential user power dispatching strategy based on the price forecasting scheme [10], the user power dispatching strategy based on the noncooperative game method [11], simulated annealing-based krill herd algorithm [12], multiobjective optimization method based on adaptive parameter harmony search algorithm [13], and improved quantum-behaved particle swarm optimization with elitist breeding [14]. In the work [15], the particle swarm optimization (PSO) algorithm is employed to handle the PSP and to obtain an optimal smart home appliances schedule. e work in [16] presents two bio-inspired energy optimization techniques, i.e., the grasshopper optimization algorithm (GOA) and bacterial foraging algorithm (BFA), for power scheduling in a single office. In order to solve the problem of instability and high-cost of photovoltaic power generation, the optimal scheduling model of a photovoltaic power system was established by minimizing power generation scheduling cost. e model increases the ability of load controlling by virtue of the demand response of price to reduce the influence of the instability of photovoltaic generation on optimal scheduling results. For solving the model, the classical genetic algorithm was improved [17]. In a deregulated electricity market, the power system operator should systematically identify the optimal schedule of renewable distributed generation (DG) units to not only optimize the market profits but also to improve the network conditions. e work in [18] proposes a parallel computation-based methodology using fuzzy logic designed in the structure of a genetic algorithm (GA). A large number of electric vehicles (EV) connected to the grid will affect the planning and operation of the power system. Hence, it is of great significance to guide the charging behavior of electric vehicles in an orderly manner. Regarding this kind of problem, an electric vehicle intelligent charging navigation strategy based on real-time electricity price is proposed, where the PSOGA algorithm is used to solve the optimal scheme. e motivation is to guide the EV charging towards an orderly way by virtue of the real-time electricity price mechanism [19]. e work in [20] compares the effects of different optimization algorithms for different reference functions. However, the energy storage equipment is not considered in these scheduling strategies, and the scheduling scheme is only given from the distribution side or the user side.
In this paper, based on the intelligent electricity bidirectional interaction technology, the flexible working mode and power consumption strategy of several typical electrical loads including energy storage equipment are studied. Based on the real-time price scheme, the optimal scheduling algorithm is given so that the power consumption equipment can automatically change its power load through the intelligent terminal and even work in the way of reverse power transmission. By using the adaptive algorithm for beetle swarm optimization with variable whisker length, i can not only maximize the interests of users but also ensure the minimum peak to average ratio, so as to realize peak shaving and valley filling. Firstly, the mathematical modeling of several typical loads is carried out; then, based on the realtime price scheme, the optimization objective function is given, which includes two parts: one is the user's electricity cost, and the other is the peak to average ratio. Finally, the optimal control algorithm is given, and an example is analyzed.

Intelligent Bidirectional Interactive
Operation of the Smart Grid

System Description.
In the traditional orderly power consumption management, for residential users, either through the peak load regulation strategy of forced switching off or through the price incentive policy, users can limit their power consumption load in a certain period of time. For users, it is basically in a passive state of power consumption. In order to mobilize users to change their electricity demand actively and participate in power consumption management, intelligent two-way interactive technology is more and more adopted. Its interaction model is shown in Figure 1.
According to the total load, the power supply side issues the price signal in real time, and the user side makes demand response according to the real-time price signal, so as to achieve the purpose of maximizing the interests of users and smoothing the load curve of the grid. Due to the lack of professional knowledge of residents, it is inconvenient to participate in demand response. In order to not affect the normal life of residents and let more users participate in the demand response, the development of intelligent terminal equipment, the realization of intelligent management of household appliances, and the automatic control of demand response are the important contents of realizing intelligent power consumption. In order to realize intelligent power consumption, it is very important to design the optimal dispatching algorithm of power load based on the characteristics of the typical load.

Classification of Household Electricity Load.
In order to facilitate the analysis and calculation, the user power load is divided into three categories: (i) α-type dynamic load: the controllable load that can be completely scheduled in the dispatching time. e total load in the dispatching time is unchanged and has the function of reverse power transmission, such as energy storage equipment and electric vehicle; the set of such electrical equipment is marked as U α . (ii) β-type dynamic load: the controllable load that can be completely scheduled within the dispatching time is the same as the total load within the dispatching time, but it does not have the function of reverse power transmission, such as temperature control equipment and water heater; the set of such electrical equipment is marked as U β . (iii) c-type dynamic load: for the load fixed in the dispatching time, such as lighting equipment and television, the set of such electrical equipment is marked as U c ; all consumers are marked as U.

Real-Time Electricity Price.
In order to realize fair power consumption and peak load shifting, it is an effective means to adopt the real-time electricity price strategy by citing the competition mechanism. Without losing generality, it is assumed that there are n users participating in intelligent power consumption, and all users' electrical equipment is recorded as a set Γ � 1, 2, . . . , N { }. Considering that many electric loads do not work in a complete small period of time ΔT, each hour can be divided into several equal time periods, so each hour period can be divided into L � (1/ΔT). Without losing generality, let L be an integer. en, the whole day from 0:00 to 24:00 can be divided into H � 24L segments, denoted as M � 1, 2, . . . , For any device j ∈ Γ, it is assumed that the load over the time period i ∈ M is a constant l i j and written as a vector; indicates the load j in the whole day. Let L i � j∈Γ l i j be the sum of all user loads above the time For a substation transformer, the total electricity charge can be determined in sections according to the current total load. When the power consumption does not exceed the basic load, the electricity price is relatively low. When the power consumption exceeds the basic load, the high price is adopted, such as the simple piecewise linear function as follows: where is the corresponding constant of a i , b i , L * i and can be adjusted according to the time calculation. As mentioned in [11], the parameters adopted by a Canadian power company are as follows: According to the total electricity charge, the station transformer charges the equipment j the electricity fee according to the proportion: e i j � (l i j /L i )E i (L i ), where l i j is the electrical load of i th period of load j. From the point of view of a single user, it is hoped that the single consumption will be the lowest; that is, it is hoped that e i j will be the smallest, while from the point of view of the whole station change, it is hoped that E i (L i ) will be kept the smallest.

Journal of Control Science and Engineering
In addition, as the power supplier, we hope that the peak valley difference is the minimum. e peak load is defined as L peak � max i∈M L i ; the average load is L avg � (1/H) H i�1 L i , and the peak to average ratio is, For a whole day's electric load, the average value of the load is usually constant. erefore, as the power supply side, it is necessary to ensure that the peak to average ratio reaches the minimum value.

Participation of Energy Storage Equipment in Generation
Subsidy Price. In order to solve the problem of insufficient power supply, an effective way is to encourage users to use energy storage equipment (such as energy storage battery and electric vehicle) to discharge during peak load. erefore, the electricity price subsidy policy is adopted, and the traditional electricity price subsidy policy adopts the unified subsidy price, which is a lack of flexibility. erefore, the subsidy tariff can be formulated according to the load at the current moment. For example, the following subsidy function can be simply used: where c i is a constant, L * * i is the corresponding constant, L i is the total load at the current time, and Q i is the total discharge load at the current time, which is recorded as a negative value. Obviously, if the current total load is large and higher than the set critical value L * * i , the energy storage equipment is encouraged to participate in power generation and subsidize the electricity charge; on the contrary, if the current total load is small and lower than the set threshold L * * i , the power supply is sufficient and the users are not encouraged to participate in power generation. For the convenience of mathematical description, the total discharge load Q i can be expressed as Q i � j∈Γ g(l i j ):

Optimal Orderly Operation Control Algorithm of Power Load
Based on the above mathematical description, taking the minimum cost and peak to average ratio as the optimization objectives and taking the load of each power consumption equipment and each period as the control object, the optimization objective function is, where λ is the weighting factor, S i (L i , Q i ) is the subsidy function, and PAR is the peak to average ratio. e following statements are to analyze the constraint conditions: for any equipment j, i s,j is used to indicate the start time of load dispatching, i e,j is the end time of load dispatching, and the total load of electric load in the whole dispatching time is fixed, which is recorded as a constant value P j , i.e., i�i e,j i�i s,j l i j � P j . e load device does not work outside the dispatch time, l i j � 0, 0 ≤ i < i s,j , i e,j < i ≤ H. In addition, for any electrical equipment, its load generally has upper and lower limits, that is, l min j ≤ l i j ≤ l max j . If the load is negative, it indicates the discharge state. erefore, the general constraint is, From the optimization point of view, the total load in a day should remain unchanged; that is, the optimization function L avg is constant, and the specific value is, In addition, the objective optimization function contains a maximum function, which is not conducive to find the optimal value. e method of adding a variable can be used. For example, if the variable ρ is used, then the objective function (6) can be expressed as, By adding the constraint conditions, we get, which implies that the final constraint is Ω 1 ∩ Ω 2 .

Adaptive Algorithm for Beetle Swarm Optimization with Variable Whisker Length
We first introduce the beetle antennae search (BAS) algorithm and then beetle swarm optimization (BSO). e main difference is that the former is based on a single individual, and the latter is based on multiple individuals.

Principle of Beetle Antennae Search Algorithm.
In the beetle antennae search (BAS) algorithm, we now use the following two rules inspired by the behavior of beetle searching with antennae, which includes searching behavior and detecting behavior. It is noted that the beetle searches randomly to explore an unknown environment. e specific steps are as follows: Step 1: assume that the position of longicorn beetles in n-dimensional solution space is X � (x 1 , x 2 , . . . , x n ), to model the searching behavior, and we propose describing a random direction of beetle searching as follows: where rand(n, 1) is an n-dimensional vector of random numbers in the range of (0, 1).
Step 2: we present the searching behaviors of both right-hand and left-hand sides, respectively, to imitate the activities of the beetle's antennae: where x k is the current position of longicorn beetles, d is the distance from the center of mass to the antennae, x k r denotes a position lying in the searching area of the right-hand side, and x k l denotes that of the left-hand side.
Step 3: location update method: where δ k is the current step size, sign is a symbolic function, and f is the function to be optimized.

Principle of Particle Swarm Optimization (PSO)
Algorithm. e basic concept of the PSO algorithm is that individuals in a group share information, so that the movement of the whole group can change from disorder to order in the process of solving problems, and finally, the best solution to the problem can be obtained. e specific steps are as follows: Step 1: suppose that the population size of particle swarm optimization in n-dimensional solution space is N, and the coordinate position vector of each particle is expressed as e velocity vector of each particle is expressed as . e optimal position of an individual is expressed as P i � (p i1 , p i2 , . . . , p in ), and the optimal position of the population is P m � (p m1 , p m2 , . . . , p mn ).
Step 2: in the k-th iteration, the position and velocity of the d-dimension of the i-th particle are updated as follows: where w is the inertia weight, c 1 and c 2 are learning factors and rand random numbers in the range of (0, 1).
Step 3: the particle optimal position updating method is as follows: where f is the function to be optimized.

Principle of Particle Swarm Optimization Algorithm Based on Beetle Antennae Search.
ere are many unknown parameters in the optimization scheduling system model studied in this paper. In this paper, a particle swarm optimization algorithm (BSO) based on a longicorn whisker search is proposed based on the idea of the BAS algorithm and PSO algorithm. e initial position and velocity process of the beetle antennae algorithm are consistent with that of PSO. However, due to the lack of local information acquisition around the current particle individual in the evolutionary direction strategy of PSO, it is unstable and prone to local optimal solution in the case of multidimensional complexity. e BSO proposed in this paper uses the idea of beetle antennae search and has its own judgment on the environment space in each iteration process; that is, individuals compare the fitness function values of left and right whiskers in each iteration and compare the values of the two. rough this method, the adaptive problems of different groups and iterative stages can be improved, and the instability and local optimal solution problems of the algorithm are solved. e specific steps are as follows: Step 1: suppose that the population size of longicorn beetle population in n-dimensional space and the standardized direction vector generated by each individual are According to the relationship between the optimal position of the group and the optimal position distance of the individual, the distance between the left and right whiskers of the i-th longicorn in the k-th iteration is calculated as follows: Step 2: according to the fitness function of the left and right sides of an individual, by comparing the values on both sides, the speed generated by the fitness of each individual in the population is updated as follows: Step 3: in the k-th iteration, the velocity and position of the i-th individual are updated as follows: where w is the inertia weight and c 1 and c 2 is the learning factor and the matrix dot multiplication represents the multiplication of corresponding elements of the same type matrix.
Step 4: after completing the iteration process, the global optimal solution can be obtained.

Simulation Results
It is considered that there are three household users participating in intelligent power consumption under a substation transformer, and each user has three different types of power load (see Table 1 for details). If a smaller resolution is adopted, different parameter L can be selected to obtain more accurate results, but it will bring a certain computational burden. For simplicity, the day is divided into 24 small periods, i.e., L � 1. e electricity charge is collected by piecewise function (1), where the parameter is a i � 0.5, b i � 0.8, and L * i � 2.5. If reverse generation is used, the subsidy tariff is calculated according to function (4), where the parameter is c i � 0.2 and L * * i � 2.
For comparison, first, it is considered that all users do not participate in intelligent power consumption and power generation. Under the premise of no loss of generality, the load is assumed to be uniformly distributed during the scheduling time; for α-type dynamic load, the load is evenly distributed within the dispatching time, while for β-type dynamic load, the load is evenly distributed within the dispatching time and does not participate in power generation. Actually, there is no difference between α-type and β-type dynamic load in this case. By a simple calculation, Figure 2 shows the power load of each time period in this case.
rough the formula the peak to average ratio is 1.9786, and the total electricity charge is 47.7286. If the intelligent dispatching optimization control algorithm proposed in this paper is adopted, where λ � 3, the daily power load is shown in Figure 3.
If the intelligent dispatching optimization control algorithm proposed in this paper is adopted, the power load of one day is shown in Figure 3.
By solving the optimal problem, According to the calculation, the peak to average ratio is 1.1670, increased by 41.02%; the total electricity charge is 24.2140, including 15.3871 income from power generation, saving 49.27% in total. erefore, based on the intelligent power consumption strategy, it not only maximizes the interests of users but also effectively participates in peak shaving and valley filling of the power grid.
To have a comparison among different kinds of optimal algorithms for solutions (21) and (22), as shown in Table 2, some popular optimal algorithms are employed: beetle swarm optimization (BSO) algorithm, particle swarm optimization (PSO) algorithm, particle swarm optimization with dynamic adjustment of inertial weights (PSO-w), and beetle antennae search (BAS) algorithm.
In this paper, the mean value of the optimal value, the standard deviation of the optimal value, and the running time of the algorithm to complete 1000 iterations are used as the main comparison data. Clearly, the performance of the BSO algorithm is obviously better than BAS and PSO algorithms.

Conclusion
Taking residential users participating in intelligent power consumption as an example, this paper considers the optimal scheduling control algorithm of several typical loads including energy storage equipment and proves the superiority of the method based on the adaptive algorithm for beetle swarm optimization with variable whisker length. Based on mathematical modeling, real-time price, and generation subsidy price mechanism, the optimal control model is given. e optimal objective function not only considers the maximization of the user's income but also takes into account the peak valley difference in power load.
e proposed algorithm provides a technical basis for the realization of intelligent power consumption and distributed generation. e next step is to study the influence of various parameters on the optimization objectives.

Data Availability
No data were used to support this study.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.