Point-to-point energy transaction method and system based on virtual community and distributed power generation
By establishing models of buildings, virtual communities and distribution system operators, conducting point-to-point energy transactions and optimizing energy flow, the scheduling problem of distributed power generation in smart grids is solved, efficient utilization of renewable energy and network stability are achieved, and transaction costs are reduced.
Patent Information
- Application Number
- CN202411842680.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-07-08
AI Technical Summary
How to realize the dispatching model of distributed power generation under the framework of smart grids to promote the reform of the power system and the scientific development of renewable energy, especially under the requirement that distributed power generation is preferred to optimize the output of thermal power units and reduce carbon emissions.
By establishing models of buildings, virtual communities and distribution system operators, conducting point-to-point energy transactions, optimizing energy flow, and using decentralized optimization algorithms and alternating direction multiplier algorithms to optimize transactions to ensure efficient energy utilization and network stability.
It realizes the maximum utilization of renewable energy, reduces energy transaction costs, improves the flexibility and scalability of the system, ensures the stability of the distribution network, and provides privacy protection and a reliable transaction mechanism.
Smart Images

Figure CN120278814A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart grids, and specifically to a peer-to-peer energy trading method and system based on virtual communities and distributed generation. Background Art
[0002] With the transformation of the energy system, peer-to-peer (P2P) energy trading has gradually become an important way to achieve decentralized energy management. Through advanced information and communication technologies, the P2P energy trading model allows users to directly conduct energy transactions with each other, no longer relying on the traditional centralized power trading market. This model not only improves the energy utilization efficiency but also promotes the wide application of distributed generation (DG), providing a more flexible scheduling means for the power system. At the same time, the wide deployment of distributed generation (such as wind energy, solar energy, etc.) and virtual communities (VC) provides technical support for the optimal management of distributed resources. VC connects buildings or energy users through a peer-to-peer (P2P) energy trading mechanism, and each node in the virtual community can achieve local energy optimization by sharing energy resources (such as wind power, energy storage, power load management, etc.). Such virtual communities usually work together in local power markets, reducing dependence on the external power grid and enhancing energy utilization efficiency.
[0003] On the other hand, carbon emission constraints and the requirements for the consumption of renewable energy globally have made the scheduling optimization of the power system more complex. Therefore, when formulating a scheduling plan, the power grid company needs to consider the characteristics of peer-to-peer (P2P) energy trading and virtual communities (VC) and reasonably allocate the output plans of different power generation resources. Especially under the requirement of giving priority to the grid connection of distributed generation, the power grid company needs to optimize the output of thermal power units within the framework of VC so that it can coordinate the unstable renewable energy generation such as distributed wind power and solar energy, and minimize the use of thermal power to reduce carbon emissions on the premise of meeting the renewable energy quota. Implementing a scheduling mode for distributed generation within the framework of the smart grid through VC and P2P trading mechanisms will become a key way for the reform of the power system and the scientific development of renewable energy. Summary of the Invention
[0004] In view of the above existing problems, the present invention is proposed.
[0005] Therefore, the technical problem solved by the present invention is: how to implement a scheduling mode for distributed generation within the framework of the smart grid, which will become a key way for the reform of the power system and the scientific development of renewable energy.
[0006] To solve the above technical problems, the present invention provides the following technical solutions: A peer-to-peer energy trading method based on virtual communities and distributed generation, including
[0007] Establish a building model, and aggregate the building models into a virtual community model according to their positions in the distribution network;
[0008] Establish a model of distributed generation, and introduce distributed power sources into the virtual community model;
[0009] When the virtual community and the distributed power source conduct peer-to-peer transactions, establish a distribution system operator model;
[0010] Integrate the building model, virtual community model, distributed generation model, and distribution system operator model into a framework model for P2P energy trading to obtain a peer-to-peer energy trading method.
[0011] As a preferred solution of the peer-to-peer energy trading method based on virtual communities and distributed generation according to the present invention, wherein: The establishment of the building model includes that each building optimizes its energy use according to its own energy demand and supply situation, preferentially uses renewable energy, and when the energy generated by the building exceeds its demand, sells the excess energy to other buildings in the same virtual community through a B2B trading platform; The method for constructing the building cost is expressed by the formula:
[0012]
[0013] Wherein, represents the building cost; represents the discomfort cost caused by load transfer; represents the discomfort cost caused by deviation from the reference temperature; represents the B2B transaction cost; represents the B2C transaction cost; where the B2B cost represents the cost generated by energy trading between buildings, and the B2C cost represents the cost generated by energy trading between buildings and the virtual community;
[0014] The building-level constraints include energy balance constraints, temperature constraints, and load transfer constraints as:
[0015]
[0016] In the formula: represents the transaction power between buildings; represents the transaction power between the building and the virtual community; R n,i,t represents the renewable energy power generation; represents the load demand of the building; Represents the power requirement of the HVAC system of a building; and respectively represent the minimum and maximum temperatures allowed within the building; represents the temperature regulation variable of the HVAC system within the building; represents the power of load shifting within the building; and respectively represent the minimum and maximum values of the load shifting power within the building.
[0017] As a preferred embodiment of the peer-to-peer energy trading method based on virtual communities and distributed generation according to the present invention, wherein: aggregating the building models into virtual community models according to their locations in the distribution network includes combining multiple buildings into a virtual community according to the physical locations in the distribution network and the energy demands of the buildings. Each virtual community includes several buildings B1, B2, B3,... Bn, and a shared battery energy storage system BESS is set up within each virtual community to store the excess renewable energy within the community and release energy during peak loads;
[0018] Aggregating the building models into virtual community models, the formula for constructing the virtual community cost is expressed as:
[0019]
[0020] wherein, represents the cost generated from trading with the utility; represents the battery utilization cost; represents the C2C trading cost; where the C2C cost represents the fees generated from electricity trading between virtual communities;
[0021] The virtual community-level constraints include energy storage system charge and discharge constraints, energy balance constraints, and energy storage system state constraints, which are expressed by the formula:
[0022]
[0023] wherein, and respectively represent the charging and discharging efficiencies of the energy storage system, and respectively represent the minimum and maximum values of the charging efficiency of the energy storage system, and respectively represent the minimum and maximum values of the discharging efficiency of the energy storage system; and respectively represent the input and output powers between the community and the power grid; represents the trading power between communities; represents the trading power between the building and the community; En,t Represents the state of the energy storage system at time t.
[0024] As a preferred solution of the point-to-point energy trading method based on virtual communities and distributed generation according to the present invention, wherein: establishing the model of distributed generation includes that the distributed generation source dynamically provides energy according to market demand and directly conducts energy trading with the buildings in the virtual community;
[0025] The formula for the construction method of distributed generation cost is expressed as:
[0026]
[0027] Wherein, Represents the distributed generation cost; And Represents the cost characteristic parameter of DG; Represents the LMP of the main power market where DG is located; Represents the LMP of the ancillary service market where DG is located; Represents the power generation of DG in the main power market; Represents the power generation of DG in the ancillary service market; DG represents distributed generation, and LMP represents local marginal price;
[0028] The constraints of distributed generation are:
[0029]
[0030] Wherein, And Respectively represent the power generation of the distributed generation unit in the main market and the ancillary market; And Respectively represent the minimum and maximum power generation capabilities of distributed generation;
[0031] The distributed generation source participates in the bidding process of the local energy market, provides energy support at the optimal price, and provides power generation support for the distribution network when the market demand is low to ensure the stable operation of the network.
[0032] As a preferred solution of the point-to-point energy trading method based on virtual communities and distributed generation according to the present invention, wherein: establishing the distribution system operator model includes establishing the distribution system operator model and adjusting the transaction fee in real time according to factors such as the load of the network, line voltage, and transaction scale;
[0033] The formula for the construction method of the distribution system operator cost is expressed as:
[0034]
[0035] Wherein, f DSODenote the cost of the distribution system operator; Denote the total power generation in the distribution system at time t; Denote the reactive power at time t, which is used to maintain the voltage stability of the power grid; and Denote the electricity prices of active power and reactive power at time t respectively; Denote a binary variable used to determine whether the distributed generation unit d participates in the electricity trading in the market; Denote another binary variable used to determine whether the distributed generation unit d participates in the ancillary service market; Denote the marginal bid submitted by the distributed generation unit d to the main market at time t; Denote the marginal bid submitted by the distributed generation unit d to the ancillary service market at time t; and Denote the active power and reactive power at the d - th node at time t respectively;
[0036] The constraints of the distribution system operator include network constraints, power balance constraints and transmission power constraints, which are expressed by the formula:
[0037]
[0038]
[0039] where, V min and V max Denote the minimum and maximum values of the node voltages in the power grid respectively; and Denote the reactance between node k and other node k′ in the power grid, representing the electrical connection strength between different nodes in the power grid; and Denote the active power generation and active load of node k respectively; and Denote the reactive power generation and reactive load of node k respectively; N B Denote the total number of nodes in the distribution system; k and k′ represent different node indices respectively; and Denote the power transfer coefficient and flow transfer coefficient between line l and node k respectively; - P l max and P l max Denote the minimum and maximum power capacities at node l respectively.
[0040] As a preferred solution of the peer-to-peer energy trading method based on virtual communities and distributed generation according to the present invention, wherein: the framework model of the P2P energy trading includes integrating building models, virtual community models, distributed generation models, and distribution system operator models into a framework model of P2P energy trading, conducting energy trading between building and building B2B, building and community B2C, and community and community C2C, optimizing the energy flow in virtual communities, distributed power sources, and distribution networks, and obtaining the point energy trading method;
[0041]
[0042] Among them, f1 represents minimizing the total cost of the system; Represents the building cost; Represents the virtual community cost; Represents the distributed generation cost; f DSO Represents the distribution system operator cost;
[0043] B2B building-to-building transaction: Each building within the community directly conducts energy transactions with other buildings; If a building generates more renewable energy than needed, or its energy storage system is full, it sells the excess energy to other buildings within the community, reducing energy losses and increasing the utilization rate of renewable energy;
[0044] B2C building-to-energy storage system transaction: The building also stores the excess energy in the shared energy storage system of the virtual community for future high-demand use; The BESS ensures efficient energy management by optimizing the charge and discharge strategy;
[0045] Energy sharing and trading within the interval C2C transaction: When a virtual community has excess energy or is energy-deficient, it conducts energy transactions with other communities through the community-to-community C2C trading platform. The trading process is dynamically adjusted based on demand to ensure the balance of energy supply and demand in the entire system; A dynamic network usage fee mechanism is introduced to adjust the fees for cross-community transactions in real-time, reducing the pressure on the distribution network and ensuring network security; The energy flow between communities is also transmitted through the shortest path or the optimal trading route to reduce transaction costs.
[0046] As a preferred solution of the peer-to-peer energy trading method based on virtual communities and distributed generation according to the present invention, wherein: the obtained peer-to-peer energy trading method includes that the trading process is carried out on a cloud platform, adopting a privacy-preserving decentralized method to ensure that the privacy data of participants is not leaked; The energy trading between buildings and virtual communities is optimized through the alternating direction method of multipliers algorithm to minimize the overall trading cost;
[0047] The system adopts a decentralized optimization algorithm, enabling each building or virtual community to independently make energy trading decisions without the need to centrally process all users' data; each node only needs to handle its own energy trading and a small amount of necessary global information;
[0048] Since the computing tasks are distributed across multiple independent nodes, the trading optimization process can be decentralized, and the cloud computing platform is only responsible for coordinating the update of global variables without directly accessing the complete data of each node;
[0049] Local problem optimization: For each building i and community n, optimize its trading decision xi, and introduce Lagrange multipliers yi and dual variables zi to handle the coupling constraints of the system:
[0050] L(x i ,z i ,y i )=f(x i )+g(z i )-y i (Ax i +Bz i -C)
[0051] Among them, L(x i ,z i ,y i ) represents the Lagrangian function of the i-th sub-problem; f(x i ) represents the trading cost of the building or community; g(z i ) represents the network usage cost; Ax i +Bz i =C represents the constraint condition of the system; where matrices A and B represent the constraint matrices of the system, reflecting the coupling relationship between each building or community; C represents the constant vector;
[0052] Lagrange multiplier update: After each iteration, update the Lagrange multiplier y i :
[0053]
[0054] Among them, represents the Lagrange multiplier updated after the (K + 1)-th iteration; represents the Lagrange multiplier updated after the K-th iteration; represents the violation amount obtained after local optimization, that is, the degree to which the solution of the current iteration violates the global constraint; ρ controls the update step size of the Lagrange multiplier.
[0055] The update of the Lagrange multiplier enables the system to continuously adjust the trading path and decision in each iteration, gradually reaching the optimal solution under the global constraint conditions;
[0056] Summarize the local optimization results, and collect the local optimization results of each building xi and community zi;
[0057] Conduct global constraint checking, and check the global constraint of Ax i + Bz i = C to ensure that energy trading and transmission will not cause system imbalance or network overload;
[0058] Adjust the trading decision. Through the update of Lagrange multipliers, the system gradually adjusts the trading path and energy allocation until the global constraint is satisfied.
[0059] As a preferred solution of the peer-to-peer energy trading system based on virtual communities and distributed generation according to the present invention, wherein: a building model module, for each building, establish its energy demand and supply models, and optimize its energy usage strategy;
[0060] A virtual community model module, according to the location of the building in the distribution network, aggregate it into virtual communities to improve the energy management efficiency;
[0061] A distributed generation module, establish a distributed power source model to support direct energy trading with buildings within the virtual community;
[0062] A distribution system operator module, as the coordinator of the distribution network, manages the costs of energy trading and the network operating status.
[0063] A computer device, including a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the steps of the peer-to-peer energy trading method based on virtual communities and distributed generation.
[0064] A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the peer-to-peer energy trading method based on virtual communities and distributed generation.
[0065] Advantages of the present invention: The peer-to-peer energy trading method based on virtual communities and distributed generation provided by the present invention optimizes the energy sharing and trading between buildings and inside and outside the community through the aggregation of virtual communities and the integration of local distributed generation, maximizes the utilization rate of renewable energy, and reduces the dependence on the external power grid. At the same time, the dynamic network usage fee mechanism adjusts the trading cost according to the actual load, significantly reducing the energy trading cost. The hierarchical optimization algorithm and decentralized processing improve the flexibility and scalability of the system, ensuring efficient operation even in large-scale applications. By dynamically adjusting the trading path, the system effectively maintains the stability of the distribution network, prevents network overload, and provides a privacy protection and reliable trading mechanism. Brief Description of the Drawings
[0066] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0067] Figure 1 It is the overall flowchart of a point-to-point energy trading method based on virtual community and distributed generation provided for the first embodiment of the present invention.
[0068] Figure 2 It is the building load diagrams for each period of a point-to-point energy trading method based on virtual community and distributed generation provided for the second embodiment of the present invention.
[0069] Figure 3 It is the environmental temperature and RES power generation data diagram of a point-to-point energy trading method based on virtual community and distributed generation provided for the second embodiment of the present invention.
[0070] Figure 4 It is the VC power exchange diagram under three scenarios of a point-to-point energy trading method based on virtual community and distributed generation provided for the second embodiment of the present invention.
[0071] Figure 5(a) is the power exchange diagram of B2C (C1) under two scenarios of a point-to-point energy trading method based on virtual community and distributed generation provided for the second embodiment of the present invention.
[0072] Figure 5(b) is the power exchange diagram of B2C (C2) under two scenarios of a point-to-point energy trading method based on virtual community and distributed generation provided for the second embodiment of the present invention.
[0073] Figure 5(c) is the power exchange diagram of B2C (C3) under two scenarios of a point-to-point energy trading method based on virtual community and distributed generation provided for the second embodiment of the present invention.
[0074] Figure 6(a) is the battery scheduling power diagram of Scenario B under two scenarios of a point-to-point energy trading method based on virtual community and distributed generation provided for the second embodiment of the present invention.
[0075] Figure 6(b) is the battery scheduling power diagram of Scenario C under two scenarios of a point-to-point energy trading method based on virtual community and distributed generation provided for the second embodiment of the present invention.
[0076] Figure 7(a) is the power exchange diagram of B2B of C2 in Scenario B under two cases of a point-to-point energy trading method based on virtual communities and distributed generation provided by the second embodiment of the present invention.
[0077] Figure 7(b) is the power exchange diagram of B2B of C2 in Scenario C under two cases of a point-to-point energy trading method based on virtual communities and distributed generation provided by the second embodiment of the present invention.
[0078] Figure 8 It is the net power exchange diagram of C2C of a point-to-point energy trading method based on virtual communities and distributed generation provided by the second embodiment of the present invention. Detailed implementation manners
[0079] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will describe the detailed implementation manners of the present invention with reference to the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0080] Embodiment 1, referring to Figure 1 , is an embodiment of the present invention, which provides a point-to-point energy trading method based on virtual communities and distributed generation, including:
[0081] S1: Establish a building model, and aggregate the building models into a virtual community model according to their locations in the distribution network.
[0082] Further, the establishment of the building model includes that each building optimizes its energy use according to its own energy demand and supply situation, preferentially uses renewable energy, and when the energy generated by the building exceeds its demand, sells the excess energy to other buildings in the same virtual community through the B2B trading platform; establish a building model, and the formula for the building cost construction method is expressed as:
[0083]
[0084] Among them, represents the building cost; represents the discomfort cost caused by load transfer; represents the discomfort cost caused by deviating from the reference temperature; represents the B2B trading cost; represents the B2C trading cost; where the B2B cost represents the fees generated by energy trading between buildings, and the B2C cost represents the fees generated by energy trading between buildings and virtual communities.
[0085] Furthermore, the building-level constraints, including energy balance constraints, temperature constraints, and load transfer constraints, are as follows:
[0086]
[0087] In the formula: represents the trading power between buildings; represents the trading power between a building and a virtual community; R n,i,t represents the renewable energy power generation; represents the load demand of the building; represents the power requirement of the HVAC system in the building; and represent the minimum and maximum allowable temperatures in the building, respectively; represents the temperature regulation variable of the HVAC system in the building; represents the power of load transfer in the building; and represent the minimum and maximum values of the load transfer power in the building, respectively.
[0088] Furthermore, according to the physical locations in the distribution network and the energy demands of buildings, multiple buildings are combined into a virtual community. Each virtual community includes several buildings (B1, B2, B3,... Bn). A shared battery energy storage system (BESS) is set up within each virtual community to store the excess renewable energy in the community and release this energy during peak loads. The energy storage system ensures the energy balance within the community and provides flexibility for subsequent energy scheduling. The specific construction method is as follows:
[0089] Furthermore, the building models are aggregated into a virtual community model. The formula for constructing the virtual community cost is expressed as:
[0090]
[0091] Wherein, represents the cost generated from the transaction with the utility; represents the battery utilization cost; represents the C2C transaction cost; the C2C cost represents the fee generated from the electricity transaction between virtual communities;
[0092] Furthermore, the virtual community-level constraints, including the charge and discharge constraints of the energy storage system, energy balance constraints, and energy storage system state constraints, are expressed by the formula:
[0093]
[0094] Wherein, and respectively represent the charging and discharging efficiencies of the energy storage system, and respectively represent the minimum and maximum charging efficiencies of the energy storage system, and respectively represent the minimum and maximum discharging efficiencies of the energy storage system; and respectively represent the input and output powers between the community and the power grid; represents the trading power between communities; represents the trading power between the building and the community; E n,t represents the state of the energy storage system at time t..
[0095] S2: Establish a model of distributed generation and introduce a distributed power source into the virtual community model.
[0096] Furthermore, the establishment of the distributed generation model includes that the distributed power source dynamically provides energy according to market demand and directly conducts energy transactions with the buildings in the virtual community.
[0097] Even further, the formula for the distributed generation cost construction method is expressed as:
[0098]
[0099] Wherein, represents the distributed generation cost; and represent the cost characteristic parameters of DG; represents the LMP of the main power market where DG is located; represents the LMP of the ancillary service market where DG is located; represents the power generation of DG in the main power market; represents the power generation of DG in the ancillary service market. DG represents distributed generation and LMP represents local marginal price.
[0100] Even further, the distributed generation constraints are:
[0101]
[0102] Wherein, and respectively represent the power generations of the distributed generation unit in the main market and the ancillary market; and respectively represent the minimum and maximum power generation capabilities of the distributed generation;
[0103] Furthermore, distributed power generation sources participate in the bidding process of the local energy market to provide energy support at the optimal price, providing power generation support to the distribution network when the market demand is low to ensure the stable operation of the network.
[0104] S3: When virtual communities and distributed power generation sources conduct peer-to-peer transactions, a distribution system operator model is established.
[0105] Furthermore, the establishment of the distribution system operator model includes establishing a distribution system operator model and adjusting the transaction fees in real time according to factors such as the load of the network, line voltage, and transaction scale.
[0106] Furthermore, the formula for the cost construction method of the distribution system operator is expressed as:
[0107]
[0108] where f DSO represents the cost of the distribution system operator; represents the total power generation in the distribution system at time t; represents the reactive power at time t, which is used to maintain the voltage stability of the power grid; and represent the electricity prices of active power and reactive power at time t respectively; represents a binary variable used to determine whether the distributed generation unit d participates in the power trading in the market; represents another binary variable used to determine whether the distributed generation unit d participates in the ancillary service market; represents the marginal bid submitted by the distributed generation unit d to the main market at time t; represents the marginal bid submitted by the distributed generation unit d to the ancillary service market at time t; and represent the active power and reactive power of the d-th node at time t respectively.
[0109] Furthermore, the distribution system operator constraints include network constraints, power balance constraints, and transmission power constraints, which are expressed by the formula:
[0110]
[0111]
[0112] where V min and V max represent the minimum and maximum values of the node voltages in the power grid respectively; and represent the reactance between node k and other nodes k' in the power grid, indicating the electrical connection strength between different nodes in the power grid; and respectively represent the active power generation and active load of node k; and respectively represent the reactive power generation and reactive load of node k; N B represents the total number of nodes in the distribution system; k and k′ respectively represent different node indices; and respectively represent the power transfer coefficient and the flow transfer coefficient between line l and node k; -P l max and P l max respectively represent the minimum and maximum power capacities at node l.
[0113] S4: Integrate the building model, virtual community model, distributed generation model, and distribution system operator model into a framework model for P2P energy trading to obtain a peer-to-peer energy trading method.
[0114] Furthermore, integrate the building model, virtual community model, distributed generation model, and distribution system operator model into a framework model for P2P energy trading, conduct energy trading between building and building (B2B), building and community (B2C), and community and community (C2C), optimize the energy flow in the virtual community, distributed power sources, and distribution network, and obtain a point energy trading method. The specific construction method is as follows:
[0115]
[0116] where f1 is to minimize the total cost of the system; is the building cost; is the virtual community cost; is the distributed generation cost; f DSO is the distribution system operator cost.
[0117] Step 1, B2B (building-to-building) trading: Each building within the community can directly conduct energy trading with other buildings. If a building generates more renewable energy than it needs, or its energy storage system is full, it can sell the excess energy to other buildings within the community, reducing energy losses and increasing the utilization rate of renewable energy.
[0118] Step 2, B2C (building-to-energy storage system) trading: A building can also store the excess energy in the shared energy storage system of the virtual community for future use during high-demand periods. The BESS ensures efficient energy management through optimized charge and discharge strategies.
[0119] Step 3, Energy Sharing and Trading within the Interval (C2C Trading): When a virtual community has surplus energy or insufficient energy, it can conduct energy trading with other communities through a community-to-community (C2C) trading platform. The trading process is dynamically adjusted based on demand to ensure the balance between energy supply and demand in the entire system. By introducing a dynamic network usage fee mechanism, the fees for cross-community transactions are adjusted in real time to reduce the pressure on the distribution network and ensure network security. The energy flow between communities is also transmitted through the shortest path or the optimal trading route to reduce transaction costs.
[0120] Furthermore, the trading process is carried out on a cloud platform, adopting a privacy-preserving decentralized method to ensure that the privacy data of participants is not leaked. The energy trading between buildings and virtual communities is optimized through the Alternating Direction Method of Multipliers (ADMM) algorithm to minimize the overall transaction cost. The specific construction method is as follows:
[0121] Furthermore, Privacy Protection: The system adopts a decentralized optimization algorithm, enabling each building or virtual community to independently make energy trading decisions without the need to centrally process all users' data. Each node (building or community) only needs to handle its own energy trading and a small amount of necessary global information, effectively avoiding the privacy risks brought by the centralized storage of a large amount of sensitive data.
[0122] Furthermore, since the computing tasks are distributed among multiple independent nodes, the trading optimization process can be decentralized, and the cloud computing platform is only responsible for coordinating the update of global variables without directly accessing the complete data of each node.
[0123] Application of the ADMM Algorithm: Local Problem Optimization (Optimization of Each Building or Community). For each building i or community n, we will optimize its trading decision xi and introduce Lagrange multipliers yi and dual variables zi (representing decision variables related to network usage or global coordination variables, reflecting the impact of building i or community i on the distribution network) to handle the coupling constraints of the system:
[0124] L(x i ,z i ,y i )=f(x i )+g(z i )-y i (Ax i +Bz i -C)
[0125] where L(x i ,z i ,y i ) represents the Lagrangian function of the i-th sub-problem; f(x i ) is the trading cost of the building or community; g(zi ) is the network usage fee; Ax i + Bz i = C is the constraint condition of the system. Among them, matrices A and B are the constraint matrices of the system, reflecting the coupling relationship between each building or community; C is a constant vector.
[0126] Lagrange multiplier update. After each iteration, update the Lagrange multiplier y i :
[0127]
[0128] where is the Lagrange multiplier updated after the (K + 1)-th iteration; is the Lagrange multiplier updated after the K-th iteration; is the amount of default obtained after local optimization, that is, the degree to which the solution of the current iteration violates the global constraint; ρ controls the update step size of the Lagrange multiplier.
[0129] The update of the Lagrange multiplier enables the system to continuously adjust the trading path and decision in each iteration to gradually reach the optimal solution under the global constraint conditions.
[0130] It should be noted that for global coordination: First, local optimization result summary: Collect the local optimization results of each building xi and community zi. Second, global constraint check: Check the global constraint of Ax i + Bz i = C to ensure that energy trading and transmission will not cause system imbalance or network overload. Finally, adjust the trading decision: Through the update of the Lagrange multiplier, the system gradually adjusts the trading path and energy allocation until the global constraint is satisfied.
[0131] Example 2, referring to Figures 2 - 8 , is an embodiment of the present invention, providing a point-to-point energy trading method based on virtual communities and distributed generation. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.
[0132] First, assume that a local power system includes multiple buildings and virtual communities, and the power grid company needs to purchase electricity through point-to-point (P2P) trading and distributed generating units. In this paper, the IEEE 33-bus system is adopted, and the data of buildings / virtual communities and distributed generation are obtained after sorting. The parameters of buildings / virtual communities are shown in Table 2, and the building loads at each time period are as Figure 2 shown, the environmental temperature and RES power generation data are as Figure 3 shown, the data of distributed generation are shown in Table 2, and the cost comparison of three scenarios is shown in Table 3.
[0133] Table 1 Data of Buildings and Virtual Communities
[0134]
[0135] Table 2 Data of Distributed Generation
[0136]
[0137] Table 3 Cost Comparison of Three Scenarios
[0138]
[0139] To study the impact of the implementation of P2P energy sharing and BESS on the power system scheduling plan, the present invention sets three scenarios: Scenario A. Without considering the effects of P2P energy sharing and BESS, under basic conditions, the building exchanges energy with the utility company within the building complex, importing / exporting the excess / remaining energy. Scenario B. Considering the effects of P2P energy sharing and BESS, the building exchanges energy with the VC (B2C) and other buildings in the VC (B2B). The energy exchange through the VC (B2C) means using the shared BESS to exchange with the utility. Scenario C. An extended case of Scenario II, in which power can be exchanged between VCs through C2C transactions, and each C2C energy exchange is accompanied by an appropriate increase in NUC. Table 3 shows the cost comparison of the three cases. Figure 4 Figure 4 is the VC power exchange diagram for the three cases, and Figure 5 is the power exchange diagram for B2C.
[0140] Through Figure 4 It is found that in Scenario A, the building transfers the load according to the available renewable energy generation and the electricity exchange price with the utility company (i.e., LMP). In Scenario B, the building can exchange energy with other buildings in B2B transactions while using the BESS of the VC to utilize load diversity and effectively utilize RESs. As this local energy consumption increases, the energy exchange with the utility decreases.
[0141] According to Figure 5, the total B2C exchange in Scenario B can be regarded as the algebraic sum of the energy exchange with the utility and the energy exchange for battery charging and discharging. In Scenario B, compared with Scenario A, the imports and exports of all VCs decrease. For example, in Scenario A, during the period from 1:00 to 7:00 h, the surplus energy in C2 is exported to the utility [Figure 5(a)], while in Scenario B [Figure 5(b)], this export decreases because it is used for storage in the BESS, as shown in Figure 6.
[0142] The stored energy is used to supply the load in subsequent intervals, so the import volume is also reduced. The cost of B2B transactions depends on the contribution of the building as a seller or buyer to P2P transactions. As shown in Table 3, C b2b Building 1 of C2 is positive for the same VC, while Buildings 2 and 3 of the same VC are negative, which can be analyzed from the B2B exchange of C2 shown in Figure 7. Building 1 imports electricity from other buildings for most of the time intervals, so it pays other buildings, and its net B2B transaction cost is positive.
[0143] Figure 7 shows almost the same B2B exchanges in Scenario B and Scenario C of C2. Similarly, the B2B exchanges are almost the same in other VCs. It can also be understood from the cost C of the B2B exchange in Table 3 b2b that they are almost equal in Scenario B and Scenario C.
[0144] The C2C transactions in Scenario C provide a more cost-effective opportunity to save costs by leveraging RESs and load diversity. As Figure 4 shown, in Scenario C, the total energy exported to the utility company is almost zero, far lower than 283.43 kWh in Scenario B. Similarly, the energy import in Scenario C is 2357.68 kWh, while the energy import in Scenario B is 2500.29 kWh.
[0145] In addition, as shown in Table 3, the user discomfort cost C in Scenario C ls is smaller than that in Scenario B. For C1, C2, and C3, the C in Scenario C ls is reduced by 94.63%, 92.98%, and 93.31% respectively compared to Scenario B. Similarly, compared with Scenario B, the discomfort cost (C HAVC ) caused by temperature deviation in Scenario C is also reduced. The reason for the reduction of the user discomfort cost is that in Scenario C, the surplus energy of one VC is used by other VCs instead of being output to the utility or consumed by load shifting as in Scenario B. This load shifting also affects the B2C exchange, as shown in Figure 6. During the period from 12:00 to 14:00h, the energy output by Buildings C1 and C3 increases and is used by C2 through C2C transactions Figure 8 stored in the BESS [Figure 6]. These stored energies are used by the buildings of C2 at 19:00h, as shown in Figure 5, with an increase in energy import in the B2C exchange. In Scenario C, the C2C incentives for C1, C2, and C3 are $22.83, -$51.02, and $28.20 respectively. The corresponding power exchanges are as Figure 8 shown.
[0146] A novel P2P energy sharing scheduling method with the active participation of distributed generation for a distribution system composed of multiple communities. In this work, the DSO clears the market through the main market and ancillary services with the active participation of DGs. The cloud computing-based framework proposed in this work avoids sharing any sensitive information between the DSO and the participants, thus avoiding security and privacy issues.
[0147] The numerical results demonstrate the effectiveness of the proposed energy trading framework. This LMP-based framework significantly reduces the energy costs of all buildings and increases the profits of DGs while maintaining network constraints. In addition to bringing economic benefits to prosumers, the distribution network also benefits from peak shaving and reducing reverse power flow. The framework takes into account the uncertainties of the information exchange system used and the benefits of load diversity of all buildings in all communities. By utilizing the shareable BESS, the effectiveness of the P2P energy trading framework is improved. Future work aims to make this framework more practical by considering the irrational behavior of consumers.
[0148] Example 3, an embodiment of the present invention, provides a peer-to-peer energy trading system based on virtual communities and distributed generation, including:
[0149] A building model module that, for each building, establishes its energy demand and supply models and optimizes its energy usage strategy.
[0150] A virtual community model module that aggregates buildings into virtual communities according to their locations in the distribution network to improve energy management efficiency.
[0151] A distributed generation module that establishes a distributed power generation source model to support direct energy trading with buildings within the virtual community.
[0152] A distribution system operator module that, as the coordinator of the distribution network, manages the fees of energy trading and the network operation status.
[0153] If a function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, etc., which can store program codes of various kinds.
[0154] The logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch instructions from the instruction execution system, apparatus, or device and execute the instructions), or in combination with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in combination with an instruction execution system, apparatus, or device.
[0155] More specific examples (a non-exhaustive list) of computer-readable media include the following: electrical connection parts with one or more wirings (electronic devices), portable computer disk cartridges (magnetic devices), random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), fiber optic devices, and portable compact disc read-only memories (CDROMs). Additionally, a computer-readable medium can even be paper or other suitable media on which a program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, then editing, interpreting, or otherwise processing it as appropriate, and then storing it in a computer memory.
[0156] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc. It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.
[0157] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.
Claims
1. A peer-to-peer energy trading method based on virtual communities and distributed generation, characterized in that, Including: Building a building model and aggregating the building models into a virtual community model according to their locations in the distribution network; Building a distributed generation model and introducing distributed power generation sources into the virtual community model; When point-to-point trading occurs between the virtual community and the distributed power generation sources, building a distribution system operator model; Integrating the building model, virtual community model, distributed generation model, and distribution system operator model into a framework model for P2P energy trading to obtain a point-to-point energy trading method.
2. The peer-to-peer energy trading method based on virtual communities and distributed generation according to claim 1, characterized in that: The building model establishment includes that the building optimizes energy use according to its own energy demand and supply situation, preferentially uses renewable energy, and when the energy generated by the building exceeds its demand, sells the excess energy to other buildings in the same virtual community through a B2B trading platform; the building cost construction formula is expressed as: Among them, represents the building cost; represents the discomfort cost caused by load transfer; represents the discomfort cost caused by deviation from the reference temperature; represents the B2B transaction cost; represents the B2C transaction cost; where the B2B cost represents the expenses generated by energy transactions between buildings, and the B2C cost represents the expenses generated by energy transactions between buildings and virtual communities; The building-level constraints include energy balance constraint, temperature constraint, and load transfer constraint, which are: Among them, represents the trading power between buildings; represents the trading power between a building and a virtual community; R n,i,t represents the renewable energy power generation; represents the load demand of a building; represents the power requirement of the HVAC system of a building; and represent the minimum and maximum temperatures allowed in a building, respectively; represents the temperature regulation variable of the HVAC system in a building; represents the power of load transfer in a building; and represent the minimum and maximum values of the load transfer power in a building, respectively.
3. The peer-to-peer energy trading method based on virtual communities and distributed generation according to claim 2, characterized in that: The aggregation of the building models into a virtual community model according to their locations in the distribution network includes combining multiple buildings into a virtual community according to the physical locations in the distribution network and the energy demands of the buildings. Each virtual community includes several buildings B1, B2, B3,... Bn, and a shared battery energy storage system BESS is set up in each virtual community to store the excess renewable energy in the community and release energy during peak loads; The method for constructing the virtual community cost when aggregating the building models into a virtual community model is expressed by the formula: Among them, represents the cost generated from the utility exchange; represents the battery utilization cost; represents the C2C transaction cost; where the C2C cost represents the cost generated from the electricity exchange between virtual communities; The virtual community-level constraints include energy storage system charge-discharge constraint, energy balance constraint, and energy storage system state constraint, which are expressed by the formula: Among them, and respectively represent the charging and discharging efficiencies of the energy storage system, and respectively represent the minimum and maximum values of the charging efficiency of the energy storage system, and respectively represent the minimum and maximum values of the discharging efficiency of the energy storage system; and respectively represent the input and output powers between the community and the power grid; represents the trading power between communities; represents the trading power between the building and the community; E n,t represents the state of the energy storage system at time t.
4. The peer-to-peer energy trading method based on virtual communities and distributed power generation according to claim 3, wherein: The establishment of the distributed generation model includes that the distributed power generation sources dynamically provide energy according to market demand and directly conduct energy trading with the buildings in the virtual community; The formula for constructing the distributed generation cost is expressed as: Among them, represents the distributed generation cost; and represent the cost characteristic parameters of DG; represents the LMP of the main power market where DG is located; represents the LMP of the ancillary service market where DG is located; represents the power generation of DG in the main power market; represents the power generation of DG in the ancillary service market; DG represents distributed generation, and LMP represents local marginal price; The distributed generation constraint is: Among them, and respectively represent the power generation of distributed generation units in the main market and the ancillary market; and respectively represent the minimum and maximum power generation capabilities of distributed generation; The distributed power generation sources participate in the bidding process in the local energy market to provide energy support at the optimal price and provide power generation support for the distribution network when the market demand is low to ensure the stable operation of the network.
5. The peer-to-peer energy trading method based on virtual communities and distributed generation according to claim 4, characterized in that: The establishment of the distribution system operator model includes building a distribution system operator model and adjusting the trading fees in real time according to factors such as the network load, line voltage, and trading scale; The formula for constructing the distribution system operator cost is expressed as: Among them, f DSO represents the cost of the distribution system operator; represents the total power generation in the distribution system at time t; represents the reactive power at time t, which is used to maintain the voltage stability of the power grid; and represent the electricity prices of active power and reactive power at time t respectively; represents a binary variable used to determine whether the distributed generation unit d participates in the electricity trading in the market; represents another binary variable used to determine whether the distributed generation unit d participates in the ancillary service market; represents the marginal bid submitted by the distributed generation unit d to the main market at time t; represents the marginal bid submitted by the distributed generation unit d to the ancillary service market at time t; and represent the active power and reactive power of the d-th node at time t respectively; The distribution system operator constraints include network constraint, power balance constraint, and transmission power constraint, which are expressed by the formula: Among them, V min and V max represent the minimum and maximum values of the node voltage in the power grid, respectively; and represent the reactance between node k and other node k′ in the power grid, indicating the electrical connection strength between different nodes in the power grid; and represent the active power generation and active power load of node k, respectively; and represent the reactive power generation and reactive power load of node k, respectively; N B represents the total number of nodes in the distribution system; k and k′ represent different node indices, respectively; and represent the power transfer coefficient and the flow transfer coefficient between line l and node k, respectively; and represent the minimum and maximum power capacities at node l, respectively.
6. The peer-to-peer energy trading method based on virtual communities and distributed generation according to claim 5, characterized in that: The framework model for P2P energy trading includes integrating the building model, virtual community model, distributed generation model, and distribution system operator model into a framework model for P2P energy trading, conducting energy trading between building and building B2B, building and community B2C, and community and community C2C, optimizing the energy flow in the virtual community, distributed power generation sources, and distribution network, and obtaining a point energy trading method; where f1 represents minimizing the total cost of the system; represents the building cost; represents the virtual community cost; represents the distributed generation cost; f DSO represents the distribution system operator cost; B2B Building-to-Building Energy Trading: Each building within the community directly conducts energy trading with other buildings. If a building generates more renewable energy than it needs or its energy storage system is full, it sells the excess energy to other buildings in the community, reducing energy losses and increasing the utilization rate of renewable energy. B2C Building-to-Energy Storage System Trading: The building also stores the excess energy in the shared energy storage system of the virtual community for future use during high-demand periods. The BESS ensures efficient energy management through optimized charging and discharging strategies. C2C Energy Sharing and Trading within Intervals: When a virtual community has excess energy or is energy-deficient, it conducts energy trading with other communities through a community-to-community C2C trading platform. The trading process is dynamically adjusted based on demand to ensure the balance between energy supply and demand in the entire system. A dynamic network usage fee mechanism is introduced to adjust the fees for cross-community trading in real-time, reducing the pressure on the distribution network and ensuring network security. The energy flow between communities is also transmitted through the shortest path or optimal trading routes to reduce trading costs.
7. The peer-to-peer energy trading method based on virtual communities and distributed generation according to claim 6, characterized in that: The obtained peer-to-peer energy trading method includes that the trading process is carried out on a cloud platform, adopting a privacy-preserving decentralized method to ensure that the privacy data of participants is not leaked. The energy trading between buildings and virtual communities is optimized through the alternating direction method of multipliers algorithm to minimize the overall trading cost. The system adopts a decentralized optimization algorithm, enabling each building or virtual community to independently make energy trading decisions without the need to centrally process all users' data. Each node only needs to handle its own energy trading and a small amount of necessary global information. Since the computing tasks are distributed among multiple independent nodes, the trading optimization process can be decentralized. The cloud computing platform is only responsible for coordinating the update of global variables and does not directly access the complete data of each node. Local Problem Optimization: For each building i and community n, their trading decisions xi will be optimized, and Lagrange multipliers yi and dual variables zi are introduced to handle the coupling constraints of the system: L(x i , z i , y i ) = f(x i ) + g(z i ) - y i (Ax i + Bz i - C) where \(L(x\) i , z\) i , y\) i ) represents the Lagrangian function of the \(i\)-th sub-problem; \(f(x\) i ) represents the transaction cost of a building or a community; \(g(z\) i ) represents the network usage cost; \(Ax\) i + Bz\) i = C represents the constraint condition of the system; where the matrices A and B represent the constraint matrices of the system, reflecting the coupling relationship between buildings or communities; C represents the constant vector. Lagrange multiplier update. After each iteration, update the Lagrange multiplier y i : Among them, represents the Lagrange multiplier updated after the (K + 1)-th iteration; represents the Lagrange multiplier updated after the K-th iteration; represents the amount of default obtained after local optimization, that is, the degree to which the solution of the current iteration violates the global constraint; ρ controls the update step size of the Lagrange multiplier; The update of the Lagrange multipliers enables the system to continuously adjust the trading path and decisions in each iteration, gradually reaching the optimal solution under global constraint conditions. Summarize the Local Optimization Results: Collect the local optimization results of each building xi and community zi. Perform a global constraint check to check Ax i + Bz i = the global constraint of C to ensure that energy trading and transmission do not cause system imbalance or network overload; Adjust the Trading Decisions: Through the update of the Lagrange multipliers, the system gradually adjusts the trading path and energy allocation until the global constraints are met.
8. A system adopting the peer-to-peer energy trading method based on virtual communities and distributed generation as described in any one of claims 1 to 7, characterized in that: Building Model Module: For each building, establish its energy demand and supply model and optimize its energy usage strategy. Virtual Community Model Module: Aggregate buildings into virtual communities according to their positions in the distribution network to improve energy management efficiency. Distributed Generation Module: Establish a distributed power source model to support direct energy trading with buildings within the virtual community. Distribution System Operator Module: As the coordinator of the distribution network, manage the fees for energy trading and the operating status of the network.
9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the peer-to-peer energy trading method based on virtual communities and distributed power generation according to 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 peer-to-peer energy trading method based on virtual communities and distributed power generation according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Point-to-point energy transaction method and device for defining price curve based on virtual line
CN121639260A