Energy regulation method and device for a building complex

By constructing a master-slave game model, the problem of the accuracy of regulation that ignores the interaction between building-related users and agents in existing technologies is solved, and more precise energy regulation is achieved.

CN116245682BActive Publication Date: 2026-04-17CHINA ENERGY ENG GRP GUANGDONG ELECTRIC POWER DESIGN INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA ENERGY ENG GRP GUANGDONG ELECTRIC POWER DESIGN INST CO LTD
Filing Date
2023-02-03
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing energy regulation methods for low-carbon building clusters, game theory models neglect the interaction process between building-related users and building agents, resulting in a lack of accuracy in regulation.

Method used

A master-slave game model is constructed to consider the interaction process between the building complex and the building agent. By acquiring and analyzing internal resource data and power resource data, an operating cost function and an economic optimization model are constructed to generate a control strategy that maximizes the profits of the building agent.

Benefits of technology

It improves the accuracy of energy regulation, reflects the negotiation process between building-related users and building agents, and achieves more precise power system regulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116245682B_ABST
    Figure CN116245682B_ABST
Patent Text Reader

Abstract

This invention discloses an energy regulation method and apparatus for a building complex. The method includes: acquiring internal resource data of the power system of each building in the building complex; constructing an operating cost function and several constraints for each building based on the internal resource data; acquiring power resource data of the power system corresponding to a building agent; constructing an economic optimization model and several constraints for the building agent based on the power resource data and the internal resource data; constructing a master-slave game model with the building agent and the building complex as the main players based on the operating cost function and the economic optimization model; solving the master-slave game model under the several constraints to generate several indicators of the power system of each building when the building agent's profit is maximized; and regulating the energy of the building complex based on the several indicators. This invention considers the interaction process of the main players when constructing the master-slave game model, thus improving the accuracy of regulation when using the solution value for regulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of energy regulation, and more particularly to a method and apparatus for energy regulation of a building complex. Background Technology

[0002] With the development of distributed generation and energy storage technologies, rooftop photovoltaic and related projects, as a new energy source, are increasingly being used in cities. This includes transforming traditional buildings from electricity consumers into new types of buildings that combine consumption and production capabilities, making them low-carbon buildings.

[0003] Among them, third-party operators such as low-carbon building agents, acting as agents for low-carbon buildings, can effectively manage low-carbon building resources while coordinating conflicts between the upper-level power grid and various low-carbon buildings. This provides value and revenue to the power grid while protecting the rights and interests of users associated with low-carbon buildings. The control of low-carbon buildings by low-carbon building agents can be broadly categorized into direct control (centralized control) and indirect control (centralized control). Direct control involves directly incorporating distributed generating units and flexible loads into the power sales company's dispatch system. However, this method requires comprehensive control over equipment information related to low-carbon buildings, placing high demands on the power sales company's information collection capabilities. Furthermore, when the equipment data is too large, the computational requirements are also significant. In indirect control methods, existing technologies propose a game theory model, which uses intermediate signals for feedback based on the user's interests. This model considers both the interests of users associated with low-carbon buildings and the interests of agents, making it a more practical control method. However, the current game theory model only constructs the interest model of the other party based on one party, that is, it transforms the two-layer relationship between agents and users associated with low-carbon buildings into a single-layer relationship. This essentially ignores the interaction process between the two parties. Therefore, regulating based on the solution results of the above model lacks accuracy. Summary of the Invention

[0004] To overcome the shortcomings of the existing technology, this invention proposes an energy regulation method for building complexes. When constructing the master-slave game model, the interaction process between the building complex and the building agent is taken into account. Therefore, when regulating based on the solution value of the model, it is beneficial to improve the accuracy of regulation.

[0005] This invention provides an energy regulation method for a building complex, comprising:

[0006] Acquire internal resource data of the power system of each building in the building complex. The internal resource data includes: power output data of generator sets, charging and discharging data of energy storage systems, power output data of new energy photovoltaics, flexible load adjustment data, original electricity demand data, electricity sales from building-related users to building agents, electricity sales prices from building-related users to building agents, electricity purchases from building-related users to building agents, and electricity purchase prices from building-related users to building agents.

[0007] Based on the internal resource data, an operating cost function for each building is constructed, and the first output power constraint, the charging and discharging power constraint of the energy storage system, the state of charge constraint of the energy storage system, the output power constraint of the new energy photovoltaic system, the flexible load adjustment constraint, and the first power balance constraint are constructed for each building's generator set.

[0008] Obtain power resource data of the power system corresponding to the construction agent. The power resource data includes: the output data of the generator sets owned by the construction agent, the amount of electricity sold by the construction agent to the power grid, the electricity price sold by the construction agent to the power grid, the amount of electricity purchased by the construction agent from the power grid, and the electricity price purchased by the construction agent from the power grid.

[0009] Based on the power resource data and the internal resource data, an economic optimization model for the construction agent is constructed, and a second output power constraint, an electricity price constraint, and a second power balance constraint are constructed for the generator sets owned by the construction agent.

[0010] Based on the operating cost function and the economic optimization model, a master-slave game model is constructed with construction agents and building groups as the main players.

[0011] Under the constraints of the first output power of each building's generator set, the charging and discharging power of the energy storage system, the state of charge of the energy storage system, the output power of the new energy photovoltaic system, the flexible load adjustment amount, the first power balance constraint, the second output power constraint of the generator set owned by the building agent, the electricity price constraint, and the second power balance constraint, the master-slave game model is solved to generate the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of the new energy photovoltaic system, and the flexible load adjustment amount when the building agent's profit is maximized.

[0012] Energy regulation of the building complex is carried out based on the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of new energy photovoltaics, and the adjustment amount of flexible load.

[0013] Furthermore, based on the internal resource data, an operating cost function for each building is constructed, including:

[0014] An internal resource model for each building for a given time period is constructed based on the internal resource data. The internal resource model includes a distributed unit model, an energy storage model, a new energy resource model, and an interruptible load model.

[0015] Based on the distributed generator unit model, construct the operating cost function of the generator unit in a time period; based on the energy storage model, construct the aging cost function of the energy storage system in a time period; based on the new energy resource model, construct the output power function of new energy photovoltaic in a time period; and based on the interruptible load model, construct the electricity satisfaction cost function brought by interruptible load in a time period.

[0016] The operating cost function for each building during a given time period is constructed based on the operating cost function of each building's generator unit during a given time period, the aging cost function of the energy storage system during a given time period, the output function of the new energy photovoltaic system during a given time period, the electricity satisfaction cost function brought about by the interruptible load model during a given time period, the original electricity demand data, the electricity sold by building-related users to building agents, the electricity sold by building-related users to building agents, the electricity purchased by building-related users from building agents, and the electricity purchased by building-related users from building agents.

[0017] Furthermore, the distributed unit model is specifically as follows:

[0018]

[0019] Where i is the building number. For generator set G in building i of building complex B t Operating costs for a given period of time Let G be the output power of generator unit G in building i of building complex B during time period t. , and Let G be the operating cost coefficient of generator unit G in building i within building complex B.

[0020] The energy storage model is specifically as follows:

[0021]

[0022] in, Let denot be the aging cost of the energy storage system ESS in building i of building complex B during time period t. This represents the degradation cost factor for an energy storage system (ESS). The charging efficiency of the energy storage system ESS Let be the charging power of the energy storage system ESS in building i of building group B during time period t. The discharge efficiency of the energy storage system (ESS) Let be the discharge power of the energy storage system ESS in building i of building group B during time period t. The state of charge of the energy storage system ESS in building i of building group B during time period t; Let ESS be the state of charge of the building energy storage system ESS in building i of building group B during time period t+1.

[0023] The specific new energy resource model is as follows:

[0024]

[0025] in, Let represent the cost of building i's renewable energy photovoltaic (RES) system during time period t in building group B.

[0026] The interruptible load model is specifically as follows:

[0027]

[0028] in, Let be the cost of user electricity satisfaction resulting from the interruptible load FL of building i in building group B during time period t. Let FL be the flexible load adjustment amount of interruptible load of building i in building group B during time period t. Let FL be the electricity satisfaction cost coefficient for the interruptible load FL of building i in building group B.

[0029] The operating cost function is specifically as follows:

[0030]

[0031] in, , For building-related users, the electricity price and volume sold to building agents during time period t. , For building-related users, the electricity price and volume purchased from the building agent during time period t. Let be the decision variable for the operating cost of building i in building cluster B during time period t. The electricity price charged by i-building associated users to building agents during time period t is The electricity purchase price that i-building-related users pay to building agents during time period t is And the decision variable for the operating cost of building i in building group B during time period t is: The operating cost of building i at that time.

[0032] Furthermore, the first output power constraint for each building generator set is specifically as follows:

[0033]

[0034] in, The length of the scheduling period. Let G be the lower limit of the power output of generator unit G in building i within building complex B. This represents the upper limit of the power output of generator set G in building i within building complex B.

[0035] The charging and discharging power constraints of the energy storage system are specifically as follows:

[0036]

[0037]

[0038] in, The length of the scheduling period. This represents the lower limit of the charging power of the energy storage system (ESS) in building i within building complex B. The upper limit of the charging power of the building energy storage system ESS in building i in building group B; This represents the lower limit of the discharge power of the energy storage system ESS in building i within building complex B. This represents the upper limit of the discharge power of the building energy storage system ESS in building group B.

[0039] The state-of-charge constraints of the energy storage system are as follows:

[0040]

[0041] in, The state-of-charge limit of the building energy storage system ESS in building i of building group B during time period t. Let be the upper limit of the state of charge of the building energy storage system ESS in building i in building group B during time period t.

[0042] The specific power output constraints of the aforementioned new energy photovoltaic system are as follows:

[0043]

[0044] in, To provide energy output for building-integrated photovoltaic (RES) systems in building cluster B during time period t. For building cluster B, i-building new energy photovoltaic RES in t Maximum output power during a given period.

[0045] The specific constraints on the flexible load adjustment amount are as follows:

[0046]

[0047] in, This represents the lower limit of the flexible load adjustment amount for the interruptible load FL of building i in building group B during time period t. This represents the upper limit of the flexible load adjustment of building i in building group B during time period t.

[0048] The first power balance constraint is specifically as follows:

[0049]

[0050] in, For the electricity sold by user associated with building i in building group B to the building agent during time period t. For the electricity purchased by user associated with building i in building group B from the building agent during time period t. This represents the original electricity demand of users associated with building i in building group B. To contribute to the building-integrated photovoltaic (RES) system in building complex B.

[0051] Furthermore, an economic optimization model for the construction agency is constructed based on the power resource data and the internal resource data, including:

[0052] The operating cost of a generator set owned by a construction agent over a period of time can be calculated using the following formula:

[0053]

[0054] in, The generator set G owned by the construction agency BA t Operating costs for a given period of time The generator set G owned by the construction agency BA t Total power generation during the period , and The power generation cost coefficient for generator set G owned by construction agent BA.

[0055] Calculate according to the following formula Total electricity purchased and sold by building-related users to building agents:

[0056]

[0057]

[0058] in, For i-building related users, the electricity purchased from the building agent during time period t. For i-building related users, the electricity sold to building agents during time period t. For construction agents to Total electricity sales to users associated with each building For construction agents to Total electricity purchased by users associated with each building.

[0059] An economic optimization model for construction agents is constructed based on the total power generation, total electricity purchase, total electricity sales, and the power resource data. Specifically:

[0060]

[0061] in, They are respectively t The electricity sales price and purchase price from building agents to building-related users during specific time periods. , They are respectively t The electricity sales price and purchase price from the grid by the building agent during the time period. , These represent the total electricity sold and purchased by construction agents to the power grid, respectively. Let be the revenue decision variables for construction agency BA at time t. Is iBuilding associated users in time period t? for Electricity sales volume is And the revenue decision variables for the construction agent BA in time period t are: The revenue of the construction agency BA.

[0062] Furthermore, the second power constraint on the generator set owned by the construction agent is specifically as follows:

[0063]

[0064] in, This represents the lower limit of the power output of generator set G owned by the construction agency BA. The maximum power rating of generator set G owned by the building agent BA.

[0065] The electricity price constraint is specifically as follows:

[0066]

[0067] The second power balance constraint is as follows:

[0068]

[0069] Furthermore, the master-slave game model is specifically as follows:

[0070]

[0071] In this group, BA represents the main construction agency, and B represents the main building complex. An economic optimization model for construction agency (BA). Let H be the operating cost function of building i in building group B, and let H be the total control duration.

[0072] Furthermore, solving the master-slave game model includes:

[0073] Step S1: Initialize the electricity sales and purchases by the building agent to the power grid over a period of time, the number of buildings, and the iteration count k; randomly generate the initial optimal fitness value. Several groups of building agents sell and purchase electricity to building-related users, and then form an initial population based on the initial data and randomly generated data;

[0074] Step S2: For each building, based on the electricity sales and purchase data of a group in the initial population, the internal resource model of the building is used to calculate and formulate a corresponding operation strategy with the goal of minimizing operating costs.

[0075] Step S3: Obtain an operating strategy population consisting of the operating strategies of several buildings, wherein the operating strategy population includes the electricity sold and purchased by each building-related user to the building agent for a period of time.

[0076] Step S4: Based on the electricity sold and purchased, solve the economic optimization model to obtain the revenue value of the construction agent for each building, and use the negative number of the revenue value of each building as several fitness values ​​of the heuristic algorithm.

[0077] Step S5: Control k = k+1 and update the initial population according to the heuristic algorithm;

[0078] Step S6: Extract the optimal fitness value based on the aforementioned fitness values, and then generate the optimal fitness function based on the optimal fitness value.

[0079] Step S7: Perform iterative calculation based on the optimal fitness function to obtain the optimal fitness value after iteration. Then, determine whether the current iteration result meets the convergence threshold based on the optimal fitness value after iteration, and at the same time determine whether the corresponding number of iterations exceeds the preset maximum number of iterations. If the convergence threshold is not met and the corresponding number of iterations exceeds the preset maximum number of iterations, proceed to step S2. If the convergence threshold is met and the corresponding number of iterations does not exceed the preset maximum number of iterations, proceed to step S8.

[0080] Step S8: Obtain the optimal fitness value when the convergence threshold is met and the corresponding number of iterations does not exceed the preset maximum number of iterations; extract the electricity volume selected for sale / purchase in the corresponding number of iterations based on the fitness value;

[0081] Step S9: Based on the purchased electricity volume, and under the constraints of the first output power of each building's generator set, the charging and discharging power of the energy storage system, the state of charge constraint of the energy storage system, the output power constraint of the new energy photovoltaic system, the flexible load adjustment constraint, the first power balance constraint, the second output power constraint of the generator set owned by the building agent, the electricity price constraint, and the second power balance constraint, calculate the output power of the building's generator set, the charging and discharging power of the energy storage system, the output power of the new energy photovoltaic system, and the flexible load adjustment amount.

[0082] Further, based on the optimal fitness value after the iteration, it is determined whether the current iteration result meets the convergence threshold, and simultaneously it is determined whether the corresponding iteration number exceeds the preset maximum iteration number, including:

[0083] Obtain the optimal fitness value for adjacent iterations and the preset convergence threshold.

[0084] If the difference in the optimal fitness values ​​between adjacent iterations is less than or equal to Then the optimal fitness value satisfies the convergence threshold.

[0085] If the difference in the optimal fitness values ​​between adjacent iterations is greater than If the optimal fitness value does not meet the convergence threshold, then the optimal fitness value does not meet the convergence threshold.

[0086] This invention also provides an energy control device for a building complex, comprising:

[0087] The system comprises a first data acquisition module, a second data acquisition module, a first construction module, a second construction module, a third construction module, a model solving module, and a scheduling module;

[0088] The first data acquisition module is used to acquire the internal resource data of the power system of each building in the building complex. The internal resource data includes: the output data of generator sets, the charging and discharging data of the energy storage system, the output data of new energy photovoltaic, the flexible load adjustment data, the original electricity demand data, the electricity sold by building-related users to building agents, the electricity sold by building-related users to building agents, the electricity purchased by building-related users from building agents, and the electricity purchased by building-related users from building agents.

[0089] The first construction module is used to construct the operating cost function of each building based on the internal resource data, and to construct the first output power constraint of the generator set of each building, the charging and discharging power constraint of the energy storage system, the state of charge constraint of the energy storage system, the output power constraint of the new energy photovoltaic, the flexible load adjustment constraint, and the first power balance constraint.

[0090] The second data acquisition module is used to acquire power resource data of the power system corresponding to the construction agent. The power resource data includes: the output data of the generator sets owned by the construction agent, the amount of electricity sold by the construction agent to the power grid, the electricity price sold by the construction agent to the power grid, the amount of electricity purchased by the construction agent from the power grid, and the electricity price purchased by the construction agent from the power grid.

[0091] The second construction module is used to construct an economic optimization model for the construction agent based on the power resource data and the internal resource data, and to construct a second output power constraint, electricity price constraint and second power balance constraint for the generator sets owned by the construction agent.

[0092] The third construction module is used to construct a master-slave game model with construction agents and building groups as the main players, based on the operating cost function and the economic optimization model.

[0093] The model solving module is used to solve the master-slave game model under the constraints of the first output power of each building's generator set, the charging and discharging power of the energy storage system, the state of charge constraint of the energy storage system, the output power constraint of the new energy photovoltaic system, the flexible load adjustment constraint, the first power balance constraint, the second output power constraint of the generator set owned by the building agent, the electricity price constraint, and the second power balance constraint, to generate the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of the new energy photovoltaic system, and the flexible load adjustment amount when the building agent's profit is maximized.

[0094] The scheduling module is used to regulate the energy of the building complex based on the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of new energy photovoltaics, and the amount of flexible load adjustment.

[0095] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0096] In this invention, a building operation cost function and an economic optimization model for building agents are first constructed. Then, a master-slave game model is constructed based on the above models. The building operation cost function considers various internal resources of the building, such as generator sets, energy storage systems, and new energy photovoltaics. The economic optimization model for building agents considers various basic data such as the generator sets owned by the agents and the amount of electricity sold and purchased. By constructing game relationships in the above models, a master-slave game model with building agents and buildings as the main players is obtained. Therefore, the model includes the interaction relationship between building-related users and building agents. Furthermore, the solution process of the model reflects the negotiation process between building-related users and building agents. The power system regulation is carried out through the solution value, making the regulation more precise. Attached Figure Description

[0097] Figure 1 A flowchart illustrating the steps of an energy regulation method for a building complex, as provided in an embodiment of the present invention;

[0098] Figure 2 A schematic diagram of the structure of an energy control device for a building complex provided in an embodiment of the present invention; Detailed Implementation

[0099] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0100] Please refer to Figure 1 According to one embodiment of the present invention, an energy regulation method for a building complex is provided, comprising:

[0101] Step S11: Obtain the internal resource data of the power system of each building in the building complex. The internal resource data includes: the output data of generator sets, the charging and discharging data of the energy storage system, the output data of new energy photovoltaic, the flexible load adjustment data, the original electricity demand data, the electricity sold by building-related users to building agents, the electricity sold by building-related users to building agents, the electricity purchased by building-related users from building agents, and the electricity purchased by building-related users from building agents.

[0102] In a preferred embodiment, the output data of the generator set includes the output power of the generator set, the charging and discharging data of the energy storage system includes the charging power, charging efficiency, discharging power and discharging efficiency of the energy storage system, and the output data of the new energy photovoltaic system includes the output power and output capacity of the new energy photovoltaic system.

[0103] Step S12: Construct the operating cost function for each building based on the internal resource data, and construct the first output power constraint of the generator set, the charging and discharging power constraint of the energy storage system, the state of charge constraint of the energy storage system, the output power constraint of the new energy photovoltaic, the flexible load adjustment constraint, and the first power balance constraint for each building.

[0104] The first step is to construct an operating cost function. Based on the internal resource data, an internal resource model for each building for a given time period is constructed. The internal resource model includes a distributed unit model, an energy storage model, a new energy resource model, and an interruptible load model.

[0105] Preferably, the distributed unit model is constructed according to the following formula:

[0106]

[0107] Where i is the building number. For generator set G in building i of building complex B t Operating costs for a given period of time Let G be the output power of generator unit G in building i of building complex B during time period t. , and Let G be the operating cost coefficient of generator unit G in building i within building complex B.

[0108] Preferably, the energy storage model is constructed according to the following formula:

[0109]

[0110] in, Let denot be the aging cost of the energy storage system ESS in building i of building complex B during time period t. This represents the degradation cost factor for an energy storage system (ESS). The charging efficiency of the energy storage system ESS Let be the charging power of the energy storage system ESS in building i of building group B during time period t. The discharge efficiency of the energy storage system (ESS) Let be the discharge power of the energy storage system ESS in building i of building group B during time period t. The state of charge of the energy storage system ESS in building i of building group B during time period t; Let ESS be the state of charge of the building energy storage system ESS in building i of building group B during time period t+1.

[0111] Preferably, the new energy resource model is constructed according to the following formula:

[0112]

[0113] in, Let represent the cost of building i's renewable energy photovoltaic (RES) system during time period t in building group B.

[0114] Preferably, the interruptible load model is constructed according to the following formula:

[0115]

[0116] in, Let be the cost of user electricity satisfaction resulting from the interruptible load FL of building i in building group B during time period t. Let FL be the flexible load adjustment amount of interruptible load of building i in building group B during time period t. Let FL be the electricity satisfaction cost coefficient for the interruptible load FL of building i in building group B.

[0117] Preferably, the following steps are taken: First, the operating cost function of the generator set in a given time period is constructed based on the distributed generator set model; second, the aging cost function of the energy storage system in a given time period is constructed based on the energy storage model; third, the output function of the new energy photovoltaic system in a given time period is constructed based on the new energy resource model; and fourth, the electricity satisfaction cost function brought about by the interruptible load in a given time period is constructed based on the interruptible load model. Finally, the following steps are taken: the operating cost function of the generator set in a given time period for each building; the aging cost function of the energy storage system in a given time period; the output function of the new energy photovoltaic system in a given time period; the electricity satisfaction cost function brought about by the interruptible load model in a given time period; the original electricity demand data; the electricity sold by building-related users to building agents; the electricity price sold by building-related users to building agents; the electricity purchased by building-related users from building agents; and the electricity purchase price from building-related users to building agents.

[0118] Preferably, the operating cost function is constructed according to the following formula:

[0119]

[0120] in, , For building-related users, the electricity price and volume sold to building agents during time period t. , For building-related users, the electricity price and volume purchased from the building agent during time period t. Let be the decision variable for the operating cost of building i in building cluster B during time period t. The electricity price charged by i-building associated users to building agents during time period t is The electricity purchase price that i-building-related users pay to building agents during time period t is And the decision variable for the operating cost of building i in building group B during time period t is: The operating cost of building i at that time.

[0121] Preferably, the first output power constraint of each building generator set is specifically as follows:

[0122]

[0123] in, The length of the scheduling period. Let G be the lower limit of the power output of generator unit G in building i within building complex B. This represents the upper limit of the power output of generator set G in building i within building complex B.

[0124] Preferably, the charging and discharging power constraint of the energy storage system is specifically as follows:

[0125]

[0126]

[0127] in, The length of the scheduling period. This represents the lower limit of the charging power of the energy storage system (ESS) in building i within building complex B. The upper limit of the charging power of the building energy storage system ESS in building i in building group B; This represents the lower limit of the discharge power of the energy storage system ESS in building i within building complex B. This represents the upper limit of the discharge power of the building energy storage system ESS in building group B.

[0128] Preferably, the state of charge constraint of the energy storage system is as follows:

[0129]

[0130] in, The state-of-charge limit of the building energy storage system ESS in building i of building group B during time period t. Let be the upper limit of the state of charge of the building energy storage system ESS in building i in building group B during time period t.

[0131] Preferably, the power output constraint of the new energy photovoltaic system is as follows:

[0132]

[0133] in, To provide energy output for building-integrated photovoltaic (RES) systems in building cluster B during time period t. For building cluster B, i-building new energy photovoltaic RES in t Maximum output power during a given period.

[0134] Preferably, the flexible load adjustment constraint is specifically:

[0135]

[0136] in, This represents the lower limit of the flexible load adjustment amount for the interruptible load FL of building i in building group B during time period t. This represents the upper limit of the flexible load adjustment of building i in building group B during time period t.

[0137] Preferably, the first power balance constraint is specifically:

[0138]

[0139] in, For the electricity sold by user associated with building i in building group B to the building agent during time period t. For the electricity purchased by user associated with building i in building group B from the building agent during time period t. This represents the original electricity demand of users associated with building i in building group B. To contribute to the building-integrated photovoltaic (RES) system in building complex B.

[0140] Step S13: Obtain the power resource data of the power system corresponding to the construction agent. The power resource data includes: the output data of the generator sets owned by the construction agent, the amount of electricity sold by the construction agent to the power grid, the electricity price sold by the construction agent to the power grid, the amount of electricity purchased by the construction agent from the power grid, and the electricity price purchased by the construction agent from the power grid.

[0141] In a preferred embodiment, the output data of the generator set owned by the aforementioned construction agent includes the generator set's output power and output strength.

[0142] Step S14: Construct an economic optimization model for the construction agent based on the power resource data and the internal resource data, and construct the second output power constraint, electricity price constraint and second power balance constraint for the generator sets owned by the construction agent;

[0143] Preferably, an economic optimization model for the construction agent is constructed based on the power resource data and the internal resource data, including:

[0144] The operating cost of a generator set owned by a construction agent over a period of time can be calculated using the following formula:

[0145]

[0146] in, The generator set G owned by the construction agency BA t Operating costs for a given period of time The generator set G owned by the construction agency BA t Total power generation during the period , and The power generation cost coefficient for generator set G owned by construction agent BA.

[0147] Calculate according to the following formula Total electricity purchased and sold by building-related users to building agents:

[0148]

[0149]

[0150] in, For i-building related users, the electricity purchased from the building agent during time period t. For i-building related users, the electricity sold to building agents during time period t. For construction agents to Total electricity sales to users associated with each building For construction agents to Total electricity purchased by users associated with each building.

[0151] An economic optimization model for construction agents is constructed based on the total power generation, total electricity purchase, total electricity sales, and the power resource data. Specifically:

[0152]

[0153] in, They are respectively t The electricity sales price and purchase price from building agents to building-related users during specific time periods. , They are respectively t The electricity sales price and purchase price from the grid by the building agent during the time period. , These represent the total electricity sold and purchased by construction agents to the power grid, respectively. Let be the revenue decision variables for construction agency BA at time t. Is iBuilding associated users in time period t? for Electricity sales volume is And the revenue decision variables for the construction agent BA in time period t are: The revenue of the construction agency BA.

[0154] Preferably, the second power constraint of the generator set owned by the construction agent is specifically as follows:

[0155]

[0156] in, This represents the lower limit of the power output of generator set G owned by the construction agency BA. The maximum power rating of generator set G owned by the building agent BA.

[0157] The electricity price constraint is specifically as follows:

[0158]

[0159] The second power balance constraint is as follows:

[0160]

[0161] Step S15: Based on the operating cost function and the economic optimization model, construct a master-slave game model with construction agents and building groups as the main players;

[0162] Preferably, the master-slave game model is as follows:

[0163]

[0164] In this group, BA represents the main construction agency, and B represents the main building complex. An economic optimization model for construction agency (BA). H represents the operation of building i in building group B, and H represents the total control duration.

[0165] In a preferred embodiment, the game has the following properties: (1) the strategy sets of the construction agent and the construction are both compact subsets of the entire game space; (2) the payoff functions of the construction agent and the construction are... For each set of strategies (3) The payoff function of lower-level followers For information about its strategy (4) The revenue function of low-carbon building complex agents in any quasi-convex function; The following are all related strategies. The convex function has a unique optimal solution; therefore, the game has a unique Nash equilibrium solution.

[0166] Step S16: Under the constraints of the first output power of each building's generator set, the charging and discharging power of the energy storage system, the state of charge of the energy storage system, the output power of the new energy photovoltaic system, the flexible load adjustment amount, the first power balance constraint, the second output power constraint of the generator set owned by the building agent, the electricity price constraint, and the second power balance constraint, solve the master-slave game model to generate the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of the new energy photovoltaic system, and the flexible load adjustment amount when the building agent's profit is maximized.

[0167] Preferably, solving the master-slave game model includes:

[0168] Step S1: Initialize the electricity sales and purchases by the building agent to the power grid over a period of time, the number of buildings, and the iteration count k; randomly generate the initial optimal fitness value. Several groups of building agents sell and purchase electricity to building-related users, and then form an initial population based on the initial data and randomly generated data;

[0169] Step S2: For each building, based on the electricity sales and purchase data of a group in the initial population, the internal resource model of the building is used to calculate and formulate a corresponding operation strategy with the goal of minimizing operating costs.

[0170] Step S3: Obtain an operating strategy population consisting of the operating strategies of several buildings, wherein the operating strategy population includes the electricity sold and purchased by each building-related user to the building agent for a period of time.

[0171] Step S4: Based on the electricity sold and purchased, solve the economic optimization model to obtain the revenue value of the construction agent for each building, and use the negative number of the revenue value of each building as several fitness values ​​of the heuristic algorithm.

[0172] Step S5: Control k = k+1 and update the initial population according to the heuristic algorithm;

[0173] Step S6: Extract the optimal fitness value based on the aforementioned fitness values, and then generate the optimal fitness function based on the optimal fitness value.

[0174] Step S7: Perform iterative calculation based on the optimal fitness function to obtain the optimal fitness value after iteration. Then, determine whether the current iteration result meets the convergence threshold based on the optimal fitness value after iteration, and at the same time determine whether the corresponding number of iterations exceeds the preset maximum number of iterations. If the convergence threshold is not met and the corresponding number of iterations exceeds the preset maximum number of iterations, proceed to step S2. If the convergence threshold is met and the corresponding number of iterations does not exceed the preset maximum number of iterations, proceed to step S8.

[0175] Step S8: Obtain the optimal fitness value when the convergence threshold is met and the corresponding number of iterations does not exceed the preset maximum number of iterations; extract the electricity volume selected for sale / purchase in the corresponding number of iterations based on the fitness value;

[0176] Step S9: Based on the purchased electricity volume, and under the constraints of the first output power of each building's generator set, the charging and discharging power of the energy storage system, the state of charge constraint of the energy storage system, the output power constraint of the new energy photovoltaic system, the flexible load adjustment constraint, the first power balance constraint, the second output power constraint of the generator set owned by the building agent, the electricity price constraint, and the second power balance constraint, calculate the output power of the building's generator set, the charging and discharging power of the energy storage system, the output power of the new energy photovoltaic system, and the flexible load adjustment amount.

[0177] Preferably, determining whether the current iteration result meets the convergence threshold based on the optimal fitness value after iteration, and simultaneously determining whether the corresponding iteration number exceeds the preset maximum iteration number, includes:

[0178] Obtain the optimal fitness value for adjacent iterations and the preset convergence threshold.

[0179] If the difference in the optimal fitness values ​​between adjacent iterations is less than or equal to Then the optimal fitness value satisfies the convergence threshold.

[0180] If the difference in the optimal fitness values ​​between adjacent iterations is greater than If the optimal fitness value does not meet the convergence threshold, then the optimal fitness value does not meet the convergence threshold.

[0181] Step S17: Perform energy regulation on the building complex based on the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of new energy photovoltaics, and the flexible load adjustment amount.

[0182] In a preferred embodiment, after calculating the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of the new energy photovoltaic system, and the adjustment amount of the flexible load, the main controller adjusts the generator set, energy storage system, new energy photovoltaic system, and flexible load adjustment amount to make them correspond to the solution results.

[0183] Based on the method embodiments of the present invention, corresponding apparatus embodiments are provided:

[0184] Please refer to Figure 2 Another embodiment of the present invention provides an energy control device for a building complex, comprising: a first data acquisition module, a second data acquisition module, a first construction module, a second construction module, a third construction module, a model solving module, and a scheduling module;

[0185] The first data acquisition module is used to acquire the internal resource data of the power system of each building in the building complex. The internal resource data includes: the output data of generator sets, the charging and discharging data of the energy storage system, the output data of new energy photovoltaic, the flexible load adjustment data, the original electricity demand data, the electricity sold by building-related users to building agents, the electricity sold by building-related users to building agents, the electricity purchased by building-related users from building agents, and the electricity purchased by building-related users from building agents.

[0186] The first construction module is used to construct the operating cost function of each building based on the internal resource data, and to construct the first output power constraint of the generator set of each building, the charging and discharging power constraint of the energy storage system, the state of charge constraint of the energy storage system, the output power constraint of the new energy photovoltaic, the flexible load adjustment constraint, and the first power balance constraint.

[0187] The second data acquisition module is used to acquire power resource data of the power system corresponding to the construction agent. The power resource data includes: the output data of the generator sets owned by the construction agent, the amount of electricity sold by the construction agent to the power grid, the electricity price sold by the construction agent to the power grid, the amount of electricity purchased by the construction agent from the power grid, and the electricity price purchased by the construction agent from the power grid.

[0188] The second construction module is used to construct an economic optimization model for the construction agent based on the power resource data and the internal resource data, and to construct a second output power constraint, electricity price constraint and second power balance constraint for the generator sets owned by the construction agent.

[0189] The third construction module is used to construct a master-slave game model with construction agents and building groups as the main players, based on the operating cost function and the economic optimization model.

[0190] The model solving module is used to solve the master-slave game model under the constraints of the first output power of each building's generator set, the charging and discharging power of the energy storage system, the state of charge constraint of the energy storage system, the output power constraint of the new energy photovoltaic system, the flexible load adjustment constraint, the first power balance constraint, the second output power constraint of the generator set owned by the building agent, the electricity price constraint, and the second power balance constraint, to generate the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of the new energy photovoltaic system, and the flexible load adjustment amount when the building agent's profit is maximized.

[0191] The scheduling module is used to regulate the energy of the building complex based on the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of new energy photovoltaics, and the amount of flexible load adjustment.

[0192] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0193] Those skilled in the art will clearly understand that, for convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0194] The embodiments of the present invention have the following beneficial effects:

[0195] In this invention, a building operation cost function and an economic optimization model for building agents are first constructed. Then, a master-slave game model is built using these models. The building operation cost function considers various internal resources such as generator sets, energy storage systems, and new energy photovoltaics. The economic optimization model for building agents considers basic data such as the generator sets owned by the agents and the amount of electricity sold and purchased. By constructing game relationships within these models, including using the strategy sets of building agents and buildings as compact subsets of the model's game space, a master-slave game model with building agents and buildings as the main players is obtained. Therefore, the model includes the interaction between building-related users and building agents. Furthermore, the solution process reflects the negotiation process between building-related users and building agents. Power system regulation is then performed using the solved values, making the regulation more precise.

[0196] The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for energy regulation of a building complex, characterized in that, include: Acquire internal resource data of the power system of each building in the building complex. The internal resource data includes: power output data of generator sets, charging and discharging data of energy storage systems, power output data of new energy photovoltaics, flexible load adjustment data, original electricity demand data, electricity sales from building-related users to building agents, electricity sales prices from building-related users to building agents, electricity purchases from building-related users to building agents, and electricity purchase prices from building-related users to building agents. Based on the internal resource data, an operating cost function for each building is constructed, and the first output power constraint, the charging and discharging power constraint, the state of charge constraint, the output power constraint, the flexible load adjustment constraint, and the first power balance constraint for each building's generator set are also constructed. Obtain power resource data of the power system corresponding to the construction agent. The power resource data includes: the output data of the generator sets owned by the construction agent, the amount of electricity sold by the construction agent to the power grid, the electricity price sold by the construction agent to the power grid, the amount of electricity purchased by the construction agent from the power grid, and the electricity price purchased by the construction agent from the power grid. Based on the power resource data and the internal resource data, an economic optimization model for the construction agent is constructed, and a second output power constraint, an electricity price constraint, and a second power balance constraint are constructed for the generator sets owned by the construction agent. Based on the operating cost function and the economic optimization model, a master-slave game model is constructed with construction agents and building groups as the main players. Under the constraints of the first output power of each building's generator set, the charging and discharging power of the energy storage system, the state of charge of the energy storage system, the output power of the new energy photovoltaic system, the flexible load adjustment amount, the first power balance constraint, the second output power constraint of the generator set owned by the building agent, the electricity price constraint, and the second power balance constraint, the master-slave game model is solved to generate the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of the new energy photovoltaic system, and the flexible load adjustment amount when the building agent's profit is maximized. Energy regulation of the building complex is carried out based on the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of new energy photovoltaics, and the adjustment amount of flexible load. Specifically, the master-slave game model is as follows: In this group, BA represents the main construction agency, and B represents the main building complex. An economic optimization model for construction agency (BA). Let H be the operating cost function of building i in building group B, and H be the total control duration. Solving the master-slave game model includes: Step S1: Initialize the electricity sales and purchases by the building agent to the power grid over a period of time, the number of buildings, and the iteration count k; randomly generate the initial optimal fitness value. Several groups of building agents sell and purchase electricity to building-related users, and then form an initial population based on the initial data and randomly generated data; Step S2: For each building, based on the electricity sales and purchase data of a group in the initial population, the internal resource model of the building is used to calculate and formulate a corresponding operation strategy with the goal of minimizing operating costs. Step S3: Obtain an operating strategy population consisting of the operating strategies of several buildings, wherein the operating strategy population includes the electricity sold and purchased by each building-related user to the building agent for a period of time. Step S4: Based on the electricity sold and purchased, solve the economic optimization model to obtain the revenue value of the construction agent for each building, and use the negative number of the revenue value of each building as several fitness values ​​of the heuristic algorithm. Step S5: Control k = k+1 and update the initial population according to the heuristic algorithm; Step S6: Extract the optimal fitness value based on the aforementioned fitness values, and then generate the optimal fitness function based on the optimal fitness value. Step S7: Perform iterative calculation based on the optimal fitness function to obtain the optimal fitness value after iteration. Then, determine whether the current iteration result meets the convergence threshold based on the optimal fitness value after iteration, and at the same time determine whether the corresponding number of iterations exceeds the preset maximum number of iterations. If the convergence threshold is not met and the corresponding number of iterations exceeds the preset maximum number of iterations, proceed to step S2. If the convergence threshold is met and the corresponding number of iterations does not exceed the preset maximum number of iterations, proceed to step S8. Step S8: Obtain the optimal fitness value when the convergence threshold is met and the corresponding number of iterations does not exceed the preset maximum number of iterations; extract the electricity volume selected for sale / purchase in the corresponding number of iterations based on the fitness value; Step S9: Based on the purchased electricity volume, and under the constraints of the first output power of each building's generator set, the charging and discharging power of the energy storage system, the state of charge constraint of the energy storage system, the output power constraint of the new energy photovoltaic system, the flexible load adjustment constraint, the first power balance constraint, the second output power constraint of the generator set owned by the building agent, the electricity price constraint, and the second power balance constraint, calculate the output power of the building's generator set, the charging and discharging power of the energy storage system, the output power of the new energy photovoltaic system, and the flexible load adjustment amount.

2. The energy regulation method for a building complex as described in claim 1, characterized in that, Constructing an operating cost function for each building based on the internal resource data includes: An internal resource model for each building for a given time period is constructed based on the internal resource data. The internal resource model includes a distributed unit model, an energy storage model, a new energy resource model, and an interruptible load model. Based on the distributed generator unit model, construct the operating cost function of the generator unit in a time period; based on the energy storage model, construct the aging cost function of the energy storage system in a time period; based on the new energy resource model, construct the output power function of the new energy photovoltaic in a time period; and based on the interruptible load model, construct the electricity satisfaction cost function brought by the interruptible load in a time period. The operating cost function for each building during a given time period is constructed based on the operating cost function of each building's generator unit during a given time period, the aging cost function of the energy storage system during a given time period, the output function of the new energy photovoltaic system during a given time period, the electricity satisfaction cost function brought about by the interruptible load model during a given time period, the original electricity demand data, the electricity sold by building-related users to building agents, the electricity sold by building-related users to building agents, the electricity purchased by building-related users from building agents, and the electricity purchased by building-related users from building agents.

3. The energy regulation method for a building complex as described in claim 2, characterized in that, The distributed unit model is specifically as follows: Where i is the building number. For generator set G in building i of building complex B t Operating costs for a given period of time Let G be the output power of generator unit G in building i of building complex B during time period t. , and Let G be the operating cost coefficient of generator unit G in building i within building complex B. The energy storage model is specifically as follows: in, Let denot be the aging cost of the energy storage system ESS in building i of building complex B during time period t. This represents the degradation cost factor for an energy storage system (ESS). The charging efficiency of the energy storage system ESS Let be the charging power of the energy storage system ESS in building i of building group B during time period t. The discharge efficiency of the energy storage system (ESS) Let be the discharge power of the energy storage system ESS in building i of building group B during time period t. The state of charge of the energy storage system ESS in building i of building group B during time period t; The state of charge of the energy storage system ESS in building i of building group B at time t+1; The specific new energy resource model is as follows: in, The cost of renewable energy photovoltaic (RES) for building i in building group B during time period t; The interruptible load model is specifically as follows: in, Let be the cost of user electricity satisfaction resulting from the interruptible load FL of building i in building group B during time period t. Let FL be the flexible load adjustment amount of interruptible load of building i in building group B during time period t. The electricity satisfaction cost coefficient for the interruptible load FL of building i in building group B; The operating cost function is specifically as follows: in, , For building-related users, the electricity price and volume sold to building agents during time period t. , For building-related users, the electricity price and volume purchased from the building agent during time period t. Let be the decision variable for the operating cost of building i in building cluster B during time period t. The electricity price charged by i-building associated users to building agents during time period t is The electricity purchase price that i-building-related users pay to building agents during time period t is And the decision variable for the operating cost of building i in building group B during time period t is: The operating cost of building i at that time.

4. The energy regulation method for a building complex as described in claim 3, characterized in that, The first output power constraint for each building generator set is specifically as follows: in, The length of the scheduling period. Let G be the lower limit of the power output of generator unit G in building i within building complex B. The upper limit of the power of generator set G in building i within building group B; The charging and discharging power constraints of the energy storage system are specifically as follows: in, The length of the scheduling period. This represents the lower limit of the charging power of the energy storage system (ESS) in building i within building complex B. The upper limit of the charging power of the building energy storage system ESS in building i in building group B; This represents the lower limit of the discharge power of the energy storage system ESS in building i within building complex B. The upper limit of the discharge power of the building energy storage system ESS in building i in building group B; The state-of-charge constraints of the energy storage system are as follows: in, The state-of-charge limit of the building energy storage system ESS in building i of building group B during time period t. The upper limit of the state of charge of the energy storage system ESS in building i in building group B during time period t; The specific power output constraints of the aforementioned new energy photovoltaic system are as follows: in, To provide energy output for building-integrated photovoltaic (RES) systems in building cluster B during time period t. For building cluster B, i-building renewable energy photovoltaic RES in t Maximum output during the period; The specific constraints on the flexible load adjustment amount are as follows: in, This represents the lower limit of the flexible load adjustment amount for the interruptible load FL of building i in building group B during time period t. The upper limit of the flexible load adjustment of building i in building group B during time period t; The first power balance constraint is specifically as follows: in, For the electricity sold by user associated with building i in building group B to the building agent during time period t. For the electricity purchased by user associated with building i in building group B from the building agent during time period t. This represents the original electricity demand of users associated with building i in building group B. To contribute to the building-integrated photovoltaic (RES) system in building complex B.

5. The energy regulation method for a building complex as described in claim 4, characterized in that, Based on the power resource data and the internal resource data, an economic optimization model for the construction agency is constructed, including: The operating cost of a generator set owned by a construction agent over a period of time can be calculated using the following formula: in, The generator set G owned by the construction agency BA t Operating costs for a given period of time The generator set G owned by the construction agency BA t Total power generation during the period , and The power generation cost coefficient for generator set G owned by construction agent BA; Calculate according to the following formula Total electricity purchased and sold by building-related users to building agents: in, For i-building related users, the electricity purchased from the building agent during time period t. For i-building related users, the electricity sold to building agents during time period t. For construction agents to Total electricity sales to users associated with each building For construction agents to Total electricity purchased by users associated with each building; An economic optimization model for construction agents is constructed based on the total power generation, total electricity purchase, total electricity sales, and the power resource data. Specifically: in, They are respectively t The electricity sales price and purchase price from building agents to building-related users during specific time periods. , They are respectively t The electricity sales price and purchase price from the grid by the building agent during the time period. , These represent the total electricity sold and purchased by construction agents to the power grid, respectively. Let be the revenue decision variables for construction agency BA at time t. Is iBuilding associated users in time period t? for Electricity sales volume is And the revenue decision variables for the construction agent BA in time period t are: The revenue of the construction agency BA.

6. The energy regulation method for a building complex as described in claim 5, characterized in that, The second power constraint on the generator sets owned by the construction agent is as follows: The electricity price constraint is specifically as follows: The second power balance constraint is as follows: in, This represents the lower limit of the power output of generator set G owned by the construction agency BA. The maximum power rating of generator set G owned by the building agent BA.

7. The energy regulation method for a building complex as described in claim 1, characterized in that, Based on the optimal fitness value after the iteration, determine whether the current iteration result meets the convergence threshold, and simultaneously determine whether the corresponding iteration number exceeds the preset maximum iteration number, including: Obtain the optimal fitness value for adjacent iterations and the preset convergence threshold. If the difference in the optimal fitness values ​​between adjacent iterations is less than or equal to Then the optimal fitness value satisfies the convergence threshold. If the difference in the optimal fitness values ​​between adjacent iterations is greater than If the optimal fitness value does not meet the convergence threshold, then the optimal fitness value does not meet the convergence threshold.

8. An energy control device for a building complex, characterized in that, include: The system comprises a first data acquisition module, a second data acquisition module, a first construction module, a second construction module, a third construction module, a model solving module, and a scheduling module; The first data acquisition module is used to acquire the internal resource data of the power system of each building in the building complex. The internal resource data includes: the output data of generator sets, the charging and discharging data of the energy storage system, the output data of new energy photovoltaic, the flexible load adjustment data, the original electricity demand data, the electricity sold by building-related users to building agents, the electricity sold by building-related users to building agents, the electricity purchased by building-related users from building agents, and the electricity purchased by building-related users from building agents. The first construction module is used to construct the operating cost function of each building based on the internal resource data, and to construct the first output power constraint of the generator set of each building, the charging and discharging power constraint of the energy storage system, the state of charge constraint of the energy storage system, the output power constraint of the new energy photovoltaic, the flexible load adjustment constraint, and the first power balance constraint. The second data acquisition module is used to acquire power resource data of the power system corresponding to the construction agent. The power resource data includes: the output data of the generator sets owned by the construction agent, the amount of electricity sold by the construction agent to the power grid, the electricity price sold by the construction agent to the power grid, the amount of electricity purchased by the construction agent from the power grid, and the electricity price purchased by the construction agent from the power grid. The second construction module is used to construct an economic optimization model for the construction agent based on the power resource data and the internal resource data, and to construct the second output power constraint, electricity price constraint and second power balance constraint of the generator sets owned by the construction agent; The third construction module is used to construct a master-slave game model with construction agents and building groups as the main players, based on the operating cost function and the economic optimization model; the master-slave game model is specifically as follows: In this group, BA represents the main construction agency, and B represents the main building complex. An economic optimization model for construction agency (BA). Let H be the operating cost function of building i in building group B, and H be the total control duration. The model solving module is used to solve the master-slave game model under the constraints of the first output power of each building's generator set, the charging and discharging power of the energy storage system, the state of charge constraint of the energy storage system, the output power constraint of the new energy photovoltaic system, the flexible load adjustment constraint, the first power balance constraint, the second output power constraint of the generator sets owned by the building agent, the electricity price constraint, and the second power balance constraint, to generate the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of the new energy photovoltaic system, and the flexible load adjustment when the building agent's profit is maximized; the solution of the master-slave game model includes: Step S1: Initialize the electricity sales and purchases of building agents to the grid for a period of time, the number of buildings, and the iteration number k. Randomly generate several sets of initial optimal fitness values ​​for the electricity sales and purchases of building agents to users associated with buildings. Then, construct an initial population based on the initialized data and the randomly generated data. Step S2: For each building, calculate the corresponding operating strategy based on the electricity sales and purchases data of one set in the initial population using the building's internal resource model, with the goal of minimizing operating costs. Step S3: Obtain an operating strategy population composed of the operating strategies of several buildings. The operating strategy population includes the electricity sales and purchases of each building's associated users to building agents for a period of time. Step S4: Based on the electricity sales and purchases, solve the economic optimization model to obtain the revenue value of the building agent for each building. Use the negative of the revenue value of each building as several fitness values ​​for the heuristic algorithm. Step S5: Control k = k+1, update the initial population according to the heuristic algorithm; Step S6: Extract the optimal fitness value based on the several fitness values, and then generate the optimal fitness function based on the optimal fitness value; Step S7: Perform iterative calculation based on the optimal fitness function to obtain the optimal fitness value after iteration, and then determine whether the current iteration result meets the convergence threshold based on the optimal fitness value after iteration, and at the same time determine whether the corresponding iteration number exceeds the preset maximum iteration number. If the convergence threshold is not met and the corresponding iteration number exceeds the preset maximum iteration number, then go to step S2; if the convergence threshold is met and the corresponding iteration number does not exceed the preset maximum iteration number, then go to step S8; Step S8: Obtain the optimal fitness value when the convergence threshold is met and the corresponding iteration number does not exceed the preset maximum iteration number, and extract the electricity volume selected in the corresponding iteration number based on the fitness value;Step S9: Based on the purchased electricity volume, and under the constraints of the first output power of each building's generator set, the charging and discharging power of the energy storage system, the state of charge constraint of the energy storage system, the output power constraint of the new energy photovoltaic system, the flexible load adjustment constraint, the first power balance constraint, the second output power constraint of the generator sets owned by the building agent, the electricity price constraint, and the second power balance constraint, calculate the output power of the building's generator sets, the charging and discharging power of the energy storage system, the output power of the new energy photovoltaic system, and the flexible load adjustment amount; The scheduling module is used to regulate the energy of the building complex based on the output power of each building's generator set, the charging and discharging power of the energy storage system, the output power of new energy photovoltaics, and the amount of flexible load adjustment.