Micro-grid operation decision-making method and system based on federated learning algorithm
By adopting federated learning algorithms and Nash negotiation algorithms in the microgrid and combining the cloud-based global strategy model, the privacy leakage and fair distribution problems in the integration of microgrid resources are solved, and efficient, safe and fair microgrid operation decisions are achieved.
Patent Information
- Application Number
- CN202411276556.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-06-06
AI Technical Summary
The existing microgrid resource integration strategy has the risk of privacy leakage, it is difficult to achieve fair and reasonable contribution estimates between microgrids, and the lack of a method to fairly allocate producers and consumers' economic surplus, resulting in low enthusiasm for participation and hindering the healthy development of the cooperative ecosystem.
The microgrid operation decision-making method based on federated learning algorithm is adopted, and the output power of the production and consumer are integrated through the EMS system, the Nash negotiation algorithm is used to allocate surplus, and a global strategy model in the cloud is built to achieve global optimization.
It improves the network security and system flexibility of the microgrid group, realizes global optimization decision-making, enhances energy utilization efficiency and system stability, and ensures data privacy and fair economic distribution.
Smart Images

Figure CN120109857A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid optimization, and in particular to a microgrid operation decision-making method and system based on a federated learning algorithm. Background Art
[0002] Microgrids are a solution for coordinating distributed power supply and achieving energy optimization across interconnected systems. They can combine multiple clean energy sources, improve energy efficiency and support green power. Since microgrids are usually small in scale and have limited stability, multiple microgrids need to be combined to form a microgrid group to increase the stability and reliability of power supply. Existing microgrid resource integration strategies mainly use empirical methods, optimization methods, centralized or distributed machine learning methods to integrate and analyze the information and resources provided by all partners to support corresponding business and decision-making and energy management. The disadvantages of these methods are that all partners' data or intermediate information of training iterations need to be sent directly to the partners or servers for analysis, which will bring the risk of privacy leakage. In addition, for microgrid groups owned by many different stakeholders, the use of distributed optimization methods is easily restricted in the energy exchange between microgrids; at the same time, there is a lack of provable fairness mechanisms to optimize power scheduling, resource allocation and demand response. Finally, existing research focuses more on the contribution of economic entities, lacks the design of contribution estimation methods for the fair distribution of economic surplus between producers and consumers, and is prone to low participation enthusiasm before forming a good microgrid cooperation, which hinders the healthy development of the cooperation ecology. Summary of the invention
[0003] In view of the problems existing in the existing microgrid operation decision-making and system based on the federated learning algorithm, the present invention is proposed.
[0004] Therefore, the problem to be solved by the present invention is: how to design a fair and reasonable contribution estimation strategy to optimize power scheduling, resource allocation of producers and high response to consumer needs.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0006] In a first aspect, an embodiment of the present invention provides a microgrid operation decision method based on a federated learning algorithm, which comprises the following steps:
[0007] The prosumers calculate the output power through the EMS system. The microgrid system integrates the output power declarations of all prosumers to form the total power and determine the exchange power with the main grid, and then submits the day-ahead market bidding curve;
[0008] The market operator clears the electricity price, calculates the total revenue of the microgrid system, and uses the Nash negotiation algorithm to preliminarily distribute the surplus among prosumers;
[0009] Calculate the cooperative surplus space generated by all producers and consumers, distribute the cooperative surplus space, build a cloud-based global strategy model, and generate a global strategy library.
[0010] As a preferred solution of the microgrid operation decision method based on the federated learning algorithm described in the present invention, wherein: the prosumers are power supply-dominated prosumers and energy storage-dominated prosumers;
[0011] Among them, the internal aggregation unit of the power supply-dominated prosumer is composed of a photovoltaic system and a gas turbine, and the internal aggregation unit of the energy storage-dominated prosumer is an energy storage system.
[0012] As a preferred solution of the microgrid operation decision method based on the federated learning algorithm described in the present invention, the operation cost calculation formula of the power-dominated prosumer is expressed as:
[0013]
[0014] In the formula, Expressed as the total operating cost of the prosumer, C pv Expressed as photovoltaic operation and maintenance cost, Expressed as the gas turbine power generation cost, λ pv Expressed as the operation and maintenance cost per unit capacity of photovoltaic power generation, S pv Expressed as photovoltaic installed capacity, n i Expressed as the number of gas turbine units, It is expressed as the output power of the gas turbine unit i in period t, k i Expressed as the fuel cost of the i-th unit gas turbine, Expressed as the startup cost of the gas turbine in unit i, Expressed as the gas turbine shutdown cost of the i-th unit, and They respectively represent whether the gas turbine of unit i is started or stopped during period t;
[0015] If the i-th unit gas turbine is in the startup state during period t, then is 1 and is 0;
[0016] If the i-th unit gas turbine is stopped during period t, then is 0 and is 1;
[0017] The operating cost calculation formula of the energy storage-dominated prosumer is expressed as:
[0018]
[0019] In the formula, Expressed as the operating cost of energy storage during period t, n x Expressed as the number of ESS units, It is expressed as the charging power of the x-th ESS in period t, It is expressed as the discharge power of the xth ESS in period t. and All are expressed as cost coefficients;
[0020] Among them, the operating constraints of the energy storage-dominated prosumer operating cost calculation formula are expressed as:
[0021]
[0022] In the formula, and They are respectively represented as the maximum charging power and discharging power of the x-th energy storage device, and They represent the minimum and maximum storage capacity of the x-th energy storage device, respectively. and They respectively represent whether the x-th energy storage device is charged or discharged in time period t, and represents the initial storage capacity of the x-th energy storage device and the storage capacity at the end of scheduling, and They represent the storage capacity of the x-th energy storage device at time periods t and t-1, respectively. and represent the charging efficiency and discharging efficiency of the x-th energy storage device respectively.
[0023] As a preferred solution of the microgrid operation decision method based on the federated learning algorithm described in the present invention, when initially allocating the surplus of the prosumers, the microgrid system integrates all prosumers and participates in the joint dispatch of the energy market and the reserve market as a whole in the form of a cooperative alliance. The objective function is expressed as:
[0024]
[0025] In the formula, S cms It is the income obtained by the community microgrid when participating in market activities. It is the income of community microgrid participating in the energy reserve market. and They are respectively represented as the power generation planning cost and load demand response cost in period t, and They are respectively represented as the energy market electricity price and the reserve electricity price of the ancillary service market during period t, P t em With P t srmThey are respectively represented as the bidding amount of the community microgrid in the energy market and the reserve market during period t;
[0026] Based on the objective function, the microgrid system conducts Nash negotiation. First, the benefit function of each participant is defined, and then the Nash equilibrium solution is calculated. The calculation formula of the benefit function of each participant is expressed as:
[0027]
[0028] The Nash equilibrium solution is the one that satisfies the maximum product of the benefit functions of each participant. It is expressed as:
[0029]
[0030] In the formula, α i Expressed as a distribution factor, x i Expressed as the final distribution coefficient, U i,x Expressed as the benefit function of all participants, It represents the Nash equilibrium solution, argmax represents the value of the variable when the expression reaches the maximum value, and V represents the total profit of the cooperative alliance.
[0031] As a preferred solution of the microgrid operation decision method based on the federated learning algorithm described in the present invention, when initially allocating the surplus of the prosumer, the calculated allocation factor is adjusted. The specific steps require calculating the independent risk contribution and the boundary contribution. When calculating the independent risk contribution, the independent risk contribution theory is used to obtain the contribution of individual prosumers to the operation risk of the microgrid system, which is expressed by the formula:
[0032]
[0033] C i,SAC It is expressed as the contribution of participant i to the operation risk of the microgrid system, L i It is expressed as the risk preference coefficient of participant i when running independently, and its range is between 0 and 1, and L i The larger the value, the higher the risk preference. ρ(·) is represented as the risk assessment function. Substituting the two fixed points (0,0) and (1,1) respectively, the specific expression of the risk assessment function can be determined. m and n are respectively represented as the parameters in the risk assessment function.
[0034] Then generalize the risk factors, and the calculation formula of the ratio factor of risk size is expressed as:
[0035]
[0036] In the formula, γ i Expressed as the risk size ratio factor of the ith participant;
[0037] When calculating the marginal contribution, the marginal contribution calculation based on the Shapley value method is expressed as follows:
[0038]
[0039] In the formula, It is expressed as the cooperation surplus value finally shared by the i-th participant, ω(N s ) represents the allocation weight coefficient of the i-th participant, M represents the total number of participants, N s It is expressed as the number of participants in the cooperative alliance, s i Represented as a sub-coalition with subject i, v s and They are respectively represented as the profit of the cooperative alliance and the profit of the sub-alliance after removing i from the cooperative alliance;
[0040] The adjustment calculation formula of the allocation factor is expressed as:
[0041]
[0042] β i Expressed as contribution weight factor, ε i Represented as the weight of the weight factor, which is a 1×2 dimensional vector;
[0043] The EMS system of the microgrid system distributes the surplus of producers and consumers through contribution weight factors.
[0044] As a preferred solution of the microgrid operation decision-making method based on the federated learning algorithm described in the present invention, the step of building a cloud-based global strategy model includes:
[0045] Upload the local model data of all microgrid systems to the cloud database and pre-process them;
[0046] Based on historical data, simulate different operating scenarios;
[0047] Provide a global strategy library through simulation results;
[0048] Among them, when simulating different operation scenarios, the objective function of the total operation cost of the microgrid system is established, which is specifically expressed as:
[0049]
[0050] P grid,i,t It is expressed as the transaction power between the microgrid group where the microgrid is located and the distribution network in the tth period, P trade,i,t Expressed as target transaction power, e g,tIt is represented by the transaction price between microgrid i and distribution network in the tth period, I is represented by the number of microgrids participating in the joint modeling, and C MGs It is expressed as the total operating cost of the microgrid group, and the internal operating cost C of microgrid i self,i,t The power P of various units inside i,t Decide;
[0051] For the objective function calculation formula, the pattern search algorithm is used to complete the calculation. The calculation method of the pattern search algorithm is expressed as:
[0052]
[0053] In the formula, x k Represents the current iteration point, Δ k is the grid size, D is a matrix of finite search directions, and z is n D A vector of natural numbers of dimension 1, used to generate the grid, M k Represented as a new iteration point;
[0054] It is also necessary to calculate the transaction costs reduced when the microgrid system and individual operations are performed. The specific calculation formula is:
[0055]
[0056] In the formula, It is expressed as the additional revenue generated by the microgrid group and the individual operation, C DN (*) represents the cost function, P buy,t Expressed as total purchased power, P sell,t Expressed as total electricity sales power, C buy Expressed as the purchase price of electricity, C sell Indicates the selling price of electricity.
[0057] As a preferred solution of the microgrid operation decision-making method based on the federated learning algorithm of the present invention, wherein: the cloud global strategy model includes a bottom layer model, an interaction layer model and a top layer model, wherein the bottom layer model is used to collect the local model of the microgrid system;
[0058] The interaction layer model adopts a key-encrypted fully connected network architecture to aggregate and update data gradients across microgrids while protecting privacy.
[0059] The top-level model makes the final strategic decision based on the information of the bottom-level model and the interaction-level model;
[0060] For each microgrid, the definition of its input variables is expressed as:
[0061] X i =[P PV,i ,PWT,i ,P load,i ,e b ,e s ];
[0062] Among them, X i Represented as the input variable of each microgrid, P PV,i It is represented by the photovoltaic power generation power of the i-th microgrid, P WT,i It is represented by the wind power generation power of the i-th microgrid, P load,i It is represented as the load power of the i-th microgrid, e b Indicates the battery energy storage state, e s Represents the energy storage state of the supercapacitor;
[0063] In order to reduce the difficulty of network training, the output variables are removed after the transaction power and transaction electricity price. After simplification, the output variables are expressed as:
[0064] Y i =[P GT,i ,P bat,i ];
[0065] Where Y i Represented as the output variable of each microgrid, P GT,i It is represented by the power generated by the gas turbine of the i-th microgrid, P bat,i It is represented as the exchange power between the i-th microgrid and the main grid;
[0066] Among them, the loss function adopts the square loss function, and the calculated value is the average of the square of the deviation between the predicted value output by the network and the true value of the global strategy library, which is specifically expressed as:
[0067]
[0068] Where, L loss,i Expressed as squared loss, Y i Represented as the true value of the global policy library, Represented as through the network N net,i The predicted values obtained,[*] are expressed as encrypted, i.e., microgrid i indirectly perceives the input variables of other microgrids through the interaction layer model.
[0069] In a second aspect, an embodiment of the present invention provides a microgrid operation decision system based on a federated learning algorithm, which includes an energy management module, a revenue calculation module, a surplus allocation module, and a model building module;
[0070] The energy management module is responsible for calculating and reporting the output power of each prosumer and integrating all the output powers;
[0071] The revenue calculation module is used to calculate the total revenue of the microgrid system according to the market clearing electricity price;
[0072] The surplus allocation module uses the Nash negotiation algorithm to perform a preliminary allocation of the surplus of the prosumers;
[0073] The model building module is responsible for building a cloud-based global policy model and performing calculations using the cloud-based global policy model.
[0074] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the processor executes the computer program, any step of the above-mentioned microgrid operation decision method based on the federated learning algorithm is implemented.
[0075] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the above-mentioned microgrid operation decision-making method based on the federated learning algorithm is implemented.
[0076] The beneficial effects of the present invention are as follows: the method adopts federated learning and encryption technology, and the use of the interactive layer model, in addition to data encryption, also acts as a security gateway to implement functions such as access control and intrusion detection, thereby improving the network security of the entire microgrid group, and as the microgrid joins or exits, the interactive layer model can dynamically adjust the network topology to ensure the flexibility and scalability of the system, while achieving effective fusion of heterogeneous data.
[0077] The construction of the cloud-based global strategy model breaks through the limitations of traditional distributed optimization methods in the coordination between microgrids. The cloud-based global strategy model can comprehensively consider the status and needs of all participating microgrids to achieve true global optimization, rather than just a simple combination of local optimal solutions. Traditional methods are often limited by factors such as incomplete information and decentralized decision-making when dealing with energy exchange between microgrids. This method realizes data aggregation and gradient update across microgrids through an interactive layer model, so that energy exchange decisions can be optimized based on more comprehensive information, which not only improves energy utilization efficiency, but also enhances the stability of the entire microgrid group. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0079] Figure 1 Flowchart of the microgrid operation decision-making method based on the federated learning algorithm.
[0080] Figure 2 This is a structural diagram of the microgrid operation decision-making method based on the federated learning algorithm.
[0081] Figure 3 This is the first support unit structure diagram of the microgrid operation decision method based on the federated learning algorithm.
[0082] Figure 4 Another perspective diagram of the first support unit of the microgrid operation decision-making method based on the federated learning algorithm.
[0083] Figure 5 This is the structural diagram of the second support unit of the microgrid operation decision method based on the federated learning algorithm.
[0084] Figure 6 Another perspective diagram of the second support unit of the microgrid operation decision-making method based on the federated learning algorithm.
[0085] Figure 7 This is a structural change diagram of the alternating process of the microgrid operation decision-making method based on the federated learning algorithm.
[0086] Figure 8 This is a structural change diagram of the alternating process of the microgrid operation decision-making method based on the federated learning algorithm. DETAILED DESCRIPTION
[0087] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0088] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0089] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0090] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0091] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0092] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0093] Example 1
[0094] Reference Figure 1 to Figure 6 , which is the first embodiment of the present invention, and provides a microgrid operation decision method based on a federated learning algorithm, comprising the following steps:
[0095] S1. Producers and consumers calculate their output power through the EMS system. The microgrid system integrates the output power declarations of all producers and consumers to form the total power and determine the exchange power with the main grid, and then submits the day-ahead market bidding curve.
[0096] The prosumers are power supply-dominated prosumers and energy storage-dominated prosumers;
[0097] Among them, the internal aggregation unit of the power supply-dominated prosumer is composed of a photovoltaic system and a gas turbine, and the internal aggregation unit of the energy storage-dominated prosumer is an energy storage system.
[0098] The operating cost calculation formula of power-dominated prosumers is expressed as:
[0099]
[0100] In the formula, Expressed as the total operating cost of the prosumer, C pv Expressed as photovoltaic operation and maintenance cost, Expressed as the gas turbine power generation cost, λ pv Expressed as the operation and maintenance cost per unit capacity of photovoltaic power generation, S pv Expressed as photovoltaic installed capacity, n i Expressed as the number of gas turbine units, It is expressed as the output power of the gas turbine unit i in period t, k i Expressed as the fuel cost of the i-th unit gas turbine, Expressed as the startup cost of the gas turbine in unit i, Expressed as the gas turbine shutdown cost of the i-th unit, and They respectively represent whether the gas turbine of unit i is started or stopped during period t;
[0101] If the i-th unit gas turbine is in the startup state during period t, then is 1 and is 0;
[0102] If the i-th unit gas turbine is stopped during period t, then is 0 and is 1;
[0103] The operating cost calculation formula of the energy storage-dominated prosumer is expressed as:
[0104]
[0105] In the formula, Expressed as the operating cost of energy storage during period t, n x Expressed as the number of ESS units, It is expressed as the charging power of the x-th ESS in period t, It is expressed as the discharge power of the xth ESS in period t. and All are expressed as cost coefficients;
[0106] Among them, the operating constraints of the energy storage-dominated prosumer operating cost calculation formula are expressed as:
[0107]
[0108] In the formula, and They are respectively represented as the maximum charging power and discharging power of the x-th energy storage device, and They represent the minimum and maximum storage capacity of the x-th energy storage device, respectively. and They respectively represent whether the x-th energy storage device is charged or discharged in time period t, and represents the initial storage capacity of the x-th energy storage device and the storage capacity at the end of scheduling, and They represent the storage capacity of the x-th energy storage device at time periods t and t-1, respectively. and represent the charging efficiency and discharging efficiency of the x-th energy storage device respectively.
[0109] S2. The market operator clears the electricity price, calculates the total revenue of the microgrid system, and uses the Nash negotiation algorithm to preliminarily distribute the surplus among producers and consumers.
[0110] When initially allocating the surplus of prosumers, the microgrid system integrates all prosumers and participates in the joint dispatch of the energy market and the reserve market as a whole in the form of a cooperative alliance. The objective function is expressed as:
[0111]
[0112] In the formula, S cms It is the income obtained by the community microgrid when participating in market activities. It is the income of community microgrid participating in the energy reserve market. and They are respectively represented as the power generation planning cost and load demand response cost in period t, and They are respectively represented as the energy market electricity price and the reserve electricity price of the ancillary service market during period t, P t em With P t srm They are respectively represented as the bidding amount of the community microgrid in the energy market and the reserve market during period t;
[0113] The objective function includes the revenue from the energy market and reserve market, as well as the generation planning costs and load demand response costs;
[0114] Based on the objective function, the microgrid system conducts Nash negotiation. First, the benefit function of each participant is defined, and then the Nash equilibrium solution is calculated. The calculation formula of the benefit function of each participant is expressed as:
[0115]
[0116] The Nash equilibrium solution is the one that satisfies the maximum product of the benefit functions of each participant. It is expressed as:
[0117]
[0118] In the formula, α i Expressed as a distribution factor, x i Expressed as the final distribution coefficient, U i,xExpressed as the benefit function of all participants, It represents the Nash equilibrium solution, argmax represents the value of the variable when the expression reaches the maximum value, and V represents the total profit of the cooperative alliance.
[0119] When initially allocating the surplus of the prosumers, the calculated allocation factor is adjusted. The specific steps require calculating the independent risk contribution and the boundary contribution. When calculating the independent risk contribution, the independent risk contribution theory is used to obtain the contribution of individual prosumers to the operating risk of the microgrid system, which is expressed by the formula:
[0120]
[0121] C i,SAC It is expressed as the contribution of participant i to the operation risk of the microgrid system, L i It is expressed as the risk preference coefficient of participant i when running independently, and its range is between 0 and 1, and L i The larger the value, the higher the risk preference. ρ(·) is represented as the risk assessment function. Substituting the two fixed points (0,0) and (1,1) respectively, the specific expression of the risk assessment function can be determined. m and n are respectively represented as the parameters in the risk assessment function.
[0122] Then generalize the risk factors, and the calculation formula of the ratio factor of risk size is expressed as:
[0123]
[0124] In the formula, γ i Expressed as the risk size ratio factor of the ith participant;
[0125] When calculating the marginal contribution, the marginal contribution calculation based on the Shapley value method is expressed as follows:
[0126]
[0127] In the formula, It is expressed as the cooperation surplus value finally shared by the i-th participant, ω(N s ) represents the allocation weight coefficient of the i-th participant, M represents the total number of participants, N s It is expressed as the number of participants in the cooperative alliance, s i Represented as a sub-coalition with subject i, v s and They are respectively represented as the profit of the cooperative alliance and the profit of the sub-alliance after removing i from the cooperative alliance;
[0128] The adjustment calculation formula of the allocation factor is expressed as:
[0129]
[0130] β i Expressed as contribution weight factor, ε i Represented as the weight of the weight factor, which is a 1×2 dimensional vector;
[0131] The EMS system of the microgrid system distributes the surplus of producers and consumers through contribution weight factors.
[0132] S3. Calculate the cooperative surplus space generated by all producers and consumers, distribute the cooperative surplus space, build a cloud-based global strategy model, and generate a global strategy library.
[0133] The steps to build a cloud-based global policy model include:
[0134] Upload the local model data of all microgrid systems to the cloud database and pre-process them;
[0135] Based on historical data, simulate different operating scenarios;
[0136] Provide a global strategy library through simulation results;
[0137] Among them, when simulating different operation scenarios, the objective function of the total operation cost of the microgrid system is established, which is specifically expressed as:
[0138]
[0139] P grid,i,t It is expressed as the transaction power between the microgrid group where the microgrid is located and the distribution network in the tth period, P trade,i,t Expressed as target transaction power, e g,t It is represented by the transaction price between microgrid i and distribution network in the tth period, I is represented by the number of microgrids participating in the joint modeling, and C MGs It is expressed as the total operating cost of the microgrid group, and the internal operating cost C of microgrid i self,i,t The power P of various units inside i,t Decide;
[0140] For the objective function calculation formula, the pattern search algorithm is used to complete the calculation. The calculation method of the pattern search algorithm is expressed as:
[0141]
[0142] In the formula, x k Represents the current iteration point, Δ k is the grid size, D is a matrix of finite search directions, and z is n D A vector of natural numbers of dimension 1, used to generate the grid, M kRepresented as a new iteration point;
[0143] It is also necessary to calculate the transaction costs reduced when the microgrid system and individual operations are performed. The specific calculation formula is:
[0144]
[0145] In the formula, It is expressed as the additional revenue generated by the microgrid group and the individual operation, C DN (*) represents the cost function, P buy,t Expressed as total purchased power, P sell,t Expressed as total electricity sales power, C buy Expressed as the purchase price of electricity, C sell Indicates the selling price of electricity.
[0146] The cloud-based global strategy model includes a bottom-layer model, an interaction layer model, and a top-layer model, wherein the bottom-layer model is used to collect the local model of the microgrid system;
[0147] The interaction layer model adopts a key-encrypted fully connected network architecture to aggregate and update data gradients across microgrids while protecting privacy.
[0148] The top-level model makes the final strategic decision based on the information of the bottom-level model and the interaction-level model;
[0149] For each microgrid, the definition of its input variables is expressed as:
[0150] X i =[P PV,i ,P WT,i ,P load,i ,e b ,e s ];
[0151] Among them, X i Represented as the input variable of each microgrid, P PV,i It is represented by the photovoltaic power generation power of the i-th microgrid, P WT,i It is represented by the wind power generation power of the i-th microgrid, P load,i It is represented as the load power of the i-th microgrid, e b Indicates the battery energy storage state, e s Represents the energy storage state of the supercapacitor;
[0152] In order to reduce the difficulty of network training, the output variables are removed after the transaction power and transaction electricity price. After simplification, the output variables are expressed as:
[0153]
[0154] Where Yi Represented as the output variable of each microgrid, P GT,i It is represented by the power generated by the gas turbine of the i-th microgrid, P bat,i It is represented as the exchange power between the i-th microgrid and the main grid;
[0155] Among them, the loss function adopts the square loss function, and the calculated value is the average of the square of the deviation between the predicted value output by the network and the true value of the global strategy library, which is specifically expressed as:
[0156]
[0157] Where, L loss,i Expressed as squared loss, Y i Represented as the true value of the global policy library, Represented as through the network N net,i The predicted values obtained,[*] are expressed as encrypted, i.e., microgrid i indirectly perceives the input variables of other microgrids through the interaction layer model.
[0158] In summary, this method adopts federated learning and encryption technology. The use of the interactive layer model, in addition to data encryption, also acts as a security gateway to implement access control, intrusion detection and other functions to improve the network security of the entire microgrid group. Moreover, as the microgrid joins or exits, the interactive layer model can dynamically adjust the network topology to ensure the flexibility and scalability of the system, while realizing the effective fusion of heterogeneous data.
[0159] The construction of the cloud-based global strategy model breaks through the limitations of traditional distributed optimization methods in the coordination between microgrids. The cloud-based global strategy model can comprehensively consider the status and needs of all participating microgrids to achieve true global optimization, rather than just a simple combination of local optimal solutions. Traditional methods are often limited by factors such as incomplete information and decentralized decision-making when dealing with energy exchange between microgrids. This method realizes data aggregation and gradient update across microgrids through an interactive layer model, so that energy exchange decisions can be optimized based on more comprehensive information, which not only improves energy utilization efficiency, but also enhances the stability of the entire microgrid group.
[0160] Example 2
[0161] On the basis of the first embodiment, this embodiment further provides a microgrid operation decision system based on a federated learning algorithm, including an energy management module, a revenue calculation module, a surplus allocation module, and a model building module;
[0162] The energy management module is responsible for calculating and reporting the output power of each prosumer and integrating all the output powers;
[0163] The revenue calculation module is used to calculate the total revenue of the microgrid system according to the market clearing electricity price;
[0164] The surplus allocation module uses the Nash negotiation algorithm to perform a preliminary allocation of the surplus of the prosumers;
[0165] The model building module is responsible for building a cloud-based global policy model and performing calculations using the cloud-based global policy model.
[0166] This embodiment also provides a computer device, which is suitable for the microgrid operation decision-making method based on the federated learning algorithm, including a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the microgrid operation decision-making method based on the federated learning algorithm proposed in the above embodiment.
[0167] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0168] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the microgrid operation decision-making method based on the federated learning algorithm proposed in the above embodiment is implemented.
[0169] The storage medium proposed in this embodiment and the data storage method proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be found in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0170] Example 3
[0171] On the basis of the previous two embodiments, this embodiment provides a microgrid operation decision-making method based on a federated learning algorithm. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through simulation experiments.
[0172] Experimental environment: Assume that we have a microgrid cluster system consisting of multiple microgrids, including 2 power-dominant prosumers (each with 1 photovoltaic system and 1 gas turbine), 1 energy storage-dominant prosumer (with 2 energy storage units), and several loads.
[0173] Comparative example: traditional centralized optimization method; simple distributed optimization method (without considering the global strategy).
[0174]
[0175]
[0176] In a variety of scenarios, the method of the present invention can achieve the lowest operating cost and the highest energy utilization rate, and secondly can maintain the minimum frequency deviation, indicating that the system operation is more stable and the overall privacy protection is increased.
[0177] Example 4
[0178] Reference Figure 7 and Figure 8 Based on Example 1 and Example 2, this embodiment also provides a microgrid operation decision-making method based on a federated learning algorithm. In order to verify the beneficial effects of the present invention, a second scientific demonstration is carried out through simulation experiments.
[0179] The experiment focuses on a microgrid group in Brussels, which includes three main producers and consumers. GAMS24.4.6 is used as the test platform, CPLEX is used to solve the energy ancillary service market model, and the interior point optimizer (IPOPT) is used to solve the Nash negotiation problem.
[0180] The experiment conducted two comparative tests: in Case 1, the microgrid participated in the energy and ancillary service markets; while in Case 2, it only participated in the energy market to verify the effectiveness of the dispatch model. In the experiment, the maximum charging and discharging power of the energy storage power station was set to 8MW, the energy storage capacity was 40MW·h, and the charging and discharging efficiency was 0.9.
[0181] Figure 7 The power market bidding situation under the microgrid energy storage joint dispatch mode is shown. Figure 7 (a) and Figure 7 (b) It can be seen that the microgrid adopts a more flexible market bidding method through joint scheduling. This strategy enables the equipment to reserve a certain production capacity for the backup market, improves the economic benefits of the microgrid, and optimizes the configuration of energy and backup capacity. Therefore, the simultaneous participation in energy storage scheduling proves the economic feasibility of the strategy.
[0182] In order to evaluate the effectiveness of the collaborative optimization method for microgrid groups, the experiment used MATLAB, Python and FATE architecture to build a simulation platform for microgrid groups and federated learning to verify the effectiveness of the method. MATLAB was used for system simulation, Python and FATE were used to develop control strategies and learning algorithms. This experiment used a deep learning model to optimize the cloud-based strategy and verified the effectiveness of federated learning. The cloud-based scenario used the kernel density method to analyze the historical data of wind and solar power generation and was expanded through specific sampling techniques.
[0183] Figure 8 The convergence curve of the root mean square error (RMSE) between the basic parameters of each microgrid and the federated learning training is shown in Figure 8 (a) and Figure 8 In (b), the average relative error of the network decision output remains within 1.8%, which indicates that the network decision output of each microgrid is very close to the global optimization result in the cloud. The federated network skillfully absorbs the strategies discovered through cloud search and is able to make informed decisions with limited information, thereby facilitating collaborative operations among multi-agent microgrid groups.
[0184] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A microgrid operation decision-making method based on a federated learning algorithm, characterized in that: The following steps are included: The prosumers calculate the output power through the EMS system. The microgrid system integrates the output power declarations of all prosumers to form the total power and determine the exchange power with the main grid, and then submits the day-ahead market bidding curve; The market operator clears the electricity price, calculates the total revenue of the microgrid system, and uses the Nash negotiation algorithm to preliminarily distribute the surplus among prosumers; Calculate the cooperative surplus space generated by all producers and consumers, distribute the cooperative surplus space, build a cloud-based global strategy model, and generate a global strategy library.
2. The microgrid operation decision method based on the federated learning algorithm according to claim 1, characterized in that: The prosumers are power supply-dominated prosumers and energy storage-dominated prosumers; Among them, the internal aggregation unit of the power supply-dominated prosumer is composed of a photovoltaic system and a gas turbine, and the internal aggregation unit of the energy storage-dominated prosumer is an energy storage system.
3. The microgrid operation decision method based on the federated learning algorithm according to claim 2, characterized in that: The operating cost calculation formula of the power-dominated prosumer is expressed as: In the formula, Expressed as the total operating cost of the prosumer, C pv Expressed as photovoltaic operation and maintenance cost, Expressed as the gas turbine power generation cost, λ pv Expressed as the operation and maintenance cost per unit capacity of photovoltaic power generation, S pv Expressed as photovoltaic installed capacity, n i Expressed as the number of gas turbine units, It is expressed as the output power of the gas turbine unit i in period t, k i Expressed as the fuel cost of the i-th gas turbine unit, λ i su Expressed as the startup cost of the gas turbine in unit i, Expressed as the gas turbine shutdown cost of the i-th unit, and They respectively represent whether the gas turbine of unit i is started or stopped during period t; If the i-th unit gas turbine is in the startup state during period t, then is 1 and is 0; If the i-th unit gas turbine is stopped during period t, then is 0 and is 1; The operating cost calculation formula of the energy storage-dominated prosumer is expressed as: In the formula, Expressed as the operating cost of energy storage during period t, n x Expressed as the number of ESS units, It is expressed as the charging power of the x-th ESS in period t, It is expressed as the discharge power of the xth ESS in period t. and All are expressed as cost coefficients; Among them, the operating constraints of the energy storage-dominated prosumer operating cost calculation formula are expressed as: In the formula, and They are respectively represented as the maximum charging power and discharging power of the x-th energy storage device, and They represent the minimum and maximum storage capacity of the x-th energy storage device, respectively. and They respectively represent whether the x-th energy storage device is charged or discharged in time period t, and represents the initial storage capacity of the x-th energy storage device and the storage capacity at the end of scheduling, and They represent the storage capacity of the x-th energy storage device at time periods t and t-1, respectively. and represent the charging efficiency and discharging efficiency of the x-th energy storage device respectively.
4. The microgrid operation decision method based on the federated learning algorithm according to claim 3, characterized in that: When initially allocating the surplus of prosumers, the microgrid system integrates all prosumers and participates in the joint dispatch of the energy market and the reserve market as a whole in the form of a cooperative alliance. The objective function is expressed as: In the formula, S cms It is the income obtained by the community microgrid when participating in market activities. It is the income of community microgrid participating in the energy reserve market. and They are respectively represented as the power generation planning cost and load demand response cost in period t, and They are respectively represented as the energy market electricity price and the reserve electricity price of the ancillary service market during period t, P t em With P t srm They are respectively represented as the bidding amount of the community microgrid in the energy market and the reserve market during period t; Based on the objective function, the microgrid system conducts Nash negotiation. First, the benefit function of each participant is defined, and then the Nash equilibrium solution is calculated. The calculation formula of the benefit function of each participant is expressed as: The Nash equilibrium solution is the one that satisfies the maximum product of the benefit functions of each participant. It is expressed as: In the formula, α i Expressed as a distribution factor, x i Expressed as the final distribution coefficient, U i,x Expressed as the benefit function of all participants, It represents the Nash equilibrium solution, argmax represents the value of the variable when the expression reaches the maximum value, and V represents the total profit of the cooperative alliance.
5. The microgrid operation decision method based on the federated learning algorithm according to claim 4, characterized in that: When initially allocating the surplus of the prosumers, the calculated allocation factor is adjusted. The specific steps require calculating the independent risk contribution and the boundary contribution. When calculating the independent risk contribution, the independent risk contribution theory is used to obtain the contribution of individual prosumers to the operating risk of the microgrid system, which is expressed by the formula: C i,SAC It is expressed as the contribution of participant i to the operation risk of the microgrid system, L i It is expressed as the risk preference coefficient of participant i when running independently, and its range is between 0 and 1, and L i The larger the value, the higher the risk preference. ρ(·) is represented as the risk assessment function. Substituting the two fixed points (0,0) and (1,1) respectively, the specific expression of the risk assessment function can be determined. m and n are respectively represented as the parameters in the risk assessment function. Then generalize the risk factors, and the calculation formula of the ratio factor of risk size is expressed as: In the formula, γ i Expressed as the risk size ratio factor of the ith participant; When calculating the marginal contribution, the marginal contribution calculation based on the Shapley value method is expressed as follows: In the formula, It is expressed as the cooperation surplus value finally shared by the i-th participant, ω(N s ) represents the allocation weight coefficient of the i-th participant, M represents the total number of participants, N s It is expressed as the number of participants in the cooperative alliance, s i Represented as a sub-coalition with subject i, v s and They are respectively represented as the profit of the cooperative alliance and the profit of the sub-alliance after removing i from the cooperative alliance; The adjustment calculation formula of the allocation factor is expressed as: β i Expressed as contribution weight factor, ε i Represented as the weight of the weight factor, which is a 1×2 dimensional vector; The EMS system of the microgrid system distributes the surplus of producers and consumers through contribution weight factors.
6. The microgrid operation decision method based on the federated learning algorithm according to claim 5, characterized in that: The steps to build a cloud-based global policy model include: Upload the local model data of all microgrid systems to the cloud database and pre-process them; Based on historical data, simulate different operating scenarios; Provide a global strategy library through simulation results; Among them, when simulating different operation scenarios, the objective function of the total operation cost of the microgrid system is established, which is specifically expressed as: P grid,i,t It is expressed as the transaction power between the microgrid group where the microgrid is located and the distribution network in the tth period, P trade,i,t Expressed as target transaction power, e g,t It is represented by the transaction price between microgrid i and distribution network in the tth period, I is represented by the number of microgrids participating in the joint modeling, and C MGs It is expressed as the total operating cost of the microgrid group, and the internal operating cost of microgrid i is C self,i,t The power P of various units inside i,t Decide; For the objective function calculation formula, the pattern search algorithm is used to complete the calculation. The calculation method of the pattern search algorithm is expressed as: In the formula, x k Represents the current iteration point, Δ k is the grid size, D is a matrix of finite search directions, and z is n D A vector of natural numbers of dimension 1, used to generate the grid, M k Represented as a new iteration point; It is also necessary to calculate the transaction costs reduced when the microgrid system and individual operations are performed. The specific calculation formula is: In the formula, It is expressed as the additional revenue generated by the microgrid group and the individual operation, C DN (*) represents the cost function, P buy,t Expressed as total purchased power, P sell,t Expressed as total electricity sales power, C buy Expressed as the purchase price of electricity, C sell Indicates the selling price of electricity.
7. The microgrid operation decision method based on the federated learning algorithm according to claim 6, characterized in that: The cloud-based global strategy model includes a bottom-layer model, an interaction layer model, and a top-layer model, wherein the bottom-layer model is used to collect a local model of the microgrid system; The interaction layer model adopts a key-encrypted fully connected network architecture to aggregate and update data gradients across microgrids while protecting privacy. The top-level model makes the final strategic decision based on the information of the bottom-level model and the interaction-level model; For each microgrid, the definition of its input variables is expressed as: X i =[P PV,i ,P WT,i ,P load,i ,And b ,And s ]; Among them, X i Represented as the input variable of each microgrid, P PV,i It is represented by the photovoltaic power generation power of the i-th microgrid, P WT,i It is represented by the wind power generation power of the i-th microgrid, P load,i It is represented as the load power of the i-th microgrid, e b Indicates the battery energy storage state, e s Represents the energy storage state of the supercapacitor; In order to reduce the difficulty of network training, the output variables are removed after the transaction power and transaction electricity price. After simplification, the output variables are expressed as: Y i =[P GT,i ,P bat,i ]; Where Y i Represented as the output variable of each microgrid, P GT,i It is represented by the power generated by the gas turbine of the i-th microgrid, P bat,i It is represented as the exchange power between the i-th microgrid and the main grid; Among them, the loss function adopts the square loss function, and the calculated value is the average of the square of the deviation between the predicted value output by the network and the true value of the global strategy library, which is specifically expressed as: Where, L loss,i Expressed as squared loss, Y i Represented as the true value of the global policy library, Represented as through the network N net,i The predicted values obtained,[*] are expressed as encrypted, i.e., microgrid i indirectly perceives the input variables of other microgrids through the interaction layer model.
8. A microgrid operation decision system based on a federated learning algorithm, based on the microgrid operation decision method based on a federated learning algorithm according to any one of claims 1 to 7, characterized in that: It includes energy management module, revenue calculation module, surplus distribution module, and model building module; The energy management module is responsible for calculating and reporting the output power of each prosumer and integrating all the output powers; The revenue calculation module is used to calculate the total revenue of the microgrid system according to the market clearing electricity price; The surplus allocation module uses the Nash negotiation algorithm to perform a preliminary allocation of the surplus of the prosumers; The model building module is responsible for building a cloud-based global policy model and performing calculations using the cloud-based global policy model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the microgrid operation decision method based on the federated learning algorithm described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the microgrid operation decision method based on the federated learning algorithm described in any one of claims 1 to 7 are implemented.