Load prediction method and device and storage medium

By preprocessing and classifying urban power load data and environmental disturbance data, and combining self-attention mechanism and quantile regression, the problem of insufficient ability of existing load forecasting methods to reflect the dynamic impact of external environmental factors and the interval forecasting capability is solved. This achieves high-precision and stable forecasting of power load, which is applicable to scenarios such as urban power grid dispatching and new energy consumption.

CN121529520APending Publication Date: 2026-02-13CHINA RESOURCES POWER (HUBEI) SALES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511645047.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Existing load forecasting methods are inadequate in handling the nonlinear and non-stationary characteristics of power load data, making it difficult to reflect the dynamic impact of external environmental factors and lacking interval forecasting capabilities, thus failing to meet the needs of power grid dispatching and risk management.

Method used

By preprocessing and segmenting historical urban power load data and environmental disturbance data, a training model is constructed for predictive analysis. Feature extraction is performed using a self-attention mechanism and a sparse attention layer, and the prediction interval is output by combining quantile regression, thus achieving comprehensive modeling of endogenous and exogenous variables.

Benefits of technology

It improves the sensitivity and adaptability of prediction results to external environmental disturbances, realizes joint modeling of short-term fluctuations and medium-to-long-term trends in power load, has strong engineering applicability, can quantify prediction uncertainty, and meets the robustness requirements of power grid dispatch and risk management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121529520A_ABST
    Figure CN121529520A_ABST
Patent Text Reader

Abstract

The invention provides a load prediction method and device and a storage medium, and belongs to the technical field of power prediction, and the method comprises the steps: importing a plurality of pieces of original city historical power load data and a plurality of pieces of original environment interference data; preprocessing the original urban historical power load data and the original environmental interference data to obtain preprocessed urban historical power load data and preprocessed environmental interference data; and dividing all the preprocessed urban historical power load data and all the preprocessed environmental interference data to obtain multiple pieces of target urban historical power load data, multiple pieces of target environmental interference data and multiple load true values. According to the method, the problem that a traditional model only depends on a single load sequence is avoided, the sensitivity and adaptability of a prediction result to external environment disturbance are improved, and the defect that complex time sequence features are not sufficiently extracted in the prior art is effectively overcome.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application mainly relates to the technical field of power prediction, and in particular to a load prediction method and device and a storage medium. BACKGROUND

[0002] With the increasing proportion of intermittent new energy such as wind power and photovoltaic grid-connected, and the large-scale access of new loads such as electric vehicles and smart homes, the urban power load presents stronger volatility, randomness and uncertainty. This trend poses a serious challenge to the safe and stable operation and economic dispatch of the power system. As a key link in power grid dispatching and management, the prediction accuracy and stability of short-term power load prediction are directly related to the safety and economy of the power system.

[0003] Existing load prediction methods mainly fall into two categories: one is a statistical model represented by autoregressive moving average (ARIMA), which has certain applicability in dealing with linear stationary sequences, but is difficult to effectively reflect the nonlinear and non-stationary characteristics of power load data; the other is a model based on deep learning, such as long short-term memory network (LSTM) and gated recurrent unit (GRU), which has strong nonlinear fitting ability, but has problems of training difficulty and limited prediction performance in dealing with long-time dependence.

[0004] In recent years, the Transformer model has been introduced into the field of load prediction due to its ability to represent long sequence dependence through self-attention mechanism. However, the standard Transformer has two problems in time series tasks: one is that it does not adequately represent time series features, and the other is that it is computationally inefficient in long historical sequence scenarios. To this end, an improved iTransformer model is proposed, which has improved modeling of multivariate relationships, but this method still mainly focuses on static dependence between variables and underutilizes the dynamic impact of external environmental factors over time. At the same time, the above methods generally only output deterministic point predictions and cannot reflect the uncertainty of the prediction results, which has limited reference value in power system dispatching and risk management.

[0005] Currently, some research has begun to try to combine deep learning with quantile regression (QR) to provide upper and lower confidence intervals in prediction. However, existing methods still have shortcomings in short-term power load interval prediction: (1) the model underutilizes exogenous variables and is difficult to fully reflect the impact of external environment on load; (2) it lacks interval prediction capability and is difficult to meet the actual needs of power grid in risk assessment and robust dispatching. SUMMARY

[0006] The technical problem solved by the present application is to provide a load prediction method, device and storage medium to solve the problems of the prior art.

[0007] The technical solution of the present application for solving the above technical problem is as follows: a load prediction method comprising the following steps: Importing a plurality of original city historical power load data and a plurality of original environmental interference data; Preprocessing each of the original city historical power load data and each of the original environmental interference data to obtain preprocessed city historical power load data corresponding to each of the original city historical power load data and preprocessed environmental interference data corresponding to each of the original environmental interference data; Dividing all the preprocessed city historical power load data and all the preprocessed environmental interference data to obtain a plurality of target city historical power load data, a plurality of target environmental interference data and a plurality of load true values; Building a training model, performing prediction analysis on the training model through all the target city historical power load data, all the target environmental interference data and all the load true values to obtain a plurality of load prediction values; Performing evaluation index analysis on all the load prediction values and all the load true values, and taking the analysis result as the load prediction result.

[0008] Another technical solution of the present application for solving the above technical problem is as follows: a load prediction device comprising: An import module for importing a plurality of original city historical power load data and a plurality of original environmental interference data; A preprocessing module for preprocessing each of the original city historical power load data and each of the original environmental interference data to obtain preprocessed city historical power load data corresponding to each of the original city historical power load data and preprocessed environmental interference data corresponding to each of the original environmental interference data; A division module for dividing all the preprocessed city historical power load data and all the preprocessed environmental interference data to obtain a plurality of target city historical power load data, a plurality of target environmental interference data and a plurality of load true values; A prediction analysis module for building a training model, performing prediction analysis on the training model through all the target city historical power load data, all the target environmental interference data and all the load true values to obtain a plurality of load prediction values; A prediction result obtaining module for performing evaluation index analysis on all the load prediction values and all the load true values, and taking the analysis result as the load prediction result.

[0009] Based on the above-mentioned load prediction method, the application further provides a load prediction system.

[0010] Another technical solution of the application to solve the above technical problems is as follows: a load prediction system, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, when the processor executes the computer program, the load prediction method as described above is realized.

[0011] Based on the above-mentioned load prediction method, the application further provides a computer readable storage medium.

[0012] Another technical solution of the application to solve the above technical problems is as follows: a computer readable storage medium, the computer readable storage medium stores a computer program, when the computer program is executed by a processor, the load prediction method as described above is realized.

[0013] The application has the beneficial effects that: the original city historical power load data and the original environmental interference data are preprocessed to obtain preprocessed city historical power load data and preprocessed environmental interference data, the preprocessed city historical power load data and the preprocessed environmental interference data are divided to obtain target city historical power load data, target environmental interference data and load true value, the target city historical power load data, the target environmental interference data and the load true value are used for prediction analysis of a training model to obtain a load prediction value, an evaluation index of the load prediction value and the load true value is analyzed, and the analysis result is used as a load prediction result, thereby avoiding the problem that a traditional model only depends on a single load sequence, improving the sensitivity and adaptability of the prediction result to external environmental disturbance, effectively solving the defect that the prior art is insufficient in extracting complex time sequence characteristics, and compared with a traditional prediction method, the prediction result of the application is more in line with the demand of robustness and safety margin of power grid dispatching and risk management, meanwhile, the joint modeling of short-term fluctuation and medium and long-term trend of power load is realized, the prediction accuracy and stability are improved, and strong engineering applicability is possessed, so the application can be widely used in city power grid dispatching, demand response and new energy consumption and the like. BRIEF DESCRIPTION OF DRAWINGS

[0014] Figure 1 A flowchart of the load prediction method provided by the embodiment of the application is shown; Figure 2 A structural diagram of the load prediction method provided by the embodiment of the application is shown; Figure 3 An effect diagram of the prediction result of the load prediction method provided by the embodiment of the application and the prediction result of a comparative model is shown; Figure 4A module block diagram of the load prediction device provided by the embodiment of the present application is shown. DETAILED DESCRIPTION

[0015] The principles and features of the present application are described below in conjunction with the accompanying drawings, and the examples are only used to explain the present application and not to limit the scope of the present application.

[0016] Figure 1 A flowchart of a load prediction method provided by the embodiment of the present application is shown.

[0017] As shown in Figure 1 A load prediction method comprises the following steps: S1: importing a plurality of original city historical power load data and a plurality of original environmental interference data; The original city historical power load data and the original environmental interference data are respectively preprocessed to obtain preprocessed city historical power load data corresponding to each original city historical power load data and preprocessed environmental interference data corresponding to each original environmental interference data; S2: dividing all the preprocessed city historical power load data and all the preprocessed environmental interference data to obtain a plurality of target city historical power load data, a plurality of target environmental interference data and a plurality of load true values; S3: constructing a training model, and performing prediction analysis on the training model through all the target city historical power load data, all the target environmental interference data and all the load true values to obtain a plurality of load prediction values; S4: performing evaluation index analysis on all the load prediction values and all the load true values, and taking the analysis result as a load prediction result.

[0018] It should be understood that the city historical power load data (i.e. original city historical power load data) is collected as an endogenous variable, and the meteorological conditions, holiday information and economic indicators (i.e. original environmental interference data) are obtained as exogenous variables.

[0019] Specifically, the present application first needs to collect city power load data (i.e. original city historical power load data) containing load power and time-varying meteorological data, and meteorological data (i.e. original environmental interference data) including test environment outdoor temperature, relative humidity, wind speed and total scattered radiation.

[0020] In the above embodiment, the original city historical power load data and the original environmental interference data are preprocessed to obtain preprocessed city historical power load data and preprocessed environmental interference data, the preprocessed city historical power load data and the preprocessed environmental interference data are divided to obtain target city historical power load data, target environmental interference data and load true value, the prediction analysis of the training model is performed on the target city historical power load data, the target environmental interference data and the load true value to obtain a load prediction value, the evaluation index of the load prediction value and the load true value is analyzed, and the analysis result is taken as the load prediction result, thereby avoiding the problem that the traditional model only depends on a single load sequence, improving the sensitivity and adaptability of the prediction result to external environmental disturbance, effectively solving the defect that the prior art is insufficient in extracting complex time sequence characteristics, and compared with the traditional prediction method, the prediction result of the present application is more in line with the demand of robustness and safety margin of power grid dispatching and risk management, meanwhile, the joint modeling of short-term fluctuation and long-term trend of power load is realized, the prediction accuracy and stability are improved, and strong engineering applicability is possessed, so the present application can be widely used in city power grid dispatching, demand response and new energy consumption and the like.

[0021] Optionally, as one embodiment of the present application, the process of respectively pre-processing each of the original city historical power load data and each of the original environmental interference data to obtain pre-processed city historical power load data corresponding to each of the original city historical power load data and pre-processed environmental interference data corresponding to each of the original environmental interference data comprises: respectively pre-processing each of the original city historical power load data and each of the original environmental interference data to obtain pre-processed city historical power load data corresponding to each of the original city historical power load data and pre-processed environmental interference data corresponding to each of the original environmental interference data comprises: respectively pre-processing each of the original city historical power load data and each of the original environmental interference data to obtain pre-processed city historical power load data corresponding to each of the original city historical power load data and pre-processed environmental interference data corresponding to each of the original environmental interference data comprises:

[0022] It should be understood that the original data (i.e. the original city historical power load data and the original environmental interference data) is cleaned and normalized.

[0023] Specifically, the original data (i.e. the original city historical power load data and the original environmental interference data) is subjected to missing value completion and normalization processing, wherein the normalization adopts a Min-Max normalization method to map data of different dimensions to an interval The mathematical expression of the Min-Max normalization method is: , wherein, is the original data, and are the minimum and maximum values of the data, respectively.

[0024] In the above embodiment, the original city historical power load data and the original environmental disturbance data are respectively preprocessed to obtain preprocessed city historical power load data and preprocessed environmental disturbance data, thereby avoiding the problem that the traditional model only relies on a single load sequence, improving the sensitivity and adaptability of the prediction result to external environmental disturbance, and effectively solving the defect of insufficient extraction of complex time sequence characteristics in the prior art.

[0025] Optionally, as an embodiment of the present application, the process of dividing all the preprocessed city historical power load data and all the preprocessed environmental disturbance data to obtain a plurality of target city historical power load data, a plurality of target environmental disturbance data and a plurality of load true values comprises: Importing a window length and a prediction step, and constructing a sliding window through the window length and the prediction step; Dividing all the preprocessed city historical power load data and all the preprocessed environmental disturbance data according to the sliding window to obtain a plurality of target city historical power load data, a plurality of target environmental disturbance data and a plurality of load true values.

[0026] Specifically, after collecting data (i.e., preprocessed city historical power load data and preprocessed environmental disturbance data), an input window length window and a prediction step length_size are set, and the sum of the two is taken as the sequence length of the sliding window. The data is sliced on the whole data with a step size of 1, and each time, the continuous window + length_size time steps are extracted as a training sample. For each sample, the first window time steps are taken as the input sequence (i.e., the target city historical power load data and the target environmental disturbance data), and the length_size time steps that follow are taken as the prediction target sequence (i.e., the load true value), thereby forming the input-output pair required for supervised learning. In this way, a large number of time sequence samples with overlap can be generated in the data set, and the information of the original data can be fully utilized.

[0027] In the above embodiment, the pre-processed city historical power load data and the pre-processed environmental interference data are divided to obtain a plurality of target city historical power load data, a plurality of target environmental interference data, and a plurality of load true values, so that a large number of time series samples with overlaps can be generated in the data set, and the information of the original data can be fully utilized.

[0028] Optionally, as an embodiment of the present application, the training model comprises a convolution embedding layer, a self-attention mechanism layer, a sparse attention layer, a first neuron, and a second neuron, The process of performing prediction analysis on the training model by all the target city historical power load data, all the target environmental interference data, and all the load true values to obtain a plurality of load prediction values comprises: S41: aligning all the target city historical power load data and all the target environmental interference data in time sequence to obtain a plurality of original aligned power data; S42: mapping each of the original aligned power data through the convolution embedding layer to obtain an original local time segment vector corresponding to each of the original aligned power data; S43: importing an original global vector corresponding to each of the target city historical power load data, splicing all the original local time segment vectors and all the original global vectors, and obtaining an original spliced sequence through all the spliced results; S44: dividing the original spliced sequence according to a preset length to obtain a plurality of original spliced segment vectors; S45: mapping each of the original spliced segment vectors to a query vector to obtain a query vector corresponding to each of the original spliced segment vectors; S46: mapping each of the original spliced segment vectors to a key vector to obtain a key vector corresponding to each of the original spliced segment vectors and a key dimension corresponding to each of the original spliced segment vectors; S47: mapping each of the original spliced segment vectors to a value vector to obtain a value vector corresponding to each of the original spliced segment vectors; S48: performing self-attention analysis on each of the query vectors, the key vector corresponding to each of the original spliced segment vectors, the key dimension corresponding to each of the original spliced segment vectors, and the value vector corresponding to each of the original spliced segment vectors through the self-attention mechanism layer to obtain a self-attention vector corresponding to each of the original spliced segment vectors; S49: performing sparse attention analysis on each of the query vectors, the key vectors corresponding to each of the original concatenation segment vectors, the key dimensions corresponding to each of the original concatenation segment vectors, and the value vectors corresponding to each of the original concatenation segment vectors respectively through the sparse attention layer to obtain sparse attention vectors corresponding to each of the original concatenation segment vectors; S410: concatenating all of the original local time segment vectors, all of the original global vectors, all of the self-attention vectors, and all of the sparse attention vectors, and obtaining an original concatenation sequence through all of the concatenated results; S411: performing prediction on the original concatenation sequence through the first neuron to obtain a plurality of predicted upper limit values of intervals; S412: performing prediction on the original concatenation sequence through the second neuron to obtain a plurality of predicted lower limit values of intervals; S413: performing loss function analysis on all of the predicted upper limit values of intervals, all of the predicted lower limit values of intervals, and all of the true values of loads to obtain a target loss function; S414: determining whether the target loss function is less than or equal to a preset threshold, if not, updating parameters of the training model according to the target loss function, and returning to S41 after the parameter updating; if yes, taking all of the predicted upper limit values of intervals and all of the predicted lower limit values of intervals as load prediction values to obtain a plurality of load prediction values.

[0029] It should be understood that the historical sequence of the power load (i.e., the target city historical power load data) is taken as an endogenous variable, and meteorological factors and the like (i.e., target environmental interference data) are taken as exogenous variables; the endogenous and exogenous variables (i.e., the target city historical power load data and the target environmental interference data) are aligned in time and concatenated together to form a multivariate time series (i.e., the original aligned power data) input. Subsequently, through an independent convolution embedding layer (i.e., the convolution embedding layer), the multivariate time series (i.e., the original aligned power data) is mapped to a high-dimensional feature space to obtain a more abstract and distinguishable time sequence representation.

[0030] It should be understood that the input sequence (i.e., the original concatenation sequence) is divided into time segments, the long sequence (i.e., the original concatenation sequence) is decomposed into a plurality of continuous segments (i.e., the original concatenation segment vectors), and the correlation between the segments (i.e., the original concatenation segment vectors) is modeled through a sparse self-attention mechanism (i.e., the sparse attention layer).

[0031] It should be understood that in the endogenous variable modeling layer, the historical load data (i.e., the historical power load data of the target city) is used to extract the short-term time sequence variation characteristics; then, in the interactive fusion layer, the external environmental characteristics of the exogenous variables such as meteorological conditions (i.e., the target environmental interference data) are integrated; finally, in the global modeling layer, the long-term change relationship of the fused multi-level characteristics is established, so as to realize the comprehensive modeling of endogenous and exogenous variables.

[0032] It should be understood that in order to realize interval prediction, the output layer is designed to include two neurons (i.e., the first neuron and the second neuron), which correspond to the lower limit (i.e., the lower limit value of the prediction interval) and the upper limit (i.e., the upper limit value of the prediction interval) of the prediction interval, respectively.

[0033] Specifically, the historical sequence of power load (i.e., the historical power load data of the target city) is taken as an endogenous variable , meteorological factors, date types and other external information (i.e., target environmental interference data) are taken as exogenous variables , and are aligned through time index to ensure the consistency of endogenous and exogenous data in time dimension. The spliced input (i.e., the original aligned power data) is: , wherein, denotes the number of time steps, denotes the total number of characteristics.

[0034] An independent convolutional embedding layer is used to map the input sequence (i.e., the original aligned power data) to a high dimension to extract local patterns and short-term dependencies, and the formula is as follows: , wherein, is the embedding dimension. The independent convolution enhances the feature distinction of different variables.

[0035] On the basis of convolutional embedding, a learnable global token (i.e., the original global vector) is introduced for each endogenous variable as the overall representation of the variable in the entire time sequence dimension as follows: , wherein, is the number of endogenous variables. The global token (i.e., the original global vector) interacts with the exogenous variables in the subsequent cross-modeling to realize the bridging and supplementing of exogenous information to endogenous sequence. Through the above process, the multi-element time sequence characteristic set (i.e., the original spliced sequence) containing local time segment representation, global token and variate token is finally obtained, as follows: , wherein, denotes a set of time slice embeddings, denotes a set of global internal variables token, denotes a set of exogenous variables variate token, which provides a unified feature input space for subsequent sparse self-attention and cross-attention calculations.

[0036] Specifically, the high-dimensional representation sequence (i.e., the original concatenation sequence) is divided into a plurality of continuous segments according to a fixed length , and each segment forms a patch token (i.e., an original concatenation segment vector), as follows: , wherein, , M is the total number of segments, and the patch token can effectively compress long sequences and improve modeling efficiency.

[0037] It should be understood that the power load point prediction value (i.e., the load prediction value) is generated based on the fused features (i.e., the original concatenation sequence), and the upper and lower confidence boundaries are output by the interval prediction to obtain the load interval prediction result.

[0038] In the above embodiment, a plurality of load prediction values are obtained by performing prediction analysis on the training model based on all target city historical power load data, all target environmental interference data, and all load true values, which ensures the consistency of internal and external source data in the time dimension, enhances the feature discrimination degree of different variables, effectively compresses long sequences, improves modeling efficiency, realizes joint modeling of short-term fluctuations and medium and long-term trends of power load, and has strong engineering applicability while improving prediction accuracy and stability. It can be widely used in urban power grid dispatching, demand response, and new energy consumption scenarios.

[0039] Optionally, as an embodiment of the present application, the process of S48 comprises: performing self-attention analysis on each of the query vectors, the key vectors corresponding to each of the original concatenation segment vectors, the key dimensions corresponding to each of the original concatenation segment vectors, and the value vectors corresponding to each of the original concatenation segment vectors by the first formula, to obtain a self-attention vector corresponding to each of the original concatenation segment vectors, the first formula being: , wherein, is the self-attention vector corresponding to the i-th original concatenation segment vector, is the self-attention vector corresponding to the i-th original concatenation segment vector, is the self-attention vector corresponding to the i-th original concatenation segment vector, The query vector corresponding to each original concatenated fragment vector. For the first The key vector corresponding to each original spliced ​​fragment vector. For the first The value vector corresponding to each original spliced ​​fragment vector. For the first The key dimension corresponding to each original spliced ​​fragment vector. This is the activation function.

[0040] It should be understood that the correlation between each pair of patch tokens (i.e., the original concatenated fragment vectors) is modeled through a self-attention mechanism, as shown in the following formula: , in, These are obtained by mapping from patch tokens (i.e., the original spliced ​​fragment vectors), and this mechanism is used to capture long-range dependencies between different time segments.

[0041] In the above embodiments, the query vector, key vector, key dimension and value vector are analyzed by the self-attention mechanism layer to obtain the self-attention vector, which can effectively compress long sequences, improve modeling efficiency, and realize joint modeling of short-term fluctuations and medium- and long-term trends of power load.

[0042] Optionally, as an embodiment of the present invention, the process of S49 includes: The second equation uses the sparse attention layer to perform sparse attention analysis on each query vector, the key vector corresponding to each original concatenated fragment vector, the key dimension corresponding to each original concatenated fragment vector, and the value vector corresponding to each original concatenated fragment vector, respectively, to obtain the sparse attention vector corresponding to each original concatenated fragment vector. The second equation is: , in, For the first The sparse attention vector corresponding to each original spliced ​​fragment vector. For the first The query vector corresponding to each original concatenated fragment vector. For the first The key vector corresponding to each original spliced ​​fragment vector. For the first The value vector corresponding to each original spliced ​​fragment vector. For the first The key dimension corresponding to each original spliced ​​fragment vector. For activation function, For element-wise multiplication, It is a sparse mask matrix.

[0043] Specifically, for the power load forecasting task, sparse attention (i.e., sparse attention layer) is adopted to replace the full connection attention, and only the correlation between adjacent segments or key segments is calculated, so that the complexity is reduced from to approximately , and the formula can be expressed as: , wherein, is a sparse mask matrix, only part of the key attention connection is retained.

[0044] In the above embodiment, the query vector, the key vector, the key dimension and the value vector are respectively subjected to sparse attention analysis by the sparse attention layer to obtain a sparse attention vector, which can effectively compress the long sequence and improve the modeling efficiency, and realizes the joint modeling of the short-term fluctuation and the medium and long-term trend of the power load.

[0045] Optionally, as an embodiment of the present application, the process of S413 comprises: calculating all the upper limit values of the prediction intervals, all the lower limit values of the prediction intervals and all the load true values by the third formula to obtain a target loss function, the third formula is: , wherein, , wherein, is a target loss function, is the total number of original spliced segment vectors, is a lower limit loss function, is an upper limit loss function, is a first preset quantile, is the i-th load true value, is the i-th prediction interval lower limit value, is a second preset quantile, is the i-th prediction interval upper limit value. It should be understood that by quantile regression, the uncertainty of the power load forecasting result is quantified. The overall loss function of the model (i.e., the target loss function) is defined as the sum of the pinball losses corresponding to the two quantiles, and the formula is as follows:

[0046] , ​​​Wherein, M is the total number of samples. By minimizing the joint loss function, the model can learn the direct mapping from the input features to the upper and lower boundaries of the future load fluctuation interval, and complete the quantification of load uncertainty in an end-to-end manner.

[0047] Specifically, based on the fused feature representation , a quantile regression (QR) is used to output the power load prediction interval.

[0048] For the confidence interval , the loss function of the quantile regression (i.e. the target loss function) is defined as: , By selecting , , , the median prediction value, the lower confidence limit and the upper confidence limit of the load are obtained respectively.

[0049] In the above embodiment, the loss function analysis is performed on all prediction interval upper limit values, all prediction interval lower limit values and all load true values to obtain the target loss function, which can learn the direct mapping from the input features to the upper and lower boundaries of the future load fluctuation interval, and complete the quantification of load uncertainty in an end-to-end manner.

[0050] Optionally, as an embodiment of the present application, the load prediction value includes a prediction interval upper limit value and a prediction interval lower limit value, and the process of evaluating the index of all the load prediction values and all the load true values and taking the analysis result as the load prediction result includes: The coverage rate is obtained by calculating all the prediction interval upper limit values, all the prediction interval lower limit values and all the load true values by the fourth formula, and the fourth formula is: , Wherein, is the coverage rate, is the total number of original splicing segment vectors, is the th indicator function, is the th load true value, is the th prediction interval lower limit value, is the th prediction interval upper limit value; The maximum value is filtered out from all the load true values, and the maximum load true value is obtained after filtering. The minimum value is filtered out from all the load true values, and the minimum load true value is obtained after filtering. The maximum load true value, the minimum load true value, all the predicted interval upper limit values and all the predicted interval lower limit values are calculated by a fifth formula to obtain an interval width, and the coverage, the interval width, all the predicted interval upper limit values and all the predicted interval lower limit values are taken as a load prediction result together, the fifth formula being: , wherein, , wherein, is the interval width, is a total number of original spliced segment vectors, is the first predicted interval lower limit value, is the first predicted interval upper limit value, is a data range, is the maximum load true value, is the minimum load true value. It should be understood that the predicted interval coverage (i.e. the coverage), the interval width and other indexes are calculated, and the prediction result is applied to power grid dispatching and risk management.

[0051]

[0052] Specifically, to evaluate the performance of interval prediction, the coverage (PICP) and the interval width (PINAW) are used as follows: , , wherein, , are the predicted lower limit and upper limit of the first sample respectively, is the data range. The final prediction result and evaluation indexes can be used for power grid dispatching, demand response and risk management. In the above embodiment, all the load prediction values and all the load true values are analyzed by evaluation indexes, and the analysis result is taken as the load prediction result. Compared with the traditional prediction method, the prediction result of the present application is more in line with the demand of robustness and safety margin of power grid dispatching and risk management, meanwhile, the joint modeling of short-term fluctuation and medium and long-term trend of power load is realized, the prediction precision and stability are improved, and the strong engineering applicability is possessed, which can be widely used in urban power grid dispatching, demand response, new energy consumption and other scenes.

[0053] Optionally, as another embodiment of the present application, as shown in

[0054] the present application sets the following in the modeling process: Figure 2 ​​​(1) Endogenous variable modeling unit: used for extracting local time sequence characteristics of historical load sequence; (2) Endogenous and exogenous variable fusion unit: used for interactive modeling of external environmental characteristics such as weather, holidays and endogenous characteristics; (3) Global modeling unit: extract long-term change relationship on the basis of fused characteristics.

[0055] The modeling process can be abstracted as: , Wherein, represents an endogenous variable sequence, represents an exogenous variable sequence, , , Endogenous modeling function, interactive fusion function and global modeling function are respectively represented.

[0056] Optionally, as another embodiment of the present application, as shown in Figure 3 The comparison between the load prediction result provided by the present application and the actual load data shows that the prediction value can better follow the short-term fluctuation and medium-term trend change of the actual load, and the prediction interval effectively covers the change range of the real data, proving that the present application method can not only improve the prediction accuracy and stability, but also quantify the prediction uncertainty, providing reliable support for power grid dispatching and risk management.

[0057] Optionally, as another embodiment of the present application, the present application comprises the following steps: 1. Data acquisition and preprocessing: collect historical urban power load data as endogenous variables, and obtain meteorological conditions, holiday information and economic indicators as exogenous variables, and clean, normalize and construct sliding window for original data.

[0058] 2. Hierarchical modeling and feature fusion: first, in the endogenous variable modeling layer, the short-term time sequence change characteristics of the historical load data are extracted; then, in the interactive fusion layer, the external environmental characteristics of exogenous variables such as meteorological conditions are integrated; finally, in the global modeling layer, long-term change relationship is established for the fused multi-level characteristics, so as to realize comprehensive modeling of endogenous and exogenous variables.

[0059] 3. Interval prediction output: generate power load point prediction value based on the fused characteristics, and output upper and lower confidence boundaries by using interval prediction unit to obtain load interval prediction result.

[0060] 4. Result evaluation and application: calculate prediction interval coverage, interval width and other indicators, and apply the prediction result to power grid dispatching and risk management.

[0061] Optionally, as another embodiment of the present application, the present application aims to overcome the shortcomings of the prior art and aims to provide a short-term urban power load interval prediction method based on endogenous and exogenous variable hierarchical modeling. The technical problem to be solved by the present application is to simultaneously fuse endogenous and exogenous variables in short-term urban power load prediction, accurately depict the complex time sequence characteristics of the load, and provide upper and lower confidence interval prediction results while predicting, to quantify the prediction uncertainty and improve the availability and robustness of the prediction results in power dispatching. In view of the above problems, the present application proposes a short-term urban power load interval prediction method based on endogenous and exogenous variable hierarchical modeling, and introduces a quantile regression mechanism to directly generate upper and lower boundaries of the prediction interval, thereby realizing the quantification of the uncertainty of the power load prediction result and obtaining an accurate and reliable prediction interval.

[0062] Optionally, as another embodiment of the present application, in the present application, TimeXer is a Transformer model specially used for time series prediction, and is particularly suitable for processing time series prediction problems with exogenous variables. TimeXer enables the standard Transformer architecture to coordinate endogenous and exogenous information through an embedding layer. In addition, global internal variable tokens are used to effectively bridge external sequences to internal time series.

[0063] Optionally, as another embodiment of the present application, in addition to segment-to-segment attention, the present application introduces global tokens which interact with each segment token to ensure that overall trend information can be passed to local segments: , This design enhances global semantic consistency while modeling local details.

[0064] After sparse attention and global interaction, the features of patch tokens and global tokens are updated to form new representations: , This process can be stacked in multiple layers to enhance the model's ability to model long sequence dependencies layer by layer.

[0065] Optionally, as another embodiment of the present application, the present application has the beneficial effects of: (1) Endogenous and exogenous variable fusion: the present application simultaneously introduces historical load and other endogenous variables and meteorological, holiday and other exogenous variables in short-term power load prediction, and realizes the interactive fusion of the two types of variables through a hierarchical modeling structure, avoiding the problem of traditional models relying only on single load sequences, and improving the sensitivity and adaptability of the prediction results to external environmental disturbances.

[0066] (2) Novel hierarchical modeling mechanism: the present application sequentially sets endogenous variable modeling unit, endogenous and exogenous variable fusion unit and global modeling unit in the modeling process, respectively corresponding to short-term local feature extraction, external environment information introduction and overall trend modeling, forming multi-level feature expression, effectively solving the defects of the prior art in insufficient extraction of complex time sequence characteristics.

[0067] (3) Introduction of interval prediction mechanism: the present application introduces quantile regression mechanism in the output prediction link, not only generates load point prediction value, but also outputs upper and lower bounds of the prediction interval, so as to quantify the prediction uncertainty. Compared with the traditional point prediction method, the prediction result of the present application is more in line with the demand of robustness and safety margin for power grid dispatching and risk management.

[0068] (4) Combination of prediction performance and engineering application: the present application realizes joint modeling of short-term fluctuations and medium and long-term trends of power load by combining hierarchical modeling and interval prediction mechanism, which improves the prediction accuracy and stability while having strong engineering applicability, and can be widely used in urban power grid dispatching, demand response and new energy consumption and other scenes.

[0069] Figure 4 A module block diagram of a load prediction device provided for an embodiment of the present application is shown.

[0070] Optionally, as another embodiment of the present application, as shown in Figure 4 a load prediction device comprises: an import module for importing a plurality of original city historical power load data and a plurality of original environmental disturbance data; a preprocessing module for preprocessing each of the original city historical power load data and each of the original environmental disturbance data, to obtain preprocessed city historical power load data corresponding to each of the original city historical power load data and preprocessed environmental disturbance data corresponding to each of the original environmental disturbance data; a division module for dividing all the preprocessed city historical power load data and all the preprocessed environmental disturbance data to obtain a plurality of target city historical power load data, a plurality of target environmental disturbance data and a plurality of load true values; a prediction analysis module for constructing a training model, performing prediction analysis on the training model through all the target city historical power load data, all the target environmental disturbance data and all the load true values, to obtain a plurality of load prediction values; a prediction result obtaining module for performing evaluation index analysis on all the load prediction values and all the load true values, and taking the analysis result as a load prediction result.

[0071] Optionally, another embodiment of the present application provides a load prediction system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program, the load prediction method as described above is realized. The system can be a computer or the like.

[0072] Optionally, another embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores a computer program, when the computer program is executed by a processor, the load prediction method as described above is realized.

[0073] It should be noted that, in this paper, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment.

[0074] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be described here.

[0075] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0076] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the present application.

[0077] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit.

[0078] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part of the prior art that contributes, or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0079] The above description is only the preferred embodiment of the present application, and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A load forecasting method, characterized in that, Includes the following steps: Import multiple original historical power load data for cities and multiple original environmental disturbance data; Each of the original historical power load data of the city and each of the original environmental interference data are preprocessed to obtain preprocessed historical power load data of the city and preprocessed environmental interference data corresponding to each of the original historical power load data of the city. All the preprocessed historical power load data of cities and all the preprocessed environmental interference data are divided to obtain multiple target city historical power load data, multiple target environmental interference data and multiple load real values; A training model is constructed, and the training model is used to predict and analyze the historical power load data of all the target cities, all the target environmental interference data, and all the actual load values ​​to obtain multiple load prediction values. An evaluation index analysis was performed on all the predicted load values ​​and all the actual load values, and the analysis results were used as the load prediction results.

2. The load forecasting method according to claim 1, characterized in that, The process of preprocessing each of the original historical urban power load data and each of the original environmental interference data to obtain preprocessed historical urban power load data and preprocessed environmental interference data corresponding to each of the original historical urban power load data includes: Missing values ​​are processed for each of the original historical power load data of the city and each of the original environmental interference data to obtain the historical power load data of the city to be processed and the environmental interference data to be processed corresponding to each of the original historical power load data of the city. The Min-Max normalization algorithm is used to normalize the historical power load data of each city to be processed and the environmental interference data to be processed corresponding to each original environmental interference data, respectively, to obtain the preprocessed historical power load data of each city and the preprocessed environmental interference data corresponding to each original environmental interference data.

3. The load forecasting method according to claim 1, characterized in that, The process of dividing all the preprocessed historical urban power load data and all the preprocessed environmental interference data to obtain multiple target city historical power load data, multiple target environmental interference data, and multiple actual load values ​​includes: Import the window length and prediction step size, and construct a sliding window using the window length and prediction step size; The preprocessed historical power load data of cities and the preprocessed environmental interference data are divided according to the sliding window to obtain multiple target city historical power load data, multiple target environmental interference data and multiple load real values.

4. The load forecasting method according to claim 1, characterized in that, The training model includes a convolutional embedding layer, a self-attention mechanism layer, a sparse attention layer, a first neuron, and a second neuron. The process of performing predictive analysis on the trained model using all historical power load data of the target cities, all target environmental disturbance data, and all actual load values ​​to obtain multiple load prediction values ​​includes: S41: Align all the historical power load data of the target cities and all the target environmental interference data in chronological order to obtain multiple original aligned power data; S42: The convolutional embedding layer is used to map each of the original aligned power data to obtain the original local time segment vector corresponding to each of the original aligned power data. S43: Import the original global vector corresponding to the historical power load data of each target city, concatenate all the original local time segment vectors and all the original global vectors, and obtain the original concatenation sequence through all the concatenated results; S44: Divide the original splicing sequence according to a preset length to obtain multiple original splicing segment vectors; S45: Map the query vector to each of the original spliced ​​fragment vectors to obtain the query vector corresponding to each of the original spliced ​​fragment vectors; S46: Map the key vectors to each of the original spliced ​​fragment vectors to obtain the key vectors corresponding to each of the original spliced ​​fragment vectors and the key dimensions corresponding to each of the original spliced ​​fragment vectors; S47: Map the value vectors of each of the original spliced ​​fragment vectors to obtain the value vectors corresponding to each of the original spliced ​​fragment vectors; S48: The self-attention mechanism layer performs self-attention analysis on each query vector, the key vector corresponding to each original spliced ​​fragment vector, the key dimension corresponding to each original spliced ​​fragment vector, and the value vector corresponding to each original spliced ​​fragment vector to obtain the self-attention vector corresponding to each original spliced ​​fragment vector. S49: The sparse attention layer performs sparse attention analysis on each query vector, the key vector corresponding to each original spliced ​​fragment vector, the key dimension corresponding to each original spliced ​​fragment vector, and the value vector corresponding to each original spliced ​​fragment vector to obtain the sparse attention vector corresponding to each original spliced ​​fragment vector. S410: Concatenate all the original local time segment vectors, all the original global vectors, all the self-attention vectors, and all the sparse attention vectors, and obtain the original concatenation sequence through all the concatenated results; S411: The original spliced ​​sequence is predicted by the first neuron to obtain multiple upper limits of prediction intervals; S412: The original spliced ​​sequence is predicted by the second neuron to obtain multiple lower limits of prediction intervals; S413: Perform loss function analysis on all the upper limits of the prediction intervals, all the lower limits of the prediction intervals, and all the actual load values ​​to obtain the target loss function; S414: Determine whether the target loss function is less than or equal to a preset threshold. If not, update the parameters of the training model according to the target loss function, and return to S41 after parameter update. If yes, use all the upper limit values ​​of the prediction interval and all the lower limit values ​​of the prediction interval as load prediction values ​​to obtain multiple load prediction values.

5. The load forecasting method according to claim 4, characterized in that, The process in S48 includes: By performing self-attention analysis on each query vector, the key vector corresponding to each original concatenated fragment vector, the key dimension corresponding to each original concatenated fragment vector, and the value vector corresponding to each original concatenated fragment vector using the first formula, a self-attention vector corresponding to each original concatenated fragment vector is obtained. The first formula is: , in, For the first The self-attention vector corresponding to each original spliced ​​fragment vector. For the first The query vector corresponding to each original concatenated fragment vector. For the first The key vector corresponding to each original spliced ​​fragment vector. For the first The value vector corresponding to each original spliced ​​fragment vector. For the first The key dimension corresponding to each original spliced ​​fragment vector. This is the activation function.

6. The load forecasting method according to claim 4, characterized in that, The process described in S49 includes: The second equation uses the sparse attention layer to perform sparse attention analysis on each query vector, the key vector corresponding to each original concatenated fragment vector, the key dimension corresponding to each original concatenated fragment vector, and the value vector corresponding to each original concatenated fragment vector, respectively, to obtain the sparse attention vector corresponding to each original concatenated fragment vector. The second equation is: , in, For the first The sparse attention vector corresponding to each original spliced ​​fragment vector. For the first The query vector corresponding to each original concatenated fragment vector. For the first The key vector corresponding to each original spliced ​​fragment vector. For the first The value vector corresponding to each original spliced ​​fragment vector. For the first The key dimension corresponding to each original spliced ​​fragment vector. For activation function, For element-wise multiplication, It is a sparse mask matrix.

7. The load forecasting method according to claim 4, characterized in that, The process in S413 includes: The target loss function is obtained by calculating all the upper limits of the prediction intervals, all the lower limits of the prediction intervals, and all the actual load values ​​using the third equation. The third equation is: , in, , in, Let be the target loss function. This represents the total number of original spliced ​​fragment vectors. The lower bound loss function, For the upper bound loss function, This is the first preset quantile. For the first The actual load value, For the first The lower limit of the prediction interval, This is the second preset quantile. For the first The upper limit of the prediction interval.

8. The load forecasting method according to claim 1, characterized in that, The load forecast values ​​include an upper limit and a lower limit of the forecast interval. The process of performing evaluation index analysis on all the load forecast values ​​and all the actual load values, and using the analysis results as the load forecast results, includes: The coverage rate is obtained by calculating the upper limit of all predicted intervals, the lower limit of all predicted intervals, and the actual load values ​​using the fourth formula, which is: , in, For coverage, This represents the total number of original spliced ​​fragment vectors. For the first One indicator function, For the first The actual load value, For the first The lower limit of the prediction interval, For the first Upper limit of each prediction interval; The maximum value is selected from all the actual load values, and the maximum actual load value is obtained after filtering. The minimum value is selected from all the actual load values, and the minimum actual load value is obtained after filtering. The fifth equation is used to calculate the actual maximum load value, the actual minimum load value, all upper limits of the prediction intervals, and all lower limits of the prediction intervals to obtain the interval width. The coverage rate, the interval width, all upper limits of the prediction intervals, and all lower limits of the prediction intervals are then combined as the load prediction result. The fifth equation is: , in, , in, The interval width, This represents the total number of original spliced ​​fragment vectors. For the first The lower limit of the prediction interval, For the first Upper limit of the prediction interval, For the data range, This represents the actual maximum load value. This represents the actual minimum load value.

9. A load forecasting device, characterized in that, include: The import module is used to import multiple original historical electricity load data for cities and multiple original environmental disturbance data. The preprocessing module is used to preprocess each of the original historical power load data of the city and each of the original environmental interference data to obtain preprocessed historical power load data of the city and preprocessed environmental interference data corresponding to each of the original historical power load data of the city. The segmentation module is used to segment all the preprocessed historical power load data of cities and all the preprocessed environmental interference data to obtain multiple target historical power load data of cities, multiple target environmental interference data and multiple load real values. The predictive analysis module is used to build a training model and perform predictive analysis on the training model using all the historical power load data of the target city, all the target environmental interference data, and all the actual load values ​​to obtain multiple load prediction values. The prediction result acquisition module is used to perform evaluation index analysis on all the predicted load values ​​and all the actual load values, and use the analysis results as the load prediction results.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the load forecasting method as described in any one of claims 1 to 8.