Urban power grid two-stage transaction mechanism design method and device oriented to light storage resource cluster division

By optimizing the K-means algorithm and the configuration of photovoltaic and energy storage resource clusters, and combining it with the two-step electricity pricing mechanism to optimize the urban power grid trading mechanism, the voltage control and management challenges of distributed resource access to the urban power grid have been solved, thereby improving the stability and economy of the power grid.

CN121120106APending Publication Date: 2025-12-12STATE GRID INFORMATION & TELECOMM GRP CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511209030.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-27
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing technologies for connecting distributed resources to urban power grids suffer from problems such as complex voltage control, increased network losses, high management difficulty, and insufficient overall efficiency and stability, and lack consideration for economic factors.

Method used

An optimized K-means algorithm is used to partition distributed resources into clusters. Combined with photovoltaic and energy storage resource allocation and two-step electricity pricing, the urban power grid trading mechanism is optimized. Through the coordinated operation of photovoltaic power generation and energy storage systems, the system's dependence on external energy sources is reduced, and the stability and economy of the power grid are improved.

Benefits of technology

It has improved the stability and efficiency of distributed resource access to the urban power grid, reduced the system burden, enhanced the flexibility and reliability of the power grid, increased users' enthusiasm for participating in ancillary services, and maximized the aggregator's revenue.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121120106A_ABST
    Figure CN121120106A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of access of distributed resources to an urban power grid, and discloses an urban power grid two-stage transaction mechanism design method and device oriented to optical storage resource cluster division, and the method comprises the steps: carrying out the cluster division of the distributed resources of a power grid through employing an optimized K-means algorithm based on the physical characteristics of the distributed resources; based on a distributed resource cluster division and operation mechanism, establishing optical storage resource cluster configuration; based on two-step electricity price, distributed resource cluster division and optical storage resource cluster configuration, an urban power grid transaction mechanism is optimized. According to the method, the problem of cooperative interaction of the distributed resources and the power grid can be effectively solved, the two-step electricity price control is cooperated, the industry barrier is effectively broken, the defects of the overall efficiency and stability of the current distributed resources accessing the urban power grid are made up, and a guarantee is provided for the stability and efficiency of the distributed resources accessing the urban power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of distributed resource access to urban power grid technology, specifically relating to a design method and device for a two-stage trading mechanism for urban power grids oriented towards the partitioning of photovoltaic and energy storage resource clusters. Background Technology

[0002] With the rapid development of distributed power generation in my country in recent years, the drawbacks of traditional centralized power plants have become increasingly apparent. Problems such as high construction costs, high power transmission costs to remote areas, high operational difficulty, and high resource waste have emerged. These issues can be effectively alleviated and compensated for through distributed power generation. Furthermore, due to the relatively small power capacity of individual distributed power sources, compared to centralized power generation, distributed power generation offers advantages such as shorter construction cycles, lower investment costs, lower risks, and easier maintenance and repair, making it increasingly attractive to investors.

[0003] Despite the numerous advantages of distributed generation, the increasing penetration of distributed resources into the grid is transforming urban power grids from traditional single-source radial power supply networks to bidirectional active grids, making voltage control increasingly complex. On one hand, the highly volatile and random nature of distributed photovoltaic (PV) output can affect power flow changes in areas where PV is connected, leading to problems such as reverse power flow and reduced voltage quality in urban power grids. On the other hand, the active power output characteristics of random resources like PV deviate from user load characteristics, causing a "duck curve" phenomenon. This shifts the lowest load period of the urban power grid from nighttime to daytime, resulting in voltage exceeding limits and threatening the safe and stable operation of the power system. Furthermore, the grid connection of distributed resources can also increase node voltage amplitude, raise the load rate of adjacent lines, increase network losses, and affect the economic efficiency of grid operation.

[0004] Currently, to achieve coordinated interaction between distributed resources and the power grid, some research has been conducted on the rational utilization and maximization of the potential of distributed resources. For example, the paper "Photovoltaic-Storage Site Selection and Capacity Determination in Urban Power Grids Considering Photovoltaic Scenarios" proposes an improved K-means++ algorithm to aggregate and analyze historical distributed resource data to establish a multi-objective model for photovoltaic-storage site selection and capacity determination. This model can accurately characterize the uncertainty of distributed resources. However, it lacks balanced consideration of various aspects such as the consumption side and does not take into account the economic factors of different stakeholders. As a result, the results lack consideration of economic factors, leading to excessively high costs and hindering the application and promotion of the solution. Furthermore, since traditional power grids are designed for centralized power generation, they are well-suited for centralized and stable power management. In grid edge areas, the large-scale application of distributed photovoltaics increases the management difficulty of the power grid, including the planning of distributed resources and clustered urban power grids. This cannot compensate for the current shortcomings in the overall efficiency and stability of distributed resource integration into urban power grids.

[0005] Therefore, how to consider the physical characteristics of distributed resources and their operational mechanisms to achieve the stability and efficiency of distributed resources connecting to the urban power grid is an urgent problem to be solved. Summary of the Invention

[0006] To address the aforementioned technical issues, this invention provides a two-stage trading mechanism design method for urban power grids oriented towards the partitioning of photovoltaic and energy storage resource clusters. Considering the issue of coordinated interaction between distributed resources and the power grid, and based on the clustering of distributed resources and the configuration of photovoltaic and energy storage resource clusters, it coordinates two-step electricity pricing, effectively breaking down industry barriers and compensating for the current shortcomings in the overall efficiency and stability of distributed resource access to urban power grids, thus providing a guarantee for the stability and efficiency of distributed resource access to urban power grids.

[0007] The present invention provides a two-stage trading mechanism design method for urban power grids oriented towards the partitioning of photovoltaic and energy storage resource clusters, comprising:

[0008] Based on the physical characteristics of distributed resources, the optimized K-means algorithm is used to partition the distributed resources of the power grid into clusters.

[0009] Based on the distributed resource cluster partitioning and operation mechanism, establish a photovoltaic-storage resource cluster configuration;

[0010] Based on two-step electricity pricing, distributed resource cluster allocation, and photovoltaic-storage resource cluster configuration, the urban power grid trading mechanism is optimized.

[0011] Furthermore, based on the physical characteristics of distributed resources, an optimized K-means algorithm is used to partition the distributed resources of the power grid into clusters, including:

[0012] Let the sample data of distributed resource photovoltaic power generation be M = {x1, x2, ..., x}. a ,…,x b ,…,x m}, x a ,x b ∈R n ; m represents the number of sample points in the dataset, i.e., the total number of objects to be clustered; R n This represents the feature space containing all sample points, where each sample point is a point in this space; Nc clusters are determined, and initially, Nc samples are defined as the initial cluster centers z1, z2, ..., zc. Nc ;

[0013] 1) Presuppose all samples are cluster centers, where x represents one sample point in the sample data M. a1 For sample point x a The first eigenvalue, x b1 For sample point x bThe first feature value; calculate the Euclidean distance between each aggregated sample:

[0014]

[0015] 2) Calculate the average distance between clustered samples and select it as the bandwidth parameter for the algorithm; where, For two samples randomly selected from the sample, The average distance, or bandwidth parameter, is the average distance between all sample pairs, and serves as the threshold for the subsequent "window radius".

[0016]

[0017] 3) Define the window as a circular neighborhood with any potential center point (i.e., cluster center) in the sample data as the center and the bandwidth parameter as the radius, to define the set of data points within the spatial range; This is an indicator function used to mark points that fall within the window; The number of sample points within the statistical window; p is any sample point in the sample data used as the potential center of the window; p i For sample points in the sample data excluding potential centroids; |p i -p| represents the sample point p i Euclidean distance between center points p; in terms of bandwidth parameter Calculate the data points within the window centered on the cluster center, using the radius as the basis:

[0018]

[0019] 4) Take the cluster sample with the most data points in the window as the aggregation center of the class, and at the same time, regard all data points in the window as points that converge to the same centroid and thus belong to the same cluster. In the subsequent calculation process, remove the above data points from the total sample.

[0020] 5) Repeat 3) 4) Update the cluster centers of the clusters according to 4) and stop the algorithm after redetermining all Nc cluster center points.

[0021] By calculating the similarity of the output characteristic curves of different distributed resource nodes at different time points, aggregation indices can be used for calculation and normalization, thereby aggregating distributed resource systems with similar output characteristics into the same cluster. Ensuring the consistency of power generation characteristics among distributed resource systems within a cluster helps optimize subsequent photovoltaic and energy storage resource allocation and grid trading mechanisms, reducing system burden.

[0022] Furthermore, based on the distributed resource cluster partitioning and operation mechanism, a photovoltaic-storage resource cluster configuration is established, including:

[0023] The distributed resources of the power grid include not only photovoltaic (PV) systems but also energy storage systems. When operating distributed resource systems, energy storage systems are directly deployed near PV power plants to store excess PV power in real time, reducing power generation fluctuations caused by changes in sunlight and ensuring stable power supply from distributed resources. The energy storage system model considers its own parameters:

[0024]

[0025] In the formula: cluster k represents the k-th cluster after cluster partitioning; Let N be the capacity of the energy storage system in cluster k at time t, where k = 1, 2, ..., N. C ; Let be the capacity of the energy storage system in cluster k at time t-Δt, where Δt is the "smallest time unit" that discretizes continuous time, i.e., the time interval. Let be the output power of the energy storage system in cluster k at time t; Let be the minimum capacity of the energy storage system in cluster k; η represents the maximum capacity of the energy storage system in cluster k; EES The charging and discharging conversion efficiency of the energy storage system; t0 is the time of the last scheduling instruction; Let be the state of charge of the energy storage system in cluster k at time t; This refers to the installed capacity of the energy storage system;

[0026] The interaction between distributed solar resources and the power grid also needs to consider the construction investment costs, operation and maintenance costs, peak-valley arbitrage benefits, and basic electricity cost reduction benefits of the distributed photovoltaic and energy storage systems, and construct its overall economic model accordingly.

[0027] The investment cost model for distributed photovoltaic and energy storage systems is as follows:

[0028]

[0029] In the formula, C inv Investment costs for distributed photovoltaic and energy storage; μ PV μ ESB These are the discount rates for distributed photovoltaic power and energy storage, respectively; y PV y ESB These refer to the service life of distributed photovoltaic power and energy storage, respectively. These are the unit capacity investment costs for distributed photovoltaic power and energy storage, respectively. Planned construction capacity for distributed photovoltaic power; For grid-connected energy storage capacity;

[0030] The operation and maintenance cost model for distributed photovoltaic and energy storage systems is as follows:

[0031]

[0032] In the formula, C op The operation and maintenance costs of distributed photovoltaic and energy storage systems; δ ess The unit curtailment cost of distributed photovoltaic power; P ab (t) represents the predicted curtailment power of distributed photovoltaic power at time t; α is the conversion ratio of operation and maintenance costs; k re For energy storage replacement rate; t end This is the end time of the calculation cycle;

[0033] The basic electricity cost reduction benefit model for distributed photovoltaic and energy storage systems is as follows:

[0034]

[0035] In the formula, n represents the number of operating days of the energy storage system in a year; δ price P is the real-time electricity price at time t; out P represents the discharge power of the energy storage system. in The charging power of the energy storage system; Δt is the time interval; The annual basic electricity cost reduction revenue of energy storage systems through charge and discharge optimization;

[0036] Establish a peak-valley arbitrage model:

[0037]

[0038] In the formula, f1 is the annual net value; Reduced investment due to lower transformer capacity; μ t S represents the unit capacity cost of the transformer. t S represents the planned capacity of the transformer. t ′ represents the planned capacity of transformers with energy storage function; Residual value recovery income; μ r This is the residual value recovery factor; Cost of energy storage systems; For civil engineering and installation costs; μ p Cost per unit power of the energy storage system; μ E Cost per unit capacity of the energy storage system; The rated power of the energy storage system; μ b This is a cost factor for civil engineering and installation, typically ranging from 3% to 10%.

[0039] Furthermore, based on the distributed resource cluster partitioning and operation mechanism, the allocation of photovoltaic and energy storage resource clusters is established. This also includes considering the safe and stable operation of the distributed resource system, ensuring a balance between load power, energy storage power, and power obtained from the main power grid. The formula is as follows:

[0040]

[0041] In the formula, SOC t and SOC t-1 These represent the energy stored at time t and time t-1, respectively. and These are the lower and upper limits of energy storage charging power, respectively. and These are the lower and upper limits of the energy storage discharge power, respectively; SOC min and SOC max These are the lower and upper limits of energy storage capacity, respectively; P t g It is the power obtained from the real-time power grid; P t d It is the discharge power of the energy storage system; P t c It is the charging power of the energy storage system; P t l It is the real-time load power of the energy storage system.

[0042] Furthermore, based on the two-step electricity pricing system, the allocation of distributed resource clusters, and the configuration of photovoltaic and energy storage resource clusters, the optimization of the urban power grid trading mechanism includes:

[0043] The concept of reliability level is introduced to capture the uncertainty of power supply during the operation of distributed resources. The reliability level is represented by a random variable τ, which represents the probability that the energy storage system will meet the contract energy requirements during the contract period. These are the sales prices for small-scale, medium-scale, and large-scale distributed resources, respectively.

[0044] For peak demand scenarios, the utility function (i.e., benefit minus cost) of small distributed resources can be expressed as:

[0045]

[0046] In the formula: d′ i It means that when peak demand occurs, resources are obtained from distributed resources according to the contract. i The electricity price payable for a certain amount of electricity. For the electricity volume s stipulated in the supply contract i The cost, The ratio of the corrected selling price to the unit production cost of the energy storage system, (1-τ) s )s i λ′ RTP For small-scale distributed resources, the electricity gap cost is the cost of distributed resources i whose resource sales price is within the cluster with cluster center i. Let λ′ be the total cost of distributed resource i. RTP τ is the price of obtaining electricity from the grid when peak demand occurs. s This refers to the reliability level of small-scale distributed resources.

[0047] Similarly, for this situation, the utility functions for medium-sized distributed resources and large-scale distributed resources are as follows:

[0048]

[0049] In the formula: e′ j To obtain m from distributed resources according to the contract under peak conditions j The amount of electricity required; f′ g To obtain resources from distributed resources in accordance with the contract during peak conditions g The amount of electricity required for payment; τ m and τ l These represent the reliability levels of medium-sized and large-scale distributed resources, respectively.

[0050] To derive the optimal trading strategy for aggregators under peak demand scenarios, the following constraints need to be defined: electricity price, cost, supply capacity of distributed resources, and total power demand in cluster k; as shown in the following equation.

[0051]

[0052] In the formula: W′ is the case of cluster k. k n′ represents the total peak hourly power demand of the aggregator. i,k , n′ j,k and n′ h,k The number of distributed resources i, j, and h that respectively meet the peak load demand; and These are the expenditures of the aggregator when it obtains the quantities of electricity s1, m1, and l1 from small, medium, and large distributed resources, respectively. and The aggregator purchases s from distributed resources respectively i,k m j,k and l h,k The expenditure per unit of electricity; S, M, and L represent the number of small-scale distributed resources, medium-scale distributed resources, and large-scale distributed resources, respectively.

[0053] Considering all types of distributed resources and constraints, the optimal contract for the aggregator in the peak load scenario of cluster k can be obtained by the following formula:

[0054]

[0055] In the formula: R(s) i ), R(m j ) and R(l h ) respectively, aggregators obtain s from small-scale distributed resources, medium-scale distributed resources, and large-scale distributed resources. i m j and l h The benefit after the quantity of electricity; n i n j and n h These represent the quantities of distributed resources i, j, and h, respectively; U′ A,k For the benefit of aggregators.

[0056] The present invention also provides a design device for a two-stage trading mechanism for urban power grids oriented towards the partitioning of photovoltaic and energy storage resource clusters, including a data acquisition module, a data transmission module, and a data analysis and processing module;

[0057] The data acquisition module is used to collect power generation data related to distributed resources;

[0058] The data transmission module is used to transmit the collected data to the central processing platform via wired or wireless network to ensure the real-time performance and integrity of the data.

[0059] The data analysis and processing module is used to divide the power generation data of distributed resources into clusters, configure photovoltaic and energy storage resource clusters, and optimize the trading mechanism. It aggregates distributed resource systems with similar output characteristics into the same cluster to ensure the consistency of power generation characteristics of distributed resource systems within the cluster.

[0060] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the present invention.

[0061] The beneficial effects of this invention are as follows: The method described in this invention fully considers the physical characteristics of distributed resources, compensating for the volatility of distributed resource output and the inconsistency of data after cluster partitioning; the proposed configuration of photovoltaic-storage resource clusters considering distributed resources and operation mechanisms, based on the results of distributed resource clustering analysis, effectively regulates the output power of renewable energy, reducing the system's dependence on external energy; the proposed optimized urban power grid trading mechanism improves the economic efficiency of the power system through two-step electricity pricing, and also enhances the system's flexibility and reliability. The method described in this invention considers the intermittency and uncontrollability of distributed resources. Through an improved K-means algorithm, considering both spatial distribution concentration and output characteristic consistency, it forms aggregators with high aggregation and output consistency; and based on the results of the above clustering analysis, it configures photovoltaic-storage resource clusters. While ensuring the stable operation of the power grid by aggregators, it enhances user participation in ancillary services through the design of reasonable business interaction modes and incentive mechanisms, ultimately maximizing revenue and effectively improving the overall efficiency and stability of the system. Attached Figure Description

[0062] Figure 1 This is a flowchart of the method described in this invention;

[0063] Figure 2 This is the flowchart of the optimized K-means algorithm;

[0064] Figure 3 This is a framework diagram for the operation mode design of the power distribution network trading mechanism;

[0065] Figure 4 This is an improved IEEE 33-node case diagram;

[0066] Figure 5 This is a typical photovoltaic power generation curve;

[0067] Figure 6 This is the hierarchical clustering diagram of photovoltaics after reduction;

[0068] Figure 7 This is a graph showing the charging and discharging power and status of an energy storage system over a day.

[0069] Figure 8 It is a step-by-step electricity price chart for the entire day.

[0070] Figure 9 It shows the electrical load curves before and after optimization. Detailed Implementation

[0071] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings.

[0072] like Figure 1The diagram illustrates a two-stage trading mechanism design method for urban power grids oriented towards photovoltaic-storage resource cluster partitioning, as described in this invention, comprising:

[0073] Based on the physical characteristics of distributed resources, the distributed resources of the power grid are divided into clusters.

[0074] Based on the distributed resource cluster partitioning and operation mechanism, establish a photovoltaic-storage resource cluster configuration;

[0075] Based on two-step electricity pricing, distributed resource cluster partitioning, and photovoltaic-storage resource cluster configuration, the urban power grid trading mechanism is optimized to maximize aggregator revenue and reduce the opportunity cost and payment fees of distributed resources on the user side.

[0076] Based on the physical characteristics of distributed resources, the distributed resources of the power grid are clustered, including: by considering the spatial distribution characteristics of photovoltaic systems, photovoltaic concentration and photovoltaic system output factors, the distributed photovoltaic systems are clustered in space.

[0077] The traditional K-means clustering process is as follows:

[0078] 1) Randomly select Nc samples as initial cluster centers;

[0079] 2) For each data point in the dataset, calculate its distance to each cluster center and assign it to the cluster containing the nearest cluster center;

[0080] 3) For each cluster, calculate the average of all data points assigned to that cluster, and update the cluster center of that cluster;

[0081] 4) If the termination condition is met, i.e. the cluster centers no longer change significantly, then stop clustering; if the termination condition is not met, then go back to step 2) and repeat.

[0082] Since the cluster centers of the traditional K-means algorithm are not randomly determined, which affects the calculation results, Euclidean distance and non-parametric methods are introduced to optimize clustering and further improve the cluster partitioning effect. These methods include:

[0083] Let the sample data M = {x1, x2, ..., x} a ,…,x b ,…,x m}, x a ,x b ∈R n ; m represents the number of sample points in the dataset, i.e., the total number of objects to be clustered; R n This represents the feature space containing all sample points, where each sample point is a point in this space; Nc clusters are determined, and Nc cluster center points are initially defined as z1, z2, ..., zc.Nc ;

[0084] 1) Presuppose all samples are cluster centers, where x represents one sample point in the sample data M. a1 For sample point x a The first eigenvalue, x b1 For sample point x b The first feature value is used to calculate the Euclidean distance between each aggregated sample:

[0085]

[0086] 2) Calculate the average distance between clustered samples and select it as the bandwidth parameter of the algorithm; where m is the number of samples. For two samples randomly selected from the sample, The average distance, or bandwidth parameter, is the average distance between all sample pairs, and serves as the threshold for the subsequent "window radius".

[0087]

[0088] 3) The window is a circular neighborhood with any potential center point (i.e., cluster center) in the sample data as the center and the bandwidth parameter as the radius, used to define the set of data points within the spatial range; This is an indicator function used to mark points that fall within the window; The number of sample points within the statistical window; p is any sample point in the sample data used as the potential center of the window; p i For sample points in the sample data excluding potential centroids; |p i -p| represents the sample point p i Euclidean distance between center points p; in terms of bandwidth parameter Calculate the data points within the window centered on the cluster center, using the radius as the basis:

[0089]

[0090] 4) Take the cluster sample with the most data points in the window as the aggregation center of the class, and at the same time, regard all data points in the window as points that converge to the same centroid and thus belong to the same cluster. In the subsequent calculation process, remove the above data points from the total sample.

[0091] 5) Repeat step 3). 4) The algorithm stops after determining Nc cluster centers. The cluster partitioning process is as follows: Figure 2 As shown.

[0092] By calculating the similarity of the output characteristic curves of different distributed resource nodes at different time points, aggregation indices can be used for calculation and normalization, thereby aggregating distributed resource systems with similar output characteristics into the same cluster. Ensuring the consistency of power generation characteristics among distributed resource systems within a cluster helps optimize subsequent photovoltaic and energy storage resource allocation and grid trading mechanisms, reducing system burden.

[0093] Based on the distributed resource cluster partitioning and operation mechanism, a photovoltaic-storage resource cluster allocation is established, including: by configuring energy storage systems, the output power of distributed energy sources can be effectively regulated, reducing the system's dependence on external energy sources. When distributed resources reach a very high penetration rate, the problem of voltage exceeding limits in urban power grids becomes more prominent. Energy storage systems can be directly configured near photovoltaic power plants to store excess photovoltaic power generation in real time, reducing power generation fluctuations caused by changes in sunlight and ensuring stable power supply during peak load periods. The parameters of the energy storage system itself must be considered in the relevant energy storage system models.

[0094]

[0095] In the formula: cluster k represents the kth cluster after the cluster partitioning in the previous step; Let N be the capacity of the energy storage system in cluster k at time t, where k = 1, 2, ..., N. C ; Let be the capacity of the energy storage system in cluster k at time t-Δt, where Δt is the time interval, usually taken as 1 hour; Let be the output power of the energy storage system in cluster k at time t; Let be the minimum capacity of the energy storage system in cluster k; η represents the maximum capacity of the energy storage system in cluster k; EES t0 represents the charge / discharge conversion efficiency of the energy storage system; t0 represents the time of the last scheduling instruction. Let be the state of charge of the energy storage system in cluster k at time t; This refers to the installed capacity of the energy storage system.

[0096] Distributed photovoltaic (PV) and energy storage are the main investment vehicles. Through optimized scheduling, services such as power reduction and demand reduction are provided to users to meet their flexible needs. The interaction between distributed resources and the power grid also needs to consider the construction investment cost, operation and maintenance cost, peak-valley arbitrage revenue, and basic electricity cost reduction of distributed PV and energy storage systems, and construct an economic model based on these factors.

[0097] The investment cost model for distributed photovoltaic and energy storage systems is as follows:

[0098]

[0099] In the formula, C inv Investment costs for distributed photovoltaic and energy storage; μ PV μ ESB These are the discount rates for distributed photovoltaic power and energy storage, respectively; y PV y ESB These refer to the service life of distributed photovoltaic power and energy storage, respectively. These are the unit capacity investment costs for distributed photovoltaic power and energy storage, respectively. Planned construction capacity for distributed photovoltaic power; For grid-connected energy storage capacity.

[0100] The operation and maintenance model for distributed photovoltaic and energy storage systems is as follows:

[0101]

[0102] In the formula, C op The operation and maintenance costs of distributed photovoltaic and energy storage systems; δ ess The unit curtailment cost of distributed photovoltaic power; P ab (t) represents the predicted curtailment power of distributed photovoltaic power at time t; α is the conversion ratio of operation and maintenance costs, usually taken as 10%; k re This refers to the energy storage replacement rate.

[0103] Under the time-of-use pricing mechanism of the electricity market, energy storage devices can reduce electricity costs by peak shaving and valley filling. Therefore, the basic electricity cost reduction benefit model of an energy storage system is as follows:

[0104]

[0105] In the formula, n represents the number of operating days of the energy storage system in a year; δ price P is the real-time electricity price at time t; out P represents the discharge power of the energy storage system. in Δt represents the charging power of the energy storage system; Δt is the time interval, usually taken as 1 hour. This refers to the annual basic electricity cost reduction revenue of energy storage systems through charge and discharge optimization.

[0106] To achieve efficient resource management and reasonable allocation of benefits, and considering the randomness of distributed resources, as well as the dynamic changes in urban power grid power flow distribution and operating status, a peak-valley arbitrage model can be established to better assist in the accurate characterization and prediction of distributed resource behavior.

[0107]

[0108] In the formula, f1 is the annual net value; Reduced investment due to lower transformer capacity; μ t S represents the unit capacity cost of the transformer. tS represents the planned capacity of the transformer. t ′ represents the planned capacity of transformers with energy storage function; Residual value recovery income; μ r This is the residual value recovery factor; Cost of energy storage systems; For civil engineering and installation costs; μ p Cost per unit power of the energy storage system; μ E Cost per unit capacity of the energy storage system; The rated power of the energy storage system; μ b This is a cost factor for civil engineering and installation, typically ranging from 3% to 10%.

[0109] Based on the distributed resource cluster partitioning and operation mechanism, a photovoltaic-storage resource cluster allocation is established. This also includes considering the safe and stable operation of the distributed resource system, which should satisfy the balance between load power, energy storage power, and power obtained from the main power grid. The formula is as follows:

[0110]

[0111] In the formula, SOC t and SOC t-1 These represent the energy stored at time t and time t-1, respectively. and These are the lower and upper limits of energy storage charging power, respectively. and These are the lower and upper limits of the energy storage discharge power, respectively; SOC min and SOC max These are the lower and upper limits of energy storage capacity, respectively; P t g It is the power obtained from the real-time power grid; P t d It is the discharge power of the energy storage system; P t c It is the charging power of the energy storage system; P t l It is the real-time load power of the energy storage system.

[0112] By optimizing the urban power grid trading mechanism, the overall efficiency and stability of distributed resource systems are enhanced. Due to the intermittent and uncontrollable characteristics of distributed resources, the concept of reliability level is introduced to capture the uncertainty of power supply during the operation of distributed resources. This reliability level is represented by a random variable τ, which represents the probability that the energy storage system will meet the contracted energy demand during the contract period. For simplicity, it is assumed that the reliability level of distributed resources during operation is within the range [0,1] and is independently and identically distributed. When the distributed resources provide zero power at the end of the contract period, the reliability level τ = 0. Similarly, when the distributed resources provide power equal to or exceeding the contracted quantity at the end of the contract period, the reliability level τ = 1. The sales prices for small-scale, medium-scale, and large-scale distributed resources are λ, respectively. RTP This refers to the wholesale price of electricity obtained from the power grid. The specific design is as follows: Figure 3 As shown.

[0113] For peak demand scenarios, the utility function (i.e., benefit minus cost) of small distributed resources can be expressed as:

[0114]

[0115] In the formula: d′ i It obtains resources from distributed resources when peak demand occurs. i The amount of electricity required to pay. For the electricity volume s stipulated in the supply contract i Cost ( (The ratio of the corrected selling price to the unit production cost of the energy storage system), (1-τ) s )s i λ′ RTP The power shortage cost for distributed resource i. The total cost of distributed resource i, λ′ RTP τ is the price of obtaining electricity from the grid when peak demand occurs. s This refers to the reliability level of small-scale distributed resources.

[0116] Similarly, in this case, the utility functions of medium-sized and large-scale distributed resources can be achieved by separately allocating the base load payment (e) to the base load payment (e) and ... j ,f g Replace with peak demand scenario payment (e′) j ,f′ g To obtain:

[0117]

[0118] In the formula: e′ j To obtain m in the peak casej The amount of electricity required to pay; f′ g To obtain l under peak conditions g The amount of electricity required to pay; τ m and τ l These represent the reliability levels of medium-sized and large-scale distributed resources, respectively.

[0119] When τ = 1, the third term (1-τ) m )m j λ′ RTP A value of zero indicates that the power supplier maximizes utility by providing the contracted power. However, as τ decreases, the utility of distributed resources declines because the cost of supplementing power increases. Therefore, several scenarios may occur.

[0120] 1)λ′ RTP =λ FR (λ FR When the price at which aggregators sell electricity is the price at which they operate, this represents the break-even point for aggregators in a traditional electricity market, since the buying and selling prices are the same. In this scenario, aggregators trade with distributed resources to profit, while distributed resources are willing to sell their surplus electricity at a price higher than that in the baseload scenario.

[0121] In this scenario, the unit payment to distributed resources is $0.015 / kWh higher than in the baseload scenario compared to the same electricity purchase volume. The concept of selling the same amount of electricity at different prices is reasonable, following the principle of flexible pricing tariffs offered by energy retailers to consumers. Based on this principle, consumers are charged different rates depending on the time of day (off-peak and peak hours) for the same electricity consumption.

[0122] 2)λ′ RTP >λ FR When λ′ represents a loss for the aggregator through traditional trading methods, because the purchase price is higher than the selling price, the aggregator aims to avoid the loss by trading with distributed resources. At this point, the benefits of the distributed resources also increase. However, the revenue of the distributed resources decreases with λ′. RTP The aggregator's utility increases with the increase in the fixed rate, until the unit payment falls below the fixed rate. This is because the unit payment equal to the fixed rate is the saturation point; beyond this point, the aggregator's utility becomes negative.

[0123] Based on the above two scenarios, a dynamic pricing mechanism is generated that considers the current market state between aggregators and distributed resources. To derive the optimal trading strategy for aggregators in peak-load scenarios, the following constraints need to be defined: electricity price, cost, supply capacity of distributed resources, and total electricity demand in cluster k. These are defined as follows:

[0124]

[0125] In the formula: W′ is the case of cluster k. k n′ represents the total peak hourly power demand of the aggregator. i,k , n′ j,k and n′ h,k The number of distributed resources i, j, and h that respectively meet the peak load demand; and These are the expenditures of the aggregator when it obtains the quantities of electricity s1, m1, and l1 from small, medium, and large distributed resources, respectively. and The aggregator purchases s from distributed resources respectively i,k m j,k and l h,k The expenditure on the amount of electricity.

[0126] Considering all types of distributed resources and constraints, the optimal contract for the aggregator in the peak load scenario of cluster k can be obtained by the following formula.

[0127]

[0128] In the formula: R(s) i ), R(m j ) and R(l h ) respectively, aggregators obtain s from small-scale distributed resources, medium-scale distributed resources, and large-scale distributed resources. i m j and l h The benefit after the quantity of electricity; n i n j and n h These represent the quantities of distributed resources i, j, and h, respectively; U′ A,k For the benefit of aggregators.

[0129] When the reliability level of distributed resources, τ = 0, means that the distributed resources cannot provide any electricity to meet contractual requirements. Aggregators need to supplement power through other means to avoid default and losses. First, aggregators face high costs, including expensive electricity purchased from the grid in an emergency and penalties for default. To mitigate these costs, contracts should clearly define default compensation rules and establish cost-sharing mechanisms to ensure that distributed resources bear partial responsibility. Second, aggregators should adjust their optimization strategies, diversifying risk through multiple contracts, prioritizing highly reliable energy storage systems, and designing dynamic pricing mechanisms. If distributed resources fail to fulfill their obligations, aggregators can incentivize other distributed resources to provide electricity by increasing compensation prices. For distributed resources, τ = 0 reduces their utility, thus they will tend to choose contracts with high reliability to avoid penalties. Aggregators need to consider this and design more attractive contract terms to ensure a stable supply.

[0130] To verify the feasibility and effectiveness of the proposed two-stage trading mechanism for urban power grids oriented towards photovoltaic-storage resource cluster partitioning, simulation analysis was conducted based on an improved IEEE 33-node case. The improved IEEE 33-node case is as follows: Figure 4 As shown, based on aggregated indicators such as daily average photovoltaic output, daily photovoltaic output volatility, and daily photovoltaic output distribution skewness, the system is divided into three clusters. Furthermore, in practical applications, the configuration of photovoltaic and energy storage resource clusters may not always adequately consider network topology constraints and select suitable locations. This simulation experiment primarily studies the trading mechanism; therefore, in this case, a specific location was selected, and relevant information for distributed photovoltaic and energy storage was predetermined to more closely resemble the complex and unknown real-world scenario. This location was ultimately used as the cluster configuration for this simulation experiment. In cluster 1, photovoltaic systems are connected to nodes 2, 4, and 19, and energy storage systems are connected to nodes 3 and 18. In cluster 2, photovoltaic systems are connected to nodes 9, 13, and 16, and energy storage systems are connected to nodes 6, 10, and 14. In cluster 3, photovoltaic systems are connected to nodes 26, 28, 30, and 32, and energy storage systems are connected to nodes 27 and 31. The parameters of each node in the improved IEEE 33-node case are shown in Table 1. Based on this, a photovoltaic curve generated based on random factors is used to represent the randomness of photovoltaic power generation, and this curve is used as experimental data.

[0131] Table 1 Distributed Power Generation Parameters

[0132]

[0133] During the simulation, the clustering program generated a large number of photovoltaic random scenarios, and based on this, the large-scale scenarios were clustered and optimized using an improved K-means algorithm.

[0134] The photovoltaic (PV) curves generated by introducing random factors generally show a pattern of high output in the middle and low output around the edges. However, influenced by factors such as sunlight intensity and temperature, the daily PV output exhibits a general trend, although specific values ​​vary considerably. Furthermore, due to the influence of various factors, PV curves deviating from the general trend also appear. This also reflects the randomness and volatility of distributed PV generation. A typical PV daily output curve is shown below. Figure 5 As shown.

[0135] By introducing random factors to generate random photovoltaic outputs, the sheer volume of outputs leads to overly cluttered graphs, hindering effective analysis. Therefore, an improved K-means algorithm is used for cluster analysis to reduce the number of large-scale scenarios, facilitating scheduling optimization and performance evaluation. Furthermore, factors such as spatial distribution concentration and multi-machine output similarity are incorporated to achieve distributed photovoltaic clustering analysis with characteristics of concentrated spatial distribution and consistent output characteristics. The results are as follows: Figure 6 As shown, Figure 6 In the diagram, (a), (b), and (c) represent the photovoltaic output of the divided clusters C1, C2, and C3.

[0136] Based on the results of the above distributed photovoltaic clustering analysis and the two-step electricity pricing system, a user-side optimization configuration model for ancillary services is established, considering user load characteristics. Due to the randomness and volatility of distributed photovoltaic power generation, the hourly charging and discharging of energy storage in the grid, as well as the corresponding lifespan and performance of energy storage, should be considered when guiding user electricity consumption. This should be combined with the user's daily electricity load for energy storage configuration optimization and economic analysis. The daily charging and discharging power and status of the energy storage system are as follows: Figure 7 As shown. Under this constraint, the hourly distributed electricity price, derived from the user's daily electricity load and the reduction of the user's opportunity cost and payment for distributed photovoltaic power, is as follows: Figure 8 As shown in the figure, the unit price of electricity purchased from the wholesale market in this simulation experiment varies between 0.3 and 0.9 yuan / kWh, with 0.9 yuan / kWh under the peak load scenario. Since the wholesale electricity price fluctuates within each time interval in the real-time market, the price during peak load demand can be many times higher than the price during base load demand. Therefore, this study considers the wholesale electricity price variation of 0.3 to 0.9 yuan / kWh to demonstrate the effectiveness of the proposed strategy under various conditions. Furthermore, to maximize aggregator profits, promote user engagement, and address more complex situations, a base load scenario price of 0.51 yuan / kWh is set in addition to the peak-valley price. Moreover, since electricity demand fluctuates within each time interval, the simulation is performed over a 24-hour period with a 1-hour step, and the charging and discharging power and status are updated hourly. This simulation experiment will finally demonstrate the feasibility of the scheme by optimizing the load changes before and after the peak load.

[0137] The electrical load curves before and after optimization are shown below. Figure 9 As shown, the peak load curve was reduced between 09:00 and 11:00, and the load was also effectively reduced between 19:00 and 20:00. The load curve was increased between 04:00 and 07:00 and between 12:00 and 13:00, while remaining almost unchanged during other time periods. This load variation aligns with the simulation design's objectives, optimizing user-side energy storage configuration, effectively reducing the peak load curve, and maximizing the utilization of photovoltaic system power generation and aggregator revenue. Simultaneously, the time-of-use pricing ensures user participation in ancillary services.

[0138] A series of simulation experiments verified the effectiveness and feasibility of the proposed K-means-based distributed photovoltaic (PV) clustering method and time-of-use pricing. Simulation results show that the clustering method can effectively reduce large-scale scenarios, facilitating scheduling optimization and performance evaluation. Simultaneously, time-of-use pricing helps aggregators effectively improve the voltage stability and power generation utilization of distributed PV, while also ensuring user participation in peak-shaving services and reducing user costs, thereby effectively improving the overall efficiency and stability of distributed resource integration into the urban power grid.

[0139] This embodiment also provides a two-stage trading mechanism design device for urban power grids oriented towards the partitioning of photovoltaic and energy storage resource clusters, used to implement the above-mentioned trading mechanism design method, including a data acquisition module, a data transmission module, and a data analysis and processing module;

[0140] The data acquisition module is used to collect power generation data related to distributed resources;

[0141] The data transmission module is used to transmit the collected data to the central processing platform via wired or wireless network to ensure the real-time performance and integrity of the data.

[0142] The data analysis and processing module is used to perform clustering of power generation data from distributed resources, configure photovoltaic and energy storage resource clusters, and optimize trading mechanisms. It aggregates distributed resource systems with similar output characteristics into the same cluster to ensure consistency in power generation characteristics among distributed resource systems within the cluster, reduce power generation fluctuations caused by changes in sunlight, and ensure stable supply of demand. At the same time, it encourages users to participate in frequency regulation services, which helps to simplify dispatch management after grid connection, reduce system burden, and enhance system flexibility and reliability.

[0143] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0144] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0145] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0146] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0147] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0148] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for designing a two-stage trading mechanism for urban power grids facing optical storage resource cluster partitioning, characterized in that, The method comprises the following steps: Based on the physical characteristics of distributed resources, the K-means algorithm is used to cluster the distributed resources of the power grid; Based on the distributed resource cluster division and operation mechanism, the light storage resource cluster configuration is established; Based on the two-step electricity price, the distributed resource cluster division and the light storage resource cluster configuration, the city power grid transaction mechanism is optimized. 2.The method of claim 1, wherein, Based on the physical characteristics of distributed resources, the K-means algorithm is used to cluster the distributed resources of the power grid, including: Let the distributed resource photovoltaic power generation data sample data M = {x1, x2, …, x a ,…,x b ,…,x m}, x a ,x b ∈R n ; m represents the number of sample points contained in the data set, that is, the total number of objects that need to be clustered; R n represents the feature space of all sample points, each sample point is a point in the space; determine Nc clusters, initially define Nc samples as initial cluster centers z1, z2, …, z Nc ; 1) preset all samples as clustering centers, x represents a sample point in sample data M, x a1 is the first feature value of sample point x a , x b1 is the first feature value of sample point x b ; calculate the Euclidean distance between each aggregate sample: 2) Calculate the average of the distances between the samples of the cluster and select it as the bandwidth parameter of the algorithm; where, is the average distance between the two randomly selected samples in the sample, is the average distance, i.e. the bandwidth parameter, i.e. the average of the distances between all pairs of samples: 3) define a window as a circular neighborhood with any one of the potential center points in the sample data, i.e. the cluster center, as the center and the bandwidth parameter as the radius, to define the set of data points within the spatial range; is an indicator function that marks points that fall within the window; is the number of sample points within the statistical window; p is any one of the sample points in the sample data as a potential center of the window; p i is a sample point in the sample data other than the potential center point; |p i is the Euclidean distance between the sample point p i and the center point p; with the bandwidth parameter is the data points within the field, i.e. the window, with the cluster center as the center and the bandwidth parameter as the radius; 4) The cluster sample with the most data points in the window is taken as the aggregation center point of the class, and all the data points in the window are regarded as points converging to the same centroid and belong to the same cluster, and the above data points are removed from the total sample in the subsequent calculation process; 5) repeat 3) 4), update the cluster centers of the clusters according to 4), the algorithm stops after all Nc cluster centers are re-determined.

3. The method of claim 1, wherein, Based on the distributed resource cluster division and operation mechanism, the light storage resource cluster configuration is established, including: The model of the energy storage system considers the parameters of the energy storage system itself: In the formula: cluster k represents the kth cluster after cluster division; is the capacity of the energy storage system in cluster k at time t, k = 1, 2, …, N C ; is the capacity of the energy storage system in cluster k at time t-Δt, Δt is the "minimum time unit" that discretizes continuous time, that is, the time interval; is the output power of the energy storage system in cluster k at time t; is the minimum capacity of the energy storage system in cluster k; is the maximum capacity of the energy storage system in cluster k; η EES is the charge-discharge conversion efficiency of the energy storage system; t0 is the time of the last scheduling instruction; is the state of charge of the energy storage system in cluster k at time t; is the installed capacity of the energy storage system; The behavior of the distributed light resource and the power grid interaction also considers the construction investment cost, operation and maintenance cost, peak valley arbitrage income and basic electricity fee reduction income of the distributed photovoltaic and energy storage system, and builds its total economic model; The investment cost model of the distributed photovoltaic and energy storage system is as follows: In the formula, C inv is the investment cost of distributed photovoltaic and energy storage; μ PV , μ ESB are the discount rates of distributed photovoltaic and energy storage, respectively; y PV , y ESB are the service lives of distributed photovoltaic and energy storage, respectively; are the unit capacity investment costs of distributed photovoltaic and energy storage, respectively; is the distributed photovoltaic planning construction capacity; is the energy storage grid-connected capacity; The operation and maintenance cost model of the distributed photovoltaic and energy storage system is as follows: In the formula, C op is the operation and maintenance cost of the distributed photovoltaic and energy storage system; δ ess is the unit light abandonment cost of the distributed photovoltaic; P ab (t) is the predicted light abandonment power of the distributed photovoltaic at time t; α is the conversion ratio of the operation and maintenance cost; k re is the replacement rate of the energy storage; t end is the termination time of the calculation period; The basic electricity fee reduction income model of the distributed photovoltaic and energy storage system is as follows: where n is the number of operating days of the energy storage system in a year; δ price is the real-time electricity price at time t; P out is the discharging power of the energy storage system; P in is the charging power of the energy storage system; Δt is the time interval; is the annual basic electricity bill income reduced by the energy storage system through charging and discharging optimization; The peak valley arbitrage model is established: where f1 is the annual net value; Investment reduction for reducing transformer capacity; μ t Unit capacity cost of transformer; S t Planned capacity of transformer; S t Planned capacity of transformer with energy storage function; Residual value recovery income; μ r Residual value recovery coefficient; Cost of energy storage system; Civil engineering and installation cost; μ p Unit power cost of energy storage system; μ E Unit capacity cost of energy storage system; Rated power of energy storage system; μ b Cost coefficient of civil engineering and installation.

4. The method of claim 3, wherein, Based on the distributed resource cluster division and operation mechanism, the light storage resource cluster allocation is established, which also includes considering the safe and stable operation of the distributed resource system, and the balance relationship between the load power, energy storage power and the power obtained from the large power grid, and its formula is as follows: where SOCtand SOCt-1are the energy storage state of charge at time t and time t-1, respectively; t and SOCt-1are the energy storage state of charge at time t and time t-1, respectively; t-1 and are the lower and upper limits of the energy storage charge power, respectively; and are the lower and upper limits of the energy storage discharge power, respectively;​ SOC min and SOC max are the lower and upper limits of the energy storage capacity, respectively; P t g is the power obtained from the real-time grid; P t d is the discharging power of the energy storage system; P t c is the charging power of the energy storage system; P t l is the real-time load power of the energy storage system.

5. The method of claim 1, wherein the method is characterized by: Based on the two-step electricity price, the distributed resource cluster division and the light storage resource cluster configuration, the city power grid transaction mechanism is optimized, including: The concept of reliability level is introduced to capture the power supply uncertainty of distributed resources runtime, which is represented by a random variable τ, which represents the probability that the energy storage system meets the contracted energy in the contract period; The sale prices of small, medium and large distributed resources, respectively; For the peak demand scenario, the utility function of the small distributed resource is represented as: where: d i is the amount of power acquired from the distributed resources according to the contract at the time of peak demand s i is the price paid for the amount of power, is the amount of power supplied according to the contract s i is the cost, is the ratio of the modified sales price to the unit production cost of the energy storage system, (1-τ s s i λ′ RTP is the cost of the power gap of the distributed resource i, i.e. the distributed resource whose sale price is within the cluster whose center is i, is the total cost of the distributed resource i, λ′ RTP is the price of the power acquired from the grid at the time of peak demand, τ s is the reliability level of the small distributed resources; Similarly, for this case, the utility functions of the medium and large distributed resources are as follows: where: e' j is the payment required for the amount of power obtained from distributed resources under peak conditions according to the contract j f' g is the payment required for the amount of power obtained from distributed resources under peak conditions according to the contract g τ m and τ l are the reliability levels of medium and large distributed resources, respectively The optimal transaction strategy of the aggregator in the peak demand scenario is derived, and the following constraint conditions are defined: The electricity price, cost, supply capacity of distributed resources and total power demand in cluster k are as follows: In the formula: W′ is the case of cluster k. k n′ represents the total peak hourly power demand of the aggregator. i,k , n′ j,k and n′ h,k The number of distributed resources i, j, and h that respectively meet the peak load demand; and These are the expenditures of the aggregator when it obtains the quantities of electricity s1, m1, and l1 from small, medium, and large distributed resources, respectively. and The aggregator purchases s from distributed resources respectively i,k m j,k and l h,k The expenditure per unit of electricity; S, M, and L represent the number of small-scale distributed resources, medium-scale distributed resources, and large-scale distributed resources, respectively. Considering all types of distributed resources and constraint conditions, the optimal contract of the aggregator for the peak load scenario in cluster k is obtained as follows: In the formula: R(s) i ), R(m j ) and R(l h ) respectively, aggregators obtain s from small-scale distributed resources, medium-scale distributed resources, and large-scale distributed resources. i m j and l h The benefit after the quantity of electricity; n i n j and n h These represent the quantities of distributed resources i, j, and h, respectively; U′ A,k For the benefit of aggregators.

6. An apparatus for designing a two-stage trading mechanism of urban power grid oriented to light storage resource cluster partitioning, characterized in that, It comprises a data acquisition module, a data transmission module and a data analysis and processing module. The data acquisition module is used to acquire distributed resource related power generation data. The data transmission module is used to transmit the collected data to the central processing platform through wired or wireless network, and ensure the real-time and integrity of the data. The data analysis and processing module is used to cluster the distributed resource power generation data, configure the light storage resource cluster and optimize the transaction mechanism, and aggregate the distributed resource systems with similar output characteristics in the same cluster to ensure the consistency of the distributed resource systems in the cluster in terms of power generation characteristics.

7. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the method of any one of claims 1-5.