A method, system, and storage medium for power load forecasting based on conditional diffusion models.

By recombining the power load time series into a two-dimensional image matrix and constructing a conditional diffusion model, the problem of the inability to explicitly distinguish multi-scale information in existing technologies is solved, achieving high-precision and robust power load forecasting.

CN121461298BActive Publication Date: 2026-04-03STATE GRID HUNAN ELECTRIC POWER CO LTD ELECTRIC POWER SCI RES INST +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing power load forecasting models cannot explicitly distinguish between monthly trends, daily cycles, and hourly disturbances, resulting in information being overwhelmed by high-frequency noise and model drift under extreme weather or abnormal events, affecting forecast accuracy and robustness.

Method used

The power load time series data is reorganized into a two-dimensional image matrix, and multi-scale decomposition is performed through multi-level average pooling. A conditional diffusion model containing a conditional network and a denoising network is constructed. Conditional guidance information is generated using historical trend components, and high-resolution prediction is achieved through iterative denoising and feature decoding.

Benefits of technology

Multi-resolution joint analysis and hierarchical modeling of power load time series were achieved, which improved prediction accuracy and robustness, and ensured the interpretability and practicality of the prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121461298B_ABST
    Figure CN121461298B_ABST
Patent Text Reader

Abstract

This invention discloses a power load forecasting method, system, and storage medium based on a conditional diffusion model. The power load forecasting method includes: reconstructing historical power load time series data into a two-dimensional image matrix; performing multi-scale decomposition of the two-dimensional image matrix through multi-level average pooling to obtain trend component sequences at various resolutions; constructing a conditional diffusion model including a conditional network, a denoising network, and a fusion decoder; and training the conditional diffusion model using historical trend component sequences to establish a mapping relationship between the input trend component sequences and the predicted power load time series data, serving as the obtained target prediction model. This invention aims to achieve multi-resolution joint analysis, hierarchical modeling, and variable-length processing of power load time series, thereby improving the prediction accuracy and robustness of complex multi-scale power load sequences.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart grid technology, specifically to a power load forecasting method, system, and storage medium based on a conditional diffusion model. Background Technology

[0002] With the expansion of the power grid and the high proportion of renewable energy connected to the grid, the power load curve simultaneously exhibits a long-term trend driven by macroeconomic growth, a medium-term rhythm brought about by day and night cycles and weekends, and a short-term impact caused by sudden weather changes and equipment failures. Dispatch departments need to obtain high-precision load forecasts at different time scales, from several hours to several weeks in advance, to schedule unit start-ups and shutdowns, optimize reserve capacity, and reduce operating costs. This places higher demands on the refinement, hierarchy, and robustness of forecasting models. In engineering practice, two main approaches are used: one is traditional statistical models, such as SARIMA models, exponential smoothing, and their seasonal extensions, which characterize load changes through linear differences and periodic components; the other is deep learning models, such as LSTM models, TCN models, and Transformer models, which utilize large-scale parameters and nonlinear activation functions to capture long- and short-term dependencies. Recently, diffusion models that directly perform noise addition and denoising on the original load sequence have emerged, outputting future load distributions in a generative manner. These approaches generally treat the entire load sequence as a single-scale signal, failing to explicitly distinguish between monthly trends, daily cycles, and hourly disturbances. This results in coarse-grained information being overwhelmed by high-frequency noise. During the training and inference phases, insufficient utilization of multi-scale conditions in historical loads leads to a lack of effective constraints on the generation direction, making the model susceptible to drift under extreme weather or anomalous events. Furthermore, to adapt to different forecast windows, multiple structures need to be designed or repeated truncation and padding are required, limiting the model's versatility and field deployment efficiency. Therefore, improving the prediction accuracy and robustness of complex multi-scale power load sequences has become a critical technical problem urgently needing to be solved. Summary of the Invention

[0003] The technical problem to be solved by this invention is to provide a power load forecasting method, system and storage medium based on a conditional diffusion model, which addresses the above-mentioned problems in the prior art. This invention aims to realize multi-resolution joint analysis, hierarchical modeling and variable length processing of power load time series, thereby improving the forecasting accuracy and robustness of complex multi-scale power load series.

[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:

[0005] A power load forecasting method based on a conditional diffusion model includes the following steps:

[0006] S101 reconstructs historical power load time series data into a two-dimensional image matrix;

[0007] S102, multi-scale decomposition of the two-dimensional image matrix is ​​performed through multi-level average pooling to obtain trend component sequences with multiple resolutions;

[0008] S103, construct a conditional diffusion model including a conditional network, a denoising network, and a fusion decoder. The conditional network is used to fuse historical trend components and trend components at the target level resolution to generate conditional guidance information. The denoising network is used to perform iterative denoising and feature decoding based on Gaussian noise input and conditional guidance information to obtain intermediate predicted trend components. The fusion decoder is used to decode the intermediate predicted trend components to obtain high-resolution prediction results with the same resolution as the two-dimensional image matrix, and to inversely convert the high-resolution prediction results into predicted power load time series data.

[0009] S104, The conditional diffusion model is trained using historical trend component sequences to establish a mapping relationship between the input trend component sequences and the predicted power load time series data, which serves as the target prediction model.

[0010] Optionally, step S101 includes: for historical power load time series data, counting the number of sampling points in a single time unit as the row interval parameter m, and counting the number of complete cycles spanned by the entire time series data as the column interval parameter n; for historical power load time series data, sliding slices sequentially from the starting point with a step size of 1 and a length of m, with each slice directly serving as a row vector, accumulating them into a row vector group; stacking the row vector groups row by row in periodic order to form an m×n two-dimensional image matrix that preserves the spatiotemporal structure.

[0011] Optionally, in step S102, when performing multi-scale decomposition of the two-dimensional image matrix using multi-level average pooling, the functional expression for decomposing the image data using average pooling at any resolution s is:

[0012] ;

[0013] in, The trend component is obtained by average pooling at resolution s. For average pooling operation, To pad the edges with zeros, The trend component is obtained by average pooling at resolution s-1, and the pooling window size used in the average pooling operation in the multi-level average pooling increases sequentially.

[0014] Optionally, the conditional network includes a hierarchical selection module, a linear mapping layer, a coarse-grained extraction module, and a hybrid weighting unit; the guidance information for generating trend components that fuse historical trend components and target hierarchical resolution includes: extracting the current level trend component from the input trend component sequence using the hierarchical selection module at the target hierarchical resolution, including: cutting the input trend component sequence into L time points as a backtracking segment and H points as a future segment with a fixed window length, the backtracking segment and the future segment being continuous and non-overlapping; performing K-step Gaussian noise injection on the backtracking segment to obtain K noisy training samples; and projecting the K noisy training samples into the latent space using the linear mapping layer to obtain latent space features. Obtain the true trend vector of the future segment and flatten it to serve as the true trend component of the future segment. And through the hybrid weighting unit, the latent space features are... and the aforementioned future real trend component Random proportional fusion is performed to obtain mixed condition information. :

[0015] ;

[0016] in, For mixed conditional information, Let be a random mixture matrix, and the elements in the random mixture matrix follow the order of... Uniform distribution Represents element-wise product. This represents the coarse-grained true trend component; the coarse-grained extraction module extracts the coarse-grained true trend component from the trend component sequence at a higher resolution. The previous level resolution is greater than the target level resolution; if the coarse-grained true trend component is extracted. If successful, the coarse-grained true trend component will be... and mixed condition information The final condition guidance information is obtained by splicing along the channel dimension.

[0017] Optionally, the denoising network includes a one-dimensional convolutional encoder, a diffusion-step semantic encoder, a feature fusion unit, a channel concatenation layer, a mirror-symmetric decoder, and a noise superposition module. The iterative denoising and feature decoding based on Gaussian noise input and conditional guidance information to obtain intermediate predicted trend components includes: extracting local features from the Gaussian noise input using the one-dimensional convolutional encoder to obtain noise latent space features; semantically encoding the current iteration step number using the diffusion-step semantic encoder to generate a diffusion-step guidance vector; jointly encoding the noise latent space features and the diffusion-step guidance vector using the feature fusion unit to obtain high-dimensional latent space features; dimensionally fusing the high-dimensional latent space features and the conditional guidance information using the channel concatenation layer to generate an enhanced feature tensor; hierarchically reconstructing the enhanced feature tensor using the mirror-symmetric decoder to obtain the current step predicted trend component, and outputting the mirror-symmetric decoder as the final intermediate predicted trend component when the number of iterations reaches a preset number; and using the noise superposition module to use the current step predicted trend component as the input to the one-dimensional convolutional encoder for the next iteration.

[0018] Optionally, when training the conditional diffusion model using historical trend component sequences in step S104 to establish a mapping relationship between the input trend component sequences and the predicted power load time series data as the target prediction model, this includes calculating the mean square error loss between the intermediate predicted trend components and the true trend components of the future segment, and backpropagating to update the network parameters of the conditional network, the denoising network, and the fusion decoder based on the gradient of the mean square error loss.

[0019] Optionally, step S104 is followed by power load forecasting using a target forecasting model:

[0020] S201, reorganize the current power load time series data into a two-dimensional image matrix;

[0021] S202 decomposes the two-dimensional image matrix into multiple scales through multi-level average pooling to obtain trend component sequences of multiple resolutions, and extracts the finest-grained trend component with the highest resolution from the trend component sequences of multiple resolutions.

[0022] S203, the finest-grained trend component is input into the conditional network of the target prediction model. In the conditional network stage, the execution of the conditional network differs from that in the training stage in the following two ways: the first difference is the removal of the future true trend component. Directly incorporate latent space features As mixed condition information The second step involves using the coarse-grained extraction module to extract a higher-resolution estimate of the true trend components from the trend component sequence, resulting in a coarser-grained estimate of the true trend components. If the next higher resolution is greater than the previous resolution, then the estimated value of the coarser-grained true trend component will be... and mixed condition information The final conditional guidance information is obtained by stitching along the channel dimension;

[0023] S204: Input Gaussian noise, the number of the current iteration step, and the condition guidance information into the denoising network. After iterating through the denoising network for a specified number of steps, the intermediate predicted trend component of the output is obtained.

[0024] S205 decodes the intermediate prediction trend component through a fusion decoder to obtain a high-resolution prediction result with the same resolution as the two-dimensional image matrix, and then converts the high-resolution prediction result into predicted power load time series data.

[0025] A power load forecasting system based on a conditional diffusion model includes an interconnected microprocessor and a memory, the microprocessor being programmed or configured to execute the power load forecasting method based on the conditional diffusion model.

[0026] A computer-readable storage medium storing a computer program or instructions programmed or configured to execute the power load forecasting method based on the conditional diffusion model via a processor.

[0027] A computer program product includes a computer program that, when executed by a processor, implements the steps of the above-described power load forecasting method based on a conditional diffusion model.

[0028] Compared with existing technologies, this invention mainly achieves the following beneficial effects: This invention involves recombining power load time series data into a two-dimensional image matrix, enabling the data to better adapt to image-based deep learning models while preserving the spatiotemporal structure of the original data. This invention includes multi-scale decomposition of the two-dimensional image matrix through multi-level average pooling to obtain historical trend component sequences and current trend component sequences from fine-grained to coarse-grained levels. This multi-scale decomposition method can explicitly separate trend features at different time scales, providing richer hierarchical information for subsequent predictions. A diffusion model containing a conditional network and a denoising network is constructed. The conditional network is responsible for fusing historical components and generating conditional information for coarse-grained components, while the denoising network gradually predicts future trend components based on Gaussian noise input and conditional information. This structure allows the model to fully utilize the multi-scale information of historical data during the training phase and achieve the generation of high-resolution predictions from noise during the inference phase. During the training phase, the system trains the diffusion model based on the historical trend component sequences, optimizes the model parameters by minimizing the prediction error, and obtains the target prediction model. This process significantly improves the model's ability to model complex time series data. Finally, the current trend component sequence can be processed by the target prediction model to obtain high-resolution prediction results. These results are then inversely transformed to obtain power load prediction data. This process not only improves the accuracy of the prediction but also ensures the interpretability and practicality of the prediction results. Through the above steps, this invention realizes multi-resolution joint analysis, hierarchical modeling, and variable-length processing of time series, effectively improving the prediction accuracy and robustness of complex multi-scale power load sequences. Attached Figure Description

[0029] 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.

[0030] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 This is a schematic diagram of the basic process of the method in an embodiment of the present invention.

[0032] Figure 2 This is a schematic diagram of the network structure of the conditional diffusion model in an embodiment of the present invention.

[0033] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0034] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application. To better understand the technical solutions of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that the executing entity of the embodiments of this application can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or power load forecasting system capable of achieving the above functions.

[0035] like Figure 1 As shown, the power load forecasting method based on the conditional diffusion model in this embodiment includes the following steps:

[0036] S101 reconstructs historical power load time series data into a two-dimensional image matrix;

[0037] S102, multi-scale decomposition of the two-dimensional image matrix is ​​performed through multi-level average pooling to obtain trend component sequences with multiple resolutions;

[0038] S103, construct a conditional diffusion model that includes a conditional network, a denoising network, and a fusion decoder, such as... Figure 2 As shown, the conditional network is used to fuse historical trend components and trend components at the target level resolution to generate conditional guidance information. The denoising network is used to perform iterative denoising and feature decoding based on Gaussian noise input and conditional guidance information to obtain intermediate predicted trend components. The fusion decoder is used to decode the intermediate predicted trend components to obtain high-resolution prediction results with the same resolution as the two-dimensional image matrix, and to inversely convert the high-resolution prediction results into predicted power load time series data.

[0039] S104, The conditional diffusion model is trained using historical trend component sequences to establish a mapping relationship between the input trend component sequences and the predicted power load time series data, which serves as the target prediction model.

[0040] It should be noted that historical power load time series data refers to the sequence of load power values ​​collected by the system at all past time points in the power load forecasting task, arranged in chronological order. A two-dimensional image matrix refers to a two-dimensional matrix form converted from historical power load time series data through structured recombination methods such as delayed embedding, whose row and column layout preserves the temporal dependencies and spatial relationships of the original sequence. In this embodiment, step S101 includes: for historical power load time series data, counting the number of sampling points within a single time unit as the row interval parameter m, and counting the number of complete cycles spanned by the entire time series data as the column interval parameter n; for historical power load time series data, sliding slices are made sequentially from the starting point with a step size of 1 and a length of m, each slice directly serving as a row vector, accumulating into a row vector group; the row vector groups are stacked row by row in chronological order to form an m×n two-dimensional image matrix that preserves the spatiotemporal structure, where the length of a time unit refers to the number of consecutive time points included in defining a basic time granularity in the time series. The row interval parameter is a setting value used to control the number of consecutive time units contained in each row when converting the time series into a two-dimensional matrix. The total number of cycles refers to the number of complete cycles that can be divided into historical or current power load time series data according to a predetermined cycle granularity. The column interval parameter is a setting used to control the number of consecutive cycles in each column when converting the time series into a two-dimensional matrix. The historical row vector group refers to a set of row vectors obtained from historical power load time series data divided according to the row interval parameter, where each row vector represents a continuous time unit of data. The current row vector group refers to a set of row vectors obtained from current power load time series data divided according to the row interval parameter, where each row vector represents a continuous time unit of data. A two-dimensional image matrix that preserves spatiotemporal structure maintains the temporal sequence while converting a one-dimensional signal into a two-dimensional structure suitable for convolutional neural networks and diffusion models, thereby improving feature extraction efficiency. A two-dimensional image matrix that preserves spatiotemporal structure can also be represented as:

[0041] ;

[0042] Where m is the row spacing parameter; n is the column spacing parameter, which also represents the number of rows in the matrix; and n is the number of columns in the two-dimensional image matrix. L represents the total length of the time series data.

[0043] In step S102, when performing multi-scale decomposition of the two-dimensional image matrix using multi-level average pooling, multi-level average pooling refers to continuously applying average pooling operations with different window sizes on the same image, thereby compressing spatial dimensions, smoothing details, and highlighting statistical features over a wider range layer by layer. Fine-grained refers to retaining high-resolution features with the smallest temporal or spatial scale changes in the original data. Coarse-grained refers to low-resolution features obtained after averaging or downsampling over a larger range, reflecting the overall trend over a longer period or a wider range. The historical trend component sequence refers to a series of trend matrices obtained by performing multi-level average pooling on the historical two-dimensional image matrix, arranged from high to low resolution, which together constitute a multi-scale description of the historical segment from details to the whole. The current trend component sequence refers to a series of trend matrices obtained by performing multi-level average pooling on the current two-dimensional image matrix, arranged from high to low resolution, which together constitute a multi-scale description of the current segment from details to the whole. In this embodiment, when performing multi-scale decomposition of the two-dimensional image matrix using multi-level average pooling in step S102, the function expression for decomposing the image data by average pooling at any resolution s level is:

[0044] ;

[0045] in, The trend component is obtained by average pooling at resolution s. For average pooling operation, To pad the edges with zeros, The trend component is obtained by average pooling at resolution s⁻¹, and the pooling window size used in the average pooling operation in the multi-level average pooling is progressively larger. Zero-padding at the edges preserves the trend component. and trend components The lengths are consistent. Understandably, the system first performs a first average pooling operation on both the historical and current 2D image matrices, using a 2×2 window with a stride of 1 and zero padding at the edges. This slightly reduces the output size, preserving most details while initially smoothing high-frequency noise. Next, the result of the first pooling is fed into a second pooling operation, with the window expanded to 4×4 and the stride remaining at 1, further reducing the size by about half to highlight the daily trend. This same logic is repeated, using an 8×8 window for the third operation, a 16×16 window for the fourth, until the window covers a full period width, ultimately obtaining the coarsest-scale matrix. Finally, the system pushes the pooled matrices into a list in descending order of resolution, obtaining the historical trend component sequence on the historical side and the current trend component sequence on the current side. This provides complete hierarchical information from hourly fluctuations to weekly trends within the same feature space, allowing subsequent conditional networks to guide the diffusion generation step by step.

[0046] The conditional diffusion model is a generative probabilistic model that learns data distribution and generates predictions through progressive noise addition and denoising. The historical component refers to a set of multi-scale feature maps extracted from historical two-dimensional image matrices, representing past observed load trends. The coarse-grained component refers to the lowest-resolution matrix obtained after multi-level average pooling of historical or current two-dimensional image matrices, reflecting the overall long-term trend. Conditional guidance information refers to a low-dimensional vector output by the conditional network, fusing the historical and coarse-grained components, used to provide constraints and guidance during the denoising process. Noise samples refer to Gaussian noise matrices added to the real or predicted data at any time during the diffusion process, used to train the denoising network. The trend component refers to a matrix that, after multi-scale decomposition, reflects the long-term or medium-term variation of the load at a certain resolution level. In this embodiment, the conditional diffusion model includes a conditional network, a denoising network, and a fusion decoder.

[0047] A conditional network is used to fuse historical trend components with trend component generation guidance information at the target hierarchical resolution. In this embodiment, the conditional network includes a hierarchical selection module, a linear mapping layer, a coarse-grained extraction module, and a hybrid weighting unit. The fusion of historical trend components and trend component generation guidance information at the target hierarchical resolution includes: extracting the current hierarchical trend component from the input trend component sequence at the target hierarchical resolution through the hierarchical selection module, including: cutting the input trend component sequence into L time points as a backtracking segment and H points as a future segment according to a fixed window length, with the backtracking segment and the future segment being continuous and non-overlapping; performing K-step Gaussian noise injection on the backtracking segment to obtain K noisy training samples; and projecting the K noisy training samples into the latent space through the linear mapping layer to obtain latent space features. Latent space features It is a low-dimensional, dense, and information-compressed vector representation obtained after linear mapping. In this embodiment, the noisy training samples are first flattened into vectors, and then a 64-dimensional historical latent space feature is obtained through a linear mapping of 256→128→64. Obtain the true trend vector of the future segment and flatten it to serve as the true trend component of the future segment. And through the hybrid weighting unit, the latent space features are... and the aforementioned future real trend component Random proportional fusion is performed to obtain mixed condition information. :

[0048] ;

[0049] in, For mixed conditional information, Let be a random mixture matrix, and the elements in the random mixture matrix follow the order of... Uniform distribution Represents element-wise product. This represents the coarse-grained true trend component; the coarse-grained extraction module extracts the coarse-grained true trend component from the trend component sequence at a higher resolution. The previous level resolution is greater than the target level resolution; if the coarse-grained true trend component is extracted. If successful, the coarse-grained true trend component will be... and mixed condition information The final conditional guidance information is obtained by piecing together data along the channel dimension. If no coarser-grained trend is available, use the provided data directly. As a condition, the conditional robustness is enhanced by concatenating the true future values ​​and historical trends element-wise in a random proportion during the training phase through the aforementioned history-future hybrid mechanism. The historical trend and the true future value refer to the observed past load trend matrix and the actual future load trend matrix for the corresponding time period, respectively, which have not yet been used for training.

[0050] The denoising network is used to perform iterative denoising and feature decoding based on Gaussian noise input and conditional guidance information to obtain intermediate predicted trend components. In this embodiment, the denoising network includes a one-dimensional convolutional encoder, a diffusion-step semantic encoder, a feature fusion unit, a channel splicing layer, a mirror-symmetric decoder, and a noise superposition module. The iterative denoising and feature decoding based on Gaussian noise input and conditional guidance information to obtain intermediate predicted trend components includes: extracting local features from the Gaussian noise input through the one-dimensional convolutional encoder to obtain noise latent space features. In this embodiment, the one-dimensional convolutional encoder is composed of three stacked 1×3 one-dimensional convolutions. Each one-dimensional convolution is followed by ReLU and batch normalization to extract the local temporal texture of the noise input, which can be represented as:

[0051] ;

[0052] in, This represents the latent space characteristics of noise. This represents a one-dimensional convolution operation.

[0053] The diffusion step semantic encoder performs semantic encoding on the current iteration step number to generate a diffusion step guidance vector. In this embodiment, the diffusion step semantic encoder includes two fully connected layers with 128 neurons each, used to perform semantic encoding based on the current iteration step number to generate a 32-dimensional diffusion step guidance vector. This includes: firstly, generating a position embedding using sine and cosine functions:

[0054] ;

[0055] in, For positional embedding, w is the frequency used to determine the sine and cosine functions; t represents the time step or diffusion step, an integer from 0 to w×4, used to generate different positional codes in the sine and cosine functions. ,in Let the dimension of the diffusion step guide vector be denoted by ; the position embedding is passed through two fully connected layers to obtain the diffusion step guide vector:

[0056] ;

[0057] in, This is the guide vector for the k-th diffusion step. is the activation function, and FC is a fully connected layer.

[0058] The feature fusion unit jointly encodes the noisy latent space features and the diffusion step guidance vector to obtain high-dimensional latent space features. In this embodiment, the feature fusion unit adopts a residual U-Net encoder to encode the noisy latent space features. and diffusion step guidance vector Generate high-dimensional latent space features To reduce the amount of computation, To increase the number of high-dimensional features, the denoising network is informed of its current denoising stage. The channel splicing layer performs dimensionality fusion on the high-dimensional latent space features and the conditional guidance information to generate an enhanced feature tensor. The enhanced feature tensor is reconstructed hierarchically using the mirror-symmetric decoder to obtain the predicted trend component for the current step. When the preset number of iterations is reached, the mirror-symmetric decoder is used as the final component with dimension [value missing]. The intermediate predicted trend component output is obtained by concatenating the features of each level of the encoder with the 64-dimensional vector output by the conditional network in the channel dimension. After upsampling and 1×1 convolution, a three-layer feature pyramid is formed. Finally, the linear projection layer maps the 128-channel features back to the output with the same size as the original load matrix, ensuring dimensional alignment. The noise superposition module uses the predicted trend component of the current step as the input of the one-dimensional convolutional encoder in the next iteration. Here, the one-dimensional convolutional encoder refers to the sub-network that extracts local temporal patterns by applying multiple layers of one-dimensional convolutional kernels along the time dimension, and the diffusion step semantic encoder refers to the embedded sub-network that maps the current diffusion step number to the step size semantic vector. Local features refer to the local temporal feature map obtained after the trend matrix after being denoised in any diffusion step is encoded by one-dimensional convolution. The output of the conditional network can be directly connected to the third layer of the one-dimensional convolutional encoder of the denoising network and the first layer of the mirror symmetric decoder through a skip connection to form a cross-network feature transfer channel, and integrate the conditional network, denoising network, fusion decoder and channel into a unified end-to-end diffusion model. The feature fusion unit is a sub-network module that jointly encodes noisy latent space features and diffusion step guidance vectors into a higher-dimensional representation. The channel concatenation layer is a computational unit that directly concatenates high-dimensional latent space features and conditional guidance information along the channel dimension. The mirror-symmetric decoder is a sub-network symmetrical to the encoder structure that uses upsampling and convolution to restore the enhanced feature tensor to the original-size prediction matrix. The noise superposition module is a computational unit that calculates the noise required for the next step based on the current step prediction component and adds it to form a new Gaussian noise input. Noisy latent space features are local temporal feature vectors extracted from Gaussian noise input by the one-dimensional convolutional encoder. The diffusion step guidance vector is a temporal semantic vector generated by the diffusion step semantic encoder based on the current iteration step size, used to inform the network about the denoising stage. High-dimensional latent space features are compressed feature representations output by the feature fusion unit, fusing noise features and temporal semantics. The enhanced feature tensor is a multi-channel feature map output by the channel concatenation layer, simultaneously carrying noise features, temporal semantics, and conditional guidance. The current step prediction component is a low-noise estimation matrix of the true trend output by the mirror-symmetric decoder after a single iteration. The next noise input refers to the new Gaussian noise matrix used in the next iteration after the noise superposition module resamples and superimposes the predicted components from the current step. The preset number of iterations refers to the total number of iterations required for the denoising network to complete the transition from pure noise to the final prediction, as preset by the system.

[0059] The fusion decoder is used to decode the intermediate predicted trend components to obtain a high-resolution prediction result with the same resolution as the two-dimensional image matrix, and then inversely converts the high-resolution prediction result into predicted power load time series data. In this embodiment, when training the conditional diffusion model using the historical trend component sequence in step S104 to establish a mapping relationship between the input trend component sequence and the predicted power load time series data as the obtained target prediction model, it includes calculating the mean squared error loss between the intermediate predicted trend components and the true trend components of the future segment, and backpropagating to update the network parameters of the conditional network, the denoising network, and the fusion decoder based on the gradient of the mean squared error loss. The objective function for optimizing the network parameters of the conditional network, the denoising network, and the fusion decoder based on the mean squared error loss can be expressed as:

[0060] ;

[0061] in, For the parameters of the conditional diffusion model, The total number of samples, For the sample The intermediate predictive trend component, The k-th diffusion step yields the processed local features of the noise sample. For conditional guidance information, This refers to the diffusion step size. For the sample The true trend component of the future segment. In this embodiment, the Adam optimizer is used with a learning rate of 1×e. -4 Parameters of the conditional diffusion model Backpropagation is performed, with each batch of 32 samples iterating for 200 epochs. Finally, training stops when the mean squared error loss on the validation set no longer decreases for 10 consecutive epochs. At this point, all weights of the conditional network, denoising network, and fusion decoder are saved, resulting in a target prediction model that can be directly used for inference.

[0062] It should be noted that the target prediction model refers to a conditional diffusion model that, after training and with fixed parameters, can be directly used to iteratively denoise from noise and generate a future power load trend matrix. In this embodiment, step S104 is followed by using the target prediction model to predict power load:

[0063] S201, reorganize the current power load time series data into a two-dimensional image matrix; the current power load time series data refers to the sequence of load power values ​​at the most recent time point that was just obtained by the measurement device at the time of the prediction task execution, has not yet been used for model training or updating, and is used for real-time prediction of the load in the next period, arranged in chronological order.

[0064] S202 decomposes the two-dimensional image matrix into multiple scales through multi-level average pooling to obtain trend component sequences of multiple resolutions, and extracts the finest-grained trend component with the highest resolution from the trend component sequences of multiple resolutions.

[0065] S203, the finest-grained trend component is input into the conditional network of the target prediction model. In the conditional network stage, the execution of the conditional network differs from that in the training stage in the following two ways: the first difference is the removal of the future true trend component. Directly incorporate latent space features As mixed condition information The second step involves using the coarse-grained extraction module to extract a higher-resolution estimate of the true trend components from the trend component sequence, resulting in a coarser-grained estimate of the true trend components. If the next higher resolution is greater than the previous resolution, then the estimated value of the coarser-grained true trend component will be... and mixed condition information The final conditional guidance information is obtained by stitching along the channel dimension;

[0066] S204: Input Gaussian noise, the number of the current iteration step, and the condition guidance information into the denoising network. After iterating through the denoising network for a specified number of steps, the intermediate predicted trend component of the output is obtained.

[0067] S205 decodes the intermediate prediction trend component through a fusion decoder to obtain a high-resolution prediction result with the same resolution as the two-dimensional image matrix, and then converts the high-resolution prediction result into predicted power load time series data.

[0068] There is no component of future true trends during the reasoning stage. Yes, by predicting intermediate trend components through the model. From pure noise Initially, based on the model... The denoised probability distribution predicted by the generator model is used to derive the functional expression for iterative denoising:

[0069] ;

[0070] In the formula, This represents random noise sampled from a standard normal distribution. ; It is based on The calculated mean of the Gaussian distribution; It is variance, determined by hyperparameters. Decide; Indicates the k-th The intermediate predicted trend component after the first denoising step is the estimated value before the k-th step. Gaussian noise of size T×C is input into a three-layer 1×3 convolutional encoder, followed by ReLU and batch normalization at each layer, outputting 64-dimensional noise latent space features. This captures local patterns while maintaining temporal resolution. Next, the current iteration step size i is encoded using 128-dimensional sinusoidal position encoding and then connected to two fully connected layers (256→64) to obtain the diffusion step guidance vector. This vector is then element-wise added to the noise latent space features and fed into two residual blocks (64→128→256) for joint encoding, generating high-dimensional latent space features so the network knows "which step it is currently at". Then, the channel splicing layer splices the 256-dimensional high-dimensional latent space features and the conditional guidance information, which is also flattened to 128 dimensions, along the channel dimensions to form a 384-dimensional enhanced feature tensor, which is then fed into the mirror-symmetric decoder: the decoder first upsamples to half the original size, skips to the corresponding layer of the encoder through a 1×3 transposed convolution, then upsamples to the full size, and outputs the current step prediction component through a 1×1 convolution, ensuring that details and the global picture are restored simultaneously. Finally, the noise superposition module calculates the noise intensity required for the next step based on the current step prediction component and the cosine noise scheduling table, samples Gaussian noise of the same size, superimposes it to generate a new noise input, and increments the iteration counter by 1. The above four steps are repeated until the preset 1000 iterations are reached. The current step prediction component output at the 1000th step is retained as the intermediate prediction component, thereby completing the stepwise denoising and obtaining high-precision prediction. Finally, the intermediate prediction component can be reconstructed and residually connected through the fusion decoder to obtain a high-resolution prediction result, and the high-resolution prediction result can be inversely transformed to obtain the power load prediction data. Understandably, the system first feeds the intermediate predicted components into the three-layer upsampling path of the fusion decoder: each layer uses a 3×3 transposed convolution to double the spatial size, and immediately after magnification, it concatenates the feature maps of the corresponding layers of the encoder in the channel dimension. Then, a 1×1 convolution compresses the concatenated 512 channels back to 128 channels, thus restoring resolution and reusing early fine-grained information. Second, residual connections are introduced after each upsampling: the unsampled feature maps of the same level are directly added to the output pixel by pixel, maintaining gradient flow and preserving high-frequency load fluctuation details; after repeating three times, the output size is restored to the original two-dimensional matrix size. Finally, the system flattens the obtained 128-channel high-resolution matrix into a one-dimensional vector in row-major order, removes the zero-padding at the end during training, and then concatenates the time segments sequentially according to the delayed embedding inverse mapping rule to output the load power value at the corresponding time point, thus completing the generation of power load prediction data.

[0071] It should be noted that high-resolution prediction results refer to the future load trend matrix output by the target prediction model during the inference phase, starting from pure noise and undergoing iterative denoising, with a resolution completely consistent with the original input. Power load prediction data refers to the continuous hourly or minute-level load power time series obtained by restoring this high-resolution prediction result through delayed embedding inverse transform, which can be directly used for dispatching decisions. In essence, the power load prediction system first feeds the finest-grained matrix of the current trend component sequence into the trained target prediction model. Starting from random Gaussian noise, guided by the current historical latent space features provided by the conditional network, the model iterates 1000 times through denoising, outputting a matrix of the same size as the input as the high-resolution prediction result. Subsequently, the system concatenates, removes padding, and flattens this matrix row by row according to the delayed embedding inverse rule to obtain a continuous load power numerical sequence, which is the power load prediction data directly usable for dispatching. Inverse transform process: From image... Extract the original time series. For example, when m=1, you only need to stitch the first row and last column of the image to reconstruct it. (Indicates starting from the first element of the time series) Starting from 1 and continuing to the last element x L The entire sequence). The method in this embodiment is actually applied to power load forecasting, which is an important task in the operation and dispatch of power systems. Its goal is to predict the power demand in the future based on historical load data. Accurate load forecasting helps power companies optimize power generation plans, reduce operating costs, improve grid stability, and support the grid-connected dispatch of renewable energy. Power load data usually has multi-scale characteristics, including long-term trends (such as economic growth, seasonal changes), medium-term periodicity (such as weekly cycles, holiday effects), and short-term fluctuations (such as weather changes, sudden events). The method in this embodiment can effectively capture these multi-scale features and significantly improve forecast accuracy. In a power load forecasting embodiment, the steps are briefly as follows: Step (A): Data preparation. Obtain hourly load data (720 points in total) for the past 30 days from a certain regional power grid and normalize it to the [0,1] interval. Divide the training set (first 20 days) and the test set (last 10 days). Step (B): Delayed embedding transformation. Set m=24 (daily interval) and n=24 to convert the training set into a 24×30 image matrix. Step (C): Multi-resolution decomposition. The image is decomposed into two levels: daily trend: for the original image Average pooling yields daily-level feature maps. (Size 24×30). Weekly trend: [Impact] Pooling yields a periodic feature map. (Size 24×30). Step (D): Model Training. Train the conditional diffusion model, optimize the parameters of the denoising network and the conditional network, and use the RMSE between the predicted value and the actual load as the loss function. Step (E): Load Forecasting. Input the test set data from the previous 7 days and predict the load for the next 24 hours using the model. Perform an inverse transformation to obtain the time series results.

[0072] To verify the technical effectiveness of the proposed method, an experimental environment was constructed based on the ETTh dataset. The traditional LSTM model was selected as the benchmark for comparison, and RMSE (root mean square error) was used as the core evaluation index. Comparative and ablation experiments were conducted to verify the model's prediction accuracy and the contribution of its core modules. The relevant details are as follows.

[0073] The ETTh dataset, a standard dataset in the field of power load forecasting, was used, covering two years of continuous time-series power load data for a certain region. The sampling frequency was one hour, totaling 17,520 data points, including multi-scale load characteristics such as seasons, day and night, holidays, and extreme weather. The dataset was divided into a training set (12,264 data points), a validation set (3,504 data points), and a test set (1,752 data points) in a 7:2:1 time series ratio. All data were min-max normalized to the [0,1] interval. The traditional LSTM model, consisting of two LSTM hidden layers (256 units) and one fully connected layer, maintained consistent input / output settings and training parameters with the model of this invention. Comparison of the predicted results with actual values ​​showed an RMSE of 0.02, significantly outperforming the traditional LSTM model.

[0074] To further verify the rationality and effectiveness of this invention, an ablation experiment was conducted to verify the contribution of relevant modules by removing them: the average RMSE of the complete model was 0.02, but after removing the multi-scale decomposition and conditional network, the average RMSE of the model actually improved, while the prediction accuracy decreased significantly. Experimental results show that removing relevant modules leads to a decrease in prediction performance, and each module plays a role in ensuring prediction accuracy.

[0075] In summary, this embodiment first uses a conditional network to perform historical feature mapping and coarse-grained fusion on the current trend component sequence to obtain conditional guidance information. This process integrates historical components and coarse-grained components in the current trend component sequence to generate a low-dimensional conditional vector, providing clear directional constraints for the subsequent denoising network and enhancing the model's efficiency in utilizing historical information. Next, the denoising network iteratively denoises and decodes features from the Gaussian noise input and conditional guidance information, gradually recovering intermediate prediction components from the noise. Through iterative denoising, the model can gradually approximate the true trend, effectively suppressing abnormal fluctuations and improving prediction stability. Finally, the fusion decoder performs multi-level reconstruction and residual connections on the intermediate prediction components to obtain high-resolution prediction results, and then uses inverse transformation to restore them to power load prediction data. This process preserves high-frequency details through multi-level upsampling and residual connections, ensuring the high resolution and accuracy of the prediction results. The final output power load prediction data can be directly used for actual scheduling, improving the prediction accuracy and robustness of complex multi-scale power load sequences.

[0076] Furthermore, this embodiment also provides a power load forecasting system based on a conditional diffusion model, including a microprocessor and a memory interconnected, wherein the microprocessor is programmed or configured to execute the power load forecasting method based on the conditional diffusion model.

[0077] This embodiment also provides a computer-readable storage medium storing a computer program or instructions that are programmed or configured to execute the power load forecasting method based on the conditional diffusion model via a processor.

[0078] This embodiment also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described power load forecasting method based on a conditional diffusion model.

[0079] Those skilled in the art will understand that the technical solutions provided by this invention may take the form of a method, system, or computer program product. Therefore, this invention may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this invention may take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, produce an implementation of the flowchart... Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0080] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A power load forecasting method based on a conditional diffusion model, characterized in that, Includes the following steps: S101 reconstructs historical power load time series data into a two-dimensional image matrix; S102, multi-scale decomposition of the two-dimensional image matrix is ​​performed through multi-level average pooling to obtain trend component sequences with multiple resolutions; S103, construct a conditional diffusion model including a conditional network, a denoising network, and a fusion decoder. The conditional network is used to fuse historical trend components and trend components at the target level resolution to generate conditional guidance information. The denoising network is used to perform iterative denoising and feature decoding based on Gaussian noise input and conditional guidance information to obtain intermediate predicted trend components. The fusion decoder is used to decode the intermediate predicted trend components to obtain high-resolution prediction results with the same resolution as the two-dimensional image matrix, and to inversely convert the high-resolution prediction results into predicted power load time series data. S104, The conditional diffusion model is trained using historical trend component sequences to establish a mapping relationship between the input trend component sequences and the predicted power load time series data, which serves as the target prediction model.

2. The power load forecasting method based on the conditional diffusion model according to claim 1, characterized in that, Step S101 includes: for historical power load time series data, counting the number of sampling points in a single time unit as the row interval parameter m, and counting the number of complete cycles spanned by the entire time series data as the column interval parameter n; for historical power load time series data, sliding slices sequentially from the starting point with a step size of 1 and a length of m, each slice directly serving as a row vector, accumulating them into a row vector group; stacking the row vector groups row by row in periodic order to form an m×n two-dimensional image matrix that preserves the spatiotemporal structure.

3. The power load forecasting method based on the conditional diffusion model according to claim 1, characterized in that, In step S102, when performing multi-scale decomposition of the two-dimensional image matrix using multi-level average pooling, the functional expression for decomposing the image data by average pooling at any resolution s is: ; in, The trend component is obtained by average pooling at resolution s. For average pooling operation, To pad the edges with zeros, The trend component is obtained by average pooling at resolution s-1, and the pooling window size used in the average pooling operation in the multi-level average pooling increases sequentially.

4. The power load forecasting method based on the conditional diffusion model according to claim 1, characterized in that, The conditional network includes a hierarchical selection module, a linear mapping layer, a coarse-grained extraction module, and a hybrid weighting unit. The guidance information for generating trend components by fusing historical trend components and target level resolution includes: extracting the current level trend components from the input trend component sequence using the level selection module to achieve the target level resolution, including: cutting the input trend component sequence into L time points as a backtracking segment and H points as a future segment with a fixed window length, where the backtracking and future segments are continuous and non-overlapping; performing K-step Gaussian noise injection on the backtracking segment to obtain K noisy training samples; and projecting the K noisy training samples into the latent space using the linear mapping layer to obtain latent space features. Obtain the true trend vector of the future segment and flatten it to serve as the true trend component of the future segment. And through the hybrid weighting unit, the latent space features are... and the aforementioned future real trend component Random proportional fusion is performed to obtain mixed condition information. : ; in, For mixed conditional information, Let be a random mixture matrix, and the elements in the random mixture matrix follow the order of... Uniform distribution Represents element-wise product. This represents the coarse-grained true trend component; the coarse-grained extraction module extracts the coarse-grained true trend component from the trend component sequence at a higher resolution. The previous level resolution is greater than the target level resolution; if the coarse-grained true trend component is extracted. If successful, the coarse-grained true trend component will be... and mixed condition information The final condition guidance information is obtained by splicing along the channel dimension.

5. The power load forecasting method based on the conditional diffusion model according to claim 1, characterized in that, The denoising network includes a one-dimensional convolutional encoder, a diffusion-step semantic encoder, a feature fusion unit, a channel concatenation layer, a mirror-symmetric decoder, and a noise superposition module. The iterative denoising and feature decoding based on Gaussian noise input and conditional guidance information to obtain intermediate predicted trend components includes: extracting local features from the Gaussian noise input using the one-dimensional convolutional encoder to obtain noise latent space features; semantically encoding the current iteration step number using the diffusion-step semantic encoder to generate a diffusion-step guidance vector; jointly encoding the noise latent space features and the diffusion-step guidance vector using the feature fusion unit to obtain high-dimensional latent space features; dimensionally fusing the high-dimensional latent space features and the conditional guidance information using the channel concatenation layer to generate an enhanced feature tensor; hierarchically reconstructing the enhanced feature tensor using the mirror-symmetric decoder to obtain the current step predicted trend component, and outputting the mirror-symmetric decoder as the final intermediate predicted trend component when the preset number of iterations is reached; and using the noise superposition module to use the current step predicted trend component as the input to the one-dimensional convolutional encoder for the next iteration.

6. The power load forecasting method based on the conditional diffusion model according to claim 1, characterized in that, In step S104, when the historical trend component sequence is used to train the conditional diffusion model to establish a mapping relationship between the input trend component sequence and the predicted power load time series data as the target prediction model, the process includes calculating the mean square error loss between the intermediate predicted trend component and the true trend component of the future segment, and backpropagating to update the network parameters of the conditional network, the denoising network, and the fusion decoder based on the gradient of the mean square error loss.

7. The power load forecasting method based on the conditional diffusion model according to claim 4, characterized in that, Step S104 is followed by using a target prediction model to predict electricity load: S201, reorganize the current power load time series data into a two-dimensional image matrix; S202 decomposes the two-dimensional image matrix into multiple scales through multi-level average pooling to obtain trend component sequences of multiple resolutions, and extracts the finest-grained trend component with the highest resolution from the trend component sequences of multiple resolutions. S203, the finest-grained trend component is input into the conditional network of the target prediction model. In the conditional network stage, the execution of the conditional network differs from that in the training stage in the following two ways: the first difference is the removal of the future true trend component. Directly incorporate latent space features As mixed condition information The second step involves using the coarse-grained extraction module to extract a higher-resolution estimate of the true trend components from the trend component sequence, resulting in a coarser-grained estimate of the true trend components. If the next higher resolution is greater than the previous resolution, then the estimated value of the coarser-grained true trend component will be... and mixed condition information The final conditional guidance information is obtained by splicing along the channel dimension; S204: Input Gaussian noise, the number of the current iteration step, and the condition guidance information into the denoising network. After iterating through the denoising network for a specified number of steps, the intermediate predicted trend component of the output is obtained. S205 decodes the intermediate prediction trend component through a fusion decoder to obtain a high-resolution prediction result with the same resolution as the two-dimensional image matrix, and then converts the high-resolution prediction result into predicted power load time series data.

8. A power load forecasting system based on a conditional diffusion model, comprising a microprocessor and a memory interconnected, characterized in that, The microprocessor is programmed or configured to execute the power load forecasting method based on the conditional diffusion model as described in any one of claims 1 to 7.

9. A computer-readable storage medium storing a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute the power load forecasting method based on the conditional diffusion model as described in any one of claims 1 to 7 via a processor.

10. A computer program product, characterized in that, The method includes a computer program that, when executed by a processor, implements the steps of the power load forecasting method based on the conditional diffusion model as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Power distribution network medium-term load decomposition-set prediction method and system

    CN115062864A

  • Power system load prediction method based on conditional guidance diffusion process

    CN119338283A