A Two-Stage Scheduling Strategy for Electric Vehicles Based on Model Predictive Control

: In recent years, with the rapid growth in the number of electric vehicles (EVs), the large-scale grid connection of EVs has had a profound impact on the power grid. As a ﬂexible energy storage resource, EVs can participate in auxiliary services of the power grid via vehicle-to-grid (V2G) technology. Due to the uncertainty of EVs accessing the grid, it is difﬁcult to accurately control their charging and charging behaviors at both the day-ahead and real-time stages. Aiming at this problem, this paper proposes a two-stage scheduling strategy framework for EVs. In the presented framework, according to historical driving data, a day-ahead scheduling model based on distributionally robust optimization (DRO) is ﬁrst established to determine the total power plan. In the real-time scheduling stage, a real-time scheduling model based on model predictive control (MPC) is established to track the day-ahead power plan. It can reduce the impact of EVs’ uncertainties. This strategy can ensure the charging demand of users is under the control of the charging and discharging behaviors of EVs, which can improve the accuracy of controlling EVs. The case study shows that the scheduling strategy can achieve accurate and fast control of charging and discharging. At the same time, it can effectively contribute to the security and stability of grid operations.


Introduction
At present, with the rapid growth in the global economy, the demand for energy is increasing swiftly [1].Due to the advantages of energy savings and emission reduction, electric vehicles (EVs) have been developing rapidly, making them the choice of more and more people.The large-scale access of EVs to the grid will have various impacts on the stable operation of the power grid.On the one hand, the disorderly charging of EVs will bring many negative impacts to the operation of the power grid [2,3], such as an increase in the peak load of the power grid [4,5], the influence of harmonics on the power quality [6,7], and an increase in the difficulty of power grid control.On the other hand, large-scale EVs can also be used as energy storage devices, which can play an important role in many aspects, such as shaving peaks and filling valleys, providing auxiliary services [8,9], accelerating the integrated construction of renewable energy [10,11], and more.Therefore, EVs are potential and promising demand response resources [12].
There has been a lot of research on scheduling EVs.Day-ahead scheduling and realtime scheduling are the two main ways to schedule the charging and discharging of EVs.Day-ahead scheduling usually obtains relevant characteristic parameters in advance based on historical data, day-ahead reports, and statistical data.The optimal scheduling of EVs is essentially an optimization problem considering multiple uncertainties, mainly the arrival time, departure time, and initial state of charge (SOC).
In the existing research, the approaches to uncertainty problems can be broadly classified into stochastic optimization (SO), fuzzy optimization (FO), and robust optimization (RO) [13].Based on stochastic optimization or fuzzy optimization, reference [14] constructed an optimal bidding strategy model through a stochastic optimization method considering the uncertainty of wind power and EVs.Reference [15] quantified the response willingness of EVs using the Takagi-Sugeno-Kang (TSK) fuzzy model with charging/discharging spreads and the battery SOC as the influencing factors of EV response willingness.A demand response strategy for EVs, considering the dynamic adjustment of response willingness, is proposed.Stochastic optimization and fuzzy optimization need to obtain the real probability distribution and membership function [16].But the probability distribution and membership function are difficult to predict accurately or obtain.Therefore, the application of stochastic optimization and fuzzy optimization has limited effectiveness.Robust optimization does not need a real probability distribution, and the data acquisition is simple and accurate.Reference [17] proposed a robust optimization model that takes price uncertainty into account, and it aims to develop various decision strategies that can be used by electricity retailers.However, the results of the robust optimization are too conservative.Distributionally robust optimization (DRO) combines the advantages and disadvantages of stochastic optimization and robust optimization.It reduces conservatism by considering the degree of influence of uncertain parameters on decision variables [18,19].Reference [20] constructed a distributionally robust model for EV clustering by considering user preferences and aiming at cost minimization.
Compared with day-ahead scheduling, real-time scheduling is accurate to hours and minutes, enabling the precise scheduling of EVs.Moreover, due to the lack of sufficient information, the control of EVs is more difficult in real time.Reference [21] proposed a dynamic, non-cooperative game model considering the interests of all parties.Reference [22] established a real-time scheduling model that minimizes power fluctuations and charging costs based on deep learning.Reference [23] established a convex optimization model for EVs to stabilize photovoltaic outputs.It also realized the effective stabilization of photovoltaic power in real time through rolling optimization and tracked the power signal of the grid in real time.Reference [24] established a hysteresis model to control the charging and discharging process of EVs and completed the tracking of the control target.
Usually, we can perform a global optimal scheduling of EVs after obtaining data (including the arrival time, departure time, and initial SOC).However, due to the uncertainty of EVs' arrivals, the precise control of EVs in real time is a great challenge.Model predictive control (MPC) can cope with the uncertainties and randomness in the model and has been applied in the field of EV scheduling control.The core idea of MPC is to use a model to predict the dynamic characteristics of the system for a certain period of time in the future and then solve the optimal control strategy within the finite time horizon of the current control cycle.Reference [25] applied an MPC strategy to control the dispatch of power in a charging station.But it assumes that the chargers are charging at the rated power without considering vehicle-to-grid (V2G).Reference [26] developed a method based on MPC to solve the charging scheduling and power control problems of EVs.It aims at minimizing the charging costs and energy generation costs while meeting the electricity demand of residential and EVs.An online optimal charging problem was formulated in [27].A distributed MPC-based scheme is designed to solve the optimization problem.The model takes into account data privacy, individual economic interests, and EV uncertainties.
Based on the above considerations, this paper deals with the problem of EV charging and discharging strategies within a region.Most of the current literature researches the charging and discharging behaviors of electric vehicles at day-ahead scheduling and real-time scheduling, respectively.However, there are few studies that consider the dayahead and real-time, two-stage scheduling process comprehensively at the same time.Aggregators can aggregate EVs to participate in ancillary services, such as peak regulation.The power deviation between the real-time and day-ahead stages of EVs needs to be kept within certain limits; otherwise, the aggregator's revenue will be affected.The strategy focuses on researching an EV scheduling problem under the control of an aggregator.The main contributions of this work can be summarized as follows: • A two-stage optimal scheduling framework for EVs is proposed.Moreover, a charging and discharging power scheduling strategy, which includes day-ahead scheduling and real-time scheduling, is introduced to solve the problem of inaccurate power control in EVs.

•
In the day-ahead scheduling stage, a distributionally robust optimization method is adopted to deal with the uncertainty of EVs.And the day-ahead scheduling model is established with the objective of minimizing charging and discharging costs.Therefore, the day-ahead power curve can be obtained.

•
In the real-time scheduling stage, considering the dynamic connectivity of EVs, a real-time scheduling model based on MPC is established for tracking the day-ahead scheduling curve.
The remainder of this paper is organized as follows.Section 2 describes the two-stage control framework for EVs.Models of day-ahead scheduling and real-time scheduling are proposed in Section 3. Section 4 discusses the case studies of the presented method, and the paper concludes with Section 5.

The Control Framework for EVs
This section describes a framework for the two-stage scheduling control of EVs.In this paper, the objects of the study are EVs under the control of an aggregator.It assumes that all EVs are acceptable to V2G and that all chargers have V2G capability.In addition, time-of-use tariff information can be obtained in advance.In Figure 1, the control process consists of day-ahead scheduling and real-time scheduling.

Day-Ahead Scheduling
In the day-ahead stage, the scheduling period is 24 h, and the time scale is 15 min.We can forecast the charging demands based on collected information.The aggregator can collect historical data reported by EV users, including arrival time, departure time, and the initial SOC.After that, considering time-of-use tariff information, we can initiate charging and discharging plans by minimizing the cost of charging and discharging.The obtained day-ahead power curve is used as a target power in the real-time stage.

Real-Time Scheduling
Although the charging load has been predicted in the day-ahead stage, the charging parameters (arrival time, departure time, and the initial SOC) of EVs in the real-time stage are still stochastic.If not controlled, the charging power may deviate significantly from the power plan in the day-ahead stage, affecting the aggregator's revenue from participating in the market.And it will also cause fluctuations in the grid loads, which is not conducive to the safe operation of the grid.Therefore, it is necessary to monitor the charging power in real time.
The aggregator only knows the remaining charging demands and departure deadlines of the EVs that have already arrived in real-time stage-.Moreover, the EVs are dynamically connected to chargers.Therefore, online optimization calculations need to be performed at each time slot.Based on the day-ahead scheduling plan, the MPC method is applied to perform rolling optimal scheduling of EVs.Through continuous rolling optimization, the impact of EV uncertainty on real-time optimal scheduling is effectively reduced.The control time horizon of rolling optimization is set to 1 h.A single rolling optimization is based on a 15 min scale for scheduling plans in the control time horizon.But only the scheduling instructions for the first 15 min period are issued for execution.Then, the rolling optimization rolls forward every 15 min and repeats the process.

Mathematical Modeling
In this section, different typical scenarios of EV charging and discharging are generated based on the collected historical data.A day-ahead scheduling model based on DRO is established to determine the day-ahead power plan of the aggregator.It can consider the charging and discharging costs of EVs and the charging demands of users.In the real-time stage, a real-time scheduling model based on MPC is established, which can track the day-ahead power schedule and reduce the aggregator control error.

Uncertainty Set
The uncertainty parameters in this paper are the arrival time, departure time, and initial SOC of the EVs.The set of uncertain probabilities for EVs is usually difficult to obtain.Through a probability-based reduction approach, this paper uses a data-driven approach to characterize the possible values of uncertain information by obtaining K discrete typical scenarios ξ 1 , ξ 2 , • • • , ξ K in M samples of historical data.And then the resulting probability distribution is used as the initial probability distribution.The discrete values of each reduction scenario are still uncertain.In order to ensure the probability of the scenario fluctuates within a reasonable range, a comprehensive norm constraint centered on the above initial probability distribution is proposed.This constraint limits the probability distribution of the uncertain scenarios and makes it closer to the real scenarios, as shown in Equations ( 1) and (2).
where Equation (1) represents the constraint of the 1-norm.Equation (2) represents the constraint of the ∞-norm.• 1 and • ∞ are the 1-norm and ∞-norm.p 0 k is the initial scenario's probability distribution.θ 1 and θ ∞ are the allowable deviations of the probability distribution under the ∞-norm and 1-norm constraints.
Therefore, the synthetic norm fuzzy set is shown as follows: In addition, according to [28], the probability distribution satisfies the confidence constraints of Equations ( 4) and (5).
The right-hand side of Equations ( 4) and ( 5) represents the confidence levels, α 1 and α ∞ , of the probability of uncertainty.If the confidence level is 95%, Equations ( 4) and ( 5) guarantee that there is at least a 95% probability that a fuzzy distribution exists within a given set.
The deviation values, θ 1 and θ ∞ , indicate that the scenario's probability can deviate from the maximum value of the initial scenario's probability.The larger the values of θ 1 and θ ∞ , the more conservative the robust model is.Conversely, the smaller these values are, the more adventurous it is.θ 1 and θ ∞ can be calculated from Equations ( 6) and (7).

Distributionally Robust Optimization Model for Electric Vehicle Scheduling
The optimization problem formulated for the day-ahead stage is based on the requirements of EV owners and the forecasted energy prices.In this paper, considering the economic benefits of charging and discharging for EV users, the day-ahead scheduling model takes the charging and discharging power of EVs as the decision variables.And the objective function is to minimize the cost of charging and discharging.Moreover, taking into account the battery discharging loss cost in the V2G mode, a charging and discharging plan model for EVs based on the time-of-use tariff is established.Let N denote the number of EVs present during the system time and T denote the time slot number.The model can be expressed as follows: where p k is the probability distribution in scenario ξ k .The first part of the objective function is the charging and discharging costs of EVs.P c i,t,k and P d i,t,k are the charging and discharging powers of the i th EV at time t, respectively.c c t and c d t are the charging and discharging tariffs at time t, respectively.The second part of the objective function is the loss of EVs due to V2G. c d,i is the battery degradation cost of the i th EV, which is a constant number in this paper.A is the set of decision variables for the max model, A = {p k }.Ω is the set of scenarios that have been reduced.X is the set of decision variables for the min model, and X = P c i,t,k , P d i,t,k .

Power Constraints
Since EVs cannot be charged and discharged at the same time, this paper defines binary variables, δ c i,t,k and δ d i,t,k , that represent the EVs to be charged/discharged or not.P c i,max and P d i,max denote the maximum values of the charging and discharging power of EVs, respectively.If δ c i,t,k = 1 and δ d i,t,k = 0, the EV is charging; if δ d i,t,k = 1 and δ c i,t,k = 0, the EV is discharging; if δ d i,t,k = 0 and δ c i,t,k = 0, the EV is neither charging nor discharging.The constraints for the charging and discharging power limitations are presented as follows: 3.1.4.Constraints for SOC EV charging and discharging also need to meet the user's electricity demands.The constraints for the SOC are given in ( 12)- (14).
where denotes the battery capacity.S SOC i,exp,k is the expected SOC when an EV departs in scenario ξ k .Equation ( 13) limits the maximum and minimum constraints on the SOC.Equation ( 14) guarantees the SOC when EVs depart.

Constraints for Transformer
In order to ensure a safe and stable grid operation, the charging load of EVs connected to the transformer should be limited to its maximum capacity.
where ε down t and ε up t are the load factors of the transformer.P trans t is the capacity of the transformer.
By solving the day-ahead model, the total scheduling power can be obtained at each time slot.It can be expressed as follows: where P re f t is the total power of the charging loads during the day-ahead stage.

Model Predictive Control
Model predictive control is an advanced control strategy that has been widely studied and applied in recent years [29].Model predictive control is based on the ideas of rolling optimization and advance control.It can better solve optimization problems with multiple uncertainties.In this paper, model predictive control is used to make rolling corrections to the day-ahead scheduling plan.
The basic structure of model predictive control is shown in Figure 2. r(k) represents the reference value.u(k) and y(k) are the control variable and the output variable.d(k) is the perturbation value.Models are mainly used to describe the dynamic behaviors of a control system.The future output of the system is predicted through information and specific control strategies.Based on the state of the system and its inputs, the output of the system during the optimization time horizon is predicted.Therefore, the system model used for prediction must be sufficiently accurate and appropriate.tt ffi ff ff For the rolling optimization, the main responsibility is to provide the computation of the control sequence.Unlike traditional optimal control algorithms, model predictive control selects only the first instruction in the control sequence to be used for the actual system control.The rolling optimization under model predictive control obtains a global suboptimal solution in the case of open-loop control.Compared with global optimization under optimal control, although it has certain limitations, it can effectively overcome the effects of uncertainties in the power system.
In the actual scheduling process, information on EVs cannot be obtained in advance, and the arrival of EVs needs to be monitored dynamically in real time and then optimized for calculation.In addition, at the real-time scheduling stage, there is a lack of global information on the access of EVs in the future period.The period of each optimization schedule should not be too long or too short.Therefore, in order to track the instructions issued by the scheduling center accurately, this section establishes a real-time scheduling model for EVs based on model predictive control.This model continuously optimizes the charging and discharging power through rolling optimization.The process of rolling optimization is shown in Figure 3.The specific modeling process is given below.

Objective Function
There are non-convex constraints in EV modeling such that EV charging and discharging behaviors cannot be carried out at the same time.Ref. [23] relaxes the non-convex constraints by adding barrier terms, and the method has good performance in terms of control.Inspired by this, a real-time scheduling model for EVs is established by adding barrier terms to the objective function in this paper.Taking the charging and discharging powers of EVs as decision variables, in the mode of responding to the power instructions, the objective function can be expressed as in Equation ( 17): where r 1 and r 2 are the barrier terms.In this paper, r 1 = r 2 = 2.

Constraints
When users of EVs depart, the SOC of EVs needs to reach the expected value.However, rolling optimization optimizes the objective function over a limited time horizon in the future.If the SOC constraint is added at the end, the model may have no solution or invalid constraint conditions, and it is difficult to effectively ensure that the SOC reaches the expected value when EVs leave the grid.The actual departure time of the users may be earlier, and in order to avoid the users' travel being affected, constraints are added within 30 min of the expected departure time.
where ∆T indicates the distance between the current period and the expected departure period, ∆T = 1, 2, • • • , 96. S SOC i,exp (∆T) represents that the EVs need to meet the value of SOC at ∆T period from the departure time.The rest of the constraints are the same as in the day-ahead optimization.
It is assumed that the time horizon of rolling optimization is H. Taking the current moment t as an example, the optimization time horizon is t ∈ [t, t + 1, . . ., t + H].In summary, the real-time scheduling model of EVs based on MPC can be expressed as (19): The model can be iterated with EV data updated online in real time.The total power of the EVs in the day-ahead stage is used as the tracking objective, and the objective function is to minimize the error between the actual and planned values of charging and discharging power.After solving the model, the control sequence, consisting of the charging and discharging power of all EVs in the control time horizon, can be obtained.Only the first value of the control sequence is applied to the control system at the moment of issuing the command, waiting for the next cycle to arrive.And then it will repeat the above rolling optimization process.
The real-time scheduling solution of the model relies on the collection of information.In fact, the length of the optimization time horizon can be set according to practical needs, such as considering the forecast time and data update frequency.On the one hand, if the optimization time horizon is too short, the solution to the problem will lack a sufficient prediction of the future state and become shortsighted.And the obtained solution may be very different from the theoretical optimal solution.On the other hand, if the optimization time horizon is obtained too long, the complexity of the rolling optimization then rises significantly, leading to an inefficient solution and increased prediction pressure.In order to ensure that the real-time solution speed of the problem can meet the requirements of the real-time optimization, the complexity of the problem should not be too high, so this paper chooses H = 1h as the length of the optimization time horizon.

Case Study
In this section, a case is used to solve the two-stage strategy optimization model proposed in this paper based on the driving data of EVs.The results of the solved model are analyzed to verify the reasonableness and effectiveness of the model.

Simulation Parameter Settings
In this paper, the objects are 100 EVs under an aggregator.The scheduling period, T, is 24 h.Taking 15 min as the scheduling period, a day can be divided into 96 time steps.The time horizon of rolling optimization is set to 1 h.The time-of-use tariff information is shown in Figure 4.The data samples of the EVs are generated using a normal distribution or random distribution based on the predicted values.The number of samples, M, is 100.The probability distribution of the initial scenarios is obtained through a probabilistic distancebased scenario reduction technique.The number of reduced scenarios, K, is 10. Figure 5 shows one of the typical scenarios, and the initial probability distribution is stochastic.
The other parameter settings of the EVs are shown in Table 1.The platform used for the case is Python, and the solver is Gurobi.and 7 show the results of the day-ahead scheduling.Most of the initial SOCs of the 100 EVs are in the range of 0.3 to 0.6 and the ultimate goal of the EVs is to be fully charged.Therefore, during the entire scheduling period in Figure 7, it can be seen that the EVs are in the charging state most of the time, and discharging behaviors only exist for short amounts of times.In Figure 6, the red color represents the charging power and blue color represents discharging power.The overall charging load profile values are positive due to the presence of multiple EVs charging and discharging.The total charging load does not exceed the maximum capacity limit of the transformer.It is worth noting that the charging and discharging behaviors of the EVs are guided by the charging and discharging time-of-use tariffs.The charging and discharging time-of-use tariffs set in this paper are only one case.The aggregator can set appropriate time-of-use tariffs to guide the charging and discharging behaviors of EVs according to the control demand.Corresponding to the time-of-use tariffs, it can be seen that the time the EVs are charging is concentrated in the periods 6:00-10:00 and 15:00-19:00.And some EVs are discharging from 15:00 to 18:00.     2 and Figure 8.

Comparative Analysis with Other Uncertainty Methods
In order to verify the effectiveness of the proposed method, the evaluation model based on distributionally robust optimization (DRO) proposed in this paper is compared with the EV charging and discharging scheduling model based on stochastic optimization (SO) and robust optimization (RO).The historical data sample size M is 100.β 1 = β ∞ = 0.95.In this case, the SO model schedules EVs in discrete scenarios with a deterministic probability distribution.The robust optimization model is the worst-case scenario.The analysis results are shown in Table 2 and Figure 8.  Through analyzing the EV charging curves and cost results of the three methods, it can be seen that the stochastic optimization method simulates the uncertainty of the EV driving parameters in multiple scenarios.The charging and discharging costs are the lowest for this method.The robust optimization method considers the worst-case scenario, and the charging and discharging costs are the highest.In comparison, the distributionally robust optimization method solves the day-ahead scheduling model under the worst-case probability distribution of EV driving data.And the cost results are slightly higher than the stochastic optimization results and lower than the robust optimization results.Overall, the distributionally robust optimization method fully combines the economy of stochastic optimization andthe robustness characteristics of robust optimization.It can be seen that the distributionally robust optimization method proposed in this paper is able to strike a good balance between economy and conservatism.

Impact of Confidence on Robustness
Under the distributionally robust optimization approach, the confidence level constrains the allowed deviation values through the 1-norm and ∞-norm, which in turn affects the probability distribution of the scenarios.In order to analyze the impact of confidence levels on robustness, different confidence levels are set to solve the charging plans of EVs to compare the difference in charging costs.The selected historical data sample size M is 100.The ranges of β 1 and β ∞ are [0.3,0.95] and [0.8, 0.95].
The charging and discharging costs of the EVs at different confidence levels are shown in Table 3.With the increase in the confidence levels, β 1 and β ∞ , the deviation value allowed by the integrated norm constraint becomes larger.And the charging and discharging costs of the EVs increase.This is because as the level of confidence increases, the confidence interval increases.Therefore, the solution range of the worst-case scenario's probability expands, so the cost increases.Among them, the ∞-norm constraint corresponds to a more pronounced change in charging cost caused by the increase in confidence levels.When β 1 > 0.6 and β ∞ = 0.8, the relationship between the 1-norm constraint confidence level and the results of the charging cost is ambiguous.The average charging cost difference is within 0.4 CNY.This indicates that the constraint has a weak effect on the scenario's probability distribution at this time.Overall, the robustness of the model can be adjusted by controlling the confidence level to avoid the charging cost being too high when the charging and discharging powers are formulated too conservatively.The charging and discharging cost of EVs under different a typical number of scenarios are shown in Table 4.The historical data sample size M is 100.β 1 = β ∞ = 0.95.Table 4 shows the charging and discharging costs of the EVs for typical scenarios with numbers of 5, 10, and 15.When the number of EV driving data samples is certain, the higher the number of typical scenarios obtained by clustering, the more scenario sample information is retained.Therefore, typical scenarios will contain certain extreme samples of information.At the same time, the deviation value allowed by the integrated norm constraints increases, so the scenarios obtained through model solving are more severe.In summary, the model conservatism will rise, and the cost will increase.If EVs are charged in method 2, the charging load will be concentrated in the period from 6:00 to 12:00.The resulting charging peak load will lead to overloading of the transformer, which will affect the safety of users' electricity consumption.After the aggregator has taken control of method 3, the optimized power in the real-time stage effectively tracks the target power formulated in the day-ahead stage.The power tracking effect is very good before 16:00.In the 16:00-20:00, the tracking effect seems to not be good.This is because many EVs will depart and leave the grid during this time period.In order to ensure the electricity demand of users, part of the tracking effect is abandoned.According to the need for real-time control, the aggregator controls the charging and discharging of the EVs.It can also be seen that the EVs are mostly in a state of charging in Figure 10.The control strategy proposed in this paper can adapt to the dynamic access of EVs and shows good performance in the real-time scheduling stage.Method 1 is performing a global optimization.Method 1 differs from the plans in the day-ahead stage due to the presence of a barrier term in the objective function.The main difference between Method 1 and Method 3 is at 16:00-19:00.This is because the rolling optimization used in Method 3 is a finite time horizon optimization.Therefore, it is difficult to take into account the global optimum.

SOC at Departure Time
Figure 11 shows the SOC of the 100 EVs when they depart.It can be seen that after adding the SOC constraint method proposed in this paper for rolling optimization, the SOC of the 100 EVs neatly reaches 1.0.The effectiveness of the method proposed in this paper is verified.Therefore, incorporating the constraints of Equation ( 18) can ensure that the SOC of EVs reaches the expected value in the rolling optimization process.In the meantime, it can effectively satisfy the needs of the aggregator's regulation.

Conclusions
In this paper, a two-stage scheduling strategy, including day-ahead scheduling and real-time scheduling, is proposed to address the control error problem caused by the uncertainty of EVs at the aggregator level.Firstly, based on a series of EV driving data, a day-ahead scheduling model is established through a distributionally robust optimization method.The advantages of the proposed strategy are verified by comparing it with the stochastic optimization method and the robust optimization method.The results show that the distributionally robust optimization method proposed is able to strike a good balance between economy and conservatism.Furthermore, in the real-time stage, a realtime scheduling model for EVs based on model predictive control is established.The charging and discharging power of the EVs is controlled in real-time stage using a rolling optimization method.The results show that the strategy achieves accurate control of EV charging and discharging behaviors in the real-time stage.Compared to disordered charging, transformer overload control is also carried out to effectively ensure the safe and stable operation of the power grid.The method proposed in this paper can accurately control EVs while considering the user's willingness and charging costs.

Figure 1 .
Figure 1.The two-stage strategy control framework for EVs.

Figure 2 .
Figure 2. Basic structure of model predictive control.

Figure 3 .
Figure 3.The process of rolling optimization. ff

Figure 7 .
Figure 7. Power of each EV in day-ahead stage.

4. 2 . 2 .
Comparative Analysis with Other Uncertainty Methods In order to verify the effectiveness of the proposed method, based on distributionally robust optimization (DRO) proposed in with the EV charging and discharging scheduling model based on s (SO) and robust optimization (RO).The historical data sam  == β β .In this case, the SO model schedules EVs in dis deterministic probability distribution.The robust optimization m scenario.The analysis results are shown in Table

Figure 7 .
Figure 7. Power of each EV in day-ahead stage.

Figure 8 .
Figure 8.Comparison of evaluation results of three methods.

4. 3 .
Results of Real-Time Scheduling 4.3.1.Power of Real-Time Scheduling In order to verify the validity of the real-time scheduling model, two methods are proposed in this section: (1) Method 1: Global optimization.Optimal solution with perfect information.The information about EVs is all known in advance.(2) Method 2: Disorderly charging.The EVs are charged at the maximum power of the chargers immediately after being connected to the grid.The charging of EVs stops when the expected SOC is reached.(3) Method 3: The proposed real-time scheduling strategy.

Figures 9
Figures 9 and 10 show the charging and discharging powers of EVs in the real time stage.If EVs are charged in method 2, the charging load will be concentrated in the period from 6:00 to 12:00.The resulting charging peak load will lead to overloading of the transformer, which will affect the safety of users' electricity consumption.After the aggregator has taken control of method 3, the optimized power in the real-time stage effectively tracks the target power formulated in the day-ahead stage.The power tracking effect is very good before 16:00.In the 16:00-20:00, the tracking effect seems to not be good.This is because many EVs will depart and leave the grid during this time period.In order to ensure the electricity demand of users, part of the tracking effect

Figure 9 .
Figure 9. Power of real-time scheduling.

Figure 9 .
Figure 9. Power of real-time scheduling.

Figure 10 .
Figure 10.Power of each EV in real-time stage.

Figure 10 .
Figure 10.Power of each EV in real-time stage.
k is the SOC of an EV in scenario ξ k .η c and η d represent the efficiencies of charging and discharging, respectively.t arr i,k and t dep i,k are arrival time and departure time of an EV in scenario ξ k .E cap i

Table 1 .
Parameter settings of EVs.

Table 2 .
Cost of three methods.

Table 3 .
Charging and discharging costs of EVs at different confidence levels.

Table 4 .
Charging and discharging cost for different typical numbers of scenarios.