Research on Orderly Charge and Discharge Strategy of EV Based on QPSO Algorithm

The change of electric vehicle (EV) cluster schedulable capacity in each period under multi-time scales has strong randomness and volatility. To ensure the trip demand and the charge and discharge cost of users, and increase the reliability of load demand curve prediction, this paper proposes a dynamic charge and discharge optimization strategy that takes the charge and discharge control coefficient in each response period as the control object. According to the trip chain, the proposed method models the trip time-space distribution of EV users, sorts each response period from small to large according to the starting time, comprehensively considers the interests of users and the peak shaving demand of the power grid, and uses Quantum Particle Swarm Optimization (QPSO) to solve the multi-objective optimization of charge and discharge control coefficient for the sorted response period. The charge and discharge control coefficient is modified by introducing virtual charge time and the virtual state of charge. Compared with the traditional method, the proposed method considers the mismatch between the expected parking time of users and the actual parking time of users and can update the load demand curve in real-time due to the dynamic changes in users’ trip behavior, which is more practical. To verify the effectiveness of the method proposed in this paper, according to the simulation results of the time-space distribution of electric private car users, the load demand curves under different charge strategies, different optimization weights, and different vehicle-to-grid (V2G) responsiveness are simulated and analyzed. The results show that the proposed method can effectively reduce the peak valley difference and variance of the load demand curve under the condition of ensuring the trip demand and economic benefits for EV owners.


I. INTRODUCTION
EV charging load is a typical power consumption load on the user side, and it is likely to become a flexible demand response resource. In the future, there will be a large number of EVs. The charging power of a single EV is much higher than the daily household appliance load, and its charging period has strong replaceability and schedulability. With the breakthrough and development of power electronics technology, modern control, and communication technology, V2G technology is gradually maturing [1].
EV is not only a flexible load with schedulable potential but also can be used as battery energy storage equipment to feedback electric energy to the power grid at a certain The associate editor coordinating the review of this manuscript and approving it for publication was N. Prabaharan . standby capacity when necessary. In [2], for plug-in electric vehicles, an intelligent charge strategy model is proposed to assist the owner to find the optimal charging station to optimize the load double-peak overlapping phenomenon. Reference [3] considers various battery operation strategies, takes the grid-side benefits as the main goal, and proposes an EV charge and discharge optimization strategy based on Multi-objective Particle Swarm Optimization (MOPSO). Reference [4] proposes an EV charge and discharge strategy based on coordinated control of energy pricing to ensure maximum economic benefits for the EV user side. Reference [5] proposes an algorithm based on water injection, which is specially designed for smoothing the grid load curve, which can effectively coordinate the charge and discharge periods of EV clusters. Reference [6] uses the K-means clustering algorithm to divide EVs into different groups and uses PSO to solve the model with groups as units, so as to avoid dimension disaster caused by centralized scheduling of a large number of EV clusters. Reference [7] points out that EVs should follow the V2G charge and discharge scheduling on the premise of meeting basic trip needs. Considering the convenience of user trips, a Preferenceinspired Co-evolutionary Algorithm (PICEAg-EV) based on resource allocation is proposed to solve the multiobjective optimal control problem. Based on the regional power grid load, Reference [8] sets the load elasticity coefficient to optimize the electricity price in each time period and proposes an optimal control strategy for charge scheduling to reduce the charging cost of users. To select the target time slot with sufficient residual power in the power grid for charge scheduling and determine the charge priority of each EV in each time slot, Reference [9] defines the capacity margin index and charge priority index, and proposes a coordinated charge strategy employing a valley filling strategy. Reference [10] combines the peak shaving demand of the system, proposes the interactive incentive price mechanism of the EV network, and constructed the EV trip demand model based on the trip chain and the power consumption model based on the trip demand. Based on the proposed dynamic optimization method of time-of-use electricity price, Reference [11] uses PSO to optimize the charge and discharge behavior of each EV in two stages by establishing a multi-objective function with the largest charging amount and the smallest charging cost and modifies the optimized charge and discharge behavior by introducing virtual charge state.
Under multi-time scales, the changes in the schedulable capacity of EV clusters in each period have strong randomness and volatility. Most EV users will have temporary trip demand or prolong parking time due to special circumstances. The actual schedulable capacity in each period may have a large deviation compared with the predicted results, which affects the accuracy of load demand curve prediction. In addition, when simulating the load demand curve, the above references do not optimize the charge and discharge control coefficient of each response period in turn according to the chronological order of EV participation in orderly charge and discharge. In practical situations, the optimization results of subsequent EVs connected to the grid are unknown, which affects the reliability of the calculation results. Based on the above research, these paper models the charging load of private cars, taxis, and buses under disorderly charging mode. The results show that the daily charging demand of most electric private cars is not high, with sufficient parking time and electricity to respond to V2G orderly charge and discharge scheduling. Firstly, based on the 2017 national household travel survey and the regional traffic road network model, combined with the Floyd algorithm and the spatial transition probability matrix, the Monte Carlo method is used to simulate the trip time and space characteristics of electric private vehicles. Assuming that each functional area is equipped with two-way V2G equipment, the parking period of electric private cars can be regarded as the schedulable period, which is sorted according to the starting time of each schedulable period from small to large. Secondly, based on the ranking results, the peak and valley periods are divided according to the basic load in the response period when the EV is connected to the grid, and the charge and discharge control coefficient is introduced to represent the charge and discharge state of the EV in the response period. Based on the expected parking time of users and the state of charge (SOC) when the EV is connected to the power grid, judge whether the EV meets the conditions for participating in orderly charge and discharge optimization, and introduce virtual charge time to modify the charge and discharge control coefficient. Then, based on the V2G incentive price for peak shaving proposed in [10], a multiobjective function is established, which has the lowest user charge and discharge cost, the smallest peak valley difference of load in the response period, the smallest mean square deviation of load fluctuation in the response period, the smallest sum of the difference between the load in each period after optimization and the daily average load before optimization, and the highest user satisfaction. Considering the constraints, the QPSO optimization algorithm is used to optimize the charge and discharge control coefficient in the EV response period, and the virtual SOC is introduced to modify the optimized charge and discharge control coefficient, so as to realize the calculation of the user's charge and discharge costs and the SOC of the EV when it is expected to leave, which is convenient for the user to decide whether to respond to V2G. When the user leaves or reaches the expected departure time, update the load demand curve again according to the actual situation. Finally, simulation experiments are carried out on the load demand under different charge modes, different optimization weights, and different V2G responsiveness to verify the effectiveness and rationality of the optimization strategy proposed in this paper.

II. MODELING EV CHARGING LOADS
A day is discretized into 96 time periods, every 15 minutes as a period. According to the trip purpose, EVs are roughly divided into three categories: private cars, taxis, and buses. Assuming that there are a total of 300 EVs in a certain area, the basic information of various EVs is shown in Figure 1.  The trip chain model can be used to reflect the dynamic characteristics of the trip mode. According to the structure of the trip chain and regional functions, the regions are divided into five categories: residential area (H), work area (W), shopping area (S), entertainment area (E), and other functional areas (O). On weekdays, the trip activities of private cars are dominated by simple chain (H-W-H) [12]. Considering the trip chain structure with up to three driving destinations, its structure can be divided into the simple chain and complex chain, as shown in Figure 2.

2) CHARGING FREQUENCY ANALYSIS
In the disordered charge mode, a large number of users do not charge EVs every day, so taking the user's charging frequency into consideration is beneficial to improve the prediction accuracy of the Monte Carlo method. This paper assumes that the relationship between the user's charging frequency and the daily power consumption is shown in Table 1.

3) USER DRIVING CHARACTERISTIC PARAMETER ANALYSIS
In the disorderly charge mode on weekdays, private car owners often choose to charge in the parking lot in the residential area after returning home from work or conduct emergency fast charging near the destination. To reduce battery loss, private car owners often adopt the conventional charging method when charging at night. In the orderly charge and discharge mode, since the daily electricity consumption of most private car owners is low [13], there is sufficient electricity to respond to the demand for urban peak shaving and valley filling. To quickly put into operation to earn profits, taxi drivers often use fast charging during working hours, which is also one of the main reasons for the increase in the peak-to-valley difference in the power grid. In addition, the operation of electric buses is regular, and they often adopt the fast charging method in groups. To ensure the normal operation of urban traffic, this paper assumes that both buses and taxis use disorderly charge mode during working hours. In the disordered charge mode, the spatiotemporal characteristic parameters of EVs are shown in Table 2.
B. EV LOAD PREDICTION IN DISORDERED CHARGING MODE 1) CHARGING TIME When the disordered charge mode is adopted, in the conventional charge mode, the charging is stopped after the power is fully charged. In the fast charging mode, the charging is stopped when the SOC reaches 80%. The actual charging time t m,rp of an EV can be divided into two cases, that is, the charging time t m,in connected to the power grid and the charging end time t m,out are on the same day, or the charging time t m,in connected to the power grid is on the first day and the charging end time t m,out is on the second day. Then the EV charging time t m,rp can be expressed as: (1)

2) EV CHARGING CAPACITY
To simplify the model, assuming that EVs adopt a constant power charge mode, the charging electricity of EVs during disordered charge mode can be approximately expressed as: where P r is the rated charging power of the charging pile and η is the charging efficiency.

3) MONTE CARLO SIMULATION METHOD
The Monte Carlo method is a statistical simulation method that uses random numbers to solve practical problems. Its main purpose is to obtain numerical solutions to practical problems. It can produce random objects with probability distribution when simulating a process and estimate the digital characteristics of the model with statistical methods. The specific process of predicting EV load by the Monte Carlo method is shown in Figure 3. According to the charging behavior characteristics of users, this paper uses the Monte Carlo method [14] to simulate the regional EV charging load. In the case of disorderly charging, the charging load of buses and taxis is very high, which will have a great impact on the power grid. As shown in Figure 4, the EV load has four peaks in one day. Around 2:30 p.m., the load peaks of the three models are superimposed, and the total load reaches about 1400kW. In the disordered charge scenario, the overall charging demand for private cars is low, which shows that they have great dispatch potential. If they are reasonably guided to participate in orderly charge and discharge activities, they can provide effective assistance for peak shaving demand on the power grid side.

III. MODELING OF SPACE-TIME DISTRIBUTION AND RESEARCH ON THE SCHEDULABLE TIME PERIOD OF ELECTRIC PRIVATE CAR
Electric taxis and electric buses are the main sources of excessive peak value in some time periods of the power grid. However, due to the actual operation needs, the charging demand for both is high. Electric buses adopt centralized and rapid charge mode, while electric taxis have the possibility of participating in a large number of  orderly charge and discharge activities only after the end of working hours. Considering that private cars account for the highest proportion of all models, and most private cars have sufficient time and electricity to meet the basic conditions for participating in orderly charge and discharge scheduling, electric private cars with different battery capacities are used as the research objects. It is assumed that each electric private car is equipped with two-way V2G equipment, and except for the running electric private car, other electric private cars can obtain the SOC of EV users, willingness, and location to participate in V2G peak shaving and valley filling auxiliary services and other information through the VOLUME 10, 2022 communication function of V2G equipment. As shown in Figure 5, this chapter simulates the driving path of EV users in combination with the traffic network model and then obtains the schedulable period of each electric private car.

A. FLOYD ALGORITHM
This paper assumes that the shortest path of Floyd is the total length of each trip chain of EV. The core of the Floyd algorithm is to calculate the global optimal solution by using the local optimal solution [15]. It can be divided into two stages, finding the shortest path length and recording the path  of finding length, that is, the optimal route can be found. The specific steps are as follows: 1) Generate an adjacency table D according to the road network nodes, and initialize the routing matrix P; 2) Using different routing nodes s n as intermediate points, obtain the direct path length between the two nodes and the indirect path length passing through the road network node s n , and take the minimum value to update the adjacency table D; 3) The adjacency table D stores the shortest path length between nodes, which is the distance matrix.
The Floyd algorithm is used to calculate the distance matrix of the road network. The distance is expressed by the size and color of the oval color block, as shown in Figure 6.

B. VEHICLE SPACE TRANSFER PROBABILITY
The trip chain is regarded as a Markov chain. In this paper, each driving destination of an EV is regarded as a state, and the next destination of the EV is determined by the current state. Note that the current state is E i , the next state is E j , and p ij is the state transition probability from state E i to state E j .
For the five trip destinations studied in this paper (H, S, E, W, and O respectively), the one-step transition probability of EV driving from one destination to another can be expressed as: where k is the serial number of a certain sub-trip chain in the trip chain of EV one day, and p k ij will show the time-varying of different spatial distributions according to the trip demand of different sub trip chains. The specific value is set according to [12].

C. SIMULATION OF EV SPATIOTEMPORAL DISTRIBUTION BASED ON TRIP CHAIN
To obtain the V2G schedulable period of each EV, it is necessary to simulate the spatial state distribution of each EV user in each time period according to the trip chain, so as to determine whether the EV is in the schedulable state. Reference [16] points out that the daily trip time T s of EV users follows the normal distribution, and its probability density function is as follows: where µ s = 8.56 and σ s = 1.57. The normal distribution probability density diagram of user trip time is shown in Figure 7.
According to the statistical results of the 2017 national household travel survey [17], the time spent on trip activities of entertainment and work types approximately meets the normal distribution of N (2.39,0.73 2 ) and N (5.87,1.2 2 ). The  normal distribution probability density diagram of the two trip activities is shown in Figure 8.
The time spent on shopping and other types of trip activities approximately satisfies the exponential distribution: For shopping activities, where µ s = 0.56 and σ s = 0.56. For other types of activities, where µ s = 0.45 and σ s = 0.45. The probability density diagram of the exponential distribution of the two activities is shown in Figure 9.
The simulation process of EV trip temporal and spatial distribution based on the trip chain is shown in Figure 10. The specific steps are as follows: VOLUME 10, 2022 2) For the m-th EV, assume that the initial SOC value of the first trip is a random number evenly distributed in [0. 8,1], and randomly extract the length Q of the trip chain. On weekdays, the number ratio of simple chains to complex chains is about 2 [18]. Set k = 1, k is the sequence number of a certain sub-trip chain in the trip chain of EV one day; 3) According to the current sub trip chain k, use the Floyd algorithm to calculate the trip distance, and approximately estimate the trip time according to the routing matrix and the average speed of each road section in the corresponding period of the road network; 4) Assume that both residential areas and work areas adopt 10kW conventional charging, and other functional areas adopt 30kW fast charging. The user's SOC expectation is a random number evenly distributed between [0.6, 1]. The parking time t m,rp and the expected parking time t m,es are randomly selected according to the trip chain; 5) Judge whether k is equal to Q. if it is equal, go to 6). If it is unequal, make k = k + 1, random the destination of the next sub trip chain according to the transfer probability matrix, and go to 3); 6) Judge whether m is equal to M . if so, the process ends. If not, make m = m + 1 and go to 2).
It is assumed that all functional areas are equipped with two-way V2G equipment, so the period during which EV is expected to stay at a certain place can be regarded as a schedulable period. Take the EV user's family as the starting point and endpoint of the daily journey. The schematic diagram of the travel chain coupled between EV and traffic network is shown in Figure 11.

IV. EV CHARGE AND DISCHARGE STRATEGY OPTIMIZATION MODEL A. V2G PRICE INCENTIVES FOR PEAK SHAVING
When setting the discharge service price for EVs participating in peak shaving auxiliary services, the load situation of the system and the electricity price should be taken into consideration. If EV users participate in peak shaving when the grid load fluctuates greatly, they will benefit more. A day is divided into 96-time intervals at 15min intervals. If the load P t of the distribution network in the time period t is greater than the daily average load P avr of the distribution network when EVs are connected to the power grid, this time period is defined as the peak shaving period. To reflect the difference between EV users participating in system peak shaving in different time periods, the V2G service compensation price is set according to the quality of EV participation in auxiliary services. This paper introduces the peak clipping compensation coefficient [10], and designs the following compensation coefficient rules: where Q s is the peak shaving demand coefficient. P w is the system load to be reduced. Q j is the user participation compensation coefficient. ξ is the peak shaving demand price compensation coefficient, and the value in this paper is 1.1. q j is the adjustment coefficient of EV user participation, q jb is the participation of EV users. N t i is the number of EV users signed up to participate in V2G in the response period. N a is the total number of EV users. C c,t is the current city time-of-use electricity price. C d,t is the discharge service compensation price for EVs participating in peak shaving auxiliary services. C d,t,min and C d,t,max are the minimum and maximum discharge service compensation prices for EVs participating in peak shaving auxiliary services, respectively.

B. POWER BATTERY LOSS MODEL
Charge and discharge rate, depth of discharge, state of charge, number of cycles, and charge and discharge capacity are the main factors that affect battery loss. Reference [11] points out that the number of battery cycles and battery life is roughly linear, and the calculation formula of battery degradation cost  is as follows: Bm 100 where C V 2G m,t is the battery degradation cost of the EV in period t. B m is the linear relationship coefficient between battery life and cycle times, which is taken as −0.015625 in this paper. C m is the battery capacity of the EV. x m,t is the cyclic charge and discharge capacity of the vehicle in period t. S m,t and S m,t−1 are the SOC of the vehicle in period t and the previous period respectively. When the EV responds to V2G discharge in period t, there will be battery loss cost, while there will be no battery loss cost when charging.

C. CHARGE AND DISCHARGE CONTROL COEFFICIENT
An EV will have 3 states after being connected to the grid: charge, discharge, and silent. To conveniently control the charge and discharge behavior of each EV, the charge and discharge control coefficient is introduced: where CV m is the set of EV charge and discharge control coefficients. c m,t is the charge and discharge control coefficient of each period under the single parking time of EV, which is used to control the charge and discharge behavior and charge and discharge power of the EV in each period. The control rules are as follows:

D. OBJECTIVE FUNCTION 1) THE LOWEST COST OF EV CHARGING AND DISCHARGING
After considering the battery cycle charge and discharge cost, take the minimum charge and discharge cost of the EV during the charge and discharge period as the objective function: where t m,in is the starting time of EV response to charge and discharge scheduling. t m,out is the period when the EV is expected to leave the grid. f a is the charge and discharge cost of the EV after considering the battery loss. P r is the rated charge and discharge power of the EV. C cp,t , C cu,t , and C cv,t are the charge prices in the peak period, the normal period, and the valley period, respectively. C dp,t , C du,t , and C dv,t are the discharge prices in the peak period, the normal period, and the valley period, respectively.

2) THE MINIMUM LOAD PEAK-TO-VALLEY DIFFERENCE DURING THE RESPONSE PERIOD
To avoid large-scale charging of EVs during peak power consumption hours after being connected to the power grid, causing peak-to-peak superposition, the goal is to minimize VOLUME 10, 2022 the load peak-to-valley difference during the response period: Due to the randomness of the trip chain, each EV may respond to V2G scheduling many times a day. Therefore, it is necessary to study multiple V2G response periods of each EV in a day. Where P m,t is the charge and discharge power of the m-th EV in period t when responding to a V2G dispatching. P m,pk and P m,v are the peak and valley values of electric power consumption of the m-th EV in the response period respectively.

3) THE MEAN SQUARE ERROR OF LOAD FLUCTUATION DURING THE RESPONSE PERIOD IS THE SMALLEST
The mean square deviation of load reflects the fluctuation of regional load. The smaller the mean square deviation, the more stable the changing trend of load. The objective is to minimize the mean square deviation of load fluctuation in the response period: where t m,es is the expected duration of EV participating in V2G charge and discharge scheduling.

4) THE SUM OF THE ABSOLUTE VALUE OF THE DIFFERENCE BETWEEN THE LOAD IN EACH PERIOD AFTER THE OPTIMIZATION OF THE RESPONSE PERIOD AND THE DAILY AVERAGE LOAD BEFORE THE OPTIMIZATION IS THE SMALLEST
To reduce the fluctuation of the overall load and further guide EV peak shaving and valley filling, the goal is to minimize the sum of the absolute value of the difference between the load in each period after the optimization of the response period and the average load of the whole day before optimization: where S m,out is the SOC when EV leaves. S m,in is the SOC when EV starts responding to V2G. S m,tg is the ideal SOC set by the user. It can be seen from (22) that the value range of ω is within (0, 1]. The larger the value, the higher the user's SOC satisfaction.

b: SATISFACTION OF CHARGE AND DISCHARGE EXCHANGE TIMES γ
Frequent charging and discharging of the battery has a great impact on the life of the battery, which will affect the user's evaluation of V2G. Therefore, this paper introduces the satisfaction index γ of the number of charge and discharge exchanges: where n m,cg is the number of charge and discharge exchanges of EVs in a certain scheduling period. It can be seen from (24) that the value range of γ is (0, 1]. The larger the value is, the higher the satisfaction of the user with the number of charge and discharge exchanges. Based on the above considerations, user satisfaction is defined as the opposite number of the product of user SOC satisfaction and charge and discharge exchange times satisfaction: It can be seen from (25) that the value range of EV user satisfaction is within [−1, 0). The smaller the value, the higher the user satisfaction.

6) TOTAL OBJECTIVE FUNCTION
Based on the linear weighted sum method, each objective function is normalized: where f is the multi-objective optimization function.

E. CONSTRAINT CONDITION 1) EV MILEAGE CONSTRAINT
The remaining power of the EV after discharging to the grid needs to meet the power demand of the next trip, and the discharge capacity should be between the maximum and minimum battery capacity: where L is the driving mileage of the next section of the EV. m,max is the maximum energy consumption per 100 km of the current EV.

2) BATTERY DISCHARGE CAPACITY CONSTRAINT
The service life of the EV battery is not only related to the number of cycle discharges but also related to the discharge depth. In order to avoid an additional loss to the service life of the EV battery, this paper makes the following constraints on the electric quantity S m,t and schedulable electricity S m,d of EV responding to discharge in the discharge period: where t m,din is the start time of discharge phase. t m,dout is the end time of discharge phase.

3) TRANSFORMER CAPACITY CONSTRAINT
During any period of time, the overall regional load shall not be greater than the upper limit S T of the regional transformer capacity:

4) CHARGE AND DISCHARGE POWER CONSTRAINT
The size of the charge and discharge control coefficient c m,t will affect the charge and discharge power P m,t of the EV. Constraining the charge and discharge power is beneficial to the reasonable scheduling on the grid side. Therefore, the following constraints are imposed on P m,t :

5) CONSTRAINT ON THE NUMBER OF CHARGE AND DISCHARGE TRANSITIONS
Switching charge and discharge behavior multiple times in a short period of time can negatively impact battery life. Therefore, it is considered that the number of charge and discharge transitions n m,cg in a single response period does not exceed 1/3 of the total length of the period.

V. MULTI-OBJECTIVE COLLABORATIVE OPTIMIZATIONSTRATEGY FOR ORDERLY CHARGE AND DISCHARGE
After the EV is connected to the power grid, the system obtains the battery capacity C m and current SOC S m,in of the EV through the EV's battery management system, and records the access time t m,in of the EV to the power grid.
To facilitate the reasonable dispatching of the power grid, the user also needs to input whether to respond to the charge and discharge strategy. If the user has the willingness to respond, the user also needs to input the expected residence time t m,es of the EV and the expected SOC value S m,tg when leaving. The user's actual departure time t m,rout is random. If the user's departure time is greater than the expected departure time, the system will notify the user and ask the user to update the expected departure time to continue the charge and discharge optimization.

A. FIRST-STAGE CHARGE OPTIMIZATION CENTERED ON USER CHARGING NEEDS
The schedulable period simulation results of electric private cars are sorted from small to large according to the starting time. If the user chooses to respond to V2G charge and discharge scheduling within a schedulable period, this period is the response period. The load prediction results of taxis and buses are superimposed with the basic load of the power grid, and peak, flat and valley sections are divided on this basis. If the expected stay time t m,es input by the user is less than or equal to 3, it will not discharge it. If the user has the willingness to charge, the disordered charge mode is adopted by default until the SOC of the EV reaches the desired state S m,tg or the user leaves, otherwise, the control coefficient of this period is corrected to a silent state. When the expected residence time t m,es input by the user is greater than 3, the virtual charging duration t v m is introduced to calculate the time required to reach the user's expected SOC S m,tg under the constant power charge mode, in the case that the user's expected SOC S m,tg is larger than the SOC S m,in of the EV connected to the power grid: If the expected parking time t m,es input by the EV user is less than or equal to the virtual charging time t v m , the system determines that the EV does not meet the orderly charge and discharge conditions, and sets the charge and discharge control coefficient within the EV charging period to 1. Otherwise, the system judges that the EV meets the conditions of orderly charge and discharge, and will arrange for the EV to participate in the second stage of orderly charge and discharge optimization.

B. SECOND-STAGE ORDERLY CHARGE AND DISCHARGE OPTIMIZATION BASED ON QPSO
The search for particle swarm optimization (PSO) depends on speed because the speed is limited and can only search VOLUME 10, 2022 along a fixed trajectory, which leads to a limited search area and low global searchability. In view of the shortcomings brought by this certainty, the idea of uncertainty is considered to be introduced into PSO. QPSO transforms the search space of particles from the original classical space to the quantum space, so that the particles have quantum behavior so that the motion of particles conforms to the motion behavior of particles in quantum mechanics. In the quantum system, the individual particles of the population have no definite trajectory. The particles can appear at any position in the feasible search domain with a certain probability, or even at a position far away from the current position. This position may have better fitness than the global optimal position of the current population. Therefore, compared with the general PSO, the global search ability of QPSO is greatly improved.
When an EV participates in orderly charge and discharge, the charge and discharge control coefficient of the EV is optimized by QPSO. First, initialize random particles whose dimension D is the same as the expected residence time t m,es . Assuming that each population consists of M particles, the initial position c m i of the i-th particle can be expressed as a vector of dimension D: After the particles of the charge and discharge control coefficient are randomly initialized, the charge and discharge control coefficient of the EV within the response period has been preset. Considering the battery discharge capacity constraints, it is necessary to modify the charge and discharge control coefficients after initialization. The virtual SOC variable S v m,t is introduced, and the virtual SOC after the completion of the charge and discharge behavior in each period is sequentially calculated according to the charge and discharge control coefficient c m,t initialized by the EV: where S m,t−1 is the actual SOC value of the previous period. When the virtual SOC variable S v m,t of a certain period is greater than the threshold value of 0.95, if the expected departure time of the user exceeds 3 periods and the subsequent period does not belong to the valley period, the charge and discharge control coefficient of the next 3 periods is corrected to a negative number, otherwise, the correction is 0. Considering the battery discharge capacity constraint and the user's SOC satisfaction, when the virtual SOC variable S v m,t of a certain period is less than the threshold value of 0.3, if the user's expected departure time is more than 3 periods, the charge and discharge control coefficient of the next 3 periods is corrected to a positive value. If the time from the user's expected departure is less than 3 periods, the charge and discharge control coefficients of this period and adjacent periods are corrected to positive.
After the correction of the charge and discharge control coefficient is completed, the particle swarm performs iterative optimization, and the optimal position searched by the i-th particle is called the individual extreme value, which is recorded as: The optimal solution searched by the entire population so far in this iteration process is called the global extremum, which is recorded as: When the entire particle population finds the individual extreme value P m i,best and the global extreme value G m best , the iteration is completed, and each particle will update its position through (37)-(40): where n m i,best is the average optimal position of the particle swarm. z 1 and z 2 are acceleration coefficients. r 1 and r 2 are random numbers uniformly distributed in the range of [0, 1]. α is the coefficient of shrinkage and expansion, which decreases linearly from 1 to 0.5 for better performance. u is a random number between [0, 1]. After the position of the particle is updated, it enters the next iteration until all the iterative processes are completed, and the final optimal fitness value is the optimal value of the particle swarm.
When the user chooses to respond to V2G charge and discharge, the load demand curve is updated according to the optimal solution result. Under normal circumstances, the user's actual stay time often has a certain deviation from the expected stay time. When the user leaves the power grid, V2G equipment will update the load demand curve according to the current state of the EV, so as to avoid affecting the accuracy of orderly charge and discharge optimization of EVs that are subsequently connected to the grid after the EV leaves. The two-stage optimization flow chart of orderly charge and discharge is shown in Figure 12. where t b is a temporary variable that represents three consecutive periods after a certain period t, and t vp represents the valley period of load demand curve in a day.

VI. CASE ANALYSIS A. PARAMETER SETTING
Assuming that the basic load in the area refers to the basic load distribution of the IEEE33 node distribution system in [19], as shown in Table 3, the basic load of the 96 time periods in this paper can be obtained after fitting.
Assuming that the number of EVs of each type in the area is shown in Figure 1, the basic load in the corresponding period is superimposed with the load of buses and taxis to update the basic load distribution in each period. The battery replacement cost C B is set with reference to [11], taking   1 yuan/(W·h). There are a total of 3 transformers with a capacity of 1600kVA in the area. The charge and discharge efficiencies are both taken as 0.9. Set the maximum number of iterations of QPSO to 600, the population size to 50, and the acceleration coefficient z 1 = z 2 = 1.5. Based on the general industrial time-of-use electricity price in Jiangsu Province, the time-of-use electricity price in this region is formulated during peak, flat and valley periods, as shown in Table 4.
According to the simulation results of the time-space distribution of electric private car travel, the regional load demand is simulated in different scenarios within a day. The simulation process is shown in Figure 13. Among them, i is the number of the schedulable periods of electric private cars sorted according to the starting time from small to large, S is the sum of the number of schedulable periods, and S i represents the start time of the i-th schedulable period.

1) OPTIMIZATION RESULTS UNDER DIFFERENT OPTIMIZATION WEIGHTS IN THE SAME RESPONSE PERIOD
Taking a response period as an example, the results of the charge and discharge optimization method proposed in this paper are displayed. V2G responsiveness is defined as the ratio of the number of electric private cars participating in orderly charge and discharge to the total number of electric private cars. Assuming that the user's responsiveness is 100%, the EV charging information in this response period is: C m = 20, P r = 10, t m,in = 30, t m,es = 19, t m,rout = 50, S m,in = 0.8162, S m,tg = 0.95. When the user responds to V2G, the charge and discharge optimization results with optimization weights of λ 1 :λ 2 :λ 3 :λ 4 Figure 14-16, and the charge and discharge control coefficient distribution is shown in Figure 17.
From Figure 14-17, under the three optimization weights, the method proposed in this paper reduces the load demand of the power grid during the peak period in the response period and increases the load demand of the power grid during the valley period in the response period. The charge and discharge costs under the three optimization weights are approximately 0 yuan, and the SOC values when users expect to leave are 0.8050, 0.8360 and 0.8468 respectively. Obviously, the proposed method takes into account the interests and needs of power grid side and user side, and gives a reasonable and effective charge discharge optimization strategy. In this case, the response period of EV is short, and the response period is almost completely within the peak period of the power grid. In terms of the peak regulation demand on the power grid side, discharging EVs during the peak period can effectively reduce the optimal fitness value of the function and make the function closer to the optimal solution. However, the user also puts forward a high demand for charging. After discharging the EV in some periods, it is necessary to charge it in other periods. At the same time, it is also necessary to take into account the user's charge and discharge cost to keep it within a reasonable range. Therefore, the overall optimization space is small. The optimization effect of the proposed method can be effectively improved when the EV is connected to the power grid for a longer time and the time distribution of peak and valley periods in the response period is uniform. Figure 18 shows the QPSO optimization process of orderly charge and discharge under different optimization weights. It can be seen that different optimization methods reach the optimum within 500 iterations, and the convergence speed is the fastest when the optimization weight ratio is λ 1 :λ 2 :λ 3 :λ 4 :λ 5 = 0.1:0.3:0.3:0.2:0.1.

2) ANALYSIS OF PEAK SHAVING EFFECT AND USER EXPERIENCE UNDER DIFFERENT OPTIMIZATION WEIGHTS AND V2G RESPONSIVENESS
Analyze the peak shaving effect of electric private cars when the V2G response is 0%, 20%, 40%, 60%, 80% and 100% respectively under different optimization weights. In multi-objective optimization, take λ 1 :λ 2 :λ 3 :λ 4  The average income of orderly charge and discharge is defined as the opposite number of the average value of the actual charge and discharge cost of all EV users participating in V2G orderly charge and discharge in each response period in a day. The average SOC satisfaction is defined as the average value of the sum of SOC satisfaction when the user actually leaves in each response period in a day. The average charge and discharge conversion times are defined as the average value of the sum of the charge and    discharge conversion times from the beginning of the orderly charge and discharge of V2G to the actual departure of the user in each response period in a day. The average optimal fitness value is defined as the average value of the optimal fitness value in each response period in a day. Under different responsivity, the above indicators are calculated, as shown in Table 5-9.
By comparing the above charts, it can be seen that different responsiveness will affect the peak shaving effect of V2G and user experience. In general, when the optimization weights  are the same, the higher the V2G responsivity is, the average benefit of orderly charge and discharge and the average SOC satisfaction are increasing, while the average optimal fitness value is decreasing. In the case of high responsiveness, the number of EVs participating in V2G increases, and the response period of more EVs will coincide with the load peak and valley period. In the peak load period, the incentive price of V2G is high, resulting in the increase of the average income of orderly charge and discharge of EVs, and the average optimal fitness value has also been improved. Under different responsivity, the peak valley difference optimization rate and load variance optimization rate are shown in Figure 24. When the responsivity is 20% and 40%, the peak shaving effect of V2G is not obvious. This is due to the fact that when the responsiveness is low, the number of EVs participating in V2G is small, and the response period that coincides with the peak period is also less. At the same time, the charge and discharge strategy proposed in this paper is more inclined to ensure the travel demand of users, and will not over-discharge the EV due to the high demand for peak regulation. When the responsivity is greater than or   equal to 60%, the load peak valley difference optimization rate and load variance optimization rate are significantly improved. When the responsivity is 100%, the load variance optimization rate even reaches 50%, which is because more charging demand is transferred to the valley period through the charge and discharge optimization strategy during the peak period.
When the responsiveness is the same, the peak shaving effect and user experience of V2G will show different characteristics due to different optimization weights. Generally   speaking, when the optimization weight is λ 1 :λ 2 :λ 3 :λ 4 :λ 5 = 0.1:0.2:0.3:0.3:0.1, the average charge and discharge conversion times are low, the average income of orderly charge and discharge is high, and the performance in peak shaving is relatively good. When the optimization weight is λ 1 :λ 2 :λ 3 :λ 4 :λ 5 = 00.1:0.3:0.3:0.2:0.1, the average charge and discharge conversion times are low and the average income of orderly charge and discharge is high, but the performance in peak shaving and average SOC satisfaction shows volatility. When the optimization weight   is λ 1 :λ 2 :λ 3 :λ 4 :λ 5 = 0.2:0.2:0.2:0.2:0.2, the performance of each index shows volatility. Overall, the higher the responsiveness, the better the performance in various indicators. In the same responsiveness, the advantages and disadvantages of various indicators under different optimization weights do not reflect the regularity.
Under the condition of adopting the charge and discharge optimization strategy proposed in this paper, the optimized load demand shows the characteristics of a decrease in peak load and an increase in valley load. In addition, it can be observed that the load demand curve under each responsiveness shows strong volatility. On the one hand, the strategy proposed in this paper takes the charge and discharge control coefficient in the EV response period as the optimization goal, and the basic charging information of users participating in V2G has strong randomness, so the charge and discharge control coefficient in each response period will also be greatly different. On the other hand, the actual departure time of the user is often inconsistent with the expected departure time under normal circumstances, so the dynamic update of the grid load demand is relatively frequent. In conclusion, considering the temporary travel behavior of users, the method proposed in this paper not only ensures the power demand and economic benefits of discharge on the user side but also takes into account the demand of reducing peak valley difference and load variance on the power grid side, which is effective. In addition, the method proposed in this paper takes a certain response period of individual EV as the research object, and the required data can be identified by the device end or provided by the user end. It has feasibility and universal applicability and is more practical.

VII. CONCLUSION
In this paper, the Monte Carlo method is used to model the charging demand of private cars, taxis, and buses in the disorderly charge mode. Based on NHTS2017 data set and regional traffic network information, the trip time-space distribution model of electric private cars is established, and then the schedulable period of each electric private car in the whole day is obtained. Considering the temporary trip demand of users and the time sequence of each response period, this paper proposes a two-stage optimization strategy of orderly charge and discharge, which takes the charge and discharge control coefficient in the response period as the optimization object. According to the simulation results of the trip time-space distribution of electric private cars, the following conclusions are drawn: 1) There are a large number of electric private cars, but the daily charging demand is the lowest among the three models. It has sufficient time to participate in V2G orderly charge and discharge scheduling to assist the power grid in peak shaving and valley filling.
2) The method proposed in this paper considers the temporary travel needs of users under multiple time scales and can formulate charge and discharge optimization schemes according to the different needs of EV individual users. The basic information required can be obtained through V2G equipment or users, which is highly feasible. At the same time, this paper optimizes the charge and discharge control coefficients of each response period in turn according to the time sequence of EV participation in orderly charge and discharge, and the simulation results of the load demand curve are more practical.
3) The method proposed in this paper can bring considerable discharge benefits to EV users on the premise of ensuring the travel needs of EV users, and can effectively reduce the load variance of the load curve, ensuring the interests of the grid side and the user side. 4) When optimizing the charge and discharge behavior of EV, different responsiveness and different optimization weights will affect the experience of EV users and the peak shaving effect of the power grid. Generally, the higher the responsiveness of EV, the greater the benefits obtained by both parties. Under the same responsiveness, the pros and cons of each index obtained by different optimization weights do not show regularity. This paper only studies the effect of electric private vehicles participating in V2G orderly charge and discharge optimization. However, the charging demand for electric taxis is relatively high. If the charge optimization of taxis is carried out during working hours, and the orderly charge and discharge optimization of taxis is carried out during rest periods, the peak regulation effect can be further improved. In addition, this paper only studies the orderly charge and discharge optimization strategy of EV, and the demand response policy to encourage users to participate in orderly charge and discharge optimization still needs to be further studied. VOLUME 10, 2022