Power load prediction method based on adaptive multi-scale hypergraph neural network
Through adaptive multi-scale hypergraph neural network and hypergraph convolutional attention mechanism, the problems of multi-scale feature interaction and timing variation entanglement in power load prediction are solved, and prediction accuracy and result reliability are improved.
Patent Information
- Application Number
- CN202411011366.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-07-26
AI Technical Summary
The existing power load prediction methods have semantic information sparsity and noise interference when dealing with multi-scale feature interactions and timing variation entanglement, making it difficult to accurately predict power load changes.
Adaptive multi-scale hypergraph neural network is adopted to model high-order interactions between multi-scale features through adaptive hypergraph learning modules, introduce nodes and hyper-edge constraint mechanisms, aggregate features with similar semantic information and distinguish between them within each scale Time sequence changes, capture higher-order interactions using hypergraph convolutional attention mechanism.
It improves the accuracy of power load prediction, can more effectively capture high-order interactions and timing changes between multi-scale features, reduce noise interference, and enhance the reliability of prediction results.
Smart Images

Figure CN119168113A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power load prediction, and in particular relates to a power load prediction method based on an adaptive multi-scale hypergraph neural network. Background Art
[0002] With the continuous advancement of urbanization and industrialization, the demand for electricity is increasing, and the gradual increase in urban power load has become an important issue. This situation not only affects people's daily life and work, but also brings great challenges to relevant departments in power planning and energy management. Accurately predicting future changes in power load can effectively guide people in power supply and energy allocation, and provide strong data support for power system management. Therefore, power load forecasting has become one of the most important and valuable research directions in the energy field.
[0003] In real life, power load data presents complex and diverse temporal changes at different time scales due to the influence of periodic human activities. For example, household electricity consumption usually decreases in the morning and increases in the evening on a daily scale, and decreases during the week and increases on weekends on a weekly scale. Considering the interaction between multi-scale features usually leads to more accurate prediction results than analyzing the features of a single scale alone, which is of great significance for long-term planning and early warning of power loads.
[0004] In order to model the interaction between multi-scale features in power load data, many classic network structures have emerged, including Convolutional Neural Networks (CNNs), Graph Neural Networks (GNNs), Recurrent Neural Networks (RNNs) and Transformers. Although the above methods have achieved certain results, there are still two major problems that limit their further development in the field of power load forecasting.
[0005] The first point is the sparsity of semantic information. Unlike natural language processing (NLP) and computer vision (CV), a single time point in a time series contains less semantic information. Compared with paired information interactions, high-order interactions between time points with similar semantic features (for example, adjacent time points and time points that are far away but still have strong correlation) are more important in power load forecasting. In order to solve the problem of semantic information sparsity, existing methods enhance local correlation and capture high-order interactions by dividing patches or adopting predefined hypergraph structures. However, simple patch division methods or predefined hypergraph structures may introduce a lot of noise and make it difficult to discover implicit high-order interactions.
[0006] The second point is the entanglement of timing changes. Due to the complexity and non-stationarity of power load sequences in real applications, the observed power load sequences usually contain a large number of inherent timing changes (such as rises, falls, and fluctuations, etc.), which may be mixed and overlapped with each other. In particular, the power load sequence presents different timing changes at different time scales. The timing changes at multiple scales are deeply entangled, which poses a great challenge to the prediction of power load sequences. In order to solve the problem of entanglement of timing changes, some recent methods use sequence decomposition or multi-period analysis methods to distinguish timing changes at different scales. However, existing methods have difficulty distinguishing timing changes within each scale, causing multiple timing changes within each scale to overlap and entangle with each other, resulting in interference from noise and redundant information. Summary of the invention
[0007] In view of the above, the purpose of the present invention is to provide a power load forecasting method based on an adaptive multi-scale hypergraph neural network, so as to adaptively model high-order interactions between multi-scale features in the power load forecasting model, and aggregate features with similar semantic information by introducing node and hyperedge constraint mechanisms and distinguish the inherent temporal changes within each scale. It has broad application prospects in the fields of power system operation, energy planning and energy efficiency management.
[0008] In order to achieve the above-mentioned invention object, the technical solution provided by the present invention is as follows:
[0009] An embodiment of the present invention provides a method for predicting power load based on an adaptive multi-scale hypergraph neural network, comprising the following steps:
[0010] Preprocess the power load data and construct training samples;
[0011] In the multi-scale feature extraction module, the training samples are constructed into sub-sequences of different time scales;
[0012] In the adaptive hypergraph learning module, the initial node features, initial hyperedge features and point-edge association matrix of different time scales are obtained based on the subsequences, and the node constraints based on the semantic similarity between nodes and corresponding hyperedges and the hyperedge constraints based on the distance similarity between hyperedges are executed and the constraint loss is constructed.
[0013] In the multi-scale interaction module, the high-order interactions between fine-grained features are modeled through the hypergraph convolution attention mechanism to obtain updated node features, and the high-order interactions between coarse-grained features are modeled through the attention mechanism to obtain updated hyper-edge features;
[0014] In the multi-scale fusion module, the updated node features and hyper-edge features are integrated to perform power load prediction, and the power load prediction model including the multi-scale feature extraction module, the adaptive hypergraph learning module, the multi-scale interaction module and the multi-scale fusion module is trained based on the prediction loss and the constraint loss.
[0015] The new power load data is input into the trained power load prediction model to obtain the prediction result.
[0016] Specifically, in the adaptive hypergraph learning module, the initialization node features, initialization hyperedge features and point-edge association matrices of different time scales are obtained based on the subsequences, including:
[0017] The power load data at different times in the subsequence are taken as nodes, the relationship between nodes is taken as hyperedge, and the node embedding is initialized. and hyperedge embedding Where N s and M s They represent the number of nodes and hyperedges at the sth scale, respectively, D is the feature dimension, is a set of real numbers. The point-edge association matrix H of the sth scale is obtained by similarity calculation. s , and its calculation formula is as follows:
[0018]
[0019] Among them, ReLU(·) is the activation function, Softmax(·) is the Softmax function, ⊙ is the bit-by-bit multiplication, and the superscript T is the transposition operation. Finally, we get the point-edge association matrix {H 1 ,…,H s ,…,H S};
[0020] Given the subsequences of different time scales generated by the multi-scale feature extraction module, that is, the subsequences of S scales {X 1 ,…,X s ,…,X S}, get the initialization node features of the sth scale The calculation formula is as follows:
[0021]
[0022] Among them, f(·) is implemented by a multi-layer perceptron, and finally the initialization node features of S scales are obtained
[0023] After obtaining the initialized node features, the initialized hyperedge features are obtained by aggregating the node features connected by the hyperedges. For the i-th hyperedge at scale s Its characteristics The calculation formula is as follows:
[0024]
[0025] Among them, avg(·) is the averaging operation, is the hyperedge on scale s Connected neighbor nodes, is the jth node on scale s The features of S scales are finally obtained. 1 ,…,ε s ,...,ε S}.
[0026] Preferably, a sparse strategy is used to calculate the point-edge association matrix of the sth scale, and the calculation formula is as follows:
[0027]
[0028] Among them, α∈[0,M s ] is the threshold of the TopK(·) function, which indicates the maximum number of neighbor hyperedges connected to the node, n is the node index, m is the hyperedge index, For all hyperedges connecting the nth node, the final s-th scale sparse point-edge association matrix is The calculation formula is as follows:
[0029]
[0030] Among them, β∈[0,1] is the threshold of each element in the point-edge association matrix, through Generate the final S-scale point-edge association matrix {H 1 ,…,H s ,…,H S}.
[0031] Specifically, in the adaptive hypergraph learning module, node constraints based on semantic similarity between nodes and corresponding hyperedges and hyperedge constraints based on distance similarity between hyperedges are executed and constraint losses are constructed, including:
[0032] Execute node constraints and initialize node features according to each scale and initialize the hyperedge feature ε s Generate node constraint loss within each scale Including: For the jth node v on scale s j s , which has a semantic similarity difference with the corresponding hyperedge The calculation formula is as follows:
[0033]
[0034] Where abs(·) is the absolute value operation. for The node characteristics of is the i-th hyperedge on scale s The hyperedge feature of is the hyperedge on scale s Connected neighbor nodes, node constraint loss based on node constraints at the sth scale The calculation formula is as follows:
[0035]
[0036] Among them, N s is the number of nodes on scale s;
[0037] Execute the hyperedge constraint by calculating the correlation weight α between the hyperedge features initialized at each scale i,j and Euclidean distance Get the hyperedge constraint loss within each scale Including: First, by calculating the cosine similarity, the correlation weight α between any two hyperedge features on scale s is obtained i,j , and its calculation formula is as follows:
[0038]
[0039] Among them, α i,j is the i-th hyperedge on scale s and the jth hyperedge is the correlation weight, cos<·> is the cosine similarity function, and are the initialization features of the ith and jth hyperedges on scale s, respectively. The superscript T represents the transposition operation. 2 is the 2-norm, and then calculates the i-th hyperedge on scale s and the jth hyperedge The Euclidean distance between The calculation formula is as follows:
[0040]
[0041] Where D is the total feature dimension, d is the dimension index, and then based on the correlation weight α i,j and Euclidean distance Calculate the hyperedge constraint loss at the sth scale The calculation formula is as follows:
[0042]
[0043] Among them, γ>0 is the threshold of Euclidean distance, and max(·) is the maximum value operation;
[0044] Constrain the loss according to the nodes within each scale and the hyperedge constraint loss Generate the final constraint loss L const , including: constraint loss L const The calculation formula is as follows:
[0045]
[0046] Among them, λ∈[0,1] is a hyperparameter that controls the trade-off between node constraint loss and hyperedge constraint loss.
[0047] Specifically, in the intra-scale interaction module of the multi-scale interaction module, the high-order interactions between fine-grained features are modeled through the hypergraph convolutional attention mechanism, including:
[0048] Given a point-edge correlation matrix H at scale s s , first use the attention mechanism to capture each node on scale s and the interaction strength of its related hyperedges to obtain the updated point-edge association matrix The calculation formula is as follows:
[0049]
[0050] Where [·,·] is the concatenation operation of node features and their related hyperedge features, g(c) is a trainable multi-layer perceptron, σ(·) is an activation function, is the i-th node connected to scale s The adjacent hyperedges are connected by the point-edge association matrix H of the sth scale. s Get, is the kth hyperedge on scale s Features, For Node Features;
[0051] Then, input the updated point-edge association matrix Update node features at each scale by combining multi-head attention mechanism and normalized hypergraph Laplacian convolution The calculation formula is as follows:
[0052]
[0053] in, is the aggregation function for aggregating the outputs of multiple attention heads, is the number of heads of multi-head attention, and They are respectively The updated point-edge association matrix and the learnable weight adjacency matrix, is the square inverse of the node degree matrix at scale s, is the square inverse of the hyperedge degree matrix on scale s. The node features of S scales after update are
[0054] Specifically, in the inter-scale interaction module of the multi-scale interaction module, the high-order interactions between coarse-grained features are modeled through the attention mechanism, including:
[0055] Based on the initialized hyperedge features at different time scales, we first obtain the corresponding query Q, key K, and value V through linear mapping, and then capture the high-order interactions between coarse-grained features through the attention mechanism, and output the updated hyperedge features. The calculation formula is as follows:
[0056]
[0057] Among them, Softmax(·) is the Softmax function, D K is the characteristic dimension of key K, the superscript T is the transposition operation, is the updated hyperedge feature.
[0058] Specifically, in the multi-scale fusion module, the updated node features and hyperedge features are fused to perform power load prediction, including:
[0059] The updated node features and hyperedge features are concatenated and input into the linear layer for multi-scale feature fusion, and the power load prediction value for the next H steps is output.
[0060] Specifically, in the multi-scale fusion module, the loss functions used to train the power load prediction model include:
[0061] Prediction loss, which is the error between the predicted value and the true value output by the power load prediction model. The network parameters of the entire power load prediction model are adjusted according to the prediction loss of all samples.
[0062] The constraint loss, which includes the node constraint loss for performing node constraint construction and the hyperedge constraint loss for performing hyperedge constraint construction, adjusts the parameters of the adaptive hypergraph learning module according to the constraint losses of all samples.
[0063] Specifically, the preprocessing of the power load data and constructing training samples includes:
[0064] The power load data is preprocessed including outlier processing and normalization processing, and the preprocessed power load data is divided by a sliding time window to obtain a training data set; the training data set is batched according to a fixed batch size; and training samples are selected from the training data set in batches.
[0065] Specifically, in the multi-scale feature extraction module, the training samples are constructed into sub-sequences of different time scales, including:
[0066] The training samples are input into the multi-scale feature extraction module, and the aggregation function is used to generate subsequences of different time scales by setting different aggregation windows. The length of the next time scale subsequence is the length of the previous time scale subsequence divided by the aggregation window size corresponding to the previous time scale. Finally, all subsequences constitute a subsequence set.
[0067] The present invention captures the rich and implicit high-order interactions between multi-scale features through an adaptive hypergraph learning module, and explicitly considers features with similar semantic information and the inherent temporal changes within each scale through constraints. Compared with the prior art, the present invention has at least the following beneficial effects:
[0068] (1) The present invention designs an adaptive hypergraph learning module to model the rich and implicit high-order correlations between multi-scale features, and introduces a multi-scale interaction module to implement a hypergraph convolutional attention mechanism, so that the model can capture the high-order interactions between multi-scale features in the power load sequence.
[0069] (2) The present invention introduces a node and hyperedge constraint mechanism in the hypergraph learning process, which utilizes semantic similarity to aggregate features with similar semantic information in the power load sequence, and utilizes distance similarity to distinguish the inherent temporal changes within each scale, thereby improving the accuracy of the prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0071] Figure 1It is an overall flow chart of a method for power load prediction based on an adaptive multi-scale hypergraph neural network provided by an embodiment of the present invention;
[0072] Figure 2 It is an overall framework diagram of a power load prediction method based on an adaptive multi-scale hypergraph neural network provided by an embodiment of the present invention;
[0073] Figure 3 It is a detailed schematic diagram of the node and hyperedge constraint mechanism provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0074] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.
[0075] The inventive concept of the present invention is as follows: in view of the problem that the power load prediction in the prior art has insufficient prediction accuracy due to the sparse semantic information and the entanglement of time series changes, the embodiment of the present invention provides a power load prediction method based on an adaptive multi-scale hypergraph neural network, firstly, the given power load data is preprocessed to construct a training sample; secondly, the input sequence is mapped into multi-scale features by using a multi-scale feature extraction module to construct sub-sequences of different time scales; then, an adaptive hypergraph learning module is introduced to automatically infer the hypergraph structure at different scales, fully explore the rich and implicit high-order correlations between multi-scale features, and introduce node constraints and hyper-edge constraints in the process of hypergraph learning, so that the model can aggregate features with similar semantic information and distinguish the inherent time series changes in each scale; secondly, a multi-scale interaction module is introduced to model the high-order interaction between multi-scale features based on the hypergraph structure, wherein the intra-scale interaction module models the high-order interaction between fine-grained features, and the inter-scale interaction module models the high-order interaction between coarse-grained features; finally, the updated multi-scale features are integrated to realize the prediction of the power load sequence.
[0076] Figure 1 is an overall flow chart of a power load prediction method based on an adaptive multi-scale hypergraph neural network provided by an embodiment of the present invention, Figure 2 is a general framework diagram of the power load prediction method based on the adaptive multi-scale hypergraph neural network provided by the embodiment of the present invention. Figure 1 and Figure 2 As shown, the embodiment provides a method for power load prediction based on an adaptive multi-scale hypergraph neural network, comprising the following steps:
[0077] The power load forecasting task is defined as: given a station or region, the power load sequence observations of the previous T time points Predict the power load value at the next H moments
[0078] Step 1: Construct a power load sequence based on the power consumption data collected by the power load sensor, and then divide the processed data through a sliding time window to obtain a training dataset.
[0079] Perform outlier detection on the given power load sequence and remove the invalid values (such as values outside the normal range and zero values) among them. Perform Z-score normalization on the data after removing outliers, which is used to convert the data into a standard normal distribution with zero mean and unit variance. The calculation formula is as follows:
[0080]
[0081] where, x t is the value at time step t in the power load sequence after removing outliers, μ is the mean of the power load sequence data, σ is the standard deviation of the power load sequence, and x t ′ is the value at time step t after normalization.
[0082] Manually set the time window size T according to experience, and divide the normalized data using a fixed-length sliding step size to obtain a training dataset.
[0083] Step 2: Batch the training dataset according to a fixed batch size, and the total number of batches is B.
[0084] Batch the training dataset according to the batch size P set manually according to experience. The total number of batches is B, and its calculation formula is as follows:
[0085]
[0086] where, N Samples is the total number of samples in the training dataset, is rounding up.
[0087] Step 3: Sequentially select a batch of training samples with index b from the training dataset, where b ∈ {1, 2, …, B}. For each training sample in this batch, repeat steps 4 - 13.
[0088] Step 4: Input the training sample sequence into the multi-scale feature extraction module to construct S-scale subsequences {X 1 , …, X s , …, X S}, where is the original input sample sequence, and X s is the subsequence at the s-th (1 < s ≤ S) scale.
[0089] Given a sample power load sequence The multi-scale feature extraction module generates subsequences of S scales by setting different aggregation windows. The subsequence of the s-th scale is denoted as where is the representation of the power load sequence at time t of the s-th scale, D is the feature dimension, is the set of real numbers, is the sequence length of the s-th scale, that is, the number of nodes, l s-1 is the aggregation window size of the (s - 1)-th scale. The calculation formula of the specific aggregation process is as follows:
[0090]
[0091] where Agg(·) is an aggregation function, including convolution or pooling, etc., θ s-1 is the learnable parameter of the aggregation function at the (s - 1)-th scale.
[0092] Finally, the multi-scale feature extraction module generates subsequences of S scales {X 1 , …, X s , …, X S}, where represents the original input sample sequence, and X s represents the subsequence of the s-th (1 < s ≤ S) scale.
[0093] Step 5, embed the nodes of each scale and the hyperedge embedding into the adaptive hypergraph learning module to obtain point-edge incidence matrices of S scales {H 1 , …, H s , …, H S}, where H s is the point-edge incidence matrix of the s-th (1 < s ≤ S) scale.
[0094] As shown in (b) of Figure 2 , take the power load data at different times in the subsequence as nodes and the relationships between nodes as hyperedges. First, initialize two parameters, namely the node embedding and the hyperedge embedding where M s is a hyperparameter representing the number of hyperedges of the s-th scale. Then, calculate the point-edge incidence matrix H s of the s-th scale through similarity calculation. Its calculation formula is as follows:
[0095]
[0096] Among them, ReLU(·) is the activation function used to eliminate weak connections, and Softmax(·) is the Softmax function used to adjust H s The value of is normalized, ⊙ is the bit-by-bit multiplication, and the superscript T is the transposition operation. In order to reduce the subsequent computational cost and noise interference, a sparse strategy is designed, and its calculation formula is as follows:
[0097]
[0098] Among them, α∈[0,M s ] is the threshold of the TopK(·) function, which indicates the maximum number of neighbor hyperedges connected to the node, n is the node index, m is the hyperedge index, For all hyperedges connecting the nth node, the final s-th scale sparse point-edge association matrix is The calculation formula is as follows:
[0099]
[0100] Among them, β∈[0,1] is the threshold of each element in the point-edge association matrix. Finally, we get the point-edge association matrix {H 1 ,…,H s ,…,H S}.
[0101] It should be noted that the hypergraph is defined as where ε = {e 1 ,...,e m ,...,e M} is a hyperedge set, is a set of nodes. Each hyperedge connects a set of nodes Represents high-order interactions. The topological structure of the hypergraph is represented by the point-edge association matrix Indicates that its element H nm The definition is as follows:
[0102]
[0103] The degree of the nth node is defined as The degree of the mth hyperedge is defined as The node degree and hyperedge degree are stored in diagonal matrices and middle.
[0104] Step 6: According to the subsequences {X 1 ,…,X s ,…,X S} and the vertex-edge incidence matrix {H 1 ,…,H s ,…,H S, obtaining the initialized node features of S scales and the initialized hyperedge features {ε 1 ,…, ε s ,..., ε S}, where and ε s are the initialized node features and initialized hyperedge features of the s-th (1 < s ≤ S) scale, respectively.
[0105] Given the S-scale subsequences {X 1 ,…, X s ,…, X S} generated by the multi-scale feature extraction module, first obtain the initialized node features of the s-th scale The calculation formula is as follows:
[0106]
[0107] where f(·) is implemented by a multi-layer perceptron (MLP). Then obtain the initialized node features of S scales
[0108] As Figure 3 shown in (a) of, after obtaining the initialized node features, the initialized hyperedge features are obtained by aggregating the node features connected by the hyperedges. Specifically, for the i-th hyperedge at scale s its feature The calculation formula is as follows:
[0109]
[0110] where avg(·) is the averaging operation, is the neighbor nodes connected by the hyperedge at scale s, is the feature of the j-th node at scale s. Finally, obtain the initialized hyperedge features of S scales {ε 1 ,…, ε s ,…, ε S}.
[0111] Step 7, perform node constraints, and generate the node constraint losses within each scale according to the initialized node features and the initialized hyperedge features ε s of each scale
[0112] After obtaining the initialized node features and the initialized hyperedge features ε sFinally, in order to aggregate features with similar semantic information and reduce noise interference, node constraints based on the semantic similarity between nodes and their corresponding hyperedges are introduced. Figure 3 As shown in (b), for the jth node on scale s Its semantic similarity difference with the corresponding hyperedge The calculation formula is as follows:
[0113]
[0114] Where abs(·) is the absolute value operation, and the node constraint loss based on node constraints at the sth scale is The calculation formula is as follows:
[0115]
[0116] Among them, N s is the number of nodes at scale s.
[0117] Step 8: Execute the hyperedge constraint by calculating the correlation weight α between the hyperedge features at each scale i,j and Euclidean distance Get the hyperedge constraint loss within each scale
[0118] In order to solve the problem of temporal variation entanglement, a hyperedge constraint mechanism based on distance similarity is introduced. Figure 3 As shown in (c), we first calculate the cosine similarity to obtain the correlation weight α between any two hyperedge features on scale s. i,j , to reflect its correlation, the calculation formula is as follows:
[0119]
[0120] Among them, α i,j is the i-th hyperedge on scale s and the jth hyperedge is the correlation weight, cos<·> is the cosine similarity function, and are the initialization features of the ith and jth hyperedges on scale s, respectively. The superscript T represents the transposition operation. 2 is the 2-norm, and then calculates the i-th hyperedge on scale s and the jth hyperedge The Euclidean distance between The calculation formula is as follows:
[0121]
[0122] Where D is the total feature dimension and d is the dimension index. Then, based on the correlation weight αi,j and Euclidean distance Calculate the hyperedge constraint loss at the sth scale The calculation formula is as follows:
[0123]
[0124] Among them, α>0 is the threshold of Euclidean distance, and max(·) is the maximum value operation. i,j =1, and Similarly, the hyperedge constraint loss is if becomes larger, that is, the similar hyperedge Euclidean distance becomes larger, and the hyperedge constraint loss will increase. On the contrary, when α i,j = 0, and Not similar, the hyperedge constraint loss is if Below the threshold and becomes smaller, that is, the dissimilar hyperedge Euclidean distance becomes smaller, and the hyperedge constraint loss Other situations are in between.
[0125] Step 9: Constrain the loss according to the nodes within each scale and the hyperedge constraint loss Generate the final constraint loss L const .
[0126] Constrain the loss according to the nodes within each scale and the hyperedge constraint loss Generate the final constraint loss L const , and its calculation formula is as follows:
[0127]
[0128] Among them, λ∈[0,1] is a hyperparameter that controls the trade-off between node constraint loss and hyperedge constraint loss.
[0129] Step 10: transform the point-edge association matrix {H 1 ,…,H s ,…,H S}、Initialize node features and initialize the hyperedge features {ε 1 ,…,ε s ,...,ε S} is sent to the intra-scale interaction module, and the high-order interactions between intra-scale nodes and node fine-grained features are captured through the hypergraph convolution attention mechanism, and the updated multi-scale node features are output.
[0130] In order to capture the high-order interactions between fine-grained features within a scale, a hypergraph convolutional attention mechanism is introduced in the intra-scale interaction module. Specifically, given H s , first use the attention mechanism to capture each node on scale s and the interaction strength of its related hyperedges to obtain the updated point-edge association matrix The calculation formula is as follows:
[0131]
[0132] Where [·,·] is the concatenation operation of node features and their related hyperedge features, g(·) is a trainable multi-layer perceptron, and σ(δ) is an activation function, such as LeakerReLU and ELU. is the i-th node connected to scale s The adjacent hyperedges are connected by the point-edge association matrix H of the sth scale. s Get, is the kth hyperedge on scale s Features, For Node characteristics.
[0133] Finally, input the updated point-edge association matrix Update node features at each scale by combining multi-head attention and normalized hypergraph Laplacian convolution The calculation formula is as follows:
[0134]
[0135] in, is the aggregation function for aggregating the outputs of multiple attention heads, is the number of heads of multi-head attention, and They are respectively The updated point-edge association matrix and the learnable weight adjacency matrix, is the square inverse of the node degree matrix at scale s, is the square inverse of the hyperedge degree matrix on scale s. The node features of S scales after update are
[0136] Step 11: Initialize the hyperedge features {δ 1 ,…,ε s ,...,ε S} is sent to the scale interaction module, and the attention mechanism is used to capture the high-order interaction between the hyperedge and the hyperedge coarse-grained features to obtain the updated hyperedge features
[0137] The inter-scale interaction module is used to capture the high-order interactions between coarse-grained features. Specifically, based on the multi-scale hyperedge feature {ε 1 ,…,ε s ,...,ε S}, firstly obtain the corresponding query Q, key K and value V through linear mapping, then capture the high-order interaction between coarse-grained features through the attention mechanism, and output the updated hyperedge feature, which is calculated as follows:
[0138]
[0139] Among them, D K is the characteristic dimension of key K, the superscript T is the transposition operation, is the updated hyperedge feature.
[0140] Step 12: Concatenate the updated node and hyperedge features and input them into the linear layer to output the power load forecast value for the next H steps.
[0141] The node features of S scales after updating are obtained through the intra-scale interaction module and the inter-scale interaction module. and the updated hyperedge features After that, they are concatenated and then input into the linear layer for multi-scale feature fusion to output the power load prediction value for the next H steps.
[0142] Step 13, calculate the prediction loss L mse , that is, the true value corresponding to the training sample and the predicted value of the actual model output The error between .
[0143] In the present invention, mean square error loss is used as prediction loss L mse , that is, the true value corresponding to the training sample and the predicted value of the actual model output The error between them is calculated as follows:
[0144]
[0145] in, and are the true value and predicted value for the next H steps respectively.
[0146] Step 14: Calculate the prediction loss for all samples in the batch and constraint loss
[0147] Prediction loss for all samples in the batch The calculation formula is as follows:
[0148]
[0149] Among them, L mse (k) is the prediction loss of the kth sample in the batch, K is the number of samples in each batch. The constraint loss of all samples in the batch The calculation formula is as follows:
[0150]
[0151] Among them, L const (k) is the constraint loss for the kth sample in the batch.
[0152] Step 15: Based on the prediction loss of all samples in the batch Adjust the network parameters in the entire power load forecasting model.
[0153] The prediction loss for all samples in the batch The network parameters in the entire power load forecasting model are updated, and the calculation formula is as follows:
[0154]
[0155] Among them, θ all is the network parameter in the whole model, and η is the learning rate.
[0156] Step 16: Constrained loss for all samples in the batch Adjust the parameters of the adaptive hypergraph learning module.
[0157] According to the constraint loss of all samples in the batch The parameters of the adaptive hypergraph learning module are updated, and the calculation formula is as follows:
[0158]
[0159] Among them, θ hyper are the network parameters of the adaptive hypergraph learning module, and η is the learning rate.
[0160] Step 17: Repeat steps 3-16 until all batches of the training data set participate in model training.
[0161] Step 18, repeat steps 3-17 until the specified number of iterations is reached.
[0162] Step 19: input the power load sequence to be predicted into the trained model to obtain the prediction result.
[0163] In summary, an embodiment of the present invention provides a method for power load prediction based on an adaptive multi-scale hypergraph neural network. An adaptive hypergraph learning module is designed to model the rich and implicit high-order correlations between multi-scale features, and a multi-scale interaction module is introduced to execute a hypergraph convolutional attention mechanism, so that the model can capture the high-order interactions between multi-scale features in the power load sequence. In the hypergraph learning process, a node and hyper-edge constraint mechanism is introduced, which uses semantic similarity to aggregate features with similar semantic information in the power load sequence, and uses distance similarity to distinguish the inherent temporal changes within each scale, thereby improving the accuracy of the prediction results. It has broad application prospects in the fields of power system operation, energy planning, and energy efficiency management.
[0164] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for power load prediction based on an adaptive multi-scale hypergraph neural network, characterized in that: The following steps are involved: Preprocess the power load data and construct training samples; In the multi-scale feature extraction module, the training samples are constructed into sub-sequences of different time scales; In the adaptive hypergraph learning module, the initial node features, initial hyperedge features and point-edge association matrix of different time scales are obtained based on the subsequences, and the node constraints based on the semantic similarity between nodes and corresponding hyperedges and the hyperedge constraints based on the distance similarity between hyperedges are executed and the constraint loss is constructed. In the multi-scale interaction module, the high-order interactions between fine-grained features are modeled through the hypergraph convolution attention mechanism to obtain updated node features, and the high-order interactions between coarse-grained features are modeled through the attention mechanism to obtain updated hyper-edge features; In the multi-scale fusion module, the updated node features and hyper-edge features are integrated to perform power load prediction, and the power load prediction model including the multi-scale feature extraction module, the adaptive hypergraph learning module, the multi-scale interaction module and the multi-scale fusion module is trained based on the prediction loss and the constraint loss; The new power load data is input into the trained power load prediction model to obtain the prediction result.
2. The method for power load prediction based on adaptive multi-scale hypergraph neural network according to claim 1 is characterized in that: In the adaptive hypergraph learning module, the initial node features, initial hyperedge features and point-edge association matrix of different time scales are obtained based on the subsequences, including: The power load data at different times in the subsequence are taken as nodes, the relationship between nodes is taken as hyperedges, and the node embedding is initialized. and hyperedge embedding Where N s and M s They represent the number of nodes and hyperedges at the sth scale, respectively, D is the feature dimension, is a set of real numbers, and the point-edge association matrix H of the sth scale is obtained by similarity calculation s , and its calculation formula is as follows: Among them, ReLU(·) is the activation function, Softmax(·) is the Softmax function, ⊙ is the bit-by-bit multiplication, and the superscript T is the transposition operation. Finally, we get the point-edge association matrix {H 1 ,…,H s ,…,H S }; Given a subsequence of S scales {X 1 ,…,X s ,…,X S }, get the initialization node features of the sth scale The calculation formula is as follows: Among them, f(·) is implemented by a multi-layer perceptron, and finally the initialization node features of S scales are obtained After obtaining the initialized node features, the initialized hyperedge features are obtained by aggregating the node features connected by the hyperedges. For the i-th hyperedge at scale s Its characteristics The calculation formula is as follows: Among them, avg(·) is the averaging operation, is the hyperedge on scale s Connected neighbor nodes, is the jth node on scale s The features of S scales are finally obtained. 1 ,…,ε s ,…,ε S }.
3. The method for power load prediction based on adaptive multi-scale hypergraph neural network according to claim 2 is characterized in that: The sparsification strategy is used to calculate the point-edge association matrix of the sth scale, and the calculation formula is as follows: Among them, α∈[0,M s ] is the threshold of the TopK(·) function, which indicates the maximum number of neighbor hyperedges connected to the node, n is the node index, m is the hyperedge index, For all hyperedges connecting the nth node, the final sth scale sparse point-edge association matrix is The calculation formula is as follows: Among them, β∈[0,1] is the threshold of each element in the point-edge association matrix, through Generate the final S-scale point-edge association matrix {H 1 ,…,H s ,…,H S }.
4. The method for power load prediction based on adaptive multi-scale hypergraph neural network according to claim 1 is characterized in that: In the adaptive hypergraph learning module, node constraints based on semantic similarity between nodes and corresponding hyperedges and hyperedge constraints based on distance similarity between hyperedges are executed and constraint losses are constructed, including: Execute node constraints and initialize node features according to each scale and initialize the hyperedge feature ε s Generate node constraint loss within each scale Includes: For the jth node on scale s Its semantic similarity difference with the corresponding hyperedge The calculation formula is as follows: Where abs(·) is the absolute value operation. for The node characteristics of is the i-th hyperedge on scale s The hyperedge feature of is the hyperedge on scale s Connected neighbor nodes, node constraint loss based on node constraints at the sth scale The calculation formula is as follows: Among them, N s is the number of nodes on scale s; Execute the hyperedge constraint by calculating the correlation weight α between the hyperedge features initialized at each scale i,j and Euclidean distance Get the hyperedge constraint loss within each scale Including: First, by calculating the cosine similarity, the correlation weight α between any two hyperedge features on scale s is obtained i,j , and its calculation formula is as follows: Among them, α i,j is the i-th hyperedge on scale s and the jth hyperedge is the correlation weight, cos<·> is the cosine similarity function, and are the initialization features of the i-th and j-th hyperedges on scale s, respectively. The superscript T is the transposition operation, and ‖·‖2 is the 2-norm. Then the i-th hyperedge on scale s is calculated. and the jth hyperedge The Euclidean distance between The calculation formula is as follows: Where D is the total feature dimension, d is the dimension index, and then based on the correlation weight α i,j and Euclidean distance Calculate the hyperedge constraint loss at the sth scale The calculation formula is as follows: Among them, γ>0 is the threshold of Euclidean distance, and max(·) is the maximum value operation; Constrain the loss according to the nodes within each scale and the hyperedge constraint loss Generate the final constraint loss L const , including: constraint loss L const The calculation formula is as follows: Among them, λ∈[0,1] is a hyperparameter that controls the trade-off between node constraint loss and hyperedge constraint loss.
5. The method for power load prediction based on adaptive multi-scale hypergraph neural network according to claim 1 or 2, characterized in that: In the intra-scale interaction module of the multi-scale interaction module, the high-order interactions between fine-grained features are modeled through the hypergraph convolutional attention mechanism, including: Given a point-edge correlation matrix H on scale s s , first use the attention mechanism to capture each node on scale s and the interaction strength of its related hyperedges to obtain the updated point-edge association matrix The calculation formula is as follows: Where [·,·] is the concatenation operation of node features and their related hyperedge features, g(·) is a trainable multi-layer perceptron, σ(·) is an activation function, is the i-th node connected to scale s The adjacent hyperedges are connected by the point-edge association matrix H of the sth scale. s Get, is the kth hyperedge on scale s Features, For Node Features; Then, input the updated point-edge correlation matrix Update node features at each scale by combining multi-head attention mechanism and normalized hypergraph Laplacian convolution The calculation formula is as follows: Among them, ⊕ is the aggregation function for aggregating multi-head attention outputs, is the number of heads of multi-head attention, and They are respectively The updated point-edge association matrix and the learnable weight adjacency matrix, is the square inverse of the node degree matrix at scale s, is the square inverse of the hyperedge degree matrix on scale s. The node features of S scales after update are 6. The method for power load prediction based on adaptive multi-scale hypergraph neural network according to claim 1 or 2, characterized in that: In the inter-scale interaction module of the multi-scale interaction module, the high-order interactions between coarse-grained features are modeled through the attention mechanism, including: Based on the initialized hyperedge features at different time scales, we first obtain the corresponding query Q, key K, and value V through linear mapping, and then capture the high-order interactions between coarse-grained features through the attention mechanism, and output the updated hyperedge features. The calculation formula is as follows: Among them, Softmax(·) is the Softmax function, D K is the characteristic dimension of key K, the superscript T is the transposition operation, is the updated hyperedge feature.
7. The method for power load prediction based on adaptive multi-scale hypergraph neural network according to claim 1, characterized in that: In the multi-scale fusion module, the updated node features and hyperedge features are integrated to perform power load prediction, including: The updated node features and hyperedge features are concatenated and input into the linear layer for multi-scale feature fusion, and the power load prediction value for the next H steps is output.
8. The method for power load prediction based on adaptive multi-scale hypergraph neural network according to claim 4 is characterized in that: In the multi-scale fusion module, the loss functions used to train the power load prediction model include: Prediction loss, which is the error between the predicted value and the true value output by the power load prediction model. The network parameters of the entire power load prediction model are adjusted according to the prediction loss of all samples. The constraint loss, which includes the node constraint loss for performing node constraint construction and the hyperedge constraint loss for performing hyperedge constraint construction, adjusts the parameters of the adaptive hypergraph learning module according to the constraint losses of all samples.
9. The method for power load prediction based on adaptive multi-scale hypergraph neural network according to claim 1, characterized in that: The preprocessing of the power load data and constructing training samples includes: The power load data is preprocessed including outlier processing and normalization processing, and the preprocessed power load data is divided by a sliding time window to obtain a training data set; the training data set is batched according to a fixed batch size; and training samples are selected from the training data set in batches.
10. The method for power load prediction based on adaptive multi-scale hypergraph neural network according to claim 1, characterized in that: In the multi-scale feature extraction module, the training samples are constructed into sub-sequences of different time scales, including: The training samples are input into the multi-scale feature extraction module, and the aggregation function is used to generate subsequences of different time scales by setting different aggregation windows. The length of the next time scale subsequence is the length of the previous time scale subsequence divided by the aggregation window size corresponding to the previous time scale. Finally, all subsequences constitute a subsequence set.
Citation Information
Patent Citations
Power load prediction method based on hierarchical hypergraph neural network
CN116845889A
Information propagation prediction method of sequence hypergraph neural network based on common attention fusion
CN118364185A
Cited By
Multi-scale feature extraction and correlation analysis method
CN120336828A
Prediction method and system based on multi-scale space-time hypergraph and lead lag structure
CN121188456A
