A power load prediction method based on hierarchical cascading cross-scale attention mechanism and related equipment
Patent Information
- Application Number
- CN202611083615.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-21
- Publication Date
- 2026-10-27
AI Technical Summary
[0002]相关技术中,电力负荷预测技术存在单尺度建模感知片面、多尺度融合过程中的特征稀释以及数学分解方法缺乏明确负荷变化语义等缺陷,导致模型对负荷峰谷转折点捕捉不灵敏且极易过拟合于气象随机噪声
[0016]本申请实施例至少包括以下有益效果:本申请提供一种基于分层级联跨尺度注意力机制的电力负荷预测方法、系统、电子设备、存储介质及程序产品,该方案包括:得到标准多维特征张量;根据日内波动周期、周度模式切换周期和月度趋势变化周期,以滑动窗口将标准多维特征张量沿时域独立切分为短期窗口序列、中期窗口序列和长期窗口序列;输出短期时序隐状态、中期时序隐状态和长期时序隐状态;输出融合中期语境证据的短期增强隐状态;以短期增强隐状态作为查询项,以长期时序隐状态作为键值存储库,执行多头缩放点积注意力运算并经残差连接与层归一化,输出经长期宏观背景逻辑校验的全局上下文向量;将全局上下文向量映射输出电力负荷预测值。本申请能够预测出未来时刻的电力负荷值。
Smart Images

Figure CN122992668A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power load forecasting technology, and in particular to a power load forecasting method and related equipment based on a hierarchical cascaded cross-scale attention mechanism. Background Technology
[0002] Among related technologies, power load forecasting technology suffers from defects such as one-sided perception in single-scale modeling, feature dilution in the multi-scale fusion process, and lack of clear load change semantics in mathematical decomposition methods. These defects result in the model being insensitive to capturing load peak-valley inflection points and being prone to overfitting to meteorological random noise.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0004] The main objective of this application is to propose a power load forecasting method and related equipment based on a hierarchical cascaded cross-scale attention mechanism, which can predict the power load value at future times.
[0005] To achieve the above objectives, one aspect of this application proposes a power load forecasting method based on a hierarchical cascaded cross-scale attention mechanism, the method comprising the following steps: Hourly load sequences and matching meteorological factor data are collected, historical load sequence values, multi-station temperature observation values and periodic time codes are extracted and concatenated into a multidimensional feature vector, and the multidimensional feature vector is standardized to obtain a standard multidimensional feature tensor. Based on the intraday fluctuation cycle, weekly pattern switching cycle, and monthly trend change cycle, the standard multidimensional feature tensor is independently divided into short-term window sequence, medium-term window sequence, and long-term window sequence along the time domain using a sliding window. The short-term window sequence, the intermediate window sequence, and the long-term window sequence are fed into three parallel gated cyclic encoders. Each encoder independently extracts the temporal dependencies at the corresponding scale and outputs the short-term, intermediate, and long-term temporal hidden states. Using the short-term temporal hidden state as the query term and the intermediate temporal hidden state as the key value repository, perform multi-head scaling dot product attention operation and pass through residual connection and layer normalization to output the short-term enhanced hidden state that integrates intermediate contextual evidence. Using the short-term enhanced hidden state as the query term and the long-term temporal hidden state as the key value repository, perform multi-head scaling dot product attention operation and pass through residual connection and layer normalization to output a global context vector that has been verified by long-term macro background logic. The global context vector is mapped to output the predicted power load value.
[0006] In some embodiments, the process of collecting hourly load sequences and matching meteorological factor data, extracting historical load sequence values, multi-station temperature observation values, and periodic time codes, concatenating them into a multidimensional feature vector, and then standardizing the multidimensional feature vector to obtain a standard multidimensional feature tensor includes: The hourly load observations recorded during the historical operation of the power system and the meteorological station temperature observations aligned with their time were used as the full sample. The entire sample is divided into a training set, a validation set, and a test set in chronological order. Extract historical load sequence values from the full sample; Temperature observations reported by multiple meteorological observation stations that are time-aligned with the historical load sequence values are collected, and the temperature observations of each station are combined into a temperature observation vector. Collect the clock time information, calendar week information, and month information of the current prediction time. Then, convert the clock time information, calendar week information, and month information to the cyclic period space through sine mapping and cosine mapping respectively to obtain the periodic encoding vector. The historical load sequence value, the temperature observation vector, and the periodic encoding vector are concatenated into a multidimensional feature vector. On the training set, the central tendency parameter and the dispersion parameter of the multidimensional feature vector are calculated. Using the central tendency parameter and the dispersion parameter as a fixed scaling reference, a standardization operation based on the central tendency parameter and the dispersion parameter is performed on the multidimensional feature vectors in the training set, the validation set, and the test set to obtain a standard multidimensional feature tensor.
[0007] In some embodiments, the step of independently dividing the standard multidimensional feature tensor into short-term window sequences, medium-term window sequences, and long-term window sequences along the time domain using a sliding window based on intraday fluctuation cycles, weekly pattern switching cycles, and monthly trend change cycles includes: Using a preset short-cycle length that characterizes the alternation of peak and valley within a day and the fluctuation of user electricity consumption behavior as the window size and the data sampling time interval as the sliding step, short time segments at each starting moment are extracted from the standard multidimensional feature tensor, and the short time segments are arranged in chronological order to form a short-term window sequence. Using a preset medium-cycle length that characterizes the switching of load modes between weekdays and rest days and the weekly power grid dispatching pattern as the window size and the data sampling time interval as the sliding step size, medium-time segments at each starting time are extracted from the standard multidimensional feature tensor, and the medium-time segments are arranged in chronological order to form a medium-term window sequence; the medium-term window sequence and the short-term window sequence are isolated from each other in the time domain. Using a preset long-cycle length that characterizes seasonal temperature trends and macro-production rhythm as the window size and the data sampling time interval as the sliding step size, long-term segments at each starting moment are extracted from the standard multidimensional feature tensor, and the long-term segments are arranged in chronological order to form a long-term window sequence; the long-term window sequence is isolated from the short-term window sequence and the medium-term window sequence in the time domain.
[0008] In some embodiments, feeding the short-term window sequence, the intermediate-term window sequence, and the long-term window sequence into three parallel gated cyclic encoders, with each encoder independently extracting the temporal dependencies at its corresponding scale and outputting the short-term, intermediate-term, and long-term temporal hidden states, includes: Construct three gated cyclic unit encoders with identical topologies and independently updated parameters. Each encoder corresponds to a short-term scale, a medium-term scale, and a long-term scale, respectively. The short-term scale, the medium-term scale, and the long-term scale are determined by the window lengths of the short-term window sequence, the medium-term window sequence, and the long-term window sequence, respectively. The short window sequence is sequentially fed into the first gated loop unit encoder along the time steps. The first gated loop unit encoder performs gated filtering on the input state of each time step and the hidden state of the previous moment through the reset gate and update gate, iteratively updates the hidden state along the time steps, and takes the updated hidden state of each time step to form the short-term time-series hidden state. The intermediate window sequence is sequentially fed into the second gated loop unit encoder along the time steps. The second gated loop unit encoder performs gated filtering on the input state of each time step and the hidden state of the previous time step through the reset gate and update gate, iteratively updates the hidden state along the time steps, and takes the updated hidden state of each time step to form the intermediate time sequence hidden state. The long-term window sequence is sequentially fed into the third gated loop encoder along the time steps. The third gated loop encoder performs gated filtering on the input state of each time step and the hidden state of the previous time step through the reset gate and update gate, iteratively updates the hidden state along the time steps, and takes the updated hidden state of each time step to form the long-term time-series hidden state.
[0009] In some embodiments, the step of using the short-term temporal hidden state as a query term, the intermediate temporal hidden state as a key-value store, performing multi-head scaling dot product attention operations and passing them through residual connections and layer normalization to output a short-term enhanced hidden state fused with intermediate contextual evidence includes: The short-term hidden state is mapped to a query matrix, and the medium-term hidden state is mapped to a key matrix and a value matrix, respectively. The query matrix, the key matrix, and the value matrix are then split into multiple subspaces along the feature dimension. In each of the subspaces, the dot product between the query matrix and the transpose of the key matrix is calculated. The dot product result is scaled by a scaling factor and then normalized by the Softmax function to obtain the attention weight distribution. The value matrix is then weighted and summed using the attention weight distribution to obtain the attention output of each subspace. The attention outputs of each subspace are concatenated along the feature dimension and then linearly transformed. This is then superimposed on the short-term temporal hidden state and layer normalization is performed to obtain the short-term enhanced hidden state.
[0010] In some embodiments, the step of using the short-term enhanced hidden state as a query term, the long-term temporal hidden state as a key-value store, performing multi-head scaling dot product attention operations and passing them through residual connections and layer normalization to output a global context vector validated by long-term macroscopic background logic includes: The short-term enhanced hidden state is mapped to a query matrix, and the long-term time-series hidden state is mapped to a key matrix and a value matrix, respectively. The query matrix, the key matrix, and the value matrix are each split into multiple subspaces along the feature dimension. In each of the subspaces, the dot product between the query matrix and the transpose of the key matrix is calculated. The dot product result is scaled by a scaling factor and then normalized by the Softmax function to obtain the attention weight distribution. The value matrix is then weighted and summed using the attention weight distribution to obtain the attention output of each subspace. The attention outputs of each subspace are concatenated along the feature dimension, linearly transformed, superimposed with the short-term enhanced hidden state, and then subjected to layer normalization to obtain the global context vector.
[0011] In some embodiments, mapping the global context vector to output the predicted power load includes: The global context vector is converted into an output vector corresponding to the prediction step size through output mapping, and the output vector is output as the predicted power load value.
[0012] To achieve the above objectives, another aspect of this application proposes a power load forecasting system based on a hierarchical cascaded cross-scale attention mechanism, for implementing the method described above, the system comprising: The data acquisition and feature construction module is used to acquire hourly load sequences and matching meteorological factor data, extract historical load sequence values, multi-station temperature observation values and periodic time codes and concatenate them into a multidimensional feature vector, and perform standardization on the multidimensional feature vector to obtain a standard multidimensional feature tensor. The time-domain segmentation module is used to independently segment the standard multidimensional feature tensor into short-term window sequences, medium-term window sequences, and long-term window sequences along the time domain using a sliding window based on the intraday fluctuation cycle, weekly pattern switching cycle, and monthly trend change cycle. The parallel encoding module is used to feed the short-term window sequence, the intermediate window sequence and the long-term window sequence into three parallel gated cyclic unit encoders respectively. Each encoder independently extracts the temporal dependencies at the corresponding scale and outputs the short-term temporal hidden state, the intermediate temporal hidden state and the long-term temporal hidden state. The cascaded attention fusion module is used to perform multi-head scaling dot product attention operations with the short-term temporal hidden state as the query term and the medium-term temporal hidden state as the key-value store, and then perform residual connections and layer normalization to output a short-term enhanced hidden state that fuses medium-term contextual evidence; and to perform multi-head scaling dot product attention operations with the short-term enhanced hidden state as the query term and the long-term temporal hidden state as the key-value store, and then perform residual connections and layer normalization to output a global context vector that has been verified by long-term macro-background logic. The prediction output module is used to map the global context vector to output the predicted power load value.
[0013] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above.
[0014] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.
[0015] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer program product, including a computer program that, when executed by a processor, implements the aforementioned method.
[0016] The embodiments of this application include at least the following beneficial effects: This application provides a power load forecasting method, system, electronic device, storage medium, and program product based on a hierarchical cascaded cross-scale attention mechanism. The scheme includes: obtaining a standard multidimensional feature tensor; independently dividing the standard multidimensional feature tensor into short-term window sequences, medium-term window sequences, and long-term window sequences along the time domain using a sliding window based on intraday fluctuation cycles, weekly pattern switching cycles, and monthly trend change cycles; outputting short-term, medium-term, and long-term time-series hidden states; outputting short-term enhanced hidden states fused with medium-term contextual evidence; using the short-term enhanced hidden states as query terms and the long-term time-series hidden states as key-value stores, performing multi-head scaling dot product attention operations and performing residual connections and layer normalization to output a global context vector validated by long-term macroscopic background logic; and mapping the global context vector to output the predicted power load value. This application can predict the power load value at future times. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the power load forecasting method based on a hierarchical cascaded cross-scale attention mechanism provided in the embodiments of this application; Figure 2 This is a flowchart of the power load forecasting method based on a hierarchical cascaded cross-scale attention mechanism provided in the embodiments of this application; Figure 3 This is a model architecture diagram of the power load forecasting method based on a hierarchical cascaded cross-scale attention mechanism provided in the embodiments of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0020] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0021] 1) HMSA-Net (Hierarchical Multi-Scale Attention Network): refers to the core deep learning model architecture proposed in this invention, characterized by processing heterogeneous time-span information through an inside-out cascaded structure.
[0022] 2) Heterogeneous multi-scale: refers to the time resolution with different load prediction semantics established by sliding windows in the time domain. In this invention, it specifically refers to the 24-hour, 168-hour and 720-hour time windows corresponding to intraday patterns, weekly regularities and monthly trends.
[0023] 3) Cascaded query: This refers to the core attention interaction logic of this invention, which uses short-term signals reflecting instantaneous momentum as active query items and retrieves related evidence from medium-term and long-term feature repositories in a recursive manner to achieve hierarchical logical verification.
[0024] 4) Feature dilution: In multi-scale modeling, sensitive but small-scale short-term signals are covered by massive long-term background data, causing the model to lose its sensitivity to capture trend turning points.
[0025] 5) Load time characteristics: refers to the inherent pattern of power load data at different time scales. In this invention, it is specifically manifested as a multi-scale input sequence constructed by utilizing the fluctuation pattern and trend characteristics of historical load curves within 24-hour, 168-hour and 720-hour windows.
[0026] 6) Empirical Mode Decomposition (EMD): This refers to an algorithm that adaptively decomposes signals based on the local time-scale characteristics of the signal. It decomposes complex non-stationary signals into a series of intrinsic mode function components through an iterative screening process. However, this method often suffers from mode aliasing and endpoint effects when processing power load data.
[0027] 7) Variational Mode Decomposition (VMD): This refers to a non-recursive decomposition method that adaptively decomposes the original signal into stationary sub-signals with specific center frequencies and finite bandwidths by constructing and solving constrained variational problems. It has better noise resistance than EMD.
[0028] 8) Mode function: refers to the frequency components extracted from the original sequence through EMD, VMD or other signal decomposition techniques; each component represents the oscillation characteristics of the original signal in different frequency bands.
[0029] 9) GEFCom2014 (Global Energy Forecasting Competition 2014): An international power load forecasting competition organized by the Data-Driven Modeling and Forecasting Committee under the IEEE Power and Energy Society (IEEE PES).
[0030] Among related technologies, power load forecasting technology suffers from defects such as one-sided perception in single-scale modeling, feature dilution in the multi-scale fusion process, and lack of clear load change semantics in mathematical decomposition methods. These defects result in the model being insensitive to capturing load peak-valley inflection points and being prone to overfitting to meteorological random noise.
[0031] In view of this, this application provides a power load forecasting method and related equipment based on a hierarchical cascaded cross-scale attention mechanism. This scheme simulates the decision-making path of power grid dispatching experts while preserving the original load forecasting semantics through time-domain physical isolation modeling and cascaded logic verification from the inside out, so as to achieve high-precision and robust power load forecasting.
[0032] Figure 1 This is an optional schematic diagram of a power load forecasting method based on a hierarchical cascaded cross-scale attention mechanism provided in an embodiment of this application. Figure 1 The method may include, but is not limited to, steps S101 to S106.
[0033] Step S101: Collect hourly load sequences and matching meteorological factor data, extract historical load sequence values, multi-station temperature observation values and periodic time codes and concatenate them into a multidimensional feature vector, and perform standardization on the multidimensional feature vector to obtain a standard multidimensional feature tensor; Step S102: Based on the intraday fluctuation cycle, weekly pattern switching cycle, and monthly trend change cycle, the standard multidimensional feature tensor is independently divided into short-term window sequence, medium-term window sequence, and long-term window sequence along the time domain using a sliding window. Step S103: The short-term window sequence, the medium-term window sequence, and the long-term window sequence are fed into the three parallel gated cyclic unit encoders respectively. Each encoder independently extracts the temporal dependencies at the corresponding scale and outputs the short-term temporal hidden state, the medium-term temporal hidden state, and the long-term temporal hidden state. Step S104: Using short-term temporal hidden states as query terms and mid-term temporal hidden states as key-value stores, perform multi-head scaling dot product attention operations and pass through residual connections and layer normalization to output short-term enhanced hidden states that fuse mid-term contextual evidence. Step S105: Using short-term enhanced hidden states as query terms and long-term time-series hidden states as key-value stores, perform multi-head scaling dot product attention operations and pass through residual connections and layer normalization to output a global context vector that has been verified by long-term macro background logic. Step S106: Map the global context vector to output the predicted power load value.
[0034] Steps S101 to S106 of this embodiment involve collecting multi-source data to construct and standardize multi-dimensional feature vectors, providing a high-quality input foundation for the model. By using a sliding window to segment the standard feature tensor according to three inherent cycles—daily, weekly, and monthly—the load time characteristics are explicitly embedded into the model structure, avoiding semantic loss caused by frequency domain decomposition. A three-way parallel gated cyclic unit (GRU) encoder extracts the temporal evolution patterns at each scale, enabling the model to capture load fluctuation patterns of different granularities. A multi-head attention fusion mechanism is designed, cascading queries from short-term signals to medium- and long-term features, using short-term momentum as the decision core and medium- and long-term features only as verification evidence. This prevents short-term abrupt changes from being overwhelmed by massive long-term background data, effectively solving the feature dilution problem. Finally, the predicted value is output through mapping, achieving sensitive capture of load trend inflection points and accurate output of multi-step predictions. Compared with traditional models, it outperforms in RMSE, MAE, and MAPE indicators, exhibiting high accuracy, strong robustness, and clear power system semantic interpretability.
[0035] In some embodiments, step S101 may include, but is not limited to, steps S111 to S117: Step S111: Collect the hourly load observations recorded during the historical operation of the power system and the meteorological station temperature observations aligned with their time as the full sample. Step S112: Divide the entire sample into training set, validation set and test set in chronological order; Step S113: Extract historical load sequence values from the entire sample; Step S114: Collect temperature observations reported by multiple meteorological observation stations that are time-aligned with historical load sequence values, and combine the temperature observations of each station into a temperature observation vector. Step S115: Collect the clock time information, calendar week information, and month information of the current prediction time. Convert the clock time information, calendar week information, and month information to the cyclic period space through sine mapping and cosine mapping respectively to obtain the periodic encoding vector. Step S116: Concatenate the historical load sequence values, temperature observation vector, and periodic coding vector into a multidimensional feature vector; Step S117: Calculate the central tendency parameter and dispersion parameter of the multidimensional feature vector on the training set. Using the central tendency parameter and dispersion parameter as a fixed scaling reference, perform a standardization operation based on the central tendency parameter and dispersion parameter on the multidimensional feature vectors in the training set, validation set and test set to obtain the standard multidimensional feature tensor.
[0036] In steps S111 to S117 of some embodiments, by collecting hourly load sequences and matching meteorological factor data, historical load values, multi-station temperature observation values, and periodic time codes are extracted and concatenated into a 32-dimensional feature vector, and then standardization is performed to construct a unified input foundation for the model that covers load autoregressive information, external meteorological driving information, and periodic time prior information. In this embodiment, the full sample is divided into training, validation, and test sets in chronological order, and the mean and standard deviation are calculated only on the training set as a fixed scaling benchmark and statically applied to the validation and test sets. This division method ensures that the model does not peek into future information during training, avoiding false accuracy caused by data leakage; the static standardization strategy ensures that each dataset is in the same feature distribution space, eliminating the impact of dimensional differences on model training, enabling the model to stably learn the true laws of load changes rather than data scale differences. Simultaneously, the sine / cosine periodic encoding maps hours, days of the week, and months to a continuous unit circle space, enabling the neural network to understand the cyclical characteristics of time and providing a standardized feature tensor with complete physical semantics for subsequent multi-scale modeling.
[0037] In some embodiments, step S102 may include, but is not limited to, steps S201 to S203: Step S201: Using a preset short period length that characterizes the daily peak-valley alternation and fluctuations in user electricity consumption behavior as the window size and the data sampling time interval as the sliding step size, short time segments at each starting moment are extracted from the standard multidimensional feature tensor, and the short time segments are arranged in chronological order to form a short window sequence. Step S202: Using a preset medium-cycle length that characterizes the switching of load modes between weekdays and rest days and the weekly power grid dispatching pattern as the window size and the data sampling time interval as the sliding step size, extract the medium-time segments at each starting moment from the standard multidimensional feature tensor, and arrange the medium-time segments in chronological order to form a medium-term window sequence; the medium-term window sequence and the short-term window sequence are isolated from each other in the time domain. Step S203: Using a preset long-cycle length that characterizes seasonal temperature trends and macro-production rhythm as the window size and the data sampling time interval as the sliding step size, long-term segments at each starting moment are extracted from the standard multidimensional feature tensor, and the long-term segments are arranged in chronological order to form a long-term window sequence; the long-term window sequence is isolated from the short-term window sequence and the medium-term window sequence in the time domain.
[0038] In steps S201 to S203 of some embodiments, the standard multidimensional feature tensor is independently divided into three independent window sequences of 24 hours, 168 hours, and 720 hours along the time domain using a sliding window based on three load time characteristic cycles: intraday, weekly, and monthly. This is done instead of using frequency domain decomposition methods such as EMD / VMD. The three types of windows in this application's embodiments each correspond to a preset cycle length representing intraday peak-valley alternation, weekly work-rest switching, and seasonal temperature trends. The beneficial effects of this direct time-domain segmentation include: First, it preserves the physical semantics of the original load curve—the 24-hour window corresponds to "daily peak-valley alternation," the 168-hour window corresponds to "weekday and weekend mode switching," and the 720-hour window corresponds to "seasonal temperature drift," enabling the model's internal representation to accurately align with real-world power grid dispatch patterns. Second, "independent segmentation" ensures independence between the three scales, avoiding mode aliasing and endpoint effects in frequency domain decomposition. Third, it provides independent and semantically clear short, medium, and long inputs for the subsequent hierarchical attention mechanism, allowing the model to focus on load fluctuation patterns at different time granularities, rather than mixing all frequency components, thereby improving prediction accuracy and logical interpretability.
[0039] In some embodiments, step S103 may include, but is not limited to, steps S301 to S304: Step S301: Construct three gated cyclic unit encoders with identical topologies and independently updated parameters. Each encoder corresponds to the short-term, medium-term, and long-term scales, respectively. The short-term, medium-term, and long-term scales are determined by the window lengths of the short-term, medium-term, and long-term window sequences, respectively. Step S302: The short window sequence is sequentially fed into the first gated loop unit encoder along the time steps. The first gated loop unit encoder performs gated filtering on the input state of each time step and the hidden state of the previous time step through the reset gate and update gate, iteratively updates the hidden state along the time steps, and takes the updated hidden state of each time step to form the short-term time-series hidden state. Step S303: The intermediate window sequence is sequentially fed into the second gated loop encoder along the time steps. The second gated loop encoder performs gated filtering on the input state of each time step and the hidden state of the previous time step through the reset gate and update gate, iteratively updates the hidden state along the time steps, and takes the updated hidden state of each time step to form the intermediate time sequence hidden state. Step S304: The long-term window sequence is sequentially fed into the third gated loop encoder along the time steps. The third gated loop encoder performs gated filtering on the input state of each time step and the hidden state of the previous time step through the reset gate and update gate, iteratively updates the hidden state along the time steps, and takes the updated hidden state of each time step to form the long-term time-series hidden state.
[0040] In steps S301 to S304 of some embodiments, three GRU encoders with identical topologies but independently updated parameters are used to perform temporal encoding on short-term, medium-term, and long-term window sequences to extract hidden state representations at each scale. In this embodiment, each encoder uses reset and update gates to gate the input state at each time step and the hidden state at the previous time step, iteratively updating and outputting the complete temporal hidden state along the time step. The beneficial effects of this application's embodiments include: First, compared to Long Short-Term Memory (LSTM) networks, GRU has a simpler gated topology, exhibiting excellent generalization ability and lower overfitting risk in hourly load prediction tasks, resulting in higher training efficiency; Second, the independent parameter updates of the three GRU paths enable each encoder to adaptively learn the optimal temporal pattern at its respective scale. The short-term encoder focuses on capturing intraday peak-valley fluctuations, the medium-term encoder focuses on weekday / rest day mode switching, and the long-term encoder represents seasonal macroeconomic trends, avoiding inter-scale interference caused by parameter sharing; Third, the coordinated control of the reset and update gates enables GRU to effectively handle sequence dependencies lasting up to 720 hours, solving the gradient vanishing problem of traditional RNNs, ensuring the effective transmission of long-term dependency information, and providing high-quality temporal feature representations for subsequent cross-scale attention fusion.
[0041] In some embodiments, step S104 may include, but is not limited to, steps S401 to S403: Step S401: Map the short-term time-series hidden state to a query matrix, map the medium-term time-series hidden state to a key matrix and a value matrix respectively, and split the query matrix, key matrix and value matrix into multiple subspaces in the feature dimension respectively; Step S402: Calculate the dot product between the transpose of the query matrix and the key matrix in each subspace. After scaling the dot product result with a scaling factor, normalize it to the attention weight distribution using the Softmax function. Then, perform a weighted summation of the value matrix using the attention weight distribution to obtain the attention output of each subspace. Step S403: The attention outputs of each subspace are concatenated along the feature dimension and then linearly transformed. This is then superimposed on the short-term temporal hidden state and layer normalization is performed to obtain the short-term enhanced hidden state.
[0042] In steps S401 to S403 of some embodiments, short-term temporal hidden states are used as query terms, and medium-term temporal hidden states are used as key-value stores. Multi-head scaling dot product attention operations are performed, followed by residual connections and layer normalization, to output short-term enhanced hidden states. This application further defines the complete process of querying, multi-head splitting of the key-value matrix, scaling dot product attention calculation, linear transformation after concatenation, and residual connections and layer normalization. The beneficial effects of this step include: First, the design of using short-term signals as "active queryers" allows the model to prioritize recent changes reflecting instantaneous load momentum, effectively solving the problem of short-term sensitive signals being diluted by massive long-term background data in multi-scale fusion; Second, the intermediate state library serves as verification evidence, providing support or rebuttal for short-term fluctuations based on weekly patterns, simulating the decision-making logic of scheduling experts who "first look at intraday fluctuations, then align with weekly patterns," thus giving the model clear semantic interpretability for power systems; Third, the multi-head mechanism enables the model to perceive the heterogeneous relationship between queries and key values from different feature subspaces, enhancing its ability to express complex load patterns; Fourth, residual connections ensure that the original short-term features are preserved, avoiding information loss caused by network deepening, while layer normalization accelerates training convergence and prevents gradient vanishing.
[0043] In some embodiments, step S105 may include, but is not limited to, steps S501 to S503: Step S501: Map the short-term enhanced hidden state to a query matrix, map the long-term time-series hidden state to a key matrix and a value matrix respectively, and split the query matrix, key matrix and value matrix into multiple subspaces in the feature dimension respectively; Step S502: Calculate the dot product between the transpose of the query matrix and the key matrix in each subspace. Scale the dot product result with a scaling factor and normalize it to an attention weight distribution using the Softmax function. Then, use the attention weight distribution to perform a weighted summation on the value matrix to obtain the attention output of each subspace. Step S503: The attention outputs of each subspace are concatenated along the feature dimension, linearly transformed, superimposed with the short-term enhanced hidden state, and layer normalization is performed to obtain the global context vector.
[0044] In steps S501 to S503 of some embodiments, the short-term enhanced hidden state output by the first level is used as the query term, and the long-term temporal hidden state is used as the key-value store. Multi-head scaling dot product attention is performed, followed by residual connections and layer normalization, to output the global context vector. This application further defines the complete process of query, key-value matrix mapping, multi-head splitting, scaling dot product calculation, splicing linear transformation, and residual connections and layer normalization in the second-level attention. The beneficial effects of this step include: First, based on the embedded mid-term contextual evidence in the first level, a long-term macro background is further introduced for final logical verification, forming a complete cascading query chain of "short-term → mid-term → long-term". This allows the model to maintain high sensitivity to inflection points while not losing its ability to perceive seasonal trends and macro production rhythms, thus solving the prediction lag problem. Second, the second level uses the fusion results of the first level as the query item, rather than directly querying the long-term background with the original short-term signals. This ensures that the query quality gradually increases with the depth of the level and avoids attention divergence caused by directly querying large-scale backgrounds with weak signals. Third, the final output global context vector integrates full-scale information from intraday to monthly, and uses short-term momentum as the decision core and mid-to-long-term features as verification evidence. It has both macro trend perception and inflection point sensitivity, providing a rich and logically clear feature representation for the final prediction output.
[0045] In some embodiments, step S106 may include, but is not limited to, step S601: Step S601: The global context vector is converted into an output vector corresponding to the prediction step size through output mapping processing, and the output vector is output as the predicted power load value.
[0046] In step S601 of some embodiments, the global context vector, which integrates short, medium, and long-scale information, is converted into an output vector corresponding to the prediction step size through output mapping processing, and is output as the predicted power load value. This application further defines the specific process of converting the global context vector into an output vector corresponding to the prediction step size through output mapping processing. The beneficial effects of this step include: mapping the global context vector, which integrates full-scale information, to the prediction target space to achieve end-to-end load prediction output. During the training phase, mean squared error (MSE) is used as the loss function, and Adam is used as the optimizer to perform end-to-end gradient updates on all learnable parameters, allowing the parameters of the entire network to be optimized collaboratively; the early termination strategy terminates training early and rolls back to the optimal weights by monitoring the validation set loss, effectively preventing overfitting and ensuring the model's generalization ability. The final output predicted value in multi-step prediction tasks not only has a sensitive response to intraday peak-valley and weekly pattern switching, but also aligns with seasonal macroeconomic trends. It outperforms traditional statistical models, machine learning models, and cutting-edge time series models in terms of RMSE, MAE, and MAPE indicators, demonstrating excellent prediction accuracy and operational reliability in complex load fluctuation cycles.
[0047] This application also provides a power load forecasting system based on a hierarchical cascaded cross-scale attention mechanism to implement the method described above. The system includes: The data acquisition and feature construction module is used to collect hourly load sequences and matching meteorological factor data, extract historical load sequence values, multi-station temperature observation values and periodic time codes and concatenate them into a multidimensional feature vector, and perform standardization on the multidimensional feature vector to obtain a standard multidimensional feature tensor. The time-domain segmentation module is used to independently segment the standard multidimensional feature tensor into short-term window sequences, medium-term window sequences, and long-term window sequences along the time domain using a sliding window based on intraday fluctuation cycles, weekly pattern switching cycles, and monthly trend change cycles. The parallel encoding module is used to feed the short-term window sequence, the medium-term window sequence and the long-term window sequence into three parallel gated cyclic unit encoders. Each encoder independently extracts the temporal dependencies at the corresponding scale and outputs the short-term temporal hidden state, the medium-term temporal hidden state and the long-term temporal hidden state. The cascaded attention fusion module is used to perform multi-head scaling dot product attention operations with short-term temporal hidden states as query terms and mid-term temporal hidden states as key-value stores, and outputs short-term enhanced hidden states that fuse mid-term contextual evidence after residual connections and layer normalization. It also performs multi-head scaling dot product attention operations with short-term enhanced hidden states as query terms and long-term temporal hidden states as key-value stores, and outputs a global context vector that has been verified by long-term macro-background logic after residual connections and layer normalization. The prediction output module is used to map the global context vector to output the predicted power load value.
[0048] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0049] like Figure 2 As shown, the power load forecasting method based on the hierarchical cascaded cross-scale attention mechanism includes the following steps: S1: Multi-dimensional data acquisition: Acquire hourly load data of electricity load and data on external driving factors; S2: Feature Construction and Standardization: The raw load data, meteorological data and time information are uniformly constructed into a 32-dimensional input feature vector and standardized to form sequence data that can be directly fed into three parallel GRU encoders. S3: Heterogeneous multi-scale temporal physical segmentation: Using the sliding window mechanism, the constructed multidimensional time series is independently segmented according to the preset heterogeneous window length, and input tensors of short-term, medium-term and long-term dimensions are constructed respectively. S4: Parallel scale encoding extraction: Construct three parallel gated recurrent unit (GRU) channels to perform temporal encoding on the short-term, medium-term, and long-term input tensors respectively, and extract the hidden state representation at each scale; S5: Hierarchical Cascaded Cross-Scale Attention Fusion: Introduces a two-level cascaded query mechanism. The first level uses short-term signals as query terms to retrieve and fuse mid-term features. The second level uses the fusion result of the first level as query terms to perform logical verification on the long-term background and outputs a global context vector that eliminates the effect of feature dilution. S6: Model Training and Evaluation: Perform end-to-end training on the HMSA-Net model parameters; verify the accuracy of the predicted load values using statistical indicators.
[0050] Step S1: The system collects GEFCom2014 core load data, which includes hourly load records over many years and hourly temperature observation data from 25 meteorological stations, constructing a comprehensive meteorological and load data foundation layer.
[0051] Step S2, based on the raw data obtained in Step S1, constructs a 32-dimensional input vector containing three sets of heterogeneous features: the first set is historical load values (1-dimensional), providing autoregressive information of the load curve; the second set is real-time temperature observation data from 25 meteorological stations (25-dimensional), providing external meteorological driving factors; the third set is a 6-dimensional time period encoding, mapping periodic time information such as hours, days of the week, and months to a continuous unit circle space through sine and cosine functions, enabling the neural network to understand the cyclical characteristics of time. In this embodiment, the system divides the entire sample into three parts in chronological order: a training set (70%), a validation set (15%), and an independent test set (15%). Only the training set is standardized, and the mean and standard deviation are calculated based on the training set and statically applied to the scaling of the validation and test sets.
[0052] Step S3 involves partitioning the heterogeneous multi-scale temporal physical domain, where the heterogeneous multi-scale input tensor is represented as... ,in , For batch size, For feature dimensions; For the real number field; The time window length, i.e., the first... Sequence length at each scale, in hours; For short-term scales; Medium-term scale; For long-term scales; And define a short-period window (Daily load cycle) aims to capture short-term load momentum generated by intraday peak-valley alternation and fluctuations in user electricity consumption behavior; medium-term cycle window (Weekly load cycle) is used to anchor the load mode switching between weekdays and rest days and the weekly power grid dispatch cycle; long cycle window (Two-week load cycle) reflects the macroscopic inertia of seasonal temperature trends, changes in sunshine duration, and the rhythm of industrial production activities. Through this direct time-domain segmentation, this invention avoids the black-box problem of frequency-domain decomposition and preserves the original power system semantics of the signal.
[0053] refer to Figure 3 To automatically extract hidden nonlinear temporal features from these three independent scales, step S4 employs parallel GRU feature extraction. Compared to traditional Long Short-Term Memory (LSTM) networks, the GRU architecture has a simpler gated topology and exhibits excellent generalization ability and lower overfitting risk in hourly load forecasting tasks. For each specific time scale and time step, the evolution of the hidden state of the GRU encoder at each scale is collaboratively controlled by the gating mechanism.
[0054]
[0055]
[0056]
[0057]
[0058] in, and These represent the Sigmoid activation function and the hyperbolic tangent activation function, respectively. and Representing the first The weight matrices of the input and hidden states at each scale, and Represents the bias vector, operators This represents element-wise product. The input vector at the current time, i.e., the first... The input features at each time step are derived from the input tensor at the corresponding scale in step S3. Its dimension is the feature dimension. . The hidden state of the previous moment, i.e., the first... The hidden state at each time step carries information about the historical sequence at that scale; The candidate hidden state is the current candidate state calculated after filtering historical information through the reset gate. The current state is hidden. The final hidden state at time step n, i.e., the state of the GRU encoder at time step n. Output at any given moment. To reset the door, used to control its previous hidden state. The degree of being forgotten is indicated by a value closer to 0, which means more historical information is discarded, and a value closer to 1, which means more historical information is retained. The update gate controls the extent to which candidate hidden states are preserved at the current time step, and also determines how much of the hidden state from the previous time step is passed to the current time step. To reset the input weight matrix of the gate, This indicates that the door is being reset. Indicates scale; To reset the hidden state weight matrix of the door; To reset the gate's bias vector; To update the input weight matrix of the gate, Indicates an update to the door. Indicates scale; To update the hidden state weight matrix of the gate; To update the bias vector of the gate; Let the input weight matrix be the candidate hidden state. Indicates the candidate state; Let be the hidden state weight matrix of the candidate hidden states; is the bias vector of the candidate hidden state.
[0059] Step S5 is the core logical innovation of this invention, which designs a two-layer cascaded multi-scale adaptive attention mechanism. The first layer simulates the decision-making closed loop of a power grid dispatching expert—the dispatcher first observes the load fluctuations of the most recent day (short-term momentum), and then verifies it by combining it with the load evolution trend of the past week. The second layer uses the intermediate representation after the first fusion to drive the retrieval of long-term trends, and uses long-term background information to perform final logical verification and risk calibration of short-term judgments. The specific implementation path is as follows: Level 1: Short-term and medium-term contextualization, short-term momentum signals Assigned the role of "active queryer" in the intermediate state database , The model searches for evidence to support or refute current short-term load changes. The multi-head mechanism enables the model to perceive heterogeneous relationships between different feature subspaces. Each head... The scaling dot product is calculated as follows:
[0060] in, This represents a short-term query seed, which is a query matrix constructed from short-term temporal hidden states; These are the key and value matrices of the intermediate sequence; express. For the first-level query projection weight, the... The learnable query projection weight matrix for each attention head will Project onto the subspace; The intermediate key matrix is constructed from the intermediate temporal hidden states and serves as the key of the intermediate state library. The first-level bond projection weights are the first-level bond projection weights. The learnable key projection weight matrix of each attention head will Project onto the subspace; The intermediate value matrix is a value matrix constructed from intermediate temporal hidden states, and serves as the value of the intermediate state library. The first-level value projection weight is the first-level value projection weight. The learnable values of each attention head are projected onto the weight matrix, and... Project onto the subspace; This is a scaling factor used to scale the dot product result and prevent gradient vanishing.
[0061] No. Learnable projection weights for each attention head; A scaling factor defined by the dimension of the key, used to prevent gradient vanishing. All The outputs of each individual are then concatenated and projected to form a first-layer fusion representation, effectively embedding intermediate contextual evidence into short-term signals.
[0062] After calculating all After the first node, the results are concatenated. To reduce the risk of gradient vanishing during network deepening, residual connections and layer normalization are introduced:
[0063] in, This represents the output projection weight matrix. This residual design ensures that the original short-term features are preserved while incorporating mid-term contextual information, thus forming a hybrid query for subsequent hierarchical structures. .
[0064] Level 2: Global background integration and risk calibration, fusion of query vectors Interacting with long-term retrieval regions. During this process, long-hidden sequences... This serves as a global, macroscopic context for the final logical verification of the prediction:
[0065]
[0066] in, Indicating the first phase of global integration The output of each attention head; It is a hybrid query vector extracted from the first-level interaction; These correspond to the key and value matrices, respectively, in the long-term macroeconomic context. Indicating the second fusion level Learnable projection weights for each attention head; It is a scaling factor used to prevent gradient vanishing by standardizing the size of the dot product. For the mixed query vector, the output of the short-term enhanced hidden state after the first-level attention fusion; For the second-level query projection weight, the first Learnable query projection weight matrix for each attention head; It is a long-term bond matrix, constructed from long-term temporal hidden states; For the second-order bond projection weights, the... Learnable key projection weight matrix for each attention head; It is a long-term value matrix, constructed from long-term time-series hidden states; For the second-level value projection weight, the... The learnable projected weight matrix of each attention head; For the concatenation operation, the outputs of all attention heads are concatenated along the feature dimension; The second-level output projection weights are the concatenated output projection weight matrix. This is layer normalization, which means performing layer normalization on the results after residual connection; The global context vector is the final output of the second-level attention fusion, which integrates information from the short-term, medium-term, and long-term scales.
[0067] Step S6 involves end-to-end training and comprehensive evaluation of the model. For model training, the mean squared error (MSE) is used as the loss function, and gradient descent optimization is applied to all learnable parameters using the Adam adaptive learning rate optimizer. To prevent overfitting, an early stopping strategy is introduced—if the validation set loss no longer decreases after several consecutive training iterations, training is terminated early, and the model weights with the lowest validation set loss are rolled back. For model evaluation, the root mean squared error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) are used to quantify the regression prediction performance, as shown in the following formulas:
[0068]
[0069]
[0070] in: For the first The actual load value of each sample is the actual observed power load value, which serves as a benchmark for evaluating the accuracy of the prediction. For the first The predicted load value for each sample is the power load prediction value output by the model, used for comparison with the actual value; The total number of samples.
[0071] Results Comparison: The performance of the model of this invention was compared with that of traditional statistical models, machine learning models and cutting-edge time series models. The results show that the model of this invention performs better in terms of root mean square error, mean absolute error and mean absolute percentage error. The model of this invention demonstrates excellent prediction accuracy and operational reliability in complex load fluctuation cycles.
[0072] The key points and protections of this application include: proposing a novel multi-scale deep learning architecture, constructing a cascading query path "from the inside out", using short-term signals as the core of decision-making, and using medium- and long-term features only as verification evidence, simulating the decision-making logic of human experts "first look at the intraday fluctuations in 24 hours, then look at the weekly regular alignment in 168 hours, and finally look at the monthly trend verification in 720 hours", solving the feature dilution problem, breaking through the black box limitation of "mathematical decomposition", returning to the intuitive logic of "multi-time scale", and accurately capturing trend signals.
[0073] Compared with related technologies, the present invention has the following advantages: 1) Effectively solves the "feature dilution" problem in multi-scale feature fusion: When processing multi-scale information, related technologies typically employ parallel feature stitching or a single attention mechanism. This leads to the problem that massive amounts of long-term background information can easily obscure sensitive short-term momentum signals. This invention constructs an "inside-out" cascading query path (short-term → medium-term → long-term), forcing the model to use short-term signals as the core of its decision-making, while utilizing medium- and long-term features only as verification evidence. This hierarchical interaction logic ensures that the model maintains a balance in perceiving macro-trends while exhibiting extremely high sensitivity to inflection points in load trends, fundamentally solving the prediction lag problem caused by feature dilution.
[0074] 2) Possesses clear power system dispatch semantics and logical interpretability: Unlike black-box mathematical multi-scale methods based on variational mode decomposition (VMD) or empirical mode decomposition (EMD), this invention directly constructs 24-hour, 168-hour, and 720-hour physical windows in the time domain based on the theory of multi-periodicity of power load. This allows the model's internal representation to accurately align with the real-world load variation patterns of "intraday patterns, weekly regularities, and monthly trends." This design not only improves the model's adaptability to the characteristics of power system load fluctuations but also provides a more intuitive decision-making reference for quantitative grid operators, overcoming the deficiency of the lack of economic connotation in the frequency component of traditional decomposition models.
[0075] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0076] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0077] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0078] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0079] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0080] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0081] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0082] The power load forecasting method, system, electronic device, storage medium, and program product based on a hierarchical cascaded cross-scale attention mechanism provided in this application addresses the inherent patterns of power load data at different time scales, i.e., load time characteristics. It constructs three heterogeneous time windows (24 hours, 168 hours, and 720 hours) to independently segment the original sequence in the time domain. A three-way parallel gated cyclic encoder is used to extract the temporal evolution patterns at each scale. A multi-head attention fusion mechanism is designed, using short-term signals as active query terms to progressively verify medium- and long-term features. Finally, a global context vector is output for load forecasting. This simulates the decision-making logic of power grid dispatch experts—"first look at short-term fluctuations, then verify with medium-term patterns, and finally verify with long-term trends"—while preserving the physical semantics of the original load curve. It solves the technical defect in multi-scale feature fusion where short-term signals are diluted by the long-term background, leading to prediction lag. This achieves high-precision, robust, and logically interpretable power load forecasting.
[0083] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0084] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0085] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0086] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0087] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0088] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0089] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0090] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0091] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0092] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0093] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A power load forecasting method based on a hierarchical cascaded cross-scale attention mechanism, characterized in that, The method includes the following steps: Hourly load sequences and matching meteorological factor data are collected, historical load sequence values, multi-station temperature observation values and periodic time codes are extracted and concatenated into a multidimensional feature vector, and the multidimensional feature vector is standardized to obtain a standard multidimensional feature tensor. Based on the intraday fluctuation cycle, weekly pattern switching cycle, and monthly trend change cycle, the standard multidimensional feature tensor is independently divided into short-term window sequence, medium-term window sequence, and long-term window sequence along the time domain using a sliding window. The short-term window sequence, the intermediate window sequence, and the long-term window sequence are fed into three parallel gated cyclic encoders. Each encoder independently extracts the temporal dependencies at the corresponding scale and outputs the short-term, intermediate, and long-term temporal hidden states. Using the short-term temporal hidden state as the query term and the intermediate temporal hidden state as the key value repository, perform multi-head scaling dot product attention operation and pass through residual connection and layer normalization to output the short-term enhanced hidden state that integrates intermediate contextual evidence. Using the short-term enhanced hidden state as the query term and the long-term temporal hidden state as the key value repository, perform multi-head scaling dot product attention operation and pass through residual connection and layer normalization to output a global context vector that has been verified by long-term macro background logic. The global context vector is mapped to output the predicted power load value.
2. The method according to claim 1, characterized in that, The process involves collecting hourly load sequences and matching meteorological factor data, extracting historical load sequence values, multi-station temperature observation values, and periodic time codes, and concatenating them into a multidimensional feature vector. This multidimensional feature vector is then standardized to obtain a standard multidimensional feature tensor, including: The hourly load observations recorded during the historical operation of the power system and the meteorological station temperature observations aligned with their time were used as the full sample. The entire sample is divided into a training set, a validation set, and a test set in chronological order. Extract historical load sequence values from the full sample; Temperature observations reported by multiple meteorological observation stations that are time-aligned with the historical load sequence values are collected, and the temperature observations of each station are combined into a temperature observation vector. Collect the clock time information, calendar week information, and month information of the current prediction time. Then, convert the clock time information, calendar week information, and month information to the cyclic period space through sine mapping and cosine mapping respectively to obtain the periodic encoding vector. The historical load sequence value, the temperature observation vector, and the periodic encoding vector are concatenated into a multidimensional feature vector. On the training set, the central tendency parameter and the dispersion parameter of the multidimensional feature vector are calculated. Using the central tendency parameter and the dispersion parameter as a fixed scaling reference, a standardization operation based on the central tendency parameter and the dispersion parameter is performed on the multidimensional feature vectors in the training set, the validation set, and the test set to obtain a standard multidimensional feature tensor.
3. The method according to claim 1, characterized in that, The method of independently dividing the standard multidimensional feature tensor into short-term, medium-term, and long-term window sequences along the time domain using a sliding window based on intraday fluctuation cycles, weekly pattern switching cycles, and monthly trend change cycles includes: Using a preset short-cycle length that characterizes the alternation of peak and valley within a day and the fluctuation of user electricity consumption behavior as the window size and the data sampling time interval as the sliding step, short time segments at each starting moment are extracted from the standard multidimensional feature tensor, and the short time segments are arranged in chronological order to form a short-term window sequence. Using a preset medium-cycle length that characterizes the switching of load modes between weekdays and rest days and the weekly power grid dispatching pattern as the window size and the data sampling time interval as the sliding step size, medium-time segments at each starting time are extracted from the standard multidimensional feature tensor, and the medium-time segments are arranged in chronological order to form a medium-term window sequence; the medium-term window sequence and the short-term window sequence are isolated from each other in the time domain. Using a preset long-cycle length that characterizes seasonal temperature trends and macro-production rhythm as the window size and the data sampling time interval as the sliding step size, long-term segments at each starting moment are extracted from the standard multidimensional feature tensor, and the long-term segments are arranged in chronological order to form a long-term window sequence; the long-term window sequence is isolated from the short-term window sequence and the medium-term window sequence in the time domain.
4. The method according to claim 1, characterized in that, The step of feeding the short-term window sequence, the intermediate-term window sequence, and the long-term window sequence into three parallel gated cyclic encoders, with each encoder independently extracting the temporal dependencies at its corresponding scale and outputting the short-term, intermediate-term, and long-term temporal hidden states, includes: Construct a gated cyclic unit encoder with three identical topologies and independently updated parameters. Each encoder corresponds to a short-term scale, a medium-term scale, and a long-term scale, respectively. The short-term scale, the medium-term scale, and the long-term scale are determined by the window lengths of the short-term window sequence, the medium-term window sequence, and the long-term window sequence, respectively. The short window sequence is sequentially fed into the first gated loop unit encoder along the time steps. The first gated loop unit encoder performs gated filtering on the input state of each time step and the hidden state of the previous time step through the reset gate and update gate, iteratively updates the hidden state along the time steps, and takes the updated hidden state of each time step to form the short-term time-series hidden state. The intermediate window sequence is sequentially fed into the second gated loop unit encoder along the time steps. The second gated loop unit encoder performs gated filtering on the input state of each time step and the hidden state of the previous time step through the reset gate and update gate, iteratively updates the hidden state along the time steps, and takes the updated hidden state of each time step to form the intermediate time sequence hidden state. The long-term window sequence is sequentially fed into the third gated loop encoder along the time steps. The third gated loop encoder performs gated filtering on the input state of each time step and the hidden state of the previous time step through the reset gate and update gate, iteratively updates the hidden state along the time steps, and takes the updated hidden state of each time step to form the long-term time-series hidden state.
5. The method according to claim 1, characterized in that, The process of using the short-term temporal hidden state as the query term and the intermediate temporal hidden state as the key-value store, performing multi-head scaling dot product attention operation and passing it through residual connections and layer normalization, to output a short-term enhanced hidden state that integrates intermediate contextual evidence includes: The short-term hidden state is mapped to a query matrix, and the medium-term hidden state is mapped to a key matrix and a value matrix, respectively. The query matrix, the key matrix, and the value matrix are then split into multiple subspaces along the feature dimension. In each of the subspaces, the dot product between the query matrix and the transpose of the key matrix is calculated. The dot product result is scaled by a scaling factor and then normalized by the Softmax function to obtain the attention weight distribution. The value matrix is then weighted and summed using the attention weight distribution to obtain the attention output of each subspace. The attention outputs of each subspace are concatenated along the feature dimension and then linearly transformed. This is then superimposed on the short-term temporal hidden state and layer normalization is performed to obtain the short-term enhanced hidden state.
6. The method according to claim 1, characterized in that, The process involves using the short-term enhanced hidden state as the query term and the long-term temporal hidden state as the key-value store, performing multi-head scaling dot product attention operations, and then performing residual connections and layer normalization to output a global context vector that has been validated by long-term macroscopic background logic. This includes: The short-term enhanced hidden state is mapped to a query matrix, and the long-term time-series hidden state is mapped to a key matrix and a value matrix, respectively. The query matrix, the key matrix, and the value matrix are each split into multiple subspaces along the feature dimension. In each of the subspaces, the dot product between the query matrix and the transpose of the key matrix is calculated. The dot product result is scaled by a scaling factor and then normalized by the Softmax function to obtain the attention weight distribution. The value matrix is then weighted and summed using the attention weight distribution to obtain the attention output of each subspace. The attention outputs of each subspace are concatenated along the feature dimension, linearly transformed, superimposed with the short-term enhanced hidden state, and then subjected to layer normalization to obtain the global context vector.
7. The method according to claim 1, characterized in that, The step of mapping the global context vector to output the predicted power load value includes: The global context vector is converted into an output vector corresponding to the prediction step size through output mapping, and the output vector is output as the predicted power load value.
8. A power load forecasting system based on a hierarchical cascaded cross-scale attention mechanism, used to implement the method as described in any one of claims 1 to 7, characterized in that, The system includes: The data acquisition and feature construction module is used to acquire hourly load sequences and matching meteorological factor data, extract historical load sequence values, multi-station temperature observation values and periodic time codes and concatenate them into a multidimensional feature vector, and perform standardization on the multidimensional feature vector to obtain a standard multidimensional feature tensor. The time-domain segmentation module is used to independently segment the standard multidimensional feature tensor into short-term window sequences, medium-term window sequences, and long-term window sequences along the time domain using a sliding window based on the intraday fluctuation cycle, weekly pattern switching cycle, and monthly trend change cycle. The parallel encoding module is used to feed the short-term window sequence, the intermediate window sequence and the long-term window sequence into three parallel gated cyclic unit encoders respectively. Each encoder independently extracts the temporal dependencies at the corresponding scale and outputs the short-term temporal hidden state, the intermediate temporal hidden state and the long-term temporal hidden state. The cascaded attention fusion module is used to perform multi-head scaling dot product attention operations with the short-term temporal hidden state as the query term and the medium-term temporal hidden state as the key-value store, and then perform residual connections and layer normalization to output a short-term enhanced hidden state that fuses medium-term contextual evidence; and to perform multi-head scaling dot product attention operations with the short-term enhanced hidden state as the query term and the long-term temporal hidden state as the key-value store, and then perform residual connections and layer normalization to output a global context vector that has been verified by long-term macro-background logic. The prediction output module is used to map the global context vector to output the predicted power load value.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.