Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, the application provides a power grid energy control method, a device, electronic equipment and a storage medium.
According to a first aspect of the present application, there is provided a power grid energy control method comprising:
Acquiring real-time total load of a micro-grid, real-time generation power of renewable energy sources, real-time electricity price and real-time total energy storage of an energy storage system;
Substituting the real-time total load, the real-time generated power, the real-time electricity price and the real-time total energy storage into a pre-constructed objective function to obtain a power grid energy control model; wherein the objective function comprises a charge-discharge power control parameter for controlling charge-discharge of the energy storage system;
based on the real-time electricity price and/or the real-time generated power, carrying out optimization solution on the power grid energy control model to obtain a real-time value of the charge and discharge power control parameter;
And controlling the energy storage system of the micro-grid to charge or discharge according to the real-time value.
In an optional implementation manner, the optimizing the power grid energy control model to obtain the real-time value of the charge-discharge power control parameter includes:
And carrying out optimization solution on the power grid energy control model through a particle swarm optimization algorithm to obtain a real-time value of the charge and discharge power control parameter, wherein inertia factors, a first acceleration constant and a second acceleration constant in the particle swarm optimization algorithm are mutually constrained.
In an alternative embodiment, before the grid energy control model is optimally solved by a particle swarm optimization algorithm, the method further comprises:
And acquiring a first constraint coefficient and a second constraint coefficient, and determining the inertia factor, the first acceleration constant and the second acceleration constant according to the first constraint coefficient and the second constraint coefficient.
In an alternative embodiment, determining the inertia factor, the first acceleration constant, and the second acceleration constant based on the first constraint coefficient and the second constraint coefficient includes:
Acquiring a first constraint coefficient and a second constraint coefficient, and determining a target constraint coefficient according to the first constraint coefficient and the second constraint coefficient;
determining an inertia factor according to the target constraint coefficient;
determining a first acceleration constant according to the target constraint coefficient and the first constraint coefficient;
and determining a second acceleration constant according to the target constraint coefficient and the second constraint coefficient.
In an alternative embodiment, if the first constraint coefficients and the second constraint coefficients are phi 1、φ2, respectively;
The determining a target constraint coefficient according to the first constraint coefficient and the second constraint coefficient comprises:
According to Determining a target constraint coefficient CF, wherein phi=phi 1+φ2,φ1+φ2 is more than or equal to 4;
The determining an inertia factor according to the target constraint coefficient comprises the following steps:
Performing product operation on a preset coefficient and the target constraint coefficient to obtain an inertia factor;
The determining a first acceleration constant according to the target constraint coefficient and the first constraint coefficient includes:
Performing product operation on the target constraint coefficient and the first constraint coefficient to obtain a first acceleration constant;
said determining a second acceleration constant based on said target constraint coefficients and said second constraint coefficients, comprising:
And performing product operation on the target constraint coefficient and the second constraint coefficient to obtain a second acceleration constant.
In an alternative embodiment, the objective function is:
Wherein, L (t) represents real-time total load, P (t) represents real-time power generation power, C (t) represents real-time electricity price, BL (t) represents real-time total energy storage, t is current time, C min represents lowest electricity price, BL max represents maximum energy storage of the energy storage system, u (t) is a charge and discharge power control parameter, and X (t) represents income of selling electricity to or expenditure of buying electricity from the main power grid.
In an optional implementation manner, the substituting the real-time total load, the real-time generated power, the real-time electricity price and the real-time total energy storage into a pre-constructed objective function to obtain a power grid energy control model includes:
Acquiring average electricity prices in a historical time period;
Determining a penalty function value based on the average power price and the real-time power price;
substituting the real-time total load, the real-time generated power, the real-time electricity price, the punishment function value and the real-time total energy storage into a pre-constructed objective function to obtain a power grid energy control model.
In an alternative embodiment, penalty function f (t) =k-C (t); wherein, C (t) represents the real-time electricity price, and k is the average electricity price.
In an alternative embodiment, the objective function is:
Wherein, L (t) represents real-time total load, P (t) represents real-time power generation power, C (t) represents real-time electricity price, BL (t) represents real-time total energy storage, t is current time, f (t) represents penalty function, C min represents lowest electricity price, BL max represents maximum energy storage of the energy storage system, u (t) is charge and discharge power control parameter, and X (t) represents income of selling electricity to or expenditure of buying electricity from the main power grid.
In an alternative embodiment, based on the real-time electricity price and/or the real-time generated power, the power grid energy control model is optimally solved to obtain the real-time value of the charge-discharge power control parameter, which includes:
If the real-time electricity price is greater than a first electricity price threshold value and/or the real-time generated power is greater than a first power threshold value, determining a real-time value of the charge and discharge power control parameter in the objective function so as to maximize the income of selling electricity to a main power grid;
If the real-time electricity price is smaller than a second electricity price threshold value, determining a real-time value of the charge and discharge power control parameter in the objective function so as to minimize the expenditure of buying electricity to a main power grid; wherein the first electricity price threshold is greater than the second electricity price threshold, and the first power threshold is greater than the second power threshold.
According to a second aspect of the present application, there is provided a grid energy control device comprising:
the acquisition module is used for acquiring the real-time total load of the micro-grid, the real-time generation power of the renewable energy sources, the real-time electricity price and the real-time total energy storage of the energy storage system;
The objective function substituting module is used for substituting the real-time total load, the real-time power generation power, the real-time electricity price and the real-time total energy storage into a pre-constructed objective function to obtain a power grid energy control model; wherein the objective function comprises a charge-discharge power control parameter for controlling charge-discharge of the energy storage system;
The parameter value solving module is used for carrying out optimization solving on the power grid energy control model based on the real-time electricity price and/or the real-time generated power so as to obtain a real-time value of the charge and discharge power control parameter;
and the charge-discharge control module is used for controlling the charge or discharge of the energy storage system of the micro-grid according to the real-time value.
In an optional implementation manner, the parameter value solving module is specifically configured to perform optimization solving on the power grid energy control model through a particle swarm optimization algorithm based on the real-time electricity price and/or the real-time generated power, so as to obtain a real-time value of the charge and discharge power control parameter, where an inertia factor, a first acceleration constant and a second acceleration constant in the particle swarm optimization algorithm are constrained with each other.
In an alternative embodiment, the power grid energy control device further includes:
And the algorithm parameter value determining module is used for acquiring a first constraint coefficient and a second constraint coefficient and determining an inertia factor, a first acceleration constant and a second acceleration constant according to the first constraint coefficient and the second constraint coefficient.
In an alternative embodiment, the algorithm parameter value determining module is specifically configured to determine a target constraint coefficient according to the first constraint coefficient and the second constraint coefficient; determining an inertia factor according to the target constraint coefficient; determining a first acceleration constant according to the target constraint coefficient and the first constraint coefficient; and determining a second acceleration constant according to the target constraint coefficient and the second constraint coefficient.
In an alternative embodiment, if the first constraint coefficients and the second constraint coefficients are phi 1、φ2, respectively;
the numerical value determining unit is specifically used for determining the numerical value according to Determining a target constraint coefficient CF, wherein phi=phi 1+φ2,φ1+φ2 is more than or equal to 4;
Performing product operation on a preset coefficient and the target constraint coefficient to obtain an inertia factor; performing product operation on the target constraint coefficient and the first constraint coefficient to obtain a first acceleration constant; and performing product operation on the target constraint coefficient and the second constraint coefficient to obtain a second acceleration constant.
In an alternative embodiment, the objective function is:
Wherein, L (t) represents real-time total load, P (t) represents real-time power generation power, C (t) represents real-time electricity price, BL (t) represents real-time total energy storage, t is current time, C min represents lowest electricity price, BL max represents maximum energy storage of the energy storage system, u (t) is a charge and discharge power control parameter, and X (t) represents income of selling electricity to or expenditure of buying electricity from the main power grid.
In an alternative embodiment, the objective function is substituted into a module, specifically configured to obtain an average power price in a historical time period, and determine a penalty function value based on the average power price and the real-time power price; substituting the real-time total load, the real-time generated power, the real-time electricity price, the punishment function value and the real-time total energy storage into a pre-constructed objective function to obtain a power grid energy control model.
In an alternative embodiment, penalty function f (t) =k-C (t); wherein, C (t) represents the real-time electricity price, and k is the average electricity price.
In an alternative embodiment, the objective function is:
Wherein, L (t) represents real-time total load, P (t) represents real-time power generation power, C (t) represents real-time electricity price, BL (t) represents real-time total energy storage, t is current time, f (t) represents penalty function, C min represents lowest electricity price, BL max represents maximum energy storage of the energy storage system, u (t) is charge and discharge power control parameter, and X (t) represents income of selling electricity to or expenditure of buying electricity from the main power grid.
In an optional implementation manner, the parameter value solving module is specifically configured to determine a real-time value of the charge-discharge power control parameter in the objective function to maximize revenue of selling electricity to the main power grid if the real-time electricity price is greater than a first electricity price threshold and/or the real-time generated power is greater than a first power threshold; if the real-time electricity price is smaller than a second electricity price threshold value and/or the real-time generated power is smaller than a second power threshold value, determining a real-time value of the charge and discharge power control parameter in the objective function so as to minimize expenditure of buying electricity to a main power grid; wherein the first electricity price threshold is greater than the second electricity price threshold, and the first power threshold is greater than the second power threshold.
According to a third aspect of the present application, there is provided an electronic device comprising:
A processor; and
A memory for storing executable instructions of the processor;
Wherein the processor is configured to perform the method of the first aspect via execution of the executable instructions.
According to a fourth aspect of the present application there is provided a storage medium having stored thereon a computer program which when executed by a processor implements the method of the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
The energy source in the micro-grid can be optimally managed to the maximum extent by utilizing the charge and discharge functions of the energy storage system in the micro-grid. Specifically, the charge-discharge power control parameter may be introduced into the objective function constructed in advance, so that the objective function is changed along with the change of the charge-discharge power control parameter, that is, the value of the charge-discharge power control parameter is adjusted, and the function value of the objective function may be changed. Based on the real-time electricity price and/or the real-time generated power, the value of the charge and discharge power control parameter under the optimal value is obtained by calculating the objective function so as to optimally control the energy storage system. For example, when the real-time electricity price and/or the real-time generated power is low, electricity can be purchased from the main power grid, and the energy storage system is charged to store the electric energy, and the value of the charge-discharge power control parameter is the optimal charge power. And selling electricity to the main power grid when the real-time electricity price and/or the real-time generated power are high, wherein the value of the charge and discharge power control parameter is the optimal discharge power. By controlling the energy storage system in the mode, more flexible energy management can be provided for the micro-grid, the electric energy in the micro-grid can be improved under the condition of not increasing the operation cost, the electric energy in the micro-grid is maximized, and the utilization rate of the micro-grid energy is improved.
The particle swarm optimization algorithm is improved, namely, the inertia factor, the first acceleration constant and the second acceleration constant in the particle swarm optimization algorithm are mutually constrained, so that the stability of speed change can be adjusted, the speed is prevented from increasing to an unacceptable level in a plurality of iterations, and the stability of the particle swarm optimization algorithm is improved.
Detailed Description
In order that the above objects, features and advantages of the application will be more clearly understood, a further description of the application will be made. It should be noted that, without conflict, the embodiments of the present application and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, but the present application may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the application.
Referring to fig. 1, fig. 1 is a schematic diagram of a system architecture of a power grid energy control method according to an embodiment of the present application. The system architecture comprises: a main grid and a micro grid, which is a small-scale power system, for example, a community grid or the like.
The micro-grid includes: the energy storage system, the renewable energy source and the central control unit, wherein the renewable energy source is added into the micro-grid as an intermittent energy source, thereby meeting the increasing power demand and reducing the emission of greenhouse gases. Currently, community-configured power generation facilities mainly include wind power generation facilities and solar power generation facilities, and thus renewable energy sources mainly include wind energy and solar energy. The power of wind power generation may be denoted as P WT (t), the power of solar power generation may be denoted as P ST (t), and both wind power generation and solar power generation are time-varying, i.e., P WT (t) corresponding to different times t are different, and P ST (t) corresponding to different times t are also different.
Since wind power generation and solar power generation sometimes have excess power, micro-grids often have energy storage systems. Common energy storage systems include supercapacitors, electrochemical cells, superconducting magnetic energy storage, compressed air energy storage, flywheel energy storage, and the like. The energy storage systems have different characteristics, including response time, storage capacity, leakage current capacity and the like, and the applicable energy storage systems can be selected according to different scales and different requirements. Electrochemical cells have long been the product of electrostatic discharge, and thus the present application may be used with choice of electrochemical cells as energy storage systems.
If the energy storage system is charged, the total energy BL (t) of the energy storage system at time t can be expressed as:
BL(t)=BL(t-1)+ΔtPc(t)ηc,
Wherein BL (t-1) represents total energy of the energy storage system at time t-1, Δt represents a time difference between time t and time t-1, for example Δt may be half an hour, that is, the total energy of the energy storage system may be updated every half an hour, P c (t) represents charging power of the energy storage system at time t, η c represents charging efficiency of the energy storage system at time t.
BL (t) satisfies the following condition: BL max>BL(t)>BLmin,BLmax represents the maximum energy stored by the energy storage system, and BL min represents the minimum energy stored by the energy storage system.
P c (t) satisfies the following condition: p c,max>Pc>0,Pc,max denotes the maximum charging power.
If the energy storage system is discharged, the total energy BL (t) of the energy storage system at time t can be expressed as:
BL(t)=BL(t-1)+ΔtPd(t)ηd,
Wherein P d (t) represents the discharge power of the energy storage system at the time t, and eta d represents the discharge efficiency of the energy storage system at the time t.
P d (t) satisfies the following condition: p d,max<Pd<0,Pd,max represents the maximum discharge power.
The energy storage system can store electric energy when the electricity price is low and sell the electric energy when the electricity price is high, so that the operation cost is reduced to the maximum extent, and more flexible energy management is provided for the community micro-grid. The application of the energy storage system improves the stability of the power grid, improves the capacity of a power transmission line, balances a load curve, reduces voltage fluctuation and improves the power supply quality and reliability.
The central control unit can efficiently manage the energy of the micro-grid by utilizing the electric energy of the energy storage system during the operation of the grid, so as to ensure the local power demand of the micro-grid. Meanwhile, the system can exchange power with a main power grid when the local power generation is excessive or insufficient, so that the aims of energy conservation and emission reduction are fulfilled, and the lowest energy cost and the optimal control strategy are realized.
Referring to fig. 2, fig. 2 is a flowchart of a method for controlling power grid energy according to an embodiment of the present application, which may include the following steps:
Step S210, acquiring real-time total load of the micro-grid, real-time generated power of renewable energy sources, real-time electricity price and real-time total energy storage of an energy storage system.
In the embodiment of the application, the total load in the micro-grid, the power generation power of the renewable energy source, the electricity price and the total energy storage of the energy storage system are all changed along with time, and the real-time total load of the micro-grid, the real-time power generation power of the renewable energy source, the real-time electricity price and the real-time total energy storage of the energy storage system refer to the total load at the current moment, the power generation power at the current moment, the electricity price at the current moment and the total energy storage at the current moment respectively.
The real-time total load of the micro-grid is the sum of the power of the electric appliances currently running simultaneously in the micro-grid, and can be obtained through equipment monitoring. The real-time power generated by the renewable energy source can comprise the current wind power generation power and the current solar power generation power, and can be obtained through a power test. The real-time electricity price refers to the current electricity price, and the electricity prices of different time periods can be different, for example, the electricity price of a peak period is higher, the electricity price of a low peak period is lower, and the electricity price is directly acquired according to the time period of the current time.
Step S220, substituting the real-time total load, the real-time generated power, the real-time electricity price and the real-time total energy storage into a pre-constructed objective function to obtain a power grid energy control model; the objective function comprises a charge and discharge power control parameter for controlling the charge and discharge of the energy storage system.
The charge and discharge functions of the energy storage system can be considered in the objective function, and charge and discharge power control parameters are introduced, wherein the charge and discharge power control parameters are used for indicating the current charge control of the energy storage system or the current discharge control of the energy storage system. When the charge control of the energy storage system is instructed, the charge power can be instructed, and when the discharge control of the energy storage system is instructed, the discharge power can be instructed. The function value of the power grid energy control model is optimized by calculating the value of the charge and discharge power control parameter, so that the optimal control function on the energy storage system can be obtained, and the optimal management of the power grid energy is realized.
And step S230, carrying out optimization solution on the power grid energy control model based on the real-time electricity price and/or the real-time generated power so as to obtain the real-time value of the charge and discharge power control parameter.
In the constructed objective function, the values of the charge and discharge power control parameters are changed, so that the function values of different objective functions can be obtained. In order to optimize the power grid energy, a preset algorithm (for example, a particle swarm optimization algorithm or the like) may be utilized to perform optimization solution on the power grid energy control model, that is, calculate a real-time value of the charge and discharge power control parameter corresponding to the function value of the objective function reaching the optimal value. Wherein, when the real-time value of the charge-discharge power control parameter is positive, the larger the value is, the larger the charge power is, the smaller the value is, the larger the discharge power is.
It should be noted that, the objective function of the embodiment of the present application includes a case of buying electricity from the main power grid and a case of selling electricity to the main power grid, where electricity may be really bought from or sold to the main power grid according to the real-time electricity price and/or the real-time generated power. For example, electricity may be sold to the main grid at a higher real-time electricity price and/or real-time generated power, and electricity may be purchased from the main grid at a lower real-time electricity price and/or real-time generated power.
Accordingly, the function value optimization of the objective function includes: under the condition of buying electricity from a main power grid, the function value of the objective function is minimum; the function value of the objective function is the largest in case of selling electricity to the main grid. Optionally, if the real-time electricity price is greater than the first electricity price threshold value and/or the real-time generated power is greater than the first power threshold value, determining a real-time value of the charge and discharge power control parameter in the objective function so as to maximize the income of selling electricity to the main power grid; if the real-time electricity price is smaller than the second electricity price threshold value and/or the real-time generated power is smaller than the second power threshold value, determining the real-time value of the charge and discharge power control parameter in the objective function so as to minimize the expenditure of buying electricity to the main power grid; wherein the first power rate threshold is greater than the second power rate threshold and the first power threshold is greater than the second power threshold.
For example, in the case of considering only the real-time electricity price, if the first electricity price threshold is 0.9, the second electricity price threshold is 0.6, the real-time electricity price is 1 yuan per degree, and is higher than the first electricity price threshold, electricity can be sold to the main power grid, and the maximum value of the objective function is calculated, namely, the selling income is increased as much as possible; if the real-time electricity price is 0.5 yuan per degree and is lower than the second electricity price threshold value, electricity can be purchased from the main power grid, and the minimum value of the objective function is calculated, namely the electricity purchasing expenditure is reduced as much as possible. In this way, the total power inside the micro grid can be increased without increasing the cost. And the real-time generated power is considered, or the real-time electricity price is considered, and meanwhile, the real-time generated energy is considered, so that electricity is purchased from the main power grid or sold to the main power grid.
Step S240, controlling the charging or discharging of the energy storage system of the micro-grid according to the real-time value.
As described above, when the real-time value of the charge/discharge power control parameter is positive, charging is indicated, and when the real-time value is negative, discharging is indicated, so that charging or discharging of the energy storage system of the micro-grid can be directly controlled according to the real-time value.
The power grid energy control method provided by the embodiment of the application can utilize the charge and discharge functions of the energy storage system in the micro-grid to optimally manage the energy in the micro-grid to the maximum extent. Specifically, the charge-discharge power control parameter is introduced into the objective function, so that the objective function is changed along with the change of the charge-discharge power control parameter, that is, the value of the charge-discharge power control parameter is adjusted, and the function value of the objective function can be changed. Based on the real-time electricity price and/or the real-time generated power, the value of the charge and discharge power control parameter under the optimal value is obtained by calculating the objective function so as to optimally control the energy storage system. For example, when the real-time electricity price and/or the real-time generated power is low, electricity can be purchased from the main power grid, and the energy storage system is charged to store the electric energy, and the value of the charge-discharge power control parameter is the optimal charge power. And selling electricity to the main power grid when the real-time electricity price and/or the real-time generated power are high, wherein the value of the charge and discharge power control parameter is the optimal discharge power. By controlling the energy storage system in the mode, more flexible energy management can be provided for the micro-grid, the electric energy in the micro-grid can be improved under the condition of not increasing the operation cost, the electric energy in the micro-grid is maximized, and the utilization rate of the micro-grid energy optimization is improved.
Referring to fig. 3, fig. 3 is a flowchart of another power grid energy control method according to an embodiment of the present application, which may include the following steps:
Step S310, acquiring real-time total load of the micro-grid, real-time generation power of renewable energy sources, real-time electricity price and real-time total energy storage of an energy storage system.
This step is the same as step S210 in the embodiment of fig. 2, and is specifically referred to the description in the embodiment of fig. 2, and will not be repeated here.
Step S320, substituting the real-time total load, the real-time generated power, the real-time electricity price and the real-time total energy storage into a pre-constructed objective function to obtain a power grid energy control model; the objective function comprises a charge and discharge power control parameter for controlling the charge and discharge of the energy storage system.
As described above, the objective function is a function that varies with a variation of the charge-discharge power control parameter, and in the related art, the objective function constructed in advance can be expressed as: y (t) =g (t) C (t),
Where g (t) represents the power sold to or purchased from the main grid and Y (t) represents the revenue of selling or paying out from the main grid.
In an alternative embodiment, if the real-time total load is L (t), the real-time generated power is P (t), P (t) may include P WT (t) and P ST (t), the real-time electricity price is C (t), the real-time total energy storage is BL (t), and t is the current time;
Since the energy conservation, i.e., the energy generated at time t is equal to the energy consumed, i.e., g (t) +p (t) =l (t) +u (t), therefore, g (t) =l (t) -P (t) +u (t), u (t) is a charge-discharge power control parameter, where u (t) is a positive value indicates charge, a larger value indicates charge power, a smaller value indicates discharge, and a smaller value indicates discharge power; substituting g (t) into the objective function Y (t) can result in:
Y(t)=(L(t)-P(t)+u(t))C(t);
combining the lowest electricity price C min with the charge and discharge functions of the energy storage system, the determining objective function may be:
Wherein BL max represents the maximum energy storage of the energy storage system, and X (t) represents the income of selling electricity to the main power grid or the expenditure of buying electricity from the main power grid.
And substituting the real-time total load, the real-time generated power, the real-time electricity price and the real-time total energy storage into the objective function to obtain the power grid energy control model. It can be understood that the grid energy control model includes an objective function and a constraint condition corresponding to energy conservation, i.e., g (t) +p (t) =l (t) +u (t).
It can be seen from the objective function that the change of the real-time electricity price has a larger influence on the function value of the objective function, and a penalty function can be introduced in order to fully consider the change of the electricity price. Alternatively, an average power rate over a historical period of time (which may be, for example, half an hour before the current time of day) may be obtained, and a penalty function value is determined based on the average power rate and the real-time power rate. Alternatively, if the real-time electricity rate is C (t) and the average electricity rate is k, the penalty function value may be determined based on the penalty function f (t) =k-C (t). Of course, the manner of determining the penalty function is not limited thereto.
After introducing the penalty function, the objective function may be:
it can be seen that in special cases, i.e. when the real-time electricity price is equal to the average electricity price, the function value of the penalty function is 0, and the objective function can be reduced to:
X (t) = (L (t) -P (t) +u (t)) C (t), i.e., the same as the aforementioned objective function Y (t).
Step S330, a first constraint coefficient and a second constraint coefficient are obtained, and inertia factors, a first acceleration constant and a second acceleration constant in a particle swarm optimization algorithm are determined according to the first constraint coefficient and the second constraint coefficient; wherein the inertia factor, the first acceleration constant and the second acceleration constant are constrained with each other.
In the embodiment of the application, the particle swarm optimization algorithm can be improved, and the value of the charge and discharge power control parameter in the objective function is solved through the improved particle swarm optimization algorithm. Specifically, the particle swarm optimization algorithm considers two model equations of position and velocity of a two-dimensional solution space, whereinRepresenting the speed of the kth iteration of the ith particle,/>Indicating the position of the kth iteration of the ith particle. p i represents the optimal position of the ith particle, and p d represents the optimal position.
If the particle velocity is not limited while the particle swarm optimization algorithm is running, the velocity may increase to an unacceptable level over several iterations. Therefore, the application adjusts the stability of the speed variation by introducing a constraint coefficient. The particle swarm optimization algorithm may be expressed as follows:
Wherein, As inertia factors, C 1 is a first acceleration constant representing an individual learning factor of each particle, and C 2 is a second acceleration constant representing a social learning factor of each particle. r 1,r2 denotes two random numbers and k denotes the number of iterations.
In order to adjust the stability of speed change and achieve the purpose of constraint coefficient, in the embodiment of the application, the method can be establishedThe connection between C 1 and C 2 makes the three mutually constrained. In an alternative embodiment, a first constraint coefficient and a second constraint coefficient may be obtained, and a target constraint coefficient is determined according to the first constraint coefficient and the second constraint coefficient; determining an inertia factor according to the target constraint coefficient; determining a first acceleration constant according to the target constraint coefficient and the first constraint coefficient; and determining a second acceleration constant according to the target constraint coefficient and the second constraint coefficient. I.e. inertial factor/>The first acceleration constant C 1 and the second acceleration constant C 2 are values related to the target constraint coefficients, that is, the three are mutually constrained.
For example, if the first constraint coefficient and the second constraint coefficient are phi 1、φ2, respectively; can be according toDetermining a target constraint coefficient CF, wherein phi=phi 1+φ2,φ1+φ2 is more than or equal to 4;
after determining the target constraint coefficient, performing product operation on the preset coefficient and the target constraint coefficient to obtain an inertia factor; i.e. according to: determination/> W is a preset coefficient, that is, a preset coefficient, may be 0.7, etc., which is not limited in the present application. Performing product operation on the target constraint coefficient and the first constraint coefficient to obtain a first acceleration constant; that is, C 1 is determined according to C 1=CFφ1, and the product operation is performed on the target constraint coefficient and the second constraint coefficient, so as to obtain a second acceleration constant, that is, C 2 is determined according to C 2=CFφ2.
And step S340, carrying out optimization solution on the power grid energy control model through a particle swarm optimization algorithm based on the real-time electricity price and/or the real-time generated power so as to obtain the real-time value of the charge and discharge power control parameter.
In the embodiment of the present application, the calculation process of the particle swarm optimization algorithm can be seen in fig. 4, which includes the following steps:
step S410, initializing the position and velocity of each particle in the particle swarm.
Under initial conditions, the charge-discharge power control parameter u (t) may be set to a series of values, and a series of values (u min,umax) from the minimum to the maximum may be set according to history experience. The optimal u (t) is found from this series of values using an improved particle swarm optimization algorithm. Each of the particle swarm optimization algorithmsCorresponds to a u (t) value. The initialized position of each particle, i.e., the initialized u (t) value, and the initialized velocity of each particle are used to update the position of each particle in step S440 described below.
Step S420, determining a function value of an objective function corresponding to each particle based on the position of each particle.
Step S430, comparing the function values of the objective functions corresponding to all particles to determine the optimal position of each particle and the optimal position of all particles.
Step S440, the position of each particle is updated.
Specifically, the following formula may be used:
The location of each particle is updated.
Step S450, judging whether the termination condition is reached, if not, returning to step S420, and if so, ending the flow.
In the embodiment of the present application, the termination condition may be the number of iterations, for example, the number of iterations may be set to 100. If the current iteration number does not reach 100 times, step S420 is continued, and if 100 times are reached, step S460 is performed.
In step S460, the optimal positions in all the particles are used as the real-time values of the charge/discharge power control parameters.
The optimal position among all the particles obtained by calculation is the optimal u (t).
And step S350, controlling the charging or discharging of the energy storage system of the micro-grid according to the real-time value.
After the optimal u (t) is obtained, the charging or discharging of the energy storage system can be controlled according to the u (t), so that the energy utilization rate is highest, and the lowest energy cost is realized.
According to the power grid energy control method, the inertia factor, the first acceleration constant and the second acceleration constant in the speed iteration formula are mutually constrained by improving the particle swarm optimization algorithm, so that the stability of speed change is adjusted. Therefore, when the position is iterated through the speed of stable change, the stability of the position change can be improved, and further, when the optimal position is calculated, the accuracy of determining the optimal position can be improved, so that the charge and discharge control of the energy storage system is optimal, and the utilization rate of the micro-grid energy is improved.
Corresponding to the above method embodiment, the embodiment of the present application further provides a power grid energy control device, referring to fig. 5, where the power grid energy control device 500 includes:
The acquiring module 510 is configured to acquire a real-time total load of the micro-grid, a real-time generated power of the renewable energy source, a real-time electricity price, and a real-time total energy storage of the energy storage system;
The objective function substitution module 520 is configured to substitute the real-time total load, the real-time generated power, the real-time electricity price and the real-time total energy storage into a pre-constructed objective function to obtain a power grid energy control model; the objective function comprises a charge-discharge power control parameter for controlling the charge and discharge of the energy storage system;
The parameter value solving module 530 is configured to perform optimization solving on the power grid energy control model based on the real-time electricity price and/or the real-time generated power, so as to obtain a real-time value of the charge-discharge power control parameter;
and the charge and discharge control module 540 is used for controlling the charge or discharge of the energy storage system of the micro-grid according to the real-time value.
In an alternative embodiment, the parameter value solving module 530 is specifically configured to perform optimization solving on the power grid energy control model by using a particle swarm optimization algorithm based on the real-time electricity price and/or the real-time generated power, so as to obtain a real-time value of the charge/discharge power control parameter, where an inertia factor, a first acceleration constant and a second acceleration constant in the particle swarm optimization algorithm are constrained with each other.
In an alternative embodiment, the power grid energy control device further comprises:
The algorithm parameter value determining module is used for acquiring the first constraint coefficient and the second constraint coefficient, and determining an inertia factor, a first acceleration constant and a second acceleration constant according to the first constraint coefficient and the second constraint coefficient.
In an alternative embodiment, the algorithm parameter value determining module is specifically configured to determine the target constraint coefficient according to the first constraint coefficient and the second constraint coefficient; determining an inertia factor according to the target constraint coefficient; determining a first acceleration constant according to the target constraint coefficient and the first constraint coefficient; and determining a second acceleration constant according to the target constraint coefficient and the second constraint coefficient.
In an alternative embodiment, if the first constraint coefficient and the second constraint coefficient are phi 1、φ2, respectively;
A numerical value determining unit, particularly for determining according to Determining a target constraint coefficient CF, wherein phi=phi 1+φ2,φ1+φ2 is more than or equal to 4;
Performing product operation on the preset coefficient and the target constraint coefficient to obtain an inertia factor; performing product operation on the target constraint coefficient and the first constraint coefficient to obtain a first acceleration constant; and performing product operation on the target constraint coefficient and the second constraint coefficient to obtain a second acceleration constant.
In an alternative embodiment, the objective function is:
Wherein, L (t) represents real-time total load, P (t) represents real-time power generation power, C (t) represents real-time electricity price, BL (t) represents real-time total energy storage, t is current time, C min represents lowest electricity price, BL max represents maximum energy storage of the energy storage system, u (t) is a charge and discharge power control parameter, and X (t) represents income of selling electricity to or expenditure of buying electricity from the main power grid.
In an alternative embodiment, the objective function is substituted into the module 520, specifically configured to obtain an average power price in a historical period, and determine a penalty function value based on the average power price and the real-time power price; substituting the real-time total load, the real-time power generation power, the real-time electricity price, the punishment function value and the real-time total energy storage into a pre-constructed objective function to obtain a power grid energy control model.
In an alternative embodiment, penalty function f (t) =k-C (t); wherein, C (t) represents the real-time electricity price, and k is the average electricity price.
In an alternative embodiment, the objective function is:
Wherein, L (t) represents real-time total load, P (t) represents real-time power generation power, C (t) represents real-time electricity price, BL (t) represents real-time total energy storage, t is current time, f (t) represents penalty function, C min represents lowest electricity price, BL max represents maximum energy storage of the energy storage system, u (t) is charge and discharge power control parameter, and X (t) represents income of selling electricity to or expenditure of buying electricity from the main power grid.
In an alternative embodiment, the parameter value solving module 530 is specifically configured to determine a real-time value of the charge/discharge power control parameter in the objective function to maximize the revenue of selling electricity to the main grid if the real-time electricity price is greater than the first electricity price threshold and/or the real-time generated power is greater than the first power threshold; if the real-time electricity price is smaller than the second electricity price threshold value and/or the real-time generated power is smaller than the second power threshold value, determining the real-time value of the charge and discharge power control parameter in the objective function so as to minimize the expenditure of buying electricity to the main power grid; wherein the first power rate threshold is greater than the second power rate threshold and the first power threshold is greater than the second power threshold.
Specific details of each module or unit in the above apparatus have been described in the corresponding method, and thus are not described herein.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
The embodiment of the application also provides electronic equipment, which comprises: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the steps of the above-described grid energy control method.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the application. It should be noted that, the electronic device 600 shown in fig. 6 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 6, the electronic device 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for system operation are also stored. The central processing unit 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a Local Area Network (LAN) card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. When being executed by the central processing unit 601, performs the various functions defined in the apparatus of the present application.
In an embodiment of the present application, a computer readable storage medium is further provided, on which a computer program is stored, which when executed by a processor, implements the above-mentioned grid energy control method.
The computer readable storage medium according to the present application may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, radio frequency, and the like, or any suitable combination of the foregoing.
In an embodiment of the present application, a computer program product is provided, which when run on a computer causes the computer to execute the above-mentioned grid energy control method.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a specific embodiment of the application to enable those skilled in the art to understand or practice the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.