Virtual power plant spot transaction node electricity price prediction and risk early warning method and system
Patent Information
- Application Number
- CN202610981735.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-02
- Publication Date
- 2026-10-27
AI Technical Summary
然而,该电价受源荷双侧不确定性、电网拓扑约束及市场报价博弈行为叠加影响,呈现高波动、尖峰厚尾等复杂统计特性
本发明采用连续归一化流模型直接输出节点电价的完整概率密度,无需预设电价服从某种特定参数分布,可精确计算任意置信水平下的预测区间与分位数信息,为虚拟电厂提供全分布风险量化依据,克服传统点预测信息不足的缺陷。
Smart Images

Figure CN122989154A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of interdisciplinary technology of electricity price forecasting and artificial intelligence, and in particular relates to a method and system for forecasting electricity prices and risk warning at virtual power plant spot trading nodes. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] As the electricity spot market opens to virtual power plants, the nodal marginal price, as a core signal for market clearing, directly determines the bidding strategies and operating revenue of virtual power plants. However, this price is affected by the combined effects of uncertainties on both the source and load sides, grid topology constraints, and market bidding game behavior, exhibiting complex statistical characteristics such as high volatility and thick tails. Existing electricity price forecasting methods have the following shortcomings: First, they mainly rely on deterministic point forecasting and lack probability distribution descriptions, making it difficult to provide the quantitative basis required for risk management; second, they fail to effectively integrate unobservable factors such as market concentration and bidding strategy game, making it impossible to capture their amplification effect on tail risk of electricity prices; and third, they are not good at fitting the "peak-heavy tail" characteristics, causing the extreme electricity price warning threshold to deviate from reality, making it difficult to support strategy adjustments in high-risk scenarios.
[0004] Therefore, there is an urgent need for a nodal price forecasting method that can output a complete probability distribution, integrate power grid topology and market game conditions, and has adaptive extreme risk early warning capabilities. Summary of the Invention
[0005] To overcome the shortcomings of the prior art, this invention provides a method and system for predicting electricity prices and providing risk warnings for virtual power plant spot trading nodes. The aim is to generate a set of electricity price probability scenarios by constructing a fusion multimodal condition vector; then, to calibrate the prediction interval online using adaptive consistent inference; and to dynamically calculate the extreme electricity price warning index using game-aware generalized extreme value distribution, thereby achieving complete decision support from probability distribution prediction to game-sensitive risk warning.
[0006] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions: Firstly, the method for predicting electricity prices and providing risk warnings at virtual power plant spot trading nodes was disclosed, including: Obtain topology-aware embedding vectors, temporal probability embedding vectors, implicit encoding vectors, and market rule encoding vectors to construct multimodal conditional vectors; The multimodal conditional vector is input into the continuous normalized flow model to obtain the conditional probability density of nodal electricity prices and sample to generate a scenario set; Based on the scenario set, the interval width is adjusted online through adaptive consistency inference to obtain a prediction interval that converges to a preset confidence level; A generalized extreme value distribution is constructed using implicit encoding vectors as conditions, and an extreme electricity price early warning index is calculated.
[0007] Furthermore, the acquisition of the topology-aware embedding vector specifically involves: The power system topology is constructed as a directed graph. The load level, predicted output of distributed generation, historical node electricity price, line capacity margin and voltage level code of each node are extracted as initial features, and an adjacency matrix is constructed based on the line admittance. The attention weights between nodes and their neighbors are calculated using a graph attention network, and the topology-aware embedding vector is output after weighted aggregation and activation function.
[0008] Furthermore, the acquisition of the temporal probability embedding vector specifically involves: The historical load sequence, distributed power generation output sequence and time features are concatenated into a joint input, which is then linearly mapped and encoded before being input into the Transformer encoder. The mean of the sequence output is taken as the summary vector. The summary vector is mapped to the mean and variance of the latent variable distribution, and the temporal probability embedding vector is obtained through reparameterized sampling.
[0009] Furthermore, the acquisition of the implicit encoding vector specifically involves: After flattening the price stack features, they are concatenated with the Herfindahl-Hirschman index, the remaining supply index, and the virtual power plant open interest ratio to form a joint input vector. After nonlinear transformation and feature abstraction through a multi-layer fully connected network, the output layer is linearly mapped to the latent space to obtain the implicit encoding vector.
[0010] Furthermore, the acquisition of the market rule encoding vector specifically involves: Discrete market rule types are mapped to dense vectors through an embedding layer, and the resulting vectors are multiplied by the corresponding continuous strength coefficients to output the market rule encoding vector.
[0011] Furthermore, the step of inputting the multimodal conditional vector into the continuous normalized flow model to obtain the conditional probability density of nodal electricity prices and sampling to generate a scenario set specifically includes: Using the current state, virtual time, and multimodal condition vector as input, a velocity field neural network describes the continuous evolution of the electricity price state from the basic distribution to the target distribution. With the goal of maximizing the conditional log-likelihood, an ordinary differential equation solver is used to calculate the initial state and its log probability. After training, multiple electricity price scenarios are generated by sampling from the basic distribution and passing through a forward solver.
[0012] Furthermore, the conditional logarithmic probability density is determined in the following manner: The conditional logarithmic probability density is determined in the following manner:
[0013] in, For electricity price series, For multimodal condition vectors, For velocity field neural networks, The trace of the Jacobian matrix, the electricity price sequence The continuous time state is The initial state is .
[0014] Secondly, a public virtual power plant spot trading node electricity price forecasting and risk early warning system will be implemented, including: The multimodal conditional vector embedding module is used to obtain topology-aware embedding vectors, temporal probability embedding vectors, implicit encoding vectors, and market rule encoding vectors to construct multimodal conditional vectors. The probability prediction module inputs the multimodal conditional vector into the continuous normalized flow model to obtain the conditional probability density of nodal electricity prices and samples it to generate a scenario set. The interval calibration module is used to adjust the interval width online based on the scene set through adaptive consistency inference, so as to obtain a prediction interval that converges to a preset confidence level. The risk warning module is used to construct a generalized extreme value distribution based on implicit encoding vectors and calculate the extreme electricity price warning index.
[0015] Thirdly, a computer device is disclosed, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to perform the steps of the method described above.
[0016] Fourthly, a computer-readable storage medium is disclosed having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0017] The above one or more technical solutions have the following beneficial effects: This invention uses a continuous normalized flow model to directly output the complete probability density of nodal electricity prices. It does not require pre-setting that the electricity prices follow a certain specific parameter distribution. It can accurately calculate the prediction interval and quantile information at any confidence level, providing a quantitative basis for the full distribution of risks for virtual power plants and overcoming the shortcomings of insufficient information in traditional point prediction.
[0018] This invention obtains an implicit encoding vector through game theory inference network encoding, which explicitly quantifies game behaviors that are not directly observable, such as market concentration and the degree of tension in remaining supply. The implicit encoding vector is used as a condition to drive the dynamic change of the parameters of the generalized extreme value distribution, so that the extreme electricity price warning threshold is automatically adjusted according to the game situation, realizing game-sensitive tail risk capture and effectively solving the problem of insufficient fitting of conventional models to "peak and heavy tail".
[0019] This invention introduces adaptive consistent inference to adjust the prediction interval width online. By updating the width adjustment parameter time by time, the actual coverage rate asymptotically converges to the preset confidence level in the long term. It can automatically adapt to non-stationary changes in market fluctuations, seasonality, and game dynamics, avoid systematic biases caused by excessively narrow or wide intervals, and ensure the long-term reliability of early warnings.
[0020] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0021] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0022] Figure 1 This is a flowchart of the virtual power plant spot trading node electricity price prediction and risk warning method according to Embodiment 1 of the present invention; Figure 2 This is a diagram of the speed field neural network architecture for electricity price prediction and risk warning at virtual power plant spot trading nodes according to Embodiment 1 of the present invention. Figure 3 This is a module diagram of the virtual power plant spot trading node electricity price prediction and risk warning system according to Embodiment 1 of the present invention. Detailed Implementation
[0023] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0024] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations of the present invention.
[0025] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0026] Example 1 like Figure 1As shown in the figure, this embodiment discloses a method for predicting electricity prices and providing risk warnings for virtual power plant spot trading nodes, including: Step 1: Obtain the topology-aware embedding vector, temporal probability embedding vector, implicit encoding vector, and market rule encoding vector to construct a multimodal conditional vector; Step 1.1: Obtain the power grid topology feature embedding vector through graph attention encoding, which aims to fuse the topological structure information of the power grid with the electrical features of the nodes to provide a spatial topology-aware embedding representation.
[0027] First, construct a directed graph from the nodes and lines in the power system topology:
[0028] in, This represents the set of nodes in a system, such as power plant nodes that inject power into the system, load nodes that consume power, and interconnection nodes that only serve a topological connection function. A set representing the connections between nodes; Features that represent the connections between nodes, such as node admittance relationships.
[0029] Five-dimensional initial features of each node are extracted from the power grid topology to form a node feature matrix. ,in This represents the total number of nodes in the graph. The five dimensions are: node load level, predicted output of distributed power sources, historical node electricity price, line capacity margin, and voltage level coding.
[0030] Simultaneously construct the adjacency matrix. It is a symmetric matrix, where the elements are... Take the normalized admittance, which is the reciprocal of the line reactance. If there is no direct connection between the two nodes, the corresponding element takes the value of 0.
[0031] Based on the above input, the specific calculation process for graph attention encoding is as follows: For each node The initial features of the node are linearly mapped to a high-dimensional space through a fully connected layer to obtain the initial feature representation of the node: in, for The initial features of the i-th node; These are the network weight parameters for the fully connected layer.
[0032] Graph attention mechanism is used to compute nodes. Its neighboring nodes The attention coefficient between nodes is used to measure the importance of neighboring nodes to the current node.
[0033] in, For learnable attention vectors, The symbol for vector transpose. For activation function, This indicates a vector concatenation operation.
[0034] This calculation concatenates the feature vectors of the current node and its neighbors, maps them to an attention vector, and then outputs the result through an activation function. This output reflects the feature contribution weights of the neighbors to the current node.
[0035] Perform the calculated attention coefficients Normalization process:
[0036] in, Represents a node The set of all neighboring nodes.
[0037] The features of neighboring nodes are weighted and summed according to the normalized attention weights, and then... The activation function yields the output of the first-layer graph attention network:
[0038] To further expand the neighborhood range of topology-aware computing, enabling each node's embedding vector to incorporate the electrical features of its higher-order neighbors, As a new node feature, replacing Substituting into the first step yields Then, repeat the above calculation process to obtain the output of the second layer graph attention network:
[0039] Based on this This is the power grid topology feature embedding vector. This vector not only encodes the electrical feature information of the node itself, but also aggregates the topology-related information of neighboring nodes and even higher-order neighbors layer by layer through the stacking of two-layer graph attention mechanisms. This achieves a deep perception of the local topology and electrical characteristics of the power grid, and provides effective conditional input rich in spatial topology information for subsequent conditional probability prediction models.
[0040] Step 1.2: Obtain the temporal probability embedding vector through source payload temporal probability encoding.
[0041] This step aims to connect the nodes. The load sequence and distributed power output sequence over a period of time are encoded into a probabilistic vector, which retains the time-series mean trend while explicitly carrying the prediction uncertainty, thus providing a time-series conditional input rich in source-load dynamic information for the electricity price probabilistic prediction model.
[0042] The input data for source-load time-series probabilistic coding includes three categories: historical load sequences, historical distributed power generation output sequences, and time characteristics.
[0043] The historical load sequence is denoted as , indicating the past The load value at each point in time; the historical distributed generation output sequence is denoted as... This represents the output value of distributed power sources over the past 24 time points; the time characteristic is denoted as... Each point in time contains the hour's sine code, the hour's cosine code, and an indicator of whether it is a holiday or public holiday. These three types of input data are concatenated along the feature dimension to form a joint input matrix:
[0044] After obtaining the joint input matrix, Position encoding is applied to each time point in the sequence to preserve the order information of each time point in the time series, resulting in the embedded sequence:
[0045] in, represents the learnable weight parameters of the neural process encoder, used to linearly map 5-dimensional input features to a 64-dimensional embedding space; It is a learnable absolute position encoding matrix, whose function is to assign unique position information to each point in time, enabling the model to perceive the temporal sequence.
[0046] Subsequently, the embedded sequence The data is sequentially fed into a two-layer Transformer encoder for temporal feature extraction. Each Transformer encoder layer includes a multi-head self-attention mechanism and a feedforward network, with four self-attention heads used to capture temporal dependencies at different time scales. The specific calculation process is as follows:
[0047]
[0048] After two layers of abstraction and refinement by the Transformer encoder, Each time-point vector in the sequence has incorporated global temporal context information. To obtain a compact summary representation of the entire sequence, the average of the outputs at all time points in the last layer (the second layer) is taken as the sequence's summary vector: This summary vector It condenses the core trend information of the entire source payload time series. To further explicitly express the uncertainty of the prediction, the summary vector... These are mapped to the mean and log-variance of the latent variable distribution, respectively: in, and In order to seek Mean weight parameters and drift coefficients of fully connected layers; and Then it is to seek Log-variance weight parameters and drift coefficients for fully connected layers. Using log-variance instead of directly predicting variance aims to ensure the non-negativity of variance and improve numerical stability.
[0049] Finally, the latent variable distribution is sampled using a reparameterization technique to obtain the final temporal probability embedding vector: in, This is the temporal probability embedding vector, which is a probabilistic encoded vector carrying the temporal trend of the source payload and the uncertainty of the prediction. This represents the element-wise dot product of vectors. Let be a random noise vector that follows a standard normal distribution. The reparameterization technique makes the sampling operation differentiable, thus allowing the gradient to propagate back through this sampling layer to the encoder network.
[0050] As a probabilistic encoding vector carrying the temporal trend of source load and the uncertainty of prediction, it captures the long-term dependence and trend information of load and output sequences through the Transformer encoder, and explicitly expresses the range of uncertainty of prediction through the mean and variance of the latent variable distribution.
[0051] Step 1.3: Obtain the implicit encoding vector by inferring the network encoding through game theory.
[0052] This step aims to infer the game dynamics of market participants that are not directly observable from observable publicly available market data, and to explicitly encode implicit factors such as the intensity of the game and the risk of market manipulation into vectors, providing conditional inputs rich in market game information for the electricity price probability prediction model.
[0053] The input data for the game inference network encoding comes from publicly available transaction information in the electricity market, specifically including four types of features.
[0054] The first category is the quote stack feature, denoted as... , indicating time period Domestic market participants Segmented pricing information, each segment including the declared electricity price and declared capacity, flattened as... Dimensional vector.
[0055] The second category is the Herfindahl-Hirschman index, denoted as... , is a scalar used to measure market concentration; the higher the index, the more easily the market can be manipulated by a few entities.
[0056] The third category is the surplus supply index, denoted as... Also a scalar, it measures the market supply-demand ratio after excluding the largest supplier. When the index is below 1, it indicates that the key supplier has pricing power.
[0057] The fourth category is the virtual power plant holding ratio, denoted as... , is a scalar representing the percentage of electricity that the virtual power plant itself has contracted at this node.
[0058] The above four types of data are concatenated into a joint input vector:
[0059] in, This is a flattening function used to flatten the quote stack matrix into a one-dimensional vector.
[0060] by Taking segment pricing as an example, the pricing stack, after being flattened, has 10 dimensions, plus three scalar indicators. The total dimensions are 13.
[0061] The concatenated joint input vector The input is fed into a three-layer fully connected inference network for game-theoretic latent feature extraction. This network first passes through a first hidden layer, and then undergoes a linear transformation... The activation function achieves non-linear dimensionality upscaling, mapping a 13-dimensional input to 64 dimensions to extract cross-features between various market indicators. Its operation is as follows: The output dimension is 64.
[0062] Then, through a second hidden layer, the 64-dimensional features are further abstracted to refine a higher-level game representation. The operation is as follows: The output dimension remains 64 dimensions.
[0063] Finally, the output layer linearly maps the 64-dimensional features to a 32-dimensional game-theoretic latent space. The operation is as follows: The output dimension is 32.
[0064] It should be noted that the output layer does not use an activation function and directly outputs linearly in order to preserve the numerical continuity and ample dynamic range of the game features.
[0065] This is an implicitly encoded vector. Through deep abstraction and nonlinear fusion of multi-dimensional market information such as market price stack, market concentration, remaining supply tightness, and virtual power plant's own holding ratio, this vector explicitly encodes implicit factors such as the game situation of market participants, the intensity of bidding strategy game, and market manipulation risk, which are difficult to observe directly, into a compact vector.
[0066] Step 1.4: Obtain the market rule encoding vector through embedding layer encoding.
[0067] This step aims to encode discrete market rules and their enforcement strength into vector form, providing conditional inputs that reflect the impact of market rules for electricity price probability prediction models.
[0068] Discrete market rules, such as priority consumption of new energy, demand response signals, and price caps, are multiplied by a continuous intensity coefficient through an embedding layer to obtain a 16-dimensional code. .
[0069] In this embodiment, the embedding layer is implemented using a standard trainable lookup table structure, rather than a multilayer perceptron or linear projection layer.
[0070] Specifically, assuming the market rule set contains K discrete rule types, then a trainable embedding matrix is constructed as follows:
[0071] Where K is the number of rule categories and d is the embedding dimension.
[0072] During the forward computation, each discrete market rule obtains its corresponding vector representation directly from the embedding matrix by looking up its index number:
[0073] The embedding matrix These are the core trainable parameters of the model, which are jointly optimized end-to-end with the entire network during training and updated through gradient backpropagation.
[0074] In this embodiment, the embedding dimension d can be set to be higher than the final output dimension (such as 32-dimensional or 64-dimensional), and then projected to the final 16-dimensional market rule encoding space through linear mapping or direct truncation to ensure a balance between expressive power and computational efficiency.
[0075] Therefore, this embedding layer is essentially a typical parametric discrete semantic mapping layer, used to transform unstructured discrete market rules into a continuous vector space representation. In this embodiment, the input of the discrete market rules is expressed using a rule index set + multi-label parallel activation mechanism (multi-hot form).
[0076] Specifically, at any given time t, the system may have multiple effective market rules simultaneously, such as priority consumption of new energy, demand response triggering, and price ceiling constraints. In this case, the set of rules can be represented as:
[0077] For each rule in this rule set, it is independently mapped to a corresponding rule vector through the embedding layer:
[0078] To characterize the different effects of various rules in the current market environment, a corresponding continuity strength coefficient is introduced. This forms a weighted representation:
[0079] Finally, when multiple rules take effect in parallel, a vector overlay and fusion mechanism is used to obtain the market rule encoding vector:
[0080] This design is essentially equivalent to an additive rule embedding mechanism, which can avoid information overlay problems caused by rule conflicts, while maintaining the separability and independent contribution of each rule's semantics.
[0081] Furthermore, due to the use of a linear weighting structure, this mechanism has good interpretability, meaning that the contribution of each rule to the final encoded vector can be directly characterized by its strength coefficient.
[0082] Continuous strength coefficient In this embodiment, the continuous expression used to characterize the execution strength or effect strength of discrete market rules has the core physical meaning of expanding the binary state of "whether the rule is effective" into a continuous variable of "the degree of influence of the rule". Specifically, the continuous strength coefficient α∈[0,1], when α=0: it means that the rule is not effective; when α=1: it means that the rule is fully executed; when 0<α<1: it means that the rule is in a state of partial execution or weak constraint.
[0083] For example, in the priority consumption of new energy, it can represent the priority weight of consumption; in demand response, it represents the degree of response activation; and in the price cap mechanism, it represents the tightening strength of price constraints. Therefore, this coefficient is essentially a continuous characterization of the intensity of market rule enforcement.
[0084] There are three ways to obtain the value of the continuous intensity coefficient: one is to set it manually, that is, to give it directly by the market operator or the dispatch center according to the rules; The second is data-driven estimation, which is obtained through statistical regression of historical market operation data such as supply-demand ratio, curtailment rate, and congestion level; Thirdly, the recommended model learning and generation method is to obtain the model through adaptive learning via neural network modules: This allows it to dynamically adjust to market conditions.
[0085] In a dynamic market environment It can change over time, thus reflecting the time-varying characteristics of the rule constraint strength.
[0086] In the model structure, the continuous intensity coefficients act as amplitude modulators for the embedded vectors.
[0087] Essentially, it is equivalent to a lightweight gating mechanism used to control the weight of different market rules on the final representation.
[0088] When multiple rules exist, the overall encoding stability can be ensured through normalization or weighted summation:
[0089] This mechanism not only improves the interpretability of the model, but also enhances its sensitivity to changes in the strength of market rules, enabling the model to adapt to different market institutional environments.
[0090] Step 1.5: Concatenate multimodal conditional vectors.
[0091] After encoding using the above steps, the four resulting vectors are concatenated along the feature dimensions to construct a unified multimodal conditional vector. Specifically, the topology-aware embedding vector is then... Temporal probabilistic embedding vectors Implicit encoding vector and market rule encoding vector By concatenating along the feature dimensions, we obtain: in, This represents a vector concatenation operation. The conditional vector integrates information from four dimensions: grid topology spatial characteristics, source-load temporal trends and forecast uncertainties, market participant game dynamics, and market rule constraints.
[0092] Step 2: Input the multimodal conditional vector into the continuous normalized flow model to obtain the conditional probability density of nodal electricity prices and sample to generate a scenario set.
[0093] To obtain the conditional probability distribution of nodal electricity prices, this embodiment uses a continuous normalized flow as the core of the generative model to learn the conditional probability distribution of nodal electricity prices. This method eliminates the need for the forward noise addition process of the diffusion model, and instead directly models the continuous transformation from the fundamental distribution to the target distribution through neural ordinary differential equations, achieving a good balance between expressive power and computational efficiency.
[0094] Define the electricity price series The continuous time state is Assuming the initial state Follows a standard normal distribution final state ,but The process of change can be described by the following formula:
[0095] in, A velocity field neural network with conditional injection. These are the parameters of the trainable network.
[0096] Velocity field neural network in the current state Virtual Time , For scalar and multimodal conditional vectors Input is velocity vector. That is, the derivative of the state variable with respect to virtual time. .
[0097] like Figure 2 As shown, the velocity field neural network uses a residual fully connected network (ResidualMLP) as the backbone network and implements conditional vectors through characteristic linear modulation (FiLM). The injection, while also virtual time The parameters are then concatenated into the middle layer of the network after being encoded by sine and cosine to give the network time-aware capabilities. GELU is used as the activation function, and the total number of network parameters is approximately 0.3M.
[0098] According to the instantaneous variable transformation theorem, given the following conditions... Lower electricity price series The logarithmic probability density can be derived as follows: in, Represents the velocity field Regarding the current state The trace of the Jacobian matrix. This formula indicates that the change in logarithmic probability density is equal to the negative integral of the velocity field divergence. By tracing the continuous transformation path from the initial distribution to the target distribution, the probability density value of the target sample can be accurately calculated.
[0099] Since directly calculating the trace of the Jacobian matrix requires 24 backpropagations over the 24-dimensional state, the computational cost is high. This embodiment uses the following formula for approximate calculation: in, This represents the total number of samples. For the first The random vector sampled in the nth sampling satisfies ( The expected value of the outer product of random vectors is equal to the identity matrix. This approximation transforms the calculation of higher-order traces into several scalar calculations through random projection, significantly reducing computational complexity.
[0100] After providing the formula for calculating the log probability density, this embodiment adopts the approach of maximizing the conditional log-likelihood and designs the following loss function: The training process for the continuous normalized flow model in this step is as follows: S1, sample a real electricity price sequence from the dataset. And calculate its corresponding multimodal condition vector according to the method in step 1. ; S2, with To obtain the final value, solve the ordinary differential equation in reverse time to obtain the initial state. That is, the backpropagation path:
[0101] The reverse solution starts from Starting from there, it evolves backward along virtual time to... In essence, it is to inversely map the target electricity price sample back to the latent space of the standard normal distribution; S3, will Substitute the probability density function of the standard normal distribution into the equation and calculate... ; S4. On the trajectory of solving the inverse ordinary differential equation, the Hutchinson trace estimator is used to calculate the cumulative trace. ; Step S5: Substitute the results from steps S3 and S4 into the loss function formula to obtain the loss value, and update the parameters of the velocity field network through backpropagation. .
[0102] The above training process, through repeated iterations, enables the velocity field network to... We gradually learn the optimal continuous transformation path from the standard normal distribution to the real electricity price distribution.
[0103] After the model completes training, it transitions to the electricity price scenario generation stage, starting from the standard normal distribution. Independent sampling Using an initial sample, each sample is taken as an initial value, and the result is obtained through a forward ordinary differential equation solver. Corresponding future electricity price scenarios:
[0104] this These scenarios constitute a discrete approximate set of the conditional probability distribution of nodal electricity prices, fully characterizing the distribution pattern of electricity prices, including mean trend, fluctuation range and tail characteristics, providing sufficient full probability information for virtual power plant trading decisions and risk management.
[0105] Step 3: Based on the scenario set, adjust the interval width online through adaptive consistency inference to obtain a prediction interval that converges to a preset confidence level.
[0106] To achieve online adaptive calibration of the probability prediction interval, ensure coverage meets the preset confidence level, and simultaneously capture tail risks caused by intensified market competition, dynamically outputting an extreme electricity price warning index, this step proposes an online interval calibration method based on Adaptive Consistent Inference (ACI), specifically including: The core objective of the adaptive consistency calibration online interval calibration method is to ensure that the actual coverage of the prediction interval converges to a preset confidence level (such as 1-α) in the long term under non-stationary market conditions, avoiding the problem of fixed quantile intervals being too wide or too narrow due to distribution drift. Specific implementations include: For those obtained through conditional continuous normalized flow sampling Future electricity pricing scenarios Calculate the expected electricity price As the center of the interval:
[0107] Simultaneously, the scene samples are arranged in ascending order, and empirical quantiles are defined. For the sorted number Based on the sample values, an initial prediction interval based on fixed quantiles is constructed:
[0108] in The significance level is the preset value, usually set to 0.05. and These are the lower and upper bounds of the prediction interval, which is directly given by the quantiles of the generating distribution.
[0109] As electricity market pricing, supply and demand dynamics, and game theory continue to evolve, fixed quantile intervals often fail to maintain stable empirical coverage in long-term applications. When market volatility intensifies, the interval may be too narrow, resulting in insufficient actual coverage, while when volatility is moderate, the interval may be too wide, wasting forecast information.
[0110] Therefore, this embodiment introduces a real-time adjustable width scaling factor. If an interval width adjustment parameter is maintained for each prediction time t, then the actual prediction interval boundary is:
[0111] in The initial half-width is determined by the initial quantile interval width:
[0112] This design simplifies the interval adjustment task to a single parameter. Online updates: When When, the interval is equivalent to the initial quantile interval; when The time interval is enlarged to increase the coverage probability. The time interval is narrowed, reducing the probability of coverage.
[0113] At each prediction time The actual electricity price at that point in time Once disclosed, it can be determined whether it falls within the current prediction range, and the prediction can be updated accordingly. Update the adjustment parameters according to the following rules:
[0114] in, As an indicator variable, it takes the value 1 when the condition inside the parentheses is true, and 0 otherwise; This represents the learning rate, which is usually a small positive value, such as 0.01.
[0115] Through real-time online updates, The learning rate will be continuously adjusted based on historical coverage bias. It strikes a balance between adaptive speed and stability. This mechanism does not require assumptions about the form of electricity price distribution, but relies solely on real-time observation feedback. It can automatically adapt to sudden changes in market volatility, seasonality, and game dynamics, ensuring that the prediction range maintains reliable probability coverage in long-term operation and providing a stable risk quantification boundary for virtual power plants.
[0116] Step 4: Construct a generalized extreme value distribution based on the implicit encoding vector, and calculate the extreme electricity price early warning index.
[0117] The core of the game-aware conditional generalized extreme value tail modeling method lies in using the implicit encoding vector obtained from the game inference network as a dynamic adjustment factor to drive the parameters of the generalized extreme value distribution (GEV) to adaptively change with the game situation, thereby achieving refined modeling and sensitive early warning of extreme electricity price tail risks. Specific implementations include: For the target node Using a rolling time window, such as the past 30 days, the highest daily electricity price within the window is extracted as the extreme value observation, forming an extreme value sample set:
[0118] in This represents the total number of trading days within the window, and the corresponding latent game vector for each trading day is extracted. This allows each extreme value sample to be correlated with the market dynamics of that day.
[0119] Generalized extremum theory states that independent and identically distributed extremum samples asymptotically follow a GEV distribution. In this implementation, given the game's latent vectors, the conditional distribution of the daily peak electricity price follows a GEV form, and its cumulative distribution function is:
[0120] Where ξ is the shape parameter, and These are the mean and variance, respectively. These parameters are determined by the implicit encoding vector obtained from the game inference network.
[0121] in, , , These are the neural network weight parameters corresponding to the three parameters; , , This corresponds to the drift coefficient; It is the hyperbolic tangent function.
[0122] To estimate the parameter set in the GEV network under the above conditions This embodiment employs the maximum likelihood estimation (MLE) principle. Using historical extreme value samples as monitoring signals, a log-likelihood function is constructed:
[0123] in Let be the probability density function of the GEV distribution. This objective function measures how well the model-predicted extreme value distribution fits the historical observed extreme values under the current game conditions. By maximizing this log-likelihood using optimization algorithms such as gradient descent, a conditional extreme value model that can adaptively adjust its shape based on the game's latent vectors can be trained.
[0124] The advantage of this design is that when the market concentration index (HHI) in the game's latent vector increases significantly and the residual supply index (RSI) decreases sharply, the network will automatically output a larger value. And more positive This causes the upper tail quantile of the GEV distribution to automatically shift towards higher electricity prices, achieving a game-sensitive dynamic extremum description.
[0125] After obtaining the conditional GEV distribution, it needs to be transformed into an intuitive and actionable early warning signal for use by the virtual power plant trading decision-making system.
[0126] First, the expected electricity price is output by combining the continuous normalized flow model. Based on the upper tail information of the conditional GEV distribution, the Extreme Spike Warning Index (ESWI) is defined.
[0127] For the target time period, first calculate the given confidence level. Conditional GEV quantiles at (e.g., 0.95):
[0128] The early warning index can then be constructed as follows:
[0129] ESWI measures the premium of extreme high prices relative to "normal expectations" under the current market dynamics. A higher ESWI value indicates a higher tail risk premium and a more severe threat to virtual power plant revenue from extreme electricity price events.
[0130] Finally, a risk warning threshold is set. When calculated in real time The system will trigger an early warning at that time. This means that even if current expected electricity prices appear stable, market dynamics have significantly increased the risk of extremely high prices.
[0131] At this point, the system sends a signal to the virtual power plant's trading decision module, prompting it to take timely defensive strategies, such as: reducing the amount of electricity declared during high-price periods to reduce the risk of losses, increasing the reserve capacity of the energy storage system during peak periods, purchasing financial transmission rights in advance to lock in transmission costs, or adjusting the quotation curve to avoid potential extreme spot price shocks.
[0132] Example 2 Based on the method described in Embodiment 1, the purpose of this embodiment is to provide a virtual power plant spot trading node electricity price prediction and risk warning system, including: a multimodal condition vector embedding module, used to obtain topology-aware embedding vector, temporal probability embedding vector, implicit encoding vector and market rule encoding vector, and construct a multimodal condition vector; The probability prediction module inputs the multimodal conditional vector into the continuous normalized flow model to obtain the conditional probability density of nodal electricity prices and samples it to generate a scenario set. The interval calibration module is used to adjust the interval width online based on the scene set through adaptive consistency inference, so as to obtain a prediction interval that converges to a preset confidence level. The risk warning module is used to construct a generalized extreme value distribution based on implicit encoding vectors and calculate the extreme electricity price warning index.
[0133] Example 3 The purpose of this embodiment is to provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described method.
[0134] Example 4 The purpose of this embodiment is to provide a computer-readable storage medium.
[0135] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the above method.
[0136] The steps and methods involved in the apparatus of the above embodiments correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood as including any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and enabling the processor to perform any of the methods in this invention.
[0137] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any particular combination of hardware and software.
[0138] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A method for predicting electricity prices and providing risk warnings at virtual power plant spot trading nodes, characterized in that... include: Obtain topology-aware embedding vectors, temporal probability embedding vectors, implicit encoding vectors, and market rule encoding vectors to construct multimodal conditional vectors; The multimodal conditional vector is input into the continuous normalized flow model to obtain the conditional probability density of nodal electricity prices and sample to generate a scenario set; Based on the scenario set, the interval width is adjusted online through adaptive consistency inference to obtain a prediction interval that converges to a preset confidence level; A generalized extreme value distribution is constructed using implicit encoding vectors as conditions, and an extreme electricity price early warning index is calculated.
2. The method for predicting electricity prices and providing risk warnings for virtual power plant spot trading nodes as described in claim 1, characterized in that, The acquisition of the topology-aware embedding vector is specifically as follows: The power system topology is constructed as a directed graph. The load level, predicted output of distributed generation, historical node electricity price, line capacity margin and voltage level code of each node are extracted as initial features, and an adjacency matrix is constructed based on the line admittance. The attention weights between nodes and their neighbors are calculated using a graph attention network, and the topology-aware embedding vector is output after weighted aggregation and activation function.
3. The method for predicting electricity prices and providing risk warnings for virtual power plant spot trading nodes as described in claim 1, characterized in that, The acquisition of the temporal probability embedding vector is specifically as follows: The historical load sequence, distributed power generation output sequence and time features are concatenated into a joint input, which is then linearly mapped and encoded before being input into the Transformer encoder. The mean of the sequence output is taken as the summary vector. The summary vector is mapped to the mean and variance of the latent variable distribution, and the temporal probability embedding vector is obtained through reparameterized sampling.
4. The method for predicting electricity prices and providing risk warnings for virtual power plant spot trading nodes as described in claim 1, characterized in that, The implicit encoding vector is obtained as follows: After flattening the price stack features, they are concatenated with the Herfindahl-Hirschman index, the remaining supply index, and the virtual power plant open interest ratio to form a joint input vector. After nonlinear transformation and feature abstraction through a multi-layer fully connected network, the output layer is linearly mapped to the latent space to obtain the implicit encoding vector.
5. The method for predicting electricity prices and providing risk warnings for virtual power plant spot trading nodes as described in claim 1, characterized in that, The market rule encoding vector is obtained as follows: Discrete market rule types are mapped to dense vectors through an embedding layer, and the resulting vectors are multiplied by the corresponding continuous strength coefficients to output the market rule encoding vector.
6. The method for predicting electricity prices and providing risk warnings for virtual power plant spot trading nodes as described in claim 1, characterized in that, The step of inputting multimodal conditional vectors into a continuous normalized flow model to obtain the conditional probability density of nodal electricity prices and sampling to generate a scenario set specifically includes: Using the current state, virtual time, and multimodal condition vector as input, a velocity field neural network describes the continuous evolution of the electricity price state from the basic distribution to the target distribution. With the goal of maximizing the conditional log-likelihood, an ordinary differential equation solver is used to calculate the initial state and its log probability. After training, multiple electricity price scenarios are generated by sampling from the basic distribution and passing through a forward solver.
7. The method for predicting electricity prices and providing risk warnings for virtual power plant spot trading nodes as described in claim 1, characterized in that, The conditional logarithmic probability density is determined in the following manner: The conditional logarithmic probability density is determined in the following manner: in, For electricity price series, For multimodal condition vectors, For velocity field neural networks, The trace of the Jacobian matrix, the electricity price sequence The continuous time state is The initial state is .
8. A virtual power plant spot trading node electricity price prediction and risk early warning system, characterized in that, include: The multimodal conditional vector embedding module is used to obtain topology-aware embedding vectors, temporal probability embedding vectors, implicit encoding vectors, and market rule encoding vectors to construct multimodal conditional vectors. The probability prediction module inputs the multimodal conditional vector into the continuous normalized flow model to obtain the conditional probability density of nodal electricity prices and samples it to generate a scenario set. The interval calibration module is used to adjust the interval width online based on the scene set through adaptive consistency inference, so as to obtain a prediction interval that converges to a preset confidence level. The risk warning module is used to construct a generalized extreme value distribution based on implicit encoding vectors and calculate the extreme electricity price warning index.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the virtual power plant spot trading node electricity price prediction and risk warning method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it performs the steps of the virtual power plant spot trading node electricity price prediction and risk warning method as described in any one of claims 1-7.