A comprehensive energy operation scene generation and prediction method based on a diffusion model
By constructing a dual-branch neural network structure based on a diffusion model, and combining a cross-gating module and a spatiotemporal graph convolution module, the problems of inaccurate scene generation and low prediction accuracy in integrated energy systems are solved, achieving higher quality scene generation and prediction results.
Patent Information
- Application Number
- CN202510382446.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-03-28
AI Technical Summary
Existing technologies neglect spatiotemporal correlation and the correlation of multiple energy sources in integrated energy systems, resulting in inaccurate scenario generation, low prediction accuracy, and an inability to effectively address the uncertainties of renewable energy.
A dual-branch neural network structure based on a diffusion model is constructed, which combines a cross-gating module and a spatiotemporal graph convolution module. By utilizing the information interaction and spatiotemporal correlation between different types of variables, high-quality scene data is generated through diffusion model training and backsampling.
It significantly improves the quality of scenario generation and prediction accuracy of multiple energy sources in integrated energy systems, especially the accuracy of joint prediction, and can better capture the spatiotemporal dynamics and interdependencies between multiple variables.
Smart Images

Figure CN120373617B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of integrated energy operation scenario generation and prediction technology, and in particular to a method for generating and predicting integrated energy operation scenarios based on a diffusion model. Background Technology
[0002] Integrated energy systems are crucial for modern energy management, combining various energy forms such as electricity, heat, and renewable energy to improve the efficiency and sustainability of the energy system. However, the intermittent nature of renewable energy sources such as wind and solar power complicates supply and demand relationships, posing significant challenges to integrated energy systems. On the one hand, the strong randomness of renewable energy output significantly increases the uncertainty of operating scenarios, making the establishment of efficient scenario generation mechanisms a crucial prerequisite for optimizing system operation. On the other hand, accurately predicting power generation and load is essential for improving grid stability, optimizing dispatch, and reducing operating costs. Therefore, developing scenario generation and prediction models to effectively address the challenges brought by renewable energy integration has become a key research focus in modern energy management.
[0003] In the field of deterministic forecasting, machine learning techniques have shown significant advantages over traditional physical and statistical methods and have been used to solve forecasting problems in recent years. However, while machine learning models such as Multilayer Perceptrons (MLPs), Long Short-Term Memory (LSTM) networks, Gated Recurrent Units (GRUs), and Transformers have gained attention in recent years, they typically focus primarily on temporal characteristics, neglecting the interrelationships between data from different energy sources and regions. Therefore, when forecasting power generation and load in different geographical locations, existing models cannot incorporate implicit data features such as spatial correlations, limiting their performance.
[0004] In addition to deterministic prediction, scenario generation is also crucial in integrated energy systems, especially when considering the uncertainties brought about by renewable energy. Compared with traditional methods, emerging generative models (such as diffusion models) have provided better results for generating various scenarios, but these models still have problems in capturing the spatiotemporal dynamics and interdependencies among multiple variables.
[0005] In summary, many existing methods fail to adequately meet the diverse requirements of integrated energy systems for accurate scenario generation and prediction. Furthermore, these methods often overlook the inherent key spatiotemporal correlations of integrated energy system operational data, neglecting the implicit coupling relationships between multiple variables and locations, and thus cannot fully adapt to the scenario generation and prediction requirements of integrated energy systems with multiple energy sources and spatiotemporal dimensions. Summary of the Invention
[0006] The purpose of this invention is to provide a method for generating and predicting integrated energy operation scenarios based on a diffusion model, in order to solve the technical problems of existing technologies neglecting spatiotemporal correlation and multiple energy correlations, insufficient scenario generation accuracy, and low prediction precision when applied to renewable energy scenarios.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for generating and predicting integrated energy operation scenarios based on a diffusion model, comprising the following steps:
[0008] S1: Perform data preprocessing on historical power data and historical meteorological data of various photovoltaic power stations, wind farms, electrical loads, and heat loads within the integrated energy system area to construct a dataset;
[0009] S2: Construct a dual-branch neural network structure based on a cross-gating module and a spatiotemporal graph convolution module to jointly predict the power generation or load of different types of renewable energy. The neural network structure includes an input projection layer, a cross-gating module, multiple spatiotemporal graph convolution modules, and an output projection layer. The cross-gating module enables information interaction between different types of variables, thereby improving the accuracy of joint prediction. Each spatiotemporal graph convolution module includes a temporal convolution layer for extracting temporal features, a graph convolution module for utilizing spatial correlation and realizing data interaction between spatial and channel dimensions, and a temporal downsampling layer for downsampling the input data in the time dimension.
[0010] S3: The neural network structure constructed in S2 is integrated into the framework of the diffusion model as a denoising network. The diffusion model is trained using two related datasets, namely, a photovoltaic dataset and a wind power dataset, or an electrical load dataset and a heat load dataset. Gaussian noise is added to the noise-free power data in the dataset through the forward process of the diffusion model. Historical data and the noise-added data are used as training samples to train the diffusion model. The model learns to predict the noise added to the power data at each step. The training objective is to minimize the difference between the actual noise and the predicted noise given by the denoising network.
[0011] S4: Based on the trained diffusion model, the Gaussian noise is iteratively denoised through a backsampling process, and the future power generation or load is generated or predicted using historical data and Gaussian noise.
[0012] According to a preferred embodiment of the present invention, step S1 includes the following steps:
[0013] S11: Obtain historical power data and historical meteorological data for each photovoltaic power station, wind farm, electrical load, and heat load within the integrated energy system area;
[0014] S12: Preprocess and normalize the historical power data and historical meteorological data to ensure the quality and reliability of the input data;
[0015] S13: Perform data organization on each preprocessed dataset to obtain a dataset containing three dimensions: spatial, feature, and temporal. Where v is the number of power generation stations or load areas, f is the number of features contained in the data of the power generation stations or load areas, and t all This represents the total number of time points.
[0016] According to a preferred embodiment of the present invention, in S2, both the input projection layer and the output projection layer are composed of multiple channel projection layers cascaded together. The input projection layer is used to expand the number of channels of the input tensor, and the output projection layer is used to compress the number of channels of the output tensor.
[0017] Furthermore, in S2, the two branches of the dual-branch neural network structure process two related datasets respectively, and the two branches achieve information interaction through a cross-gating module;
[0018] The cross-gating module includes a temporal convolutional layer, a spatial projection layer, a channel projection layer, and a cross-gating operation. Let X and Y represent the results obtained after the inputs of the two branches pass through the input projection layer. In the cross-gating module, they first pass through the temporal convolutional layer, the spatial projection layer, and the channel projection layer to obtain the gain A used for the cross-gating operation. x A y and bias B x B y As shown below:
[0019] A x =C_Proj x1 (S_Proj x (Conv x (X)))
[0020] B x =C_Proj x2 (S_Proj x (Conv x (X)))
[0021] A y =C_Proj y1 (S_Proj y (Conv y (Y)))
[0022] B y =C_Proj y2 (S_Proj y (Conv y (Y)))
[0023] Where Conv represents the temporal convolutional layer, S_Proj represents the spatial projection layer, and C_Proj represents the channel projection layer; the subscripts x and y in the formula are used to distinguish between two different branches X and Y, and 1 and 2 are used to distinguish between two channel projection layers in the same branch; the spatial projection layer and the channel projection layer are used to align the sizes of the two input tensors along the spatial and channel dimensions, respectively, thereby realizing the subsequent cross-gating operation:
[0024] X′=X⊙A y +B y +X
[0025] Y′=Y⊙A x +B x +Y
[0026] X′ and Y′ are the outputs of the cross-gating module, which are then processed by the subsequent parts of the two branches of the neural network.
[0027] Furthermore, in S2, the spatiotemporal graph convolution module includes a temporal convolutional layer, a graph convolutional module, and a temporal downsampling layer; multiple spatiotemporal graph convolutional modules are cascaded.
[0028] The convolution kernel ω in the temporal convolutional layer t Input tensor H i The output tensor H mapped to this layer T ;
[0029] The output H of the temporal convolutional layer T It is then fed into the graph convolution module, which consists of a spatial projection layer, a channel projection layer, and a nonlinear activation function σ(·), which converts the output tensor H of the temporal convolution layer into a vector vector. T Mapped to the output tensor H of this module S :
[0030] H S =σ(W S H T W C )+B
[0031] Among them W C It is the channel projection matrix containing the trainable parameters of the channel projection layer, B is the trainable bias term, and W is the channel projection matrix. S For spatial projection matrix;
[0032] The temporal downsampling layer will convert the output tensor H of the graph convolution module S Perform downsampling.
[0033] According to a preferred embodiment of the present invention, S3 specifically includes:
[0034] The dual-branch neural network structure constructed in S2 is used as the denoising network in the diffusion model algorithm framework. The training can be performed on either a dataset related to photovoltaic and wind power, or on a dataset related to electrical load and thermal load; the two branches of the dual-branch neural network structure are each input to data from one of the datasets.
[0035] The input to either branch of the denoising network is the result of that branch, which is the backsampling output of the previous step in the diffusion model. Historical data required for this branch The current step number t in the diffusion model, where f is the number of features, t h It refers to the time length of historical data, t. p The time period for predicting future power, v is the number of power generation sites or load areas; and x t It needs to be expanded to x in the channel dimension. h The two are of the same size, and they are concatenated along the time dimension before being fed into the denoising network;
[0036] During the training phase, historical data and noisy data generated during the forward pass of the diffusion model are used as training samples and input to the denoising network; for any quantity to be predicted, let This represents the true value of the power to be predicted for the quantity to be predicted. A single iteration in the forward process is represented as:
[0037]
[0038] Where ∈ is from the standard Gaussian distribution Random noise is sampled in the middle, where α is a predefined hyperparameter controlling the level of noise added at each step; through reparameterization techniques, x is sampled directly from noise-free data. t As shown in the following formula:
[0039]
[0040] in
[0041] During training, the model learns to predict the noise added to the power data at each step; the goal is to minimize the difference between the actual noise and the predicted noise given by the denoising network; the loss function is expressed as...
[0042]
[0043] in and These are the noise predictions from the outputs of the two branches, ∈ (1) and ∈ (2) These are the actual noises corresponding to the two branches. It represents the mathematical expectation.
[0044] According to a preferred embodiment of the present invention, in step S4, the backsampling process adopts the sampling strategy of the Diffusion Denoising Implicit Model (DDIM), and a single iteration in the DDIM backsampling process for the dual-branch neural network constructed in step S2 is as follows:
[0045]
[0046]
[0047] Where x t (1) and x t (2) These are the results of the two branches of the backsampling output from the previous step, x h1 and x h2 These are the historical data of the variables corresponding to the two branches, and t represents the sequence number of the current step; for each variable to be predicted, N different Gaussian noise samples are used as the initial input x. T The diffusion model generates N samples based on these N inputs as the scene generation result, and the average of all N generated samples is used as the final result of deterministic prediction.
[0048] Compared with existing technologies, the beneficial effects of this invention are as follows: To address the problems of complex generation and low prediction accuracy of integrated energy operation scenarios, this invention innovatively constructs a composite algorithm architecture combining graph convolutional neural networks and diffusion models. The designed spatiotemporal graph convolution module fully utilizes the spatiotemporal correlation of data through operations such as temporal convolution and graph convolution, while the proposed cross-gating module fully utilizes the correlation between different types of variables. Compared with existing technologies, the method proposed in this invention is applicable to the scenario generation and prediction tasks of integrated energy systems with multiple interconnected source-load variables, such as wind power and photovoltaics, electrical load and thermal load, significantly improving the quality of scenario generation and prediction accuracy, especially the accuracy of joint prediction. Attached Figure Description
[0049] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0050] Figure 1 This is a flowchart of the integrated energy operation scenario generation and prediction method based on the diffusion model of the present invention.
[0051] Figure 2 This is a schematic diagram illustrating the forward diffusion process and the backsampling process of a diffusion model according to an exemplary embodiment.
[0052] Figure 3This is a schematic diagram illustrating the backsampling process according to an exemplary embodiment and the specific structure of the dual-branch neural network (i.e., the denoising network in the backsampling process) designed in this invention.
[0053] Figure 4 This is a schematic diagram of a cross-gating module in a dual-branch neural network according to an exemplary embodiment of the present invention.
[0054] Figure 5 It is a time series diagram illustrating the scene generation and prediction results of photovoltaic power generation, wind power generation, electrical load, and heat load according to an exemplary embodiment. Detailed Implementation
[0055] The present invention will be further described and illustrated below with reference to specific embodiments. The embodiments described are merely examples of the content of this disclosure and do not limit the scope of the invention. The technical features of each embodiment in the present invention can be combined accordingly, provided that there is no mutual conflict.
[0056] Integrated energy operation scenario generation and prediction refers to the core technology for probabilistically simulating and deterministically extrapolating the future operating states of renewable energy power generation (such as wind power and photovoltaic) and various types of loads (such as electrical load and thermal load) within an integrated energy system that couples multiple energy sources such as electricity and heat. Its core objective is to generate multi-dimensional operating sequences covering typical, extreme, and random fluctuation scenarios by quantifying the spatiotemporal uncertainties of renewable energy output and load demand, and to perform high-precision predictions of key parameters based on historical data and real-time information, providing dynamic decision-making basis for system scheduling optimization and risk prevention. This invention proposes an integrated energy operation scenario generation and prediction method based on a diffusion model. The diffusion model refers to a type of generative model mainly used to generate high-quality data samples. First, the model is trained to predict noise added during the forward process, and then noise is gradually removed during the reverse process to generate data. This invention fully considers that both photovoltaic and wind power data are affected by local meteorological conditions. Therefore, photovoltaic power generation and wind power generation are interconnected and may exhibit related changes. For example, during cloudy and rainy weather, not only will the irradiance of each photovoltaic power station in the region decrease synchronously, but the accompanying air pressure changes may also cause fluctuations in the output of surrounding wind farms. At the same time, heat load and electricity load data are also interconnected due to the coupling of user energy consumption behavior and seasonal and meteorological sensitivity. For example, during the peak heating period in winter, electricity load and heat load will rise simultaneously. The method of this invention uses the interdependencies between different types of data for training and performs joint prediction on two types of data that are interconnected.
[0057] like Figure 1 As shown, the method of the present invention mainly includes the following steps:
[0058] S1: Perform data preprocessing on historical power data and historical meteorological data of each photovoltaic power station, wind farm, electrical load, and heat load within the integrated energy system area to construct a dataset.
[0059] The implementation examples used four real-world datasets: the photovoltaic (PV) and wind power datasets came from six PV power plants and five wind farms in the same region, containing historical power and meteorological data from January 1, 2019 to December 31, 2020. For the wind farms, the dataset contained six different types of features: power generation, air temperature, wind speed at 10m, 30m, 50m height, and hub height. For the PV power plants, available features included power generation, total solar irradiance, direct normal irradiance, global horizontal irradiance, air temperature, and atmospheric pressure. The two datasets for electrical load and thermal load also came from the same region, each containing electrical load and thermal load data from three regions, from October 1, 2020 to December 31, 2020. For each of the above datasets, 70% of the data was used as the training set, 10% as the validation set, and 20% as the test set. All four datasets had a temporal resolution of 15 minutes.
[0060] Then, for each of the aforementioned datasets, the historical power data and historical meteorological data were preprocessed and normalized to ensure the quality and reliability of the input data. First, raw data from different sources, including historical power generation, historical load, and historical meteorological data, were collected and cleaned to remove outliers. Interpolation techniques were used to handle missing values to maintain the continuity of the time series. Furthermore, the data was normalized to standardize the proportions of different features, thereby making the model's learning more effective. To ensure consistency, a min-max normalization technique was used to convert the data to a uniform scale range, as shown in the formula.
[0061]
[0062] Where X represents the data value before normalization, X min X represents the minimum value of the dataset. max X represents the maximum value in the dataset, and X′ represents the normalized data value.
[0063] Then, each preprocessed dataset is further processed to obtain datasets containing three dimensions: spatial, feature (also known as channel), and temporal. Where v is the number of power generation stations or load areas, f is the number of features contained in the data of each power generation station or load area, and t all This represents the total number of time points. This three-dimensional tensor is the dataset used for training and testing the model.
[0064] S2: Construct a dual-branch neural network structure based on spatiotemporal graph convolutional modules and cross-gating modules to jointly predict the power generation or load of different types of renewable energy. The neural network structure includes an input projection layer, a cross-gating module, multiple spatiotemporal graph convolutional modules, and an output projection layer. The cross-gating module enables information interaction between different types of variables, thereby improving the accuracy of joint prediction. Each spatiotemporal graph convolutional module includes a temporal convolutional layer for extracting temporal features, a graph convolutional module for utilizing spatial correlation and realizing data interaction between spatial and channel dimensions, and a temporal downsampling layer for downsampling the input data in the time dimension.
[0065] The position of the constructed neural network within the overall framework of the diffusion model is shown in [link to relevant documentation]. Figure 2 The present invention S2 constructs a dual-branch network structure, as detailed in [the following text is missing]. Figure 3 In the figure, T represents the total number of steps in the diffusion model. The constructed network structure includes an input projection layer, a cross-gated module, multiple spatiotemporal graph convolutional modules, and an output projection layer. Each spatiotemporal graph convolutional module includes a temporal convolutional layer, a graph convolutional (GCN) module (including a spatial projection layer and a channel projection layer), and a temporal downsampling layer.
[0066] In the network structure, both the input projection layer and the output projection layer are composed of multiple channel projection layers cascaded together. The input projection layer is used to expand the number of channels of the input tensor, and the output projection layer is used to compress the number of channels of the output tensor.
[0067] The cross-gating module in the network structure is used for information interaction between different variables to improve prediction accuracy. Since both solar and wind energy are renewable energy sources and are affected by local meteorological conditions, photovoltaic power generation and wind power generation are interconnected and may exhibit correlated changes. Heat load and electricity load data also show similar correlations due to user energy consumption behavior coupling and seasonal and meteorological sensitivity. Therefore, to utilize the interdependence between these two correlated data sets, this invention designs... Figure 4 The cross-gating module shown is used to develop a dual-branch neural network architecture specifically designed for joint prediction of photovoltaic and wind power generation or joint prediction of heat load and electrical load. Each branch processes a type of variable (e.g., the data types of the two branches are photovoltaic and wind power, or heat load and electrical load, respectively). The two branches of the dual-branch neural network structure process two related datasets.
[0068] The cross-gating module includes a temporal convolutional layer, a spatial projection layer, a channel projection layer, and the cross-gating operation. Let X and Y represent the results obtained after the inputs of the two branches pass through the input projection layer. In the cross-gating module, they are first processed by the temporal convolutional layer, spatial projection layer, and channel projection layer to obtain the gain A used for the cross-gating operation. x A y and bias B x B y As shown below:
[0069] A x =C_Proj x1 (S_Proj x (Conv x (X)))
[0070] B x =C_Proj x2 (S_Proj x (Conv x (X)))
[0071] A y =C_Proj y1 (S_Proj y (Conv y (Y)))
[0072] B y =C_Proj y2 (S_Proj y (Conv y (Y)))
[0073] Where Conv represents the temporal convolutional layer, S_Proj represents the spatial projection layer, and C_Proj represents the channel projection layer; the subscripts x and y in the formula are used to distinguish between two different branches X and Y, and 1 and 2 are used to distinguish between two channel projection layers in the same branch; the spatial projection layer and the channel projection layer are used to align the sizes of the two input tensors along the spatial and channel dimensions, respectively, thereby realizing the subsequent cross-gating operation:
[0074] X′=X⊙A y +B y +X
[0075] Y′=Y⊙A x +B x +Y
[0076] X′ and Y′ are the outputs of the cross-gating module, which are then processed by the subsequent parts of the two branches of the neural network.
[0077] The spatiotemporal graph convolutional module in the network structure includes a temporal convolutional layer, a GCN module, and a temporal downsampling layer. These multiple spatiotemporal graph convolutional modules are cascaded. Let k... t v, c i and c o Let represent the temporal convolution kernel size, input tensor space size, number of input tensor channels, and number of output tensor channels, respectively. Then, the convolution kernel in the temporal convolutional layer... Input tensor Mapped to the output tensor of this layer This can be expressed as a formula:
[0078] H T =ω t *H i
[0079] Where * represents convolution.
[0080] The output H of the time convolution block T The data is then fed into the GCN module, which primarily handles data interaction across the spatial and channel dimensions. The GCN module consists of a spatial projection layer, a channel projection layer, and a nonlinear activation function σ(·), which processes the output tensor H of the temporal convolutional layer. T Mapped to the output tensor H of this module S The formula is expressed as:
[0081] H S =σ(W S H T W C )+B
[0082] in It is the channel projection matrix containing the trainable parameters of the channel projection layer, and B is the trainable bias term. This is the spatial projection matrix. If the spatial correlation of all power generation sites or load areas is known, then the spatial projection matrix... W is assigned the value of a normalized adjacency matrix; otherwise, W S These should be trainable parameters. In this case, the network will learn the relationships between different power generation sites or load areas. The activation function σ(·) can be a ReLU function.
[0083] In this embodiment, the temporal downsampling layer included in the spatiotemporal graph convolution module is a temporal convolution layer with a stride of 2, which will convert the tensor... Downsampling as tensor
[0084] S3: The network structure constructed in S2 is integrated into the diffusion model framework as a denoising network. It is trained using two related datasets: a photovoltaic (PV) dataset and a wind power dataset, or an electrical load dataset and a thermal load dataset. When trained using the PV and wind power datasets, the resulting diffusion model can generate operating scenarios for PV and wind power and jointly predict future power generation. Similarly, if trained using the electrical load and thermal load datasets, the resulting diffusion model can generate operating scenarios for electrical and thermal loads and jointly predict future loads. Gaussian noise is added to the noise-free power data in the dataset through the forward pass of the diffusion model to train the denoising diffusion model.
[0085] In this embodiment, S3 specifically includes:
[0086] The neural network model constructed in S2 is used as the denoising network in the diffusion model algorithm framework. The training can be performed on either a dataset related to photovoltaic and wind power, or on a dataset related to electrical load and thermal load; the two branches of the dual-branch neural network structure are each input to data from one of the datasets.
[0087] The input to either branch of the denoising network is the result of that branch, which is the output of the backsampling step in the previous step of the diffusion model. Historical data required for this branch The current step number t in the diffusion model, where f is the number of features, t h It refers to the time length of historical data, t. p The time period for predicting future power, v is the number of power generation sites or load areas; and x t It needs to be expanded to x in the channel dimension. h The two are of the same size, and they are concatenated along the time dimension before being fed into the denoising network;
[0088] During the training phase, historical data and noisy data generated during the forward pass of the diffusion model are used as training samples input to the denoising network. For any one of the quantities to be predicted—wind power, photovoltaic power, electrical load, and thermal load—let... t represents the true value of the power to be predicted (i.e., noise-free data). p This represents the time length of the time series to be predicted. A single iteration in the forward process can be represented as:
[0089]
[0090] Where ∈ is from the standard Gaussian distribution The random noise in the sampling is α, which is a predefined hyperparameter controlling the level of noise added at each step. Through reparameterization techniques, x can be sampled directly from noise-free data. t As shown in the following formula:
[0091]
[0092] in
[0093] During training, the model learns to predict the noise added to the power data in the dataset at each step. The goal is to minimize the difference between the actual noise and the predicted noise given by the neural network.
[0094] The loss function can be expressed as
[0095]
[0096] in and These are the noise predictions from the outputs of the two branches, ∈ (1) and ∈ (2) This refers to the actual noise corresponding to the two branches. In this embodiment, the Adam optimizer is trained for 200 epochs on each of the training sets for photovoltaic and wind power generation, with a batch size of 256 and a learning rate of 0.002. A diffusion model (with the denoising network structure described in S3) is obtained for the joint prediction of photovoltaic and wind power generation. Furthermore, in another embodiment, the Adam optimizer is trained for 200 epochs on each of the training sets for electrical load and thermal load, with a batch size of 256 and a learning rate of 0.002. A diffusion model (with the denoising network structure described in S3) is obtained for the joint prediction of electrical load and thermal load.
[0097] S4: Using the trained denoising diffusion model, the Gaussian noise is iteratively denoised through a backsampling process, and the future power generation or load is generated using historical data and Gaussian noise.
[0098] S4 includes: using the model trained in S3 to generate future power data through historical power data and historical meteorological data. Specifically, this invention employs a sampling strategy of Diffusion Denoising Implicit Model (DDIM).
[0099] The formula for a single iteration in the DDIM backsampling process of the dual-branch network constructed in S2 is expressed as follows:
[0100]
[0101]
[0102] Where xt (1) and x t (2) These are the results of the two branches of the backsampling output from the previous step, x h1 and x h2 These are the historical data for the variables corresponding to the two branches, and t represents the current step number. The total number of steps in DDIM is set to 40. For each variable to be predicted, in order to make more accurate deterministic predictions during the testing phase, N different Gaussian noises are sampled as initial input x. T The diffusion model generates N samples as scene generation results based on these N inputs. The average of all N generated samples is used as the final deterministic prediction result. In this embodiment, the diffusion model generates N = 512 samples (i.e., scene generation) for each time series to be predicted, then averages these results to obtain the final deterministic prediction result, which is then compared with the actual values in the test set. The normalized mean absolute error (NMAE) and normalized root mean square error (NRMSE) are used to evaluate the model performance, and their calculation formulas are as follows:
[0103]
[0104] Where y(i) and y′(i) represent the normalized actual value and predicted value, respectively, and N represents the number of instances.
[0105] For further comparison, a single-branch neural network structure without a cross-gating module was also constructed in the embodiment. This neural network also has the spatiotemporal graph convolution module structure of the present invention. The difference between it and the dual-branch neural network structure proposed in this invention is that it is a single-branch structure, does not contain a cross-gating module, and can only be trained on a single type of dataset, generating or predicting future power generation or load based on historical data of that type. It does not focus on the interrelationships between different types of data. The present invention also deploys this single-branch neural network structure within the framework of a diffusion model for training. The processing of branch input data and the forward noise addition process are the same as any branch of the dual-branch neural network structure of the present invention, and will not be repeated here. The loss function can be expressed as:
[0106]
[0107] in is the predicted value of the noise by the single-branch neural network, and ∈ is the actual noise. The expected value is represented by the mathematical expression. The deployed single-branch network structure diffusion model was trained for 200 epochs each on the training sets of photovoltaic and wind power data using the Adam optimizer, with a batch size of 256 and a learning rate of 0.002. Two diffusion models were obtained for scene generation and prediction using photovoltaic and wind power data, respectively.
[0108] Table 1 quantitatively lists the prediction accuracy results (expressed as a percentage) of the diffusion model proposed in this invention (the joint prediction model of photovoltaic and wind power generation obtained in step S3) and other models on photovoltaic and wind power data, with the best performance highlighted in bold. Other models used for comparison include multilayer perceptron (MLP), long short-term memory (LSTM) networks, gated recurrent units (GRU), Transformer-based models and their variants BasisFormer, iTransformer, and other popular or advanced deep learning models. It is worth noting that the diffusion model of this invention achieves state-of-the-art accuracy on all benchmarks, showing a significant improvement compared to other methods. Furthermore, it should be noted that although the single-branch network constructed for comparison in the embodiments and the diffusion model trained by deploying this network (single-branch network structure in Table 1) do not focus on the interaction between datasets and have lower prediction accuracy than the diffusion model proposed in this invention, they still show significantly better prediction accuracy than most other existing models in single-category data prediction. This indicates that the specific details of the network architecture adopted in this invention and the scene generation and prediction method based on the diffusion model have significant advantages over existing technologies. Specifically, compared with the existing iTransformer algorithm, which has superior performance, this invention reduces the average NMAE by 15.2% and the NRMSE by 9.8%. These results demonstrate that this invention, by employing an advanced diffusion model framework, designing a cross-gating module to utilize the correlations between different types of variables, and using a spatiotemporal graph convolution module to extract the inherent spatiotemporal correlations between different locations or regions, possesses stronger predictive capabilities when facing complex temporal dynamics in source load scenarios.
[0109] Table 1. Quantitative comparison of the performance of different prediction methods. (All values in the table are expressed as "%").
[0110]
[0111] Figure 5 The results show the scene generation, prediction, and actual power values of the two models trained in step S3 of this invention. As can be seen from the figures, the scenes generated by this invention basically cover the actual values and have a certain degree of diversity. It can generate multi-dimensional operating sequences covering typical, extreme, and randomly fluctuating scenarios, indicating high scene generation quality. Furthermore, the wind power, photovoltaic power, electricity load, and heat load predicted by this invention are very close to the actual situation, demonstrating high prediction accuracy. These results show that this invention can effectively capture the dynamic characteristics of source-load scenarios, thereby achieving high scene generation quality and prediction accuracy.
[0112] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. Those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.
Claims
1. A method for generating and predicting integrated energy operation scenarios based on a diffusion model, characterized in that, Includes the following steps: S1: Perform data preprocessing on historical power data and historical meteorological data of various photovoltaic power stations, wind farms, electrical loads, and heat loads within the integrated energy system area to construct a dataset; S2: Construct a dual-branch neural network structure based on a cross-gating module and a spatiotemporal graph convolution module to jointly predict the power generation or load of different types of renewable energy. The neural network structure includes an input projection layer, a cross-gating module, multiple spatiotemporal graph convolution modules, and an output projection layer. The cross-gating module enables information interaction between different types of variables. Each spatiotemporal graph convolution module includes a temporal convolution layer for extracting temporal features, a graph convolution module for utilizing spatial correlation and realizing data interaction between spatial and channel dimensions, and a temporal downsampling layer for downsampling the input data in the time dimension. S3: The neural network structure constructed in S2 is integrated into the framework of the diffusion model as a denoising network. The diffusion model is trained using two related datasets, namely, a photovoltaic dataset and a wind power dataset, or an electrical load dataset and a heat load dataset. Gaussian noise is added to the noise-free power data in the dataset through the forward process of the diffusion model. Historical data and the noise-added data are used as training samples to train the diffusion model. The model learns to predict the noise added to the power data at each step. The training objective is to minimize the difference between the actual noise and the predicted noise given by the neural network. S4: Based on the trained diffusion model, the Gaussian noise is iteratively denoised through a backsampling process, and the future power generation or load is generated or predicted using historical data and Gaussian noise.
2. The method for generating and predicting integrated energy operation scenarios based on a diffusion model according to claim 1, characterized in that, S1 includes the following steps: S11: Obtain historical power data and historical meteorological data for each photovoltaic power station, wind farm, electrical load, and heat load within the integrated energy system area; S12: Preprocess and normalize the historical power data and historical meteorological data to ensure the quality and reliability of the input data; S13: Perform data organization on each preprocessed dataset to obtain a dataset U∈R containing three dimensions: space, features, and time. v×f×tall Where v is the number of power generation stations or load areas, f is the number of features contained in the data of the power generation stations or load areas, and t all This represents the total number of time points.
3. The method for generating and predicting integrated energy operation scenarios based on a diffusion model according to claim 1, characterized in that, In S2, both the input projection layer and the output projection layer are composed of multiple channel projection layers cascaded together. The input projection layer is used to expand the number of channels of the input tensor, and the output projection layer is used to compress the number of channels of the output tensor.
4. The method for generating and predicting integrated energy operation scenarios based on a diffusion model according to claim 1, characterized in that, In S2, the two branches of the dual-branch neural network structure process two related datasets respectively, and the two branches achieve information interaction through a cross-gating module; The cross-gating module includes a temporal convolutional layer, a spatial projection layer, a channel projection layer, and a cross-gating operation. Let X and Y represent the results obtained after the inputs of the two branches pass through the input projection layer. In the cross-gating module, they first pass through the temporal convolutional layer, the spatial projection layer, and the channel projection layer to obtain the gain A used for the cross-gating operation. x A y and bias B x B y As shown below: A x =C_Proj x1 (S_Proj x (Conv x (X))) B x =C_Proj x2 (S_Proj x (Conv. x (X))) A y =C_Proj y1 (S_Proj y (Conv y (Y))) B y =C_Proj y2 (S_Proj y (Conv. y (Y))) Where Conv represents the temporal convolutional layer, S_Proj represents the spatial projection layer, and C_Proj represents the channel projection layer; the subscripts x and y in the formula are used to distinguish between two different branches X and Y, and 1 and 2 are used to distinguish between two channel projection layers in the same branch; the spatial projection layer and the channel projection layer are used to align the sizes of the two input tensors along the spatial and channel dimensions, respectively, thereby realizing the subsequent cross-gating operation: X′=X⊙A y +B y +X Y′=Y⊙A x +B x +And X′ and Y′ are the outputs of the cross-gating module, which are then processed by the subsequent parts of the two branches of the neural network.
5. The method for generating and predicting integrated energy operation scenarios based on a diffusion model according to claim 1, characterized in that, In S2, the spatiotemporal graph convolution module includes a temporal convolutional layer, a graph convolutional module, and a temporal downsampling layer; multiple spatiotemporal graph convolutional modules are cascaded together. The convolution kernel ω in the temporal convolutional layer t Input tensor H i The output tensor H mapped to this layer T ; The output H of the temporal convolutional layer T It is then fed into the graph convolution module, which consists of a spatial projection layer, a channel projection layer, and a nonlinear activation function σ(·), which converts the output tensor H of the temporal convolution layer into a vector vector. T Mapped to the output tensor H of this module S : H S =σ(W S H T W C )+B Among them W C It is the channel projection matrix containing the trainable parameters of the channel projection layer, B is the trainable bias term, and W is the channel projection matrix. S For spatial projection matrix; The temporal downsampling layer will convert the output tensor H of the graph convolution module S Perform downsampling.
6. The method for generating and predicting integrated energy operation scenarios based on a diffusion model according to claim 1, characterized in that, S3 specifically includes: The dual-branch neural network structure constructed in S2 is used as the denoising network in the diffusion model algorithm framework. The training can be performed on either a dataset related to photovoltaic and wind power, or on a dataset related to electrical load and thermal load; the two branches of the dual-branch neural network structure are each input to data from one of the datasets. The input to either branch of the denoising network is the result of that branch, which is the backsampling output of the previous step in the diffusion model. Historical data required for this branch The current step number t in the diffusion model, where f is the number of features, t h It refers to the time length of historical data, t. p The time period for predicting future power, v is the number of power generation sites or load areas; and x t In terms of channel dimension, it needs to be expanded to x. h The two are of the same size, and they are concatenated along the time dimension before being fed into the denoising network; During the training phase, historical data and noisy data generated during the forward pass of the diffusion model are used as training samples and input to the denoising network; for any quantity to be predicted, let This represents the true value of the power to be predicted for the quantity to be predicted. A single iteration in the forward process is represented as: Where ∈ is from the standard Gaussian distribution Random noise is sampled in the middle, where α is a predefined hyperparameter controlling the level of noise added at each step; through reparameterization techniques, x is sampled directly from noise-free data. t As shown in the following formula: in During training, the model learns to predict the noise added to the power data at each step; the goal is to minimize the difference between the actual noise and the predicted noise given by the denoising network; the loss function is expressed as... in and These are the noise predictions from the outputs of the two branches, ∈ (1) and ∈ (2) These are the actual noises corresponding to the two branches. It represents the mathematical expectation.
7. The method for generating and predicting integrated energy operation scenarios based on a diffusion model according to claim 6, characterized in that, In S4, the backsampling process adopts the sampling strategy of the diffusion denoising implicit model DDIM. A single iteration in the DDIM backsampling process of the dual-branch neural network constructed in S2 is as follows: Where x t (1) and x t (2) These are the results of the two branches of the backsampling output from the previous step, x h1 and x h2 These are the historical data of the variables corresponding to the two branches, and t represents the sequence number of the current step; for each variable to be predicted, N different Gaussian noise samples are used as the initial input x. T The diffusion model generates N samples based on these N inputs as the scene generation result, and the average of all N generated samples is used as the final result of deterministic prediction.
Citation Information
Patent Citations
Equivariant trajectory optimization with diffusion models
WO2024172904A1
Segmentation of objects in an image
WO2024233818A1