Electric vehicle centralized charging and discharging scheduling method and system based on particle swarm optimization
By using a centralized charging and discharging scheduling method for electric vehicles based on particle swarm optimization, and by optimizing the grid load using a neural network prediction model and particle swarm algorithm, the grid problems caused by fast charging of electric vehicles are solved, and the peak shaving and valley filling of the grid load and the improvement of power quality are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-03-10
AI Technical Summary
The high charging power of fast charging stations for electric vehicles leads to overload of power grid equipment, power system losses, and power quality problems. Existing technologies are unable to effectively schedule the charging and discharging of electric vehicles to mitigate these effects.
A centralized charging and discharging scheduling method for electric vehicles based on particle swarm optimization is adopted. The expected load is predicted by a trained neural network prediction model, and the objective function is optimized by combining the particle swarm algorithm to achieve peak shaving and valley filling of the power grid load.
By accurately predicting and optimizing scheduling, the power grid load curve can be flattened, reducing grid overload, lowering losses, improving power quality, and promoting the application of clean energy.
Smart Images

Figure CN121638703A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of scheduling algorithm design and optimization technology, specifically relating to a centralized charging and discharging scheduling method and system for electric vehicles based on particle swarm optimization. Background Technology
[0002] Due to global concerns about energy shortages and environmental pollution, the automotive industry worldwide is investing heavily in the research and development and production of electric vehicles (PEVs) to address the dependence of traditional automotive technologies on fossil fuels. This actively responds to global calls for climate change and environmental protection, reduces greenhouse gas emissions, and promotes the widespread adoption of clean energy. PEVs, including plug-in hybrid electric vehicles (PHEVs) and battery electric vehicles (BEVs), form an important part of the automotive market. As the adoption rate of electric vehicles gradually increases, uncoordinated charging can lead to additional problems in the power grid. Fast charging stations are electric vehicle charging facilities that use high-voltage and high-current direct current to charge the batteries of electric vehicles, enabling them to gain a large amount of power in a relatively short time. The charging power of fast charging stations is typically much higher than that of ordinary charging stations, reaching tens to hundreds of kilowatts or even higher. The large-scale adoption of pure electric vehicles will increase load demand and generate several adverse effects, including grid equipment overload, power system losses, and power quality issues such as voltage deviation, voltage imbalance, and harmonic distortion. These effects pose new challenges to the power grid. A method for scheduling the charging and discharging of electric vehicles is needed to mitigate these adverse effects. Summary of the Invention
[0003] To overcome the shortcomings of the prior art, this invention proposes a centralized charging and discharging scheduling method for electric vehicles based on particle swarm optimization, comprising:
[0004] Based on the historical operating data of the fast charging station, a trained neural network prediction model is used to obtain the predicted expected load corresponding to the historical operating data; the fast charging station is used for centralized charging and discharging of electric vehicles.
[0005] Based on the predicted expected load, an objective function is constructed with the goal of minimizing the squared deviation between the grid load and the predicted expected load; the grid load is the sum of the grid base load demand and the load dispatch quantity.
[0006] The objective function is optimized using the particle swarm optimization algorithm to obtain the optimal load scheduling amount, which is then used as the total scheduling amount for the fast charging station, enabling centralized charging and discharging scheduling of electric vehicles.
[0007] Preferably, the step of constructing an objective function based on the predicted expected load, with the objective of minimizing the squared deviation between the grid load and the predicted expected load, includes:
[0008] Based on the relevant influencing parameters of electric vehicle charging and discharging, determine the constraints;
[0009] Based on the constraints, an objective function is constructed with the goal of minimizing the squared deviation between the grid load and the predicted expected load.
[0010] Preferably, the objective function is expressed as:
[0011] minf t stθ;
[0012] f t =(P b,t +Δp t -P target,t ) 2 fort = 1:T;
[0013] Among them, f t Let θ be the squared deviation between the grid base load demand and the expected load, θ be the constraint condition, T be the number of time intervals in a day, and P be the value of the load. b,t Let P be the base load demand of the power grid during time period t. target,t Let Δp be the predicted expected load for time period t. t Let Δp be the electric vehicle charging and discharging scheduling quantity during time period t. t A positive value indicates that charging is needed, Δp t A negative value indicates that discharge is required.
[0014] Preferably, the constraints include electric vehicle charging and discharging constraints, power flow constraints, and power grid technology constraints.
[0015] Preferably, the electric vehicle charging and discharging constraints include electric vehicle charging and discharging power constraints and electric vehicle charging state constraints;
[0016] The electric vehicle charging and discharging power constraint includes: the electric vehicle charging and discharging power is between the upper and lower limits of the charging and discharging power;
[0017] The electric vehicle charging state constraints include: the electric vehicle charging state shall not exceed the set maximum charging state, and the electric vehicle discharging state shall not be less than the set depth of discharge.
[0018] Preferably, the power grid technical constraints include power grid bus voltage constraints and power grid branch transmission power constraints;
[0019] The grid bus voltage constraint includes: the grid bus voltage is between the upper and lower voltage limits;
[0020] The power transmission power constraint of the power grid branch line includes: the power transmission power of the power grid branch line shall not exceed the maximum heat transfer power of the branch line.
[0021] Preferably, the step of using particle swarm optimization to solve the objective function and obtain the optimal load scheduling amount as the total scheduling amount of the fast charging station includes:
[0022] Electric vehicles in fast charging are treated as particles. The number of particles in the particle swarm is determined based on the number of electric vehicles in the fast charging station. Under the constraints, the position, velocity, individual optimal position, and global optimal position of each particle are initialized.
[0023] The fitness value of each particle's position is calculated based on the fitness function, and the particle's velocity and position are updated to obtain a new individual optimal position and the global optimal position of the particle swarm. The velocity and position of the particles are updated iteratively until the maximum number of iterations is reached or the change in the global optimal position is less than a set threshold. The global optimal position at this time is taken as the optimal load scheduling amount obtained by solving the objective function, and the optimal load scheduling amount is taken as the total scheduling amount of the fast charging station.
[0024] Preferably, the training process of the neural network prediction model includes:
[0025] Obtain the historical operating data of the fast charging station, including the historical load of the power grid and the historical charging and discharging power of the electric vehicles in the fast charging station;
[0026] Based on the operational data, obtain the predicted expected load that meets the peak shaving and valley filling requirements;
[0027] A dataset is generated based on operational data from multiple historical time periods and the predicted expected load corresponding to the operational data;
[0028] The dataset is divided into a training set and a test set according to a set ratio;
[0029] Based on the training set, the neural network prediction model is trained by taking the running data in the training set as input and the expected prediction load corresponding to the running data as output. An optimizer is used to optimize and update the training weights of the neural network prediction model. The neural network prediction model is evaluated during the training process using the test set until the loss function of the neural network prediction model converges, thus obtaining a trained neural network prediction model.
[0030] The neural network prediction model uses a long short-term memory network model.
[0031] Based on the same inventive concept, this invention also provides a centralized charging and discharging scheduling system for electric vehicles based on particle swarm optimization, comprising:
[0032] The prediction module is used to obtain the predicted expected load corresponding to the historical operating data of the fast charging station using a trained neural network prediction model; the fast charging station is used for centralized charging and discharging of electric vehicles.
[0033] The objective function construction module is used to construct an objective function based on the predicted expected load, with the objective of minimizing the squared deviation between the grid load and the predicted expected load; the grid load is the sum of the grid base load demand and the load dispatch quantity;
[0034] The scheduling module is used to optimize the objective function using the particle swarm optimization algorithm to obtain the optimal load scheduling amount as the total scheduling amount of the fast charging station, and to carry out centralized charging and discharging scheduling of electric vehicles.
[0035] Preferably, the objective function construction module is specifically used for:
[0036] Based on the relevant influencing parameters of electric vehicle charging and discharging, determine the constraints;
[0037] Based on the constraints, an objective function is constructed with the goal of minimizing the squared deviation between the grid load and the predicted expected load.
[0038] Preferably, the objective function is expressed as:
[0039] min f t stθ;
[0040] f t =(P b,t +Δp t -P target,t ) 2 for t=1:T;
[0041] Among them, f t Let θ be the squared deviation between the grid base load demand and the expected load, θ be the constraint condition, T be the number of time intervals in a day, and P be the value of the load. b,t Let P be the base load demand of the power grid during time period t. target,t Let Δp be the predicted expected load for time period t. t Let Δp be the electric vehicle charging and discharging scheduling quantity during time period t. t A positive value indicates that charging is needed, Δp t A negative value indicates that discharge is required.
[0042] Preferably, the constraints include electric vehicle charging and discharging constraints, power flow constraints, and power grid technology constraints.
[0043] Preferably, the electric vehicle charging and discharging constraints include electric vehicle charging and discharging power constraints and electric vehicle charging state constraints;
[0044] The electric vehicle charging and discharging power constraint includes: the electric vehicle charging and discharging power is between the upper and lower limits of the charging and discharging power;
[0045] The electric vehicle charging state constraints include: the electric vehicle charging state shall not exceed the set maximum charging state, and the electric vehicle discharging state shall not be less than the set depth of discharge.
[0046] Preferably, the power grid technical constraints include power grid bus voltage constraints and power grid branch transmission power constraints;
[0047] The grid bus voltage constraint includes: the grid bus voltage is between the upper and lower voltage limits;
[0048] The power transmission power constraint of the power grid branch line includes: the power transmission power of the power grid branch line shall not exceed the maximum heat transfer power of the branch line.
[0049] Preferably, the scheduling module is specifically used for:
[0050] Electric vehicles in fast charging are treated as particles. The number of particles in the particle swarm is determined based on the number of electric vehicles in the fast charging station. Under the constraints, the position, velocity, individual optimal position, and global optimal position of each particle are initialized.
[0051] The fitness value of each particle's position is calculated based on the fitness function, and the particle's velocity and position are updated to obtain a new individual optimal position and the global optimal position of the particle swarm. The velocity and position of the particles are updated iteratively until the maximum number of iterations is reached or the change in the global optimal position is less than a set threshold. The global optimal position at this time is used as the optimal load scheduling amount obtained by solving the objective function, and the optimal load scheduling amount is used as the total scheduling amount of the fast charging station for centralized charging and discharging scheduling of electric vehicles.
[0052] Preferably, the prediction module is further used for:
[0053] Obtain the historical operating data of the fast charging station, including the historical load of the power grid and the historical charging and discharging power of the electric vehicles in the fast charging station;
[0054] Based on the operational data, obtain the predicted expected load that meets the peak shaving and valley filling requirements;
[0055] A dataset is generated based on operational data from multiple historical time periods and the predicted expected load corresponding to the operational data;
[0056] The dataset is divided into a training set and a test set according to a set ratio;
[0057] Based on the training set, the neural network prediction model is trained by taking the running data in the training set as input and the expected prediction load corresponding to the running data as output. An optimizer is used to optimize and update the training weights of the neural network prediction model. The neural network prediction model is evaluated during the training process using the test set until the loss function of the neural network prediction model converges, thus obtaining a trained neural network prediction model.
[0058] The neural network prediction model uses a long short-term memory network model.
[0059] Based on the same inventive concept, the present invention also provides a computer device, comprising: one or more processors;
[0060] Memory, used to store one or more programs;
[0061] When the one or more programs are executed by the one or more processors, a centralized charging and discharging scheduling method for electric vehicles based on particle swarm optimization, as described above, is implemented.
[0062] Based on the same inventive concept, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, it implements the aforementioned centralized charging and discharging scheduling method for electric vehicles based on particle swarm optimization.
[0063] Compared with the closest existing technology, the present invention has the following beneficial effects:
[0064] This invention provides a centralized charging and discharging scheduling method and system for electric vehicles based on particle swarm optimization. The method includes obtaining the predicted expected load corresponding to the historical operating data of fast charging stations using a trained neural network prediction model; the fast charging stations are used for centralized charging and discharging of electric vehicles; based on the predicted expected load, an objective function is constructed with the goal of minimizing the squared deviation between the grid load and the predicted expected load; the grid load is the sum of the grid's basic load demand and the load scheduling amount; the objective function is optimized and solved using a particle swarm optimization algorithm to obtain the optimal load scheduling amount as the total scheduling amount for the fast charging stations, and then used for centralized charging and discharging scheduling of electric vehicles. This method and system preprocess the historical operating data by introducing a neural network prediction model to obtain a predicted expected load that better meets the actual situation, which helps improve the convergence speed and scheduling optimization effect of the subsequent particle swarm optimization algorithm; simultaneously, by constructing the objective function with the goal of minimizing the squared deviation between the grid load and the predicted expected load, and using a particle swarm optimization algorithm to optimize and solve the objective function, the total scheduling amount is obtained for centralized charging and discharging scheduling, which can achieve peak shaving and valley filling of the grid load curve and effectively balance the load demand of the power system. Attached Figure Description
[0065] Figure 1 A schematic diagram of a centralized charging and discharging scheduling method for electric vehicles based on particle swarm optimization provided by the present invention;
[0066] Figure 2 This is a diagram showing the arrival time distribution of PEVs used in PEV modeling in this invention.
[0067] Figure 3 This is a probability distribution diagram of the PEV battery SOC at the start of charging, used in the PEV modeling of this invention.
[0068] Figure 4 A single-line diagram of the testing system provided by this invention;
[0069] Figure 5 This is a schematic diagram of the load change curves before and after the charging and discharging scheduling optimization in this invention;
[0070] Figure 6 This is a schematic diagram of the SOC status of multiple PEVs in the fast charging station connected to bus 18 in this invention;
[0071] Figure 7 This is a schematic diagram of the voltage distribution at bus 18 in this invention;
[0072] Figure 8 A block diagram of a centralized charging and discharging scheduling system for electric vehicles based on particle swarm optimization is provided for this invention.
[0073] Figure 9 A structural diagram of a computer device provided by the present invention. Detailed Implementation
[0074] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0075] Example 1:
[0076] This invention provides a centralized charging and discharging scheduling method for electric vehicles based on particle swarm optimization, such as... Figure 1 As shown, it includes:
[0077] S1. Based on the historical operating data of the fast charging station, a trained neural network prediction model is used to obtain the predicted expected load corresponding to the historical operating data; the fast charging station is used for centralized charging and discharging of electric vehicles.
[0078] S2. Based on the predicted expected load, construct an objective function with the goal of minimizing the squared deviation between the grid load and the predicted expected load; the grid load is the sum of the grid base load demand and the load dispatch quantity;
[0079] S3. The objective function is optimized and solved using the particle swarm optimization algorithm to obtain the optimal load scheduling amount as the total scheduling amount of fast charging stations, and centralized charging and discharging scheduling of electric vehicles is carried out.
[0080] This invention preprocesses historical operating data by introducing a neural network prediction model to obtain a more realistic predicted load, which helps improve the convergence speed and scheduling optimization effect of the subsequent particle swarm optimization algorithm. Simultaneously, it constructs an objective function with the goal of minimizing the squared deviation between the grid load and the predicted expected load, and uses the particle swarm optimization algorithm to solve it. The resulting total scheduling volume is then used for centralized charging and discharging scheduling, which can achieve peak shaving and valley filling of the grid load curve, effectively balancing the load demand of the power system. Through centralized charging and discharging scheduling of electric vehicles, during peak hours, electric vehicles release stored energy to alleviate the risk of grid equipment overload, while during off-peak hours, it meets the charging needs of various grid and vehicles, further improving the stability and efficiency of the grid.
[0081] The primary objective of this invention is to achieve peak shaving and valley filling of the power grid load curve. Specifically, this invention allows electric vehicles to release their available energy storage during peak grid periods and charge during off-peak periods, provided various grid and electric vehicle constraints are met, thereby achieving the goal of grid load flattening. The optimization problem is handled using the Particle Swarm Optimization (PSO) algorithm in the MATLAB environment. Traditional PSO algorithms, when dealing with this type of problem, often rely on historical data and simple predictions, which may fail to accurately capture future load changes and demand fluctuations, thus affecting the optimization effect of the scheduling strategy. Therefore, this invention introduces a Long Short-Term Memory (LSTM) network model, which can leverage its powerful time series prediction capabilities to accurately predict grid load and electric vehicle charging demand, thereby improving the optimization effect of the PSO algorithm.
[0082] This invention aims to optimize the charging and discharging strategies of electric vehicles, achieve peak shaving and valley filling of the power grid load curve, reduce peak load, alleviate grid overload, reduce power system losses, and solve power quality problems. By optimizing charging and discharging strategies, electric vehicles can better adapt to grid demands, achieving coordinated development of the power system and electric vehicles, and promoting the widespread application of clean energy.
[0083] Considering the inherent subjectivity in constructing the expected load curve, and the limited availability of fast-charging stations for electric vehicles, the expected load curve data often deviates significantly from actual values. This slows the convergence speed of the particle swarm optimization algorithm, and the artificially generated expected load curve lacks reliability and is detached from reality. Therefore, in S1 above, we consider preprocessing historical operating data and using the LSTM model to derive a more accurate predicted expected load curve P. target First, collect historical load data P from the power grid. load (t), collect historical charging and discharging records of electric vehicles, including historical charging power P charge (t) and historical discharge power P discharge (t). Handle missing and outlier values to ensure data integrity and reliability. Extract time features and other relevant features, and standardize the data, scaling each feature value to a range with a mean of 0 and a variance of 1. Design an LSTM network structure, including an input layer, multiple LSTM layers, and an output layer. Choose an activation function (considering tanh), a loss function (considering mean squared error MSE), and an optimizer (considering Adam). Then, split the dataset into training and test sets for training and validating the neural network prediction model. Use the trained LSTM model to predict the expected load curve for future time periods that better reflects reality. Use the prediction results as input to the PSO algorithm, i.e., the expected load curve P. target This is used to optimize the charging and discharging scheduling strategy for electric vehicles.
[0084] Specifically, the training process of the aforementioned neural network prediction model includes:
[0085] Obtain historical operating data of fast charging stations, including historical grid load and historical charging and discharging power of electric vehicles in the fast charging stations;
[0086] Based on operational data, obtain the predicted expected load that meets the peak shaving and valley filling requirements;
[0087] A dataset is generated based on the operational data from multiple historical periods and the corresponding predicted expected loads.
[0088] The dataset is divided into training and testing sets according to a set ratio;
[0089] Based on the training set, the neural network prediction model is trained by taking the running data in the training set as input and the expected prediction load corresponding to the running data as output. An optimizer is used to optimize and update the training weights of the neural network prediction model. The test set is used to evaluate the neural network prediction model during the training process until the loss function of the neural network prediction model converges, and a trained neural network prediction model is obtained.
[0090] The neural network prediction model uses a long short-term memory network model.
[0091] Specifically, peak shaving and valley filling demand refers to the dispatching demand triggered when the grid load approaches or exceeds a preset warning line (usually 90% or 95% of system capacity) to prevent grid overload. When the grid load is below the economic operating line (e.g., 30% or 40% of system capacity), valley filling dispatching demand is triggered to improve grid operating efficiency and avoid energy waste.
[0092] Considering the practical limitations of parameters related to the charging and discharging of electric vehicles, constraints are introduced in S2 above to constrain the objective function, making the solution more practical. Specifically, S2 may include:
[0093] Based on the relevant influencing parameters of electric vehicle charging and discharging, determine the constraints;
[0094] Based on the constraints, an objective function is constructed with the goal of minimizing the squared deviation between the grid load and the predicted expected load.
[0095] The goal of optimizing charge / discharge scheduling is to flatten the grid load curve. Knowing the grid base load demand curve, peak shaving and valley filling can be implemented to achieve the desired load curve. The optimization task then involves minimizing the difference between the grid load curve and the predicted desired load curve by correctly scheduling PEV charging / discharging. In this embodiment, the minimization of the squared deviation between the grid load curve and the predicted desired load curve at each time point is determined based on the following equation.
[0096] The objective function is expressed as:
[0097] min f t stθ;
[0098] f t =(P b,t +Δp t -P target,t ) 2 for t=1:T;
[0099] Among them, f t Let θ be the squared deviation between the grid base load demand and the expected load, θ be the constraint condition, T be the number of time intervals in a day, and P be the value of the load. b,t Let P be the base load demand of the power grid during time period t. target,t Let Δp be the predicted expected load for time period t. t Let Δp be the electric vehicle charging and discharging scheduling quantity during time period t. t A positive value indicates that charging is needed, Δp t A negative value indicates that discharge is required.
[0100] The constraints include electric vehicle charging and discharging constraints, power flow constraints, and grid technology constraints.
[0101] Among them, power flow constraints and grid technology constraints are basically the power balance equations and grid technology limitations for each bus in the system, such as minimum and maximum voltage values and line thermal limits.
[0102] Electric vehicle charging and discharging constraints include electric vehicle charging and discharging power constraints and electric vehicle charging state constraints;
[0103] Electric vehicle charging and discharging power constraints include: the charging and discharging power of the electric vehicle is between upper and lower limits to avoid battery degradation, expressed as:
[0104] P min,ch ≤P ch ≤P max,ch ;
[0105] P min,disch ≤P disch ≤P max,disch ;
[0106] Among them, P ch ,P min,ch ,P max,ch These represent the electric vehicle charging power, the lower limit of charging power, and the upper limit of charging power, respectively; P disch ,P min,disch ,P max,disch These are the electric vehicle discharge power, the lower limit of discharge power, and the upper limit of discharge power, respectively.
[0107] This embodiment considers a maximum charging / discharging power of 4 kilowatts, which represents the typical power supply of a slow charging socket.
[0108] Electric vehicle charging state constraints include: During charging, the electric vehicle must not exceed the set maximum state of charge (SOC); during discharging, the electric vehicle must not be less than the set depth of discharge (DOD), which represents the minimum SOC. This limit can be set by the vehicle owner and is expressed as follows:
[0109] SOC PEV,min ≤SOC PEV ≤SOC PEV,max ;
[0110] Among them, SOC PEV SOC PEV,min SOC PEV,maxThese represent the electric vehicle charging state, the electric vehicle minimum charging state, and the electric vehicle maximum charging state, respectively. In this embodiment, the electric vehicle's depth of discharge (DOD) is set to 60%, which means that when the vehicle participates in vehicle-to-grid (V2G) operations, its state of charge (SOC) will not drop below 40%.
[0111] Power flow constraints include: On each bus i of the power grid, the power balance equations must satisfy:
[0112]
[0113] Among them, P i gen (t) represents the power generation of bus i at time t, P i load (t) is the load power of bus i at time t, V i (t) and V j (t) represents the voltage magnitudes of bus i and j at time t, respectively, where N is the number of bus j, and θ i (t) and θ j (t) represents the voltage phase angles of bus i and j at time t, respectively, G ij and B ij These are the conductance and susceptance between busbars i and j, respectively.
[0114] Power grid technical constraints include power grid bus voltage constraints and power transmission constraints of power grid branches;
[0115] The grid bus voltage constraint includes: on each bus i, the grid bus voltage is between the upper and lower voltage limits, expressed as:
[0116] V min ≤V i (t)≤V max ;
[0117] Among them, V min and V max These are the lower voltage limit and the upper voltage limit, respectively.
[0118] The power transmission constraint for power grid branches includes: on each branch k of the power grid, the power transmission capacity of the branch does not exceed the maximum heat transfer capacity of the branch, expressed as:
[0119]
[0120] Among them, P k (t) is the transmission power of branch k at time t. It is the maximum heat transfer power of branch k.
[0121] To accurately describe the charging and discharging behavior and battery state of electric vehicles, and thus satisfy the constraints for load management, PEV modeling is performed here. For PEV modeling, the charging start time and the initial SOC of the electric vehicle must be determined.
[0122] This embodiment uses the arrival time of the last journey as the PEV charging start time, such as... Figure 2 As shown, this time was determined based on the arrival time distribution of PEV from the 2009 National Family Travel Survey. The initial state of charge (SOC) of the battery depends on the average daily driving distance. Figure 3 The probability distribution of battery SOC at the start of charging via PEV is shown, with an average value of 50%. Depending on the action of PEV (charging or discharging), the SOC will be updated and changed at each time step according to the following equation:
[0123]
[0124] in Let η be the State of Charge (SOC), Charging Power, and Discharging Power of the nth PEV at time t. ch,n ,η disch,n Let be the charging efficiency and discharging efficiency of the nth PEV, respectively, Δt be the time interval, and E be the total battery capacity of the nth PEV. These are the charging and discharging schedules of the nth PEV at time t. Here Because a battery cannot simultaneously exhibit both charging and discharging behavior.
[0125] The aggregator at each fast charging station estimates the charging / discharging power of each PEV based on the required / available energy of the PEV and the total charging / discharging energy of the fast charging station determined by solving a previous optimization problem. The specific derivation equations are as follows:
[0126]
[0127] in, Let be the required energy, available energy, charging power, and discharging power of the nth PEV at time t, respectively. This represents the sum of the energy required by m PEVs within the fast charging station. This represents the sum of available energy for m PEVs within the fast charging station. This is the total power injected or absorbed by the fast charging station. This power distribution among PEVs is accomplished based on the inequalities in the preceding constraints.
[0128] Particle Swarm Optimization (PSO) is a computational method belonging to the category of swarm intelligence algorithms. It finds the optimal solution to a problem by simulating the social behavior of flocks of birds and schools of fish. In S3, the PSO algorithm is used to optimize the objective function, which can effectively obtain the total scheduling of fast charging stations and achieve the goal of flattening the power grid load.
[0129] Specifically, when using the particle swarm optimization algorithm to solve the objective function in S3, it can include: treating electric vehicles in fast charging as particles, determining the number of particles in the particle swarm based on the number of electric vehicles in the fast charging station, and initializing the position, velocity, individual optimal position, and global optimal position of each particle under the constraints of the constraints.
[0130] The fitness value of each particle's position is calculated based on the fitness function. The particle's velocity and position are updated to obtain the new individual optimal position and the global optimal position of the particle swarm. The particle's velocity and position are updated iteratively until the maximum number of iterations is reached or the change in the global optimal position is less than a set threshold. The global optimal position at this time is used as the optimal load scheduling amount obtained by solving the objective function. The optimal load scheduling amount is used as the total scheduling amount of the fast charging station.
[0131] Specifically, in PSO, based on the fitness value calculated for each particle, the individual optimal position, global optimal position, particle velocity, and new position are estimated according to the equations, expressed as:
[0132]
[0133]
[0134] x K+1 =x K +v K+1 ;
[0135] Among them, xpbest K+1 xpbest K These are the Kth and K+1th iteration results of the particle's optimal solution, respectively. K This represents the result of the Kth iteration at the globally optimal position. K x K+1 These are the results of the Kth and (K+1)th iterations, respectively, showing the particle position. K and v K+1 and are the particle velocities at the Kth and K+1th iterations, respectively. w is the inertia weight, c1 and c2 are two learning factors, and r1 and r2 are two uniformly distributed random numbers.
[0136] Particle Swarm Optimization (PSO) is an optimization algorithm based on swarm intelligence. It simulates the behavior of biological groups such as flocks of birds and schools of fish to find the optimal solution. PSO finds the global optimum by moving a swarm of "particles" through the search space. The basic steps of the algorithm are as follows:
[0137] Initialization: Define the size of the particle swarm, which in this case refers to the number of PEVs (m) in the fast charging station. Initialize the initial position and velocity of each particle. Position is represented by x. n The velocity is expressed as v n Initialize the individual optimal position xpbest for each particle. n and the global best position xgbest n .
[0138] Fitness evaluation: Calculate the fitness value of each particle at its current position based on the fitness function f(x), and update the particle's velocity and position, specifically according to the following formula:
[0139]
[0140] x K+1 =x K +v K+1 ;
[0141] Termination condition: If the termination condition is met, i.e., the maximum number of iterations is reached or the change in the global optimum position is less than a certain threshold, the algorithm stops, and the global optimum position is xgbest. n If it is the optimal solution to the objective function, then return to the fitness evaluation step; otherwise, return to the fitness evaluation step.
[0142] To provide an efficient solution for the coordinated development of electric vehicles and power systems, promote sustainable energy development, and verify the effectiveness of scheduling algorithms on real power systems, this embodiment also includes simulation testing. Specifically, the IEEE 33 bus distributed testing system is used to evaluate the algorithm performance in different case studies. Simulation results show that the algorithm can successfully achieve the goal of flattening the grid baseload while simultaneously satisfying various constraints.
[0143] The charge / discharge scheduling method in this embodiment is applied to Figure 4 The diagram shows an IEEE 33 bus power distribution test system. The system consists of 33 buses and 32 branches, with a basic power of 100MVA and a voltage of 12.66KV. The active power consumption of the test system is 3715kW, and the reactive power is 2300Kvar. Three fast charging stations are connected to buses 18, 21, and 30. Each fast charging station has a load capacity of 100 PEVs. Assume the PEV's battery capacity is 24kWh and the maximum charging / discharging power is 4kW.
[0144] MATLAB simulations can verify the feasibility of particle swarm optimization technology in electric vehicle scheduling algorithms. It can initially achieve the effects of rapid peak shaving and dynamic allocation of load power at fast charging stations, which has practical significance.
[0145] To demonstrate the effectiveness of the proposed algorithm, the optimized grid load curve was compared with the base load curve, as follows: Figure 5 As shown, the optimized power grid load curve is more stable, the peak-to-valley difference is significantly reduced, and the optimized result is close to the predicted expected load curve.
[0146] exist Figure 6 The diagram shows the SOC curves of the PEV batteries connected to the fast charging stations on bus 18. The straight line at the start of the simulation represents the initial SOC of the battery, during which the PEV does not charge or discharge. During peak hours, the PEV's SOC begins to decrease as each fast charging station injects discharge power to achieve peak shaving. It is important to note that only vehicles with an SOC above 40% participate in peak shaving during peak hours. Furthermore, it can be observed that the DOD limit is met (because no vehicle's emissions are below the 40% limit). During off-peak hours, each fast charging station will begin to draw power from the grid to meet the target load curve. Therefore, the PEV's SOC increases and approaches its maximum limit (100%, which is the required final SOC) at 7:00 (the end of the off-peak period).
[0147] The voltage distribution at bus 18 is as follows Figure 7 As shown. Considering the peak time t = 20:00, in the case of disordered charging, it can be noted that the voltage reaches 0.88 pu, which violates the lower bound of 0.9. On the other hand, by optimizing the charge and discharge scheduling through the particle swarm optimization algorithm, the voltage is kept within acceptable limits, and the voltage value variation is small. For example, in the case of disordered charging, the voltage at bus 18 varies between 0.88 and 0.96 pu, while in the case of smart charging guided by the optimization algorithm, the voltage varies between 0.91 and 0.95 pu. Furthermore, in the case of smart charging guided by the optimization algorithm, the voltage during the peak period is higher than the basic case because power is injected by PEV during this period. For example, the voltage of bus 18 at 20:00 increases from 0.9 pu to 0.91 pu.
[0148] This invention, considering the rapid development of fast charging stations and the impact of instantaneous changes in charging load on the power grid, aims to address the potential negative impacts of electric vehicles on the power grid and achieve peak shaving and valley filling of the power grid load curve through intelligent scheduling. By introducing an LSTM model for data preprocessing, this invention further improves the algorithm's prediction accuracy and scheduling optimization effect. The specific effects of this invention are as follows:
[0149] (1) Environmental friendliness and sustainability: This invention is applied to the intelligent charging and discharging scheduling of electric vehicles (EVs), which helps to realize the widespread application of clean energy. With global concerns about energy shortages and environmental pollution, this invention optimizes the charging and discharging behavior of electric vehicles, enabling clean energy to be more effectively integrated into the power system, thereby helping to reduce greenhouse gas emissions and conforming to national and global environmental protection policies.
[0150] (2) Power Grid Load Balancing and Peak Shaving: By employing particle swarm optimization and combining it with an LSTM model for expected load forecasting, this invention can achieve peak shaving and valley filling of the power grid load curve, effectively balancing the load demand of the power system. During peak hours, electric vehicles release stored energy to alleviate the risk of power grid equipment overload, while during off-peak hours, it meets the charging needs of various power grids and vehicles, further improving the stability and efficiency of the power grid.
[0151] (3) Mitigation of Distribution Network Problems: The widespread adoption of electric vehicles may lead to additional problems in the distribution network, such as equipment overload, power system losses, voltage deviation, voltage imbalance, and harmonic distortion. This invention helps to mitigate these problems, improve power quality, and ensure the reliability and stability of the power grid by optimizing charging and discharging scheduling.
[0152] (4) Multiple services provided: By utilizing the contribution of vehicles to the power grid through PEV intelligent charging scheduling, this invention enables vehicles to provide multiple services such as peak shaving, load balancing, voltage regulation, and frequency regulation, further expanding the application field of electric vehicles, improving their social and economic value, and providing support for the establishment of new energy sources and more complex scheduling and allocation combined with energy storage technology.
[0153] (5) Superior Algorithm Performance: On the one hand, this invention employs a particle swarm optimization algorithm, which excels in both global search and local optimization, effectively handling complex optimization problems. Simultaneously, an LSTM model is introduced for data preprocessing to ensure its reliability and efficiency in actual power systems, achieving more accurate and reliable peak-shaving and valley-filling of the power grid load curve. This ensures improved robustness and efficiency in addressing various challenges in intelligent charging and discharging scheduling of electric vehicles. On the other hand, the algorithm's performance is evaluated through different case studies on the IEEE 33 bus distributed test system, and simulation verification considers the complexities of actual engineering scenarios. The results show that the algorithm can successfully achieve the goal of flattening the power grid load, effectively mitigating power grid overload problems, improving power quality, and satisfying various constraints. This demonstrates the feasibility and superior performance of this invention in practical applications.
[0154] Overall, the application effect of this invention is significant, and it is expected to provide an effective solution for the coordinated development of electric vehicles and power systems, achieving the goals of sustainable energy development and a clean environment.
[0155] Example 2:
[0156] Based on the same inventive concept, this invention also provides a centralized charging and discharging scheduling system for electric vehicles based on particle swarm optimization, such as... Figure 8 As shown, it includes:
[0157] The prediction module is used to obtain the predicted expected load corresponding to the historical operating data of the fast charging station using a trained neural network prediction model; the fast charging station is used for centralized charging and discharging of electric vehicles.
[0158] The objective function construction module is used to construct an objective function based on the predicted expected load, with the objective of minimizing the squared deviation between the grid load and the predicted expected load; the grid load is the sum of the grid base load demand and the load dispatch quantity;
[0159] The scheduling module is used to optimize the objective function using the particle swarm optimization algorithm to obtain the optimal load scheduling amount as the total scheduling amount for fast charging stations, and to carry out centralized charging and discharging scheduling of electric vehicles.
[0160] The objective function building module is specifically used for:
[0161] Based on the relevant influencing parameters of electric vehicle charging and discharging, determine the constraints;
[0162] Based on the constraints, an objective function is constructed with the goal of minimizing the squared deviation between the grid load and the predicted expected load.
[0163] The objective function is expressed as:
[0164] min f t stθ;
[0165] f t =(P b,t +Δp t -P target,t ) 2 for t=1:T;
[0166] Among them, f t Let θ be the squared deviation between the base load demand and the expected load of the power grid, θ be the constraint, T be the number of time intervals in a day, and P be the value of P. b,t Let P be the base load demand of the power grid during time period t. target,t Let Δp be the predicted expected load for time period t. t Let Δp be the electric vehicle charging and discharging scheduling quantity during time period t. t A positive value indicates that charging is needed, Δp t A negative value indicates that discharge is required.
[0167] The constraints include electric vehicle charging and discharging constraints, power flow constraints, and grid technology constraints.
[0168] Electric vehicle charging and discharging constraints include electric vehicle charging and discharging power constraints and electric vehicle charging state constraints;
[0169] Electric vehicle charging and discharging power constraints include: the charging and discharging power of electric vehicles is between the upper and lower limits of the charging and discharging power;
[0170] The charging state constraints for electric vehicles include: when charging, the electric vehicle shall not exceed the set maximum charging state, and when discharging, the electric vehicle shall not be less than the set depth of discharge.
[0171] Power grid technical constraints include power grid bus voltage constraints and power transmission constraints of power grid branches;
[0172] The grid bus voltage constraint includes: the grid bus voltage is between the upper and lower voltage limits;
[0173] The power transmission constraints of power grid branches include: the power transmission of power grid branches shall not exceed the maximum heat transfer power of the branch.
[0174] The scheduling module is specifically used for:
[0175] Treating electric vehicles in fast charging as particles, the number of particles in the particle swarm is determined based on the number of electric vehicles in the fast charging station. Under the constraints, the position, velocity, individual optimal position, and global optimal position of each particle are initialized.
[0176] The fitness value of each particle's position is calculated based on the fitness function, and the particle's velocity and position are updated to obtain the new individual optimal position and the global optimal position of the particle swarm. The velocity and position of the particles are updated iteratively until the maximum number of iterations is reached or the change in the global optimal position is less than a set threshold. The global optimal position at this time is used as the optimal load scheduling amount obtained by solving the objective function. The optimal load scheduling amount is used as the total scheduling amount of the fast charging station for centralized charging and discharging scheduling of electric vehicles.
[0177] The prediction module is also used for:
[0178] Obtain historical operating data of fast charging stations, including historical grid load and historical charging and discharging power of electric vehicles in the fast charging stations;
[0179] Based on operational data, obtain the predicted expected load that meets the peak shaving and valley filling requirements;
[0180] A dataset is generated based on the operational data from multiple historical periods and the corresponding predicted expected loads.
[0181] The dataset is divided into training and testing sets according to a set ratio;
[0182] Based on the training set, the neural network prediction model is trained by taking the running data in the training set as input and the expected prediction load corresponding to the running data as output. An optimizer is used to optimize and update the training weights of the neural network prediction model. The test set is used to evaluate the neural network prediction model during the training process until the loss function of the neural network prediction model converges, and a trained neural network prediction model is obtained.
[0183] The neural network prediction model uses a long short-term memory network model.
[0184] Example 3
[0185] like Figure 9 As shown, the present invention also provides an electronic device, which may be a computer device, a microcontroller device, a smart mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, processor, and transceiver component are connected via a bus; the memory can be used to store executable programs, and an exemplary executable program may include instructions; the processor is used to execute the instructions stored in the memory. The memory can also be used to store data, which can be accessed and / or modified when instructions are executed.
[0186] The processor may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and it is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions in the storage medium to realize the corresponding method flow or corresponding function, so as to realize the steps of the centralized charging and discharging scheduling method for electric vehicles based on particle swarm optimization in the above embodiments.
[0187] Example 4
[0188] Based on the same inventive concept, this invention also provides a readable storage medium, specifically an electronic device readable storage medium (Memory). This readable storage medium is a memory device within an electronic device used to store programs and data. It is understood that the storage medium here can include both built-in storage media within the electronic device and extended storage media supported by the electronic device. The storage medium provides storage space, which stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more executable programs (including program code). It should be noted that the storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. Loading and executing one or more instructions stored in the storage medium by the processor can implement the steps of the particle swarm optimization-based centralized charging and discharging scheduling method for electric vehicles in the above embodiments.
[0189] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0190] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0191] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.
[0192] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0193] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit its scope of protection. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that after reading the present invention, they can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the application, but these changes, modifications or equivalent substitutions are all within the scope of protection of the claims of the present invention.
Claims
1. A centralized charging and discharging scheduling method for electric vehicles based on particle swarm optimization, characterized in that, The method comprises the following steps: Based on the historical operation data of the fast charging station, a trained neural network prediction model is used to obtain the predicted expected load corresponding to the historical operation data; The fast charging station is used for centralized charging and discharging of electric vehicles; Based on the predicted expected load, a target function is constructed to minimize the square deviation between the grid load and the predicted expected load; the grid load is the sum of the basic load demand and the load scheduling quantity of the grid; The particle swarm optimization algorithm is used to optimize and solve the target function to obtain the optimal load scheduling quantity as the scheduling total quantity of the fast charging station for centralized charging and discharging of electric vehicles.
2. The method of claim 1, wherein, The target function is constructed based on the predicted expected load to minimize the square deviation between the grid load and the predicted expected load, which comprises: According to the electric vehicle charging and discharging related influence parameters, the constraint condition is determined; Based on the constraint condition, a target function is constructed to minimize the square deviation between the grid load and the predicted expected load.
3. The method of claim 2, wherein, The target function is expressed as: minf t s.t.θ; f t = (P b,t + Δp t - P target,t ) 2 fort = 1 :T; where f t is the squared deviation between the grid base load demand and the expected load, θ is the constraint, T is the number of time intervals in a day, P b,t is the grid base load demand at time t, P target,t is the predicted expected load at time t, Δp t is the electric vehicle charging and discharging schedule at time t, Δp t is positive indicating that charging is needed, Δp t is negative indicating that discharging is needed.
4. The method of claim 2 or 3, wherein, The constraint condition includes electric vehicle charging and discharging constraints, power flow constraints and grid technology constraints.
5. The method of claim 4, wherein, The electric vehicle charging and discharging constraints include electric vehicle charging and discharging power constraints and electric vehicle charging state constraints; The electric vehicle charging and discharging power constraints include that the electric vehicle charging and discharging power is between the upper and lower limits of the charging and discharging power; The electric vehicle charging state constraints include that the electric vehicle charging state is not more than the set maximum state of charge when charging, and not less than the set depth of discharge when discharging.
6. The method of claim 4, wherein, The grid technology constraints include grid bus voltage constraints and grid branch transmission power constraints; The grid bus voltage constraints include that the grid bus voltage is between the upper and lower limits of the voltage; The grid branch transmission power constraints include that the grid branch transmission power is not more than the maximum thermal transmission power of the branch.
7. The method of claim 4, wherein, The particle swarm optimization algorithm is used to optimize and solve the target function to obtain the optimal load scheduling quantity as the scheduling total quantity of the fast charging station, which comprises: The electric vehicle in the fast charging station is regarded as a particle, the number of particles in the particle swarm is determined according to the number of electric vehicles in the fast charging station, and the position, speed, individual best position and global best position of each particle are initialized under the constraint of the constraint condition; The fitness value of the position of each particle is calculated according to the fitness function, the speed and position of the particle are updated, the new individual best position and global best position of the particle swarm are obtained, and the speed and position of the particle are iteratively updated until the maximum iteration number is reached or the change of the global best position is less than a set threshold value. The global best position at this time is taken as the optimal load scheduling quantity obtained by solving the target function, and the optimal load scheduling quantity is taken as the scheduling total quantity of the fast charging station.
8. The method of claim 1, wherein, The training process of the neural network prediction model comprises: Obtaining the operation data of the fast charging station in the historical period, the operation data including the historical load of the grid and the historical charging and discharging power of the electric vehicles in the fast charging station; Based on the operation data, the predicted expected load meeting the peak load shifting demand is obtained; Based on the operation data of multiple historical periods and the predicted expected load corresponding to the operation data, a data set is generated; The data set is divided into a training set and a test set according to a set proportion; Based on the training set, the running data in the training set is taken as input, and the predicted expected load corresponding to the running data is taken as output, the neural network prediction model is trained, the training weight of the neural network prediction model is updated by using an optimizer, the neural network prediction model in the training process is evaluated by using the test set, and the training of the neural network prediction model is stopped until the loss function of the neural network prediction model converges, so as to obtain a trained neural network prediction model; The neural network prediction model adopts a long short-term memory network model.
9. A centralized charging and discharging scheduling system for electric vehicles based on particle swarm optimization, characterized in that, Comprise: A prediction module is configured to obtain a predicted expected load corresponding to historical running data of a fast charging station by using a trained neural network prediction model based on the historical running data of the fast charging station; The fast charging station is used for centralized charging and discharging of electric vehicles; A target function construction module is configured to construct a target function based on the predicted expected load, and minimize the square deviation between the power grid load and the predicted expected load as a target; A scheduling module is configured to optimize and solve the target function by using a particle swarm algorithm, obtain an optimal load scheduling quantity as a total scheduling quantity of the fast charging station, and perform centralized charging and discharging scheduling of electric vehicles.
10. The system of claim 9, wherein, The target function construction module is specifically configured to: Determine a constraint condition according to electric vehicle charging and discharging related influence parameters; Construct a target function based on the constraint condition, and minimize the square deviation between the power grid load and the predicted expected load as a target.