Power prediction method and system based on multi-scale time series data
Patent Information
- Application Number
- CN202611081602.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-21
- Publication Date
- 2026-10-23
AI Technical Summary
[0005]本发明提供一种基于多尺度时序数据的电量预测方法及系统,用以解决现有技术中难以同时建模月内高频变化特征与月际长期趋势特征的缺陷,实现基于日月双尺度自监督协同融合的月度用电量高精度预测
[0017]本发明的一些实施例提供的技术方案带来的有益效果至少包括:
Smart Images

Figure CN122968923A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power load forecasting technology, and in particular to a power load forecasting method and system based on multi-scale time series data. Background Technology
[0002] Monthly electricity consumption forecasting is a core prerequisite for power grid planning, power dispatching, and energy management systems. Its forecasting accuracy directly affects the operational stability of the power system and the efficiency of energy resource allocation.
[0003] Currently, mainstream methods for predicting monthly electricity consumption are mainly based on traditional statistical models, recurrent neural networks (RNNs) and their variants, and Transformer architectures and their variants. These prediction methods generally suffer from the following technical defects and limitations: First, the modeling scale is too narrow, neglecting multi-scale coupling characteristics. Most methods only use the monthly total as the smallest granularity for time series modeling, or use daily-scale data alone for aggregation and prediction. This single-scale modeling approach cannot simultaneously characterize the high-frequency fluctuation characteristics within a month and the long-term trend characteristics between months. Second, structural correlation mining is insufficient, ignoring the potential topological relationships between samples. Current methods usually treat samples from each month as independent and identically distributed sequences for point-by-point regression, failing to effectively utilize the structural correlations between different months and the similarity of industry electricity consumption structures, resulting in insufficient prediction accuracy in complex scenarios. Third, inconsistent time series granularity leads to difficulties in data alignment. Due to the differences in the actual number of natural days in different months, traditional methods cannot achieve unified modeling, and forcibly filling in zero values or truncating sequences introduces artificial noise, destroying the physical reality of electricity consumption behavior. Fourth, the coupling of external driving factors is complex, and single-scale modeling cannot fully integrate them. Meteorological factors, changes in industry structure, and seasonal cycle changes all have a significant impact on monthly electricity consumption, and relying solely on single-scale modeling cannot fully characterize multi-scale coupling relationships.
[0004] In summary, there is an urgent need for a method to jointly model time series data at multiple scales and achieve cross-scale collaborative fusion for monthly electricity consumption forecasting. Summary of the Invention
[0005] This invention provides a method and system for predicting electricity consumption based on multi-scale time-series data, which addresses the shortcomings of existing technologies that make it difficult to simultaneously model high-frequency intra-month variation characteristics and long-term inter-month trend characteristics, and achieves high-precision prediction of monthly electricity consumption based on self-supervised collaborative fusion of daily and lunar dual-scale data.
[0006] In a first aspect, the present invention provides a power prediction method based on multi-scale time-series data, comprising: Acquire daily-scale electricity consumption data and meteorological data for the target month in history, perform preprocessing, and construct a daily-scale input sequence; The daily-scale input sequence is divided and encoded using multi-scale patching to obtain multi-scale feature representations at the daily scale. Based on historical data of total monthly electricity consumption and monthly electricity consumption by industry, a graph structure feature representation at the monthly scale is constructed. The multi-scale feature representation at the daily scale and the graph structure feature representation at the monthly scale are fused to obtain cross-scale fused features. Based on the cross-scale fused features and the graph structure feature representation at the monthly scale, the total monthly electricity consumption of the future target month is predicted.
[0007] According to the present invention, a power prediction method based on multi-scale time series data is provided, which performs multi-scale patching and encoding on the daily-scale input sequence through a daily-scale multi-scale patch coding network to obtain a multi-scale feature representation at the daily scale. The daily-scale multi-scale patch coding network includes: The multi-scale patch partitioning module is used to partition the day-scale sequence according to multiple time windows to obtain patch sequences corresponding to the multiple time windows respectively. The Patch embedding and encoding module is used to embed and encode the Patch sequences corresponding to the multiple time windows respectively to obtain multi-scale embedding features. The daily-scale Transformer encoding module is used to perform feature interaction based on the attention mechanism on the multi-scale embedded features to obtain multi-scale feature representations at the daily scale.
[0008] According to the present invention, a power prediction method based on multi-scale time-series data is provided. The patch embedding encoding module includes a patch flattening layer, a first fully connected mapping layer, a first normalization layer, and a patch embedding vector generation layer connected in sequence, as well as a parallel position encoding branch and a scale encoding branch. The position encoding branch includes a position vector generation layer and a position feature overlay layer scale encoding branch connected in sequence. The scale encoding branch includes a scale vector generation layer and a scale feature overlay layer connected in sequence.
[0009] According to the present invention, a power prediction method based on multi-scale time series data is provided, wherein the daily-scale Transformer encoding module includes a first attention layer, a first residual connection layer, a second normalization layer, a first feedforward network layer, a second residual connection layer, and a third normalization layer connected in sequence.
[0010] According to the present invention, a power consumption prediction method based on multi-scale time-series data is provided, wherein the method constructs a graph structure feature representation at the monthly scale based on the total monthly power consumption and industry-specific monthly power consumption data for multiple historical months, including: Using multiple historical months as graph nodes, total monthly electricity consumption and monthly electricity consumption by industry as node features, and the relationships between adjacent months, seasonal cycles, and industry structural similarities among the aforementioned multiple historical months as edges, a graph structure is constructed. The graph structure is encoded to obtain a graph structure feature representation at the monthly scale; The adjacent month relationship describes the trend continuity between consecutive months; the seasonal cycle relationship describes the cycle similarity between the same months in different years; and the industry structure similarity relationship describes the similarity of the industry's electricity consumption structure.
[0011] According to the present invention, a power prediction method based on multi-scale time-series data is provided, which constructs a graph structure feature representation at the monthly scale through a monthly-scale graph structure coding network; The lunar scale map structure coding network includes: The monthly-scale node feature construction module is used to construct a node feature matrix based on the total monthly electricity consumption and the monthly electricity consumption by industry. The monthly-scale relationship construction module is used to construct relationships between adjacent months, seasonal cycles, and industry structure similarity based on the total monthly electricity consumption and the monthly electricity consumption by industry for multiple historical months. The adjacency matrix fusion module is used to construct an adjacency matrix based on the adjacent month relationship, the seasonal cycle relationship, and the industry structure similarity relationship; The graph neural network encoding module is used to encode the graph structure composed of the node feature matrix and the adjacency matrix through a graph neural network to obtain a graph structure feature representation at the monthly scale.
[0012] According to the present invention, a power prediction method based on multi-scale time series data is provided, which performs feature fusion on the multi-scale feature representation at the daily scale and the graph structure feature representation at the monthly scale through a solar-moon cross-guided fusion network. The sun-moon cross-guided fusion network includes: The attention aggregation module is used to perform cross-attention calculation on the multi-scale feature representation at the daily scale and the graph structure feature representation at the monthly scale to obtain cross-scale attention weights, and to weight and aggregate the multi-scale feature representation at the daily scale to obtain aggregated daily scale features. The residual connection module is used to fuse the graph structure feature representation at the monthly scale and the aggregated daily scale features through residual connection, and normalize them to obtain cross-scale fused features.
[0013] Secondly, the present invention also provides a power prediction system based on multi-scale time-series data, comprising: The data acquisition module is used to acquire daily-scale electricity consumption data and meteorological data for historical target months, and to preprocess and construct daily-scale input sequences. The daily-scale encoding module is used to perform multi-scale patch partitioning and encoding on the daily-scale input sequence to obtain multi-scale feature representations at the daily scale. The monthly-scale coding module is used to construct a graph structure feature representation at the monthly scale based on the total monthly electricity consumption and monthly electricity consumption data of different industries over multiple historical months. The monthly electricity consumption prediction module is used to perform feature fusion on the multi-scale feature representation at the daily scale and the graph structure feature representation at the monthly scale to obtain cross-scale fused features, and predict the total monthly electricity consumption of the future target month based on the cross-scale fused features and the graph structure feature representation at the monthly scale.
[0014] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the power prediction method based on multi-scale time-series data as described above.
[0015] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the power prediction method based on multi-scale time-series data as described above.
[0016] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the power prediction method based on multi-scale time-series data as described above.
[0017] The beneficial effects of the technical solutions provided by some embodiments of the present invention include at least the following: 1) This invention provides a method and system for predicting electricity consumption based on multi-scale time-series data. By performing multi-scale patching and encoding on daily-scale electricity consumption data, it achieves effective modeling of high-frequency change characteristics at different time granularities within a month. By using the total monthly electricity consumption and industry-specific monthly electricity consumption data from multiple historical months, it constructs a graph structure at the monthly scale to achieve joint modeling of long-term inter-monthly trend characteristics and industry structural correlation characteristics. Finally, through a daily-month cross-attention fusion mechanism, it achieves dynamic collaborative fusion between daily-scale high-frequency fluctuation characteristics and monthly-scale long-term trend characteristics, thereby effectively improving the accuracy, stability, and generalization ability of monthly electricity consumption prediction in complex scenarios.
[0018] 2) The daily-scale multi-scale patch encoding network of the present invention forms a multi-granularity patch feature representation by segmenting the daily-scale time series according to different time windows, so that the model can simultaneously capture local mutations, stage fluctuations and continuous change trends. In addition, by introducing position encoding and scale encoding, different patches not only retain their positional relationship in the original time series, but also distinguish their time granularity, thereby enhancing the detailed expression ability of the daily-scale sequence.
[0019] 3) The monthly-scale graph structure encoding network of the present invention, for long-term scale data, uses multiple historical months as nodes to construct a monthly-scale graph structure containing multi-dimensional features such as the relationship between adjacent months, seasonal cycle relationship, and industry structural similarity relationship. This graph structure can comprehensively depict the trend continuation relationship between adjacent cycles, the seasonal similarity relationship between the same period cycles, and the structural similarity relationship between different long-term cycle samples. By encoding the monthly-scale node features and their correlation relationships through graph neural networks, it can achieve unified modeling of long-term trends, cycle patterns and structural dependencies, fully depict the complex coupling relationship between multi-scale external drivers, and improve the prediction accuracy in complex scenarios.
[0020] 4) The solar-moon cross-guided fusion network of this invention realizes deep interaction between solar-scale features and monthly-scale features. On the one hand, solar-scale features are represented by multi-granularity patches to provide detailed evidence for monthly-scale trend modeling, enabling the monthly-scale representation to perceive its internal local fluctuations, stage changes and abnormal disturbances. On the other hand, the monthly-scale graph structure representation guides the selection of solar-scale features in reverse through the cross-attention mechanism, enabling the model to highlight key solar-scale segments and suppress irrelevant fluctuations and noise interference under the constraints of long-term trends, periodic relationships and structural relationships. This forms a two-way collaborative modeling process of "solar scale supporting monthly scale and monthly scale guiding solar scale", which can not only predict the total monthly electricity consumption of the target month, but also accurately predict the monthly electricity consumption of various industries. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0022] Figure 1 This is one of the flowcharts illustrating the power prediction method based on multi-scale time series data provided by the present invention; Figure 2 This is a schematic diagram of the overall architecture of the solar-moon dual-scale self-supervised collaborative fusion network used in this invention; Figure 3 This is a schematic diagram of the specific structure of the solar-moon dual-scale self-supervised collaborative fusion network provided by the present invention; Figure 4 This is a schematic diagram of the training process of the solar-moon dual-scale self-supervised collaborative fusion network of the present invention; Figure 5 This is a schematic diagram of the power prediction system based on multi-scale time series data provided by the present invention; Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0024] Please see Figure 1 , Figure 1 One of the flowcharts for a power prediction method based on multi-scale time series data provided as an embodiment of the present invention includes: S101. Obtain daily-scale electricity consumption data and meteorological data for the target month in history, and perform preprocessing to construct a daily-scale input sequence; S102. Perform multi-scale patch partitioning and encoding on the daily-scale input sequence to obtain multi-scale feature representation at the daily scale. S103. Based on the total monthly electricity consumption and industry-specific monthly electricity consumption data for multiple historical months, construct a graph structure feature representation at the monthly scale; S104. Perform feature fusion on the multi-scale feature representation at the daily scale and the graph structure feature representation at the monthly scale to obtain cross-scale fused features. Based on the cross-scale fused features and the graph structure feature representation at the monthly scale, predict the total monthly electricity consumption of the future target month.
[0025] This invention achieves effective modeling of high-frequency variation characteristics at different time granularities within a month by performing multi-scale patching and encoding on daily-scale electricity consumption data; it constructs a monthly-scale graph structure using historical monthly total electricity consumption and industry-specific monthly electricity consumption data to achieve joint modeling of long-term monthly trend characteristics and industry structural correlation characteristics; finally, through a daily-month cross-attention fusion mechanism, it achieves dynamic collaborative fusion between daily-scale high-frequency fluctuation characteristics and monthly-scale long-term trend characteristics, thereby effectively improving the accuracy, stability, and generalization ability of monthly electricity consumption prediction in complex scenarios.
[0026] This invention addresses the challenges in complex time-series forecasting tasks, such as the difficulty in effectively utilizing local fluctuations at short timescales, the inability to fully characterize long-term trend structures, and the lack of effective interaction between features at different timescales. Based on daily-scale data of historical target months and monthly total electricity consumption and industry-specific monthly electricity consumption data for multiple historical months, this invention constructs a daily-month dual-scale self-supervised collaborative fusion network to collaboratively model and learn unified representations of multi-scale time-series data, thereby enabling the prediction of monthly total electricity consumption for future target months.
[0027] like Figure 2 The diagram shown illustrates the overall architecture of the solar-moon dual-scale self-supervised collaborative fusion network of this invention. It includes a solar-scale multi-scale patch encoding network, a lunar-scale graph structure encoding network, a solar-moon cross-guided fusion network, and a power consumption prediction output network. The following section combines... Figure 1 Flowcharts and Figure 2 The model structure diagram illustrates the specific implementation of the present invention.
[0028] In the above implementation, step S101 mainly involves acquiring and preprocessing daily-scale data of the historical target month.
[0029] Specifically, daily-scale electricity consumption data and raw meteorological data for the target month in history are obtained. The raw meteorological data is preprocessed to obtain meteorological factor data. The daily-scale electricity consumption data and meteorological factor data are normalized and arranged in chronological order to form a daily-scale input sequence.
[0030] For example, let M be the target month to be predicted in the future. The previous complete historical month of the target month to be predicted can be used as the historical target month, such as M-1. Obtain daily electricity consumption data for this historical target month, as well as raw meteorological data such as daily average temperature, daily maximum temperature, daily minimum temperature, precipitation data at a 96-point sampling frequency, and wind speed data at a 96-point sampling frequency. Preprocess the raw meteorological data; for example, sum the daily precipitation data at the 96-point sampling frequency to obtain the daily total precipitation, and average the daily wind speed data at the 96-point sampling frequency to obtain the daily average wind speed. The meteorological factor data obtained after preprocessing the raw meteorological data includes daily average temperature, daily maximum temperature, daily minimum temperature, daily total precipitation, and daily average wind speed.
[0031] Then, the daily-scale electricity consumption data and meteorological factor data for the historical target month were subjected to maximum-min normalization:
[0032] In the formula, x represents the original input data, x max x represents the maximum value.min This represents the minimum value. This represents the normalized data.
[0033] In some embodiments, the normalized daily-scale data includes daily-scale electricity consumption characteristics and corresponding meteorological characteristics, and constitutes a daily-scale input sequence in chronological order.
[0034] In some embodiments, to unify the length of days in different months, the daily-scale input sequence for each month can be padded to a fixed length D, where D=32, and a Mask is used to indicate the padding position. This achieves unified modeling under different month length conditions, further improving the robustness and adaptability of the model in the complex data environment of actual power systems. The unified daily-scale input sequence is represented as follows:
[0035] Where t represents the month sequence number, d represents the day-scale sequence number, d=1,2,...,D, and D represents the length of the unified day sequence. F d This represents the daily-scale feature dimension.
[0036] In the above implementation, step S102 mainly involves patching and encoding the diurnal scale input sequence.
[0037] In some embodiments, the daily-scale input sequence is divided and encoded using a daily-scale multi-scale patch coding network to obtain a daily-scale multi-scale feature representation. Daily-scale multi-scale patch coding networks include: The multi-scale patch partitioning module is used to partition the daily scale sequence according to multiple time windows, and obtain the patch sequence corresponding to each time window. The Patch embedding and encoding module is used to embed and encode the Patch sequences corresponding to multiple time windows to obtain multi-scale embedding features. The daily-scale Transformer encoding module is used to perform attention-based feature interaction on multi-scale embedded features to obtain multi-scale feature representations at the daily scale.
[0038] Specifically, such as Figure 3 The diagram shows a schematic of the specific structure of the solar-moon dual-scale self-supervised collaborative fusion network of the present invention, wherein the solar-scale multi-scale patch coding network includes a multi-scale patch partitioning module, a patch embedding coding module, and a solar-scale Transformer coding module.
[0039] like Figure 3As shown, in the multi-scale patch segmentation module, multiple time windows can include 2-day windows, 4-day windows, and 8-day windows. That is, the continuous daily-scale input sequence is segmented into local segments according to 2-day, 4-day, and 8-day time windows, respectively. Each segment is a patch, used to extract short-cycle fluctuation features, medium-cycle trend features, and long-cycle variation features, respectively. The i-th patch is represented as follows:
[0040] Where s represents the time window scale corresponding to the Patch. Represents a day-scale input sequence On the timeline from the From the start of the first time step to the... A series of segments that end at each time step.
[0041] In some embodiments, such as Figure 3 As shown, the Patch embedding encoding module includes a Patch flattening layer, a first fully connected mapping layer, a first normalization layer (Layer Normalization), a Patch embedding vector generation layer connected in sequence, and parallel position encoding branches and scale encoding branches; wherein, the position encoding branch includes a position vector generation layer and a position feature overlay layer connected in sequence; the scale encoding branch includes a scale vector generation layer and a scale feature overlay layer connected in sequence.
[0042] Specifically, the patches of different scales obtained from the patch division are flattened by the patch flattening layer and then input into the first fully connected mapping layer. After layer normalization, a patch embedding vector (Patch Token) of uniform dimension is generated. .
[0043] Furthermore, to enhance the model's ability to perceive temporal order, a positional encoding layer is used to perform positional encoding on each patch, and the positional encoding results are then superimposed onto the patch embedding vector through a positional feature overlay layer. The positional encoding employs a learnable parameter table, specifically represented as follows:
[0044] in, For position-encoded mapping functions, This is the position encoding result of the patch at scale s at position i. Let s be the number of patches with a window size of s, and D represent the length of the unified daily sequence.
[0045] Furthermore, to enhance the model's ability to distinguish between different time granularities, a scale vector generation layer in the scale encoding branch performs scale encoding on patches of different scales, and a scale feature overlay layer overlays the scale encoding results onto the patch embedding vector. The scale encoding is specifically represented as follows:
[0046] in, For scale-coded mapping functions, The index representing scale s. This is the scale encoding result for scale s.
[0047] The final multi-scale embedding feature representation for each patch is as follows:
[0048] in, Let represent the multi-scale embedding feature of the i-th patch at time t. This represents the patch embedding vector. The result of the position encoding. This is the result of scale encoding.
[0049] In some embodiments, such as Figure 3 As shown, the day-scale Transformer encoding module includes a first attention layer, a first residual connection layer, a second normalization layer, a first feed forward network layer, a second residual connection layer, and a third normalization layer connected in sequence.
[0050] Specifically, the daily-scale Transformer encoding module adopts a Transformer architecture. The first attention layer can employ a multi-head self-attention mechanism to extract correlation features between different time zones within the month. The daily-scale Transformer encoding module utilizes attention and residual connection mechanisms to perform feature interaction on the multi-scale embedded features, fusing electricity consumption features from different time windows to obtain a multi-scale feature representation at the daily scale. H d .
[0051] The daily-scale multi-scale patch encoding network of this invention segments the daily-scale time series according to different time windows to form a multi-granularity patch feature representation, enabling the model to simultaneously capture local mutations, stage fluctuations, and continuous change trends. By introducing positional encoding and scale encoding, different patches not only retain their positional relationships in the original time series but also distinguish their respective time granularities, thereby enhancing the detailed representation capability of the daily-scale sequence.
[0052] In the above implementation, step S103 mainly involves constructing a graph structure based on the total monthly electricity consumption and monthly electricity consumption data by industry over multiple historical months, and then encoding the graph structure.
[0053] First, obtain the total monthly electricity consumption for multiple historical months, such as the total monthly electricity consumption data for 24 historical months, and then obtain the monthly electricity consumption data by industry.
[0054] In some embodiments, monthly electricity consumption by industry may include monthly electricity consumption data from multiple industries, such as the monthly electricity consumption data from 11 industries including industry, construction, transportation, wholesale and retail, accommodation and catering, finance, real estate, information transmission, residential life, public services, and agriculture.
[0055] In some embodiments, based on historical monthly total electricity consumption and industry-specific monthly electricity consumption data for multiple months, a monthly-scale graph structure feature representation is constructed, including: Using multiple historical months as graph nodes, total monthly electricity consumption and monthly electricity consumption by industry as node features, and the relationships between adjacent months, seasonal cycles, and industry structural similarities among multiple historical months as edges, a graph structure is constructed. The graph structure is encoded to obtain a graph structure feature representation at the monthly scale.
[0056] Specifically, a node set N is constructed using each month from a historical dataset as a graph node; an edge set E is constructed using the relationships between adjacent months, seasonal cycles, and industry structural similarities among the historical months as edges, thus constructing a graph structure G=(N,E). Furthermore, for each node, a node feature matrix X is constructed using the total monthly electricity consumption and the monthly electricity consumption by industry as node features. G Based on the edge set E, construct the adjacency matrix A, which forms the complete graph structure G=(N, E, X). G A) Then, the graph structure G is encoded using a graph neural network to obtain the graph structure feature representation at the monthly scale.
[0057] In some embodiments, a monthly-scale graph structure feature representation is constructed using a monthly-scale graph structure encoding network; like Figure 3 As shown, the lunar scale map structure encoding network includes: The monthly-scale node feature construction module is used to construct a node feature matrix based on the total monthly electricity consumption and the monthly electricity consumption by industry. The monthly-scale relationship construction module is used to construct relationships between adjacent months, seasonal cycles, and industry structure similarity based on the total monthly electricity consumption and the monthly electricity consumption by industry over multiple historical months. The adjacency matrix fusion module is used to construct an adjacency matrix based on the relationship between adjacent months, seasonal cycles, and industry structural similarities. The graph neural network encoding module is used to encode the graph structure composed of the node feature matrix and the adjacency matrix through a graph neural network, so as to obtain the graph structure feature representation at the monthly scale.
[0058] Specifically, such as Figure 3 As shown, the monthly-scale node feature construction module is used to construct the node feature matrix X; The monthly-scale relationship construction module is used to construct relationships between adjacent months, seasonal cycles, and industry structure similarity relationships. The specific expressions for adjacent month relationships, seasonal cycle relationships, and industry structure similarity relationships are as follows:
[0059]
[0060]
[0061] Where i and j are month numbers; m is the industry code. The relationship between adjacent months i and j is used to describe the trend continuity between consecutive months; Let i represent the seasonal cycle relationship between months i and j, used to describe the cyclical similarity between the same months in different years; This represents the industry structure similarity relationship of industry m in months i and j, used to describe the similarity of the industry's electricity consumption structure. These represent the total monthly electricity consumption of industry m in months i and j, respectively.
[0062] The adjacency matrix fusion module is used to construct an adjacency matrix A based on adjacent month relationships, seasonal cycle relationships, and industry structural similarity relationships. A can be represented as:
[0063] in, These represent relationships between adjacent months, seasonal cycles, and industry structural similarities, respectively. These are the weights.
[0064] like Figure 3The graph neural network encoding module employs a graph neural network consisting of, in sequence, a first graph convolutional layer, a batch normalization layer, a first ReLU activation layer, a first dropout layer, a second graph convolutional layer, a second batch normalization layer, a second ReLU activation layer, and a second dropout layer. This structure is used to process the node feature matrix X. G The adjacency matrix A is encoded, and the structural dependencies between months are propagated and aggregated through two layers of Graph Convolution to obtain a graph structure feature representation at the monthly scale. H m .
[0065] The monthly-scale graph structure encoding network of this invention, for monthly time-scale data, uses multiple historical months as nodes to construct a monthly-scale graph structure containing multi-dimensional features such as relationships between adjacent months, seasonal cycles, and industry structural similarities. This graph structure can comprehensively depict the trend continuation relationship between adjacent cycles, the seasonal similarity relationship between cycles in the same period, and the structural similarity relationship between samples of different long cycles. By encoding the monthly-scale node features and their correlations through a graph neural network, it achieves unified modeling of long-term trends, cyclical patterns, and structural dependencies, fully depicting the complex coupling relationship between multi-scale external drivers and improving prediction accuracy in complex scenarios.
[0066] In the above implementation, step S104 mainly involves using a sun-moon cross-guided fusion network to predict monthly electricity consumption.
[0067] Specifically, such as Figure 3 As shown, the multi-scale feature representation at the solar scale obtained in step S102 is processed through a solar-moon cross-guided fusion network. H d The graph structure feature representation at the lunar scale obtained in step S103 H m Feature fusion is performed to obtain cross-scale fused features. H f It also predicts the total monthly electricity consumption for future target months through an electricity consumption forecasting output network.
[0068] In some embodiments, the Sun-Moon cross-guided fusion network includes: The attention aggregation module is used to perform cross-attention calculation on multi-scale feature representations at the daily scale and graph structure feature representations at the monthly scale to obtain cross-scale attention weights, and to weight and aggregate multi-scale feature representations at the daily scale to obtain aggregated daily scale features. The residual connection module is used to fuse the graph structure feature representation at the monthly scale and the aggregated daily scale features through residual connection, and then normalize them to obtain cross-scale fused features.
[0069] Specifically, the attention aggregation module includes a Query mapping layer, a Key mapping layer, a Value mapping layer, and a ScaledDot-Product Attention layer. The principle of its cross-attention calculation and weighted aggregation is as follows: representing the graph structure features at the monthly scale. H m After passing through the Query mapping layer, the query feature Q is generated, which is a multi-scale feature representation at the daily scale. H d After passing through the Key mapping layer, the key feature K is generated, and after passing through the Value mapping layer, the value feature V is generated. The query feature Q, key feature K, and value feature V are input together into the Scaled Dot-Product Attention layer for cross-scale attention weight calculation, realizing the dynamic guidance of long-term trend information at the monthly scale to high-frequency change information at the daily scale. Finally, the multi-scale feature representation at the daily scale is weighted and aggregated based on the cross-scale attention weight to obtain the aggregated daily scale feature.
[0070] The formulas for cross-attention calculation and weighted aggregation are as follows:
[0071] in, The representative represents the aggregated daily-scale features obtained by weighting V with cross-scale attention weights. The obtained cross-scale attention weights, Let K be the dimension of the health feature.
[0072] The residual connection module first fuses the graph structure feature representation at the monthly scale and the aggregated daily scale features through the third residual connection layer, and then obtains the cross-scale fused features through the fourth layer normalization layer.
[0073] The solar-moon cross-guided fusion network of this invention enables deep interaction between solar-scale features and monthly-scale features. On the one hand, solar-scale features, through multi-granularity patch representation, provide detailed evidence for monthly-scale trend modeling, enabling the monthly-scale representation to perceive its internal local fluctuations, stage changes, and anomalous disturbances. On the other hand, the monthly-scale graph structure representation guides the selection of solar-scale features in reverse through a cross-attention mechanism, enabling the model to highlight key solar-scale segments and suppress irrelevant fluctuations and noise interference under the constraints of long-term trends, periodic relationships, and structural relationships. This forms a two-way collaborative modeling process of "solar scale supporting monthly scale and monthly scale guiding solar scale".
[0074] Finally, based on the cross-scale fusion characteristics and the graph structure characteristics at the monthly scale, the total monthly electricity consumption and the monthly electricity consumption forecast results by industry for the target month are predicted through the electricity consumption forecast output network. The electricity consumption prediction output network includes a sequentially connected feature concatenation layer, a multilayer perceptron prediction layer, and an output layer; among which, cross-scale feature fusion... H f Representation of graph structure features at the lunar scale H m After being concatenated by the feature splicing layer, the data is input into the multilayer perceptron prediction layer, which outputs the monthly total electricity consumption prediction results for the target month, as well as the monthly electricity consumption prediction results by industry.
[0075] This invention utilizes a self-supervised collaborative fusion network based on both solar and lunar scales. By constructing a collaborative modeling mechanism at both solar and lunar scales, it achieves joint learning of high-frequency intra-month variation features and long-term inter-month trend features. Simultaneously, through a cross-attention fusion mechanism, it enables information interaction and dynamic fusion between features at different time scales, thereby effectively improving the accuracy, stability, and generalization ability of monthly electricity consumption prediction in complex scenarios.
[0076] Understandable, Figure 2 The solar-moon dual-scale self-supervised collaborative fusion network needs to be trained before it can be used for power prediction. For example... Figure 4 The diagram shown illustrates the training process of the solar-moon dual-scale self-supervised collaborative fusion network of the present invention. The training process of this solar-moon dual-scale self-supervised collaborative fusion network includes: S201. Data Acquisition and Preprocessing. Collect historical daily electricity consumption and meteorological data for the target area, as well as total monthly electricity consumption and industry-specific electricity consumption data for multiple historical months. Then, preprocess the obtained data. S202. Based on the available and time-aligned multi-scale data obtained in step S201, perform sample division to obtain the electricity consumption sample library of the target area. S203. The solar and lunar dual-scale self-supervised collaborative fusion network is iteratively trained using the electricity consumption sample database of the target area to obtain the trained solar and lunar dual-scale self-supervised collaborative fusion network.
[0077] For example, during training, the Adam optimizer can be used to update network parameters, and a cosine decaying learning rate can be used to dynamically adjust the training learning rate. The loss function can be the mean squared error loss function (MSELoss). During training, a validation set accuracy evaluation is performed every ΔT epochs to monitor the model's predictive performance in real time. Furthermore, an early stopping algorithm can be used to prevent overfitting; training is stopped when the validation set loss does not decrease for several consecutive epochs to prevent overfitting.
[0078] Please see Figure 5 , Figure 5 A schematic diagram of a power prediction system based on multi-scale time-series data, provided as an embodiment of the present invention, is shown. The system includes: The data acquisition module 510 is used to acquire daily-scale electricity consumption data and influencing factor data for the target month, and to preprocess and construct a daily-scale input sequence. The daily-scale encoding module 520 is used to perform multi-scale patch partitioning and encoding on the daily-scale input sequence to obtain multi-scale feature representations at the daily scale. The monthly-scale coding module 530 is used to construct a graph structure feature representation at the monthly scale based on the total monthly electricity consumption and industry-specific monthly electricity consumption data for multiple historical months. The monthly electricity consumption prediction module 540 is used to perform feature fusion on the multi-scale feature representation at the daily scale and the graph structure feature representation at the monthly scale to obtain cross-scale fusion features, and predict the total monthly electricity consumption of the future target month based on the cross-scale fusion features and the graph structure feature representation at the monthly scale.
[0079] The power prediction system based on multi-scale time series data described above and the power prediction method based on multi-scale time series data described above can be referred to and correspond to each other.
[0080] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6 As shown, the electronic device may include a processor 610, a communications interface 620, a memory 630, and a communication bus 640. The processor 610, communications interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions stored in the memory 630 to execute a power prediction method based on multi-scale time-series data provided in the above-described method embodiments.
[0081] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a 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 several 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 described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0082] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute a power prediction method based on multi-scale time-series data provided in the above-described method embodiments.
[0083] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform a power prediction method based on multi-scale time-series data provided by the methods described above.
[0084] The device embodiments described above are merely illustrative. The units described 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0085] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A power generation prediction method based on multi-scale time series data, characterized in that, include: Acquire daily-scale electricity consumption data and meteorological data for the target month in history, perform preprocessing, and construct a daily-scale input sequence; The daily-scale input sequence is divided and encoded using multi-scale patching to obtain multi-scale feature representations at the daily scale. Based on the total monthly electricity consumption and industry-specific monthly electricity consumption data for multiple historical months, a graph structure feature representation at the monthly scale is constructed. The multi-scale feature representation at the daily scale and the graph structure feature representation at the monthly scale are fused to obtain cross-scale fused features. Based on the cross-scale fused features and the graph structure feature representation at the monthly scale, the total monthly electricity consumption of the future target month is predicted.
2. The power prediction method based on multi-scale time series data according to claim 1, characterized in that, The daily-scale input sequence is divided and encoded using a daily-scale multi-scale patch coding network to obtain a multi-scale feature representation at the daily scale. The daily-scale multi-scale patch coding network includes: The multi-scale patch partitioning module is used to partition the day-scale sequence according to multiple time windows to obtain patch sequences corresponding to the multiple time windows respectively. The Patch embedding encoding module is used to embed and encode the Patch sequences corresponding to the multiple time windows respectively to obtain multi-scale embedding features. The daily-scale Transformer encoding module is used to perform feature interaction based on the attention mechanism on the multi-scale embedded features to obtain multi-scale feature representations at the daily scale.
3. The power prediction method based on multi-scale time series data according to claim 2, characterized in that, The Patch embedding encoding module includes a Patch flattening layer, a first fully connected mapping layer, a first normalization layer, a Patch embedding vector generation layer connected in sequence, and parallel position encoding branches and scale encoding branches; wherein, the position encoding branch includes a position vector generation layer and a position feature overlay layer scale encoding branch connected in sequence; the scale encoding branch includes a scale vector generation layer and a scale feature overlay layer connected in sequence.
4. The power prediction method based on multi-scale time series data according to claim 2, characterized in that, The day-scale Transformer encoding module includes a first attention layer, a first residual connection layer, a second normalization layer, a first feedforward network layer, a second residual connection layer, and a third normalization layer connected in sequence.
5. The power prediction method based on multi-scale time series data according to claim 1, characterized in that, The method constructs a monthly-scale graph structure feature representation based on historical monthly total electricity consumption and monthly electricity consumption data by industry, including: Using multiple historical months as graph nodes, total monthly electricity consumption and monthly electricity consumption by industry as node features, and the relationships between adjacent months, seasonal cycles, and industry structural similarities among the aforementioned multiple historical months as edges, a graph structure is constructed. The graph structure is encoded to obtain a graph structure feature representation at the monthly scale; The adjacent month relationship describes the trend continuity between consecutive months; the seasonal cycle relationship describes the cycle similarity between the same months in different years; and the industry structure similarity relationship describes the similarity of the industry's electricity consumption structure.
6. The power prediction method based on multi-scale time series data according to claim 1, characterized in that, A graph structure feature representation at the monthly scale is constructed using a monthly-scale graph structure encoding network. The lunar scale map structure coding network includes: The monthly-scale node feature construction module is used to construct a node feature matrix based on the total monthly electricity consumption and the monthly electricity consumption by industry. The monthly-scale relationship construction module is used to construct relationships between adjacent months, seasonal cycles, and industry structure similarity based on the total monthly electricity consumption and the monthly electricity consumption by industry for multiple historical months. The adjacency matrix fusion module is used to construct an adjacency matrix based on the adjacent month relationship, the seasonal cycle relationship, and the industry structure similarity relationship; The graph neural network encoding module is used to encode the graph structure composed of the node feature matrix and the adjacency matrix through a graph neural network to obtain a graph structure feature representation at the monthly scale.
7. The power prediction method based on multi-scale time series data according to claim 1, characterized in that, The feature fusion of the multi-scale feature representation at the solar scale and the graph structure feature representation at the lunar scale is performed by a solar-moon cross-guided fusion network. The sun-moon cross-guided fusion network includes: The attention aggregation module is used to perform cross-attention calculation on the multi-scale feature representation at the daily scale and the graph structure feature representation at the monthly scale to obtain cross-scale attention weights, and to weight and aggregate the multi-scale feature representation at the daily scale to obtain aggregated daily scale features. The residual connection module is used to fuse the graph structure feature representation at the monthly scale and the aggregated daily scale features through residual connection, and normalize them to obtain cross-scale fused features.
8. A power generation prediction method based on multi-scale time series data, characterized in that, include: The data acquisition module is used to acquire daily-scale electricity consumption data and meteorological data for historical target months, and to preprocess and construct daily-scale input sequences. The daily-scale encoding module is used to perform multi-scale patch partitioning and encoding on the daily-scale input sequence to obtain multi-scale feature representations at the daily scale. The monthly-scale coding module is used to construct a graph structure feature representation at the monthly scale based on the total monthly electricity consumption and monthly electricity consumption data of different industries over multiple historical months. The monthly electricity consumption prediction module is used to perform feature fusion on the multi-scale feature representation at the daily scale and the graph structure feature representation at the monthly scale to obtain cross-scale fused features, and predict the total monthly electricity consumption of the future target month based on the cross-scale fused features and the graph structure feature representation at the monthly scale.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the power prediction method based on multi-scale time series data as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the power prediction method based on multi-scale time series data as described in any one of claims 1 to 7.
