Microgrid capacity configuration method and device based on improved particle swarm algorithm

By improving the particle swarm algorithm, appropriate update parameters are set for the energy fluctuations caused by new energy power generation in the microgrid, which solves the problem of slow convergence speed of the traditional algorithm, improves the efficiency of capacity allocation, and meets the energy fluctuations caused by new energy power generation. Volatility demand.

CN118630839BActive Publication Date: 2024-10-11STATE GRID ZHEJIANG ELECTRIC POWER CO LTD HANGZHOU QIANTANG DISTRICT POWER SUPPLY CO +4
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411087719.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-10-11
Estimated Expiration
2044-08-09

AI Technical Summary

Technical Problem

Due to the slow convergence speed of the traditional microgrid capacity allocation algorithm, it is difficult to meet the energy fluctuation demand brought by new energy power generation, resulting in low capacity allocation efficiency.

Method used

An improved particle swarm algorithm is used to generate initial particles and perform iterative solutions based on the microgrid operating costs. Update parameters are set for different energy operating states to improve the efficiency of the particle speed update algorithm and ensure rapid convergence to the feasible region.

Benefits of technology

It can quickly solve the energy fluctuations caused by new energy power generation, improve the efficiency of microgrid capacity allocation, and meet practical application needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118630839B_ABST
    Figure CN118630839B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of energy storage system configuration, and discloses a microgrid capacity configuration method and device based on an improved particle swarm algorithm, wherein initial particles are generated according to the number of new energy power generation units, hydrogen energy storage units, and battery energy storage units in the microgrid; the microgrid operation cost is used as the particle fitness, and the initial particles are iterated and the optimal solution is obtained, wherein in each iteration process, the energy operation state of the microgrid corresponding to each current particle is analyzed to determine the particle update parameter, and the corresponding particle is updated based on the particle update parameter to participate in the next iteration; the number of new energy power generation units, hydrogen energy storage units, and battery energy storage units is adjusted according to the optimal solution to realize the capacity configuration of the microgrid. Its beneficial effect is that it can quickly obtain a feasible solution to the energy volatility of the microgrid containing new energy power generation, thereby improving the efficiency of microgrid capacity configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of energy storage system configuration, and in particular to a microgrid capacity configuration method and device based on an improved particle swarm algorithm. Background Art

[0002] A microgrid is an electric power system composed of distributed power sources, energy storage devices, loads and other equipment. Currently, distributed energy using renewable energy generation technology is being used more and more widely in microgrids. Due to the intermittent and volatile nature of renewable energy generation, relevant energy storage devices need to be configured to achieve a balance between energy supply and demand. Therefore, how to reasonably adjust the above-mentioned equipment to achieve microgrid capacity configuration has become the current research focus.

[0003] For microgrids that contain renewable energy power generation, the energy fluctuations are usually large during their operation. In related technologies, traditional capacity configuration methods are difficult to meet actual application needs due to problems such as high algorithm complexity and slow solution convergence speed, resulting in low capacity configuration efficiency for microgrids. Summary of the invention

[0004] The present application provides a microgrid capacity configuration method and device based on an improved particle swarm algorithm, which solves the technical problem that the traditional capacity configuration algorithm has a slow solution convergence speed, resulting in reduced microgrid capacity configuration efficiency, and achieves the technical effect of being able to quickly obtain a feasible solution to the energy volatility of a microgrid containing renewable energy power generation, thereby improving the microgrid capacity configuration efficiency.

[0005] In order to achieve the above objectives, the main technical solutions adopted in this application include:

[0006] In a first aspect, an embodiment of the present application provides a microgrid capacity configuration method based on an improved particle swarm algorithm, the microgrid capacity configuration method comprising:

[0007] Generate initial particles according to the number of renewable energy generation units, hydrogen energy storage units and battery energy storage units in the microgrid;

[0008] The microgrid operation cost is used as the particle fitness, and the initial particles are iterated to obtain the optimal solution, wherein the energy operation state of the microgrid corresponding to each current particle is analyzed in each iteration process to determine the particle update parameter, and the corresponding particle is updated based on the particle update parameter to participate in the next iteration;

[0009] The number of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit is adjusted according to the optimal solution to achieve capacity configuration of the microgrid.

[0010] The microgrid capacity configuration method proposed in the embodiment of the present application sets different update parameters for different energy operation states in the microgrid to improve the traditional particle velocity update algorithm, thereby helping to accelerate particles to leave the infeasible domain and find a feasible solution during the solution process. It can be seen that the embodiment of the present application can take into account the energy fluctuations caused by renewable energy power generation in the microgrid, set update parameters that are more in line with the actual physical meaning for different energy operation states, and adaptively guide the adjustment of the particle velocity update algorithm, which helps particles find a more reliable direction of movement to the optimal solution, speeds up iteration and solution speed, and achieves the effect of quickly converging the feasible domain and improving the efficiency of microgrid capacity configuration, thereby meeting the actual application needs of microgrids containing renewable energy power generation.

[0011] Optionally, generating initial particles according to the number of new energy power generation units, hydrogen energy storage units and battery energy storage units in the microgrid includes:

[0012] Obtaining a basic number of the new energy power generation units required to meet user loads on several typical days, setting a value interval based on the basic number, and randomly selecting an integer in the value interval as each initial number of the new energy power generation units;

[0013] For each initial number of the new energy power generation units, the initial numbers of the hydrogen energy storage units and the battery energy storage units are calculated based on the following formula:

[0014] ;

[0015] In the formula, is the number of the new energy power generation units corresponding to the mth particle, is the number of the hydrogen energy storage units corresponding to the mth particle, is the number of the battery energy storage units corresponding to the mth particle, is the power generation power of the new energy power generation unit at the t-th sampling time on the i-th typical day, is the user load at the t-th sampling time on the i-th typical day, is the rated hydrogen power of the hydrogen energy storage unit, is the rated power generation of the hydrogen energy storage unit, is the rated charging power of the battery energy storage unit, is the rated discharge power of the battery energy storage unit, is the total number of typical days, is the total number of sampling moments;

[0016] Will , and As the initial position of the m-th particle, to generate the m-th initial particle.

[0017] The embodiment of the present application considers directly obtaining the initial number of new energy power generation units, hydrogen energy storage units and battery energy storage units to meet the actual power distribution needs, so as to achieve the purpose of generating initial particles. It can be seen that compared with the traditional particle solving algorithm that randomly generates initial particles in a wide area, the embodiment of the present application adopts a method of randomly generating initial particles within a certain range, which can increase the speed of particles entering the feasible domain, thereby increasing the speed of solving the subsequent optimal solution.

[0018] Optionally, taking the microgrid operation cost as the particle fitness includes:

[0019] Based on the microgrid power cost and the new energy power abandonment rate corresponding to each of the particles, determining the maximum value of the microgrid power cost and the maximum value of the new energy power abandonment rate;

[0020] Calculating a ratio of a microgrid power cost corresponding to each of the particles to a maximum value among the microgrid power costs to obtain a first ratio, and calculating a ratio of a new energy power abandonment rate corresponding to each of the particles to a maximum value among the new energy power abandonment rates to obtain a second ratio;

[0021] The sum of the first ratio and the second ratio is taken as the particle fitness.

[0022] The embodiment of the present application aims at solving the multi-objective optimization needs of microgrid capacity configuration, and uses a fuzzy membership function normalization compromise method to compromise the two optimization goals of minimizing the microgrid power cost and minimizing the new energy power abandonment rate, and uses the objective function obtained by the compromise as the particle fitness, thereby meeting the multi-objective optimization needs of microgrid capacity configuration.

[0023] Optionally, the analyzing the energy operation state of the microgrid corresponding to each current particle in each iteration process includes:

[0024] Determine whether the hydrogen storage level of the hydrogen energy storage unit and the charge state of the battery energy storage unit corresponding to each particle currently meet the preset capacity constraint condition at the same time, wherein if the capacity constraint condition is met, the energy operation state is a normal operation state; if the capacity constraint condition is not met, the energy operation state is a first abnormal operation state;

[0025] The first product of the power generation power of the new energy power generation unit corresponding to each particle and the number of the new energy power generation units is obtained respectively, and the first product is compared with the user load. When the first product is less than or equal to the user load, if the maximum total output of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit cannot meet the user load, the energy operation state is the second abnormal operation state.

[0026] In the process of analyzing the energy operation status, the embodiment of the present application can specifically identify whether the abnormal operation status is caused by the microgrid's energy supply failing to meet the user's load, or the abnormal operation status is caused by the microgrid exceeding the capacity constraint, and then use the reasonable analysis of the abnormal operation status to help adjust the speed update method of the accelerated particles in the subsequent process to accelerate the particles to converge to the feasible domain.

[0027] Optionally, when the analysis result of the energy operation state is a normal operation state, determining a particle update parameter, and updating a corresponding particle based on the particle update parameter so as to participate in the next iteration includes:

[0028] According to the initial hydrogen storage level of the hydrogen energy storage unit and the initial state of charge of the battery energy storage unit, the first energy index corresponding to each particle is calculated based on the following formula:

[0029] ;

[0030] In the formula, is the first energy index of the particle corresponding to the i-th typical day, is the rated capacity of the hydrogen energy storage unit, The high calorific value of hydrogen. is the last sampling time of the hydrogen energy storage unit on the i-th typical day Hydrogen production level, SOH ini is the initial hydrogen storage level of the hydrogen energy storage unit, is the number of the battery energy storage units corresponding to the mth particle, is the rated capacity of the battery energy storage unit, is the last sampling time of the battery energy storage unit on the i-th typical day State of charge, SOC ini is the initial state of charge of the battery energy storage unit, is the power generation power of the new energy power generation unit at the t-th sampling moment on the i-th typical day;

[0031] Determine a minimum value among the first energy indicators, calculate a second product of the minimum value and a transposed vector of a preset first adjustment vector, and use the second product as a speed adjustment amount under the normal operating state;

[0032] Using the speed adjustment amount in the normal operating state as the particle update parameter to adjust the speed of the corresponding particle;

[0033] The position of the corresponding particle is updated according to the adjusted particle speed, and then the updated particle participates in the next iteration.

[0034] Optionally, the initial hydrogen storage level of the hydrogen energy storage unit and the initial state of charge of the battery energy storage unit are determined according to the following steps:

[0035] Obtaining the upper limit and lower limit of the hydrogen storage level set in the capacity constraint condition, and taking the average value of the upper limit and lower limit of the hydrogen storage level as the initial hydrogen storage level of the hydrogen energy storage unit;

[0036] The state of charge upper limit and the state of charge lower limit set in the capacity constraint condition are obtained, and an average value of the state of charge upper limit and the state of charge lower limit is used as the initial state of charge of the battery energy storage unit.

[0037] In the case of normal operation, the energy difference is calculated to determine whether the scale of the new energy power generation unit can continue to shrink or expand, thereby guiding the adjustment of the particle update speed. At the same time, on the basis of retaining the traditional speed update algorithm, the particle optimization process is more compatible with the actual optimization significance of microgrid capacity configuration, which helps particles find a more reliable direction of movement to the optimal solution, speeds up the iteration speed, and then realizes the rapid solution of the optimal solution, thereby improving the efficiency of microgrid capacity configuration.

[0038] Optionally, when the analysis result of the energy operation state is the first abnormal operation state, determining the particle update parameter, and updating the corresponding particle based on the particle update parameter so as to participate in the next iteration includes:

[0039] Acquire a first excess value of the hydrogen energy storage unit exceeding the capacity constraint condition, and acquire a second excess value of the battery energy storage unit exceeding the capacity constraint condition;

[0040] Acquire a first excess value of the hydrogen energy storage unit exceeding the capacity constraint condition, and acquire a second excess value of the battery energy storage unit exceeding the capacity constraint condition;

[0041] constructing a second adjustment vector, wherein a first dimension element of the second adjustment vector is zero, a second dimension element of the second adjustment vector is the first excess value, and a third dimension element of the second adjustment vector is the second excess value;

[0042] taking a third product of the transposed vector of the second adjustment vector, the position of the corresponding particle and the preset coefficient as a speed adjustment amount under the first abnormal operating state;

[0043] Using the speed adjustment amount in the first abnormal operation state as the particle update parameter to adjust the speed of the corresponding particle;

[0044] The position of the corresponding particle is updated according to the adjusted particle speed, and then the updated particle participates in the next iteration.

[0045] Optionally, when the analysis result of the energy operation state is the second abnormal operation state, determining the particle update parameter, and updating the corresponding particle based on the particle update parameter so as to participate in the next iteration includes:

[0046] The second energy index corresponding to the particle is calculated based on the following formula:

[0047]

[0048] In the formula, is the second energy index corresponding to the particle, is the user load at the t-th sampling time on the i-th typical day, is the power generation power of the new energy power generation unit at the t-th sampling time on the i-th typical day, is the power generation power of the hydrogen energy storage unit at the t-th sampling time on the i-th typical day, is the rated discharge power of the battery energy storage unit, is the number of the new energy power generation units corresponding to the mth particle, is the number of the hydrogen energy storage units corresponding to the mth particle;

[0049] Calculating a fourth product of the second energy index and a transposed vector of a preset first adjustment vector, and using the fourth product as a speed adjustment amount in the second abnormal operating state;

[0050] Using the speed adjustment amount in the second abnormal operation state as the particle update parameter to adjust the speed of the corresponding particle;

[0051] The position of the corresponding particle is updated according to the adjusted particle speed, and then the updated particle participates in the next iteration.

[0052] In view of the abnormal operating states caused by two different reasons, different update parameters are used to guide the adjustment of particle update speed. Based on the traditional speed update algorithm, the particles are helped to accelerate out of the infeasible region with fewer parameters added.

[0053] Optionally, the first adjustment vector is determined according to the following steps:

[0054] The maximum power ratio of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit is obtained as follows:

[0055] ;

[0056] In the formula, represents the maximum power generation of the new energy power generation unit in several typical days, represents the maximum power value obtained between the rated hydrogen production power and the rated power generation power of the hydrogen energy storage unit, Indicates the maximum power value of the rated charging power and the rated discharging power of the battery energy storage unit;

[0057] The first adjustment vector is set according to the maximum power ratio.

[0058] The above maximum power ratio can reflect the energy flow capacity of the new energy power generation unit, hydrogen energy storage unit and battery energy storage unit in the microgrid, so as to determine the quantity scaling ratio of each unit according to this maximum power ratio and realize the reasonable setting of the update parameters.

[0059] In a second aspect, an embodiment of the present application provides a microgrid capacity configuration device based on an improved particle swarm algorithm, the microgrid capacity configuration device comprising:

[0060] An initialization module, used to generate initial particles according to the number of new energy power generation units, hydrogen energy storage units and battery energy storage units in the microgrid;

[0061] An iterative solution module, used for taking the microgrid operation cost as the particle fitness, iterating based on the initial particles and obtaining the optimal solution, wherein in each iteration process, the energy operation state of the microgrid corresponding to each current particle is analyzed to determine the particle update parameter, and the corresponding particle is updated based on the particle update parameter so as to participate in the next iteration;

[0062] A configuration module is used to adjust the number of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit according to the optimal solution to achieve capacity configuration of the microgrid.

[0063] The microgrid capacity configuration device proposed in the embodiment of the present application and the microgrid capacity configuration method proposed in the embodiment of the present application respectively set different update parameters for different energy operation states in the microgrid to improve the traditional particle velocity update algorithm, thereby helping to accelerate particles to leave the infeasible domain and find feasible solutions during the solution process. It can be seen that the embodiment of the present application can take into account the energy fluctuations caused by renewable energy power generation in the microgrid, set update parameters that are more in line with the actual physical meaning for different energy operation states, and adaptively guide the adjustment of the particle velocity update algorithm, which helps particles find a more reliable moving direction towards the optimal solution, speeds up iteration and solution speed, so as to achieve the effect of quickly converging the feasible domain and improving the efficiency of microgrid capacity configuration, thereby meeting the actual application needs of microgrids containing renewable energy power generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0065] Figure 1 A schematic diagram of a flow chart of a microgrid capacity configuration method based on an improved particle swarm algorithm proposed in an embodiment of the present application;

[0066] Figure 2 A schematic diagram of the microgrid system architecture proposed in an embodiment of the present application;

[0067] Figure 3 This is a flowchart for analyzing the energy operation status of the microgrid proposed in the embodiment of the present application;

[0068] Figure 4 A schematic diagram of the structure of a microgrid capacity configuration device based on an improved particle swarm algorithm proposed in an embodiment of the present application;

[0069] Figure 5 A computer device for executing the microgrid capacity configuration method proposed in the embodiment of the present application. DETAILED DESCRIPTION

[0070] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0071] The problem of solving the microgrid capacity configuration aims to determine the optimal capacity of the renewable energy power generation equipment and various energy storage equipment in the microgrid to achieve the goals of economy, reliability and environmental protection. However, microgrids containing renewable energy power generation usually face large energy fluctuations during operation. These fluctuations mainly come from the intermittent characteristics of renewable energy such as wind energy and solar energy, and renewable energy power generation has a certain degree of unpredictability. At the same time, the peak and valley changes of user loads during the day further aggravate the complexity and variability of energy supply and demand.

[0072] The microgrid capacity configuration method and device based on the improved particle swarm algorithm provided in this specification can be applied to Figure 2 The microgrid system architecture shown in the figure mainly includes the following components: a new energy power generation unit 10, a hydrogen storage unit (Hydrogen Storage System, HSS) 20 and a battery storage unit (Battery Storage System, BSS) 30, wherein the hydrogen storage unit 20 includes a hydrogen storage unit 21, an electrolytic hydrogen production unit 22 and a fuel cell unit 23. The energy supply to the user load 40 is realized by the new energy power generation unit 10, the hydrogen storage unit 20 and the battery storage unit 30, and the energy supply to the user load 40 is realized by the new energy power generation unit 10, the hydrogen storage unit 20 and the battery storage unit 30. Figure 2 The arrows in the figure show the direction of energy flow during operation, wherein the new energy power generation unit 10 supplies power to users, and there is also a certain amount of power abandonment.

[0073] If the new energy generation unit 10 has excess energy during the power generation process, the hydrogen energy storage unit 20 and the battery energy storage unit 30 are charged. In particular, for the hydrogen energy storage unit 20, the electrolysis hydrogen production unit 22 converts the electrical energy from the new energy generation unit 10 into hydrogen energy by electrolyzing water, and stores the hydrogen energy in the hydrogen storage unit 21. Finally, the fuel cell unit 23 converts the hydrogen energy stored in the hydrogen storage unit 21 into electrical energy through an electrochemical reaction. When the new energy generation unit 10 cannot meet the electricity demand of the user load 40, the hydrogen energy storage unit 20 and the battery energy storage unit 30 will provide electrical energy to the user load 40.

[0074] The embodiment of the present application realizes the solution of microgrid capacity configuration based on the above-mentioned microgrid system architecture. Particle Swarm Optimization (PSO) is a new intelligent optimization algorithm, in which particles simulate the foraging behavior of bird flocks and search for the optimal solution in the solution space. It has the advantages of fast convergence speed and strong global search ability, and has been widely used in solving various optimization problems. However, the traditional particle swarm algorithm often deviates from the true meaning of the problem to be solved, and can only blindly solve the whole domain. It not only has a high dependence on the parameters of the algorithm, but also easily falls into the problem of local optimal solution. There are also problems such as slow convergence speed, so it is difficult to meet the actual application needs of microgrids containing renewable energy power generation.

[0075] In the speed update part of the particle swarm algorithm, the speed update formula can usually be expressed as:

[0076] ;

[0077] in, It is a particle speed, It is a particle location, It is a particle The individual optimal position of is the global optimal position, and is a random number that follows a uniform distribution.

[0078] The above formula includes inertia, cognitive and social terms. The inertia term is similar to inertia in physics. It is used to maintain the stability of the direction and speed of particle movement and prevent the algorithm from falling into a local optimal solution and being unable to jump out. It is usually expressed as the inertia weight factor. The cognitive component represents the cognitive ability of the particle itself, that is, the particle adjusts its movement direction according to its own experience represented by its individual historical optimal position. Each particle remembers the best position it has found during the search process, which is called the individual optimal solution ( ), cognitive terms are usually expressed as , multiply it by the gap between the particle and its individual optimal position to adjust the speed. The social component represents the degree to which the particle is affected by other particles in the group, that is, the direction of movement is adjusted by cooperating with other particles in the group. The global optimal position of the entire group is called the global optimal solution ( ), the social term is usually expressed as , and adjust the velocity by multiplying it by the distance between the particle and the global optimal position.

[0079] According to an embodiment of the present application, an embodiment of a microgrid capacity configuration method based on an improved particle swarm algorithm is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0080] In this embodiment, a microgrid capacity configuration method based on an improved particle swarm algorithm is provided, which can be used in the above-mentioned microgrid system architecture. Figure 1 is a flow chart of a microgrid capacity configuration method based on an improved particle swarm algorithm according to an embodiment of the present application, such as Figure 1 As shown, the process includes the following steps:

[0081] Step S1, generating initial particles according to the number of new energy power generation units, hydrogen energy storage units and battery energy storage units in the microgrid;

[0082] Step S3, taking the microgrid operation cost as the particle fitness, iterating based on the initial particles and obtaining the optimal solution, wherein in each iteration process, the energy operation state of the microgrid corresponding to each current particle is analyzed to determine the particle update parameter, and the corresponding particle is updated based on the particle update parameter so as to participate in the next iteration;

[0083] Step S5, adjusting the number of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit according to the optimal solution to achieve capacity configuration of the microgrid.

[0084] The capacity of a microgrid refers to the rated capacity of the load in the microgrid that can ensure stable power supply. The number of new energy power generation units, hydrogen energy storage units and battery energy storage units are used as decision variables in solving the optimization problem. Adjusting these decision variables can realize the configuration of the microgrid capacity. The optimal solution is the configuration scheme that can achieve the lowest operating cost of the microgrid under the premise of meeting the user load requirements. Therefore, the number of the new energy power generation unit 10, the hydrogen energy storage unit 20 and the battery energy storage unit 30 is used as the decision variable for the optimization problem, and the generated initial particles are three-dimensional vectors, which respectively represent the number of new energy power generation units 10, hydrogen energy storage units and battery energy storage units, and the corresponding initial position and initial velocity are set for the initial particles.

[0085] The microgrid capacity configuration method proposed in the embodiment of the present application sets different update parameters for different energy operation states in the microgrid to improve the traditional particle speed update algorithm, thereby helping to accelerate particles to leave the infeasible region and find a feasible solution during the solution process. It can be seen that the embodiment of the present application can take into account the energy fluctuations of the microgrid caused by renewable energy power generation, and set update parameters that are more in line with actual physical meanings for different energy operation states to guide the adjustment of the particle speed update algorithm, which helps particles find a more reliable moving direction to the optimal solution, speeds up iteration and solution speed, thereby improving the efficiency of microgrid capacity configuration and meeting the actual application needs of microgrids containing renewable energy power generation.

[0086] It should be noted that the embodiment of the present application uses a day as the length of the data vector, based on the historical data of renewable energy power generation, energy storage charging and discharging, and user load for a selected period of time, usually one year of data is selected, and the period is divided into several categories through clustering methods such as K-means and KNN, each of which is called a typical day. If a future day is predicted to belong to a certain type of typical day, it is considered that its renewable energy power generation, energy storage charging and discharging, and user load conditions are exactly the same as those of the typical day.

[0087] In the embodiment of the present application, the generating of initial particles according to the number of new energy power generation units, hydrogen energy storage units and battery energy storage units in the microgrid includes the following steps:

[0088] Step S110, obtaining the basic number of the new energy power generation units required to meet user loads in several typical days, setting a value interval based on the basic number, and randomly selecting an integer in the value interval as each initial number of the new energy power generation units.

[0089] Specifically, the calculation formula for the basic number of the new energy power generation units is:

[0090]

[0091] In the formula, is the basic quantity, is the user load at the t-th sampling time on the i-th typical day, is the power generation power of the new energy power generation unit at the tth sampling moment on the i-th typical day.

[0092] The idea of ​​solving the above formula is that the total energy of renewable energy power generation on each typical day must be at least equal to the total energy required by the user load. In the above formula, the ratio of the total user load and the total power of renewable energy power generation on each typical day is calculated to obtain the number of renewable energy power generation units in each typical day that are required to meet the user load, and the maximum number in all typical days is taken as the basic number.

[0093] Since this calculation process does not take into account the energy loss during energy storage charging and discharging, As the next session, construct the value interval And randomly select M integers in the value interval to form an array , which contains the initial number of the new energy power generation units. To set the value, adjust It can accelerate the convergence speed of the algorithm. In the embodiment of this application, according to experience, , and set M to 200.

[0094] Step S120, for each initial number of the new energy power generation units, the initial number of the hydrogen energy storage units and the battery energy storage units is calculated based on the following formula:

[0095] ;

[0096] In the formula, is the number of the new energy power generation units corresponding to the mth particle, is the number of the hydrogen energy storage units corresponding to the mth particle, is the number of the battery energy storage units corresponding to the mth particle, is the power generation power of the new energy power generation unit at the t-th sampling time on the i-th typical day, is the user load at the t-th sampling time on the i-th typical day, is the rated hydrogen power of the hydrogen energy storage unit, is the rated power generation of the hydrogen energy storage unit, is the rated charging power of the battery energy storage unit, is the rated discharge power of the battery energy storage unit, is the total number of typical days, is the total number of sampling moments.

[0097] The solution to the above formula is that the array Each integer in is the initial number of new energy generation units corresponding to the mth particle , , assuming that only the hydrogen energy storage unit or the battery energy storage unit is output at each sampling moment, when the capacity constraint of the energy storage is not considered, it must be fully satisfied that the charging and discharging at each sampling moment can meet the current user load demand. In this way, the number combination of hydrogen energy storage units and battery energy storage units obtained must be sufficient, that is, it must be a feasible solution, and therefore the speed of entering the feasible domain can be accelerated.

[0098] Step S130: , and As the initial position of the m-th particle, to generate the m-th initial particle.

[0099] Through step S110 and step S120, the initial position of the mth initial particle can be obtained. for , and randomly generate each dimension with an absolute value not exceeding of A three-dimensional velocity vector is used as the initial velocity of each initial particle In the present application example, .

[0100] At this point, the generation of initial particles in the particle swarm algorithm is completed. It can be seen that compared with the traditional particle solving algorithm that randomly generates initial particles in a wide area, the embodiment of the present application adopts a method of randomly generating initial particles within a certain range. In this way, the number combination of new energy power generation units, hydrogen energy storage units and battery energy storage units generated by considering the actual distribution network needs can increase the speed of particles entering the feasible domain, thereby increasing the speed of solving subsequent optimal solutions.

[0101] In the embodiment of the present application, the method of using the microgrid operation cost as the particle fitness includes the following steps:

[0102] Step S211, based on the microgrid power cost and the renewable energy power abandonment rate corresponding to each of the particles, determining the maximum value of the microgrid power cost and the maximum value of the renewable energy power abandonment rate.

[0103] Specifically, the power cost of the microgrid is the Levelized Cost of Electricity (LCOE), and its calculation formula is:

[0104]

[0105] In the formula, For the whole life cycle The number of typical days, is the total number of typical day types.

[0106] is the total investment cost, specifically:

[0107]

[0108] in, is the investment cost coefficient corresponding to a new energy power generation unit, is the investment cost coefficient corresponding to a hydrogen energy storage unit, is the investment cost coefficient corresponding to a battery energy storage unit.

[0109] is the i-th typical day The operation and maintenance cost at each sampling moment is:

[0110]

[0111] in, is the operation and maintenance cost coefficient corresponding to a new energy power generation unit, is the operation and maintenance cost coefficient corresponding to a hydrogen energy storage unit, is the operation and maintenance cost coefficient corresponding to each battery energy storage unit, is the power generation of the hydrogen energy storage unit at the t-th sampling time on the i-th typical day, is the hydrogen production power of the hydrogen energy storage unit at the t-th sampling time on the i-th typical day, is the discharge power of the battery energy storage unit at the tth sampling time on the i-th typical day, is the charging power of the battery energy storage unit at the tth sampling time on the i-th typical day.

[0112] The new energy abandonment rate R is:

[0113]

[0114] In the formula, It is the renewable energy power generation power discarded by the renewable energy power generation unit at the tth sampling time on the i-th typical day.

[0115] Step S212, calculating the ratio of the microgrid power cost corresponding to each of the particles to the maximum value of the microgrid power costs to obtain a first ratio, and calculating the ratio of the new energy power abandonment rate corresponding to each of the particles to the maximum value of the new energy power abandonment rate to obtain a second ratio.

[0116] Step S213: taking the sum of the first ratio and the second ratio as the particle fitness.

[0117] The embodiment of the present application adopts a fuzzy membership function normalization compromise method for multiple objectives. Specifically, the particle fitness after compromise of multiple groups of objective function values ​​calculated for the mth particle is for:

[0118]

[0119] From this we can see that is the first ratio, is the second ratio.

[0120] The embodiment of the present application uses a fuzzy membership function normalization compromise method to compromise the two optimization objectives of minimizing the microgrid power cost and minimizing the new energy power abandonment rate, and uses the objective function obtained by the compromise as the particle fitness, thereby meeting the multi-objective optimization requirements of the microgrid capacity configuration.

[0121] It should be noted that, in the embodiments of the present application, whether still , and its nonlinear terms are all products of integer decision variables and time scheduling, that is to say, the optimization problem of microgrid capacity configuration is usually nonlinear, but its nonlinearity is not strong, so the complexity of searching for the optimal solution of the optimization problem is relatively small, and it is suitable for the use of particle swarm algorithm. At the same time, microgrid capacity configuration optimization always selects objective functions that cannot take the maximum value at the same time, which increases the chance of finding the global optimal solution. Based on the weak nonlinearity of the objective function and the trade-off between multiple objectives, the embodiment of the present application selects the particle swarm algorithm to solve the multi-objective optimization, and analyzes the energy operation status according to the energy management rules, so as to design a new particle swarm speed update formula.

[0122] In the embodiment of the present application, the energy operation state of the microgrid corresponding to each current particle is analyzed in each iteration process, including:

[0123] Determine whether the hydrogen storage level of the hydrogen energy storage unit and the charge state of the battery energy storage unit corresponding to each particle currently meet the preset capacity constraint condition at the same time, wherein if the capacity constraint condition is met, the energy operation state is a normal operation state; if the capacity constraint condition is not met, the energy operation state is a first abnormal operation state;

[0124] The first product of the power generation power of the new energy power generation unit corresponding to each particle and the number of the new energy power generation units is obtained respectively, and the first product is compared with the user load. When the first product is less than or equal to the user load, if the maximum total output of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit cannot meet the user load, the energy operation state is the second abnormal operation state.

[0125] Figure 3 The analysis process of the energy operation state of the mth particle for the i-th typical day is shown, and the analysis process is specifically described below:

[0126] Step S221, determine whether the power generated by the new energy source meets the load, that is, determine whether it meets the If the conditions are met, execute steps S222 to S226; if not, execute steps S227 to S2210.

[0127] Step S222, calculating the hydrogen production power of the hydrogen energy storage unit , the calculation process is:

[0128]

[0129] Step S223, judging whether the hydrogen production power calculated in step S222 is the rated hydrogen production power, i.e. judging whether If so, execute step S224; otherwise, execute step S2211.

[0130] Step S224, calculating the charging power of the battery energy storage unit , the calculation process is:

[0131]

[0132] Step S225, determining whether the charging power calculated in step S224 is the rated charging power, i.e., determining whether If so, execute step S226; otherwise, execute step S2211.

[0133] Step S226, calculating the discarded new energy power generation And execute step S2211, the calculation process is:

[0134]

[0135] Step S227, calculating the power generation of the hydrogen energy storage unit , the calculation process is:

[0136]

[0137] Step S228, judging whether the power generated by step S227 is the rated power generated, i.e. judging whether If so, execute step S229; otherwise, execute step S2211.

[0138] Step S229, determining the discharge power of the battery energy storage unit Whether the user load is met, that is, whether:

[0139]

[0140] If the conditions are met, step S2210 is executed. If not, the analysis result of the mth particle is determined to be in the second abnormal operation state and the process ends.

[0141] Step S2210, calculating the discharge power of the battery energy storage unit , and after completing the calculation, execute step S2211, where the discharge power The calculation process is:

[0142]

[0143] Step S2211, calculating the hydrogen storage level of the hydrogen energy storage unit and the state of charge of the battery storage unit , the calculation process is:

[0144]

[0145]

[0146] In the formula, is the hydrogen production efficiency of the hydrogen energy storage unit, is the power generation efficiency of the hydrogen energy storage unit, HHV is the higher heating value of hydrogen as a constant, is the rated capacity of the hydrogen energy storage unit, is the charging energy efficiency of the battery energy storage unit, is the discharge energy efficiency of the battery energy storage unit, is the rated capacity of the battery energy storage unit. and denote the hydrogen storage levels at the t+1th sampling time and the tth sampling time on the ith typical day, respectively. and They represent the charge levels at the t+1th sampling time and the tth sampling time on the i-th typical day respectively.

[0147] Step S2212, determine whether the hydrogen storage level and the state of charge meet the constraints, that is, determine whether

[0148]

[0149] In the formula, and are the preset upper and lower limits of hydrogen storage level, and They are respectively the preset upper limit of state of charge and the lower limit of state of charge;

[0150] If it is satisfied, execute t=t+1, and In the case of t=24, the process returns to step S221 and executes in a loop until the analysis result of the m-th particle is determined to be in a normal operating state and the process ends;

[0151] If not, the analysis result of the mth particle is determined to be the first abnormal operation state and the process ends.

[0152] From the above analysis process, it can be seen that the abnormal operating state in the embodiment of the present application is mainly caused by two situations. One is that when the discharge of the battery energy storage unit and the power generation of the hydrogen energy storage unit reach the maximum, the user load still cannot be met. At this time, increasing the scale of new energy power generation or increasing the scale of energy storage power generation may make the abnormal operating state disappear. The other is when the battery energy storage unit and the hydrogen energy storage unit exceed the capacity constraint, whether it is insufficient capacity or overflow, reducing the scale of new energy power generation or expanding the corresponding energy storage scale may make the abnormal operating state disappear.

[0153] Therefore, in the process of analyzing the energy operation status, the embodiment of the present application can identify whether the energy supply and demand of the microgrid is normal, and use reasonable analysis of the abnormal operation status to help subsequently adjust the speed update method of the accelerated particles to accelerate the particles to converge to the feasible domain.

[0154] For the above-mentioned normal operating state, the first abnormal operating state and the second abnormal operating state, the embodiments of the present application respectively propose corresponding particle speed update methods, and the improved particle swarm algorithm improves the speed update formula for the normal operating state and the abnormal operating state caused by two different reasons, which helps particles find a more reliable moving direction to the optimal solution and speeds up the iteration speed. The specific description is given below.

[0155] In the case where the analysis result of the energy operation state is a normal operation state, determining the particle update parameter and updating the corresponding particle based on the particle update parameter so as to participate in the next iteration includes the following steps:

[0156] Step S2311, according to the initial hydrogen storage level of the hydrogen energy storage unit and the initial state of charge of the battery energy storage unit, the first energy index corresponding to each particle is calculated based on the following formula:

[0157] ;

[0158] In the formula, is the first energy index of the particle corresponding to the i-th typical day, is the rated capacity of the hydrogen energy storage unit, The high calorific value of hydrogen. is the last sampling time of the hydrogen energy storage unit on the i-th typical day The level of hydrogen production is the initial hydrogen storage level of the hydrogen energy storage unit, is the number of the battery energy storage units corresponding to the mth particle, is the rated capacity of the battery energy storage unit, is the last sampling time of the battery energy storage unit on the i-th typical day The state of charge, is the initial state of charge of the battery energy storage unit, is the power generation power of the new energy power generation unit at the tth sampling moment on the i-th typical day.

[0159] Wherein, the method for determining the initial hydrogen storage level of the hydrogen energy storage unit and the initial state of charge of the battery energy storage unit includes:

[0160] The upper limit and lower limit of the hydrogen storage level set in the capacity constraint are obtained, and the average value of the upper limit and lower limit of the hydrogen storage level is used as the initial hydrogen storage level of the hydrogen energy storage unit, that is, .

[0161] The upper and lower limits of the state of charge set in the capacity constraint are obtained, and the average value of the upper and lower limits of the state of charge is used as the initial state of charge of the battery energy storage unit, that is, . .

[0162] The actual physical significance of the above calculation process is to analyze the energy supply and demand relative to the user load, and how much of the total amount of new energy power generation per day can be converted into the excess or insufficient energy. If both are greater than zero, there is still room for the scale of new energy to be reduced, and in order to ensure operational safety, the scale reduction of new energy usually means the scale reduction of energy storage. If the inequality is greater than zero, there is still room for the scale of renewable energy power generation to expand. The reason is that if If the unevenness is greater than zero, directly reducing the scale of renewable energy power generation may result in exceeding the capacity constraint on the day when the unevenness is less than zero, leading to safety risks in the operation of the microgrid.

[0163] Step S2312: determine a minimum value among the first energy indicators, calculate a second product of the minimum value and a transposed vector of a preset first adjustment vector, and use the second product as the speed adjustment amount in the normal operating state.

[0164] Step S2313: Using the speed adjustment amount in the normal operating state as the particle update parameter, the speed of the corresponding particle is adjusted.

[0165] Step S2314, updating the position of the corresponding particle according to the adjusted particle speed, and then using the updated particle to participate in the next iteration.

[0166] Specifically, if are all greater than zero, calculate the minimum energy difference , and based on its update speed for:

[0167] ;

[0168] like If the difference is greater than zero, then find Minimum value of negative term , and based on its update speed for:

[0169] .

[0170] in, , , , , and To update the parameters, Refer to the inertia weight factor To set, Reference cognitive items set up, Please refer to social items set up, The current individual optimal position of the particle. If it does not exist, it will not be considered. This one; The global optimal position of all particle groups. If it does not exist, it will not be considered. This one; is the position of the particle at the jth iteration, is the velocity of the particle at the j+1th iteration, is a random number between 0 and 1.

[0171] It can be seen that That is, the first adjustment vector determined in step S2312, where and This is the speed adjustment amount determined in step S2312, and this formula weakens the influence of the global and local optimal solutions, effectively avoiding the situation where particles fall into the local optimal solution and the particle swarm iterates the global optimal solution at a low speed.

[0172] In the case where the analysis result of the energy operation state is the first abnormal operation state, determining the particle update parameter and updating the corresponding particle based on the particle update parameter so as to participate in the next iteration includes the following steps:

[0173] Step S2321, obtaining a first excess value of the hydrogen energy storage unit exceeding the capacity constraint condition, and obtaining a second excess value of the battery energy storage unit exceeding the capacity constraint condition.

[0174] Specifically, let the first excess value be , the second excess value is , if the hydrogen energy storage unit exceeds the maximum capacity constraint, then

[0175] If the hydrogen storage unit exceeds the minimum capacity constraint, then

[0176] If the hydrogen energy storage unit does not exceed the capacity constraint, then .

[0177] Similarly, if the battery storage unit exceeds the maximum capacity constraint, then

[0178] If the battery storage unit exceeds the minimum capacity constraint, then

[0179] If the battery storage unit does not exceed the capacity constraint, then .

[0180] Step S2322: construct a second adjustment vector, wherein a first-dimensional element of the second adjustment vector is zero, a second-dimensional element of the second adjustment vector is the first excess value, and a third-dimensional element of the second adjustment vector is the second excess value.

[0181] Step S2323: taking the third product of the transposed vector of the second adjustment vector, the position of the corresponding particle and the preset coefficient as the speed adjustment amount in the first abnormal operating state.

[0182] Step S2324: Using the speed adjustment amount in the first abnormal operation state as the particle update parameter, the speed of the corresponding particle is adjusted.

[0183] Step S2325, updating the position of the corresponding particle according to the adjusted particle speed, and then using the updated particle to participate in the next iteration.

[0184] Specifically, the energy storage capacity is expanded according to the above calculation guidance, so the speed is updated for:

[0185] .

[0186] In the formula, is the reference inertia weight factor The update parameters set, Need to be set to Small value, this is because the particles corresponding to the abnormal operation state have less self-reference than those in the normal operation state; is the preset coefficient. The larger the value is, the and The greater the weight of guiding speed update.

[0187] It can be seen that That is, the second adjustment vector determined in step S2322, where This is the speed adjustment amount determined in step S2323, and this formula weakens the influence of the global and local optimal solutions, effectively avoiding the situation where particles fall into the local optimal solution and the particle swarm iterates the global optimal solution at a low speed.

[0188] It should be noted that in the above formula, the second adjustment vector is multiplied by the current particle position because in the process of expanding the energy storage capacity, the amount of expansion is directly proportional to the current amount.

[0189] In the case where the analysis result of the energy operation state is the second abnormal operation state, determining the particle update parameter and updating the corresponding particle based on the particle update parameter so as to participate in the next iteration includes the following steps:

[0190] Step S2331, calculating the second energy index corresponding to the particle based on the following formula:

[0191]

[0192] In the formula, is the second energy index corresponding to the particle, is the user load at the t-th sampling time on the i-th typical day, is the power generation power of the new energy power generation unit at the t-th sampling time on the i-th typical day, is the power generation power of the hydrogen energy storage unit at the t-th sampling time on the i-th typical day, is the rated discharge power of the battery energy storage unit, is the number of the new energy power generation units corresponding to the mth particle, is the number of the hydrogen energy storage units corresponding to the mth particle.

[0193] The actual physical meaning here is to calculate how many more energy storage units are needed to meet the energy difference of the user's load.

[0194] Step S2332: Calculate a fourth product of the second energy index and the transposed vector of the preset first adjustment vector, and use the fourth product as the speed adjustment amount in the second abnormal operating state.

[0195] Step S2333: Using the speed adjustment amount in the second abnormal operation state as the particle update parameter, and adjusting the speed of the corresponding particle.

[0196] Step 2334, update the position of the corresponding particle according to the adjusted particle speed, and then use the updated particle to participate in the next iteration.

[0197] Specifically, the energy storage capacity is expanded according to the above calculation guidance, so the speed is updated for:

[0198] .

[0199] It can be seen that That is, the first adjustment vector determined in step S2332, where This is the speed adjustment amount determined in step S2332, and this formula weakens the influence of the global and local optimal solutions, effectively avoiding the situation where particles fall into the local optimal solution and the particle swarm iterates the global optimal solution at a low speed.

[0200] It should be noted that here Parameters and no abnormal operation The same reason is that the scaling ratio of the number of new energy units, hydrogen energy storage units and battery energy storage units is rooted in the ability of each unit to flow energy / power in the microgrid, so power and energy have the same meaning.

[0201] In addition, in the application embodiment, when setting the above parameters , and When the rated power of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit is used, the initial estimation and setting can be performed. Therefore, the first adjustment vector is determined according to the following steps:

[0202] The maximum power ratio of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit is obtained as follows:

[0203] ;

[0204] In the formula, represents the maximum power generation of the new energy power generation unit in several typical days, represents the maximum power value obtained between the rated hydrogen production power and the rated power generation power of the hydrogen energy storage unit, Indicates the maximum power value of the rated charging power and the rated discharging power of the battery energy storage unit;

[0205] The first adjustment vector is set according to the maximum power ratio.

[0206] The above maximum power ratio can reflect the energy flow capacity of the new energy power generation unit, hydrogen energy storage unit and battery energy storage unit in the microgrid, so as to determine the quantity scaling ratio of each unit according to this maximum power ratio and realize the reasonable setting of the update parameters.

[0207] After completing the particle velocity update based on the above description, the embodiment of the present application will update the particle velocity based on the updated velocity. Update the position of the particles. Specifically, the position of each particle is updated as follows:

[0208]

[0209] in, is the particle position in the jth iteration, is the particle position in the j+1th iteration, The function rounds up each dimension of the independent variable x, and ensures that the first and second dimensions are at least 1, and the third dimension is at least equal to 0. The significance of this setting is that for the operation of the microgrid, the new energy generation unit must exist, and in order to ensure that the hydrogen energy storage unit, which is more expensive than the battery energy storage unit, plays a regulatory role and is not replaced by the battery energy storage unit in the optimization solution, the priority of hydrogen energy storage in charging and discharging is set higher than that of battery energy storage, so that each particle is closer to a feasible solution in the subsequent solution process based on the improved particle swarm algorithm.

[0210] It should also be noted that in the process of solving the problem based on the improved particle swarm algorithm, the optimal particles are screened to determine the global optimal position of the particles. When , only the fitness values ​​of the particles running normally are calculated to select , and to determine the current individual optimal position of the particle, the fitness of the particles in all energy operating states is calculated.

[0211] In summary, the embodiment of the present application is based on a heuristic improved particle swarm algorithm, which can analyze the energy flow of each unit of the microgrid, and thus use the analysis results to guide the particle swarm's speed iteration optimization according to the normal and abnormal energy operation conditions, and on the premise of retaining the inertia term, cognitive term and social term of the traditional algorithm, make the particle swarm optimization process more closely related to the actual operation significance of the microgrid. And it can improve the corresponding speed update formula for abnormal energy operation conditions, which helps to accelerate the particles to leave the infeasible region, so that the particles can find a more reliable moving direction to the optimal solution, speed up the iteration speed, thereby adapting to the energy fluctuations brought by new energy generation and improving the efficiency of microgrid capacity configuration.

[0212] In addition, the speed update formula in the improved particle swarm algorithm only adds a small number of update parameters compared to the traditional particle swarm algorithm to achieve an increase in convergence speed. Therefore, it can improve the speed of finding feasible solutions and obtaining optimal solutions without increasing the complexity of the solution algorithm, thereby improving the capacity configuration efficiency of the microgrid.

[0213] Accordingly, please refer to Figure 4The embodiment of the present application provides a microgrid capacity configuration device based on an improved particle swarm algorithm, the device comprising:

[0214] Initialization module 701, used to generate initial particles according to the number of new energy power generation units, hydrogen energy storage units and battery energy storage units in the microgrid;

[0215] An iterative solution module 702 is used to use the microgrid operation cost as the particle fitness, iterate based on the initial particles and obtain the optimal solution, wherein in each iteration process, the energy operation state of the microgrid corresponding to each current particle is analyzed to determine the particle update parameter, and the corresponding particle is updated based on the particle update parameter so as to participate in the next iteration;

[0216] The configuration module 703 is used to adjust the number of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit according to the optimal solution to achieve capacity configuration of the microgrid.

[0217] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0218] The microgrid capacity configuration device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0219] like Figure 5 As shown, a computer device provided by an embodiment of the present application includes: one or more processors 50, a memory 60, and a communication interface 70 for connecting various components, including a high-speed interface and a low-speed interface. The processor 50 can process instructions executed in the computer device, including instructions stored in or on the memory 60 to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors 50 and / or multiple buses can be used together with multiple memories 60 and multiple memories 60. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).

[0220] The processor 50 may be a central processing unit, a network processor or a combination thereof. The processor 50 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0221] The memory 60 stores instructions executable by at least one processor, so that the at least one processor 50 executes the method shown in the above embodiment.

[0222] The embodiment of the present application also provides a computer-readable storage medium to implement the method shown in the above embodiment. The above method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or downloaded through a network and originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory.

[0223] The embodiment of the present application provides a computer program product, which includes computer program instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of any embodiment of the present application.

[0224] Although the embodiments of the present application are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations are all within the scope defined by the appended claims.

[0225] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0226] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0227] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0228] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0229] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

[0230] Although the embodiments of the present application have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A microgrid capacity configuration method based on improved particle swarm algorithm, characterized in that: The microgrid capacity configuration method comprises: Generate initial particles according to the number of renewable energy generation units, hydrogen energy storage units and battery energy storage units in the microgrid; The microgrid operation cost is used as the particle fitness, and the initial particles are iterated to obtain the optimal solution, wherein the energy operation state of the microgrid corresponding to each current particle is analyzed in each iteration process to determine the particle update parameter, and the corresponding particle is updated based on the particle update parameter to participate in the next iteration; Adjusting the number of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit according to the optimal solution to achieve capacity configuration of the microgrid; The generating of initial particles according to the number of new energy power generation units, hydrogen energy storage units and battery energy storage units in the microgrid comprises: Obtaining a basic number of the new energy power generation units required to meet user loads on several typical days, setting a value interval based on the basic number, and randomly selecting an integer in the value interval as each initial number of the new energy power generation units; For each initial number of the new energy power generation units, the initial numbers of the hydrogen energy storage units and the battery energy storage units are calculated based on the following formula: ; In the formula, is the number of the new energy power generation units corresponding to the mth particle, is the number of the hydrogen energy storage units corresponding to the mth particle, is the number of the battery energy storage units corresponding to the mth particle, is the power generation power of the new energy power generation unit at the t-th sampling time on the i-th typical day, is the user load at the t-th sampling time on the ith typical day, is the rated hydrogen power of the hydrogen energy storage unit, is the rated power generation of the hydrogen energy storage unit, is the rated charging power of the battery energy storage unit, is the rated discharge power of the battery energy storage unit, is the total number of typical days, is the total number of sampling moments; Will , and As the initial position of the m-th particle, to generate the m-th initial particle; The method of using the microgrid operation cost as particle fitness includes: Based on the microgrid power cost and the new energy power abandonment rate corresponding to each of the particles, determining the maximum value of the microgrid power cost and the maximum value of the new energy power abandonment rate; Calculating a ratio of a microgrid power cost corresponding to each of the particles to a maximum value among the microgrid power costs to obtain a first ratio, and calculating a ratio of a new energy power abandonment rate corresponding to each of the particles to a maximum value among the new energy power abandonment rates to obtain a second ratio; Taking the sum of the first ratio and the second ratio as the particle fitness; The energy operation state of the microgrid corresponding to each particle is analyzed in each iteration process, including: Determine whether the hydrogen storage level of the hydrogen energy storage unit and the charge state of the battery energy storage unit corresponding to each particle currently meet the preset capacity constraint condition at the same time, wherein if the capacity constraint condition is met, the energy operation state is a normal operation state; if the capacity constraint condition is not met, the energy operation state is a first abnormal operation state; respectively obtaining a first product of the power generation power of the new energy power generation unit corresponding to each particle and the number of the new energy power generation units, and comparing the first product with the user load, and when the first product is less than or equal to the user load, if the maximum total output of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit cannot meet the user load, then the energy operation state is the second abnormal operation state; In the case that the analysis result of the energy operation state is a normal operation state, determining the particle update parameter, and updating the corresponding particle based on the particle update parameter so as to participate in the next iteration, includes: According to the initial hydrogen storage level of the hydrogen energy storage unit and the initial state of charge of the battery energy storage unit, the first energy index corresponding to each particle is calculated based on the following formula: ; In the formula, is the first energy index of the particle corresponding to the i-th typical day, is the rated capacity of the hydrogen energy storage unit, The high calorific value of hydrogen. is the last sampling time of the hydrogen energy storage unit on the i-th typical day The level of hydrogen production is the initial hydrogen storage level of the hydrogen energy storage unit, is the number of the battery energy storage units corresponding to the mth particle, is the rated capacity of the battery energy storage unit, is the last sampling time of the battery energy storage unit on the i-th typical day The state of charge, is the initial state of charge of the battery energy storage unit, is the power generation power of the new energy power generation unit at the t-th sampling moment on the i-th typical day; Determine a minimum value among the first energy indicators, calculate a second product of the minimum value and a transposed vector of a preset first adjustment vector, and use the second product as a speed adjustment amount under the normal operating state; Using the speed adjustment amount in the normal operating state as the particle update parameter to adjust the speed of the corresponding particle; The position of the corresponding particle is updated according to the adjusted particle speed, and then the updated particle participates in the next iteration.

2. The microgrid capacity configuration method based on improved particle swarm algorithm according to claim 1 is characterized in that: The initial hydrogen storage level of the hydrogen energy storage unit and the initial state of charge of the battery energy storage unit are determined according to the following steps: Obtaining the upper limit and lower limit of the hydrogen storage level set in the capacity constraint condition, and taking the average value of the upper limit and lower limit of the hydrogen storage level as the initial hydrogen storage level of the hydrogen energy storage unit; The state of charge upper limit and the state of charge lower limit set in the capacity constraint condition are obtained, and an average value of the state of charge upper limit and the state of charge lower limit is used as the initial state of charge of the battery energy storage unit.

3. The microgrid capacity configuration method based on improved particle swarm algorithm according to claim 1 is characterized in that: In a case where the analysis result of the energy operation state is a first abnormal operation state, determining a particle update parameter, and updating a corresponding particle based on the particle update parameter so as to participate in a next iteration, includes: Acquire a first excess value of the hydrogen energy storage unit exceeding the capacity constraint condition, and acquire a second excess value of the battery energy storage unit exceeding the capacity constraint condition; constructing a second adjustment vector, wherein a first dimension element of the second adjustment vector is zero, a second dimension element of the second adjustment vector is the first excess value, and a third dimension element of the second adjustment vector is the second excess value; taking a third product of the transposed vector of the second adjustment vector, the position of the corresponding particle and the preset coefficient as a speed adjustment amount under the first abnormal operating state; Using the speed adjustment amount in the first abnormal operation state as the particle update parameter to adjust the speed of the corresponding particle; The position of the corresponding particle is updated according to the adjusted particle speed, and then the updated particle participates in the next iteration.

4. The microgrid capacity configuration method based on improved particle swarm algorithm according to claim 1 is characterized in that: In a case where the analysis result of the energy operation state is the second abnormal operation state, determining the particle update parameter, and updating the corresponding particle based on the particle update parameter so as to participate in the next iteration, includes: The second energy index corresponding to the particle is calculated based on the following formula: In the formula, is the second energy index corresponding to the particle, is the user load at the t-th sampling time on the ith typical day, is the power generation power of the new energy power generation unit at the t-th sampling time on the i-th typical day, is the power generation power of the hydrogen energy storage unit at the t-th sampling time on the i-th typical day, is the rated discharge power of the battery energy storage unit, is the number of the new energy power generation units corresponding to the mth particle, is the number of the hydrogen energy storage units corresponding to the mth particle; Calculating a fourth product of the second energy index and a transposed vector of a preset first adjustment vector, and using the fourth product as a speed adjustment amount in the second abnormal operating state; Using the speed adjustment amount in the second abnormal operation state as the particle update parameter to adjust the speed of the corresponding particle; The position of the corresponding particle is updated according to the adjusted particle speed, and then the updated particle participates in the next iteration.

5. The microgrid capacity configuration method based on improved particle swarm algorithm according to claim 1 or 4, characterized in that: The first adjustment vector is determined according to the following steps: The maximum power ratio of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit is obtained as follows: ; In the formula, represents the maximum power generation of the new energy power generation unit in several typical days, represents the maximum power value obtained between the rated hydrogen production power and the rated power generation power of the hydrogen energy storage unit, Indicates the maximum power value of the rated charging power and the rated discharging power of the battery energy storage unit; The first adjustment vector is set according to the maximum power ratio.

6. A microgrid capacity configuration device based on an improved particle swarm algorithm, characterized in that: The microgrid capacity configuration device comprises: An initialization module, used to generate initial particles according to the number of new energy power generation units, hydrogen energy storage units and battery energy storage units in the microgrid; An iterative solution module, used for taking the microgrid operation cost as the particle fitness, iterating based on the initial particles and obtaining the optimal solution, wherein in each iteration process, the energy operation state of the microgrid corresponding to each current particle is analyzed to determine the particle update parameter, and the corresponding particle is updated based on the particle update parameter so as to participate in the next iteration; A configuration module, used to adjust the number of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit according to the optimal solution to achieve capacity configuration of the microgrid; The generating of initial particles according to the number of new energy power generation units, hydrogen energy storage units and battery energy storage units in the microgrid comprises: Obtaining a basic number of the new energy power generation units required to meet user loads on several typical days, setting a value interval based on the basic number, and randomly selecting an integer in the value interval as each initial number of the new energy power generation units; For each initial number of the new energy power generation units, the initial numbers of the hydrogen energy storage units and the battery energy storage units are calculated based on the following formula: ; In the formula, is the number of the new energy power generation units corresponding to the mth particle, is the number of the hydrogen energy storage units corresponding to the mth particle, is the number of the battery energy storage units corresponding to the mth particle, is the power generation power of the new energy power generation unit at the t-th sampling time on the i-th typical day, is the user load at the t-th sampling time on the ith typical day, is the rated hydrogen power of the hydrogen energy storage unit, is the rated power generation of the hydrogen energy storage unit, is the rated charging power of the battery energy storage unit, is the rated discharge power of the battery energy storage unit, is the total number of typical days, is the total number of sampling moments; Will , and As the initial position of the m-th particle, to generate the m-th initial particle; The method of using the microgrid operation cost as particle fitness includes: Based on the microgrid power cost and the new energy power abandonment rate corresponding to each of the particles, determining the maximum value of the microgrid power cost and the maximum value of the new energy power abandonment rate; Calculating a ratio of a microgrid power cost corresponding to each of the particles to a maximum value among the microgrid power costs to obtain a first ratio, and calculating a ratio of a new energy power abandonment rate corresponding to each of the particles to a maximum value among the new energy power abandonment rates to obtain a second ratio; Taking the sum of the first ratio and the second ratio as the particle fitness; The energy operation state of the microgrid corresponding to each particle is analyzed in each iteration process, including: Determine whether the hydrogen storage level of the hydrogen energy storage unit and the charge state of the battery energy storage unit corresponding to each particle currently meet the preset capacity constraint condition at the same time, wherein if the capacity constraint condition is met, the energy operation state is a normal operation state; if the capacity constraint condition is not met, the energy operation state is a first abnormal operation state; respectively obtaining a first product of the power generation power of the new energy power generation unit corresponding to each particle and the number of the new energy power generation units, and comparing the first product with the user load, and when the first product is less than or equal to the user load, if the maximum total output of the new energy power generation unit, the hydrogen energy storage unit and the battery energy storage unit cannot meet the user load, then the energy operation state is the second abnormal operation state; In the case that the analysis result of the energy operation state is a normal operation state, determining the particle update parameter, and updating the corresponding particle based on the particle update parameter so as to participate in the next iteration, includes: According to the initial hydrogen storage level of the hydrogen energy storage unit and the initial state of charge of the battery energy storage unit, the first energy index corresponding to each particle is calculated based on the following formula: ; In the formula, is the first energy index of the particle corresponding to the i-th typical day, is the rated capacity of the hydrogen energy storage unit, The high calorific value of hydrogen. is the last sampling time of the hydrogen energy storage unit on the i-th typical day The level of hydrogen production is the initial hydrogen storage level of the hydrogen energy storage unit, is the number of the battery energy storage units corresponding to the mth particle, is the rated capacity of the battery energy storage unit, is the last sampling time of the battery energy storage unit on the i-th typical day The state of charge, is the initial state of charge of the battery energy storage unit, is the power generation power of the new energy power generation unit at the t-th sampling moment on the i-th typical day; Determine a minimum value among the first energy indicators, calculate a second product of the minimum value and a transposed vector of a preset first adjustment vector, and use the second product as a speed adjustment amount under the normal operating state; Using the speed adjustment amount in the normal operating state as the particle update parameter to adjust the speed of the corresponding particle; The position of the corresponding particle is updated according to the adjusted particle speed, and then the updated particle participates in the next iteration.