Electric vehicle and power grid game orderly charging method and system based on DBO algorithm
By using DBO algorithm for optimization scheduling in the game between electric vehicles and the power grid, the problem of overload of the power grid during peak charging is solved, the orderly charging of electric vehicles and the stability of the grid load is achieved, and the charging cost and equipment maintenance cost are reduced.
Patent Information
- Application Number
- CN202411869125.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-04
AI Technical Summary
As the number of electric vehicles increases, the power grid may experience insufficient power supply or overload during peak charging periods, affecting the stability and safety of the power grid.
The orderly charging method of electric vehicles and power grid game based on DBO algorithm is adopted, and the orderly charging of electric vehicles is achieved by establishing a master-slave game model and optimizing the scheduling using the DBO algorithm.
It improves the stability of the grid load, reduces the charging cost of electric vehicles, and realizes orderly charging of electric vehicles. The optimized grid load curve is smoother, reducing the investment and maintenance costs of grid equipment.
Smart Images

Figure CN119765499A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric vehicle charging guidance strategies, and in particular to a method and system for orderly charging of electric vehicles and power grids based on a DBO algorithm. Background Art
[0002] With the rapid development of electric vehicles, the combination of smart grids and renewable energy has gradually become an important trend in the energy field. Since the travel patterns determined by the living and working habits of car owners largely affect the time and space for electric vehicle charging, a large number of electric vehicles have formed random and disordered charging characteristics without guidance. When the number of electric vehicles reaches a certain scale, there will be a large-scale charging demand. At this time, the power grid may experience insufficient power supply or overload, which will affect the stability and security of the power grid.
[0003] Therefore, it is necessary to provide a new DBO algorithm-based orderly charging method and system for electric vehicles and power grids. Summary of the invention
[0004] Based on the above problems existing in the prior art, the purpose of the embodiments of the present invention is to provide an orderly charging method and system for electric vehicles and power grids based on the DBO algorithm. By establishing a master-slave game model and using the DBO algorithm to solve it, the load stability of the power grid is improved, the charging cost of electric vehicles is reduced, and orderly charging of electric vehicles is achieved. .
[0005] To achieve the above purpose, the technical solution adopted by the present invention is: an orderly charging method of electric vehicles and power grids based on DBO algorithm, comprising:
[0006] S1, collecting charging data of electric vehicles and preprocessing the charging data to obtain a target charging data set;
[0007] S2, using k-means++ algorithm to cluster the target charging data set to obtain different categories of electric vehicles;
[0008] S3, establish a master-slave game model with the power grid as the main body and electric vehicles as the slaves;
[0009] S4, uses the DBO algorithm to solve the game model and realize the orderly charging of electric vehicles.
[0010] Furthermore, in S1, the collecting charging data of the electric vehicle and preprocessing the charging data include:
[0011] Step S11, collecting charging data of electric vehicle charging piles in a region to obtain an initial charging data set;
[0012] Step S12, cleaning the initial charging data set to obtain a first charging data set;
[0013] Step S13: using the Min-Max method to perform standardization processing on the first charging data set to obtain a target charging data set.
[0014] Furthermore, in S2, the target charging data set is clustered using the k-means++ algorithm to obtain different categories of electric vehicles, including:
[0015] Step S21, select the initial cluster center C j ;
[0016] Step S22, for data point x i , calculate the data point x i To cluster center C j distance;
[0017] Step S23, selecting a more appropriate cluster center according to a probability formula;
[0018] Step S24, repeating steps S22 and S23 until K cluster centers are generated;
[0019] Step S25, determining whether the cluster center no longer changes, if so, outputting the clustering result, otherwise, returning to step S21.
[0020] Furthermore, the calculation data point x i To cluster center C j The distance calculation formula is:
[0021]
[0022] Among them, D(x i ) is the data point x i To cluster center C j The distance (a i ,b i ) is the data point x i The coordinates of j ,b j ) is the cluster center C j The coordinates of
[0023] The more appropriate cluster center C' j The calculation formula is:
[0024]
[0025] Among them, C' j For a more appropriate cluster center, D(x i ) is the data point x iTo cluster center C j The distance, S j is the cumulative value of the Euclidean distance, x i is the charging data point of the i-th label after standardization, and X is the set of data points.
[0026] Furthermore, in S2, the establishment of a master-slave game model with the power grid as the main body and the electric vehicle as the slave body includes:
[0027] Step S31, establishing an objective function with the power grid as the main body, that is, the equivalent load variance after the electric vehicle is connected to the power grid;
[0028] Step S32, establishing an objective function with the electric vehicle cluster as a slave, that is, the electricity cost of the electric vehicle cluster;
[0029] Step S33, setting constraints of the master-slave game;
[0030] Step S34, establishing a master-slave game model with one master and multiple slaves;
[0031] Step S35, setting the judgment basis of the master-slave game equilibrium.
[0032] Furthermore, the calculation formula of the objective function with the power grid as the main body is:
[0033]
[0034] Among them, F G is the objective function of the power grid game subject; P before,t To optimize the grid load after electric vehicles are connected at time t, P avg is the average value of equivalent load, P grid,t is the grid base load before electric vehicles are connected to the grid at time t, P EVkt is the total charging load of the k-th electric vehicle at time t;
[0035] The objective function calculation formula with the electric vehicle cluster as the slave is:
[0036] f EV =C EV +C f
[0037]
[0038] Among them, F EV is the objective function of the electric vehicle cluster game slave, C EV is the charging cost of the electric vehicle cluster at time t, C f is the energy loss cost of the electric vehicle cluster at time t, P EV,k,tis the total charging load of the k-th electric vehicle at time t, W t is the time-of-use electricity price at time t, η c is the charging efficiency; W f,t is the price of electric energy loss in electric vehicles.
[0039] The master-slave game model with one master and multiple slaves is:
[0040]
[0041] Among them, {G,EV1,EV2,...EV K} is the set of game participants, G is the power grid, EV1, EV2, ..., EV K For different types of electric vehicle clusters, {δ G (W t )} is the strategy set of charging electricity price in each period of the upper power grid, C t is the electricity price at time t, is the strategy set of charging power of each cluster of lower-level follower electric vehicles, P EV,1,t ,P EV,2,t ,...,P EV,K,t is the charging power of different electric vehicle clusters at time t, is the objective function set of the game participants, F G is the objective function of the power grid, is the objective function of different electric vehicle clusters.
[0042] Furthermore, in S4, the DBO algorithm is used to solve the game model to achieve orderly charging of electric vehicles, including:
[0043] Step S41, inputting parameters related to the power grid and the electric vehicle;
[0044] Step S42, inputting the main parameters of the DBO algorithm;
[0045] Step S43, initializing the population;
[0046] Step S44, updating the position of the dung beetle in the rolling stage;
[0047] Step S45, determining the optimal breeding area and updating the current optimal position;
[0048] Step S46, determining the optimal foraging area and updating the position of the mantis larva;
[0049] Step S47, updating the position of the thief in the population;
[0050] Step S48, determine whether the game equilibrium is satisfied, if so, output the load variance and charging cost after the game, otherwise return to step S43 to continue the calculation.
[0051] Furthermore, the rolling ball stage includes straight-line rolling ball behavior and dancing rolling ball behavior;
[0052] The calculation formula for the straight-line rolling ball behavior is:
[0053]
[0054] Among them, t is the number of iterations, x i (t) is the position of dung beetle individual i at the tth iteration, x i (t+1) is the position of dung beetle individual i at the t+1th iteration, x i (t-1) is the position of dung beetle individual i at the t-1th iteration, a is the natural coefficient, k is the deflection coefficient, b is a random number in [0,1], X wo is the global worst position, Δx is the change in light intensity;
[0055] The calculation formula of the dance rolling ball behavior is:
[0056] x i (t+1)=x i (t)+tanθ|x i (t)-x i (t-1)|
[0057] Among them, t is the number of iterations, x i (t) is the position of dung beetle individual i at the tth iteration, x i (t+1) is the position of dung beetle individual i at the t+1th iteration, x i (t-1) is the position of dung beetle individual i at the t-1th iteration, θ is the disturbance angle, θ∈[0,π].
[0058] Further, the determining of the optimal breeding area and updating the current optimal position includes:
[0059] The boundary selection strategy for the spawning area is:
[0060]
[0061] R=1-t / T max
[0062] Among them, U * is the upper boundary of the spawning area, L * is the lower boundary of the spawning area, X * is the current optimal spawning position, U is the upper boundary of the search area, L is the lower boundary of the search area, R is the iteration progress coefficient, t is the number of iterations, T max is the maximum number of iterations;
[0063] The formula for the position change of dung beetle eggs is:
[0064]
[0065] Among them, B i (t+1) is the position of egg i at the t+1th iteration, X wo is the global worst position, B i (t) is the position of egg ball i at the tth iteration; b1 and b2 are two independent random vectors of 1×N, L * is the lower boundary of the spawning area, U * The upper boundary of the spawning area.
[0066] The electric vehicle and power grid game orderly charging system based on the DBO algorithm is applied to the electric vehicle and power grid game orderly charging method based on the DBO algorithm, and the system includes:
[0067] A data set acquisition module is used to collect charging data of electric vehicles and pre-process the charging data to obtain a target charging data set;
[0068] The data set clustering module is used to cluster the target charging data set using the k-means++ algorithm to obtain different categories of electric vehicles;
[0069] Modeling module, used to establish a master-slave game model with the power grid as the main body and electric vehicles as the slaves
[0070] The algorithm solving module is used to solve the game model using the DBO algorithm, thereby realizing the orderly charging of electric vehicles.
[0071] The beneficial effects of the present invention are as follows: the DBO algorithm-based orderly charging method of electric vehicles and power grids comprises: collecting charging data of electric vehicles and preprocessing the charging data to obtain a target charging data set; clustering the target charging data set using a k-means++ algorithm to obtain different categories of electric vehicles; establishing a master-slave game model with the power grid as the main body and the electric vehicles as the slaves; and solving the game model using the DBO algorithm to achieve orderly charging of electric vehicles. The electric vehicle and power grid game orderly charging method based on the DBO algorithm of the present invention establishes an objective function with the power grid as the main body and adopts the DBO algorithm for optimization and scheduling, so that the fluctuation of the power grid load is effectively controlled, which is beneficial to the stable operation of the power grid; the optimized power grid load curve is smoother, achieving the effect of peak shaving and valley filling, helping to improve the utilization rate of power grid equipment and reduce the investment and maintenance costs of power grid equipment; the charging strategy is optimized by the algorithm, so that the owner can choose a more economical time period for charging when charging; the orderly charging of the electric vehicle is achieved by collecting, preprocessing, and clustering the charging data of the electric vehicle, establishing a master-slave game model, and adopting the DBO algorithm for optimization and scheduling; the DBO algorithm takes into account global exploration and local development by simulating various behaviors of dung beetles, and has the characteristics of fast convergence speed and high solution accuracy, so that the effect of orderly charging is more significant, and a win-win strategy for the power grid and the electric vehicle can be found quickly and accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0073] In the figure:
[0074] Figure 1 A flow chart of an orderly charging method for an electric vehicle and a power grid based on a DBO algorithm provided in Embodiment 1 of the present invention;
[0075] Figure 2 A schematic diagram of the k-means++ clustering results of electric vehicles provided in the first embodiment of the present invention;
[0076] Figure 3 A line graph of power grid load before and after DBO optimization provided in the first embodiment of the present invention;
[0077] Figure 4 A schematic diagram of a module of an orderly charging system for electric vehicles and power grids based on a DBO algorithm provided in the second embodiment of the present invention;
[0078] Figure 5 It is a structural diagram of a network-side server provided according to a third embodiment of the present invention. DETAILED DESCRIPTION
[0079] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0080] First embodiment:
[0081] The first embodiment of the present invention provides an orderly charging method of electric vehicles and power grid based on the DBO algorithm, including: collecting charging data of electric vehicles and preprocessing the charging data to obtain a target charging data set; clustering the target charging data set using the k-means++ algorithm to obtain different categories of electric vehicles to establish a master-slave game model with the power grid as the main body and the electric vehicles as the slaves; using the DBO algorithm to solve the game model to achieve orderly charging of electric vehicles. The orderly charging method of electric vehicles and power grid based on the DBO algorithm of the present invention improves the load stability of the power grid, reduces the charging cost of electric vehicles, and achieves orderly charging of electric vehicles by establishing a master-slave game model and using the DBO algorithm to solve it.
[0082] The following is a detailed description of the implementation details of the orderly charging method of the electric vehicle and the power grid based on the DBO algorithm in this embodiment. The following content is only for the convenience of understanding the implementation details, which is not necessary for the implementation of this solution. The specific process of this embodiment is as follows: Figure 1 As shown, this implementation is applied to an orderly charging system of electric vehicles and power grids based on the DBO algorithm.
[0083] Step S1, collecting charging data of the electric vehicle and preprocessing the charging data to obtain a target charging data set.
[0084] Specifically, the specific steps of collecting the charging data of the electric vehicle and preprocessing the charging data to obtain the initial charging data set include:
[0085] Step S11, collecting charging data of electric vehicle charging piles in an area to obtain an initial charging data set.
[0086] Specifically, the initial data set includes charging start time, charging end time, charging duration, charging energy and charging power.
[0087] Step S12, cleaning the initial charging data set to obtain a first charging data set.
[0088] Specifically, data cleaning of the initial charging data set includes: deleting the charging time, charging energy and charging power that exceed the standard value, and deleting invalid data with missing user ID or GPS.
[0089] Among them, the values exceeding the standard are lower or higher than the maximum values of battery capacity, charger power and charging pile output power popular on the market.
[0090] Step S13: using the Min-Max method to perform standardization processing on the first charging data set to obtain a target charging data set.
[0091] Specifically, the calculation formula of the Min-Max method is:
[0092]
[0093] in, is the charging data of the ith tag before normalization, x i is the charging data point of the i-th tag after standardization, i = 1, 2, 3, ..., N, N is the number of collected tags; is the original charging data of the jth user, and n is the number of data points, i.e., the number of electric vehicles.
[0094] In this embodiment, N=5, n=800.
[0095] Step S2, using the k-means++ algorithm to cluster the target charging data set to obtain different categories of electric vehicles.
[0096] Specifically, the specific steps of clustering the target charging data set using the k-means++ algorithm to obtain different categories of electric vehicles include:
[0097] Step S21, select the initial cluster center C j .
[0098] Specifically, the initial cluster center C j To randomly select a few data points from the dataset.
[0099] Step S22, for data point x i , calculate the data point x i To cluster center C j distance.
[0100] Specifically, calculate the data point x i To cluster center C j The distance calculation formula is:
[0101]
[0102] Among them, D(xi ) is the data point x i To cluster center C j The distance (a i ,b i ) is the data point x i The coordinates of j ,b j ) is the cluster center C j The coordinates of .
[0103] Step S23, selecting a more appropriate cluster center according to the probability formula.
[0104] Specifically, a more appropriate cluster center C' j The calculation formula is:
[0105]
[0106] Among them, C' j For a more appropriate cluster center, D(x i ) is the data point x i To cluster center C j The distance, S j is the cumulative value of the Euclidean distance, x i is the charging data point of the i-th label after standardization, and X is the set of data points.
[0107] Step S24, repeating steps S22 and S23 until K cluster centers are generated.
[0108] Specifically, the two operations of calculating the distance in step S22 and selecting a more appropriate cluster center in step S23 are continuously repeated, and each cycle is an optimization and adjustment process of the cluster center until K cluster centers are finally generated. With the continuous repetition of steps S22 and S23, the cluster center will continue to approach the ideal position corresponding to the real distribution of the data, making the cluster division more and more accurate and more in line with the inherent similarity and difference laws of the data.
[0109] Step S25, determining whether the cluster center no longer changes, if so, outputting the clustering result, otherwise, returning to step S21.
[0110] Specifically, it is determined whether the cluster center no longer changes. If the cluster center no longer changes, the clustering result is output; if the cluster center still changes, the process returns to step S21.
[0111] Step S3, establishing a master-slave game model with the power grid as the main body and the electric vehicles as the slaves.
[0112] Specifically, the specific steps of establishing a master-slave game model with the power grid as the main body and the electric vehicles as the slaves include:
[0113] Step S31, establishing an objective function with the power grid as the main body, that is, the equivalent load variance after the electric vehicle is connected to the power grid.
[0114] Specifically, the objective function of the grid game subject is the equivalent load variance after the electric vehicle is connected to the grid. The equivalent load variance reflects the fluctuation of the grid load. The grid hopes to optimize the scheduling to make the grid load as stable as possible after the electric vehicle is connected, and reduce the load fluctuation caused by the charging of electric vehicles.
[0115] The calculation formula of the objective function with the power grid as the main body is:
[0116]
[0117] Among them, F G is the objective function of the power grid game subject; P before,t To optimize the grid load after electric vehicles are connected at time t, P avg is the average value of equivalent load, P grid,t is the grid base load before electric vehicles are connected to the grid at time t, P EV,k,t is the total charging load of the kth electric vehicle at time t.
[0118] Step S32, establishing an objective function with the electric vehicle cluster as a slave, that is, the electricity cost of the electric vehicle cluster.
[0119] Specifically, the objective function of the electric vehicle cluster game slave is the electricity cost of the electric vehicle cluster. The objective function calculation formula with the electric vehicle cluster as the slave is:
[0120] f EV =C EV +C f
[0121]
[0122]
[0123] Among them, F EV is the objective function of the electric vehicle cluster game slave, C EV is the charging cost of the electric vehicle cluster at time t, C f is the energy loss cost of the electric vehicle cluster at time t, P EV,t is the total charging load of the electric vehicle cluster at time t, W t is the time-of-use electricity price at time t, η c is the charging efficiency; W f,t is the price of electric energy loss in electric vehicles.
[0124] Step S33, setting the constraints of the master-slave game.
[0125] Specifically, the constraints of the master-slave game are for the power grid and electric vehicles, and the constraints of the master-slave game include: electricity price constraints, charging time constraints, charging energy constraints, charging power constraints for each electric vehicle, charging power constraints during peak load periods of the power grid, and charging power constraints for all electric vehicles.
[0126] As an example, the electricity price constraint is:
[0127] C valley ≤C t ≤C peak
[0128] Among them, C t is the electricity price at time t, C valley is the off-peak electricity price, C peak Peak electricity price.
[0129] As an example, the charging time constraint is:
[0130] t start,i ≤t i ≤t end,i
[0131] Among them, t i is the charging time of the i-th vehicle, t start,i is the charging start time of the i-th vehicle, t end,i is the charging end time of the i-th vehicle.
[0132] As an example, the charging energy constraint is:
[0133]
[0134] Among them, P i (t) is the charging energy of the electric vehicle at time t, t starti is the charging start time of the i-th vehicle, t end,i is the charging end time of the i-th vehicle, S max,i is the battery capacity of the i-th vehicle.
[0135] As an example, the charging power constraint for each electric vehicle is:
[0136] P min ≤P i ≤P max
[0137] Among them, P i is the charging power of the i-th electric vehicle, P min is the minimum output power, P max For maximum output power.
[0138] As an example, the charging power constraint during the peak load period of the grid is:
[0139]
[0140] Among them, P i is the charging power of the i-th electric vehicle, P i,N is the rated power of the i-th vehicle, SOC i is the initial state of charge of the i-th vehicle.
[0141] As an example, the charging power constraint for all electric vehicles is:
[0142]
[0143] Among them, P i is the charging power of the i-th electric vehicle, n is the number of electric vehicles, P set (t) is the upper limit of charging power set by the power grid at time t.
[0144] Step S34, establishing a master-slave game model with one master and multiple slaves.
[0145] Specifically, the master-slave game model of one master and multiple slaves is:
[0146]
[0147] Among them, {G,EV1,EV2,...EV K} is the set of game participants, G is the power grid, EV1, EV2, ..., EV K For different types of electric vehicle clusters, {δ G (W t )} is the strategy set of charging electricity price in each period of the upper power grid, C t is the electricity price at time t, is the strategy set of charging power of each cluster of lower-level follower electric vehicles, P EV,1,t ,P EV,2,t ,...,P EV,K,t is the charging power of different electric vehicle clusters at time t, is the objective function set of the game participants, F G is the objective function of the power grid, is the objective function of different electric vehicle clusters.
[0148] Step S35, setting the judgment basis of the master-slave game equilibrium.
[0149] Specifically, the basis for determining the master-slave game equilibrium is:
[0150]
[0151] Among them, F G is the objective function of the power grid, is the objective function of different electric vehicle clusters, It is the equilibrium solution of charging electricity price in each period of the power grid after the game; is the equilibrium solution of charging power of each cluster of electric vehicles after the game. G is the strategy set of charging electricity price in each period of the upper power grid, It is the strategy set for charging power of each cluster of lower-level follower electric vehicles.
[0152] Step S4, using the DBO algorithm to solve the game model to achieve orderly charging of electric vehicles.
[0153] Specifically, the DBO algorithm is a dung beetle optimization algorithm that simulates the five behaviors of dung beetles: straight-line rolling, dancing rolling, reproduction, foraging, and competition. The DBO algorithm takes into account both global exploration and local development, and has the characteristics of fast convergence speed and high solution accuracy.
[0154] The specific steps of using the DBO algorithm to solve the game model and realize orderly charging of electric vehicles include:
[0155] Step S41, inputting parameters related to the power grid and the electric vehicle.
[0156] Specifically, the parameters related to the power grid and electric vehicles include: power grid load, battery capacity, and electric vehicle charging power, etc. The actual parameters related to the power grid and electric vehicles are input into the DBO algorithm to provide basic data support for subsequent calculations.
[0157] Step S42, input the main parameters of the DBO algorithm.
[0158] Specifically, the main parameters of the DBO algorithm include population size, number of dung beetles, maximum number of iterations, upper and lower limits of position boundaries, etc. These key parameters required for the operation of the DBO algorithm also need to be input in advance. These parameters will affect the algorithm's iteration process and final results.
[0159] Step S43, initializing the population.
[0160] Specifically, the population participating in the algorithm operation is initialized and the initial individual state is determined to prepare for subsequent iterative updates. Each dung beetle corresponds to an electric car, and each dung beetle population corresponds to a type of electric vehicle cluster. The initialized population determines the starting point for the algorithm to begin searching.
[0161] Step S44, updating the position of the dung beetle in the rolling stage.
[0162] Specifically, the rolling stage includes straight-line rolling behavior and dance rolling behavior.
[0163] Among them, the linear rolling behavior refers to the dung beetle moving its food through the linear rolling behavior. This behavior is simulated as a movement mode in the search space and is used to update the position of the dung beetle. The calculation formula of the linear rolling behavior is:
[0164]
[0165] Where t is the number of iterations, x i (t) is the position of dung beetle individual i at the tth iteration, x i (t+1) is the position of dung beetle individual i at the t+1th iteration, x i (t-1) is the position of dung beetle individual i at the t-1th iteration, a is the natural coefficient, k is the deflection coefficient, b is a random number in [0,1], X wo is the global worst position, and Δx is the change in light intensity.
[0166] Dancing ball rolling behavior means that if the dung beetle encounters an obstacle during the rolling process, it needs to change its route through dancing behavior. The tangent function is used to describe the new route obtained by the dung beetle. The calculation formula of dancing ball rolling behavior is:
[0167] x i (t+1)=x i (t)+tanθ|x i (t)-x i (t-1)|
[0168] Where t is the number of iterations, x i (t) is the position of dung beetle individual i at the tth iteration, x i (t+1) is the position of dung beetle individual i at the t+1th iteration, x i (t-1) is the position of dung beetle individual i at the t-1th iteration, θ is the disturbance angle, θ∈[0,π].
[0169] Step S45, determine the optimal breeding area and update the current optimal position.
[0170] Specifically, the boundary selection strategy for the spawning area is:
[0171]
[0172] R=1-t / T max
[0173] Among them, U * is the upper boundary of the spawning area, L * is the lower boundary of the spawning area, X *is the current optimal spawning position, U is the upper boundary of the search area, L is the lower boundary of the search area, R is the iteration progress coefficient, t is the number of iterations, T max is the maximum number of iterations.
[0174] The formula for the position change of dung beetle eggs is:
[0175]
[0176] Among them, B i (t+1) is the position of egg i at the t+1th iteration, X wo is the global worst position, B i (t) is the position of egg ball i at the tth iteration; b1 and b2 are two independent random vectors of 1×N, L * is the lower boundary of the spawning area, U * The upper boundary of the spawning area.
[0177] Furthermore, according to a certain boundary selection strategy, the upper and lower boundaries of the egg-laying area are determined, and combined with information such as the current optimal egg-laying position, the position is updated through the position change formula of the dung beetle egg ball, and better breeding areas and positions are continuously sought to optimize the algorithm results.
[0178] Step S46, determine the optimal foraging area and update the position of the mantis larvae.
[0179] Specifically, the boundary selection strategy of the foraging area is:
[0180]
[0181] Among them, L b is the lower boundary of the foraging area, X b is the current optimal foraging position, U b is the upper boundary of the foraging area, U is the upper boundary of the search area, L is the lower boundary of the search area, and R is the iteration progress coefficient.
[0182] The position update formula of the dung beetle larva is:
[0183]
[0184] Among them, x i (t+1) is the position of dung beetle individual i at the t+1th iteration, x i (t) is the position of dung beetle individual i at the tth iteration, I ran,1 is a random number that follows a normal distribution, I ran,2 is a random vector in (0,1), L b is the lower boundary of the foraging area, U b is the upper boundary of the foraging area.
[0185] Furthermore, the boundary of the foraging area is determined through the boundary selection strategy of the foraging area, and then the position of the dung beetle larvae is updated according to the position update formula of the dung beetle larvae, simulating the position change during the foraging process, helping the algorithm to explore a better solution.
[0186] Step S47, updating the position of the thief in the population.
[0187] Specifically, thieves refer to some dung beetles that specialize in stealing food. Thieves compete with other individuals for food. The calculation formula for competitive behavior is:
[0188]
[0189] Among them, x i (t+1) is the position of dung beetle individual i at the t+1th iteration, X b is the current optimal foraging position, n con is a constant, I g is a random vector that follows a normal distribution, x i (t) is the position of dung beetle individual i at the tth iteration, X * is the current optimal spawning position, X b is the current optimal foraging position.
[0190] Furthermore, some dung beetles that specialize in stealing food are considered to simulate the competition between solutions. Their positions are updated using the formula to increase the search diversity and optimization ability of the algorithm and avoid premature convergence.
[0191] Step S48, determine whether the game equilibrium is satisfied, if so, output the load variance and charging cost after the game, otherwise return to step S43 to continue the calculation.
[0192] Specifically, after each iteration, check whether the master-slave game equilibrium condition set in the previous step S35 is met. If it is met, it means that a better scheduling scheme has been found, and the final load variance and the charging cost of the electric vehicle owner are output. These results can be used to evaluate the effect of orderly charging of electric vehicles. If it is not met, return to step S43 to continue the iterative solution process of the game model and continuously optimize and adjust.
[0193] As an example, a community is taken as the research object, and the relevant parameters in the example are as follows: assuming that there are N = 800 electric vehicles in the community, the battery capacity is 40kWh, the charging power is 7kWh, the minimum daily charging demand of each electric vehicle is 20kWh, the charging efficiency is 0.9, and the power loss price is 0.4 yuan / h.
[0194] Consider each car as a dung beetle and all cars as a population. Assume that the population size is 40, the number of dung beetles is 30, the maximum number of iterations is 200, the upper limit of the position boundary is 100, and the lower limit of the position boundary is 0. Use the DBO algorithm for optimization and find the optimal solution for each population through iteration.
[0195] For the preprocessed charging data, the charging start time and charging end time are selected as the two dimensions of clustering, and the k-mean++ algorithm is used for clustering.
[0196] After k-mean++ clustering, four types of electric vehicles are obtained, that is, K = 4. The clustering results are as follows Figure 2 shown.
[0197] In order to facilitate the display of calculation results, this example performs isovalue fitting on the clustered electric vehicles. After isovalue fitting, the electric vehicles can be divided into 4 groups, each group has n = [100, 100, 200, 400] electric vehicles. The first group represents the "morning charging type", charging time from 3 to 9 o'clock; the second group represents the "noon charging type", charging time from 10 to 14 o'clock; the third group represents the "afternoon charging type", charging time from 15 to 19 o'clock; the fourth group represents the "evening charging type", charging time from 20 o'clock to 2 o'clock the next day. The time-of-use electricity price is shown in Table 1.
[0198]
[0199] The game model is solved by the DBO algorithm, and the results are shown in Table 2.
[0200]
[0201] Comparison of grid load before and after DBO optimization Figure 3 shown.
[0202] From the optimization results, it can be seen that the load variance, peak-to-valley difference rate and charging cost after optimization are significantly reduced, and the load rate is significantly increased. The model built in this embodiment and its simulation results meet the expected effect of orderly charging and win-win situation between the power grid and the car owner, and realize the peak shaving and valley filling of the power grid and the orderly charging of electric vehicles.
[0203] The first embodiment of the present invention provides an orderly charging method for electric vehicles and power grids based on the DBO algorithm, including: collecting charging data of electric vehicles and preprocessing the charging data to obtain a target charging data set; clustering the target charging data set using the k-means++ algorithm to obtain different categories of electric vehicles; establishing a master-slave game model with the power grid as the main body and the electric vehicles as the slaves; and using the DBO algorithm to solve the game model to achieve orderly charging of electric vehicles. The electric vehicle and power grid game orderly charging method based on the DBO algorithm of the present invention establishes an objective function with the power grid as the main body and adopts the DBO algorithm for optimization and scheduling, so that the fluctuation of the power grid load is effectively controlled, which is beneficial to the stable operation of the power grid; the optimized power grid load curve is smoother, achieving the effect of peak shaving and valley filling, helping to improve the utilization rate of power grid equipment and reduce the investment and maintenance costs of power grid equipment; the charging strategy is optimized by the algorithm, so that the owner can choose a more economical time period for charging when charging; the orderly charging of the electric vehicle is achieved by collecting, preprocessing, and clustering the charging data of the electric vehicle, establishing a master-slave game model, and adopting the DBO algorithm for optimization and scheduling; the DBO algorithm takes into account global exploration and local development by simulating various behaviors of dung beetles, and has the characteristics of fast convergence speed and high solution accuracy, so that the effect of orderly charging is more significant, and a win-win strategy for the power grid and the electric vehicle can be found quickly and accurately.
[0204] The step division of the above methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.
[0205] Second implementation method:
[0206] like Figure 4 As shown, the second embodiment of the present invention provides an electric vehicle and power grid game orderly charging system based on the DBO algorithm, and the system includes: a data set acquisition module 201, a data set clustering module 202, a modeling module 203, and an algorithm solving module 204.
[0207] Specifically, the data set acquisition module 201 is used to collect the charging data of electric vehicles and pre-process the charging data to obtain the target charging data set; the data set clustering module 202 is used to cluster the target charging data set using the k-means++ algorithm to obtain different categories of electric vehicles; the modeling module 203 is used to establish a master-slave game model with the power grid as the main body and the electric vehicles as the slaves; the algorithm solving module 204 is used to solve the game model using the DBO algorithm to achieve orderly charging of electric vehicles.
[0208] It is not difficult to find that this embodiment is a system embodiment corresponding to the first embodiment, and this embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the first embodiment.
[0209] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.
[0210] A third embodiment of the present invention relates to a network side server, such as Figure 5 As shown, it includes at least one processor 302; and a memory 301 that is communicatively connected to the at least one processor 302; wherein the memory 301 stores instructions that can be executed by the at least one processor 302, and the instructions are executed by the at least one processor 302 so that the at least one processor 302 can execute the above-mentioned data processing method.
[0211] The memory 301 and the processor 302 are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors 302 and the memory 301 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor 302 is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor 302.
[0212] The processor 302 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 301 can be used to store data used by the processor 302 when performing operations.
[0213] The fourth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the method for orderly charging of electric vehicles and power grids based on the DBO algorithm in the first embodiment is implemented.
[0214] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0215] The above is only an embodiment of the present invention. The common sense such as the known specific structure and characteristics in the scheme is not described in detail here. The ordinary technicians in the relevant field know all the common technical knowledge in the technical field of the invention before the application date or priority date, can know all the existing technologies in the field, and have the ability to apply the conventional experimental means before that date. The ordinary technicians in the relevant field can improve and implement this scheme in combination with their own abilities under the enlightenment given by this application. Some typical known structures or known methods should not become obstacles for ordinary technicians in the relevant field to implement this application. It should be pointed out that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can be made, which should also be regarded as the scope of protection of the present invention, which will not affect the effect of the implementation of the present invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.
[0216] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for orderly charging of electric vehicles and power grids based on DBO algorithm, characterized in that: include: S1, collecting charging data of electric vehicles and preprocessing the charging data to obtain a target charging data set; S2, using k-means++ algorithm to cluster the target charging data set to obtain different categories of electric vehicles; S3, establish a master-slave game model with the power grid as the main body and electric vehicles as the slaves; S4, uses the DBO algorithm to solve the game model and realize the orderly charging of electric vehicles.
2. The method for orderly charging of electric vehicles and power grids based on DBO algorithm according to claim 1 is characterized in that: In S1, the step of collecting charging data of the electric vehicle and preprocessing the charging data includes: Step S11, collecting charging data of electric vehicle charging piles in a region to obtain an initial charging data set; Step S12, cleaning the initial charging data set to obtain a first charging data set; Step S13: using the Min-Max method to perform standardization processing on the first charging data set to obtain a target charging data set.
3. The method for orderly charging of electric vehicles and power grids based on DBO algorithm according to claim 1 is characterized in that: In S2, the k-means++ algorithm is used to cluster the target charging data set to obtain different categories of electric vehicles, including: Step S21, select the initial cluster center C j ; Step S22, for data point x i , calculate the data point x i To cluster center C j distance; Step S23, selecting a more appropriate cluster center according to a probability formula; Step S24, repeating steps S22 and S23 until K cluster centers are generated; Step S25, determining whether the cluster center no longer changes, if so, outputting the clustering result, otherwise, returning to step S21.
4. The method for orderly charging of electric vehicles and power grids based on DBO algorithm according to claim 3 is characterized in that: The calculated data point x i To cluster center C j The distance calculation formula is: Among them, D i (x) is the data point x i To cluster center C j The distance (a i ,b i ) is the data point x i The coordinates of j ,b j ) is the cluster center C j The coordinates of The more appropriate cluster center C' j The calculation formula is: Among them, C' j For a more appropriate cluster center, D i (x) is the data point x i To cluster center C j The distance, S j is the cumulative value of the Euclidean distance, x i is the charging data point of the i-th label after standardization, and X is the set of data points.
5. The method for orderly charging of electric vehicles and power grids based on DBO algorithm according to claim 1 is characterized in that: In S2, the establishment of a master-slave game model with the power grid as the main body and the electric vehicles as the slaves includes: Step S31, establishing an objective function with the power grid as the main body, that is, the equivalent load variance after the electric vehicle is connected to the power grid; Step S32, establishing an objective function with the electric vehicle cluster as a slave, that is, the electricity cost of the electric vehicle cluster; Step S33, setting constraints of the master-slave game; Step S34, establishing a master-slave game model with one master and multiple slaves; Step S35, setting the judgment basis of the master-slave game equilibrium.
6. The method for orderly charging of electric vehicles and power grids based on DBO algorithm according to claim 5 is characterized in that: The calculation formula of the objective function with the power grid as the main body is: Among them, F G is the objective function of the power grid game subject; P before,t To optimize the grid load after electric vehicles are connected at time t, P avg is the average value of equivalent load, P grid,t is the grid base load before electric vehicles are connected to the grid at time t, P EV,k,t is the total charging load of the kth type of electric vehicle at time t; K is the number of electric vehicle clusters after clustering. The objective function calculation formula with the electric vehicle cluster as the slave is: minF EV =C EV +C f Among them, F EV is the objective function of the electric vehicle cluster game slave, C EV is the charging cost of the electric vehicle cluster at time t, C f is the energy loss cost of the electric vehicle cluster at time t, P EV,k,t is the total charging load of the k-th electric vehicle at time t, W t is the time-of-use electricity price at time t, η c is the charging efficiency; W f,t is the price of electric energy loss in electric vehicles. The master-slave game model with one master and multiple slaves is: Among them, {G,EV1,EV2,...EV K } is the set of game participants, G is the power grid, EV1, EV2, ..., EV K For different types of electric vehicle clusters, {δ G (W t )} is the strategy set of charging electricity price in each period of the upper power grid, C t is the electricity price at time t, is the strategy set of charging power of each cluster of lower-level follower electric vehicles, P EV,1,t ,P EV,2,t ,...,P EV,K,t is the charging power of different electric vehicle clusters at time t, is the objective function set of the game participants, F G is the objective function of the power grid, is the objective function of different electric vehicle clusters.
7. The method for orderly charging of electric vehicles and power grids based on DBO algorithm according to claim 6 is characterized in that: In S4, the DBO algorithm is used to solve the game model to achieve orderly charging of electric vehicles, including: Step S41, inputting parameters related to the power grid and the electric vehicle; Step S42, inputting the main parameters of the DBO algorithm; Step S43, initializing the population; Step S44, updating the position of the dung beetle in the rolling stage; Step S45, determining the optimal breeding area and updating the current optimal position; Step S46, determining the optimal foraging area and updating the position of the mantis larva; Step S47, updating the position of the thief in the population; Step S48, determine whether the game equilibrium is satisfied, if so, output the load variance and charging cost after the game, otherwise return to step S43 to continue the calculation.
8. The method for orderly charging of electric vehicles and power grids based on DBO algorithm according to claim 7 is characterized in that: The rolling ball stage includes straight-line rolling ball behavior and dancing rolling ball behavior; The calculation formula for the straight-line rolling ball behavior is: Among them, t is the number of iterations, x i (t) is the position of dung beetle individual i at the tth iteration, x i (t+1) is the position of dung beetle individual i at the t+1th iteration, x i (t-1) is the position of dung beetle individual i at the t-1th iteration, a is the natural coefficient, k is the deflection coefficient, b is a random number in [0,1], X wo is the global worst position, Δx is the change in light intensity; The calculation formula of the dance rolling ball behavior is: x i (t+1)=x i (t)+tanθ|x i (t)-x i (t-1)| Among them, t is the number of iterations, x i (t) is the position of dung beetle individual i at the tth iteration, x i (t+1) is the position of dung beetle individual i at the t+1th iteration, x i (t-1) is the position of dung beetle individual i at the t-1th iteration, θ is the disturbance angle, θ∈[0,π].
9. The method for orderly charging of electric vehicles and power grids based on DBO algorithm according to claim 7 is characterized in that: Determining the optimal breeding area and updating the current optimal position includes: The boundary selection strategy for the spawning area is: R=1-t / T max Among them, U * is the upper boundary of the spawning area, L * is the lower boundary of the spawning area, X * is the current optimal spawning position, U is the upper boundary of the search area, L is the lower boundary of the search area, R is the iteration progress coefficient, t is the number of iterations, T max is the maximum number of iterations; The formula for the position change of dung beetle eggs is: Among them, B i (t+1) is the position of egg i at the t+1th iteration, X wo is the global worst position, B i (t) is the position of egg ball i at the tth iteration; b1 and b2 are two independent random vectors of 1×N, L * is the lower boundary of the spawning area, U * The upper boundary of the spawning area.
10. The orderly charging system of electric vehicles and power grid based on DBO algorithm is characterized by: The method for orderly charging of electric vehicles and power grids based on the DBO algorithm described in claim 1 comprises: A data set acquisition module is used to collect charging data of electric vehicles and pre-process the charging data to obtain a target charging data set; The data set clustering module is used to cluster the target charging data set using the k-means++ algorithm to obtain different categories of electric vehicles; A modeling module is used to establish a master-slave game model with the power grid as the main body and electric vehicles as the slaves; The algorithm solving module is used to solve the game model using the DBO algorithm, thereby realizing the orderly charging of electric vehicles.