A power load prediction method, device, equipment and medium
By embedding features and transforming the frequency domain of power load data, combined with quadratic programming and adaptive conformal calibration constrained by the grid ramp rate, the problems of redundant information and feature distortion in multi-source heterogeneous data are solved, and high-precision and stable power load forecasting is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENGDU GCL DIGITAL INTELLIGENCE TECHNOLOGY CO LTD
- Filing Date
- 2026-03-12
- Publication Date
- 2026-06-09
Smart Images

Figure CN122173830A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power load forecasting, and in particular to a power load forecasting method, apparatus, equipment and medium. Background Technology
[0002] With the development of power systems, the volatility on both the power source and load sides has increased dramatically, placing extremely high demands on the accuracy and reliability of load forecasting in power grid dispatching. Related technologies typically employ resampling or interpolation to unify multi-source data to the same frequency. However, these simple interpolation and duplication operations introduce a large amount of redundant information, making it difficult for models to distinguish between real fluctuations and filled data, thus causing information aliasing and feature distortion.
[0003] Traditional load forecasting methods often rely on standard deep learning models, performing probability fitting only at the data level. This can easily generate forecasts that exceed the equipment's ramp-up capabilities and do not conform to actual operating patterns. Furthermore, most methods use static quantile regression to achieve interval forecasting, where model parameters and confidence intervals remain fixed after training. This makes it difficult to adapt to concept drift problems in non-stationary scenarios such as sudden load changes and abnormal weather, thus failing to achieve accurate, stable, and reliable load forecasting. Summary of the Invention
[0004] The purpose of this invention is to provide a power load forecasting method, apparatus, equipment, and medium that can improve the accuracy, engineering applicability, and operational stability of power load forecasting.
[0005] To address the aforementioned technical problems, this invention provides a power load forecasting method, comprising: The input data, which includes load sequences, time covariates, resolution identifiers, and subject identity identifiers, is preprocessed and feature-embedded. Various features are then projected onto the same hidden layer dimension and concatenated. The spliced features are subjected to frequency domain transformation and adaptive gated filtering, and after restoring the time domain, the correlation between variables is captured by encoding. The encoded features are initially predicted, and the initial prediction results are substituted into a quadratic programming problem containing grid ramp rate constraints. The corrected results that satisfy the grid ramp rate constraints are obtained through a differentiable optimization layer. The gradient is calculated according to the implicit function theorem and backpropagation is performed. The corrected results are then inversely normalized. A prediction interval is constructed based on the quantile prediction values in the inverse normalization process. The coverage error is calculated based on the coverage relationship between the actual load value and the prediction interval. The scaling factor is then updated based on the coverage error to adjust the width of the prediction interval, thus obtaining the final power load prediction result.
[0006] To address the aforementioned technical problems, the present invention also provides a power load forecasting device, comprising: The resolution-aware embedding module is used to preprocess and embed features into input data containing load sequences, time covariates, resolution identifiers, and subject identity identifiers, projecting various features onto the same hidden layer dimension and stitching them together. The spectral domain gated fusion module is used to perform frequency domain transformation and adaptive gated filtering on the spliced features, and after restoring the time domain, it captures the correlation between variables through encoding. The physical constraint differentiable projection module is used to make preliminary predictions on the encoded features, substitute the preliminary prediction results into a quadratic programming problem containing grid ramp rate constraints, obtain the corrected results that satisfy the grid ramp rate constraints through a differentiable optimization layer, and calculate the gradient according to the implicit function theorem for backpropagation, and perform inverse normalization processing on the corrected results. The adaptive conformal calibration module is used to construct a prediction interval based on the quantile prediction values in the inverse normalization processing results, calculate the coverage error according to the coverage relationship between the actual load value and the prediction interval, and update the scaling factor according to the coverage error to adjust the width of the prediction interval, so as to obtain the final power load prediction result.
[0007] To address the aforementioned technical problems, the present invention also provides an electronic device, comprising: Memory, used to store computer programs; A processor is used to implement the steps of the above-described power load forecasting method when executing the computer program.
[0008] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned power load forecasting method.
[0009] The beneficial effects of this invention are that the power load forecasting method provided by this invention can natively process multi-source heterogeneous data, avoiding noise interference and information loss caused by data resampling and interpolation. When preprocessing and embedding features of multiple types of input data, by assigning independent identifier vectors to different resolutions and uniformly projecting them to the same hidden layer dimension, it can adaptively distinguish and process input information of different resolutions in the same feature space, without the need for forced data stretching in the time domain. Frequency domain transformation and adaptive gated filtering of the concatenated features can effectively distinguish and filter effective frequency components at the frequency domain level, accurately extracting and correcting the macroscopic change trend of fine-grained data while preserving the details of high-frequency load fluctuations. By substituting the preliminary prediction results into a quadratic programming problem containing grid ramp rate constraints and solving the constraints through a differentiable optimization layer, physical constraints can be directly integrated into the network computation process, ensuring that the prediction results always conform to the operating limitations of grid equipment, possessing physical self-correction capabilities, and improving the usability and security of the prediction results in practical engineering. Gradient backpropagation based on the implicit function theorem can guarantee the stability and convergence of the entire network's end-to-end training. The prediction interval is constructed based on the quantile prediction values after inversion and the interval width is dynamically adjusted according to the coverage relationship between the actual load value and the prediction interval. The prediction interval can be treated as a controlled object for adaptive adjustment, enabling the model to have environmental adaptability, continuously maintain a stable and reliable risk coverage level, and ultimately improve the accuracy of power load prediction.
[0010] In addition, the present invention also provides a corresponding power load forecasting device, electronic device and computer-readable storage medium for the power load forecasting method, which have the same or corresponding technical features as the power load forecasting method mentioned above, and have the same effect. Attached Figure Description
[0011] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A flowchart of the power load forecasting method provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating steps S101 and S102 provided in an embodiment of the present invention. Figure 3 This is a flowchart illustrating steps S103 and S104 provided in an embodiment of the present invention. Figure 4 This is a schematic diagram of the power load prediction device provided in an embodiment of the present invention. Detailed Implementation
[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0014] It should be noted that, in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., used in this invention are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0015] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0016] The specific application environment architecture or specific hardware architecture on which the power load forecasting method depends is described here.
[0017] The present invention provides a power load forecasting method, and the method is described in detail in conjunction with the execution flow of the power load forecasting method. Figure 1 A flowchart of the power load forecasting method provided in the embodiments of the present invention is shown below. Figure 1 As shown, the method includes: S101. Preprocess and embed features into the input data containing load sequences, time covariates, resolution identifiers, and subject identity identifiers, projecting various features onto the same hidden layer dimension and concatenating them.
[0018] It should be noted that multi-source heterogeneous data refers to power-related data from different sources, with different sampling frequencies and different physical meanings. This data can include first-resolution data (such as 15-minute SCADA load), second-resolution data (such as 1-hour numerical weather forecast (NWP), and static attribute data such as subject identity and time information. For this type of data, this invention can uniformly preprocess and embed features into input data containing load sequences, time covariates, resolution identifiers, and subject identity identifiers. It employs the resolution-aware embedding principle, avoiding forced stretching or interpolation of the data in the time domain. Instead, it assigns independent, learnable identifier vectors to different resolutions. By mapping the temporal resolution attribute of the data to a high-dimensional embedding vector, the neural network can explicitly distinguish the sampling granularity of the input data. Based on this, various features are uniformly projected onto the same hidden layer dimension and feature concatenation is completed. This achieves effective alignment and fusion of multi-source heterogeneous information in a unified feature space, avoiding redundant information and data distortion, and providing a reliable feature foundation for subsequent high-precision and robust load forecasting.
[0019] S102. Perform frequency domain transformation and adaptive gating filtering on the spliced features, restore the time domain, and capture the correlation between variables through encoding.
[0020] It should be noted that this invention performs frequency domain transformation and adaptive gating filtering on the spliced features. This process employs a spectral gating mechanism to achieve feature interaction and information fusion in the frequency domain. The time-series features are transformed from the time domain to the frequency domain through Fourier transform. The low-frequency energy spectrum of the coarse-grained data is used as a mask to filter and correct the spectrum of the fine-grained load data, thereby extracting complementary information across scales. This accurately captures long-term macroscopic patterns while preserving high-frequency fluctuation details. After completing the frequency domain filtering process, the features are restored to the time domain form. Then, the encoding network effectively mines and captures the intrinsic correlations between multiple variables, providing high-quality feature representations that combine detail and trends for subsequent predictions.
[0021] S103. Perform preliminary prediction on the encoded features, substitute the preliminary prediction results into a quadratic programming problem containing grid ramp rate constraints, obtain the corrected results that satisfy the grid ramp rate constraints through a differentiable optimization layer, calculate the gradient according to the implicit function theorem and backpropagate, and perform inverse normalization on the corrected results.
[0022] In implementation, this invention performs preliminary predictions on the encoded features to obtain initial load prediction results without physical constraints. These preliminary prediction results are then substituted into a quadratic programming (QP) problem with grid ramp rate constraints, and the constraint optimization is completed through a differentiable projection layer. The differentiable projection layer, acting as a mathematical optimization layer at the output of the neural network, constructs the grid ramp rate constraint as a convex optimization problem and embeds a differentiable solution algorithm into the deep learning computation graph. It then calculates the partial derivatives of the optimal solution with respect to the initial prediction results based on the implicit function theorem, allowing the gradient to smoothly propagate through the optimization layer and ensuring end-to-end training of the entire model. After obtaining a corrected result that satisfies the grid ramp rate constraint, it undergoes inverse normalization to restore the prediction results to the original data scale, ensuring that the output conforms to both the data distribution pattern and the physical constraints of actual grid operation.
[0023] S104. Construct a prediction interval based on the quantile prediction values in the inverse normalization processing results. Calculate the coverage error based on the coverage relationship between the actual load value and the prediction interval. Update the scaling factor based on the coverage error to adjust the width of the prediction interval and obtain the final power load prediction result.
[0024] It should be noted that this invention can construct an initial prediction interval based on the quantile prediction values in the inverse normalization processing results. This process employs the principle of Adaptive Conformal Inference (ACI), which differs from traditional static interval construction methods. Adaptive Conformal Inference dynamically adjusts the interval width based on the latest prediction error through an online feedback mechanism to ensure that the prediction interval has a strict coverage guarantee. Specifically, after obtaining the actual load value, its coverage relationship with the current prediction interval is determined, and the coverage error is calculated accordingly. Then, based on this coverage error, the scaling factor is dynamically adjusted through online update rules, thereby adaptively adjusting the width of the prediction interval. Finally, a final power load prediction result that balances accuracy and reliability is obtained, effectively addressing the concept drift of non-stationary sequences and maintaining a stable risk coverage level.
[0025] The power load forecasting method provided in this invention can natively process multi-source heterogeneous data, avoiding noise interference and information loss caused by data resampling and interpolation. When preprocessing and embedding features of multiple types of input data, by assigning independent identifier vectors to different resolutions and uniformly projecting them to the same hidden layer dimension, it can adaptively distinguish and process input information of different resolutions in the same feature space without forcibly stretching the data in the time domain. Frequency domain transformation and adaptive gated filtering of the concatenated features can effectively distinguish and filter effective frequency components at the frequency domain level, accurately extracting and correcting the macroscopic change trend of fine-grained data while preserving the details of high-frequency load fluctuations. By substituting the preliminary prediction results into a quadratic programming problem containing grid ramp rate constraints and solving the constraints through a differentiable optimization layer, physical constraints can be directly integrated into the network computation process, ensuring that the prediction results always conform to the operating limitations of grid equipment, possessing physical self-correction capabilities, and improving the usability and security of the prediction results in practical engineering. Gradient backpropagation based on the implicit function theorem guarantees the stability and convergence of the entire network's end-to-end training. The prediction interval is constructed based on the quantile prediction values after inversion and the interval width is dynamically adjusted according to the coverage relationship between the actual load value and the prediction interval. The prediction interval can be treated as a controlled object for adaptive adjustment, enabling the model to have environmental adaptability, continuously maintain a stable and reliable risk coverage level, and ultimately improve the accuracy of power load prediction.
[0026] Furthermore, in a specific implementation, in the power load forecasting method provided in the embodiments of the present invention, step S101 preprocesses and embeds features into the input data containing load sequence, time covariate, resolution identifier, and subject identity identifier, and projects various features onto the same hidden layer dimension and concatenates them. Specifically, this may include: performing reversible normalization on the load sequence; performing feature embedding on the normalized load sequence, time covariate, resolution identifier, and subject identity identifier respectively; during the embedding process, the entire time sequence is regarded as a feature unit in the time dimension; using the embedding operation, various features are projected onto the same hidden layer dimension respectively, to obtain the sequence embedding vector, time embedding vector, resolution embedding vector, and identity identifier embedding vector in sequence; wherein the resolution embedding vector is generated by a lookup table, which contains two learnable vectors, corresponding to different time resolution types respectively; the sequence embedding vector, identity identifier embedding vector, resolution embedding vector, and each time component constituting the time embedding vector are all regarded as independent variable channels; concatenating the sequence embedding vector, identity identifier embedding vector, resolution embedding vector, and time embedding vector in the variable dimension in the order of sequence embedding vector, identity identifier embedding vector, resolution embedding vector, and time embedding vector, and using the concatenated features as the input features of the encoder.
[0027] Figure 2This is a flowchart illustrating steps S101 and S102 provided in an embodiment of the present invention. In implementation, as... Figure 2 As shown, this invention allows for the definition of model inputs, where the historical observation window length is... Batch size is The input data consists of three parts: first, a fine-grained load sequence. (Aligned to 15-minute level, including missing values); secondly, time covariates containing five categories of features: month, day, week, hour, and minute. Thirdly, the resolution identifier has a value of 0 or 1. (0 corresponds to 15 minutes of source data, 1 corresponds to 1 hour of source data), and the entity's identity identifier (such as enterprise ID). .
[0028] In the processing logic, to eliminate data non-stationarity, a reversible normalization (RevIN) operation is first performed on the load sequence: ; ; in, The mean of the sequence. For the sequence variance, The parameters are learnable affine parameters, and t=1,…,L are time steps. The original load value at time step t. It is the load sequence after reversible normalization.
[0029] Calculate the sequence mean using the above formula. With variance Then, using learnable affine parameters The load sequence is normalized to obtain the normalized load sequence.
[0030] Subsequently, multi-source feature embedding is performed, projecting each type of feature onto the same hidden layer dimension. In this process, the present invention adopts inverted processing logic, treating the entire time series as a single feature unit (Token) in the time dimension, rather than using a single time step as the feature unit in traditional methods, thereby better preserving the overall temporal correlation of the sequence.
[0031] The specific embedding process includes: Sequence embedding: .
[0032] Time embedding: .
[0033] Resolution embedding: The embedding layer may contain... Two learnable vectors in the lookup table and .
[0034] ID embedding: .
[0035] In the feature fusion stage, the above-mentioned various embedding vectors are concatenated along the variable dimension. Here, the load sequence itself, time features, ID features, and resolution features are all considered as independent "variable channels": ; in, Physically, this means that the model treats the sequence, ID, resolution, and five time components as eight independent variable channels.
[0036] This invention uses resolution embedding The model can adaptively identify whether the input data is at the 15-minute or 1-hour level, thereby processing multi-scale data in a unified feature space and solving the drawback of traditional methods that require manual resampling.
[0037] Furthermore, in a specific implementation, in the power load forecasting method provided in the embodiments of the present invention, step S102 performs frequency domain transformation and adaptive gating filtering on the spliced features, restores the time domain, and captures the correlation between variables through encoding. Specifically, it may include: performing Fourier transform on the spliced features to convert the time domain signal into a frequency domain signal; using a complex weight matrix to weight the spectrum, taking the complex real part, mapping it to a preset interval through an activation function, and generating an adaptive frequency domain gating value; using the adaptive frequency domain gating value to perform gating filtering on the spectrum; restoring the filtered frequency domain signal back to the time domain through inverse Fourier transform, and superimposing it with the spliced features; using a multi-head self-attention mechanism to capture the correlation between variables in the superimposed features, obtaining the encoded features and using them as the output features of the encoder.
[0038] In implementation, such as Figure 2 As shown, in order to capture feature dependencies at different resolutions, this invention introduces a frequency domain interaction mechanism in the encoder.
[0039] In the processing logic, frequency domain swapping is performed first. Specifically, for the input features... Perform a Fast Fourier Transform (FFT) to convert the time-domain signal into a frequency-domain signal: ; in, The characteristic matrix after frequency domain transformation; For complex numbers; For batch size, The number of channels is a variable. For hidden layer dimensions.
[0040] Then, adaptive gating in the spectral domain is performed. Specifically, a learnable complex weight matrix is used. The spectrum is weighted. This process is physically equivalent to an adaptive frequency domain filter. In power load data, high-frequency components typically correspond to random fluctuations or noise in the load, while low-frequency components correspond to daily / periodic macroscopic trends. Parameters can be learned through training. It can automatically identify and retain frequency band energy that is useful for prediction, while suppressing meaningless random noise.
[0041] The calculation formula corresponding to the above-mentioned weighted spectrum process is as follows: ; in, This represents the Hadamard Product, which is an element-wise multiplication that ensures that each frequency component can be independently weighted and adjusted. This represents taking the real part of a complex number. Only the real part is used to generate the gate value because it contains the main energy and amplitude information of the signal, which is sufficient to serve as the basis for feature selection, while also reducing computational complexity. It is the Sigmoid activation function, which maps the gate value to... Interval. This is the gating weight.
[0042] Next, frequency domain filtering and inverse transform are performed. Specifically, a gating mechanism can be applied to filter the spectrum, and then the time domain can be restored using the inverse Fourier transform (iFFT). ; ; in, This is the feature matrix after frequency domain filtering; To restore the encoder input features to the time domain and fuse the residuals.
[0043] Finally, perform Transformer encoding. Input a standard Transformer encoder layer and use multi-head self-attention (MSA) to capture the correlation between variables: ; in, The output feature matrix of the encoder, This represents the converter encoder operator.
[0044] Furthermore, in a specific implementation, in the power load forecasting method provided in the embodiments of the present invention, step S103 performs a preliminary forecast of the encoded features and substitutes the preliminary forecast result into a quadratic programming problem containing grid ramp rate constraints. Specifically, this may include: extracting feature units corresponding to the load from the encoded output results and obtaining preliminary forecast results for future time periods through linear mapping; constructing grid ramp rate constraints; and transforming the grid ramp rate constraints into a quadratic programming problem, solving it with the objective function of minimizing the error between the preliminary forecast result and the optimization variables.
[0045] Figure 3 This is a flowchart illustrating steps S103 and S104 provided in an embodiment of the present invention. In implementation, as... Figure 3 As shown, the decoder not only needs to generate predicted values but also ensures that the predicted values meet the physical constraints of the power grid. In the processing logic, during the initial prediction process, the feature units corresponding to the load (i.e., variables with index 0) are extracted and mapped to future time periods through a linear layer: ; in, For predicted length; These are preliminary predictions.
[0046] Then, physical constraint modeling is performed. First, the power grid ramp rate constraint is defined: ; in, Let be the load forecast value at time t. The load forecast value at time t-1, This refers to the physical safety threshold for power grid equipment, which is defined as the load change between adjacent time points not exceeding [a certain threshold]. Here The preset physical safety threshold for power grid equipment is used to prevent the prediction results from exceeding the physical ramping capacity of the equipment (such as the maximum load increase / decrease rate of the generator), thereby ensuring the feasibility of the prediction results in engineering.
[0047] Next, the power grid ramp rate constraint is transformed into a quadratic programming problem. For each sample, the solution is: ; ; in, To meet the load forecast correction value obtained after satisfying the grid ramp rate constraint, For the load forecasting variables to be optimized, Let argmin represent the initial load forecast without grid ramp rate constraints. Then, argmin represents the solution that minimizes the objective function. This represents the square of the L2 norm. This is the constraint matrix; The predicted value is to be optimized; The boundary constraints are a vector or matrix. sum vector The ramp rate constraint is encoded.
[0048] This invention can constrain the power grid ramp rate. Transform into a quadratic programming problem An embedded neural network is used, and the gradient is calculated using the implicit function theorem for backpropagation.
[0049] Furthermore, in a specific implementation, in the power load forecasting method provided in the embodiments of the present invention, step S103 obtains a corrected result that satisfies the grid ramp rate constraint through a differentiable optimization layer, and calculates the gradient for backpropagation based on the implicit function theorem, and performs inverse normalization processing on the corrected result. Specifically, this may include: using a differentiable optimization layer to solve a quadratic programming problem; during the solution process, based on the optimization conditions and the implicit function theorem, calculating the partial derivatives of the optimal corrected result with respect to the preliminary forecast result and the constraint boundary, so that the gradient is backpropagated through the optimization layer; after obtaining the corrected result that satisfies the grid ramp rate constraint, performing inverse normalization processing on the corrected result, and restoring the processed result to the original data scale.
[0050] In implementation, the differentiable optimization layer utilizes a differentiable quadratic programming solver to solve the quadratic programming problem. The optimal solution of this optimization process... Regarding input parameters It possesses differentiability and can support gradient backpropagation. The principle behind this is that by applying the implicit function theorem to the KKT (Karush-Kuhn-Tucker) optimization conditions, the optimal solution can be analytically computed. Relative to input parameters and constraint boundaries The partial derivatives of . This allows the gradient to propagate back through the optimization layers, thus enabling end-to-end training of the entire network.
[0051] This invention embeds the solution process of the quadratic programming problem as a layer into a neural network. During the model training and inference phases, the network first generates preliminary load forecast suggestions, and then this layer forces the suggestions to be projected into the physical feasible region, ensuring that the output always meets the power grid operation constraints.
[0052] After obtaining the corrected result that satisfies the grid ramp rate constraint, the corrected result is inversely normalized. The calculation formula corresponding to this inverse normalization is: ; in, This is the result of the inverse normalization process.
[0053] Furthermore, in a specific implementation, in the power load forecasting method provided in the embodiments of the present invention, step S104 constructs a forecast interval based on the quantile prediction values in the inverse normalization processing results, calculates the coverage error based on the coverage relationship between the actual load value and the forecast interval, and updates the scaling factor based on the coverage error to adjust the width of the forecast interval, thereby obtaining the final forecast result of the power load. Specifically, this may include: generating forecast outputs corresponding to multiple quantiles based on the inverse normalization processing results to obtain quantile prediction values; constructing a forecast interval using the quantile prediction values and the scaling factor; after obtaining the actual load value, determining whether the actual load value is within the forecast interval, and calculating the coverage error based on the determination result; with the goal of maintaining a preset confidence level, using an online gradient descent algorithm to update the scaling factor based on the coverage error, increasing the scaling factor to widen the forecast interval when the actual load value is not covered, and decreasing the scaling factor to narrow the forecast interval when the actual value is covered, thereby obtaining the final forecast interval of the power load.
[0054] In implementation, such as Figure 3 As shown, the present invention can generate multiple quantile prediction outputs based on the inverse normalization processing results, that is, the model can output quantile prediction values (such as P10, P50, P90), and then dynamically adjust the interval width using an online algorithm.
[0055] In the initial interval construction stage, let the prediction interval output by the model be... To achieve interval calibration, a scaling factor is introduced. (Initially can be 1): ; in, Let t be the prediction interval for the t-th time step. Let be the predicted P50 quantile value at time step t. Let P10 quantile be the predicted value at time step t. Let be the predicted P90 quantile value at time step t.
[0056] In the non-consistency scoring and error definition stage, when the actual load value Upon arrival, calculate the coverage error: ; in, To cover error, Let be the actual load value at time step t. This is an indicator function. The error is 1 if the actual load value is outside the forecast range, and 0 otherwise.
[0057] Online Gradient Descent rules are used to maintain preset confidence level parameters. (For example, a target error rate of 0.1 corresponds to 90% coverage), and the scaling factor is updated using online gradient descent. .in To update the step size parameter online: ; in, This is the scaling factor at the (t+1)th time step. This formula can be used to dynamically adjust the scaling factor of the prediction interval.
[0058] when When (not covered), that is, when the true value is not covered by the interval, the scaling factor increases, and the prediction interval widens accordingly. When When (already covered), that is, when the true value is covered by the interval, the scaling factor decreases, and the decrease is... The prediction interval is narrowed accordingly to improve prediction accuracy.
[0059] To prevent the prediction interval from being too large (leading to meaningless predictions) or too small (leading to underestimation of risk), this invention sets boundary constraints: ; in, Scaling factor The lower limit, Scaling factor The upper limit. This increases the robustness of the algorithm in extreme cases.
[0060] The above process utilizes the principle of online feedback control, treating the width of the prediction interval as a controlled object. It can monitor in real time whether the actual load value falls within the prediction interval and generate a feedback signal. If the actual value is not covered, i.e. the error increases, an adaptive algorithm is used as the controller to widen the interval width. If the actual load value is normally covered, the interval is adaptively narrowed, realizing dynamic calibration and stable optimization of the prediction interval.
[0061] From the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by software plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0062] Embodiments of the present invention also provide an electrical load forecasting device. Figure 4 This is a schematic diagram of the power load forecasting device provided in an embodiment of the present invention. This embodiment is based on functional modules, such as… Figure 4 As shown, the device includes: The resolution-aware embedding module 10 is used to preprocess and embed features into input data containing load sequences, time covariates, resolution identifiers and subject identity identifiers, projecting various features onto the same hidden layer dimension and stitching them together. The spectral domain gated fusion module 11 is used to perform frequency domain transformation and adaptive gated filtering on the spliced features, and after restoring the time domain, it captures the correlation between variables through encoding. The physical constraint differentiable projection module 12 is used to make a preliminary prediction on the encoded features, substitute the preliminary prediction result into a quadratic programming problem containing grid ramp rate constraints, obtain the corrected result that satisfies the grid ramp rate constraints through the differentiable optimization layer, and calculate the gradient according to the implicit function theorem for backpropagation, and perform inverse normalization on the corrected result. The adaptive conformal calibration module 13 is used to construct a prediction interval based on the quantile prediction values in the inverse normalization processing results, calculate the coverage error according to the coverage relationship between the actual load value and the prediction interval, and update the scaling factor according to the coverage error to adjust the width of the prediction interval, so as to obtain the final prediction result of the power load.
[0063] In the power load forecasting device provided in this embodiment of the invention, the interaction of the four modules can natively process multi-source heterogeneous data, avoiding noise interference and information loss caused by data resampling and interpolation. When preprocessing and embedding features of multiple types of input data, by assigning independent identifier vectors to different resolutions and uniformly projecting them to the same hidden layer dimension, it can adaptively distinguish and process input information of different resolutions in the same feature space without forcibly stretching the data in the time domain. Frequency domain transformation and adaptive gating filtering of the spliced features can effectively distinguish and filter effective frequency components at the frequency domain level, accurately extracting and correcting the macroscopic change trend of fine-grained data while preserving the details of high-frequency load fluctuations. Through preliminary prediction... Substituting the results into a quadratic programming problem with grid ramp rate constraints and solving the constraints through a differentiable optimization layer, the physical constraints can be directly integrated into the network computation process. This ensures that the prediction results always conform to the operating limitations of the grid equipment, possessing physical self-correction capabilities and improving the usability and security of the prediction results in practical engineering. By implementing gradient backpropagation based on the implicit function theorem, the stability and convergence of the entire network's end-to-end training can be guaranteed. The prediction interval is constructed based on the inversely normalized quantile prediction values, and the interval width is dynamically adjusted according to the coverage relationship between the actual load value and the prediction interval. This allows the prediction interval to be adaptively adjusted as a controlled object, enabling the model to have environmental adaptability, continuously maintain a stable and reliable risk coverage level, and ultimately improve the accuracy of power load prediction.
[0064] Since the embodiments of the power load forecasting device and the power load forecasting method correspond to each other, the descriptions of the features in the embodiments corresponding to the power load forecasting device can be found in the relevant descriptions of the embodiments corresponding to the power load forecasting method, and will not be repeated here. Furthermore, it has the same beneficial effects as the power load forecasting method mentioned above.
[0065] Furthermore, in a specific implementation, in the power load forecasting device provided in the embodiments of the present invention, the resolution perception embedding module 10 can be specifically used to perform reversible normalization processing on the load sequence; to perform feature embedding processing on the normalized load sequence, time covariate, resolution identifier, and subject identity identifier respectively; during the embedding process, the entire time sequence is regarded as a feature unit in the time dimension; using the embedding operation, various features are projected onto the same hidden layer dimension respectively to obtain the sequence embedding vector, time embedding vector, resolution embedding vector, and identity identifier embedding vector in sequence; wherein the resolution embedding vector is generated by a lookup table, which contains two learnable vectors, corresponding to different time resolution types respectively; the sequence embedding vector, identity identifier embedding vector, resolution embedding vector, and each time component constituting the time embedding vector are all regarded as independent variable channels; the sequence embedding vector, identity identifier embedding vector, resolution embedding vector, and time embedding vector are concatenated in the variable dimension in the order of sequence embedding vector, identity identifier embedding vector, resolution embedding vector, and time embedding vector, and the concatenated features are used as the input features of the encoder.
[0066] Furthermore, in a specific implementation, in the power load forecasting device provided in the embodiments of the present invention, the spectral domain gating fusion module 11 can be used to perform Fourier transform on the spliced features to convert the time-domain signal into a frequency-domain signal; weight the spectrum using a complex weight matrix, and generate an adaptive frequency-domain gating value by taking the complex real part and mapping it to a preset interval through an activation function; perform gating filtering on the spectrum using the adaptive frequency-domain gating value; restore the filtered frequency-domain signal back to the time domain through inverse Fourier transform, and superimpose it with the spliced features; and use a multi-head self-attention mechanism to capture the correlation between variables in the superimposed features to obtain the encoded features and use them as the output features of the encoder.
[0067] Furthermore, in a specific implementation, in the power load forecasting device provided in the embodiments of the present invention, the physical constraint differentiable projection module 12 can be used to extract feature units corresponding to the load from the encoded output results, obtain preliminary forecast results for future time periods through linear mapping; construct grid ramp rate constraints; transform the grid ramp rate constraints into a quadratic programming problem, and solve it with minimizing the error between the preliminary forecast results and the optimization variables as the objective function; use a differentiable optimization layer to solve the quadratic programming problem; during the solution process, based on the optimization conditions and the implicit function theorem, calculate the partial derivatives of the optimal correction result with respect to the preliminary forecast results and the constraint boundaries, and make the gradient propagate backward through the optimization layer; after obtaining the correction result that satisfies the grid ramp rate constraints, perform inverse normalization processing on the correction result, and restore the processed result to the original data scale.
[0068] Furthermore, in a specific implementation, in the power load forecasting device provided in the embodiments of the present invention, the adaptive conformal calibration module 13 can be used to generate multiple quantile-corresponding forecast outputs based on the inverse normalization processing results to obtain quantile forecast values; construct a forecast interval using the quantile forecast values and scaling factors; after obtaining the actual load value, determine whether the actual load value is within the forecast interval, and calculate the coverage error based on the determination result; with the goal of maintaining a preset confidence level, use an online gradient descent algorithm to update the scaling factor based on the coverage error, increase the scaling factor to widen the forecast interval when the actual load value is not covered, and decrease the scaling factor to narrow the forecast interval when the actual value is covered, so as to obtain the final power load forecast interval.
[0069] Embodiments of the present invention also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the power load forecasting method.
[0070] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program configured to execute the steps in any of the above-described embodiments of the power load forecasting method.
[0071] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0072] Embodiments of the present invention also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described embodiments of the power load forecasting method.
[0073] Embodiments of the present invention also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described embodiments of the power load forecasting method.
[0074] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0075] The present invention has provided a detailed description of a power load forecasting method, apparatus, device, and medium. Specific examples have been used to illustrate the principles and implementation methods of the invention. The descriptions of these embodiments are only intended to aid in understanding the method and core ideas of the invention. It should be noted that those skilled in the art can make various improvements and modifications to the invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the present invention.
Claims
1. A method for predicting electricity load, characterized in that, include: The input data, which includes load sequences, time covariates, resolution identifiers, and subject identity identifiers, is preprocessed and feature-embedded. Various features are then projected onto the same hidden layer dimension and concatenated. The spliced features are subjected to frequency domain transformation and adaptive gated filtering, and after restoring the time domain, the correlation between variables is captured by encoding. The encoded features are initially predicted, and the initial prediction results are substituted into a quadratic programming problem containing grid ramp rate constraints. The corrected results that satisfy the grid ramp rate constraints are obtained through a differentiable optimization layer. The gradient is calculated according to the implicit function theorem and backpropagation is performed. The corrected results are then inversely normalized. A prediction interval is constructed based on the quantile prediction values in the inverse normalization process. The coverage error is calculated based on the coverage relationship between the actual load value and the prediction interval. The scaling factor is then updated based on the coverage error to adjust the width of the prediction interval, thus obtaining the final power load prediction result.
2. The power load forecasting method according to claim 1, characterized in that, The input data, which includes load sequences, temporal covariates, resolution identifiers, and subject identity identifiers, is preprocessed and feature-embedded. Various features are projected onto the same hidden layer dimension and then concatenated, including: Perform reversible normalization on the load sequence; Feature embedding is performed on the normalized load sequence, time covariate, resolution identifier, and subject identity identifier respectively; during the embedding process, the entire time series is regarded as a feature unit in the time dimension. Embedding operations are used to project various features onto the same hidden layer dimension, resulting in sequence embedding vectors, temporal embedding vectors, resolution embedding vectors, and identity embedding vectors. The resolution embedding vector is generated by a lookup table containing two learnable vectors, each corresponding to a different temporal resolution type. The sequence embedding vector, identity embedding vector, resolution embedding vector, and each time component constituting the time embedding vector are all treated as independent variable channels. The sequence embedding vector, identity embedding vector, resolution embedding vector, and time embedding vector are concatenated in the variable dimension in that order, and the concatenated features are used as the input features of the encoder.
3. The power load forecasting method according to claim 1, characterized in that, The spliced features are subjected to frequency domain transformation and adaptive gated filtering. After restoring the time domain, the correlation between variables is captured through encoding, including: Perform a Fourier transform on the spliced features to convert the time-domain signal into a frequency-domain signal; The spectrum is weighted using a complex weight matrix, and by taking the real part of the complex number and mapping it to a preset interval through an activation function, an adaptive frequency domain gate value is generated. The frequency spectrum is gated and filtered using the aforementioned adaptive frequency domain gate value; The filtered frequency domain signal is restored back to the time domain by inverse Fourier transform and then superimposed with the spliced features. The correlation between variables in the superimposed features is captured by a multi-head self-attention mechanism to obtain the encoded features and use them as the output features of the encoder.
4. The power load forecasting method according to claim 1, characterized in that, The encoded features are initially predicted, and the results are then substituted into a quadratic programming problem that includes constraints on the power grid ramp rate, including: Feature units corresponding to the load are extracted from the encoded output, and preliminary prediction results for future time periods are obtained through linear mapping. Construct power grid ramp rate constraints; The power grid ramp rate constraint is transformed into a quadratic programming problem, and the objective function is to minimize the error between the preliminary prediction result and the optimization variable.
5. The power load forecasting method according to claim 4, characterized in that, The following formula is used to construct the power grid ramp rate constraint: ; in, Let t be the load forecast value at time t. The load forecast value at time t-1, Physical safety thresholds for constrained power grid equipment; The power grid ramp rate constraint can be transformed into a quadratic programming problem using the following formula: ; in, To meet the load forecast correction value obtained after satisfying the grid ramp rate constraint, For the load forecasting variables to be optimized, Let argmin represent the initial load forecast without grid ramp rate constraints. Then, argmin represents the solution that minimizes the objective function. This represents the square of the L2 norm.
6. The power load forecasting method according to claim 1, characterized in that, The corrected result satisfying the grid ramp rate constraint is obtained through a differentiable optimization layer, and the gradient is calculated and backpropagated according to the implicit function theorem. The corrected result is then denormalized, including: Differentiable optimization layers are used to solve the quadratic programming problem; During the solution process, based on the optimization conditions and the implicit function theorem, the partial derivatives of the optimal correction result with respect to the preliminary prediction result and the constraint boundary are calculated, so that the gradient is backpropagated through the optimization layer. After obtaining the corrected result that satisfies the grid ramp rate constraint, the corrected result is denormalized to restore the processed result to the original data scale.
7. The power load forecasting method according to claim 1, characterized in that, A prediction interval is constructed based on the quantile prediction values in the inverse normalization process. The coverage error is calculated based on the coverage relationship between the actual load value and the prediction interval. The scaling factor is then updated based on the coverage error to adjust the width of the prediction interval, resulting in the final prediction of the power load, including: Based on the inverse normalization process, multiple prediction outputs corresponding to quantiles are generated to obtain quantile prediction values. The prediction interval is constructed using the quantile prediction values and the scaling factor; After obtaining the actual load value, it is determined whether the actual load value is within the prediction interval, and the coverage error is calculated based on the determination result; With the goal of maintaining a preset confidence level, an online gradient descent algorithm is used to update the scaling factor based on the coverage error. When the actual load value is not covered, the scaling factor is increased to widen the prediction interval, and when the actual value is covered, the scaling factor is decreased to narrow the prediction interval, so as to obtain the final prediction interval of the power load.
8. A power load forecasting device, characterized in that, include: The resolution-aware embedding module is used to preprocess and embed features into input data containing load sequences, time covariates, resolution identifiers, and subject identity identifiers, projecting various features onto the same hidden layer dimension and stitching them together. The spectral domain gated fusion module is used to perform frequency domain transformation and adaptive gated filtering on the spliced features, and after restoring the time domain, it captures the correlation between variables through encoding. The physical constraint differentiable projection module is used to make preliminary predictions on the encoded features, substitute the preliminary prediction results into a quadratic programming problem containing grid ramp rate constraints, obtain the corrected results that satisfy the grid ramp rate constraints through a differentiable optimization layer, and calculate the gradient according to the implicit function theorem for backpropagation, and perform inverse normalization processing on the corrected results. The adaptive conformal calibration module is used to construct a prediction interval based on the quantile prediction values in the inverse normalization processing results, calculate the coverage error according to the coverage relationship between the actual load value and the prediction interval, and update the scaling factor according to the coverage error to adjust the width of the prediction interval, so as to obtain the final power load prediction result.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the power load forecasting method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the power load forecasting method as described in any one of claims 1 to 7.