Layered energy system optimization scheduling method based on LSTM neural network
Through the optimization scheduling method of layered energy system based on LSTM neural network, combined with GA and improved particle swarm algorithm, the problem of how load aggregators formulate optimized scheduling management strategies after the widespread use of electric vehicles is solved, and the accurate prediction of load curves is achieved and Maximize the benefits of energy transactions and ensure the economic and environmental benefits of grid scheduling.
Patent Information
- Application Number
- CN202410923285.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-11-22
AI Technical Summary
How load aggregators formulate optimized scheduling management strategies, manage flexible loads and conduct energy transactions in distributed power markets has become an urgent issue, especially in the context of the impact on grid scheduling after the widespread use of electric vehicles.
Using the hierarchical energy system optimization scheduling method based on LSTM neural network, the energy scheduling model runs through the entire power system by predicting the recent market basic load and electric vehicle load, and combining GA genetic algorithm and improved particle swarm algorithm to optimize the load scheduling of electric vehicles Transaction with energy to maximize the interests of both parties.
Effectively reduce the error between the predicted load and the actual load, ensure the accuracy of the load curve of the electric vehicle, and achieve the optimal economic and environmental benefits of grid scheduling at different energy levels and constraints.
Smart Images

Figure CN119009940A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system optimization scheduling methods, and mainly relates to a hierarchical energy system optimization scheduling method based on LSTM neural network, and specifically relates to a power system hierarchical optimization scheduling method based on LSTM neural network aggregation of electric vehicle loads. Background Art
[0002] With the increasingly serious energy crisis and environmental problems, electric vehicles have become an important way and development trend for future energy security, energy conservation and environmental protection. However, the widespread use of electric vehicles will have an impact on grid dispatching. Since the power of a single EV is relatively small, individual dispatching cannot respond to the dispatching needs of the power system. Therefore, it is necessary to use load aggregators to aggregate and control electric vehicles to form high-power, large-capacity dispatchable load resources, so as to have the basic conditions for participating in the operation of the power system and providing ancillary services. In this context, how load aggregators can formulate optimized dispatching management strategies, manage and dispatch flexible loads, and conduct energy transactions in the distributed power market has become an issue that needs to be studied urgently. Summary of the invention
[0003] Aiming at the technical problems of how the above-mentioned load aggregators formulate optimized dispatching management strategies, how to manage and dispatch flexible loads and conduct energy transactions in distributed power markets, this technical solution provides a hierarchical energy system optimization dispatching method based on LSTM neural network, and proposes an energy dispatching model throughout the entire power system based on the prediction of the basic load and electric vehicle load in the day-ahead market based on the long short-term memory (LSTM) hybrid model; the constructed model not only considers the aggregation control of electric vehicles, but also considers the centralized optimization dispatching of P2P power transactions between load aggregators; by formulating different dispatching strategies for electric vehicle loads, the impact of P2P power transactions between electric vehicle loads and load aggregators on power grid dispatching is studied under different energy levels, different objective functions and constraints; it can effectively solve the above-mentioned problems.
[0004] The present invention is achieved through the following technical solutions:
[0005] A hierarchical energy system optimization scheduling method based on LSTM neural network, characterized by comprising the following steps:
[0006] Step 1: Load forecasting, using LSTM network to predict the target electric vehicle load;
[0007] Step 2: Based on the results of the LSTM network's prediction of the target electric vehicle load, an electric vehicle load optimization scheduling model is established to reduce the error between the predicted load curve and the actual load curve;
[0008] Step 3: For the electric vehicle load optimization dispatching model, it can be considered that the load aggregator fully grasps the status information of the electric vehicle, so the centralized optimization method of the GA genetic algorithm is used to solve the electric vehicle load optimization dispatching model in step 2;
[0009] Step 4: Considering the maximization of interests of both parties in the transaction, establish an electric vehicle energy trading model;
[0010] Step 5: The electric vehicle energy trading model is a distributed optimization model, so the improved particle swarm algorithm is used to solve the electric vehicle energy trading model and obtain the global optimal solution as the result;
[0011] For the variable sales electricity X={x1,x2,…,x D}, the objective function is the optimization problem of min{f(x)}, and the particle update formula of the standard particle swarm algorithm is as follows:
[0012] v id (t+1)=w1v id (t)+c1r1(pbest id -x id (t))+c2r2(gbest d -x id (t));
[0013] x id (t+1)=x id (t)+v id (t+1);
[0014] In the formula, v id (t+1) and x id (t+1) are the position and velocity of particle i at t+1; v id (t) and x id (t) are the position and velocity of particle i at t; w is the inertia weight, which decreases linearly with the number of iterations in the standard particle swarm algorithm; pbest id For the particle's own historical experience; gbest d is the particle group experience; c1 and c2 are learning factors, usually 2; r1 and r2 are random numbers uniformly distributed in [0, 1].
[0015] Furthermore, the improved particle swarm algorithm described in step 5 is used to solve the electric vehicle energy trading model, and the specific operation steps include:
[0016] Step 5.1: Initialize the particle state, and the particle sells electricity in the trading market;
[0017] A certain number of particles are randomly generated, each particle represents a solution, that is, a point in the search space; each particle has two properties: position and velocity;
[0018] Step 5.2: Calculate the fitness function value, that is, calculate the value of the objective function;
[0019] Step 5.3: Update particle velocity and position;
[0020] Update the speed and position of each particle according to the current position and speed of the particle, as well as the information of the global optimum and the local optimum. The global optimum is the optimal solution found by all particles in history, and the local optimum is the optimal solution found by a particle in the neighborhood.
[0021] The improved particle swarm algorithm adopts a new adaptive particle speed and position update strategy. The update formula is as follows:
[0022]
[0023] In the above formula, p ad is the average dimension information of particles;
[0024] Step 5.4: Update the global optimum and local optimum;
[0025] After updating the speed and position of each particle, recalculate the global optimum and local optimum; if a particle finds a better solution than the current local optimum, set it as the new local optimum; if a particle finds a better solution than the current global optimum, set it as the new global optimum;
[0026] Step 5.5: Determine whether the stop condition is met;
[0027] Determine whether the current particle swarm has reached the preset maximum number of iterations. If so, the stop condition is met;
[0028] Or determine whether the fitness function value of the current particle swarm is small enough. If so, the stopping condition is met;
[0029] Step 5.6: Return the global optimal solution;
[0030] If the particle swarm meets the stopping condition, the global optimal solution is returned as the result; if not, it returns to step 5.3 to continue the iteration.
[0031] Furthermore, each LSTM unit in the LSTM network described in step 1 contains three control gates: an input gate, a forget gate, and an output gate; the input gate determines how much current input data is input to the memory unit, the forget gate determines to retain the historical state information of the cell, and the output gate controls how much storage unit state value needs to be output to the current output value; the specific process is as follows:
[0032] i t =σ(w xi x t +w hi h t-1 +w ci c t-1 +b i );
[0033] f t =σ(w xf x t +w hf h t-1 +w cf c t-1 +b f );
[0034] c t =f t c t-1 +i t tan(w xc x t +w hc h t-1 +b c );
[0035] o t =σ(w xo x t +w ho h t-1 +w co c t-1 +b o );
[0036] y t =o t tanc t ;
[0037] In the formula, x t is the input data, y t is the output value, c t is the storage unit state, b is the offset matrix, w xi 、w xf 、w xc 、w xo All are x t The offset matrix, w hi 、w hf 、w hc 、w ho Both are h t-1 The offset matrix, w ci 、w cf 、w co Both are c t-1 The offset matrix, i tis the output of the input gate at time t, f t is the output of the forget gate, o t is the output of the input gate, σ uses the Sigmoid function; the updated cell state consists of two parts: (a) the information generated by the current new input; (b) the old cell state information at the previous moment.
[0038] Furthermore, the LSTM network is used in step 1 to predict the electric vehicle load in the day-ahead market. The specific operation steps include:
[0039] Step 1.1: Data preparation: Prepare a time series data set, including historical data and corresponding target values; divide the data set into a training set and a test set to ensure the generalization ability of the model on future data;
[0040] Step 1.2: Feature engineering; perform feature engineering normalization on the data;
[0041] Step 1.3: Build the LSTM model; define the structure of the LSTM model, including the number of neurons, the number of layers, and the activation function; set the loss function and optimizer of the model, and use the mean square error as the loss function in the time series prediction task;
[0042] Step 1.4: Model training; use the training set to train the LSTM model, and use the back propagation algorithm to update the model parameters; use the validation set to adjust the hyperparameters to prevent overfitting;
[0043] Step 1.5: Model prediction; use the trained LSTM model to predict the test set or future data; compare the predicted results with the actual values to evaluate the performance of the model;
[0044] Step 1.6: Model evaluation; use the evaluation indicators root mean square error and mean absolute error to evaluate the prediction accuracy of the model.
[0045] Furthermore, the normalization process described in step 1.2 is to scale the data to a standard range to eliminate the weight differences between different features due to different dimensions;
[0046] The minimum-maximum scaling method is used to normalize the data. The scaled data range is between [0,1]. First, the minimum value Z of each feature is calculated. min and the maximum value Z max ; Secondly, apply the following min-max scaling formula to each eigenvalue:
[0047]
[0048] In the formula, Z is the eigenvalue, Z min is the minimum eigenvalue, Z maxis the maximum value of the eigenvalue, and f is the normalized eigenvalue.
[0049] Furthermore, the objective function of the electric vehicle load optimization scheduling model described in step 2 is:
[0050]
[0051] Where n is the number of electric vehicles; L(t) is the local basic load; and are the charging and discharging rates of the jth electric vehicle in period t; L fore (t) is the forecast load in time period t; Δt is the scheduling period.
[0052] Furthermore, the constraints of the electric vehicle load optimization scheduling model described in step 2 include electric vehicle SOC constraints, electric vehicle charging and discharging constraints, and battery capacity constraints when the electric vehicle arrives and leaves; specifically:
[0053] Electric vehicle SOC constraints:
[0054]
[0055] In the formula, is the battery state of charge of the jth EV in time period t; η c and η d are the charging and discharging efficiencies of electric vehicles, respectively; and are the upper and lower limits of SOC respectively;
[0056] Electric vehicle charging and discharging constraints:
[0057]
[0058]
[0059] In the formula, and are the maximum charge and discharge rates, respectively; T arrive,j is the time when the jth electric vehicle arrives at the charging station;
[0060] Battery capacity constraints for electric vehicles when they arrive and leave:
[0061]
[0062] In the formula, is the SOC state of the jth electric vehicle when it arrives at the charging station; D j is the daily driving distance of the jth electric vehicle; W is the energy consumption of the electric vehicle when driving; C is the total energy consumption of the electric vehicle; is the SOC state value that the j-th electric vehicle is expected to support the next journey before departure.
[0063] Furthermore, the core of the GA genetic algorithm described in step 3 lies in the evolution process of the population. Through continuous selection, crossover, and mutation operations, the individuals in the population are increasingly adapted to the objective function or fitness function of the problem until the optimal solution is reached.
[0064] Solving the electric vehicle load optimization dispatch model includes the following steps:
[0065] Step 3.1: Initialization; randomly generate a population, each individual represents a solution;
[0066] Step 3.2: Evaluation: Evaluate each individual in the population according to the objective function or fitness function of the problem;
[0067] Step 3.3: Selection: select the better individuals as parents according to their fitness values and keep them for the next generation;
[0068] Step 3.4: Crossover: Through the crossover operation, different parent genes are combined to produce new offspring;
[0069] Step 3.5: Mutation: After the crossover operation, some individuals are mutated to increase the diversity of the population.
[0070] Step 3.6: Replacement: through selection, crossover, and mutation operations, some of the poorer individuals are replaced in the new generation;
[0071] Step 3.7: Determine the termination condition; if the preset stopping criterion is reached, the algorithm ends and the optimal solution is output; otherwise, return to step 3.2 and continue iterating.
[0072] Furthermore, the objective function for maximizing the interests of both parties to the transaction described in step 4 is specifically:
[0073]
[0074] Since the buyer's electricity purchase cost and the seller's electricity sales revenue are equal, the above formula is simplified as follows:
[0075]
[0076] P Spq =P Bpq ;
[0077] C p (P Sp )=A p (P Sp ) 2 +B p (PSp )+D p ;
[0078]
[0079] Where P Spq , P Bpq are the electricity sold by seller p to buyer q and the electricity purchased by buyer q from seller p respectively; and P Sp The upper and lower limits of the amount of electricity sold by the seller; and P Bq is the upper and lower limits of the amount of electricity that buyer q can purchase; pq is the transaction price between seller p and buyer q; C p (·) is the cost function for producing electricity for seller p, A p , B p , D p are the cost quadratic function coefficients respectively; P Sp is the total amount of electricity sold by seller p; P Bq is the total amount of electricity purchased by buyer q; U q (·) is the utility function of the amount of electricity purchased by buyer q; G q , H q , K q are the coefficients of the utility quadratic function; N S and N B is the number of sellers and buyers.
[0080] Beneficial Effects
[0081] The hierarchical energy system optimization scheduling method based on LSTM neural network proposed in the present invention has the following beneficial effects compared with the prior art:
[0082] (1) Based on the load prediction based on the long short-term memory network hybrid model, the present invention assumes that the load aggregator can reduce the error between the actual load and the predicted load by dispatching controllable flexible load, and conducts point-to-point power transactions with power operators according to the formulated load dispatching strategy, and uses the improved particle swarm algorithm to solve the maximum benefit that both parties can obtain.
[0083] (2) The method of the present invention takes into account the uncertainty of the electric vehicle group, introduces the LSTM neural network prediction method, and establishes an LSTM neural network prediction model. Then, based on the prediction results, an electric vehicle load optimization scheduling model is adopted, and the electric vehicle charging and discharging strategy is considered. A new load optimization scheduling model is proposed to schedule the electric vehicle load to ensure that the error between the predicted load curve and the actual load curve is minimized. At the same time, an electric vehicle energy trading model is adopted to ensure that the interests of both buyers and sellers are maximized. This paper aims to study the formulation of electric vehicle load coordination scheduling strategies at different energy levels such as energy consumption layer and energy scheduling layer, different objective functions and constraints, so as to achieve the optimal economic and environmental benefits of the power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 It is a schematic diagram of the overall process of the present invention.
[0085] Figure 2 This is a flow chart of the LSTM network prediction method in the present invention.
[0086] Figure 3 It is the flow chart of GA genetic algorithm in the present invention.
[0087] Figure 4 This is the flow chart of the improved particle swarm algorithm in the present invention. DETAILED DESCRIPTION
[0088] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Under the premise of not departing from the design concept of the present invention, various modifications and improvements made by ordinary persons in the art to the technical solutions of the present invention should all fall within the protection scope of the present invention.
[0089] Embodiment 1:
[0090] A hierarchical energy system optimization scheduling method based on LSTM neural network, the method comprising the following steps:
[0091] Step 1: Load forecasting, using LSTM network to predict the target electric vehicle load; the target electric vehicle load can be the electric vehicle load within any research range of the day-ahead market.
[0092] Traditional recurrent neural networks (RNNs) are prone to gradient vanishing or gradient exploding problems when dealing with long-term dependencies, while LSTM effectively solves this problem through a gated structure, and can better capture long-term dependencies in time series data. At the same time, it can process various types of time series data, including text, audio, video, etc., and has a wide range of applications. The LSTM network dynamically adjusts the storage of memory cells through forget gates, input gates, and output gates, thereby effectively controlling the flow of information and improving the learning ability of the model.
[0093] Each LSTM unit in the LSTM network contains three control gates: input gate, forget gate and output gate; the input gate determines how much current input data is input to the memory unit, the forget gate determines how to retain the historical state information of the cell, and the output gate controls how much storage unit state value needs to be output to the current output value; the specific process is as follows:
[0094] i t =σ(w xi x t +w hi h t-1 +w ci c t-1 +b i );
[0095] f t =σ(w xf x t +w hf h t-1 +w cf c t-1 +b f );
[0096] c t =f t c t-1 +i t tan(w xc x t +w hc h t-1 +b c );
[0097] o t =σ(w xo x t +w ho h t-1 +w co c t-1 +b o );
[0098] y t =o t tanc t ;
[0099] In the formula, x t is the input data, y t is the output value, c t is the storage unit state, b is the offset matrix, w xi 、w xf 、w xc 、w xo All are x t The offset matrix, w hi 、w hf 、w hc 、w ho Both are h t-1 The offset matrix, w ci 、w cf 、w co Both are c t-1 The offset matrix, i t is the output of the input gate at time t, f t is the output of the forget gate, o t is the output of the input gate, σ uses the Sigmoid function; the updated cell state consists of two parts: (a) the information generated by the current new input; (b) the old cell state information at the previous moment.
[0100] The LSTM network is used to predict the electric vehicle load in the day-ahead market. The specific steps include:
[0101] Step 1.1: Data preparation: Prepare a time series dataset, usually including historical data and corresponding target values. Divide the dataset into a training set and a test set to ensure the model's generalization ability on future data.
[0102] Step 1.2: Feature Engineering: Perform feature engineering normalization on the data to improve the training effect of the model. The main purpose of normalization is to scale the data to a standard range to eliminate the weight differences between different features due to different dimensions. The Min-Max Scaling method is used to normalize the data, and the scaled data range is between [0,1]. First, calculate the minimum value Z of each feature min and the maximum value Z max . Second, apply the following min-max scaling formula to each eigenvalue:
[0103]
[0104] In the formula, Z is the eigenvalue, Z min is the minimum eigenvalue, Z max is the maximum value of the eigenvalue, and f is the normalized eigenvalue.
[0105] Step 1.3: Build an LSTM model; define the structure of the LSTM model, including the number of neurons, number of layers, and activation function; set the model's loss function and optimizer, and use mean square error as the loss function in the time series prediction task.
[0106] Step 1.4: Model training; use the training set to train the LSTM model and use the back propagation algorithm to update the model parameters; use the validation set to adjust the hyperparameters to prevent overfitting.
[0107] Step 1.5: Model prediction; use the trained LSTM model to make predictions on the test set or future data; compare the predicted results with the actual values to evaluate the performance of the model.
[0108] Step 1.6: Model evaluation; use the evaluation indicators root mean square error and mean absolute error to evaluate the prediction accuracy of the model.
[0109] Step 2: Based on the results of the LSTM network's target electric vehicle load prediction, an electric vehicle load optimization scheduling model is established to reduce the error between the predicted load curve and the actual load curve.
[0110] The objective function of the electric vehicle load optimization scheduling model is:
[0111]
[0112] Where n is the number of electric vehicles; L(t) is the local basic load; and are the charging and discharging rates of the jth electric vehicle in period t; L fore (t) is the forecast load in time period t; Δt is the scheduling period.
[0113] The constraints of the electric vehicle load optimization scheduling model include electric vehicle SOC constraints, electric vehicle charging and discharging constraints, and battery capacity constraints when electric vehicles arrive and leave; specifically:
[0114] Electric vehicle SOC constraints:
[0115]
[0116] In the formula, is the battery state of charge of the jth EV in time period t; η c and η d are the charging and discharging efficiencies of electric vehicles, respectively; and are the upper and lower limits of SOC respectively.
[0117] Electric vehicle charging and discharging constraints:
[0118]
[0119] When t<T arrive,j hour;
[0120] In the formula, and are the maximum charge and discharge rates, respectively; T arrive,j is the time when the jth electric car arrives at the charging station.
[0121] Battery capacity constraints for electric vehicles when they arrive and leave:
[0122]
[0123] In the formula, is the SOC state of the jth electric vehicle when it arrives at the charging station; D j is the daily driving distance of the jth electric vehicle; W is the energy consumption of the electric vehicle when driving; C is the total energy consumption of the electric vehicle; is the SOC state value that the j-th electric vehicle is expected to support the next journey before departure.
[0124] Step 3: For the electric vehicle load optimization scheduling model, it can be assumed that the load aggregator fully grasps the status information of the electric vehicle. Therefore, the centralized optimization method of the GA genetic algorithm is used to solve the electric vehicle load optimization scheduling model in step 2; the core of the genetic algorithm lies in the evolution process of the population. Through continuous selection, crossover, mutation and other operations, the individuals in the population are increasingly adapted to the objective function or fitness function of the problem until the optimal solution is reached.
[0125] Solving the electric vehicle load optimization dispatch model includes the following steps:
[0126] Step 3.1: Initialization; randomly generate a population, each individual represents a solution;
[0127] Step 3.2: Evaluation: Evaluate each individual in the population according to the objective function or fitness function of the problem;
[0128] Step 3.3: Selection: select the better individuals as parents according to their fitness values and keep them for the next generation;
[0129] Step 3.4: Crossover: Through the crossover operation, different parent genes are combined to produce new offspring;
[0130] Step 3.5: Mutation: After the crossover operation, some individuals are mutated to increase the diversity of the population.
[0131] Step 3.6: Replacement: through selection, crossover, and mutation operations, some of the poorer individuals are replaced in the new generation;
[0132] Step 3.7: Determine the termination condition; if the preset stopping criterion is reached, the algorithm ends and the optimal solution is output; otherwise, return to step 3.2 and continue iterating.
[0133] Step 4: Considering the maximization of interests of both parties in the transaction, establish an electric vehicle energy trading model;
[0134] The objective function of maximizing the interests of both parties to the transaction is specifically:
[0135]
[0136] Since the buyer's electricity purchase cost and the seller's electricity sales revenue are equal, the above formula is simplified as follows:
[0137]
[0138] P Spq =P Bpq ;
[0139] C p (P Sp )=A p (P Sp ) 2 +B p (P Sp )+D p ;
[0140]
[0141] Where P Spq , P Bpq are the electricity sold by seller p to buyer q and the electricity purchased by buyer q from seller p respectively; and P Sp The upper and lower limits of the amount of electricity sold by the seller; and P Bq is the upper and lower limits of the amount of electricity that buyer q can purchase; pq is the transaction price between seller p and buyer q; C p (·) is the cost function for producing electricity for seller p, A p , B p , D p are the cost quadratic function coefficients respectively; P Sp is the total amount of electricity sold by seller p; P Bq is the total amount of electricity purchased by buyer q; U q (·) is the utility function of the amount of electricity purchased by buyer q; G q, H q , K q are the coefficients of the utility quadratic function; N S and N B is the number of sellers and buyers.
[0142] Step 5: For the electric vehicle load optimization scheduling model, it can be considered that the load aggregator fully grasps the status information of the electric vehicle, so the centralized optimization method of the GA genetic algorithm is used to solve the electric vehicle load optimization scheduling model in step 2;
[0143] In the standard PSO algorithm, particles find the best particle by learning their own historical experience (pbest) and group experience (gbest). D}, the objective function is the optimization problem of min{f(x)}, and the particle update formula of the standard PSO algorithm is as follows:
[0144] v id (t+1)=wv id (t)+c1r1(pbest id -x id (t))+c2r2(gbest d -x id (t));
[0145] x id (t+1)=x id (t)+v id (t+1);
[0146] In the formula, v id (t+1) and x id (t+1) are the position and velocity of particle i at t+1; v id (t) and x id (t) are the position and velocity of particle i at t; w is the inertia weight, which decreases linearly with the number of iterations in the standard particle swarm algorithm; pbest id For the particle's own historical experience; gbest d is the particle group experience; c1 and c2 are learning factors, usually 2; r1 and r2 are random numbers uniformly distributed between [0, 1];
[0147] The improved particle swarm algorithm adopts a new adaptive particle speed and position update strategy. The update formula is as follows:
[0148]
[0149] The above adaptive strategy adopts p i As an adaptive decision condition.
[0150] When pi When >δ, the fitness value of the current particle is much greater than the average fitness value of all particles in the population, indicating that the algorithm is in the early stage of search or the current particle distribution is relatively dispersed. At this time, the first formula should be used to update the particle speed and position. The first formula introduces the linear combination of individual optimal and group optimal in the speed update term, which can make the particle search space wider, thereby increasing the possibility of the algorithm searching for the global optimal solution, while the position update uses X=wX+(1-w)V to improve the global search ability of the algorithm. In this formula, X is the position of the particle, V is the speed of the particle, and ω is the update weight.
[0151] When p i When <δ, the fitness value of the current particle is not much different from the average fitness value of all particles in the population, indicating that the algorithm is in the middle and late stages of the search or the current particle distribution is relatively concentrated. At this time, the second formula should be used to update the particle speed and position. In the second formula, the position update uses X=X+V to ensure the local development ability of the algorithm and prevent the algorithm from falling into the local optimum when solving complex multi-peak functions, and the average particle dimension information p is used. ad Introduced into the particle velocity update formula to improve the convergence speed of the algorithm.
[0152] The improved particle swarm algorithm is used to solve the electric vehicle energy trading model. The specific steps include:
[0153] Step 5.1: Initialize particle state;
[0154] A certain number of particles are randomly generated, each particle represents a solution, that is, a point in the search space; each particle has two properties: position and velocity;
[0155] Step 5.2: Calculate the fitness function value, that is, calculate the value of the objective function;
[0156] Step 5.3: Update particle velocity and position;
[0157] Update the speed and position of each particle according to the current position and speed of the particle, as well as the information of the global optimum and the local optimum. The global optimum is the optimal solution found by all particles in history, and the local optimum is the optimal solution found by a particle in the neighborhood.
[0158] The improved particle swarm algorithm adopts a new adaptive particle speed and position update strategy. The update formula is as follows:
[0159]
[0160] Step 5.4: Update the global optimum and local optimum;
[0161] After updating the speed and position of each particle, recalculate the global optimum and local optimum; if a particle finds a better solution than the current local optimum, set it as the new local optimum; if a particle finds a better solution than the current global optimum, set it as the new global optimum.
[0162] Step 5.5: Determine whether the stop condition is met;
[0163] Determine whether the current particle swarm has reached the preset maximum number of iterations. If so, the stop condition is met;
[0164] Or determine whether the fitness function value of the current particle swarm is small enough. If so, the stopping condition is met.
[0165] Step 5.6: Return the global optimal solution;
[0166] If the particle swarm meets the stopping condition, the global optimal solution is returned as the result; if not, it returns to step 5.3 to continue the iteration.
[0167] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the present invention.
Claims
1. A hierarchical energy system optimization scheduling method based on LSTM neural network, characterized in that: The following steps are involved: Step 1: Load forecasting, using LSTM network to predict the target electric vehicle load; Step 2: Based on the results of the LSTM network's prediction of the target electric vehicle load, an electric vehicle load optimization scheduling model is established to reduce the error between the predicted load curve and the actual load curve; Step 3: For the electric vehicle load optimization dispatching model, it can be considered that the load aggregator fully grasps the status information of the electric vehicle, so the centralized optimization method of the GA genetic algorithm is used to solve the electric vehicle load optimization dispatching model in step 2; Step 4: Considering the maximization of interests of both parties in the transaction, establish an electric vehicle energy trading model; Step 5: The electric vehicle energy trading model is a distributed optimization model, so the improved particle swarm algorithm is used to solve the electric vehicle energy trading model and obtain the global optimal solution as the result; For the variable sales electricity X={x1,x2,…,x D }, the objective function is the optimization problem of min{f(x)}, and the particle update formula of the standard particle swarm algorithm is as follows: v id (t+1)=w1v id (t)+c1r1(pbest id -x id (t))+c2r2(gbest d -x id (t)); x id (t+1)=x id (t)+v id (t+1); In the formula, v id (t+1) and x id (t+1) are the position and velocity of particle i at t+1; v id (t) and x id (t) are the position and velocity of particle i at t; w is the inertia weight, which decreases linearly with the number of iterations in the standard particle swarm algorithm; pbest id For the particle's own historical experience; gbest d is the particle group experience; c1 and c2 are learning factors, usually 2; r1 and r2 are random numbers uniformly distributed in [0, 1].
2. According to claim 1, a hierarchical energy system optimization scheduling method based on LSTM neural network is characterized in that: The improved particle swarm algorithm described in step 5 is used to solve the electric vehicle energy trading model. The specific operation steps include: Step 5.1: Initialize the particle state, and the particle sells electricity in the trading market; A certain number of particles are randomly generated, each particle represents a solution, that is, a point in the search space; each particle has two properties: position and velocity; Step 5.2: Calculate the fitness function value, that is, calculate the value of the objective function; Step 5.3: Update particle velocity and position; Update the speed and position of each particle according to the current position and speed of the particle, as well as the information of the global optimum and the local optimum. The global optimum is the optimal solution found by all particles in history, and the local optimum is the optimal solution found by a particle in the neighborhood. The improved particle swarm algorithm adopts a new adaptive particle speed and position update strategy. The update formula is as follows: In the above formula, p ad is the average dimension information of particles; Step 5.4: Update the global optimum and local optimum; After updating the speed and position of each particle, recalculate the global optimum and local optimum; if a particle finds a better solution than the current local optimum, set it as the new local optimum; if a particle finds a better solution than the current global optimum, set it as the new global optimum; Step 5.5: Determine whether the stop condition is met; Determine whether the current particle swarm has reached the preset maximum number of iterations. If so, the stop condition is met; Or determine whether the fitness function value of the current particle swarm is small enough. If so, the stopping condition is met; Step 5.6: Return the global optimal solution; If the particle swarm meets the stopping condition, the global optimal solution is returned as the result; if not, it returns to step 5.3 to continue the iteration.
3. According to claim 1, a hierarchical energy system optimization scheduling method based on LSTM neural network is characterized in that: Each LSTM unit in the LSTM network described in step 1 contains three control gates: input gate, forget gate and output gate; the input gate determines how much current input data is input to the memory cell, the forget gate determines how to retain the historical state information of the cell, and the output gate controls how much storage cell state value needs to be output to the current output value; the specific process is as follows: i t =σ(w xi x t +w hi h t-1 +w ci c t-1 +b i ); f t =σ(w xf x t +w hf h t-1 +w cf c t-1 +b f ); c t =f t c t-1 +i t tan(w xc x t +w hc h t-1 +b c ); o t =σ(w xo x t +w ho h t-1 +w co c t-1 +b o ); the t =oh t tank t ; In the formula, x t is the input data, y t is the output value, c t is the storage unit state, b is the offset matrix, w xi 、w xf 、w xc 、w xo All are x t The offset matrix, w hi 、w hf 、w hc 、w ho Both are h t-1 The offset matrix, w ci 、w cf 、w co Both are c t-1 The offset matrix, i t is the output of the input gate at time t, f t is the output of the forget gate, o t is the output of the input gate, σ uses the Sigmoid function; The updated cell state consists of two parts: (a) the information generated by the current new input; (b) the old cell state information at the previous moment.
4. A hierarchical energy system optimization scheduling method based on LSTM neural network according to claim 1 or 3, characterized in that: The specific steps of using the LSTM network to predict the electric vehicle load in the day-ahead market described in step 1 include: Step 1.1: Data preparation: Prepare a time series data set, including historical data and corresponding target values; divide the data set into a training set and a test set to ensure the generalization ability of the model on future data; Step 1.2: Feature engineering; perform feature engineering normalization on the data; Step 1.3: Build the LSTM model; define the structure of the LSTM model, including the number of neurons, the number of layers, and the activation function; set the loss function and optimizer of the model, and use the mean square error as the loss function in the time series prediction task; Step 1.4: Model training; use the training set to train the LSTM model, and use the back propagation algorithm to update the model parameters; use the validation set to adjust the hyperparameters to prevent overfitting; Step 1.5: Model prediction; use the trained LSTM model to predict the test set or future data; compare the predicted results with the actual values to evaluate the performance of the model; Step 1.6: Model evaluation; use the evaluation indicators root mean square error and mean absolute error to evaluate the prediction accuracy of the model.
5. The hierarchical energy system optimization scheduling method based on LSTM neural network according to claim 4 is characterized in that: The normalization process described in step 1.2 is to scale the data to a standard range and eliminate the weight differences between different features due to different dimensions; The minimum-maximum scaling method is used to normalize the data. The scaled data range is between [0,1]. First, the minimum value Z of each feature is calculated. min and the maximum value Z max ; Secondly, apply the following min-max scaling formula to each eigenvalue: In the formula, Z is the eigenvalue, Z min is the minimum eigenvalue, Z max is the maximum value of the eigenvalue, and f is the normalized eigenvalue.
6. The hierarchical energy system optimization scheduling method based on LSTM neural network according to claim 1 is characterized in that: The objective function of the electric vehicle load optimization scheduling model described in step 2 is: Where n is the number of electric vehicles; L(t) is the local basic load; and are the charging and discharging rates of the jth electric vehicle in period t; L fore (t) is the forecast load in time period t; Δt is the scheduling period.
7. The hierarchical energy system optimization scheduling method based on LSTM neural network according to claim 1 is characterized in that: The constraints of the electric vehicle load optimization scheduling model described in step 2 include electric vehicle SOC constraints, electric vehicle charging and discharging constraints, and battery capacity constraints when the electric vehicle arrives and leaves; specifically: Electric vehicle SOC constraints: In the formula, is the battery state of charge of the jth EV in time period t; η c and η d are the charging and discharging efficiencies of electric vehicles, respectively; and are the upper and lower limits of SOC respectively; Electric vehicle charging and discharging constraints: hour; In the formula, and are the maximum charge and discharge rates, respectively; T arrive,j is the time when the jth electric vehicle arrives at the charging station; Battery capacity constraints for electric vehicles when they arrive and leave: In the formula, is the SOC state of the jth electric vehicle when it arrives at the charging station; D j is the daily driving distance of the jth electric vehicle; W is the energy consumption of the electric vehicle when driving; C is the total energy consumption of the electric vehicle; is the SOC state value that the j-th electric vehicle is expected to support the next journey before departure.
8. The hierarchical energy system optimization scheduling method based on LSTM neural network according to claim 1 is characterized in that: The core of the GA genetic algorithm described in step 3 lies in the evolution process of the population. Through continuous selection, crossover, and mutation operations, the individuals in the population are increasingly adapted to the objective function or fitness function of the problem until the optimal solution is reached. Solving the electric vehicle load optimization dispatch model includes the following steps: Step 3.1: Initialization; randomly generate a population, each individual represents a solution; Step 3.2: Evaluation: Evaluate each individual in the population according to the objective function or fitness function of the problem; Step 3.3: Selection: select the better individuals as parents according to their fitness values and keep them for the next generation; Step 3.4: Crossover: Through the crossover operation, different parent genes are combined to produce new offspring; Step 3.5: Mutation: After the crossover operation, some individuals are mutated to increase the diversity of the population. Step 3.6: Replacement: through selection, crossover, and mutation operations, some of the poorer individuals are replaced in the new generation; Step 3.7: Determine the termination condition; if the preset stopping criterion is reached, the algorithm ends and the optimal solution is output; otherwise, return to step 3.2 and continue iterating.
9. The hierarchical energy system optimization scheduling method based on LSTM neural network according to claim 1 is characterized in that: The objective function for maximizing the interests of both parties in step 4 is specifically: Since the buyer's electricity purchase cost and the seller's electricity sales revenue are equal, the above formula is simplified as follows: P Spq =P Bpq ; C p (P Sp )=A p (P Sp ) 2 +B p (P Sp )+D p ; Where P Spq , P Bpq are the electricity sold by seller p to buyer q and the electricity purchased by buyer q from seller p respectively; and P Sp The upper and lower limits of the amount of electricity sold by the seller; and P Bq is the upper and lower limits of the amount of electricity that buyer q can purchase; pq is the transaction price between seller p and buyer q; C p (·) is the cost function for producing electricity for seller p, A p , B p , D p are the cost quadratic function coefficients respectively; P Sp is the total amount of electricity sold by seller p; P Bq is the total amount of electricity purchased by buyer q; U q (·) is the utility function of the electricity purchased by buyer q; G q , H q , K q are the coefficients of the utility quadratic function; N S and N B is the number of sellers and buyers.
Citation Information
Cited By
Intelligent calculation center power supply elastic scheduling system and method
CN119341203A
A power supply elastic scheduling system and method for intelligent computing center
CN119341203B
Electric vehicle hybrid energy storage system energy management method fused with Hemma particle swarm optimization LSTM
CN121019302A
Energy Management Method for Electric Vehicle Hybrid Energy Storage System Integrating Hippo Particle Swarm Optimization Algorithm (LSTM)
CN121019302B
Distributed energy and load coordinated resource optimization scheduling method under machine learning
CN121258088A
