Optimization method for power grid operation safety and electric vehicle charging and discharging interconnection

Through the double-layer optimization dispatch model, the charging and discharging status of electric vehicles is coordinated, the problem of grid power security and load balance is solved, and the orderly charging and discharging of electric vehicles and the safety and stability of grid operation are achieved.

CN118748394APending Publication Date: 2024-10-08STATE GRID ELECTRIC VEHICLE SERVICE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311853094.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

Existing optimization methods for charging and discharging electric vehicles ignore the power supply conditions of the transmission network and the spatial position of electric vehicles in the distribution network, making it difficult to ensure the safety of power consumption in the grid, and disordered charging may cause load peaks.

Method used

A two-layer optimization dispatch model is adopted. The upper-layer model aims at optimizing the safety of the grid operation, and the lower-layer model aims at minimizing the peak-valley difference between the daily load of the grid. It coordinates the charging and discharging status of electric vehicles through improved algorithms to ensure the safety and load of the grid operation. balanced.

Benefits of technology

It realizes the orderly charging and discharging of electric vehicles, improves the safety and load balance of power grid operation, reduces the peak and valley differences of power grid load, and reduces charging costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118748394A_ABST
    Figure CN118748394A_ABST
Patent Text Reader

Abstract

The invention relates to an optimization method for power grid operation safety and electric vehicle charging and discharging interconnection. The optimization method comprises the following steps: step 1, determining upper and lower layer evaluation indexes of an electric vehicle ordered charging and discharging double-layer optimization scheduling model; 2, collecting related data for constructing the ordered charging and discharging double-layer optimization scheduling model of the electric vehicle; step 3, establishing an electric vehicle ordered charging and discharging double-layer optimization scheduling model; the upper-layer model establishes an optimization model by taking optimal power grid operation safety as a target and taking battery capacity, battery expectation at the end of charging and the like as constraint conditions; the lower-layer optimization model establishes an optimization model by taking the minimum power grid daily load peak-valley difference as a target and taking the optimal power grid operation safety calculated by the upper-layer optimization as a constraint condition; and 4, solving the upper-layer model by using an improved algorithm to obtain an optimization method for the operation safety of the power grid and the charging and discharging interconnection of the electric vehicle. According to the invention, ordered charging and discharging control of the electric vehicle can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of power system automatic control, and in particular to a method for optimizing power grid operation safety and electric vehicle charging and discharging interconnection. Background Art

[0002] In recent years, new energy has become a competitive power generation method at home and abroad with its advantages of low pollution and abundant resources. However, the randomness of new energy power generation increases the difficulty of grid dispatching and operation. Since electric vehicles have huge advantages in achieving green travel, using electric vehicles as a future travel method is an inevitable trend. When large-scale electric vehicles are randomly connected to the power grid, the disorderly charging of electric vehicles will have a negative impact on the power safety of the power grid. How to effectively reduce the power load risk brought by electric vehicles is the focus of future attention.

[0003] The large-scale popularization of electric vehicles has a positive impact on the planning and operation of distribution networks, including the power quality and reliability of distribution networks, but disorderly charging has also brought a series of adverse effects. In order to enhance the distribution network's capacity to accommodate large-scale electric vehicle charging loads and reduce the adverse effects of disorderly charging of electric vehicles, corresponding measures need to be taken to guide and control random charging behavior.

[0004] The existing optimization methods for charging and discharging electric vehicles ignore the power supply of the transmission network and the spatial location of electric vehicles in the distribution network. The actual charging scheduling results may be difficult for users to accept, and thus EVs cannot be effectively scheduled. Using electricity prices to guide users without proper and reasonable control of users' charging behavior is likely to bring new load peaks during low-price periods.

[0005] After searching, no literature in the prior art that is identical or similar to the present invention was found. Summary of the invention

[0006] The purpose of the present invention is to overcome the shortcomings of the prior art and propose an optimization method for the interconnection of power grid operation safety and electric vehicle charging and discharging. Through double-layer optimization coordination, the optimal power grid operation safety and the minimum peak-to-valley difference of the power grid daily load are ensured, thereby realizing orderly charging and discharging control of electric vehicles.

[0007] The present invention solves the practical problem by adopting the following technical solutions:

[0008] A method for optimizing power grid operation safety and electric vehicle charging and discharging interconnection includes the following steps:

[0009] Step 1: Determine the upper and lower evaluation indicators of the double-layer optimization scheduling model for orderly charging and discharging of electric vehicles;

[0010] Step 2: Based on the evaluation index determined in step 1, collect relevant data for constructing a two-layer optimization scheduling model for orderly charging and discharging of electric vehicles;

[0011] Step 3: Based on the data collected in step 2, a two-layer optimization scheduling model for orderly charging and discharging of electric vehicles is established; the upper layer model takes the optimal grid operation safety as the goal, and takes battery capacity, battery expectation at the end of charging, etc. as constraints to establish the optimization model; the lower layer optimization model takes the minimum peak-to-valley difference of the grid daily load as the goal, and takes the optimal grid operation safety calculated by the upper layer optimization as the constraint to establish the optimization model;

[0012] Step 4: Solve the upper model with the improved algorithm, and obtain the optimal solution of the lower model through repeated iterations, thereby optimizing the charging and discharging status of electric vehicles, and obtaining an optimization method for the safety of power grid operation and the interconnection of electric vehicle charging and discharging.

[0013] Moreover, the specific method of step 1 is:

[0014] Considering the influencing factors of electric vehicles connecting to the power grid, the safety of power grid operation and the minimum peak-to-valley difference of daily power grid load are determined as evaluation indicators, and then a two-layer optimization scheduling model for orderly charging and discharging of electric vehicles is constructed.

[0015] Moreover, the data collected in step 2 to construct the electric vehicle orderly charging and discharging double-layer optimization scheduling model include: charging and discharging start time Ts, end time T f , charge and discharge state related parameters, charge and discharge electricity price, daily load value in time period i in the control area of ​​the control center is M Li ; The charging and discharging power value of the electric vehicle in the control time period i is M Ei ; The daily average load value is M av wait.

[0016] Moreover, the specific steps of step 3 include:

[0017] (1) The upper optimization model establishes the objective function with the goal of optimizing the safety of power grid operation:

[0018]

[0019] In the formula, the charge and discharge start time is Ts; the charge and discharge end time is T f ; The charge and discharge state parameter is Q 1i,j , Q 2i,j , in the charging state Q 1i,j =1,Q 2i,j =0, in the discharge state Q 1i,j =0,Q 2i,j =1, Q in idle state 1i,j =0,Q 2i,j =0; charging power is Pai ; Charging price is p ai ; The discharge power is P bi ; The discharge price is p bi ; The length of the control unit time period is Δt; The cost of battery loss at the discharge time is C d .

[0020] The constraints include:

[0021] ① Vehicle battery capacity constraints:

[0022]

[0023] ② Expected constraints on battery after charging:

[0024]

[0025] ③ Electric vehicle charging and discharging power limit:

[0026]

[0027]

[0028] ④ Uniqueness constraints of electric vehicle charging and discharging modes:

[0029] Q 1i,j ×Q 2i,j =0

[0030] ⑤ At any time, when electric vehicles are connected to the power grid, the total load should be lower than the maximum load of the distribution network:

[0031]

[0032] (2) Based on the upper-level optimization of the charging and discharging scheme, the lower-level model is optimized as the objective function:

[0033]

[0034] The daily load value of electric vehicles in the control area during time period i is M Li ; The charging and discharging power value of the electric vehicle in the control time period i is M Ei ; The daily average load value is M av ;

[0035] Moreover, the specific steps of step 4 include:

[0036] (1) Solve the upper-level model to ensure the safety of access to the power grid;

[0037] ① Let T = T0, initialize the system and set the parameters, randomly generate an initial solution Y0, and calculate the initial objective function value that satisfies the security of the power grid corresponding to the initial solution;

[0038] ② Let T = T1, and T1 < T, reassign T to change the charge and discharge time;

[0039] ③ For the current solution Y i Perturb to generate new solution Y j , calculate the new solution Y j Corresponding to the new objective function value, the difference ΔE between the new objective function and the original objective function value is obtained;

[0040] ④If ΔE<0, accept the new solution Y j As the current optimal solution; if ΔE>0, the new solution is accepted according to the Metropolis criterion;

[0041] ⑤ Repeat L at T1 k Disturb and accept again, and repeat steps ③ and ④;

[0042] ⑥ Determine whether T is lower than the minimum value T f If yes, the algorithm is terminated and the optimal solution that satisfies the safety of the power grid is output; if no, jump to step ② and change the charging and discharging time to continue calculating the optimal solution.

[0043] (2) Solving the lower model:

[0044] ① Randomly initialize the transportation mode: that is, the charging and discharging mode is randomly initialized so that the initial values ​​of the individual optimal value and the global optimal value are both 0, and the charging and discharging state iteration parameters are initialized;

[0045] ② Taking E as the objective function of the lower model, it means that the difference between the peak and valley of the daily load of the power grid is minimized. Calculate the value of the objective function for the charge and discharge state;

[0046] ③ Determine whether the charge and discharge state has converged or whether the number of iterations has been reached. If not, update the global optimal charge and discharge method and return to the above steps. If it has converged or the number of iterations has been reached, output the optimal solution and end.

[0047] (3) After extracting the charging load value for this time period, the charging and discharging status is optimized according to four categories:

[0048] a. When M>M av , and there is a charging state during this time period, the optimization method is: reduce the charging state;

[0049] b. When M>M av , and there is no charging state during this time period, the optimization method is: increase the discharge state;

[0050] c. When M<M av , and there is a discharge state during this time period, the optimization method is: reduce the discharge state;

[0051] d. When M<M av , and there is no discharge state during this time period, the optimization method is: increase the charging state.

[0052] Advantages and beneficial effects of the present invention:

[0053] The present invention proposes an optimization method for the safety of power grid operation and the interconnection of electric vehicle charging and discharging, and adopts a two-layer optimization scheduling model for orderly charging and discharging of electric vehicles. The model can not only achieve the optimal safety of electric vehicle users, but also the reasonable scheduling control has a positive effect on the safe and stable operation of the power grid. The upper-layer optimization takes the battery loss and efficiency and charging and discharging time into consideration, takes the battery capacity and battery expectation as constraints, and establishes an optimization model, and uses an improved algorithm to solve the optimization problem. The lower-layer optimization model takes the minimum peak-to-valley difference of the daily load of the power grid as the goal, and establishes an optimization model with the optimal safety of electric vehicle operation calculated by the upper-layer optimization as a constraint. The coordination between the two-layer optimization scheduling is used to ensure the utilization efficiency of the power grid and users, thereby achieving orderly charging and discharging control of electric vehicles. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 A processing flow chart of a method for optimizing the operation safety of a power grid and the interconnection of charging and discharging of electric vehicles according to the present invention;

[0055] Figure 2 The upper optimized load curve diagram of the present invention;

[0056] Figure 3 Optimize the load curve diagram for the lower layer of the present invention. DETAILED DESCRIPTION

[0057] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0058] A method for optimizing the safety of power grid operation and the interconnection of electric vehicle charging and discharging, such as Figure 1 As shown, the following steps are included:

[0059] Step 1: Determine the upper and lower evaluation indicators of the double-layer optimization scheduling model for orderly charging and discharging of electric vehicles;

[0060] The specific steps of step 1 include:

[0061] The intelligent charging device can control the charging and discharging status of electric vehicles, which are idle, charging, and discharging. When a vehicle is connected to the intelligent charging device, the charging device obtains the time-of-use electricity price information from the power grid, obtains the start time from the electric vehicle charging, and optimizes the charging cost of the electric vehicle. After the charging and discharging plan is obtained, the charging and discharging plan is adjusted according to the local load forecast value, while ensuring the optimal safety of the power grid, so as to minimize the load fluctuation of the power grid. After repeated iterations, the final optimized charging plan is output and executed immediately.

[0062] Therefore, considering the influencing factors of electric vehicles connecting to the power grid, the safety of power grid operation and the minimum peak-to-valley difference of power grid daily load are determined as evaluation indicators, and then a two-layer optimization scheduling model for orderly charging and discharging of electric vehicles is constructed;

[0063] Step 2: Based on the evaluation index determined in step 1, collect relevant data for constructing a two-layer optimization scheduling model for orderly charging and discharging of electric vehicles;

[0064] The specific method of step 2 is:

[0065] The relevant data for constructing the double-layer optimization scheduling model for orderly charging and discharging of electric vehicles are collected, including the charging and discharging start time Ts, the end time T f , charge and discharge state related parameters, charge and discharge electricity price, daily load value in time period i in the control area of ​​the control center is M Li ; The charging and discharging power value of the electric vehicle in the control time period i is M Ei ; The daily average load value is M av wait.

[0066] Step 3: Based on the data collected in step 2, a two-layer optimization scheduling model for orderly charging and discharging of electric vehicles is established; the upper layer model takes the optimal grid operation safety as the goal, and takes battery capacity, battery expectation at the end of charging, etc. as constraints to establish the optimization model; the lower layer optimization model takes the minimum peak-to-valley difference of the grid daily load as the goal, and takes the optimal grid operation safety calculated by the upper layer optimization as the constraint to establish the optimization model;

[0067] The specific steps of step 3 include:

[0068] Electric vehicles are connected to the power grid to improve safety. Under the time-of-use electricity price mechanism, they can be charged during off-peak hours and discharged during peak hours, effectively improving safety through the price difference between peak and valley electricity.

[0069] (1) The upper optimization model establishes the objective function with the goal of optimizing the safety of power grid operation:

[0070]

[0071] In the formula, the charge and discharge start time is Ts; the charge and discharge end time is T f ; The charge and discharge state parameter is Q 1i,j , Q 2i,j , in the charging state Q 1i,j =1,Q 2i,j =0, in the discharge state Q 1i,j =0,Q 2i,j =1, Q in idle state 1i,j =0,Q 2i,j =0; charging power is P ai ; Charging price is p ai ; The discharge power is P bi ; The discharge price is p bi ; The length of the control unit time period is Δt; The cost of battery loss at the discharge time is C d .

[0072] The constraints include:

[0073] ① Vehicle battery capacity constraints:

[0074]

[0075] ② Expected constraints on battery after charging:

[0076]

[0077] ③ Electric vehicle charging and discharging power limit:

[0078]

[0079]

[0080] ④ Uniqueness constraints of electric vehicle charging and discharging modes:

[0081] Q 1i,j ×Q 2i,j =0

[0082] ⑤ At any time, when electric vehicles are connected to the power grid, the total load should be lower than the maximum load of the distribution network:

[0083]

[0084] (2) If all the electric vehicle batteries that can be discharged centrally are discharged, it may cause the grid load to change from "peak" to "valley" at a certain moment, so it is necessary to set a reasonable number of electric vehicle discharges. Under the premise of minimizing the difference between the peak and valley of the daily grid load and considering the battery loss, it is necessary to increase the enthusiasm of electric vehicle owners to participate in the discharge process and formulate a reasonable discharge electricity price to ensure the user's return on investment.

[0085] Based on the upper layer optimization charging and discharging scheme, the lower layer model is optimized as the objective function:

[0086]

[0087] The daily load value of electric vehicles in the control area during time period i is M Li ; The charging and discharging power value of the electric vehicle in the control time period i is M Ei ; The daily average load value is M av .

[0088] The optimal solution of the upper-level optimization is used as the initial solution of the lower-level optimization. The charging and discharging strategy is adjusted by changing the corresponding charging control time without changing various parameters as much as possible.

[0089] Step 4: Solve the upper model with the improved algorithm, and obtain the optimal solution of the lower model through repeated iterations, thereby optimizing the charging and discharging status of electric vehicles, and obtaining an optimization method for the safety of power grid operation and the interconnection of electric vehicle charging and discharging.

[0090] The specific steps of step 4 include:

[0091] (1) Solve the upper-level model to ensure the safety of access to the power grid;

[0092] ① Let T = T0, initialize the system and set the parameters, randomly generate an initial solution Y0, and calculate the initial objective function value that satisfies the security of the power grid corresponding to the initial solution;

[0093] ② Let T = T1, and T1 < T, reassign T to change the charge and discharge time;

[0094] ③ For the current solution Y i Perturb to generate new solution Y j , calculate the new solution Y j Corresponding to the new objective function value, the difference ΔE between the new objective function and the original objective function value is obtained;

[0095] ④If ΔE<0, accept the new solution Y j As the current optimal solution; if ΔE>0, the new solution is accepted according to the Metropolis criterion;

[0096] ⑤ Repeat L at T1 k Disturb and accept again, and repeat steps ③ and ④;

[0097] ⑥ Determine whether T is lower than the minimum value T f If yes, the algorithm is terminated and the optimal solution that satisfies the safety of the power grid is output; if no, jump to step ② and change the charging and discharging time to continue calculating the optimal solution.

[0098] (2) Solving the lower model:

[0099] The lower optimization model is solved by an iterative method, and the initialization scheme uses the charge and discharge state after the upper optimization. The state within a certain time period is randomly selected to determine whether there is a charging state within the time period, and the charge and discharge state is optimized. After repeated iterations, the optimal solution is obtained.

[0100] ① Randomly initialize the transportation mode: that is, the charging and discharging mode is randomly initialized so that the initial values ​​of the individual optimal value and the global optimal value are both 0, and the charging and discharging state iteration parameters are initialized;

[0101] ② Taking E as the objective function of the lower model, it means that the difference between the peak and valley of the daily load of the power grid is minimized. Calculate the value of the objective function for the charge and discharge state;

[0102] ③ Determine whether the charge and discharge state has converged or whether the number of iterations has been reached. If not, update the global optimal charge and discharge method and return to the above steps. If it has converged or the number of iterations has been reached, output the optimal solution and end.

[0103] (3) After extracting the charging load value for this time period, the charging and discharging status is optimized according to four categories:

[0104] e. When M>M av , and there is a charging state during this time period, the optimization method is: reduce the charging state;

[0105] f. When M>M av , and there is no charging state during this time period, the optimization method is: increase the discharge state;

[0106] g. When M<M av , and there is a discharge state during this time period, the optimization method is: reduce the discharge state;

[0107] h. When M<M av , and there is no discharge state during this time period, the optimization method is: increase the charging state.

[0108] After the model proposed in the present invention is solved, it can ensure the minimum peak-to-valley fluctuation of the load in its control area while meeting the security of access to the power grid. If the above requirements are met, the optimization strategy of this model is output, which can provide a reference for the orderly charging and discharging control of electric vehicles.

[0109] The present invention is further described below by means of specific examples:

[0110] Taking the distribution network of a certain region as an example, it is assumed that the number of electric vehicles that can participate in the dispatch in the region is 2,000, the battery of the electric vehicle is fully charged every time, the electricity price refers to the domestic time-of-use electricity price, and the charging and discharging state is controllable. The specific relevant parameters are shown in Table 1. (Table 1):

[0111]

[0112]

[0113]

[0114] according to Figure 2 The upper optimization load curve of electric vehicle charging and discharging simulates the charging and discharging of all electric vehicles. The upper optimization has a significant peak-cutting effect during the evening peak period. However, due to the low electricity price in the early morning, more electric vehicles are scheduled to charge during this period. A new load peak appears during this period, so using only the upper optimization still has shortcomings.

[0115]

[0116] Based on the consideration of charging and discharging power, charging and discharging time, and battery capacity, an upper optimization model is established. At the same time, in order to reduce the peak-to-valley difference, a lower optimization model is established based on the upper optimization. Figure 3 The cost and peak-valley difference optimization models of the upper-layer optimized charging and lower-layer optimized charging are compared. As can be seen from the table, the peak-valley difference of the daily load is reduced by about 4% after double-layer optimization compared with the peak-valley difference of the first-layer optimization. From the perspective of peak-valley difference, the hierarchical optimization model improves the security of the power grid and reduces the requirements for power generation capacity. In terms of charging benefits, the results obtained by using the two-layer optimization model proposed in the present invention are similar to those obtained by simply using the first-layer optimization model, and are much lower than the charging cost under disordered charging.

[0117] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0118] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0119] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for optimizing the safety of power grid operation and the interconnection of electric vehicle charging and discharging, Features: The following steps are involved: Step 1: Determine the upper and lower evaluation indicators of the double-layer optimization scheduling model for orderly charging and discharging of electric vehicles; Step 2: Based on the evaluation index determined in step 1, collect relevant data for constructing a two-layer optimization scheduling model for orderly charging and discharging of electric vehicles; Step 3: Based on the data collected in step 2, a two-layer optimization scheduling model for orderly charging and discharging of electric vehicles is established; the upper layer model takes the optimal grid operation safety as the goal, and takes battery capacity, battery expectation at the end of charging, etc. as constraints to establish the optimization model; the lower layer optimization model takes the minimum peak-to-valley difference of the grid daily load as the goal, and takes the optimal grid operation safety calculated by the upper layer optimization as the constraint to establish the optimization model; Step 4: Solve the upper model with the improved algorithm, and obtain the optimal solution of the lower model through repeated iterations, thereby optimizing the charging and discharging status of electric vehicles, and obtaining an optimization method for the safety of power grid operation and the interconnection of electric vehicle charging and discharging.

2. A method for optimizing power grid operation safety and electric vehicle charging and discharging interconnection according to claim 1, Features: The specific method of step 1 is: Considering the influencing factors of electric vehicles connecting to the power grid, the safety of power grid operation and the minimum peak-to-valley difference of daily power grid load are determined as evaluation indicators, and then a two-layer optimization scheduling model for orderly charging and discharging of electric vehicles is constructed.

3. A method for optimizing power grid operation safety and electric vehicle charging and discharging interconnection according to claim 1, Features: The data collected in step 2 to construct the electric vehicle orderly charging and discharging double-layer optimization scheduling model include: charging and discharging start time Ts, end time T f , parameters related to charge and discharge status, charge and discharge electricity prices, daily load value M in the control area of ​​the control center within time period i Li ; The charging and discharging power value M of the electric vehicle in the control time period i Ei ; Daily average load value M av .

4. A method for optimizing power grid operation safety and electric vehicle charging and discharging interconnection according to claim 1, Features: The specific steps of step 3 include: (1) The upper optimization model establishes the objective function with the goal of optimizing the safety of power grid operation: In the formula, the charge and discharge start time is Ts; the charge and discharge end time is T f ; The charge and discharge state parameter is Q 1i,j , Q 2i,j , in the charging state Q 1i,j =1,Q 2i,j =0, in the discharge state Q 1i,j =0,Q 2i,j =1, Q in idle state 1i,j =0,Q 2i,j =0; charging power is P ai ; Charging price is p ai ; The discharge power is P bi ; The discharge price is p bi ; The length of the control unit time period is Δt; The cost of battery loss at the discharge time is C d ; The constraints include: ① Vehicle battery capacity constraints: ② Expected battery constraints at the end of charging: ③ Electric vehicle charging and discharging power limit: ④ Uniqueness constraints of electric vehicle charging and discharging modes: Q 1i,j ×Q 2i,j =0 ⑤ At any time, when electric vehicles are connected to the power grid, the total load should be lower than the maximum load of the distribution network: (2) Based on the upper-level optimization of the charging and discharging scheme, the lower-level model is optimized as the objective function: The daily load value of electric vehicles in the control area during time period i is M Li ; The charging and discharging power value of the electric vehicle in the control time period i is M Ei ; The daily average load value is M av .

5. A method for optimizing power grid operation safety and electric vehicle charging and discharging interconnection according to claim 1, Features: The specific steps of step 4 include: (1) Solve the upper-level model to ensure the safety of access to the power grid; ①Let T = T 0 , initialize the system and set parameters, randomly generate an initial solution Y 0 , and calculate the initial objective function value that satisfies the security of the power grid corresponding to the initial solution; ②Let T = T 1 , and T 1 <T, reassign T to change the charge and discharge time; ③ For the current solution Y i Perturb to generate a new solution Y j , calculate the new solution Y j Corresponding to the new objective function value, the difference ΔE between the new objective function and the original objective function value is obtained; ④If ΔE<0, accept the new solution Y j As the current optimal solution; if ΔE>0, the new solution is accepted according to the Metropolis criterion; ⑤In T 1 Repeat L k Disturb and accept again, and repeat steps ③ and ④; ⑥ Determine whether T is lower than the minimum value T f If yes, the algorithm is terminated and the optimal solution that satisfies the safety of the power grid is output; if no, the algorithm jumps to step ② and changes the charging and discharging time to continue calculating the optimal solution; (2) Solving the lower model: ① Randomly initialize the transportation mode: that is, the charging and discharging mode is randomly initialized so that the initial values ​​of the individual optimal value and the global optimal value are both 0, and the charging and discharging state iteration parameters are initialized; ② Taking E as the objective function of the lower model, it means that the difference between the peak and valley of the daily load of the power grid is minimized. Calculate the value of the objective function for the charge and discharge state; ③ Determine whether the charge and discharge state has converged or whether the number of iterations has been reached. If not, update the global optimal charge and discharge method and return to the above steps. If it has converged or the number of iterations has been reached, output the optimal solution and end. (3) After extracting the charging load value for this time period, the charging and discharging status is optimized according to four categories: a. When M>M av , and there is a charging state during this time period, the optimization method is: reduce the charging state; b. When M>M av , and there is no charging state during this time period, the optimization method is: increase the discharge state; c. When M<M av , and there is a discharge state during this time period, the optimization method is: reduce the discharge state; d. When M<M av , and there is no discharge state during this time period, the optimization method is: increase the charging state.