Power utilization plan prediction method, system and device based on GAT-TCN and medium
By using the GAT-TCN model, which combines graph attention networks and temporal convolutional networks, the problem of insufficient prediction accuracy for the interactive behavior and temporal characteristics of market participants is solved. This enables high-precision electricity consumption forecasting and market behavior analysis, supporting market supervision and enterprise strategy optimization.
Patent Information
- Application Number
- CN202511075970.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-12-19
AI Technical Summary
In existing technologies, a single model cannot simultaneously capture the complex interactive behaviors and dynamic temporal characteristics of market participants, resulting in insufficient accuracy in electricity consumption planning forecasts and an inability to support refined market simulations.
A GAT-TCN-based approach is adopted, which models the dynamic relationships between participants through graph attention networks and extracts long-term time-series features by combining temporal convolutional networks. This leads to the construction of a predictive model for the behavior of electricity market participants, which includes modules for data acquisition, spatial feature output, temporal feature output, and electricity consumption plan prediction. A fully connected prediction layer is used to output continuous electricity consumption plan prediction values.
It improves the accuracy and interpretability of electricity consumption forecasts, supports joint analysis of complex market behaviors, helps market regulators quickly identify abnormal trading activities, and enables enterprises to optimize pricing strategies and reduce market congestion risks.
Smart Images

Figure CN121168705A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power market data analysis, and in particular to a power consumption plan prediction method, system, device and medium based on GAT-TCN (Graph Attention Network-Temporal Convolutional Network). BACKGROUND
[0002] With the gradual opening of the power market, the behaviors (such as bidding strategies, power consumption plan adjustments) of market participants have a significant impact on market price fluctuations and system stability. Traditional prediction methods rely on time series analysis or independent individual modeling, ignoring the correlation between participants and the coupling effect of behaviors in the time and space dimensions. In the prior art, a single model is difficult to simultaneously capture the complex interactive behaviors of market subjects and dynamic time sequence characteristics, resulting in insufficient prediction accuracy and being unable to support fine market simulation.
[0003] The present application proposes a power market participant behavior prediction method based on GAT-TCN fusion modeling, which models the dynamic correlation between participants through a graph attention network (GAT), extracts long-term time sequence dependency features by combining a temporal convolution network (TCN), and realizes multi-dimensional data fusion and behavior prediction. SUMMARY
[0004] In view of the above problems, the present application is proposed.
[0005] Therefore, the problem to be solved by the present application is that in the prior art, a single model is difficult to simultaneously capture the complex interactive behaviors of market subjects and dynamic time sequence characteristics, resulting in insufficient prediction accuracy and being unable to support fine market simulation.
[0006] To solve the above technical problems, the present application provides the following technical scheme: a power consumption plan prediction method based on GAT-TCN, which comprises: collecting subject data and historical transaction data of power transaction subjects, establishing a node feature matrix according to the subject data, constructing a time sequence according to the transaction data, and forming graph structure data; modeling the node feature matrix using a graph attention mechanism, calculating the attention weight for any two adjacent nodes in the graph, updating the center node by splicing the node features, weighted summation and activation function, and outputting the spatial feature representation; extracting long-term dependency features of the time sequence using a temporal convolution network, and outputting the time feature representation; aligning and splicing the output spatial feature representation and the time feature representation along the time axis, inputting them into a fully connected prediction layer, and outputting continuous power consumption plan prediction values.
[0007] As a preferred scheme of the power consumption plan prediction method based on GAT-TCN, the method comprises the following steps: establishing a node feature matrix, constructing a time sequence according to transaction data, constructing a graph attention network based on the time sequence and the node feature matrix, and predicting a power consumption plan according to the graph attention network.
[0008] As a preferred scheme of the power consumption plan prediction method based on GAT-TCN, the method comprises the following steps: establishing a node feature matrix, constructing a time sequence according to transaction data, constructing a graph attention network based on the time sequence and the node feature matrix, and predicting a power consumption plan according to the graph attention network.
[0009] As a preferred scheme of the power consumption plan prediction method based on GAT-TCN, the method comprises the following steps: establishing a node feature matrix, constructing a time sequence according to transaction data, constructing a graph attention network based on the time sequence and the node feature matrix, and predicting a power consumption plan according to the graph attention network.
[0010] X∈R N*d
[0011] wherein N is the number of participants, d is the feature dimension, R N*d is a matrix containing N nodes, each node has d-dimensional features; the time sequence T constructed according to the transaction data is represented as,
[0012] T∈R N*L*m
[0013] wherein L is the time step, m is the number of transaction indicators, R N*L*m is a three-dimensional time sequence matrix containing N, L and m.
[0014] As a preferred scheme of the power consumption plan prediction method based on GAT-TCN, the method comprises the following steps: establishing a node feature matrix, constructing a time sequence according to transaction data, constructing a graph attention network based on the time sequence and the node feature matrix, and predicting a power consumption plan according to the graph attention network. ij is represented as,
[0015] e ij =LeakyReLU(a T [Wx i ||Wx j ])
[0016] wherein LeakyReLU is a linear rectifier function with leakage, W∈R d′*d is a learnable parameter matrix, a T ∈R 2d' is an attention vector, || is a splicing operation, R d′*d is a linear transformation weight matrix, d' is the target feature dimension after conversion, R 2d' is a vector with a length of 2d', and xi x j is the input of node i
[0017]
[0018] where α ij is the normalized weight, and N(i) is the neighbor set of node i i The updated feature h
[0019] h i is calculated as j∈N(i) α ij Wx j )
[0020] where σ is an activation function.
[0021] As a preferred scheme of the power consumption plan prediction method based on GAT-TCN, the long-term dependence feature of the time series is extracted by using the time convolution network, which includes performing causal dilated convolution on the lth layer output T (l) of the time series T
[0022] T (l) = ReLU (Φ (l) *T (l-1) +b (l) )
[0023] where ReLU is a ReLU activation function, Φ (l) is a convolution kernel with a dilated coefficient of 2 l , * represents a dilated convolution operation, T (l-1) is a causal dilated convolution of the (l-1)th layer output of the time series T (l) , and b out is the bias of the lth layer output; residual connection is performed to pass information across layers, and is represented as
[0024] T (l) = T (l-1) + T
[0025] where T out is the output after residual connection.
[0026] As a preferred embodiment of the electricity consumption plan prediction method based on GAT-TCN described in this invention, the method for outputting continuous electricity consumption plan prediction values includes: concatenating spatial feature representation and temporal feature representation into high-dimensional spatiotemporal features; performing a fully connected prediction layer to map the concatenated high-dimensional spatiotemporal features onto the prediction target space, outputting a multi-class probability distribution, and quantifying the probability of different behaviors.
[0027] To address the aforementioned technical problems, this invention provides the following technical solution: a power consumption planning forecasting system based on GAT-TCN, comprising: a data acquisition and processing module, a spatial feature output module, a temporal feature output module, and a power consumption planning forecasting module; the data acquisition and processing module is used to collect the main data and historical transaction data of the power trading entity, establish a node feature matrix based on the main data, and construct a time series based on the transaction data to form graph structure data; the spatial feature output module is used to model the node feature matrix using a graph attention mechanism, calculate the attention weight for any two adjacent nodes in the graph, update the central node by concatenating node features, weighted summation, and activation function, and output the spatial feature representation; the temporal feature output module is used to extract the long-term dependency features of the time series using a temporal convolutional network and output the temporal feature representation; the power consumption planning forecasting module is used to align and concatenate the output spatial feature representation and temporal feature representation along the time axis, input them to a fully connected prediction layer, and output continuous power consumption planning forecast values.
[0028] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of a power consumption planning and forecasting method based on GAT-TCN as described above.
[0029] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a power consumption forecasting method based on GAT-TCN as described above.
[0030] The beneficial effects of this invention are as follows: The method of this invention dynamically models the relationships between participants (such as transaction frequency and cooperation history) through GAT, capturing behavioral patterns such as competition and alliances in the market network. TCN extracts long-term trends (such as seasonal fluctuations) and short-term mutations (such as the impact of sudden events) in transaction data such as electricity prices and transaction volumes through causal dilatation convolution. This not only solves the limitations of traditional methods in terms of prediction accuracy, interpretability, and dynamic adaptability, but also supports the joint analysis of complex market behaviors, which is conducive to revealing market rules, providing market regulators with visualization tools to quickly locate abnormal transaction behaviors, and allowing enterprise users to optimize their bidding strategies based on prediction results. Power trading platforms can also dynamically adjust their matching strategies based on real-time prediction results, reducing the risk of market congestion. Attached Figure Description
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without any creative effort based on these drawings.
[0032] Figure 1 A flowchart of a power consumption plan prediction method based on GAT-TCN in Embodiment 1. DETAILED DESCRIPTION
[0033] In order to make the above-mentioned objects, features and advantages of the present application more apparent and understandable, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0034] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, but the present application can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without departing from the connotation of the present application, therefore the present application is not limited to the specific embodiments disclosed below.
[0035] Embodiment 1, refer to Figure 1 , the first embodiment of the present application provides a power consumption plan prediction method based on GAT-TCN, which comprises, as shown in Figure 1
[0036] Step S1: collecting subject data and historical transaction data of power transaction subjects, establishing a node feature matrix according to the subject data, constructing a time series according to the transaction data, and forming graph structure data.
[0037] Specifically, establishing the node feature matrix comprises extracting static and dynamic features in the subject data, normalizing all features, and encoding them into fixed-dimension feature vectors in a unified format, and arranging them in order according to the subject to form the node feature matrix.
[0038] The node feature matrix X is represented as,
[0039] X∈R N*d
[0040] Wherein, N is the number of participants, d is the feature dimension, R N*d is a matrix containing N nodes, each node has d-dimensional features.
[0041] According to the transaction data, the time series is constructed, which comprises aligning the transaction data in time sequence to form a fixed-length time window sequence; and vectorizing the data at each time to form a three-dimensional time series matrix by stacking in order.
[0042] The time sequence T is represented as,
[0043] T∈R N*L*m
[0044] wherein L is a time step, m is a number of transaction indexes, R N*L*m is a three-dimensional time sequence matrix containing N, L, and m.
[0045] Step S2: modeling the node feature matrix using a graph attention mechanism, calculating attention weights for any two adjacent nodes in the graph, updating the center node by concatenating node features, weighted summation, and an activation function, and outputting spatial feature representation.
[0046] Specifically, calculating the attention weight e ij is represented as,
[0047] e ij = LeakyReLU(a T [Wx i ||Wx j ])
[0048] wherein LeakyReLU is a leaky rectified linear function, W∈R d′*d is a learnable parameter matrix, a T ∈R 2d' is an attention vector, || is a concatenation operation, R d′*d is a linear transformation weight matrix, d' is the target feature dimension after conversion, R 2d' is a vector of length 2d', x i is the input of node i, and x j is the input of node j.
[0049] After calculating each e ij , a softmax function needs to be applied on the neighbor nodes of node i to standardize and obtain the final attention weight α ij , and the weight normalization is represented as,
[0050]
[0051] wherein α ij is the normalized weight, and N(i) is the neighbor node set of node i.
[0052] The updated feature h i ' of node i is calculated as,
[0053] h i ' = σ(Σ j∈N(i) αij Wx j )
[0054] wherein, σ is an activation function.
[0055] So, h i is the new feature representation of node i, which is obtained by weighted summation of the features of neighbor nodes and the corresponding attention weights.
[0056] Step S3: long-term dependence features of the time series are extracted by using a time convolution network, and time feature representation is output.
[0057] Specifically, the electricity price data in the transaction market has certain periodicity and volatility, and TCN is a general convolutional neural network architecture for processing time series problems. It is composed of a group of residual module connections. Using residual connections can effectively train deep networks. The residual module contains a one-dimensional dilated causal convolution unit, which can make the convolutional neural network well grasp the time information of the electricity price feature sequence.
[0058] Extracting long-term dependence features of the time series by using the time convolution network includes performing causal dilated convolution on the lth layer output of the time series T (l) is expressed as,
[0059] T (l) = ReLU(Φ (l) *T (l-1) +b (l) )
[0060] wherein, ReLU is a ReLU activation function, Φ (l) is a convolution kernel with a dilation coefficient of 2 l , * represents a dilated convolution operation, T (l-1) is the (l-1)th layer output causal dilated convolution of the time series T, and b (l) is the bias of the lth layer output.
[0061] Residual connection is performed, and the information across layers is represented as,
[0062] T out = T (l) + T (l-1)
[0063] wherein, T out is the output after residual connection; the residual connection can prevent gradient disappearance in deep networks to preserve multi-time granularity features.
[0064] Step S4: the output spatial feature representation and the time feature representation are aligned along the time axis and spliced, and input to a fully connected prediction layer to output continuous electricity consumption plan prediction values.
[0065] Specifically, outputting the continuous electricity consumption plan prediction value includes splicing the spatial feature representation and the time feature representation into a high-dimensional space-time feature; performing a fully connected prediction layer to map the spliced high-dimensional space-time feature to a prediction target space, output a multi-class probability distribution, and quantify the probability of different behaviors.
[0066] Data output by GAT and TCN:
[0067] H GAT ∈R N*d'
[0068] H GAT is a spatial feature representation.
[0069] H TCN ∈R N*L*d”
[0070] H TCN is a time feature representation.
[0071] H GAT is then aligned and spliced with H TCN along the time axis:
[0072] H fuse = [H GAT ||H TCN [:, t, :]] (t = 1, 2, …, L)
[0073] H fuse ∈R N×(d'+d”) .
[0074] A fully connected prediction layer is performed to map the fused high-dimensional space-time feature H fuse to a prediction target space, and a Softmax function is used to output a multi-class probability distribution to intuitively quantify the possibility of different behaviors:
[0075]
[0076] H p ∈R C*(d'+d”) is a fully connected layer weight matrix, C is the number of prediction categories, b p ∈R C is a fully connected layer bias term, is a behavior probability distribution at time t (such as the probability of different price intervals).
[0077] The prediction result represents the probabilities of the decision being a high-price, medium-price, and low-price strategy, respectively. high mid low .
[0078] The market participant behavior prediction model is trained using historical data and calibrated through a cross-validation method to ensure the accuracy and stability of the model.
[0079] Embodiment 2, which is different from the first embodiment, is a power consumption plan prediction system based on GAT-TCN, comprising a data acquisition and processing module, a spatial feature output module, a time feature output module, and a power consumption plan prediction module; the data acquisition and processing module is used to acquire subject data and historical transaction data of the power transaction subject, establish a node feature matrix according to the subject data, construct a time sequence according to the transaction data, and form graph structure data; the spatial feature output module is used to model the node feature matrix by using a graph attention mechanism, calculate attention weights for any two adjacent nodes in the graph, update a center node by splicing node features, weighted summation, and an activation function, and output spatial feature representation; the time feature output module is used to extract long-term dependence features of the time sequence by using a time convolution network, and output time feature representation; the power consumption plan prediction module is used to align and splice the output spatial feature representation and the time feature representation along a time axis, input them into a fully connected prediction layer, and output continuous power consumption plan prediction values.
[0080] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the present application that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0081] The logic and / or steps represented in the flow diagrams or otherwise described herein, for example, can be considered as a sequence of executable instructions, and can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. In the context of this specification, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium.
[0082] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example via an optical scanner, then compiled, interpreted, or otherwise processed, and stored in a computer memory in a form that can be later executed by a computer.
[0083] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any of the following technologies, which are known in the art, can be used: a combination of discrete logic circuits having logic gates for implementing logic functions upon data signals, application specific integrated circuits having logic gates, field programmable gate arrays (FPGA), programmable logic arrays (PLA), and the like.
[0084] It should be noted that the above-mentioned embodiments are merely used to illustrate the technical solutions of the present application but not limit the present application, and although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or equivalent replaced without departing from the spirit and scope of the present application, and all the modifications and equivalent replacements should be covered in the scope of the claims of the present application.
Claims
1. A GAT-TCN based electricity consumption plan prediction method, characterized in that: The method comprises the following steps: The node feature matrix is established according to the subject data, and the time sequence is constructed according to the transaction data to form the graph structure data; The node feature matrix is modeled by using the graph attention mechanism, the attention weight is calculated for any two adjacent nodes in the graph, the center node is updated by splicing the node features, weighted summation and activation function, and the spatial feature representation is output; The long-term dependence feature of the time sequence is extracted by using the time convolution network, and the time feature representation is output; The spatial feature representation and the time feature representation are aligned and spliced along the time axis, and input into the full connection prediction layer to output the continuous electricity plan prediction value.
2. The GAT-TCN-based electricity consumption plan forecasting method of claim 1, wherein: The node feature matrix is established according to the subject data, and the time sequence is constructed according to the transaction data to form the graph structure data; 3. The GAT-TCN-based electricity consumption plan forecasting method of claim 2, wherein: The transaction data is aligned in time sequence to form a fixed-length time window sequence; Each moment of data is vectorized and stacked in sequence to form a three-dimensional time sequence matrix. The node feature matrix X is represented as 4. The GAT-TCN-based electricity consumption plan forecasting method of claim 3, wherein: The time sequence T is constructed according to the transaction data, and represented as X e R N*d where N is the number of participants, d is the feature dimension, R N*d is a matrix containing N nodes, each node having d-dimensional features; The center node is updated by splicing the node features, weighted summation and activation function, and the spatial feature representation is output. T e R N*L*m where L is the time step, m is the number of trading indicators, R N*L*m is a three-dimensional time series matrix containing N, L, m.
5. The GAT-TCN based electricity consumption schedule prediction method of claim 4, wherein: The computing attention weights comprises, for each pair of adjacent nodes (i, j), computing an attention weight e ij is represented as, e ij = LeakyReLU(a T [Wx i || Wx j ]) where LeakyReLU is a linear rectifier function with leakage, W ∈ R d′*d is a learnable parameter matrix, a T ∈ R 2d' is an attention vector, || is a concatenation operation, R d′*d is a linear transformation weight matrix, d' is the dimension of the converted target feature, R 2d' is a vector of length 2d', x i is the input of node i, x j is the input of node j; Wherein, σ is the activation function. wherein a ij is the normalized weight, N(i) is the set of neighbor nodes of node i; The updated feature h i is computed as, h i ' = σ(∑ j∈N(i) α ij Wx j ) The long-term dependence feature of the time sequence is extracted by using the time convolution network, and the time feature representation is output.
6. The GAT-TCN based electricity consumption schedule prediction method of claim 5, wherein: Residual connection is performed, and the information is transmitted across layers. The causal dilated convolution T of the l-th layer on the time series T (l) is represented as, T (l) = ReLU(Φ (l) * T (l-1) + b (l) ) wherein ReLU is a ReLU activation function, Φ (l) is a convolution kernel with an expansion coefficient of 2 l , * represents an expanded convolution operation, T (l-1) is a causal expanded convolution of the (l-1)-th layer output of the time series T, b (l) is a bias of the l-th layer output; The spatial feature representation and the time feature representation are spliced into high-dimensional spatio-temporal features. T out = T (l) + T (l-1) where T out is the output after residual connection.
7. The GAT-TCN-based electricity consumption plan forecasting method of claim 6, wherein: The full connection prediction layer is performed, the spliced high-dimensional spatio-temporal features are mapped to the prediction target space, the multi-class probability distribution is output, and the probability of different behaviors is quantified. The method comprises the following steps: The data acquisition and processing module is used for acquiring the subject data and historical transaction data of the power transaction subject, establishing the node feature matrix according to the subject data, constructing the time sequence according to the transaction data, and forming the graph structure data; 8. A GAT-TCN-based electricity consumption plan prediction system, applying a GAT-TCN-based electricity consumption plan prediction method according to any one of claims 1-7, characterized in that: The spatial feature output module is used for modeling the node feature matrix by using the graph attention mechanism, calculating the attention weight for any two adjacent nodes in the graph, updating the center node by splicing the node features, weighted summation and activation function, and outputting the spatial feature representation; The time feature output module is used for extracting the long-term dependence feature of the time sequence by using the time convolution network, and outputting the time feature representation; The electricity plan prediction module is used for aligning and splicing the output spatial feature representation and the time feature representation along the time axis, inputting into the full connection prediction layer, and outputting the continuous electricity plan prediction value. The processor executes the computer program to realize the steps of the electricity plan prediction method based on GAT-TCN in any one of claims 1 to 7. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is characterized in that: 10. A computer readable storage medium having stored thereon a computer program, characterized in that: The computer program, when executed by a processor, implements the steps of the GAT-TCN-based power consumption plan prediction method of any one of claims 1 to 7.