Power market clearing method, device and equipment based on risk scene and storage medium

By using an improved WGAN network and a spatiotemporal network with a fusion attention mechanism, power market risk scenarios are generated and clustered, solving the problems of low clearing efficiency and insufficient capture of risk coupling effects in existing technologies, and achieving more efficient risk management and clearing results.

CN121765335APending Publication Date: 2026-03-31STATE GRID JIANGSU ECONOMIC RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-05
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing electricity market clearing methods are inefficient and cannot effectively capture the coupling effects of multiple risks, leading to difficulties in decision-making and risk management.

Method used

An improved WGAN network is used to generate a 3D scene matrix. A spatiotemporal network with a fusion attention mechanism is used to extract spatiotemporal features. Risk scene clusters are generated through clustering. Clearing tasks are assigned to computing nodes to determine the clearing results.

Benefits of technology

It has improved the efficiency of electricity market clearing, captured the coupling effect of multiple risks such as price, load, and unit failure, and enhanced risk coverage and clearing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121765335A_ABST
    Figure CN121765335A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an electricity market clearing method and device based on risk scenes, equipment and a storage medium, and the method comprises the steps: generating a three-dimensional scene matrix of each risk scene based on an improved WGAN network, the three-dimensional elements of the three-dimensional scene matrix are price fluctuation and load deviation of each time point and fault states of all units respectively; inputting the three-dimensional scene matrix into a space-time network fused with an attention mechanism for space-time feature extraction to obtain space-time features of corresponding risk scenes; performing clustering processing on the spatial-temporal features of the risk scenes to generate a plurality of risk scene clusters; dividing clearing tasks of the computing nodes based on the risk scene clusters, and distributing the clearing tasks to the corresponding computing nodes to enable the computing nodes to determine clearing results of the risk scene clusters based on the clearing tasks. Therefore, the clearing efficiency can be improved, and the problem that various risk coupling effects cannot be captured can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electricity market technology, and in particular to a method, apparatus, equipment and storage medium for electricity market clearing based on risk scenarios. Background Technology

[0002] Against the backdrop of the ongoing and deepening market-oriented reforms in the power industry, the uncertainty of price fluctuations in the power market, as a core component of the power market system, places extremely high demands on the decision-making and risk management of market participants. The power market clearing mechanism is a crucial foundation for the orderly operation of the power market and the generation of reasonable price signals.

[0003] In related technologies, electricity market clearing methods are based on historical price data and market influencing factors. They generate a large number of simulated price fluctuation samples using random sampling techniques to cover possible market price trends. Then, for each generated price fluctuation sample, an electricity market clearing model is called to perform sequential clearing calculations, obtaining the market clearing results under the corresponding risk scenario, including core parameters such as nodal marginal electricity prices and unit output allocation. However, these clearing methods are inefficient and cannot capture the coupling effects of multiple risks. Summary of the Invention

[0004] This application provides a method, apparatus, equipment, and storage medium for electricity market clearing based on risk scenarios, which can improve clearing efficiency and solve the problem of not being able to capture the coupling effects of multiple risks.

[0005] In a first aspect, embodiments of this application provide a method for electricity market clearing based on risk scenarios, including:

[0006] A three-dimensional scenario matrix for each risk scenario is generated based on the improved WGAN network. The three dimensions of the three-dimensional scenario matrix are price fluctuation, load deviation and fault status of all units at each time point.

[0007] The three-dimensional scene matrix is ​​input into a spatiotemporal network with a fusion attention mechanism to extract spatiotemporal features, thereby obtaining the spatiotemporal features of the corresponding risk scene.

[0008] The spatiotemporal features of each risk scenario are clustered to generate multiple risk scenario clusters;

[0009] Based on the risk scenario cluster, clearing tasks are divided for each computing node, and the clearing tasks are assigned to the corresponding computing nodes so that the computing nodes determine the clearing result of the risk scenario cluster based on the clearing tasks.

[0010] Secondly, embodiments of this application provide an electronic device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the method provided in embodiments of this application.

[0011] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method provided in embodiments of this application.

[0012] The technical solution provided in this application generates a three-dimensional scene matrix for each risk scenario through an improved WGAN network. The three-dimensional scene matrix is ​​input into a spatiotemporal network with a fusion attention mechanism to obtain the spatiotemporal features of the corresponding risk scenarios. The spatiotemporal features of each risk scenario are clustered to generate multiple risk scenario clusters. Based on the risk scenario clusters, clearing tasks are divided for each computing node. The clearing tasks are assigned to the corresponding computing nodes so that the computing nodes can determine the clearing results of the risk scenario clusters based on the clearing tasks. That is, by generating a risk scenario matrix that includes price fluctuations, load deviations, and unit fault states, and by extracting spatiotemporal features and performing clustering, the clearing results of different risk scenario clusters can be calculated, which can improve the coverage of risks. The clearing process takes into account risk issues and captures the coupling effect of multiple risks such as price, load, and unit faults. By using distributed computing and clustering into risk scenario clusters, the clearing results of the risk scenario clusters can be obtained, which can improve the clearing efficiency. Attached Figure Description

[0013] Figure 1 This is a flowchart of a risk-based electricity market clearing method provided in an embodiment of this application;

[0014] Figure 2 This is a flowchart of a risk-based electricity market clearing method provided in an embodiment of this application;

[0015] Figure 3 This is a structural block diagram of a power market clearing device based on a risk scenario provided in an embodiment of this application;

[0016] Figure 4 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation

[0017] The present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0018] Figure 1This is a flowchart of a risk-based electricity market clearing method provided in an embodiment of this application. The method can be executed by a risk-based electricity market clearing device, which can be implemented by software and / or hardware. The device can be configured in the main computing node of a distributed system, and the main computing node can be an electronic device such as a computer.

[0019] like Figure 1 As shown, the method provided in this application embodiment includes:

[0020] S110: Generate a three-dimensional scenario matrix for each risk scenario based on the improved WGAN network, wherein the three dimensions of the three-dimensional scenario matrix are the price fluctuation, load deviation and fault status of all units at each time.

[0021] In this embodiment, before step S110, data acquisition and preprocessing may be included, and the Wasserstein Generative Adversarial Network (WGAN) may be trained.

[0022] Historical price data (timestamps, grid node prices, and transaction volumes) can be obtained from power trading platforms or power data service platforms; unit parameters (start-up and shutdown costs, ramp-up rates, and price curves) can be obtained from information disclosures on power trading platforms or power generation companies; and grid topology (branch impedance and node connectivity) can be obtained from grid companies or open-source data platforms. In electricity market transactions, the price curve can be a curve model reflecting the "correspondence between price and tradable electricity volume (or power)," and is one of the core bases for market clearing and price formation.

[0023] In electricity market clearing calculations, the clearing party needs to perform calculations based on key data across the entire electricity market. Essentially, it's an economic dispatch optimization problem with security constraints, requiring simultaneous satisfaction of: electricity supply and demand balance across the entire electricity market (generation = consumption + grid losses); technical constraints on all generating units (such as output limits and ramping constraints); and security constraints on the entire grid (such as line transmission capacity and voltage stability). Therefore, it's essential to integrate the generating unit parameters and the complete grid topology of the entire electricity market to obtain an economically secure clearing result through optimization algorithms (such as linear programming and mixed-integer programming).

[0024] In this embodiment, historical price data can be standardized using the following formula: ; 'This is the original electricity price at that moment (RMB / MWh)' It is the standardized electricity price. Historical average price The standard deviation is denoted as .

[0025] In this embodiment, the power grid topology can be parsed into a CIM / XML file to construct a power grid node-branch association matrix. , For the number of power grid nodes, This represents the number of branches.

[0026] In this embodiment, the improved WGAN network includes a generator and a discriminator. The generator receives a latent vector (typically random noise) as input and generates samples similar to the training data. The generator's goal is to generate realistic samples such that the discriminator cannot accurately distinguish between generated and real samples. The discriminator receives samples (which can be real or generated by the generator) as input and predicts their realism. The generator and discriminator compete and cooperate with each other through adversarial training. The generator aims to deceive the discriminator, making the generated samples increasingly similar to real samples, to the point that the discriminator cannot accurately distinguish them. The discriminator aims to classify samples as accurately as possible, making the differences between real and generated samples more obvious. Through iterative adversarial training, the generator and discriminator continuously adjust their parameters to reach an equilibrium point, ultimately enabling the generator to generate realistic samples while the discriminator cannot accurately distinguish between real and generated samples.

[0027] Specifically, the generator's input can be a 100-dimensional Gaussian noise vector z, where z follows a normal distribution; the output is a three-dimensional risk scene matrix, where the first dimension is... The price fluctuation ΔP ∈ [-30%, +30%] at each point in time, the second dimension is... The load deviation ΔD at each time point ∈ [-15%, +15%], and the third dimension is... The fault status of all units at each time point is F∈{0,1}. We can use 8760, in hours, which corresponds to simulating 365 days or 1 year of data to generate a near-realistic risk scenario. To avoid excessive computation, we can... The vectors corresponding to the fault states of all units at each time point are compressed, F= · + ;in, , These are the trainable weight matrix and the bias matrix, respectively. It is the embedding vector of all unit fault states. The generator is essentially a "mapping function," learning and mapping from a 100-dimensional random noise space to a 3-dimensional target data space. Through adversarial training with a discriminator (which distinguishes between generated and real data), the generator can ultimately produce a 3-dimensional matrix highly similar to the distribution of real data, achieving the simulation or generation of target data (risk scenarios).

[0028] Traditional WGAN networks use weight pruning to control gradients, restricting discriminator weights to a fixed interval to satisfy the "Lipschitz continuity" constraint and ensure computable Wasserstein distance. However, weight pruning forces parameter distribution to concentrate in a narrow interval, limiting the discriminator's capabilities (e.g., inability to learn complex features) and exacerbating training instability. More seriously, it can easily lead to mode collapse, where the generator, in order to "deceive" the discriminator, only generates a few seemingly "successful" samples (rather than covering all patterns in the real data). In this embodiment, spectral normalization is used to constrain the discriminator weight matrix W: ,in, It is the spectral norm (maximum singular value) of W. This is the weight matrix after spectral normalization.

[0029] Optionally, spectral normalization is an alternative constraint method to weight pruning. It satisfies Lipschitz continuity by limiting the spectral norm of the discriminator's weight matrix. By limiting the maximum magnification of the matrix, spectral normalization satisfies the Lipschitz constraint while preserving the relative proportions of the weight matrix. This allows the discriminator to learn the multi-dimensional features of the data more evenly, avoiding over-reliance on a few features. If the discriminator can evenly identify multiple data patterns, the generator cannot win by "generating only a few patterns." In this case, the generator must learn the complete distribution of the real data (covering all patterns) to avoid being identified by the discriminator in adversarial situations, fundamentally suppressing pattern collapse.

[0030] In this embodiment, a coupling term for price and load is introduced into the loss function of the improved WGAN network; the coupling term is determined based on the following formula:

[0031]

[0032] in, The value of the coupling term; This is the coupling strength coefficient, empirically taken as 0.5; For price fluctuations; This refers to the load deviation. This is the function for calculating covariance.

[0033] In this embodiment, training the improved WGAN network can specifically involve: (1) initialization, where the generator and discriminator weights are initialized using a He normal distribution; and (2) discriminator update: calculating the Wasserstein distance between the real risk scenario and the generated risk scenario. : ;in, and These are the discriminator's judgment results for real risk scenarios and generated risk scenarios, respectively.

[0034] The generator is updated based on the following formula:

[0035] Min ;

[0036] Here, Min represents minimization. The generator's goal is to minimize -D(G(z)), which is equivalent to maximizing D(G(z)), i.e., to make the generated risk scenarios as accurately as possible judged as "real data" by the discriminator. This is the core logic of the adversarial process between the generator and the discriminator. Training iterations of 5000 times or discriminator loss fluctuation < .

[0037] After training the improved WGAN network, a three-dimensional scenario matrix for each risk scenario is obtained by inputting a Gaussian noise vector. The three dimensions of the three-dimensional scenario matrix represent price fluctuations, load deviations, and the fault status of all units at each time point. Each time point can be... A specific point in time.

[0038] S120: Input the three-dimensional scene matrix into a spatiotemporal network with a fusion attention mechanism to extract spatiotemporal features and obtain the spatiotemporal features of the corresponding risk scene.

[0039] In this embodiment, the three-dimensional scene matrix M∈ The elements in the standardization are performed, and the standardization method can refer to the method in the above embodiment.

[0040] In this embodiment, the spatiotemporal network with fused attention mechanism includes a temporal convolutional layer, a graph convolutional network layer, an attention layer, and a fully connected layer. The step of inputting the 3D scene matrix into the spatiotemporal network with fused attention mechanism for spatiotemporal feature extraction to obtain the spatiotemporal features of the corresponding risk scenario includes: constructing an adjacency matrix based on the impedance between power grid nodes in the power grid topology; extracting temporal features from the 3D scene matrix using the temporal convolutional layer to obtain temporal features; inputting the temporal features and the adjacency matrix into the graph convolutional layer to obtain spatial features; processing the spatial features using the attention layer to obtain fused features; and converting the fused features into spatiotemporal features of the corresponding risk scenario using the fully connected layer.

[0041] Specifically, the construction of the Graph Convolutional Network (GCN) layer can be achieved by establishing an adjacency matrix based on the impedance between power grid nodes (mainly substations / power plants) in the power grid topology. ,in, Let i be the impedance between grid node i and grid node j. This is the attenuation coefficient, empirically set to 0.2, used to control the correlation strength;

[0042] The GCN layer can be represented as: , To add a self-loop adjacency matrix, for The degree matrix, For the features of the l-th layer nodes, For a trainable weight matrix, This is the activation function.

[0043] Specifically, the temporal convolutional layer used to capture dynamic evolution can independently apply a one-dimensional convolutional kernel K to each dimension of M, and extract features using a 24-hour sliding window to obtain temporal features. The temporal feature means compressing hours into (T / 24) days (e.g., compressing 8760 hours into 365 days), with each day containing three dimensions (price / load / fault), and each dimension having C feature channels. Spatial graph convolutional network layers used to capture node associations can then utilize these temporal features. By aggregating neighborhood information according to the power grid topology, spatial characteristics are obtained. The spatial features refer to the C-dimensional risk features of each power grid node every day. The spatial features are processed through an attention layer to obtain fused features, and the fused features are then transformed through a fully connected layer to obtain the spatiotemporal features of the corresponding risk scenarios.

[0044] Specifically, the attention layer can obtain fused features based on the following formula:

[0045] ;

[0046] in, The fusion feature; The attention weight is the feature vector of the k-th dimension in the spatial features;

[0047] ;

[0048] in, Let k be the feature vector of the k-th dimension in the spatial features; , The parameters are trainable, tanh() is the activation function, [:] is the feature concatenation operation, and exp() is the exponential function. The mean of global spatiotemporal features;

[0049] ;

[0050] in, The number of time points; for Spatial characteristics of power grid node n at time n; This represents the number of nodes in the power grid.

[0051] In this embodiment, the compressed output is performed in the fully connected layer based on the following formula:

[0052]

[0053] in, For the final spatiotemporal features, For the dimension reduction weight matrix, The bias parameter is used, and Flatten() is the flattening operation. The final output is the spatiotemporal features of N risk scenarios. Each risk scenario corresponds to a 256-dimensional vector.

[0054] S130: Perform clustering processing on the spatiotemporal features of each risk scenario to generate multiple risk scenario clusters.

[0055] In this embodiment, the K-means++ clustering algorithm can be performed on the spatiotemporal features to generate multiple risk scenario clusters. A risk scenario cluster index table can also be established, which can cluster high-dimensional spatiotemporal features into typical risk scenario clusters, reducing the complexity of subsequent clearing calculations while preserving key features. Furthermore, the spatiotemporal features of each risk scenario can be preprocessed before clustering.

[0056] In this embodiment, optionally, the step of clustering the spatiotemporal feature matrices of each risk scenario to generate multiple risk scenario clusters includes: determining the corresponding risk exposure based on the spatiotemporal matrix of each risk scenario; selecting the scenario with the highest risk exposure as the current cluster center; determining the distance from the remaining scenarios to the current cluster center based on the spatiotemporal features; and determining the probability distribution of the remaining scenarios as subsequent cluster centers based on the distance; constructing a probability distribution interval based on the probability distribution of the remaining scenarios as subsequent cluster centers; if a randomly generated random number is located within the target probability distribution interval, selecting the scenario corresponding to the target probability distribution interval as a new cluster center, and using the new cluster center as the current cluster center; returning to the step of determining the distance from the remaining scenarios to the current cluster center based on the spatiotemporal features, until the number of cluster centers meets a preset number, resulting in a preset number of cluster centers; assigning risk scenarios to the nearest cluster center for the preset number of cluster centers, forming target clusters; calculating the mean of the spatiotemporal features of all scenarios in each target cluster as the cluster center, and returning to the step of assigning risk scenarios to the nearest cluster center, until the iteration termination condition is met, resulting in multiple risk scenario clusters.

[0057] Specifically, the risk exposure is determined based on the following formula:

[0058] ;

[0059] in, For risk scenarios Risk exposure; For risk scenarios The spatiotemporal characteristics; As a risk-sensitive vector, the weight ratio of price fluctuation, unit failure status and other dimensions is 2:1.5:0.8 (which can be appropriately changed) to amplify the contribution of price fluctuation and unit failure status dimensions. This weight vector can be obtained through training. For element-wise multiplication, The value is L2 norm. Then, the scenario with the highest risk exposure, i.e., the highest risk, is selected as the first cluster center; then the distance between each risk scenario and the first cluster center is calculated. Risk scenarios based on distance calculation The probability distribution of subsequent centers , This is the distance between the risk scenario corresponding to the first cluster center and the first cluster center. This is the distance between all risk scenarios. By sequentially accumulating, a "probability bucket" in the interval [0,1] is constructed. A random number between 0 and 1 is generated; the interval in which this random number falls is used to select the corresponding risk scenario as the new cluster center. For each risk scenario cluster, the scenario closest to the cluster center is selected as the representative scenario. This method is used to continuously select new cluster centers until a predetermined number of cluster centers are selected. The relationship between the number of cluster centers K and the original number of risk scenarios N satisfies: For example, when N=10000, K=4.

[0060] To enhance the clustering differentiation of price fluctuations and unit failures, the distance is determined based on the following formula:

[0061] ;

[0062] in, Cluster center Corresponding spatiotemporal characteristics; and These are the balance coefficients; For risk scenarios To the cluster center The Euclidean distance can be obtained by... and Perform calculations; Weights sensitive to differences; For risk scenarios To the cluster center The distance can also be referred to as the risk scenario. To the cluster center Weighted distance.

[0063] In the clustering iterative optimization, for a preset number of cluster centers, each risk scenario is assigned to the nearest cluster center to form an initial risk scenario cluster. The mean of all risk scenarios in the risk scenario cluster is calculated as the cluster center, and risk scenarios are reassigned. Through continuous iteration, the cluster center is moved a distance less than a threshold. The iteration may terminate when the maximum number of iterations (100) is reached. A risk scenario cluster index table is generated, recording the cluster number to which each risk scenario belongs; for each risk scenario cluster, the risk scenario closest to the cluster center is selected as the representative risk scenario.

[0064] S140: Based on the risk scenario cluster, divide the clearing tasks of each computing node, and assign the clearing tasks to the corresponding computing nodes so that the computing nodes determine the clearing result of the risk scenario cluster based on the clearing tasks.

[0065] In this embodiment, the master computing node can divide the risk scenario clusters into clearing tasks according to the index table of the risk scenario clusters, and then allocate the clearing tasks to various computing nodes in the distributed system for distributed computing. Here, computing nodes are child nodes in the distributed system, and the master computing node is the master node of the distributed system. The master computing node can interact with each computing node. One clearing task is set for each risk scenario cluster k, that is, each type of risk scenario. The allocation rule can be:

[0066]

[0067] in, and The risk levels of risk scenario clusters k and m are respectively, and can be calculated by summing the risk exposure of each risk scenario in the cluster. Based on the above allocation principle, high-performance computing nodes can be prioritized for high-risk clusters. For computing nodes Computational power; Settlement node ;

[0068] In this embodiment, the master computing node can send the scenario risk clusters and scenario risk cluster index tables corresponding to each computing node, the Safety Constrained Unit Combination (SCUC) model, unit parameters (minimum output, maximum output, and ramp rate), network constraints (line capacity, node phase angle limits), and the price quotation curve for unit i. The objective function and constraints are constructed into a Safety Constrained Unit Combination (SCUC) model. The constraints may include preset constraints or risk scenario coupling constraints. Optionally, determining the clearing result of the risk scenario cluster based on the clearing task includes: constructing an objective function aimed at minimizing the total operating cost, solving the objective function under preset constraints and risk scenario coupling constraints, and obtaining the clearing result of the risk scenario cluster. A mixed-integer programming solver (such as CPLEX) can be used to solve the objective function, and the master computing node summarizes the clearing results from each computing node to obtain the unit combination scheme for each risk scenario cluster. , Indicates the unit Start-stop status under risk scenario s Indicates the unit Efforts made in risk scenario s.

[0069] The objective function is:

[0070] The coupling constraints of the risk scenario are:

[0071] in, Number of scheduling periods For the number of units, For the unit The output during time period t; The units Startup and shutdown costs in time period t; Indicates the unit The quote in time period t;

[0072] Where s represents a risk scenario in risk scenario cluster k. The weight of risk scenario s (which can be 1 / distance between risk scenario s and cluster center); For the unit The baseline output (the optimized value in a risk-free scenario, i.e., the result of solving the SCUC model without considering the coupling constraints of the risk scenario). It is a generator set Risk tolerance in risk scenario cluster k For the unit The maximum risk deviation. Among them, , is a system-level coefficient, empirically taken as 0.3; For the unit The system impact coefficient is used to indicate the unit's... Compared to the overall impact of all generating units on the system; and They are the generator sets Maximum and minimum output.

[0073] in, ;

[0074] in, The risk level of risk scenario cluster k can be the average risk exposure of risk scenarios within the risk scenario cluster. This is a scaling factor, which can be 10. For example, a high failure rate unit has a risk tolerance of 0.9 in a risk scenario cluster, allowing for larger fluctuations. For the unit The historical failure probability is calculated. Preset constraints can include power balance constraints (sum of unit output = load + network loss), unit output limits (unit output is between the maximum and minimum unit output), and ramp constraints (unit power change is less than the ramp rate). Risk scenario coupling constraints can constrain the fluctuation range of unit output within each risk scenario cluster, ensuring that risks are controllable.

[0075] The technical solution provided in this application generates a three-dimensional scene matrix for each risk scenario through an improved WGAN network. The three-dimensional scene matrix is ​​input into a spatiotemporal network with a fusion attention mechanism to obtain the spatiotemporal features of the corresponding risk scenarios. The spatiotemporal features of each risk scenario are clustered to generate multiple risk scenario clusters. Based on the risk scenario clusters, clearing tasks are divided for each computing node. The clearing tasks are assigned to the corresponding computing nodes so that the computing nodes can determine the clearing results of the risk scenario clusters based on the clearing tasks. That is, by generating a risk scenario matrix that includes price fluctuations, load deviations, and unit fault states, and by extracting spatiotemporal features and performing clustering, the clearing results of different risk scenario clusters can be calculated, which can improve the coverage of risks. The clearing process takes into account risk issues and captures the coupling effect of multiple risks such as price, load, and unit faults. By using distributed computing and clustering into risk scenario clusters, the clearing results of the risk scenario clusters can be obtained, which can improve the clearing efficiency.

[0076] Figure 2 This is a flowchart of a risk-based electricity market clearing method provided in an embodiment of this application, such as... Figure 2 As shown, the technical solutions provided in this application include:

[0077] S110: Generate a three-dimensional scenario matrix for each risk scenario based on the improved WGAN network, wherein the three dimensions of the three-dimensional scenario matrix are the price fluctuation, load deviation and fault status of all units at each time.

[0078] S120: Input the three-dimensional scene matrix into a spatiotemporal network with a fusion attention mechanism to extract spatiotemporal features and obtain the spatiotemporal features of the corresponding risk scene;

[0079] S130: Perform clustering processing on the spatiotemporal features of each risk scenario to generate multiple risk scenario clusters;

[0080] S140: Based on the risk scenario cluster, divide the clearing tasks of each computing node, and assign the clearing tasks to the corresponding computing nodes so that the computing nodes determine the clearing result of the risk scenario cluster based on the clearing tasks.

[0081] S150: Based on the clearing results and the prices of grid nodes in each time period and under each risk scenario, determine the returns of the electricity market under each risk scenario, and determine the probability-weighted returns of the electricity market under each risk scenario based on the returns, and sort the probability-weighted returns in ascending order, taking the returns with the preset ranking as the risk value of the electricity market.

[0082] Specifically, this can be achieved by inputting the clearing result. , The power system's gains in each risk scenario are determined by factors such as the weights of each risk scenario cluster. Specifically, the weights of risk scenario cluster k are... , Let N be the number of risk scenarios in risk scenario cluster k, and N be the total number of risk scenarios. The price (electricity price) of a power grid node in time period t and under risk scenario s.

[0083] In this embodiment, the revenue from the electricity market can be determined based on the following formula:

[0084] ;

[0085] in, Let n be the net injected power of grid node n in time period t and under risk scenario s. For the cost of electricity generation; The returns of the electricity market under risk scenario s.

[0086] Each electricity market (mainly intraday, day-ahead, and real-time markets) is calculated in isolation based on the number and length of time periods. It includes the income and expenditure of the corresponding market m, independent of other markets.

[0087]

[0088] in, Probability-weighted returns This represents the weight of the risk scenario cluster to which risk scenario s belongs.

[0089] Specifically, probability-weighted returns can be sorted in ascending order, and the probability-weighted return ranked 0.05N can be used as the risk value of a single electricity market. VaR is used to measure the "maximum possible loss" in a financial market (or a single market) at a certain confidence level. It represents the maximum possible loss with a 95% probability, where the loss is the [ranking value]. Benefits in the following scenarios.

[0090] S160: Using the risk type corresponding to the scenario cluster as the horizontal axis and the market dimension divided by time period as the vertical axis, a risk heat map is generated based on the color value.

[0091] Specifically, the x-axis is defined as the risk type (price fluctuation / load deviation / unit failure), which can be analyzed based on the data in the three-dimensional scenario matrix. The risk type corresponding to the dimension with the largest deviation is the risk scenario or risk scenario cluster. The y-axis is the power market dimension (intraday market / day-ahead market / real-time market), and the color value is determined based on the following formula. Finally, a risk heat map is output.

[0092] ;

[0093] in, The risk value of risk type r corresponding to risk scenario cluster in electricity market m can be the average risk value of electricity market corresponding to each risk scenario in risk scenario cluster k. These represent the historical maximum risk value and the historical minimum risk value of the electricity market m, respectively. ) represents the chromaticity value at point m in the electricity market corresponding to risk type r.

[0094] Therefore, by determining the risk value of the electricity market, the risks of the electricity market can be quantified, and by generating a risk heat map, the risks of the electricity market can be vividly depicted.

[0095] Figure 3 This is a structural block diagram of a power market clearing device based on a risk scenario, provided in an embodiment of this application. Figure 3 As shown, the device includes:

[0096] The scenario generation module 310 is used to generate a three-dimensional scenario matrix for each risk scenario based on the improved WGAN network. The three-dimensional scenario matrix has three dimensions, namely the price fluctuation, load deviation and fault status of all units at each time point.

[0097] The spatiotemporal feature determination module 320 is used to input the three-dimensional scene matrix into a spatiotemporal network with a fusion attention mechanism to extract spatiotemporal features and obtain the spatiotemporal features of the corresponding risk scene.

[0098] Clustering module 330 is used to perform clustering processing on the spatiotemporal features of each risk scenario to generate multiple risk scenario clusters;

[0099] The clearing module 340 is used to divide the clearing tasks of each computing node based on the risk scenario cluster, and to allocate the clearing tasks to the corresponding computing nodes so that the computing nodes can determine the clearing result of the risk scenario cluster based on the clearing tasks.

[0100] In an alternative embodiment, a price-load coupling term is introduced into the loss function of the improved WGAN network; the coupling term is determined based on the following formula:

[0101]

[0102] in, The value of the coupling term; This is the coupling strength coefficient; For the aforementioned price fluctuations; The load deviation is mentioned above; This is the function for calculating covariance.

[0103] In one optional embodiment, the spatiotemporal network that integrates the attention mechanism includes a temporal convolutional layer, a graph convolutional network layer, an attention layer, and a fully connected layer;

[0104] The step of inputting the three-dimensional scene matrix into a spatiotemporal network with a fusion attention mechanism for spatiotemporal feature extraction to obtain the spatiotemporal features of the corresponding risk scene includes:

[0105] Construct an adjacency matrix based on the impedance between power grid nodes in the power grid topology;

[0106] The temporal convolutional layer is used to extract temporal features from the three-dimensional scene matrix to obtain temporal features;

[0107] The temporal features and the adjacency matrix are input into the graph convolutional layer to obtain spatial features;

[0108] The spatial features are processed by the attention layer to obtain fused features, and the fused features are converted into spatiotemporal features corresponding to the risk scenario by the fully connected layer.

[0109] In an alternative embodiment, the fusion features are obtained based on the following formula:

[0110] ;

[0111] in, The fusion feature; The attention weight is the feature vector of the k-th dimension in the spatial features;

[0112] ;

[0113] in, Let k be the feature vector of the k-th dimension in the spatial features; , These are the trainable parameters, tanh() is the activation function, [:] is the feature concatenation operation, and exp() is the exponential function. The mean of global spatiotemporal features;

[0114] ;

[0115] in, The number of time points; for Spatial characteristics of power grid node n at time n; This represents the number of nodes in the power grid.

[0116] In an optional embodiment, the step of clustering the spatiotemporal feature matrices of each risk scenario to generate multiple risk scenario clusters includes:

[0117] Based on the spatiotemporal matrix of each risk scenario, the corresponding risk exposure is determined. The scenario with the highest risk exposure is selected as the current cluster center. Based on the spatiotemporal features, the distance from the remaining scenarios to the current cluster center is determined, and based on the distance, the probability distribution of the remaining scenarios as subsequent cluster centers is determined.

[0118] Based on the probability distribution of the remaining scenes as subsequent cluster centers, construct a probability distribution interval. If the randomly generated random number is located in the target probability distribution interval, select the scene corresponding to the target probability distribution interval as the new cluster center, and use the new cluster center as the current cluster center. Return to the step of determining the distance from the remaining scenes to the current cluster center based on the spatiotemporal features, until the number of cluster centers meets the preset number, and obtain the preset number of cluster centers.

[0119] For a predetermined number of cluster centers, risk scenarios are assigned to the nearest cluster center to form target clusters;

[0120] The mean of the spatiotemporal features of all scenarios in each target cluster is calculated as the cluster center. The steps of assigning risk scenarios to the nearest cluster center are returned until the iteration termination condition is met, resulting in multiple risk scenario clusters.

[0121] In an alternative embodiment, the risk exposure is determined based on the following formula:

[0122] ;

[0123] in, For risk scenarios Risk exposure; For risk scenarios The spatiotemporal characteristics; This is the risk sensitivity vector;

[0124] The distance is determined based on the following formula:

[0125] ;

[0126] in, Cluster center Corresponding spatiotemporal characteristics; and These are the balance coefficients; For risk scenarios To the cluster center Euclidean distance; Weights sensitive to differences; For risk scenarios To the cluster center The distance.

[0127] In an optional embodiment, the determination of the clearing result of the risk scenario cluster based on the clearing task includes:

[0128] Construct an objective function with the goal of minimizing the total operating cost, and solve the objective function under preset constraints and risk scenario coupling constraints to obtain the clearing result of the risk scenario cluster;

[0129] The objective function is:

[0130] The coupling constraints of the risk scenario are:

[0131] in, Number of scheduling periods; Number of generating units; For the unit The output during time period t; The units Startup and shutdown costs in time period t; Indicates the unit The quote in time period t;

[0132] Where s represents a risk scenario in risk scenario cluster k; Let k be the number of risk scenarios in risk scenario cluster k. The weights for risk scenario s; For the unit The reference output; It is a generator set Risk tolerance in risk scenario cluster k For the unit The maximum risk deviation;

[0133] in, ;

[0134] in, The risk level of risk scenario cluster k; This is the scaling factor; For the unit Historical failure probability.

[0135] In an optional embodiment, an analysis module is further included, for:

[0136] Based on the clearing results and the prices of grid nodes in each time period and under each risk scenario, the returns of the electricity market under each risk scenario are determined, and the probability-weighted returns of the electricity market under each risk scenario are determined based on the returns. The probability-weighted returns are then sorted in ascending order, and the probability-weighted returns with the preset ranking are taken as the risk value of the electricity market.

[0137] Using the risk type corresponding to the scenario cluster as the horizontal axis and the market dimension divided by time period as the vertical axis, a risk heat map is generated based on the color value.

[0138] The chromaticity value is determined based on the following formula:

[0139] ;

[0140] in, The risk value of risk type r corresponding to risk scenario cluster k in electricity market m; These represent the historical maximum risk value and the historical minimum risk value of the electricity market m, respectively. ) represents the chromaticity value at point m in the electricity market corresponding to risk type r.

[0141] like Figure 4 As shown in the figure, this application provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0142] Memory 113 is used to store computer programs;

[0143] In one embodiment of this application, when the processor 111 executes a program stored in the memory 113, it implements the method provided in any of the foregoing method embodiments, including:

[0144] A three-dimensional scenario matrix for each risk scenario is generated based on the improved WGAN network. The three dimensions of the three-dimensional scenario matrix are price fluctuation, load deviation and fault status of all units at each time point.

[0145] The three-dimensional scene matrix is ​​input into a spatiotemporal network with a fusion attention mechanism to extract spatiotemporal features, thereby obtaining the spatiotemporal features of the corresponding risk scene.

[0146] The spatiotemporal features of each risk scenario are clustered to generate multiple risk scenario clusters;

[0147] Based on the risk scenario cluster, clearing tasks are divided for each computing node, and the clearing tasks are assigned to the corresponding computing nodes so that the computing nodes determine the clearing result of the risk scenario cluster based on the clearing tasks.

[0148] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method provided in any of the foregoing method embodiments.

[0149] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0150] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0151] The above embodiments are merely illustrative examples and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations. However, obvious variations or modifications derived therefrom are still within the scope of protection of this application.

Claims

1. A method for clearing the electricity market based on risk scenarios, characterized in that, include: A three-dimensional scenario matrix for each risk scenario is generated based on the improved WGAN network. The three dimensions of the three-dimensional scenario matrix are price fluctuation, load deviation and fault status of all units at each time point. The three-dimensional scene matrix is ​​input into a spatiotemporal network with a fusion attention mechanism to extract spatiotemporal features, thereby obtaining the spatiotemporal features of the corresponding risk scene. The spatiotemporal features of each risk scenario are clustered to generate multiple risk scenario clusters; Based on the risk scenario cluster, clearing tasks are divided for each computing node, and the clearing tasks are assigned to the corresponding computing nodes so that the computing nodes determine the clearing result of the risk scenario cluster based on the clearing tasks.

2. The method according to claim 1, characterized in that, The improved WGAN network introduces a coupling term between price and load in its loss function; this coupling term is determined based on the following formula: ; in, The value of the coupling term; This is the coupling strength coefficient; For the aforementioned price fluctuations; The load deviation is mentioned above; This is the function for calculating covariance.

3. The method according to claim 1, characterized in that, The spatiotemporal network that integrates the attention mechanism includes a temporal convolutional layer, a graph convolutional network layer, an attention layer, and a fully connected layer. The step of inputting the three-dimensional scene matrix into a spatiotemporal network with a fusion attention mechanism for spatiotemporal feature extraction to obtain the spatiotemporal features of the corresponding risk scene includes: Construct an adjacency matrix based on the impedance between power grid nodes in the power grid topology; The temporal convolutional layer is used to extract temporal features from the three-dimensional scene matrix to obtain temporal features; The temporal features and the adjacency matrix are input into the graph convolutional layer to obtain spatial features; The spatial features are processed by the attention layer to obtain fused features, and the fused features are converted into spatiotemporal features corresponding to the risk scenario by the fully connected layer.

4. The method according to claim 3, characterized in that, The fusion features are obtained based on the following formula: ; in, The fusion feature; The attention weight is the feature vector of the k-th dimension in the spatial features; ; in, Let k be the feature vector of the k-th dimension in the spatial features; , These are the trainable parameters, tanh() is the activation function, [:] is the feature concatenation operation, and exp() is the exponential function. The mean of global spatiotemporal features; ; in, The number of time points; for Spatial characteristics of power grid node n at time n; This represents the number of nodes in the power grid.

5. The method according to claim 1, characterized in that, The process of clustering the spatiotemporal feature matrices of each risk scenario to generate multiple risk scenario clusters includes: Based on the spatiotemporal matrix of each risk scenario, the corresponding risk exposure is determined. The scenario with the highest risk exposure is selected as the current cluster center. Based on the spatiotemporal features, the distance from the remaining scenarios to the current cluster center is determined, and based on the distance, the probability distribution of the remaining scenarios as subsequent cluster centers is determined. Based on the probability distribution of the remaining scenes as subsequent cluster centers, construct a probability distribution interval. If the randomly generated random number is located in the target probability distribution interval, select the scene corresponding to the target probability distribution interval as the new cluster center, and use the new cluster center as the current cluster center. Return to the step of determining the distance from the remaining scenes to the current cluster center based on the spatiotemporal features, until the number of cluster centers meets the preset number, and obtain the preset number of cluster centers. For a predetermined number of cluster centers, risk scenarios are assigned to the nearest cluster center to form target clusters; The mean of the spatiotemporal features of all scenarios in each target cluster is calculated as the cluster center. The steps of assigning risk scenarios to the nearest cluster center are returned until the iteration termination condition is met, resulting in multiple risk scenario clusters.

6. The method according to claim 5, characterized in that, The risk exposure level is determined based on the following formula: ; in, For risk scenarios Risk exposure; For risk scenarios The spatiotemporal characteristics; This is the risk sensitivity vector; The distance is determined based on the following formula: ; in, Cluster center Corresponding spatiotemporal characteristics; and These are the balance coefficients; For risk scenarios To the cluster center Euclidean distance; Weights sensitive to differences; For risk scenarios To the cluster center The distance.

7. The method according to claim 1, characterized in that, The clearing results for determining risk scenario clusters based on clearing tasks include: Construct an objective function with the goal of minimizing the total operating cost, and solve the objective function under preset constraints and risk scenario coupling constraints to obtain the clearing result of the risk scenario cluster; The objective function is: ; The coupling constraints of the risk scenario are: ; in, Number of scheduling periods; Number of generating units; For the unit The output during time period t; The units Startup and shutdown costs in time period t; Indicates the unit The quote in time period t; Where s represents a risk scenario in risk scenario cluster k; Let k be the number of risk scenarios in risk scenario cluster k. The weights for risk scenario s; For the unit The reference output; It is a generator set Risk tolerance in risk scenario cluster k For the unit The maximum risk deviation; in, ; in, The risk level of risk scenario cluster k; This is the scaling factor; For the unit Historical failure probability.

8. The method according to claim 1, characterized in that, Also includes: Based on the clearing results and the prices of grid nodes in each time period and under each risk scenario, the returns of the electricity market under each risk scenario are determined, and the probability-weighted returns of the electricity market under each risk scenario are determined based on the returns. The probability-weighted returns are then sorted in ascending order, and the probability-weighted returns with the preset ranking are taken as the risk value of the electricity market. Using the risk type corresponding to the scenario cluster as the horizontal axis and the market dimension divided by time period as the vertical axis, a risk heat map is generated based on the color value. The chromaticity value is determined based on the following formula: ; in, The risk value of risk type r corresponding to risk scenario cluster k in electricity market m; These represent the historical maximum risk value and the historical minimum risk value of the electricity market m, respectively. ) represents the chromaticity value at point m in the electricity market corresponding to risk type r.

9. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed in a computer, causes the computer to perform the method of any one of claims 1-8.