A new energy scene generation method and system considering uncertainty

CN122388522BActive Publication Date: 2026-10-30NARI TECH CO LTD +2
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202610858986.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-15
Publication Date
2026-10-30
Estimated Expiration
2046-06-15

AI Technical Summary

Technical Problem

[0007]为解决现有新能源场景生成方法存在条件特征物理约束弱、模型注意力计算复杂度高,且极易生成违背电网实际运行边界的非物理毛刺等问题,使场景难以直接满足日前安全调度需求

Benefits of technology

1.本发明针对日前调度需求,提炼风电/光伏可解释、可数字化、可调控的形态特征(平均功率、峰谷值、波动率、最大爬坡、日照时数等),替代传统方法所用的原始时序/气象粗粒度条件,从数据输入源头让场景生成具备物理意义与可控性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122388522B_ABST
    Figure CN122388522B_ABST
Patent Text Reader

Abstract

The application discloses a new energy scene generation method and system considering uncertainty. The method comprises the following steps: extracting controllable morphological features of historical output data and mapping the controllable morphological features into high-dimensional feature sequences; generating a global conditional feature vector by combining a lower bound of variational inference and a cosine similarity joint loss function optimization; constructing a diffusion probability model, introducing a sparse cross-attention mechanism in the denoising network of the diffusion probability model, dynamically screening a query vector according to a divergence measure to perform fine attention calculation, and using a global conditional feature to determine the weighting of the unselected query vector; in the reverse denoising sampling stage, a physical constraint penalty function is constructed by using a physical boundary parameter, and the sampling mean output by the denoising network is corrected in real time through the energy gradient of the physical constraint penalty function, and finally, a new energy scene is generated. The application effectively reduces the non-physical burrs in the generated sequence while reducing the model reasoning algorithm consumption, and realizes high-fidelity scene generation strictly in accordance with the safe boundary of power grid operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of novel power system optimization scheduling, and specifically relates to a method and system for generating new energy scenarios that take into account uncertainties. Background Technology

[0002] Under the "dual carbon" target, my country's renewable energy installed capacity has maintained rapid development, and the continuous increase in renewable energy penetration has brought significant challenges to the safe and stable operation of the power system due to the strong uncertainty of renewable energy output. Effectively describing the uncertainty of renewable energy output is key to overcoming these challenges. Existing research mainly uses scenario-based and interval-based methods to describe and analyze the uncertainty of renewable energy output. Scenario-based methods, by discretizing the stochastic distribution of renewable energy output through multi-state analysis, can embed more fluctuation details into the optimization model, thus providing a more robust and stable scheduling scheme.

[0003] Since scene accuracy directly determines how closely the stochastic optimization solution matches the actual optimal value, generating high-quality new energy day-ahead scenes has become a current research hotspot in scene analysis methods. Common current scene generation methods introduce relevant conditional information to model conditional probability distributions, incorporating elements such as seasons, weather, and forecast information into the scene generation process to guide it. However, existing methods have significant limitations in condition selection, feature encoding, and condition injection mechanisms, resulting in insufficient model generalization and interpretability, high computational complexity, slow inference, and an inability to effectively establish the correlation between scene generation and physical scheduling operation boundaries.

[0004] For example, the publication number CN119443987B, "A Method and System for Generating Scenery of Shagohuang Based on Conditional Diffusion Model," only uses the twenty-four solar terms as the division intervals of historical time series, which is difficult to accurately depict the complex uncertainty of the day-ahead output. The simple MLP network for solar term label mapping lacks in-depth mining of temporal dependencies and cannot capture the long-term and short-term temporal characteristics of wind and solar output. The lack of an effective attention mechanism to establish a dynamic mapping relationship between conditional features and the denoising process, and the relatively crude conditional injection method, leads to an imbalance between the diversity and realism of the generated scenes.

[0005] For example, CN121581478A, "A Method for Generating Renewable Energy Scenarios Based on an Improved Conditional Diffusion Model," only uses the day-ahead forecast and weather classification as conditions, without extracting the physical morphological features specific to wind power / photovoltaics. It only uses linear layer mapping and simple concatenation to process the conditions, resulting in extremely simple feature encoding, low feature discrimination, and poor generalization. It cannot distinguish subtle differences between similar scenarios and is prone to overfitting / generalization failure under small sample sizes. In addition, the method uses full cross-attention, which has high computational complexity and slow inference, and is prone to introducing irrelevant conditional noise. Furthermore, it lacks screening and fallback mechanisms, leading to low accuracy of conditional fusion and easy distortion of scenarios.

[0006] In summary, existing methods for generating new energy scenarios mainly face the following technical bottlenecks: First, the granularity of input conditions is coarse and lacks physical constraints, deviating from the boundary requirements of actual power grid dispatch. Second, the shallow feature mining leads to easy confusion and weak discriminative power of conditional features in high-dimensional space. Third, the attention fusion mechanism is redundant, consuming a lot of computing power and easily generating non-physical glitches. These pain points collectively result in serious deficiencies in the realism, timeliness, and physical reliability of generated scenarios in existing methods, urgently requiring a novel scenario generation architecture to meet the high standards required for the safe and stable operation of the power grid. Summary of the Invention

[0007] To address the shortcomings of existing renewable energy scenario generation methods, such as weak physical constraints on conditional features, high computational complexity of model attention, and a tendency to generate non-physical spikes that violate the actual operating boundaries of the power grid, making it difficult for scenarios to directly meet the day-ahead safety dispatch requirements, this invention provides a renewable energy scenario generation method and system that considers uncertainty. The method includes: extracting controllable morphological features from historical power output data and mapping them to a high-dimensional feature sequence; optimizing and generating a global conditional feature vector by combining a joint loss function of variational inference lower bound and cosine similarity; constructing a diffusion probability model, introducing a sparse cross-attention mechanism into its denoising network, dynamically selecting query vectors based on divergence metrics to perform fine-grained attention calculations, and using global conditional features to perform deterministic fallback weighting on unselected query vectors; in the inverse denoising sampling stage, constructing a physical constraint penalty function using physical boundary parameters, and real-time correcting the sampling mean output of the denoising network using its energy gradient, ultimately generating the renewable energy scenario. This invention effectively reduces non-physical spikes in the generated sequence while lowering the computational cost of model inference, achieving high-fidelity scenario generation that strictly conforms to the safety boundaries of power grid operation.

[0008] The present invention adopts the following technical solution.

[0009] In a first aspect, the present invention provides a method for generating new energy scenarios that takes into account uncertainty, comprising: Acquire historical power output time-series data of new energy sources and extract controllable morphological features; The controllable morphological features are subjected to feature mapping to obtain a high-dimensional feature sequence; the high-dimensional feature sequence is then subjected to aggregation mapping to generate a global conditional feature vector. A diffusion probability model is constructed, and a denoising neural network is used as the inverse denoising network of the diffusion probability model; A query vector is generated based on the hidden layer features of the denoising neural network, and a key vector and a value vector are generated based on the high-dimensional feature sequence. The query vector is then filtered according to the divergence measure between the query vector and the key vector to generate a selected query vector and an unselected query vector. A selected query result is generated using the selected query vector, the key vector, and the value vector. The value vector is then weighted and summed using the global conditional feature vector to generate an unselected query result. The selected query result and the unselected query result are then recombined, and the recombined result is injected into the denoising neural network. A physical constraint penalty function is constructed using the physical boundary parameters in the controllable morphological features, and the sampling mean of the output of the denoising neural network is corrected based on the gradient of the physical constraint penalty function; a new energy scenario is generated based on the corrected sampling mean.

[0010] Preferably, controllable morphological features are extracted, specifically including: The historical output time series data of the new energy source is divided into days to obtain multiple daily output sequences; For wind power generation scenarios, the average power, maximum power, minimum power, power standard deviation, power fluctuation, and maximum ramp are extracted from the daily power generation sequence as the controllable morphological features. For solar power generation scenarios, the average power, maximum power, power standard deviation, power fluctuation, maximum ramp, and sunshine duration are extracted from the daily power sequence as the controllable morphological features.

[0011] Preferably, feature mapping is performed on the controllable morphological features to obtain a high-dimensional feature sequence, specifically including: The controllable morphological features are normalized to obtain a normalized feature vector; Each feature component in the normalized feature vector is input into multiple parallel multilayer perceptron subnetworks for feature mapping, and the outputs of the multiple parallel multilayer perceptron subnetworks are concatenated to generate an initial feature sequence. Sine position codes are injected into the initial feature sequence to obtain the high-dimensional feature sequence.

[0012] Preferably, updating the network parameters corresponding to the global conditional feature vector specifically includes: The high-dimensional feature sequence is subjected to global average pooling and linear mapping in sequence to obtain a non-normalized mean vector; The global conditional feature vector is obtained by performing L2 normalization on the denormalized mean vector. Calculate the distribution divergence between the posterior distribution corresponding to the unnormalized mean vector and the standard normal distribution to generate the variational inference lower bound loss; Cosine similarity is calculated based on the global conditional feature vectors of different samples within a batch, and cosine similarity discrimination loss is generated based on the cosine similarity exceeding a set threshold. The joint loss function is constructed based on the variational inference lower bound loss and the cosine similarity discrimination loss, and the network parameters of the denoising neural network are updated using the joint loss function.

[0013] Preferably, the query vector is filtered based on the divergence metric between the query vector and the key vector to generate selected and unselected query vectors, specifically including: Calculate the scaled dot product score of the query vector and all the key vectors respectively; For each query vector, calculate the maximum value and arithmetic mean of all the corresponding scaling dot product scores, and use the difference between the maximum value and the arithmetic mean as the corresponding query divergence index; The number of key queries is determined based on the preset sparse sampling ratio; All query vectors are sorted in descending order according to their corresponding query divergence indices. The query vectors with the highest number of key queries are selected as the selected query vectors, and the remaining query vectors are selected as the unselected query vectors.

[0014] Preferably, the value vector is weighted and summed using the global conditional feature vector to generate unselected query results, specifically including: The global conditional feature vector is processed sequentially through linear mapping and normalized exponential function to generate a global catch-all weight vector; For all the unselected query vectors, the global fallback weight vector is used to perform a weighted summation on each of the value vectors generated from the high-dimensional feature sequence to generate the corresponding unselected query results.

[0015] Preferably, a physical constraint penalty function is constructed using the physical boundary parameters in the controllable morphological features, and the sampling mean of the denoising neural network output is corrected based on the gradient of the physical constraint penalty function, specifically including: During the reverse sampling process of the denoising neural network, the maximum power and minimum power in the controllable morphological features are extracted; when the single time step output value of the current denoising step generation state is greater than the maximum power or less than the minimum power, the sum of squares of the corresponding output over-limit difference is calculated as the upper and lower limit penalty terms for output. Obtain the maximum ramp rate among the controllable morphological features; when the absolute value of the output power fluctuation of the generation state of the current denoising step is greater than the maximum ramp rate, calculate the sum of squares of the corresponding ramp rate boundary difference as a ramp rate penalty term. The physical constraint penalty function is obtained by adding the upper and lower limit penalty terms of output and the gradeability penalty term. Calculate the partial derivative of the physical constraint penalty function with respect to the generation state of the current denoising step to obtain the physical penalty gradient; The offset is obtained by multiplying the physical penalty gradient by a preset step size coefficient, and the offset is subtracted from the sample mean predicted by the denoising neural network to obtain the corrected sample mean.

[0016] Secondly, the present invention provides a new energy scenario generation system that takes into account uncertainty, comprising: The feature extraction module is used to acquire historical power output time-series data of new energy sources and extract controllable morphological features; The conditional feature encoding and optimization module is used to perform feature mapping on the controllable morphological features to obtain a high-dimensional feature sequence; and to perform aggregation mapping on the high-dimensional feature sequence. A diffusion model construction module is used to construct a diffusion probability model and uses a denoising neural network as the inverse denoising network of the diffusion probability model. A sparse cross-attention processing module is used to generate query vectors based on the hidden layer features of the denoising neural network, and generate key vectors and value vectors based on the high-dimensional feature sequence; to filter the query vectors according to the divergence metric between the query vectors and the key vectors, generating selected query vectors and unselected query vectors; to generate selected query results using the selected query vectors, the key vectors, and the value vectors; to generate unselected query results by weighted summation of the value vectors using the global conditional feature vectors; and to recombine the selected query results and unselected query results, and inject the recombination result into the denoising neural network. The physical constraint guidance and generation module is used to construct a physical constraint penalty function using the physical boundary parameters in the controllable morphological features, and to correct the sampling mean of the output of the denoising neural network based on the gradient of the physical constraint penalty function; and to generate a new energy scenario based on the corrected sampling mean.

[0017] Thirdly, the present invention provides a terminal, including a processor and a storage medium; the storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method.

[0018] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method.

[0019] The beneficial effects of this invention are compared with those of the prior art: 1. This invention addresses day-ahead scheduling needs by extracting interpretable, digitizable, and controllable morphological characteristics (average power, peak-to-valley values, volatility, maximum ramp rate, sunshine duration, etc.) of wind / solar power to replace the coarse-grained time-series / meteorological conditions used in traditional methods, enabling scenario generation to possess physical meaning and controllability from the data input source.

[0020] 2. This invention designs a Transformer-based feature encoder that maps controllable morphological feature sequences to a high-dimensional embedding space, amplifying subtle differences between different scenarios and solving the problems of low feature discriminative power and weak generalization ability with small samples in traditional encoding methods. Furthermore, it utilizes variational inference lower bounds and cosine similarity to construct a joint loss function. This mechanism effectively optimizes the manifold structure of features, amplifies subtle differences between different meteorological scenarios, and improves feature discriminative power and the model's generalization ability with small samples.

[0021] 3. This invention proposes a KL divergence-guided sparse cross-attention mechanism and employs a deterministic fallback weighting based on global features for unselected nodes. It overcomes the limitations of traditional self-attention mechanisms, which can only model single-sequence dependencies and suffer from low overall computational efficiency. This mechanism achieves dynamic selective fusion of denoised hidden layer features and morphological feature embeddings, reducing computational load while improving the accuracy of conditional information injection.

[0022] 4. This invention constructs a conditional denoising diffusion model guided by both morphological features and physical boundaries, transforming rigid physical operational boundaries into differentiable penalty functions and using energy gradients to correct the drift of the sampled mean in real time. Without requiring network retraining, it solves the problems of sequence mutation and boundary overflow, ensuring that the generated scenarios fully meet the physical safety constraints of power grid dispatching, while also considering high-dimensional distribution fitting and temporal-physical consistency. Attached Figure Description

[0023] Figure 1 This is a schematic diagram of a new energy scenario generation method considering uncertainties provided by an embodiment of the present invention; Figure 2 This is a schematic diagram of the internal structure of the feature encoder and the high-dimensional conditional feature generation process provided in the embodiments of the present invention; Figure 3 This is a schematic diagram of the operation mechanism of the morphological feature-guided diffusion probability model provided in the embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The embodiments described in this application are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of this invention.

[0025] Example 1: A method for generating new energy scenarios considering uncertainty is based on constructing an improved cross-attention-denoising diffusion probability model guided by controllable morphological features and incorporating sparse sampling and a deterministic fallback mechanism. This model achieves highly controllable, stable, and high-fidelity generation of day-ahead new energy output scenarios, such as... Figure 1 As shown, the overall architecture of this generation method mainly includes a feature extraction and encoding branch, a forward denoising branch of the diffusion model, and a reverse branch where the two are conditionally fused in the denoising model to finally generate the scene. Specifically, it includes the following steps: Step 1: Obtain historical power output time series data of new energy sources and extract controllable morphological features.

[0026] Extracting controllable morphological features specifically includes: The historical output time series data of the new energy source is divided into days to obtain multiple daily output sequences; For wind power generation scenarios, the average power, maximum power, minimum power, power standard deviation, power fluctuation, and maximum ramp are extracted from the daily power generation sequence as the controllable morphological features. For solar power generation scenarios, the average power, maximum power, power standard deviation, power fluctuation, maximum ramp, and sunshine duration are extracted from the daily power sequence as the controllable morphological features.

[0027] In a preferred but non-limiting embodiment of the present invention, step 1 specifically includes: First, the data collection and preprocessing time span covers a complete calendar year, with a sampling time resolution of [missing information]. Historical power output time series data for wind and solar power, such as The time allotted is 15 minutes. The raw data is preprocessed, including outlier removal and interpolation to fill in missing values.

[0028] Based on the fluctuation characteristics of new energy power output and the day-ahead scheduling operation requirements, in order to extract controllable morphological features with clear physical meaning, quantifiable digitization, and constrainable regulation, the preprocessed annual time series data is divided into natural days to obtain multiple daily power output sequences of length T (at 15-minute resolution). For the output sequence of the i-th natural day. ,in Let t be the actual output value at the t-th time step. Then, extract the controllable morphological features of wind power and photovoltaic power respectively.

[0029] For wind power generation scenarios, six controllable characteristics are defined, including average power, maximum power, minimum power, power standard deviation, average power fluctuation, and maximum ramp rate. Specifically, they are expressed as follows: (1) Average power :

[0030] (2) Maximum power :

[0031] (3) Minimum power :

[0032] (4) Power standard deviation :

[0033] (5) Power fluctuation :

[0034] (6) Maximum Climb :

[0035] in, t=1,2,...,T It is a time-series index; max ( This operation takes the maximum value of the input sequence. min ( The minimum value operation is performed on the input sequence; | This is an operation that takes the absolute value of the input sequence. Average power directly describes the basic power generation situation on a given day; maximum and minimum power describe the extreme power values ​​of wind power generation within a day, and can describe the daily peak-valley difference in wind power generation scenarios; power standard deviation can quantify the degree of dispersion of power around the mean, reflecting the overall stability of daily power generation; power fluctuation describes the degree of fluctuation in wind power generation; maximum ramp reflects the ability of wind power to change abruptly in a short period of time.

[0036] Similarly, six controllable morphological characteristics are defined for solar power generation scenarios. Since solar energy cannot generate electricity at night, no minimum power is specified. Considering that solar energy is affected by sunrise and sunset times, resulting in a different effective power generation period compared to wind power, sunshine duration is set as a controllable morphological characteristic for solar power generation scenarios, replacing the minimum power:

[0037] in, and These represent the start and end time step indices of the photovoltaic system's daily continuous output being greater than zero, respectively. This refers to sunshine hours. The calculation methods for the other five controllable morphological characteristics of the solar power generation scenario (average power, maximum power, power standard deviation, average power fluctuation, and maximum ramp rate) are the same as those for the wind power generation scenario described above.

[0038] Step 2: Perform feature mapping on the controllable morphological features to obtain a high-dimensional feature sequence; perform aggregation mapping on the high-dimensional feature sequence to generate a global conditional feature vector.

[0039] After obtaining the controllable morphological features of the aforementioned scenario, they are input into a Transformer-based feature encoder. This encoder maps low-dimensional statistical features to a high-dimensional space, generating embedded features, thereby deeply mining the implicit information behind the feature metrics. The specific process is as follows: Figure 2 As shown. It mainly includes feature normalization, multi-scale subspace decoupling, Transformer feature encoding, and high-dimensional embedding feature generation based on variational metric learning. Specifically, it includes: Step 2.1: Normalize the controllable morphological features to obtain a normalized feature vector.

[0040] In a preferred but non-limiting embodiment of the present invention, step 2.1 specifically includes: First, the extracted m-dimensional statistical features Normalization is performed:

[0041] in, These are the normalized eigenvectors. , Let m be an m-dimensional real vector space, where m This is the original feature dimension; combined with step 1, we know that m=6 in wind power or photovoltaic scenarios; It is the mean vector of the features; It is the standard deviation vector of the feature; the division operation in the above formula is an element-by-element division between vectors.

[0042] Step 2.2: Multi-scale subspace projection Each feature component in the normalized feature vector is input into multiple parallel multilayer perceptron subnetworks for feature mapping, and the outputs of the multiple parallel multilayer perceptron subnetworks are concatenated to generate an initial feature sequence.

[0043] In a preferred but non-limiting embodiment of the present invention, step 2.2 specifically includes: Normalized eigenvectors Each feature component in The inputs are projected onto a complementary subspace through K parallel MLP (Multilayer Perceptron) subnetworks. To ensure the homogeneity of the input distribution of each subnetwork, a normalization layer is introduced before each MLP subnetwork to obtain a multi-scale fused feature vector. After concatenation, the initial representation vector corresponding to the j-th morphological feature is obtained.

[0044] Among them, Concat[ The symbol ] represents vector concatenation; the feature dimension of the output of each parallel MLP sub-network is d / K, and the total feature dimension after concatenation is d. In this embodiment, the output feature dimension d is 256; by designing a subspace decoupling mechanism, an initial feature sequence containing m d-dimensional vectors is generated. Each parallel branch captures different frequency components of the feature: the low-frequency subspace encodes long-term trends (low-frequency components), and the high-frequency subspace captures short-term fluctuations (high-frequency components).

[0045] This invention replaces the traditional single fully connected layer mapping with a subspace decoupling mechanism consisting of K parallel multilayer perceptron subnetworks. This design enables the system to simultaneously capture the long-term low-frequency trend and short-term volatility of the same morphological feature component in different parallel feature subspaces. This effectively avoids the information collapse or bottleneck problem that occurs when low-dimensional physical statistical features are projected linearly into a high-dimensional latent space, preserving richer physical constraint boundary information for the subsequent diffusion denoising process.

[0046] Step 2.3: Morphological Position Encoding Injection Sine position codes are injected into the initial feature sequence to obtain the high-dimensional feature sequence.

[0047] In a preferred but non-limiting embodiment of the present invention, step 2.3 specifically includes: To address the lack of position awareness in the Transformer's self-attention mechanism and accurately distinguish and capture the independent attribute differences of various controllable morphological features (such as average power and maximum ramp rate), a sinusoidal positional encoding is injected into the feature vector before inputting the multi-scale fused feature vector into the Transformer encoding layer. The positional encoding formula is as follows:

[0048] In the formula: j : Sequence position index of the morphological feature sequence, corresponding to different controllable morphological features in different scenarios. In this embodiment, the value range is . 1≤j≤m ; i Feature dimension index, with a value range of: 0≤i <d / 2 ; d The dimension of the multi-scale fusion feature is fixed at 256 in this invention; 10000: Wavelength control coefficient (scaling base) for sinusoidal position coding, used to constrain the wavelength range of position coding, ensuring that the coding of different temporal positions has global uniqueness, and is a common standard hyperparameter in the field of Transformer temporal modeling.

[0049] The high-dimensional feature sequence of the Transformer encoding layer after injection position encoding contains m feature vectors, where the input feature vector corresponding to the j-th morphological feature is calculated as follows:

[0050] In the formula: This represents the feature vector corresponding to the j-th morphological feature of the initial feature sequence output in step 2. This represents the d-dimensional position encoding vector corresponding to the j-th position. This represents the high-dimensional feature vector after the injection position is encoded.

[0051] Step 2.4: Forward Propagation of the Transformer Coding Layer Build N layer Transformer coding layer ( N layer =4) Learning nonlinear mappings, each layer contains two sub-modules: multi-head self-attention and feedforward network. Each sub-module introduces residual connections and layer normalization to achieve stable training. The complete forward propagation formula is as follows: (1) Multi-head self-attention submodule

[0052] In the formula: l Layer index for Transformer encoding layer ( l =1,2,..., N layer ); For the first l The intermediate feature sequence output by the multi-head self-attention submodule in the Transformer encoding layer; For the first l The output features of layer 1, when l When =1, This is the high-dimensional feature sequence after encoding the injection positions, output from step 2.3; LN( ) is for layer normalization; MHSA ( () is a multi-head self-attention computation, and the output is a feature vector with the same dimension as the input.

[0053] (2) Feedforward Network FFN Submodule

[0054] in, For the first l The final output feature sequence after the Transformer encoding layer passes through the FFN submodule; FFN is a position-wise feedforward network, consisting of two fully connected layers combined with the GELU non-linear activation function, targeting the vector of each controllable morphological feature in the sequence. The complete calculation formula is:

[0055] In the formula: The input features of FFN, i.e. After layer normalization, the corresponding single feature vector has a dimension of d=256; , The weights and biases of the first fully connected layer are designed with a 4x dimension increase to enhance feature fitting capability. The weights and biases of the second fully connected layer are used to restore the feature dimension to d=256; GELU( ) is the activation function of the Gaussian error linear unit, GELU(x) = x Φ(x), where Φ(x) is the cumulative distribution function of the standard Gaussian distribution.

[0056] Through the global self-attention interaction of the aforementioned multi-layer Transformer encoder, the implicit nonlinear coupling relationship between different controllable morphological features can be fully explored, and a high-dimensional feature sequence with a global perspective can be output.

[0057] Step 2.5: Latent Space Feature Optimization and Output The high-dimensional feature sequence is sequentially subjected to global average pooling and linear mapping to obtain a denormalized mean vector; the denormalized mean vector is then L2 normalized to obtain the global conditional feature vector, i.e., the high-dimensional manifold embedding; the distribution divergence between the posterior distribution corresponding to the denormalized mean vector and the standard normal distribution is calculated to generate a variational inference lower bound loss; cosine similarity is calculated based on the global conditional feature vectors of different samples within a batch, and a cosine similarity discriminant loss is generated based on the cosine similarity exceeding a set threshold; the joint loss function is constructed based on the variational inference lower bound loss and the cosine similarity discriminant loss, and the network parameters of the denoising neural network are updated using the joint loss function.

[0058] In a preferred but non-limiting embodiment of the present invention, step 2.5 specifically includes: Finally, based on the deep metric learning and latent space regularization framework, a joint loss function is constructed to constrain the feature embedding process, thereby optimizing the embedding manifold structure and enhancing the discriminative power and inter-class separation of high-dimensional representations. The joint loss function directly constrains the output of the last layer of the Transformer encoding layer, which, after temporal global pooling and linear mapping, yields a denormalized mean vector. The specific process is as follows:

[0059]

[0060] In the formula: is the feature vector corresponding to the j-th morphological feature in the last layer of the Transformer; m is the total number of controllable morphological features; The global aggregated features are obtained after average pooling; The weight matrix is ​​a learnable linear mapping. This is the bias vector.

[0061] To ensure the output of the global conditional feature vector Located on the unit hypersphere, for the mapped features Perform L2 normalization:

[0062] Based on the above global conditional feature vector Constructing the joint framework objective function This directly constrains the above feature extraction process:

[0063] In the formula: λ is the balance coefficient, with a value range of λ∈[0.1,1], and is a learnable hyperparameter; The lower bound loss for latent space variational inference evidence is used to constrain unnormalized features. The rationality of the probability distribution; Cosine similarity is used as the discrimination loss to amplify the discriminative power of features from different scenes; The calculation is as follows:

[0064] In the formula: where, The posterior distribution for morphological feature embedding is assumed to follow a certain pattern in actual computation. It follows a normal distribution with constant mean and variance; For the prior distribution, it is usually taken as Standard normal distribution, whereI denoted as the identity matrix; DKL is the KL divergence. Under the Gaussian distribution assumption mentioned above, calculating this divergence is equivalent to applying a regularization penalty to the unnormalized mean vector, thereby forcing the feature distribution of the latent space to smoothly align with the standard normal distribution.

[0065] Calculate cosine similarity loss :

[0066] In the formula: Cosine similarity is used for feature embedding (since L2 normalization has been performed beforehand, cosine similarity is equivalent to vector dot product); τ is a similarity threshold (set to 0.5) to tolerate small fluctuations in extremely similar weather scenes, while forcibly separating features from different daily scenes on the hypersphere. N batch refers to the number of scene samples within a batch; The global conditional feature vectors of the i-th and j-th different samples within a batch.

[0067] The calculated latent space variational inference evidence lower bound loss and cosine similarity discrimination loss are weighted and summed using a preset learnable balance coefficient to construct the final joint loss function. During network training, the system uses this joint loss function to calculate the error gradient and directly updates the network parameters of the Transformer encoder and linear mapping layer through the backpropagation algorithm.

[0068] If only a single mean squared error or cross-entropy is used for constraints, multidimensional physical statistical features are prone to feature collapse and inter-class confusion when mapped to high-dimensional spaces. This invention addresses this by using variational inference lower bound loss to forcibly constrain the probability distribution of the latent space, ensuring the smoothness and physical rationality of feature embedding. Furthermore, by combining L2 normalization and cosine similarity discriminative loss, it forcibly widens the cosine distance between features from different meteorological scenarios on a unit hypersphere. This combined optimization solves the technical challenge of confusion in high-dimensional conditional features, providing highly discriminative physical condition guidance for downstream diffusion denoising networks.

[0069] Step 3: Construct a diffusion probability model and use a denoising neural network as the inverse denoising network of the diffusion probability model.

[0070] Specifically, a diffusion probability model is constructed, which learns the evolution of the data distribution by gradually adding noise, and then gradually removes the noise to generate a scene that conforms to the embedded features: The model consists of two processes: "diffusion" and "denoising," with a total of [number] diffusion / denoising steps. N step Establish global conditional feature vectors With new energy power scenarios The mapping relationship between them. For example... Figure 3 As shown, its specific mechanism is as follows: The diffusion process, also known as the forward process, is the process of converting initial renewable energy output into renewable energy. Gaussian noise is gradually added until the distribution approximates a standard Gaussian distribution. To identify the number of diffusion steps, the scene after n diffusion steps is denoted as... Its diffusion process can be represented as:

[0071] in , is the noise variance added to the data in the nth step; The sampled noise is standard Gaussian noise. Can be regarded as nth-order Markov process:

[0072] Among them, let Forward process cumulative variance parameter Then, for any scenario in step n... Can be directly from the initial scene The derivation leads to:

[0073] According to the above formula, as n continuously increases, It will tend to 0, eventually Converging to a Gaussian distribution .

[0074] The denoising process is also known as the backward diffusion process. The model starts from a known distribution. The noise reduction process is repeated to ultimately restore the scene distribution under the given features. .

[0075] Therefore, it is necessary to obtain the conditional distribution of each step in the denoising process. Here, a denoising network is used to map the conditional distribution, so the entire denoising process can also be represented as an n-order Markov chain:

[0076] The goal of denoising is to make the distribution of the output of the denoising neural network approximate as closely as possible to the fixed distribution given by the forward process. The morphological feature-guided conditional denoising diffusion model proposed in this embodiment uses the inverse conditional distribution predicted by the denoising network. Compared with the forward and posterior distributions based on the initial real scene The KL divergence between the two points is used as the loss function. This divergence corresponds to the negative evidence lower bound (ELBO), therefore a simplified diffusion loss function is adopted. Conduct network training:

[0077] In the formula: For a denoising neural network given the current noise state Time step n and high-dimensional morphological feature conditions The predicted noise estimate.

[0078] Therefore, the noise reduction process can be transformed into:

[0079] in, The posterior variance of the reverse process; when n>1, random noise is injected. When n=1, no noise is added, i.e., z=0; The noise estimate is the output of the denoising network, DN( ) represents a denoising neural network.

[0080] Step 4: Generate a query vector based on the hidden layer features of the denoising neural network, and generate a key vector and a value vector based on the high-dimensional feature sequence; filter the query vector according to the divergence measure between the query vector and the key vector to generate a selected query vector and an unselected query vector; generate a selected query result using the selected query vector, the key vector, and the value vector; perform a weighted summation of the value vector using the global conditional feature vector to generate an unselected query result; reassemble the selected query result and the unselected query result, and inject the reassembled result into the denoising neural network.

[0081] In a preferred but non-limiting embodiment of the present invention, step 4 specifically includes: Specifically, to incorporate macroscopic physical constraints into the denoising process, a dynamic mapping relationship between the hidden layer features and controllable morphological features needs to be established within each denoising iteration time step n of the denoising neural network described in step 3. An improved cross-attention mechanism is designed to selectively inject high-dimensional morphological features into the denoising process through a sparse sampling strategy, achieving refined controllable scene generation while reducing computational complexity. This includes the following sub-steps: Step 4.1: Feature Location Encoding Injection and Q, K, V Vector Generation First, extract the unpooled high-dimensional feature sequence output by the Transformer encoder in step 2. And the global conditional feature vector after global pooling in step 2.5. The hidden layer feature sequence of the denoising network at step n. and the unpooled high-dimensional feature sequence output by the feature encoder Positional encoding is introduced separately to preserve temporal and feature structure information:

[0082]

[0083] In the formula: Hidden layer features of the scenario for contributing to new energy sources during the nth denoising iteration; This is the diffusion time step position encoding function, and the input is the denoising iteration time step index n; The conditional feature dimension position encoding matrix is ​​generated by mapping the dimension index j of the controllable morphological features, where 1 ≤ j ≤ 1. m , m The dimension of the controllable morphological features is m=6 in this embodiment.

[0084] Then, the Query, Key, and Value vectors required for cross-attention are obtained through the projection matrix. Unlike self-attention, in this embodiment, the Query for cross-attention comes from the features of the denoising network, and the Key and Value come from the conditional embeddings output by the feature encoder.

[0085] In the formula: , , It is a learnable projection matrix.

[0086] Step 4.2: Query the divergence index calculation Calculate the scaled dot product score of the query vector and all the key vectors respectively; For each query vector, calculate the maximum value and arithmetic mean of all the corresponding scaling dot product scores, and use the difference between the maximum value and the arithmetic mean as the corresponding query divergence index.

[0087] During implementation, not every conditional feature is strongly correlated with the current denoising position. Calculating all cross-attention features is not only computationally complex but also prone to introducing irrelevant noise. Therefore, a KL divergence-based approximation selection mechanism is adopted, retaining only the Query-Key pairs with the largest difference between the attention distribution and the uniform distribution for calculation. This reduces model complexity and improves the fusion efficiency of key conditional features. The formula for calculating the difference metric is:

[0088] In the formula: is the query divergence index between the i-th Query and the set of condition keys, representing the significance of the attention to condition features at this denoising position; This is the i-th query vector; Let m be the total number of controllable morphological features, and j be the index of the number of controllable morphological features, where 1 ≤ j ≤ 1. m ; The feature dimension of the Key vector is used to scale the dot product result to prevent gradient vanishing or exploding.

[0089] First item The maximum attention score among the scaled dot product of the i-th query and all m key vectors; Second item : The arithmetic mean of the attention scores of the scaled dot product of the i-th query and all m key vectors.

[0090] Step 4.3: Dynamic Filtering Based on Divergence Metric (Top-K) The number of key queries is determined based on the preset sparse sampling ratio; All query vectors are sorted in descending order according to their corresponding query divergence indices. The query vectors with the highest number of key queries are selected as the selected query vectors, and the remaining query vectors are selected as the unselected query vectors.

[0091] Specifically, the sparse sampling selection mechanism based on query divergence metrics is implemented through a dynamic Top-K threshold filtering strategy. Specifically, the set of query divergence metrics for all Query-Key pairs is first calculated. , where N q Set the sparse sampling ratio coefficient for the number of queries. ρ ∈(0,1], in this embodiment, we take ρ =0.3, then the number of key query vector pairs retained is Query. K s :

[0092] in, It represents rounding up.

[0093] Based on the calculated query divergence index Sort in descending order and construct a sorted index sequence. :

[0094] Before selection K The selected query collection consists of s indexes:

[0095] The set of query indexes that were not selected is:

[0096] Here, argsort represents the sorting function that returns the index sequence of the array in descending numerical order; descending is a hyperparameter indicating the descending order. This indicates the set of indexes representing the selected query vector within the original sequence. This represents the set of position indices of the unselected query vector within the original sequence.

[0097] Step 4.4: Detailed calculation of selected features and fallback calculation of unselected features The global conditional feature vector is processed sequentially through linear mapping and normalized exponential function to generate a global catch-all weight vector; For all the unselected query vectors, the global fallback weight vector is used to perform a weighted summation on each of the value vectors generated from the high-dimensional feature sequence to generate the corresponding unselected query results.

[0098] Specifically, attention value calculation is divided into two parts: fine-grained attention calculation for selected queries and deterministic fallback calculation for unselected queries. For selected queries, scaled dot product attention calculation is used:

[0099] in Let i be the selected Query vector, where i is the time-series index of the Query, corresponding to the time step of the new energy output sequence, and its value range is 1 ≤ i ≤ 1. N q , N q Total number of queries, at 15-minute resolution. N q =96; , These are the Key matrix and Value matrix output by the conditional feature encoder, respectively. m The number of conditional features (controllable morphological features), d k = d v =256 is the feature dimension; Detailed calculations will be provided for the selected set of query vectors later.

[0100] For unselected queries, a deterministic fallback mechanism is used to calculate the output to avoid loss of conditional information due to sparse sampling. A fallback weight vector is defined. This vector is the global conditional feature vector generated in step 2.5. After linear mapping and Softmax normalization, we obtain:

[0101] in: , These are learnable projection parameters. The attention output for unselected queries is achieved through weighted summation:

[0102] This fallback mechanism ensures that even unselected queries can still receive a reasonable response based on global conditional features, avoiding information loss and scene generation interruption caused by sparse sampling.

[0103] Step 4.5: Sequence Recombination and Residual Injection Denoising Network Subsequently, the system reorders and reorganizes the attention calculation results of the selected and unselected queries according to the original denoising time step index i, restoring them to the original sequence length, and obtains the complete sparse cross-attention intermediate output.

[0104] The final output is normalized and injected into the denoising network through residual connections:

[0105] In the formula, The final output hidden layer feature matrix of the denoising neural network after fusing physical condition information through the sparse cross attention mechanism in the nth denoising iteration time step; For layer normalization function; The complete sparse cross-attention intermediate output matrix is ​​obtained by reordering and recombining the selected query attention results and the unselected query fallback results generated in step 4.4. To output the projection matrix, the attention output is mapped to a space with the same dimension as the hidden layer features of the denoising network (d=256). The initial hidden layer feature matrix, encoded with the diffusion time step position, is injected in step 4.1.

[0106] This dynamic Top-K strategy ensures that only a few query vector pairs with the most significant differences between the attention distribution and the uniform distribution are retained for fine-grained calculation, while the remaining unselected query vector pairs are handled through a deterministic fallback mechanism, which reduces computational complexity while ensuring the physical consistency of the generated scene.

[0107] Through this sparse cross-attention mechanism, the denoising network can dynamically focus on the most relevant controllable morphological features (such as average power, maximum slope, sunshine duration, etc.) at each time step, thereby achieving efficient conditional scene generation while maintaining physical consistency.

[0108] This invention proposes a sparse cross-attention module with a deterministic fallback mechanism in the denoising network of a diffusion model. Traditional full-scale cross-attention mechanisms consume significant computational resources when processing long sequences of physical features and are prone to introducing interference noise from irrelevant meteorological features. This invention utilizes the difference between the maximum and mean values ​​to construct a Top-K dynamic selection mechanism, performing fine-grained attention calculations only on the few morphological features most relevant in the current denoising step, reducing the time and space complexity of the inference stage. For unselected feature nodes, this invention does not discard them but compensates using static fallback weights generated from global conditional features. While compressing computational resources, this invention preserves the response of macroscopic physical boundary information, effectively avoiding the loss of conditional information and scene generation interruptions caused by sparse sampling, achieving a balance between computational efficiency and high fidelity in physical constraints.

[0109] Step 5: Construct a physical constraint penalty function using the physical boundary parameters in the controllable morphological features, and correct the sampling mean of the output of the denoising neural network based on the gradient of the physical constraint penalty function; generate a new energy scenario based on the corrected sampling mean.

[0110] In the reverse sampling process of the denoising neural network, the maximum and minimum power in the controllable morphological features are extracted; when the output value of a single time step in the generation state of the current denoising step is greater than the maximum power or less than the minimum power, the sum of squares of the corresponding output over-limit difference is calculated as the upper and lower limit penalty terms for output; the maximum ramp in the controllable morphological features is obtained; when the absolute value of the output fluctuation of the generation state of the current denoising step in adjacent time steps is greater than the maximum ramp, the sum of squares of the corresponding ramp over-limit difference is calculated as the ramp rate penalty term; the upper and lower limit penalty terms for output and the ramp rate penalty term are added to obtain the physical constraint penalty function; the partial derivative of the physical constraint penalty function with respect to the generation state of the current denoising step is calculated to obtain the physical penalty gradient; the physical penalty gradient is multiplied by a preset step size coefficient to obtain the offset, and the offset is subtracted from the sample mean predicted by the denoising neural network to obtain the corrected sample mean.

[0111] Specifically, after completing the scene generation of the above-mentioned morphological feature guidance and sparse cross-attention mechanism, the traditional sampling process only relies on the probability distribution of the output of the denoising network for sampling. Since the diffusion model is essentially a probabilistic generation model, the output sequence it generates is prone to local non-physical spikes: for example, sudden changes in output between adjacent time steps (such as output of 10MW in the previous minute and sudden changes to 80MW in the next minute), or output values ​​exceeding the maximum installed capacity of the power station. Such generation results that violate the physical operating boundaries of wind power / photovoltaics will result in the generated scene not being directly applied to grid dispatching decisions.

[0112] To address the aforementioned issues, this invention proposes a physical constraint mechanism that eliminates the need to modify the original denoising network structure or retrain the model. Instead, it utilizes the physical boundary features extracted in step 1 during the inverse denoising sampling stage to perform real-time correction of the sampling mean using a physical constraint penalty function, thereby achieving efficient injection of physical constraints.

[0113] First, based on the physical boundary parameters in the controllable morphological features extracted in step 1, such as maximum power, minimum power, and maximum ramp, a method is constructed for the current denoising step generation state. Physical constraint penalty function This function generates a non-zero penalty value only when the output sequence violates the physical boundary; when the output sequence fully conforms to the physical constraints, the penalty value is 0, thus avoiding interference with the normal generation process.

[0114]

[0115] in, This is a power output upper and lower limit penalty term, used to constrain the power output value from exceeding the physical boundary of the power station's installed capacity. It is defined as follows:

[0116] In the formula, Generate the current denoising step state The Middle t The output value at each time step. T The total time steps of the day-ahead scheduling (at 15-minute resolution) T=96 ); , These are the maximum and minimum power extracted in step 1, respectively.

[0117] The ramp rate penalty term is used to constrain the output fluctuation between adjacent time steps from exceeding the maximum ramp rate capability of the new energy unit. It is defined as follows:

[0118] In the formula, This represents the maximum incline extracted in step 1.

[0119] In the reverse denoising sampling stage, the gradient is used to correct the drift of the sampling mean predicted by the denoising network in real time, thereby implicitly injecting physical constraints into the sampling process.

[0120] Physical penalty gradient calculation:

[0121] In traditional sampling processes, denoising networks rely on conditional features The first prediction under guidance n Step sampling mean is ,in This is the high-dimensional conditional feature vector output from step 2. This invention corrects this mean using an energy gradient; the corrected sampling mean is:

[0122] In the formula, Here, represents the step size coefficient for mean shift, and is a configurable hyperparameter (taken in this embodiment). =0.1 ), used to control the correction strength of physical constraints.

[0123] The core logic of this correction mechanism is: when the current generation state... When the physical boundary conditions are perfectly met, the energy function Its gradient At this point, the corrected mean is exactly the same as the mean output by the original network, and will not interfere with the normal generation process; when the current generation state When local out-of-bounds behavior occurs, the energy function generates a non-zero penalty value, and its gradient guides the sampling mean to drift in the direction within the physical boundary, thereby pulling the out-of-bounds output value back into the legal range and effectively eliminating non-physical spikes in the generated sequence.

[0124] Specifically, based on the aforementioned mean correction mechanism, the complete reverse iteration process for generating the final new energy scenario is as follows: First, a pure noise sequence is sampled from a standard Gaussian distribution as the initial state. ; Then, set the current denoising time step. The reverse Markov sampling loop begins; At each time step n, the system utilizes the sparse cross-attention mechanism from step 4 to address the global conditional feature vector. Guided by a denoising neural network, the original sampling mean is predicted. With posterior variance; Next, the energy penalty gradient of the current generated state with respect to the physical boundary is calculated. and using the formula Obtain the corrected sample mean ; Based on the corrected sampling mean Reparameterized sampling is performed on the posterior variance to obtain the generated state from the previous step. ; make Repeat the above sampling process of prediction and correction until... When the denoising iteration ends, the output sequence is... This means ultimately generating new energy output scenarios that conform to the physical operation constraints of the power grid.

[0125] Compared with traditional physical constraint injection methods, this mechanism has extremely low deployment costs: it does not require modification of the original denoising network structure and can fully reuse the trained model parameters; it does not require retraining the model, but only requires adding an energy gradient calculation and mean correction step to the original sampling process, with minimal computational overhead; it does not require post-processing of the generated results, avoiding the destruction of the original data distribution by post-processing operations and ensuring the statistical consistency of the generated scene.

[0126] This invention proposes a mean drift correction mechanism based on physically constrained energy gradients in the reverse denoising sampling stage. Traditional diffusion models are prone to generating non-physical spikes or out-of-bounds abrupt changes when generating industrial time-series data with strict physical boundaries. This invention cleverly transforms the rigid physical operating boundaries into a differentiable energy penalty function. Without modifying the original denoising network structure or retraining the model, it uses a penalty gradient with minimal computational overhead to perform real-time, deterministic reverse drift correction on the sampling mean. This mechanism not only fundamentally reduces the disruption of the original data probability distribution caused by traditional post-processing methods and ensures the statistical consistency of the generated scenarios, but also ensures that the final generated wind power and photovoltaic output scenarios meet the physical safety boundaries of grid dispatch (such as the upper limit of installed capacity and the unit ramping limit), reducing the industrial deployment cost of generating high-fidelity new energy scenarios.

[0127] Example 2: This invention provides a new energy scenario generation system that considers uncertainty, comprising: The feature extraction module is used to acquire historical power output time-series data of new energy sources and extract controllable morphological features; The conditional feature encoding and optimization module is used to perform feature mapping on the controllable morphological features to obtain a high-dimensional feature sequence; and to perform aggregation mapping on the high-dimensional feature sequence to generate a global conditional feature vector. A diffusion model construction module is used to construct a diffusion probability model and uses a denoising neural network as the inverse denoising network of the diffusion probability model. A sparse cross-attention processing module is used to generate query vectors based on the hidden layer features of the denoising neural network, and generate key vectors and value vectors based on the high-dimensional feature sequence; to filter the query vectors according to the divergence metric between the query vectors and the key vectors, generating selected query vectors and unselected query vectors; to generate selected query results using the selected query vectors, the key vectors, and the value vectors; to generate unselected query results by weighted summation of the value vectors using the global conditional feature vectors; and to recombine the selected query results and unselected query results, and inject the recombination result into the denoising neural network. The physical constraint guidance and generation module is used to construct a physical constraint penalty function using the physical boundary parameters in the controllable morphological features, and to correct the sampling mean of the output of the denoising neural network based on the gradient of the physical constraint penalty function; and to generate a new energy scenario based on the corrected sampling mean.

[0128] Example 3: This invention provides a terminal, including a processor and a storage medium; the storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method.

[0129] Example 4: The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method.

[0130] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.

[0131] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0132] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0133] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.

[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.

Claims

1. A method for generating new energy scenarios considering uncertainty, characterized in that, include: Obtain historical power output time-series data of new energy sources, and divide the historical power output time-series data of new energy sources by day to obtain multiple daily power output sequences; For wind power generation and solar power generation scenarios, controllable morphological features are extracted from the daily power generation sequence; The controllable morphological features are subjected to feature mapping to obtain a high-dimensional feature sequence; the high-dimensional feature sequence is then subjected to aggregation mapping to generate a global conditional feature vector. A diffusion probability model is constructed, and a denoising neural network is used as the inverse denoising network of the diffusion probability model; A query vector is generated based on the hidden layer features of the denoising neural network, and a key vector and a value vector are generated based on the high-dimensional feature sequence. The query vector is then filtered according to the divergence measure between the query vector and the key vector to generate selected and unselected query vectors. Selected query results are generated using the selected query vector, the key vector, and the value vector. Unselected query results are generated by weighted summation of the value vector using the global conditional feature vector. Specifically, this includes: processing the global conditional feature vector sequentially through linear mapping and a normalized exponential function to generate a global fallback weight vector; for all unselected query vectors, weighted summation of each value vector generated from the high-dimensional feature sequence using the global fallback weight vector to generate corresponding unselected query results; and the selected and unselected query results are recombined, and the recombined result is injected into the denoising neural network. A physical constraint penalty function is constructed using the physical boundary parameters in the controllable morphological features, and the sampling mean of the output of the denoising neural network is corrected based on the gradient of the physical constraint penalty function; a new energy scenario is generated based on the corrected sampling mean.

2. The method for generating new energy scenarios considering uncertainties according to claim 1, characterized in that, Extracting controllable morphological features, specifically including: The historical output time series data of the new energy source is divided into days to obtain multiple daily output sequences; For wind power generation scenarios, the average power, maximum power, minimum power, power standard deviation, power fluctuation, and maximum ramp are extracted from the daily power generation sequence as the controllable morphological features. For solar power generation scenarios, the average power, maximum power, power standard deviation, power fluctuation, maximum ramp, and sunshine duration are extracted from the daily power sequence as the controllable morphological features.

3. The method for generating new energy scenarios considering uncertainties according to claim 1, characterized in that, The controllable morphological features are subjected to feature mapping to obtain a high-dimensional feature sequence, specifically including: The controllable morphological features are normalized to obtain a normalized feature vector; Each feature component in the normalized feature vector is input into multiple parallel multilayer perceptron subnetworks for feature mapping, and the outputs of the multiple parallel multilayer perceptron subnetworks are concatenated to generate an initial feature sequence. Sine position codes are injected into the initial feature sequence to obtain the high-dimensional feature sequence.

4. The method for generating new energy scenarios considering uncertainties according to claim 1, characterized in that, It also includes updating the network parameters corresponding to the global conditional feature vector, specifically including: The high-dimensional feature sequence is subjected to global average pooling and linear mapping in sequence to obtain a non-normalized mean vector; The global conditional feature vector is obtained by performing L2 normalization on the denormalized mean vector. Calculate the distribution divergence between the posterior distribution corresponding to the unnormalized mean vector and the standard normal distribution to generate the variational inference lower bound loss; Cosine similarity is calculated based on the global conditional feature vectors of different samples within a batch, and cosine similarity discrimination loss is generated based on the cosine similarity exceeding a set threshold. A joint loss function is constructed based on the variational inference lower bound loss and the cosine similarity discrimination loss, and the network parameters of the feature encoder and the linear mapping layer are updated using the joint loss function.

5. The method for generating new energy scenarios considering uncertainties according to claim 1, characterized in that, Based on the divergence metric between the query vector and the key vector, the query vector is filtered to generate selected and unselected query vectors, specifically including: Calculate the scaled dot product score of the query vector and all the key vectors respectively; For each query vector, calculate the maximum value and arithmetic mean of all the corresponding scaling dot product scores, and use the difference between the maximum value and the arithmetic mean as the corresponding query divergence index; The number of key queries is determined based on the preset sparse sampling ratio; All query vectors are sorted in descending order according to their corresponding query divergence indices. The query vectors with the highest number of key queries are selected as the selected query vectors, and the remaining query vectors are selected as the unselected query vectors.

6. The method for generating new energy scenarios considering uncertainties according to claim 1, characterized in that, A physical constraint penalty function is constructed using the physical boundary parameters in the controllable morphological features, and the sampling mean of the output of the denoising neural network is corrected based on the gradient of the physical constraint penalty function, specifically including: During the reverse sampling process of the denoising neural network, the maximum power and minimum power in the controllable morphological features are extracted; when the single time step output value of the current denoising step generation state is greater than the maximum power or less than the minimum power, the sum of squares of the corresponding output over-limit difference is calculated as the upper and lower limit penalty terms for output. Obtain the maximum ramp rate among the controllable morphological features; when the absolute value of the output power fluctuation of the generation state of the current denoising step is greater than the maximum ramp rate, calculate the sum of squares of the corresponding ramp rate boundary difference as a ramp rate penalty term. The physical constraint penalty function is obtained by adding the upper and lower limit penalty terms of output and the gradeability penalty term. Calculate the partial derivative of the physical constraint penalty function with respect to the generation state of the current denoising step to obtain the physical penalty gradient; The offset is obtained by multiplying the physical penalty gradient by a preset step size coefficient, and the offset is subtracted from the sample mean predicted by the denoising neural network to obtain the corrected sample mean.

7. A new energy scenario generation system considering uncertainty, comprising a new energy scenario generation method considering uncertainty as described in any one of claims 1-6, characterized in that, include: The feature extraction module is used to acquire historical power output time-series data of new energy sources and extract controllable morphological features; The conditional feature encoding and optimization module is used to perform feature mapping on the controllable morphological features to obtain a high-dimensional feature sequence; and to perform aggregation mapping on the high-dimensional feature sequence to generate a global conditional feature vector. A diffusion model construction module is used to construct a diffusion probability model and uses a denoising neural network as the inverse denoising network of the diffusion probability model. The sparse cross-attention processing module is used to generate query vectors based on the hidden layer features of the denoising neural network, and to generate key vectors and value vectors based on the high-dimensional feature sequence; to filter the query vectors according to the divergence measure between the query vectors and the key vectors, generating selected query vectors and unselected query vectors; to generate selected query results using the selected query vectors, the key vectors, and the value vectors; and to generate unselected query results by performing a weighted summation of the value vectors using the global conditional feature vectors. The selected query results and the unselected query results are recombined, and the recombined result is injected into the denoising neural network. The physical constraint guidance and generation module is used to construct a physical constraint penalty function using the physical boundary parameters in the controllable morphological features, and to correct the sampling mean of the output of the denoising neural network based on the gradient of the physical constraint penalty function; New energy scenarios are generated based on the corrected sampling mean.

8. A terminal, comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the method according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Shahuo desert wind festival scene generation method and system based on conditional diffusion model

    CN119443987B

  • Renewable energy scene generation method based on improved conditional diffusion model

    CN121581478A

  • Power distribution network intelligent scheduling method and system based on data enhancement and topology awareness dynamic partitioning

    CN120582130A

  • Progressive cross-modal image text alignment method based on diffusion model

    CN121279319A