Energy community p2p transaction pricing method considering producer-consumer source load matching degree

By constructing a personalized electricity pricing model for multi-microgrid systems and optimizing the trading strategies of producers, consumers, and energy retailers, the problems of lack of incentive mechanisms and unquantified source-load matching in existing P2P electricity trading have been solved, achieving efficient consumption of distributed energy and improved user income.

CN122243559APending Publication Date: 2026-06-19SHANDONG UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG UNIV OF TECH
Filing Date
2026-05-22
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

The existing P2P electricity trading model lacks targeted incentive mechanisms and fails to fully quantify the physical matching degree of source and load, resulting in low efficiency of local consumption of distributed energy and high risk of privacy leakage.

Method used

By constructing a producer-consumer electricity price model, the internal electricity price is decoupled from the base price term and the incentive price term. A personalized energy consumption flexibility discount factor is introduced, and the alternating direction multiplier method is used to solve the problem, thereby optimizing the trading strategies of producers and consumers and energy retailers.

Benefits of technology

It has enabled efficient local consumption of distributed energy, increased user benefits, reduced operating costs, reduced the risk of privacy leaks, and promoted the supply and demand balance of multi-microgrid systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122243559A_ABST
    Figure CN122243559A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of P2P transaction pricing technology, specifically involving a P2P transaction pricing method for energy communities that considers the source-load matching degree of producers and consumers. The steps include: establishing an energy community composed of multiple decentralized producers and consumers, energy retailers, and the distribution network within a local distribution area; decoupling the internal electricity price from the base price term and the incentive price term to construct a producer-consumer electricity price model; introducing a discount factor to construct an energy retailer electricity price model; constructing a producer-consumer user model and an energy retailer model; and solving the producer-consumer user model and the energy retailer model using the alternating direction multiplier method to output the internal transaction electricity price for each time period, the optimal transaction volume for producers and consumers and energy retailers, and the operating costs and incentive benefits of each entity. This invention quantifies the matching degree based on the time-series characteristics of source and load, guides producer-consumer collaboration through differentiated pricing, and achieves dual optimization of efficient local consumption of distributed energy and user benefits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of P2P transaction pricing technology, specifically involving a P2P transaction pricing method for energy communities that considers the matching degree of producers and consumers with source load. Background Technology

[0002] With the deepening of the "dual-carbon" strategy and the accelerated construction of new power systems, distributed energy technologies, represented by distributed photovoltaic and energy storage systems, have experienced rapid development due to their clean and environmentally friendly characteristics, abundant resources, and low operating costs. With the widespread integration of distributed energy into distribution networks and the introduction of the demand-side energy sharing concept, more and more traditional energy consumers are gradually transforming into "prosumers" with both production and consumption functions. Most small-scale prosumers can participate in the regional energy community's electricity market by adjusting flexible resource combinations, forming a decentralized development trend from the traditional centralized power purchase and sale model to heterogeneous collaboration. Against this backdrop, peer-to-peer (P2P) electricity trading, with its decentralized, flexible, and efficient characteristics, has opened up new paths for the local consumption of distributed energy within multi-microgrid systems and for improving user benefits.

[0003] Existing P2P electricity trading models and pricing strategies suffer from the following main shortcomings: Lack of targeted incentive mechanisms: Existing pricing mechanisms are mostly based on a single supply-demand ratio or a uniform clearing price, ignoring the differences in users' historical participation and price-driven demand response, making it difficult to maximize the regulatory potential of high-quality users; Neglect of source-load physical matching: Most existing pricing models only focus on numerical power balance, failing to fully quantify the physical matching degree of source-load temporal characteristics. Without price guidance signals based on source-load complementarity, it will be difficult to achieve efficient local consumption of distributed energy. High risk of privacy leakage: Traditional centralized optimization methods, when handling large-scale producer-consumer transactions, require highly centralized user data, facing significant privacy exposure risks and the curse of computational dimensionality.

[0004] Therefore, there is an urgent need for a new P2P electricity trading pricing method that can take into account user participation, source-load physical matching, and privacy and security, in order to solve the shortcomings of existing technologies. Summary of the Invention

[0005] In view of the shortcomings of the prior art, the purpose of this invention is to provide a P2P transaction pricing method for energy communities that considers the matching degree of source and load between producers and consumers. Based on the time-series characteristics of source and load, the matching degree is quantified, and the collaborative mechanism between producers and consumers is guided by differentiated pricing, thereby achieving the dual optimization of efficient local consumption of distributed energy and user benefits.

[0006] To achieve the above objectives, this invention provides a pricing method for energy community P2P transactions that considers the matching degree of producer-consumer source load, comprising the following steps: S1. Establish an energy community consisting of multiple decentralized producers and consumers, energy retailers, and the power distribution network within a local power distribution area; S2. Define the price used when producers and consumers trade electricity as the internal electricity price. Decouple the internal electricity price from the basic electricity price term and the incentive electricity price term to construct a producer-consumer electricity price model. S3. Introduce a discount factor for each producer's personalized energy consumption flexibility to construct an electricity price model for energy retailers; S4. Considering the maintenance cost of the photovoltaic power generation system, the electricity transaction cost between prosumers and energy retailers, the cost of prosumers participating in P2P energy transactions, the cost of prosumers participating in demand response, and the grid access fee charged by the distribution network to prosumers, construct a prosumer user model and define its objective function and constraints. S5. Considering the revenue generated by energy retailers from trading electricity with the distribution network, the revenue generated by energy retailers from trading electricity with prosumers, the agency fee revenue charged by energy retailers to prosumers, the charging and discharging costs of energy storage systems, and the maintenance costs of energy retailers' photovoltaic power generation systems, construct an energy retailer model and define its objective function and constraints. S6. The alternating direction multiplier method is used to solve the producer-consumer user model and the energy retailer model, and outputs the internal transaction electricity price, the optimal transaction electricity volume between producers and consumers and energy retailers for each time period, as well as the operating costs and incentive benefits of each entity.

[0007] As a preferred embodiment of the present invention, in S1, the producers and consumers achieve interconnection and mutual assistance and power interaction through the distribution network. The fixed loads, flexible loads and distributed power sources of the producers and consumers participate in the internal transactions of the energy community. The energy retailer connects to the distribution network node through the integrated energy storage converter. After the producers and consumers complete the internal power interaction, the retailer conducts charging and discharging and power purchase and sale operations with the producers and consumers and the distribution network respectively, based on the overall operation. The power interaction process transmits energy flow and information flow through the distribution network, forming a decentralized collaborative transaction architecture.

[0008] As a preferred embodiment of the present invention, the process of constructing the producer-consumer electricity price model in S2 is as follows: S2.1 For the base electricity price item, based on the electricity surplus and deficit situation optimized by each producer and consumer, all producers and consumers are divided into two categories: suppliers and demanders. The total supply and total demand of the shared market are defined as follows: (1); (2); (3); In the formula, , Let represent the total supply and total demand of electricity in the shared market during time period t, respectively. , These represent the electricity purchased and sold by producer-consumer n to energy retailers during time period t; , Let N and N represent the electricity purchased and sold by producer-consumer n to producer-consumer m during time period t; N is the total number of producers-consumers. Let t be the energy supply-demand ratio of the energy community during time period t; To prevent constants with a numerator or denominator of 0; For producer-consumer n, the proportion of electricity sales within the energy community is defined as producer-consumer n's contribution to the market: (4); In the formula, This represents the market contribution of producer-consumer n during time period t; The electricity price determined by the energy supply-demand ratio and market contribution is defined as the internal base electricity price for producers and consumers based on the energy community market status, as follows: when hour: (5); when hour: (6); In the formula, This represents the internal base price of electricity for producer-consumer n during time period t; , These represent the time-of-use electricity price and the purchase price of electricity from the energy retailer to the distribution network, respectively. Indicates the compensation price; S2.2 For the incentive price term, the net power characteristic vector of producer-consumer n during the day-ahead dispatch phase is defined as: (7); (8); In the formula, Represents the net power eigenvector of producer-consumer n during time period t; They represent The net power of producers and consumers in time period n, where T represents the total number of time periods; This represents the net power of producer-consumer n during time period t; The symbol for vector transpose; The photovoltaic output is predicted n days prior to the production and consumption period t. The predicted load power of producers and consumers n days prior to time period t; Based on the producer-consumer source-load curve data within a day, the source-load matching degree is calculated using the Spearman rank correlation coefficient and Euclidean distance. ; When producer-consumer n acts as the electricity seller, the electricity price incentive is defined as follows: (9); (10); In the formula, The total power shortage for power consumer m during time period t; , These represent the optimized actual power consumption and photovoltaic power generation of producer-consumer m during time period t, respectively. These are complementary incentive coefficients; This represents the source-load matching degree between producer-consumer n and m; The amount of electricity transferred from surplus electricity consumer n to target electricity consumer m that is short of electricity; This represents the electricity price incentive term between producers and consumers n and m during time period t; S2.3, The internal electricity price for producer-consumer n is defined as follows: (11); In the formula, This represents the internal electricity price when producer-consumer n sells electricity to producer-consumer m during time period t.

[0009] As a preferred embodiment of the present invention, in S2, the source-load matching degree is calculated using the Spearman rank correlation coefficient and Euclidean distance. The process is as follows: Based on the producer-consumer source-load curve data within a day, the rank of each time period is calculated according to an arbitrary sorting rule, and the Spearman rank correlation coefficient is obtained by substituting it into the vector dimension. (12); In the formula, This represents the Spearman rank correlation coefficient between any two net power eigenvectors; denoted as the difference in rank between the elements of the two net power feature vectors in time period t under the same sorting rule; D is the vector dimension, with a value of 24. Find the Euclidean distance to the specified location: (13); In the formula, , These are the positions of the two net power eigenvectors in space; Indicates time period t , The Euclidean distance between corresponding points in space; A normalization method is used to eliminate dimensional differences and obtain the source-load matching degree. : (14); In the formula, , They represent The minimum and maximum values; These are the weighting coefficients.

[0010] As a preferred embodiment of the present invention, the process of constructing the electricity price model for energy retailers in S3 is as follows: when When the discount factor is defined as: (15); (16); In the formula, This represents the discount factor for producer-consumer n during time period t; This is the discount factor; , , respectively, represent the power purchased and sold by energy retailers to the distribution network during time period t; sgn represents the sign function; The electricity consumption adjustment ratio for producer-consumer n during time period t; The optimized actual power consumption of producer-consumer n during time period t; based on The electricity price that energy retailers sell to producers and consumers is: (17); In the formula, This represents the electricity price that energy retailers sell to consumers n during time period t.

[0011] As a preferred embodiment of the present invention, in S4, the objective function of the prosumer user model is: (18); In the formula, Let n be the total cost for prosumers over T time periods; The maintenance cost of the photovoltaic power generation system for producer-consumer n during time period t; The cost of electricity transactions between producer-consumer n and energy retailers during time period t; The cost for producer-consumer n to participate in P2P energy trading during period t; The cost of producer-consumer n participating in demand response during time period t; The network access fee charged by the distribution network to consumer n during time period t; For time intervals; The constraints of the producer-consumer user model include load adjustment power constraints, power trading power limit constraints, producer-consumer power balance constraints, and uniqueness constraints.

[0012] As a preferred embodiment of the present invention The calculation method is as follows: (19); In the formula, This represents the cost coefficient of a photovoltaic power generation system; This represents the photovoltaic power generation of producer n during time period t; The calculation method is as follows: (20); The calculation method is as follows: (twenty one); In the formula, This represents the internal electricity price when producer-consumer m sells electricity to producer-consumer n during time period t; The calculation method is as follows: (twenty two); In the formula, This represents the comfort loss coefficient in demand response; The calculation method is as follows: (twenty three); In the formula, This represents the cost coefficient for agent fees per unit power.

[0013] As a preferred embodiment of the present invention, in S5, the objective function of the energy retailer model is: (twenty four); In the formula, This represents the total trading revenue of an energy retailer over T time periods; This represents the revenue generated by energy retailers trading electricity with the distribution network during time period t; This represents the revenue generated by energy retailers trading electricity with producers and consumers during time period t; This represents the agency fee revenue that energy retailers collect from consumers during period t. This represents the charging and discharging cost of the energy storage system during time period t. This represents the maintenance cost of a photovoltaic power generation system for an energy retailer during time period t; The constraints of the energy retailer model include energy retailer power balance constraints, charging and discharging power constraints, charging or discharging constraints, and shared energy storage state of charge constraints.

[0014] As a preferred embodiment of the present invention The calculation method is as follows: (25); The calculation method is as follows: (26); In the formula, , These represent the electricity purchased and sold by energy retailers to consumer n during time period t. The calculation method is as follows: (27); The calculation method is as follows: (28); In the formula, This is the degradation cost coefficient for energy storage batteries; , These represent the charging and discharging power of the energy storage system during time period t; The calculation method is as follows: (29); In the formula, This represents the photovoltaic power generation capacity of energy retailers during time period t.

[0015] As a preferred embodiment of the present invention, in S6, the alternating direction multiplier method is used to solve the producer-consumer user model and the energy retailer model in a distributed and collaborative manner, decomposing the overall optimization problem at the energy community level into two sub-problems on the producer-consumer side and the energy retailer side, and achieving convergence by iteratively updating the coupling variables.

[0016] The beneficial effects of this invention are: This invention proposes a P2P collaborative trading method for multi-microgrid systems based on a two-tier personalized electricity pricing mechanism. By constructing a master-slave game architecture between energy retailers and producers / consumers, it transforms the macro market supply and demand status and the underlying physical mutual assistance demand into precise price signals. Through a differentiated electricity price incentive mechanism, it effectively breaks down traditional trading barriers and fully mobilizes the enthusiasm of underlying producers / consumers to participate in the regional electricity market. The model of driving physical power flow with price signals fundamentally activates the flexible regulation potential of microgrid clusters, promoting the local consumption and supply-demand balance of local distributed energy on a larger spatial scale.

[0017] This invention proposes a dynamic guided pricing method that considers retailer-side discount factors and market conditions. It seamlessly integrates a price-based demand response mechanism into the upper-level game theory, effectively overcoming the limitations of uniform pricing and lack of flexibility in traditional non-P2P mutual aid models by providing exclusive settlement electricity price discounts to prosumers with high response rates. Simulation results show that this mechanism successfully taps into the initial potential for demand-side adjustment, significantly reducing the total operating cost of the prosumer alliance by 7.36% and substantially improving the power mutual aid level and overall operational economy of the multi-microgrid system.

[0018] This invention proposes a bottom-level P2P personalized incentive electricity pricing mechanism based on the source-load matching degree of prosumers. It deeply analyzes the source-load heterogeneity of different prosumer nodes and guides entities with highly complementary physical characteristics to prioritize local energy transactions through precise price signals, further exploring the system's cost reduction potential. Under this mechanism, energy retailers only need to relinquish a small amount of profit to achieve a unit profit reduction benefit of up to 2.53 times. Simultaneously, this mechanism substantially reshapes the energy cost structure of prosumers, driving a significant increase in the proportion of P2P electricity mutual assistance funds within the system to 7.7%. While perfectly achieving Pareto improvement in multi-entity economic benefits, it also achieves efficient synergy between economic and physical flows. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating the principle of this invention; Figure 2 This is a schematic diagram of the energy community framework in Example 1; Figure 3 This is a block diagram of the multi-tiered electricity trading price in the energy community in Example 1; Figure 4 This is a flowchart of the ADMM algorithm in Example 1; Figure 5 This is the topology diagram of the verification system in Example 1; Figure 6 It is the source load matching degree matrix of the source load prediction data in Example 1; Figure 7 This describes the power interaction of all trading combinations in Example 1 throughout the entire optimization period; Figure 8 This is a schematic diagram of the multi-tiered electricity pricing system for producers and consumers in Example 1. Detailed Implementation

[0020] The embodiments of the present invention will be further described below with reference to the accompanying drawings: Example 1: As Figure 1 As shown, the pricing method for energy community P2P transactions considering the matching degree of producer and consumer sources and loads includes the following steps: S1. Establish an energy community consisting of multiple decentralized producers and consumers, energy retailers, and the power distribution network within a local power distribution area; S2. Define the price used when producers and consumers trade electricity as the internal electricity price. Decouple the internal electricity price from the basic electricity price term and the incentive electricity price term to construct a producer-consumer electricity price model. S3. Introduce a discount factor for each producer's personalized energy consumption flexibility to construct an electricity price model for energy retailers; S4. Considering the maintenance cost of the photovoltaic power generation system, the electricity transaction cost between prosumers and energy retailers, the cost of prosumers participating in P2P energy transactions, the cost of prosumers participating in demand response, and the grid access fee charged by the distribution network to prosumers, construct a prosumer user model and define its objective function and constraints. S5. Considering the revenue generated by energy retailers from trading electricity with the distribution network, the revenue generated by energy retailers from trading electricity with prosumers, the agency fee revenue charged by energy retailers to prosumers, the charging and discharging costs of energy storage systems, and the maintenance costs of energy retailers' photovoltaic power generation systems, construct an energy retailer model and define its objective function and constraints. S6. The alternating direction multiplier method (ADMM) is used to solve the producer-consumer user model and the energy retailer model, and outputs the internal transaction electricity price for each time period, the optimal transaction electricity volume between producers-consumers and energy retailers, and the operating costs and incentive benefits of each entity.

[0021] The specific technical problems addressed by the method in this embodiment include: Existing P2P transaction pricing mechanisms are mostly based on a single supply-demand ratio or a uniform market clearing price, lacking consideration of the individual behavioral characteristics of prosumers. In the demand response phase, differences in users' historical participation and response enthusiasm are often ignored, resulting in a lack of targeted incentive effects in the pricing mechanism and difficulty in maximizing the adjustment potential of high-quality users. In the P2P mutual assistance process between prosumers, existing pricing models mostly focus only on the balance of power values, failing to fully quantify the physical matching degree of source-load time-series characteristics. The complementary differences between the renewable energy output curves and load curves of different prosumers directly affect the stable operation of the local power grid. Without price guidance signals based on source-load matching, it will be difficult to achieve efficient local consumption of distributed energy. Traditional centralized optimization methods face the curse of computational dimensionality and the risk of user privacy leakage when dealing with large-scale prosumer transactions, making it difficult to adapt to the future development needs of decentralized energy communities.

[0022] In this embodiment, the framework diagram of the energy community (multi-microgrid energy community system) is as follows: Figure 2 As shown, the energy community uses energy retailers as its core hub. On the one hand, it interacts with the upper-level main grid (distribution network) through the distribution network to achieve power purchase and sales and power balance between the energy community and the external grid. On the other hand, it interacts with multiple prosumers (i.e., user-side microgrids) within the energy community in two directions, sharing energy and information. Each prosumer integrates distributed photovoltaic, fixed load, and flexible load, enabling local source-load interaction and sharing of surplus power within the community. The energy retailer, relying on its own photovoltaic and energy storage systems, plays the role of supply and demand regulation, electricity price settlement, and transaction matching within the community. Ultimately, this forms a multi-microgrid energy community operation architecture characterized by "autonomous transactions by prosumers within the community, coordinated regulation by energy retailers, and flexible interaction with the distribution network."

[0023] In S1, producers and consumers achieve interconnection and power exchange through the distribution network. The fixed loads, flexible loads, and distributed power sources of producers and consumers participate in the internal transactions of the energy community. Energy retailers connect to the distribution network nodes through integrated energy storage converters. After the producers and consumers complete the internal power exchange, they carry out charging, discharging, and power purchase and sale operations with the producers and consumers and the distribution network respectively, based on the overall operation. The power exchange process transmits energy flow and information flow through the distribution network, forming a decentralized collaborative transaction architecture.

[0024] Establishing effective price signals within energy communities is crucial for incentivizing prosumers to actively participate in internal energy sharing and enhancing the local consumption of distributed renewable energy. Addressing the market disadvantage of prosumers due to price differences between buyers and sellers in traditional models, this paper proposes an innovative two-stage dynamic internal electricity price model, the prosumer-consumer price model. This model decouples the internal electricity price into a base price component and an incentive price component. The base price is anchored to the overall supply and demand status of the community and users' historical contributions, ensuring basic fairness and market efficiency in transactions. The incentive price component precisely quantifies and rewards users' actual contributions to the community's "source-load complementarity" goal, thereby linking individual energy consumption behavior with the community's operational optimization objectives.

[0025] In S2, the process of constructing the producer-consumer electricity price model is as follows: S2.1 According to the basic economic principles of a perfectly competitive market, price is negatively correlated with the supply-demand ratio. From a supply-demand perspective, a shared electricity price based on the supply-demand ratio is formulated. For the base electricity price, based on the self-optimized electricity surplus / deficit situation of each producer and consumer, all producers and consumers are divided into two categories: suppliers and demanders. The total supply and total demand of the shared market are defined as follows: (30); (31); (32); In the formula, , Let represent the total supply and total demand of electricity in the shared market during time period t, respectively. , These represent the electricity purchased and sold by producer-consumer n to energy retailers during time period t; , Let N and N represent the electricity purchased and sold by producer-consumer n to producer-consumer m during time period t; N is the total number of producers-consumers. Let t be the energy supply-demand ratio of the energy community during time period t; To prevent constants with a numerator or denominator of 0; Based on the differentiated power consumption adjustments of each prosumer, their contribution to the electricity sharing market is also a key factor influencing prosumer pricing. Including market contribution in the factors affecting internal electricity prices can increase the enthusiasm of users (prosumers) to participate in the energy community, effectively stimulating market competition. The reasonable mathematical modeling employed shows a positive correlation between contribution and internal electricity prices. For prosumer n, the proportion of its electricity sales within the energy community is defined as prosumer n's contribution to the market: (33); In the formula, The numerator represents the market contribution of producer-consumer n during time period t; the denominator represents the sum of electricity sold by producer-consumer n to other producer-consumers during time period t; and the denominator represents the sum of electricity sold by all producer-consumers to other producer-consumers.

[0026] The electricity price determined by the energy supply-demand ratio and market contribution is defined as the internal base electricity price for producers and consumers based on the energy community market status, as follows: when hour: (34); when hour: (35); In the formula, This represents the internal base price of electricity for producer-consumer n during time period t; , These represent the time-of-use electricity price and the purchase price of electricity from the energy retailer to the distribution network, respectively. The compensation price can be set as a fixed price based on historical transaction data of the energy community, time-of-use electricity price differences, and user acceptance. S2.2 To encourage active participation in internal energy trading within energy communities through electricity pricing, an incentive price based on source-load matching is proposed. The electricity consumption behavior of each producer-consumer in an energy community differs, resulting in varying source-load curves among them. Therefore, to fully consider the duality of microgrids and promote producer-consumer complementarity within multiple microgrids, a source-load matching index is proposed, taking into account both curve shape and distance, and quantified as an incentive term in the electricity price. To quantify the time-series energy complementarity characteristics of producers-consumers, the net power characteristic vector of producer-consumer n during the day-ahead dispatch phase is defined as follows: (36); (37); In the formula, Represents the net power eigenvector of producer-consumer n during time period t; They represent The net power of producers and consumers in time period n, where T represents the total number of time periods; This represents the net power of producer-consumer n during time period t; The symbol for vector transpose; The photovoltaic output is predicted n days prior to the production and consumption period t. The predicted load power of producers and consumers n days prior to time period t; Based on the producer-consumer source-load curve data within a day, the source-load matching degree is calculated using the Spearman rank correlation coefficient and Euclidean distance. ; When producer-consumer n acts as the electricity seller, the electricity price incentive is defined as follows: (38); (39); In the formula, The total power shortage for power consumer m during time period t; , These represent the optimized actual power consumption and photovoltaic power generation of producer-consumer m during time period t, respectively. This is a complementary incentive coefficient used to adjust the overall price and prevent it from being too high or too low; This represents the source-load matching degree between producer-consumer n and m; The amount of electricity transferred from surplus electricity consumer n to target electricity consumer m that is short of electricity; This represents the electricity price incentive term between producers and consumers n and m during time period t; In this embodiment, the photovoltaic output is predicted m days before the time period t. Add fluctuations to get .

[0027] S2.3, The internal electricity price for producer-consumer n is defined as follows: (40); In the formula, This represents the internal electricity price when producer-consumer n sells electricity to producer-consumer m during time period t. To encourage priority electricity trading between producers and consumers, the internal electricity price will be higher than the price sold to retailers.

[0028] Calculate source-load matching degree using Spearman rank correlation coefficient and Euclidean distance The process is as follows: Based on the producer-consumer source-load curve data within a day, the rank of each time period is calculated according to an arbitrary sorting rule, and the Spearman rank correlation coefficient is obtained by substituting it into the vector dimension. (41); In the formula, This represents the Spearman rank correlation coefficient between any two net power eigenvectors; Let be the difference in rank between the elements of the two net power feature vectors in time period t under the same sorting rule; take T=24h as an optimization period, and D as the vector dimension, with a value of 24; It reflects the similarity in shape between the two producers' and consumers' source-load curves (whether they increase or decrease together).

[0029] Find the Euclidean distance to the specified location: (42); In the formula, , These are the positions of the two net power eigenvectors in space; Indicates time period t , The Euclidean distance between corresponding points in space; The smaller the distance between the two producer-consumer source-load curves, the closer the actual power is.

[0030] Since the Spearman rank correlation coefficient only reflects the magnitude of the rank and ignores the amplitude differences of the original data, and the Euclidean distance only considers the distance and ignores the morphological similarity, in order to comprehensively measure the matching degree between source and load curves, a normalization method is used to eliminate dimensional differences after obtaining their Spearman rank correlation coefficients and Euclidean distance sets, and appropriate weighting coefficients are assigned to each to obtain the source-load matching degree. : (43); In the formula, , They represent The minimum and maximum values; These are the weighting coefficients.

[0031] In S3, the process of constructing the electricity price model for energy retailers is as follows: when At the same time, producers and consumers can obtain electricity price discounts by increasing consumption, and conversely, they can obtain discounts by decreasing consumption. This discount should be flexible and adjustable to keep electricity prices within a reasonable range. The discount factor is defined as: (44); (45); In the formula, This represents the discount factor for producer-consumer n during time period t; This is the discount factor; , , respectively, represent the power purchased and sold by energy retailers to the distribution network during time period t; sgn represents the sign function; Let be the electricity adjustment ratio of producer-consumer n in time period t. It is the ratio of the difference between the optimized power consumption and the predicted power to the predicted power, representing the adjustment ratio of the producer-consumer within its own limited power consumption. The optimized actual power consumption of producer-consumer n during time period t; Since electricity consumption behavior is closely related to electricity price levels, a discount factor based on the personalized energy consumption flexibility of each producer and consumer is used. This describes the relationship and guides producers and consumers to adjust their electricity consumption behavior to match regional supply and demand.

[0032] based on The electricity price that energy retailers sell to producers and consumers is: (46); In the formula, This represents the electricity price that an energy retailer sells to a prosumer (n) during time period t. This price reflects the discount that prosumers can receive from energy retailers by adjusting their electricity consumption behavior based on the energy supply and demand situation in the energy community.

[0033] In S4, within the energy trading market, prosumers act as load aggregators, equipped with photovoltaic power generation systems and various flexible loads. Prosumers can achieve local energy production-consumption balance by trading electricity with other prosumers and energy retailers. When making trading decisions, in addition to considering the cost of electricity purchase, it is also necessary to consider the comfort loss costs associated with demand response, photovoltaic maintenance costs, and agency fees charged by energy retailers. The objective function of the prosumer user model is: (47); In the formula, Let n be the total cost for prosumers over T time periods; The maintenance cost of the photovoltaic power generation system for producer-consumer n during time period t; The cost of electricity transactions between producer-consumer n and energy retailers during time period t; The cost for producer-consumer n to participate in P2P energy trading during period t; The cost of producer-consumer n participating in demand response during time period t; The network access fee charged by the distribution network to consumer n during time period t; For time intervals; The constraints of the producer-consumer user model include load adjustment power constraints, power trading power limit constraints, producer-consumer power balance constraints, and uniqueness constraints.

[0034] The calculation method is as follows: (48); In the formula, This represents the cost coefficient of a photovoltaic power generation system; This represents the photovoltaic power generation of producer n during time period t; The calculation method is as follows: (49); When consumer n acts as the electricity seller, This refers to the electricity price that producer-consumer n sells to energy retailers.

[0035] The calculation method is as follows: (50); In the formula, This represents the internal electricity price when producer-consumer m sells electricity to producer-consumer n during time period t; In this embodiment, the multi-tiered electricity trading price framework of the energy community is as follows: Figure 3 As shown. Figure 3 middle, This represents the internal electricity price when producer-consumer 1 sells electricity to producer-consumer 2 during time period t. This indicates the electricity price that consumer 1 pays to energy retailers. This represents the electricity price that an energy retailer sells to consumer 1 during time period t; the other symbols are similar.

[0036] The calculation method is as follows: (51); In the formula, This represents the comfort loss coefficient in demand response; The calculation method is as follows: (52); In the formula, This represents the cost coefficient for agency fees per unit power. The load adjustment power constraint is: (53); The power trading limit constraints are as follows: (54); (55); (56); (57); In the formula, , These represent the upper limit of the electricity power transferred from producer-consumer n to energy retailers during time period t; , These represent the upper limit of the electricity power transmission from producer-consumer n to producer-consumer m during time period t; At any given time period t, the electricity purchased by producer-consumer n from producer-consumer m should be equal to the electricity sold by producer-consumer m to producer-consumer n to ensure power balance in the transaction. The producer-consumer power balance constraint is: (58); (59); In the formula, This represents the electricity sold by producer-consumer m to producer-consumer n during time period t; Within the same time period t, each producer and consumer can only participate in the transaction as either a buyer or a seller of electricity, and the purchase and sale of energy should meet the uniqueness constraint: (60).

[0037] In S5, within the energy trading market, energy retailers act as coordinators and operators of energy transactions within a multi-prosumer energy community. Equipped with energy storage systems, they provide energy storage services to prosumers within the community. Energy retailers generate revenue through electricity transactions with the distribution network and prosumers. Furthermore, prosumers do not directly trade electricity with the distribution network; when their electricity demand cannot be met, they purchase electricity from energy retailers. When the energy storage system cannot meet the community's electricity demand, the energy retailer, acting as an intermediary, then trades electricity with the distribution network to achieve supply and demand balance within the energy community. The energy retailer's goal is to maximize its own profits and achieve a prosumer-consumption balance within the energy community. The objective function of the energy retailer model is: (61); In the formula, This represents the total trading revenue of an energy retailer over T time periods; This represents the revenue generated by energy retailers trading electricity with the distribution network during time period t; This represents the revenue generated by energy retailers trading electricity with producers and consumers during time period t; This represents the agency fee revenue that energy retailers collect from consumers during period t. This represents the charging and discharging cost of the energy storage system during time period t. This represents the maintenance cost of a photovoltaic power generation system for an energy retailer during time period t; The constraints of the energy retailer model include energy retailer power balance constraints, charging and discharging power constraints, charging or discharging constraints, and shared energy storage state of charge constraints.

[0038] The calculation method is as follows: (62); The calculation method is as follows: (63); In the formula, , These represent the electricity purchased and sold by energy retailers to consumer n during time period t. The calculation method is as follows: (64); The calculation method is as follows: (65); In the formula, The degradation cost factor for energy storage batteries (CNY / kWh); , These represent the charging and discharging power of the energy storage system during time period t; The calculation method is as follows: (66); In the formula, This represents the photovoltaic power generation capacity of energy retailers during time period t; The power balance constraint for energy retailers is: (67); The energy storage system can only charge or discharge at any given time, and the charging and discharging power constraints are as follows: (68); (69); In the formula, , These represent the maximum charging and discharging power of the energy storage system; The charging or discharging constraints are: (70); Shared energy storage state of charge constraints are: (71); (72); (73); In the formula, , These represent the state of charge of the shared energy storage at time periods t and t-1, respectively. , These represent the charge / discharge efficiency coefficients of the shared energy storage battery; , These represent the state of charge at the beginning and end of the optimization cycle, respectively; , These represent the upper and lower limits of the energy storage battery capacity.

[0039] In S6, the alternating direction multiplier method is used to perform distributed collaborative solutions for the producer-consumer user model and the energy retailer model. The overall energy community-level optimization problem is decomposed into two sub-problems: the producer-consumer side and the energy retailer side. Convergence is achieved by iteratively updating the coupling variables. The specific solution process is as follows: Step 1: Construct the augmented Lagrangian function, which involves defining the local variable sets of producers and consumers and the local variable sets of energy retailers, constructing system coupling constraints based on the power balance constraints of P2P and the power balance constraints of energy retailers, introducing Lagrange multipliers and penalty factors, and establishing penalty terms for the buying and selling directions to construct the augmented Lagrangian function.

[0040] Step 2: Prosumer-consumer distributed optimization, which uses the ADMM algorithm to decouple the augmented Lagrangian function. After receiving the transaction power decision from the previous round, each prosumer updates its local decision variables with the goal of minimizing its own overall cost, thus achieving distributed optimization solution.

[0041] Step 3: Energy retailer optimization, which involves the energy retailer collecting the electricity purchase and sale declarations from each producer and consumer, solving the corresponding sub-problems with the goal of maximizing its own revenue, and updating the energy retailer's transaction decision variables.

[0042] Step 4: Update the dual variables, that is, update the system's dual variables based on the coupling variable deviation of the interaction between prosumers and energy retailers in the current iteration round.

[0043] Step 5: Dynamically update the electricity price parameters, that is, use the transaction results of the current round to update the price parameters in the next round of the producer-consumer sub-problem. This includes calculating the current supply-demand ratio and market contribution, and calculating the source-load matching degree and the actual transaction volume of this round based on the day-ahead forecast source-load data to update the P2P incentive electricity price, and then synthesize a new round of internal electricity price.

[0044] Step 6: Convergence determination, that is, calculate and determine whether the original residual and the dual residual satisfy the set convergence conditions. If they are satisfied, the algorithm converges and outputs the optimal scheduling scheme. If they are not satisfied, return to step 2 to continue the next iteration.

[0045] In this embodiment, each parameter (coefficient) can be selected and set according to actual needs or historical data. Preferred values ​​are as follows: Table 1 Optimal Parameter Settings

[0046] The YALMIP toolbox in the MATLAB 2023b simulation platform was used to solve the established model, and the CPLEX 12.9 solver was called. The solution process is as follows: Figure 4As shown, the ADMM algorithm starts by initializing the number of iterations k and inputting basic data such as the grid electricity price, photovoltaic power output forecast, and electricity load forecast. It then solves the energy retailer side problem and shares the optimized electricity price and power purchase and sale information with the prosumers. Next, it solves the prosumer side problem and feeds back its own power purchase and sale plan to other entities. Then, it determines whether the convergence condition is met. If it does not converge, it updates the Lagrange multipliers and the community electricity sharing price and enters the next iteration until the convergence condition is met, and finally obtains the optimal operation and trading scheme for each entity.

[0047] The verification process involved introducing a P2P trading architecture for an energy community consisting of five prosumers (two residential prosumers (RB), two commercial prosumers (CB), and one office prosumer (OB)) and an energy retailer to verify the feasibility and effectiveness of the established model. The scheduling interval was 1 hour, and the optimization cycle was 24 hours. Each prosumer was equipped with fixed loads, flexible loads, and photovoltaic power generation systems. The verification system topology is shown below. Figure 5 As shown.

[0048] Source-load matching matrix based on current producer-consumer source-load forecast data ( )like Figure 6 As shown, the obtained matching degree index matrix provides transaction guidance for the energy community. Taking producer-consumer 4 as an example for analysis, the source-load matching degree of producer-consumer 4 (RB1) and producer-consumer 5 (RB2) is 0.632, which is higher than that of other producer-consumers. Therefore, in the multi-level electricity pricing system, the electricity price sold by producer-consumer 4 to producer-consumer 5 is higher. At the same time, this transaction combination is the best combination. Under the guidance of the matching degree matrix, the seller producer-consumer can reduce information complexity, simplify the information processing process, and obtain higher electricity sales benefits. Other transaction combinations are sorted by source-load matching degree as producer-consumer 2, producer-consumer 1, and producer-consumer 3.

[0049] Figure 7 The power interaction of all trading combinations throughout the optimization period shows that, during the optimization scheduling period, producer-consumer 4 is more inclined to trade electricity with producer-consumer 5 to maximize its own revenue, demonstrating the feasibility and effectiveness of the personalized electricity price model proposed in this embodiment.

[0050] To further analyze the relationship between the electricity trading behavior of various entities and negotiated electricity prices, this embodiment constructs various models to compare and analyze the electricity prices generated by P2P transactions between producers and consumers. The electricity price sold by producers and consumers to energy retailers, i.e., the basic electricity price within the producer-consumer system ( ) and the electricity price charged by energy retailers to producers and consumers ( A multi-tiered electricity pricing system is formed by ( ).

[0051] Taking producer-consumer 4 as an example, the negotiation results with other producer-consumers are as follows: Figure 8 As shown. By Figure 8 It can be seen that the electricity prices for each time period negotiated and determined by Producer-Consumer 4 and other entities are all within the envelope range of the main grid electricity sales price and the electricity purchase price, proving that the introduction of the personalized electricity price model can guarantee the income of all parties in the P2P transaction.

[0052] To verify the effectiveness of the personalized electricity pricing model, and to analyze the impact of P2P transactions considering source-load matching on producer-consumer revenue and source-load balance, the following simulation scenario was set up: Scenario 1: There is no P2P transaction between producers and consumers. Each producer and consumer is an independent interest entity and only trades electricity with energy retailers. The transaction price adopts the grid time-of-use electricity price.

[0053] Scenario 2 allows P2P electricity trading between producers and consumers. Energy retailers introduce a price-based demand response mechanism that considers discount factors. The electricity price for P2P transactions between demand-side producers and consumers adopts a base price based on market conditions (considering only the energy supply-demand ratio and market contribution).

[0054] Scenario 3: Based on Scenario 2, an incentive electricity price based on source-load matching degree is set in the producer-consumer P2P transaction, and producers and consumers conduct electricity transactions through multiple differentiated electricity prices.

[0055] Table 2 Comparison of Prosumer Costs in Different Scenarios

[0056] Compared to Scenario 1, Scenario 2 introduces a basic P2P electricity trading and demand response mechanism. Table 2 shows that total operating costs for prosumers decreased by 7.36%, while energy retailers' revenue decreased by 9.39%. This indicates that electricity sharing within the open system can initially reduce end-user energy costs and decrease reliance on the main grid; however, due to the lack of precise guidance on the complementary characteristics of various stakeholders in the unified pricing mechanism, the potential for resource allocation and cost reduction / efficiency improvement has not yet been fully realized.

[0057] Compared to scenarios 1 and 2, scenario 3 (the method in this embodiment) introduces an incentive pricing strategy based on source-load matching in P2P transactions. Under this mechanism, the total cost for prosumers further decreased significantly by 10.49%, while the revenue of energy retailers decreased by only 7.96%. On the other hand, with the introduction of P2P transactions and the source-load matching incentive pricing mechanism, the growth rate of the cumulative cost reduction for prosumers is significantly higher than the growth rate of the cumulative profit concessions by energy retailers. Specifically, scenario 3 proposed in this embodiment further deepens the mutual assistance between prosumers and consumers compared to scenario 2. Under the condition that energy retailers concede 368.95 yuan of profit, the total operating cost of the prosumer group is significantly reduced by 935.03 yuan, and the cost reduction benefit per unit of profit concession reaches 2.53 times. This result shows that the personalized pricing mechanism established in this embodiment effectively overcomes the limitations of zero-sum game among multiple stakeholders. By coupling price signals with the underlying source-load physical complementarity characteristics, Pareto improvement in overall economic benefits is achieved with extremely low platform profit concessions.

[0058] Example 2: A pricing device for energy community P2P transactions considering the matching degree of producer and consumer source load, comprising: One or more processors; Memory, used to store one or more computer programs; When one or more programs are executed by one or more processors, the one or more processors execute the method in Example 1.

[0059] Example 3: A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the method in Example 1.

Claims

1. A pricing method for energy community P2P transactions that considers the matching degree of producer-consumer source load, characterized in that... Includes the following steps: S1. Establish an energy community consisting of multiple decentralized producers and consumers, energy retailers, and the power distribution network within a local power distribution area; S2. Define the price used when producers and consumers trade electricity as the internal electricity price. Decouple the internal electricity price from the basic electricity price term and the incentive electricity price term to construct a producer-consumer electricity price model. S3. Introduce a discount factor for each producer's personalized energy consumption flexibility to construct an electricity price model for energy retailers; S4. Considering the maintenance cost of the photovoltaic power generation system, the electricity transaction cost between prosumers and energy retailers, the cost of prosumers participating in P2P energy transactions, the cost of prosumers participating in demand response, and the grid access fee charged by the distribution network to prosumers, construct a prosumer user model and define its objective function and constraints. S5. Considering the revenue generated by energy retailers from trading electricity with the distribution network, the revenue generated by energy retailers from trading electricity with prosumers, the agency fee revenue charged by energy retailers to prosumers, the charging and discharging costs of energy storage systems, and the maintenance costs of energy retailers' photovoltaic power generation systems, construct an energy retailer model and define its objective function and constraints. S6. The alternating direction multiplier method is used to solve the producer-consumer user model and the energy retailer model, and outputs the internal transaction electricity price, the optimal transaction electricity volume between producers and consumers and energy retailers for each time period, as well as the operating costs and incentive benefits of each entity.

2. The energy community P2P transaction pricing method considering producer-consumer source-load matching degree according to claim 1, characterized in that, In S1, producers and consumers achieve interconnection and power exchange through the distribution network. The fixed loads, flexible loads, and distributed power sources of producers and consumers participate in the internal transactions of the energy community. Energy retailers connect to the distribution network nodes through integrated energy storage converters. After the producers and consumers complete the internal power exchange, they carry out charging, discharging, and power purchase and sale operations with the producers and consumers and the distribution network respectively, based on the overall operation. The power exchange process transmits energy flow and information flow through the distribution network, forming a decentralized collaborative transaction architecture.

3. The energy community P2P transaction pricing method considering producer-consumer source-load matching degree according to claim 1, characterized in that, In S2, the process of constructing the producer-consumer electricity price model is as follows: S2.1 For the base electricity price item, based on the electricity surplus and deficit situation optimized by each producer and consumer, all producers and consumers are divided into two categories: suppliers and demanders. The total supply and total demand of the shared market are defined as follows: (1); (2); (3); In the formula, , Let represent the total supply and total demand of electricity in the shared market during time period t, respectively. , These represent the electricity purchased and sold by producer-consumer n to energy retailers during time period t; , Let N and N represent the electricity purchased and sold by producer-consumer n to producer-consumer m during time period t; N is the total number of producers-consumers. Let t be the energy supply-demand ratio of the energy community during time period t; To prevent constants with a numerator or denominator of 0; For producer-consumer n, the proportion of electricity sales within the energy community is defined as producer-consumer n's contribution to the market: (4); In the formula, This represents the market contribution of producer-consumer n during time period t; The electricity price determined by the energy supply-demand ratio and market contribution is defined as the internal base electricity price for producers and consumers based on the energy community market status, as follows: when hour: (5); when hour: (6); In the formula, This represents the internal base price of electricity for producer-consumer n during time period t; , These represent the time-of-use electricity price and the purchase price of electricity from the energy retailer to the distribution network, respectively. Indicates the compensation price; S2.2 For the incentive price term, the net power characteristic vector of producer-consumer n during the day-ahead dispatch phase is defined as: (7); (8); In the formula, Represents the net power eigenvector of producer-consumer n during time period t; They represent The net power of producers and consumers in time period n, where T represents the total number of time periods; This represents the net power of producer-consumer n during time period t; The symbol for vector transpose; The photovoltaic output is predicted n days prior to the production and consumption period t. The predicted load power of producers and consumers n days prior to time period t; Based on the producer-consumer source-load curve data within a day, the source-load matching degree is calculated using the Spearman rank correlation coefficient and Euclidean distance. ; When producer-consumer n acts as the electricity seller, the electricity price incentive is defined as follows: (9); (10); In the formula, The total power shortage for power consumer m during time period t; , These represent the optimized actual power consumption and photovoltaic power generation of producer-consumer m during time period t, respectively. These are complementary incentive coefficients; This represents the source-load matching degree between producer-consumer n and m; The amount of electricity transferred from surplus electricity consumer n to target electricity consumer m that is short of electricity; This represents the electricity price incentive term between producers and consumers n and m during time period t; S2.3, The internal electricity price for producer-consumer n is defined as follows: (11); In the formula, This represents the internal electricity price when producer-consumer n sells electricity to producer-consumer m during time period t.

4. The energy community P2P transaction pricing method considering producer-consumer source-load matching degree according to claim 3, characterized in that, In S2, the source-load matching degree is calculated using the Spearman rank correlation coefficient and Euclidean distance. The process is as follows: Based on the producer-consumer source-load curve data within a day, the rank of each time period is calculated according to an arbitrary sorting rule, and the Spearman rank correlation coefficient is obtained by substituting it into the vector dimension. (12); In the formula, This represents the Spearman rank correlation coefficient between any two net power eigenvectors; denoted as the difference in rank between the elements of the two net power feature vectors in time period t under the same sorting rule; D is the vector dimension, with a value of 24. Find the Euclidean distance to the specified location: (13); In the formula, , These are the positions of the two net power eigenvectors in space; Indicates time period t , The Euclidean distance between corresponding points in space; A normalization method is used to eliminate dimensional differences and obtain the source-load matching degree. : (14); In the formula, , They represent The minimum and maximum values; These are the weighting coefficients.

5. The energy community P2P transaction pricing method considering producer-consumer source-load matching degree according to claim 3, characterized in that, In S3, the process of constructing the electricity price model for energy retailers is as follows: when When the discount factor is defined as: (15); (16); In the formula, This represents the discount factor for producer-consumer n during time period t; This is the discount factor; , , respectively, represent the power purchased and sold by energy retailers to the distribution network during time period t; sgn represents the sign function; The electricity consumption adjustment ratio for producer-consumer n during time period t; The optimized actual power consumption of producer-consumer n during time period t; based on The electricity price that energy retailers sell to producers and consumers is: (17); In the formula, This represents the electricity price that energy retailers sell to consumers n during time period t.

6. The energy community P2P transaction pricing method considering producer-consumer source-load matching degree according to claim 5, characterized in that, In S4, the objective function of the prosumer user model is: (18); In the formula, Let n be the total cost for prosumers over T time periods; The maintenance cost of the photovoltaic power generation system for the producer and consumer n during time period t; The cost of electricity transactions between producer-consumer n and energy retailers during time period t; The cost for producer-consumer n to participate in P2P energy transactions during time period t; The cost for producer-consumer n to participate in demand response during time period t; The network access fee charged by the distribution network to consumer n during time period t; For time intervals; The constraints of the producer-consumer user model include load adjustment power constraints, power trading power limit constraints, producer-consumer power balance constraints, and uniqueness constraints.

7. The energy community P2P transaction pricing method considering producer-consumer source-load matching degree according to claim 6, characterized in that, The calculation method is as follows: (19); In the formula, This represents the cost coefficient of a photovoltaic power generation system; This represents the photovoltaic power generation of producer n during time period t; The calculation method is as follows: (20); The calculation method is as follows: (21); In the formula, This represents the internal electricity price when producer-consumer m sells electricity to producer-consumer n during time period t; The calculation method is as follows: (22); In the formula, This represents the comfort loss coefficient in demand response; The calculation method is as follows: (23); In the formula, This represents the cost coefficient for agent fees per unit power.

8. The energy community P2P transaction pricing method considering producer-consumer source-load matching degree according to claim 7, characterized in that, In S5, the objective function of the energy retailer model is: (24); In the formula, This represents the total trading revenue of an energy retailer over T time periods; This represents the revenue generated by energy retailers trading electricity with the distribution network during time period t; This represents the revenue generated by energy retailers trading electricity with producers and consumers during time period t; This represents the agency fee revenue that energy retailers collect from consumers during period t. This represents the charging and discharging cost of the energy storage system during time period t. This represents the maintenance cost of a photovoltaic power generation system for an energy retailer during time period t; The constraints of the energy retailer model include energy retailer power balance constraints, charging and discharging power constraints, charging or discharging constraints, and shared energy storage state of charge constraints.

9. The energy community P2P transaction pricing method considering producer-consumer source-load matching degree according to claim 8, characterized in that, The calculation method is as follows: (25); The calculation method is as follows: (26); In the formula, , These represent the electricity purchased and sold by energy retailers to consumer n during time period t. The calculation method is as follows: (27); The calculation method is as follows: (28); In the formula, This is the degradation cost coefficient for energy storage batteries; , These represent the charging and discharging power of the energy storage system during time period t; The calculation method is as follows: (29); In the formula, This represents the photovoltaic power generation capacity of energy retailers during time period t.

10. The energy community P2P transaction pricing method considering producer-consumer source-load matching degree according to claim 9, characterized in that, In S6, the alternating direction multiplier method is used to solve the producer-consumer user model and the energy retailer model in a distributed and collaborative manner, decomposing the overall optimization problem at the energy community level into two sub-problems on the producer-consumer side and the energy retailer side, and achieving convergence by iteratively updating the coupling variables.