A power grid node carbon factor prediction method based on directed power flow graph convolution network
Patent Information
- Application Number
- CN202611052166.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-15
- Publication Date
- 2026-09-29
AI Technical Summary
[0005]本发明实施例提供一种基于有向潮流图卷积网络的电网节点碳因子预测方法,可以解决现有技术中,存在的问题
本发明通过构建基于电网节点相角差的有向潮流图卷积网络,在特征提取时,以电网节点之间的电压相角差作为判定有功潮流方向的物理依据,构建出流与入流两个独立的有向邻接子矩阵,使图卷积运算严格遵循"碳流跟随有功潮流单向传播"的碳排放流理论基本物理规律,此时在每一次图卷积网络的信息聚合过程中,每个电网节点仅能从其物理上游(即入流方向)接收碳素注入影响,并仅能向其物理下游(即出流方向)传递自身碳势影响,碳素不再像现阶段技术所构建的无向静态邻接矩阵那样沿支路双向"扩散",而是按照实际功率传输方向进行"流动",基于此所得到节点空间表征向量中的每一个维度数值,都能将该电网节点在当前电网分布下,从上游碳源接收到的累积碳影响与向下游碳汇传递的碳势贡献进行定量刻画,从而将碳流在多个环形路径中的定向分流与汇合在物理定律上进行精确建模并准确刻画各路径碳势贡献,最终实现高精度的进行电网节点碳因子预测。
Smart Images

Figure CN122840975A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy consumption prediction technology, and in particular to a method, apparatus, device and medium for predicting the carbon factor of power grid nodes based on a directed power flow graph convolutional network. Background Technology
[0002] Driven by the "dual carbon" strategy, accurate spatiotemporal perception of carbon emission factors (hereinafter referred to as carbon factors) at the node level of the power system has become the core foundation for coordinated low-carbon dispatching of power generation, grid, load and storage. The current mainstream calculation paths are divided into two categories: one is the emission factor method, which relies on the static unified factor issued by the state multiplied by the electricity consumption of the node. Its essence is a weighted average of all units in the region, which completely ignores the real-time impact of unit type, operating conditions and start-up and shutdown differences on carbon emission intensity. The other is the macro-statistical method, which uses the average intensity of the entire network at a fixed time period as a constant to allocate to each node. This method assumes that the carbon emission intensity is uniform in space and constant in time, and cannot reflect the spatial transfer effect caused by power flow distribution and the temporal dynamics caused by the fluctuation of new energy sources.
[0003] To overcome the limitations of the above approaches, researchers proposed a power flow-based carbon emission analysis method, treating carbon emissions as a virtual flow propagating in the power grid alongside active power flow, and establishing a quantitative correlation between generator carbon emissions and node loads. However, this theory is essentially a post-hoc accounting method based on steady-state power flow, and cannot make forward-looking predictions of node carbon factors in future periods. With the widespread application of deep learning in spatiotemporal data modeling, researchers have begun to introduce neural network frameworks into the calculation and prediction of electrical carbon factors, achieving data-driven estimation of node-level carbon factors by jointly extracting the topological spatial characteristics of the power grid and the temporal evolution law of the load.
[0004] The most widely adopted approach in existing research is the real-time carbon factor calculation method for distribution networks based on graph convolutional networks (GCNs). Its core is to use GCNs to extract grid topology connection information and aggregate features between nodes, ultimately identifying the aggregated features to predict the carbon factor of power system nodes. Current GCN technologies typically use undirected static adjacency matrices to construct the graph structure, treating branches as bidirectional symmetrical connections. Mathematically, this undirected static adjacency matrix and its corresponding symmetrical aggregation operation statically propagate the carbon factor information of each node to all adjacent nodes without differentiation. This is equivalent to allowing bidirectional flow of carbon factor information along branches. However, carbon flow is a strict vector field accompanying active power flowing from leading to lagging nodes. In a ring network structure, this undirected aggregation can lead to the erroneous backpropagation of emission information from upstream high-carbon units to physically unaffected branch nodes. This results in the loss of the actual directionality of carbon flow during spatial propagation, causing non-causal physical confusion and leading to huge errors in the model's prediction results that violate physical laws. Ultimately, it is difficult to achieve high-precision prediction of grid node carbon factors. Summary of the Invention
[0005] This invention provides a method for predicting the carbon factor of power grid nodes based on a directed power flow graph convolutional network, which can solve the problems existing in the prior art.
[0006] This invention provides a method for predicting the carbon factor of power grid nodes based on a directed power flow graph convolutional network, comprising the following steps: Acquire measurement data of each power grid node within the target power grid at multiple historical moments; The measurement data is input into a pre-trained carbon factor prediction model, which includes a cascaded directed adjacency matrix construction module, a multi-channel graph convolution module, and an LSTM temporal coding module. The directed adjacency matrix construction module calculates the phase angle difference between the two ends of the power grid nodes of any branch in the target power grid based on measurement data for each historical moment. When the phase angle difference is greater than a preset positive threshold, it is determined that the active power flows from the first node to the last node, and the corresponding branch belongs to the outflow channel. All branches belonging to the outflow channel are identified, and the outflow adjacency submatrix is constructed using the absolute value of the phase angle difference as the edge weight. When the phase angle difference is less than a preset negative threshold, it is determined that the active power flows from the last node to the first node, and the corresponding branch belongs to the inflow channel. All branches belonging to the inflow channel are identified, and the inflow adjacency submatrix is constructed using the absolute value of the phase angle difference as the edge weight. Other branches in the target power grid are assigned to self-loop channels to construct a self-loop adjacency submatrix. The multi-channel graph convolution module performs graph convolution operations on the outflow adjacency submatrix, inflow adjacency submatrix, and self-loop adjacency submatrix respectively to obtain outflow aggregation features, inflow aggregation features, and self-loop retained features, and then performs weighted summation to obtain the node space representation vector at the current historical moment, as well as the node space representation vector at each historical moment. The LSTM time-series coding module performs sequential modeling of the node spatial representation vectors at each historical moment in the time dimension to obtain the predicted value of the grid node carbon factor at the next moment.
[0007] Preferably, the acquisition of the outflow aggregation characteristics, inflow aggregation characteristics, and self-loop retention characteristics includes: When performing graph convolution operation on the outflow adjacency submatrix, the carbon propagation carbon value received by each grid node in the outflow adjacency submatrix from its downstream neighboring grid nodes is extracted to form outflow aggregation features. When performing graph convolution operation on the inflow adjacency submatrix, the carbon aggregation carbon value received by each grid node in the inflow adjacency submatrix from its upstream neighbor grid node is extracted to form inflow aggregation features. When performing graph convolution on the self-loop adjacency submatrix, the input features of each power grid node within the self-loop adjacency submatrix are preserved through independent linear transformations to form self-loop preserved features.
[0008] Preferably, obtaining the node spatial representation vector at the current historical moment includes: The outflow aggregation features, inflow aggregation features, and self-loop retention features are input into the node-level gated fusion network. The node-level gated fusion network uses the original input features of each power grid node at the current historical moment as a condition, and calculates the weight coefficients corresponding to the outflow channel, inflow channel, and self-loop channel for each power grid node independently through a multilayer perceptron. The three weight coefficients are then normalized to ensure that the sum of the three weights of the same power grid node is equal to the unit value. Based on the weight coefficients of the three channels after normalization constraints, the outflow aggregation features, inflow aggregation features, and self-loop retention features are weighted and fused to obtain the node space representation vector of the current historical moment.
[0009] Preferably, obtaining the predicted value of the carbon factor of the power grid node at the next moment includes: The node spatial representation vectors at each historical moment are arranged in temporal order and input into the parallel-running short-branch long short-term memory network and long-branch long short-term memory network, respectively. The short-branch long short-term memory network takes the continuous time sequence sampled hourly at the original sampling interval as input, and updates the network state through time step iteration to capture the nonlinear dynamic characteristics of carbon factor caused by intraday load peak and valley fluctuations, generator start and stop regulation and short-term power fluctuations of new energy, and outputs short-time encoded features. Long-branch long short-term memory network takes a sequence covering a week as input and expands the actual time span corresponding to each time step by downsampling in order to capture the differences in electricity consumption patterns between weekdays and rest days, the periodic scheduling patterns within the week, and the trend evolution characteristics of carbon factors caused by meteorological changes, thus obtaining long-time coding features. Short-time-series coding features and long-time-series coding features are concatenated along the feature dimension to form joint-time-series coding features. The joint-time-series coding features are then input into a multilayer perceptron (MLP) to map and obtain the predicted value of the carbon emission factor of the power grid node at the next time step.
[0010] Preferably, before arranging the node spatial representation vectors of each historical moment in temporal order and inputting them into the parallel-running short-branch long short-term memory network and long-branch long short-term memory network, the method further includes temporal feature enhancement of the node spatial representation vectors of each historical moment, including: A sinusoidal position coding based on time lag is adopted, and the actual time difference between each historical moment and the current prediction moment is used as the independent variable to perform a sinusoidal transformation to generate the sinusoidal position coding of the node spatial representation vector of each historical moment. Learnable static attribute embedding vectors for each power grid node are introduced to encode the inherent electrical role information of the power grid node, generating node static attribute embeddings of node spatial representation vectors at each historical moment. The original node spatial representation vectors at each historical moment are concatenated with the corresponding sinusoidal position codes and node static attributes embedded in the feature dimension to generate enhanced node spatial representation vectors at each historical moment. These enhanced node spatial representation vectors are then arranged in temporal order and input into the parallel-running short-branch long short-term memory network and long-branch long short-term memory network.
[0011] Preferably, the process of obtaining the predicted value of the carbon emission factor of the grid node at the next moment further includes correcting the predicted value of the carbon emission factor of the grid node, including: A gradient boosting decision tree correction model is constructed, with the identification information of power grid nodes in encoded form as input features. The residual between the basic predicted value of the carbon emission factor of the power grid node at the next time step output by the LSTM time-series coding module and the actual value of the carbon emission factor of the power grid node at the next time step in the training data is used as the optimization objective to train the gradient boosting decision tree correction model. The identification information of the power grid nodes includes the measurement features of each power grid node at the current time step, the time period code at the current time step, and the unique heat identification code of each power grid node. During the training of the gradient boosting decision tree correction model, the measurement features of each power grid node at the current time, the time period code at the current time, and the one-hot identifier code of each power grid node are used as input features, and the residuals are used as supervision labels to train the gradient boosting decision tree correction model. The measurement characteristics of each power grid node at the current moment, the time period code of the current moment, and the unique heat identification code of each power grid node are input into the trained gradient boosting decision tree correction model, and the estimated value of the residual for the next moment is output. The basic predicted value of the carbon emission factor of the power grid node at the next moment is added to the estimated value of the residual for the next moment to obtain the final predicted value of the carbon emission factor of the power grid node at the next moment.
[0012] Preferably, the measurement data includes the voltage phase angle, active power, reactive power, load demand, and generator output information of each power grid node.
[0013] This invention also provides a power grid node carbon factor prediction device based on a directed power flow graph convolutional network, comprising: The data module is used to acquire measurement data of each power grid node in the target power grid at multiple historical moments; The model module is used to input measurement data into a pre-trained carbon factor prediction model, which includes a cascaded directed adjacency matrix construction module, a multi-channel graph convolution module, and an LSTM temporal coding module. The feature extraction module and the directed adjacency matrix construction module calculate the phase angle difference between the two ends of the power grid nodes of any branch in the target power grid based on measurement data for each historical moment. When the phase angle difference is greater than a preset positive threshold, it is determined that the active power flows from the first node to the last node, and the corresponding branch belongs to the outflow channel. All branches belonging to the outflow channel are identified, and the outflow adjacency submatrix is constructed using the absolute value of the phase angle difference as the edge weight. When the phase angle difference is less than a preset negative threshold, it is determined that the active power flows from the last node to the first node, and the corresponding branch belongs to the inflow channel. All branches belonging to the inflow channel are identified, and the inflow adjacency submatrix is constructed using the absolute value of the phase angle difference as the edge weight. Other branches in the target power grid are assigned to self-loop channels to construct a self-loop adjacency submatrix. The multi-channel graph convolution module performs graph convolution operations on the outflow adjacency submatrix, inflow adjacency submatrix, and self-loop adjacency submatrix respectively to obtain outflow aggregation features, inflow aggregation features, and self-loop retained features, and then performs weighted summation to obtain the node space representation vector at the current historical moment, as well as the node space representation vector at each historical moment. The prediction module, namely the LSTM time-series coding module, performs sequential modeling of the node spatial representation vectors at each historical moment in the time dimension to obtain the predicted value of the grid node carbon factor at the next moment.
[0014] This invention also provides an electronic device, including a memory and a processor; The memory is used to store computer programs; When the processor executes the computer program stored in the memory, it implements the steps of the method for predicting the carbon factor of a power grid node based on a directed power flow graph convolutional network as described in any one of claims 1 to 7.
[0015] This invention also provides a computer-readable storage medium, characterized in that it is used to store a computer program, which, when executed by a processor, implements the steps of a method for predicting the carbon factor of a power grid node based on a directed power flow graph convolutional network as described in any one of claims 1 to 7.
[0016] This invention provides a method for predicting the carbon factor of power grid nodes based on a directed power flow graph convolutional network. Compared with the prior art, its advantages are as follows: This invention constructs a directed power flow graph convolutional network based on the phase angle difference between power grid nodes. During feature extraction, the voltage phase angle difference between power grid nodes is used as the physical basis for determining the direction of active power flow. Two independent directed adjacency sub-matrices are constructed for outflow and inflow, ensuring that the graph convolution operation strictly follows the fundamental physical law of carbon emission flow theory: "carbon flow follows active power flow and propagates unidirectionally." Therefore, in each information aggregation process of the graph convolutional network, each power grid node can only receive carbon injection influence from its physical upstream (i.e., the inflow direction) and can only transmit its own carbon potential influence to its physical downstream (i.e., the outflow direction). Carbon no longer "diffused" bidirectionally along branches as in the undirected static adjacency matrix constructed by current technology, but "flowed" according to the actual power transmission direction. Based on this, the value of each dimension in the node space representation vector can quantitatively characterize the cumulative carbon impact received by the grid node from the upstream carbon source and the carbon potential contribution transferred to the downstream carbon sink under the current grid distribution. This allows for precise modeling of the directional splitting and merging of carbon flow in multiple ring paths based on physical laws, accurately characterizing the carbon potential contribution of each path, and ultimately achieving high-precision prediction of the carbon factor of grid nodes. Attached Figure Description
[0017] Figure 1 A schematic diagram of the overall framework of the principle algorithm provided in the embodiments of the present invention. Detailed Implementation
[0018] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0019] Under the "dual-carbon" strategy, accurate measurement of nodal-level carbon emission factors (hereinafter referred to as carbon factors) in the power system is a key foundation for coordinated low-carbon dispatching of power generation, grid, load, and storage. Existing statistical methods largely rely on macro-level emission factors of generating units or static average values of the entire grid over a period of time. Specifically, current mainstream carbon emission accounting methods mainly employ two paths: the emission factor method and the macro-statistical method. At the emission factor method level, the carbon factor is typically calculated by multiplying the national or regionally published emission factor by the electricity consumption of each node. This factor is essentially a weighted average of the carbon emission intensity of all generating units within the region, ignoring the real-time impact of differences in fuel type, operating condition fluctuations, and start-up / shutdown status on the nodal carbon factor. At the macro-statistical method level, the entire grid is often used as the statistical caliber to calculate the average carbon emission intensity over a fixed period and distribute it as a constant to each node. This method assumes that the carbon emission intensity of the entire grid is spatially uniform and temporally constant, failing to reflect the spatial transfer effect of carbon emissions caused by grid power flow distribution, and also failing to capture the temporal dynamics of nodal carbon factors caused by fluctuations in renewable energy output, load peak-valley changes, and differences in grid loss distribution.
[0020] The power flow-based carbon emission flow analysis method enables the calculation of nodal-level carbon factors. Its theoretical foundation is the carbon flow theory, which was proposed by Kang Chongqing et al. in 2011. This theory treats carbon emissions as a virtual flow that propagates in the power grid along with active power flow, and establishes a quantitative correlation between generator carbon emissions and nodal loads. Its core is that carbon emissions are not only generated on the generation side, but also propagate along branches in the form of carbon flow density with the transmission and distribution of electrical energy, and are ultimately consumed by users at load nodes along with electrical energy. The theory defines three core elements: branch carbon flow rate, branch carbon flow density, and nodal carbon potential, which reflect the influence of power flow distribution on nodal carbon factor distribution.
[0021] However, carbon flow theory faces significant limitations in practical applications, especially in carbon factor prediction tasks. The theory itself lacks predictive power; carbon flow theory is essentially a post-event accounting method based on steady-state power flow, which cannot use historical data to make forward-looking predictions of nodal carbon factors in future periods, making it difficult to support the coordinated optimization scheduling of power generation, grid, load, and storage. With the widespread application of deep learning in spatiotemporal data modeling, some studies have begun to introduce neural network frameworks into the calculation and prediction of electrical carbon factors, achieving data-driven estimation of nodal carbon factors by jointly extracting grid topology spatial features and load temporal evolution patterns.
[0022] Researchers have used a three-layer fully connected network to predict the electric carbon factor in small-scale test systems such as IEEE 9-node and 39-node systems. This method treats each node as an independent sample and establishes an end-to-end mapping from input features to carbon factors, completely ignoring the topological connections and electrical coupling characteristics between power grid nodes, and thus failing to characterize the spatial propagation mechanism of carbon flow in the power grid. In addition, the number of parameters in the fully connected network expands linearly with the number of nodes, and its experimental verification is limited to very small-scale systems. When facing large-scale power grids such as IEEE 118-node systems, its generalization ability and scalability are severely insufficient. Moreover, this method does not have the ability to sense the direction of power flow, and it is difficult to reflect the differentiated distribution of carbon factors along different flow branches.
[0023] Other researchers have proposed a real-time carbon factor calculation method for distribution networks based on graph convolutional networks (GCNs). This method uses GCNs to extract grid topology connection information and achieve feature aggregation between nodes. However, this method uses an undirected static adjacency matrix to construct the graph structure and treats branches as bidirectional symmetrical connections. It fails to use physical measurements such as node phase angle differences to characterize the actual directionality of power flow, resulting in the inability to distinguish the outflow and inflow propagation paths of carbon factors in the grid. In addition, this work mainly focuses on real-time steady-state calculation scenarios for power grids and has not yet verified the extrapolation capability of the model under time series prediction tasks.
[0024] Other researchers have proposed an SSA-CNN-LSTM framework for predicting carbon factors at power system nodes, using CNN to extract spatial features, LSTM for temporal modeling, and the Sparrow Search algorithm (SSA) to optimize hyperparameters. However, CNNs are inherently more suitable for Euclidean structure data such as images and regular grids, and their convolution operations rely on regular neighborhoods and fixed arrangements. Power grids, on the other hand, have typical non-Euclidean graph structure characteristics, where the connections between nodes are determined by line topology, electrical distance, and power flow coupling. If power grid state data is directly serialized or gridded and input into a CNN, artificial neighborhood relationships are easily introduced, resulting in insufficient representation of real topological connections, electrical distances, and node coupling information, thus limiting its ability to extract complex power grid structure features. The Sparrow Search algorithm only performs peripheral optimization at the training strategy level and does not change the inherent defect of the network architecture itself ignoring the physical operation mechanism of the power grid. At the same time, this method lacks directed graph modeling and node-level residual correction mechanisms, and cannot solve the prediction bias problem caused by differences in generator connection location, load fluctuation characteristics, and new energy penetration rates among different nodes.
[0025] In summary, none of the methods proposed by existing researchers have simultaneously solved the core problems of topological directionality characterization and temporal multi-scale dynamic modeling, making it difficult to meet the demand for high-precision prediction of carbon factors at the node level in large-scale power grids.
[0026] Based on this, this invention proposes a method for predicting the carbon factor of power grid nodes, aiming to improve prediction accuracy and model physical interpretability. It employs a three-stage cascaded architecture of GCN-LSTM-XGBoost, such as... Figure 1 As shown, the carbon emission factor of a power grid node is constrained by power flow propagation and has a directional distribution characteristic in the topological space. Therefore, in the first stage, a multi-channel directed graph convolutional network is constructed. A dynamic directed adjacency matrix is constructed based on the phase angle difference of the nodes, and outflow channels, inflow channels, and self-loop channels are established respectively. The naming of the three channels originates from the physical orientation characteristics of the active power flow of the power system. According to the approximate relationship of DC power flow, active power flows from nodes with higher phase angles to nodes with lower phase angles. Therefore, the edge pointing from a node to its neighbor with a lower phase angle is defined as the outflow channel, which represents the node's ability to propagate the carbon emission factor to the external grid as a carbon source. The edge pointing from a node to its neighbor with a higher phase angle is defined as the inflow channel, which represents the node's ability to receive the influence of upstream carbon flow injection as a carbon sink. The introduction of the self-loop channel is based on the physical necessity of graph convolution message passing. If neighborhood aggregation is only performed through outflow and inflow edges, the nodes will gradually smooth out and lose their inherent local electrical properties after multi-layer propagation. The self-loop edge allows the node to retain and strengthen its own characteristics during the topological convolution process, ensuring that the carbon emission factor prediction reflects both the topological diffusion effect of the neighborhood carbon flow and does not obscure the essential attributes of the node itself. Subsequently, the weights of the three channels are adaptively allocated through a node-level gating fusion mechanism to extract the spatial propagation characteristics and directional coupling relationship of carbon flow in the power grid topology.
[0027] The power grid's operating status exhibits strong temporal correlation, and electricity load and renewable energy output display typical daily (24-hour) and weekly (168-hour) multi-scale fluctuation characteristics. GCN alone is insufficient to characterize the dynamic evolution and multi-frequency coupling patterns of carbon factors over time. Therefore, the second stage introduces a dual-scale Long Short-Term Memory (LSTM) network. The short-scale model samples intraday data hourly to characterize the short-term nonlinear dynamics of daily load fluctuations and unit regulation. The long-scale model downsamples and covers a week's worth of historical data to capture the weekly trend evolution driven by differences between weekdays and weekends. Furthermore, as an end-to-end deep learning model, GCN-LSTM is still prone to systematic biases when facing grid node heterogeneity, extreme operating conditions, or nonlinear abrupt changes. The residuals often contain structured information that can be further explored. Therefore, the third stage uses the XGBoost gradient boosting framework to fit the previous stage prediction residuals. The input features of the GCN-LSTM model at time t and the predicted values of the first stage model are used as XGBoost inputs, and the residuals at time t+1 are used as labels for training. By leveraging the modeling capabilities and node-level independent correction characteristics of XGBoost, a second improvement in prediction accuracy and fine compensation for heterogeneity bias are achieved. Dynamic directed graph convolution is used to characterize the spatial propagation directionality of carbon factors, dual-scale temporal coding is used to capture the evolution law of multi-time granularity, and residual cascade correction is used to reduce systematic errors and prediction imbalances between nodes. Finally, high-precision and high-fairness prediction of carbon factors at the node level is achieved.
[0028] This invention embeds the physical mechanisms of power grid carbon emission flow theory into four levels: graph structure, feature engineering, temporal modeling, and residual correction. This transforms the model from a simple data fitting black box into a computational framework with physical semantics. First, at the graph topology level, the invention dynamically constructs a directed adjacency matrix based on real-time branch power flow symbols, strictly adhering to the fundamental assumption of carbon flow following power flow in carbon emission flow theory. Simultaneously, the multi-channel directed graph convolutional layer is explicitly decomposed into three physical channels: outward propagation, inward aggregation, and self-loop retention. An adaptive node-level gating mechanism is introduced, enabling pure load nodes to automatically rely on upstream carbon potential injection and power generation nodes to automatically enhance local emission characteristics, thereby embedding the carbon potential formation mechanisms of different electrical roles into the network parameters. Second, at the input feature level, net... The three types of flow direction features—flow rate, absolute flow rate, and flow asymmetry—directly correspond to the physical information of Kirchhoff's current law and power distribution equation, providing physically meaningful prior information for graph neural networks. The time-series coding adopts a long-short dual-branch structure, with the long branch capturing slowly changing trends and the short branch tracking rapidly changing components such as intraday scheduling and renewable energy fluctuations. Time information is preserved through sinusoidal position coding, achieving decoupling of multi-scale physical cycles. In summary, this invention, through the collaborative design of dynamic power flow orientation, multi-channel physical decomposition, electrical feature embedding, multi-scale time-series decoupling, and node-level residual correction, enables the model's internal weights, gating coefficients, and adjacency matrix to reflect physical narratives, significantly improving the physical interpretability of deep learning models in power grid carbon factor prediction tasks.
[0029] Specifically, it includes: Step 1: Spatial feature extraction.
[0030] The GCN Block consists of three cascaded multi-channel directed graph convolutional layers. Each layer contains three parallel channels: GCN OUT (outflow channel), GCN IN (inflow channel), and GCN SELF (self-loop channel); node phase angle It contains information about the amplitude and direction of branch power flow: In simplified DC power flow, the phase angle difference is proportional to the power flow; the larger the phase angle difference, the stronger the branch power flow and the tighter the electrical coupling between nodes. Therefore, by using the absolute value of the phase angle difference as the edge weight and the sign of the phase angle difference to determine the power flow direction, a physically interpretable dynamic directed adjacency matrix can be constructed. , For any branch (i,j), calculate the phase angle difference. Given a threshold Define directed edges and The existence and weights are as follows: .
[0031] The matrix is calculated , Then, to avoid numerical instability and preserve the normalization properties of graph convolution, the outflow and inflow weights are normalized row-wise to obtain a normalized directed adjacency matrix: .
[0032] in: and These are the degree matrices for outflow and inflow, respectively; the self-loop channel retains node information through an identity matrix, mitigating over-smoothing during information aggregation; the three channels aggregate neighbor features through independent linear transformations: .
[0033] Then as Figure 1 As shown in the diagram, the fusion node labeled G represents the three channels whose outputs are adaptively weighted through a node-level gating fusion mechanism. The gating network uses the current input features of the node as a condition and generates normalized weights for the three channels through an MLP. , , and The weighted fusion yields the output of this layer: .
[0034] The three-layer gated graph convolution is concatenated layer by layer, with the output of the previous layer serving as the input of the next layer, ultimately outputting a node spatial representation. .
[0035] Step 2: Temporal feature extraction.
[0036] The LSTM time-series coding module employs a dual-scale parallel structure, simultaneously setting up long and short LSTM branches to decouple the physical characteristics of fast and slow dynamic coupling in the time series of power system carbon emission factors: the short branch focuses on local transient processes such as load fluctuations and unit start-up and shutdown, while the long branch captures slowly varying evolution patterns through step-size downsampling, thus avoiding the conflict between time domain resolution and long-range dependence in a single fixed window; to inject time position information, a sinusoidal position coding based on time lag is used to directly represent the time interval between this time step and the prediction time; for the l-th time slice of the long branch: .
[0037] For the l-th time slice of the short branch: .
[0038] in: The sine and cosine coding functions are used to represent the nodes output by the GCN module. Learnable node embeddings And, by concatenating the aforementioned time codes, the node input feature representation is constructed as follows: .
[0039] .
[0040] The input features are processed through two LSTM layers to obtain the output features. , After splicing, we get ;Will Inputting into an MLP, the MLP predicts the node's carbon emission factor at the next time step. .
[0041] By employing sinusoidal position coding based on time lag, historical sequences at different sampling frequencies are uniformly mapped to the same context of "actual time span from the prediction time," enhancing the model's ability to perceive the daily cycle peak and valley phases and correcting the time alignment deviation caused by differences in sampling intervals between long and short branches. Furthermore, learnable node static attributes are embedded and time lag coding is concatenated along the feature dimension to construct a composite input feature that integrates grid topology status, node identity, and time-series context information. This allows the time-series model to simultaneously perceive the current grid carbon flow distribution, the inherent electrical properties of the processed nodes, and the phase distance of the historical moment relative to the prediction target at each decoding step. This significantly reduces the difficulty for the model to decouple information from mixed signals, thereby improving the accuracy, physical interpretability, and overall node prediction fairness of node-level carbon emission factor prediction.
[0042] Step 3: Residual correction.
[0043] The XGBoost Block takes the residual between the base predictions from the first-stage model and the true labels as the optimization objective. This module consists of k gradient boosting decision trees, each taking node features, time encoding (hour, day of the week), and node identifiers as input, and fitting the residual gradient to each tree. The output of each tree is aggregated through summation nodes to obtain a residual correction value. This correction value is added to the base predictions from the first-stage model to achieve a second improvement in prediction accuracy, outputting the final node carbon factor prediction value. .
[0044] After standardization and preprocessing, the original measurement data of the model is input into the network along with the dynamic directed adjacency matrix, node embedding vectors, and sinusoidal temporal position encoding. The GCN Block extracts topological spatial features step by step. The LSTM Block encodes and fuses the long and short sequences respectively. The fused features are mapped through a Linear layer to obtain the base prediction values. The XGBoost Block performs gradient boosting correction based on the residuals of the base model. The training process adopts a phased strategy: the GCN-LSTM base model is trained end-to-end, and then the XGBoost correction model is trained with the prediction residuals of the base model on the training set as labels, finally achieving three-level collaborative optimization of space, time, and residuals.
[0045] The core of this invention lies in deeply embedding the physical operation mechanism of the power grid into a deep learning framework to construct a node-level carbon factor prediction system that combines physical interpretability with data-driven accuracy. Existing graph neural networks in power grid carbon factor prediction generally use undirected static adjacency matrices, treating branch connections as bidirectional symmetric relationships, which fails to reflect the actual directionality of power flow, leading to the loss of directional information during the spatial propagation of carbon factors. To address these shortcomings, this invention proposes a multi-channel directed graph convolutional network based on node phase angle differences. It constructs a dynamic directed adjacency matrix in real time using node voltage phase angles as the physical measurement basis. For any branch, the actual power flow direction is determined by calculating the phase angle difference: if the phase angle difference is greater than a set threshold, the power flow is determined to be from the first node to the last node, and the absolute value of the phase angle difference is weighted in the outflow channel adjacency matrix; otherwise, it is weighted in the inflow channel adjacency matrix. Self-loop channels retain node state information through an identity matrix. This adjacency matrix is dynamically updated with time steps, overcoming the limitation of traditional static adjacency matrices in failing to reflect the real-time operating state of the power grid. Within a single layer of graph convolution, three independent linear transformation channels are set. The system processes outflow, inflow, and self-loop information separately. Subsequently, based on the current input features of a node, a three-channel weight coefficient is generated for that node using a multilayer perceptron. The three weight coefficients satisfy normalization constraints, achieving adaptive topology perception node-by-node and level-by-level. This invention enables nodes in different electrical locations in the power grid to autonomously allocate their attention to outflow neighbors, inflow neighbors, and their own state, significantly improving the model's ability to characterize the heterogeneous topological coupling of nodes. Multilayer, multi-channel directed graph convolutions are sequentially connected, with the gated fusion output of the previous layer serving as the input of the next layer. Deep and stable training is achieved through layer normalization and regularization, breaking through the physical blind spot of traditional undirected graph convolutions in power grid power flow directionality modeling.
[0046] At the temporal modeling level, this invention employs a dual-scale long short-term memory network to capture weekly trends and intraday fluctuations respectively. Furthermore, it adds node embedding and time encoding to the input features based on the output of the GCN layer, significantly reducing the difficulty of decoupling information from mixed signals. The most crucial core lies in the third-stage residual correction module. Existing cascaded models typically use a globally uniform residual fitting strategy, ignoring the differences in electrical characteristics among different nodes: some nodes, due to their proximity to generators or load centers, exhibit systematic biases in prediction; others, due to fluctuations in renewable energy penetration rates, exhibit high variance in their residuals, making global correction ineffective in accurately compensating for node heterogeneity biases. To address this issue, this invention proposes a node-level independent residual correction mechanism based on XGBoost. Node identifiers are used as explicit input features in one-hot encoding, allowing the gradient boosting tree to naturally form node conditional branches during the splitting process, automatically learning independent correction modes for each node. Specifically, the XGBoost correction module uses standardized node measurement features, time period encoding, and node on-time encoding... The e-hot identifiers together constitute the input space. Gradient boosting training is performed using the prediction residuals of the GCN-LSTM base model on the training set as the optimization target. During the testing phase, the output residual correction value is added to the base model prediction value to achieve a second improvement in prediction accuracy. The technical significance of this invention is that, through node one-hot encoding, XGBoost can provide targeted compensation for systematic overestimation or underestimation of different nodes, solving some accuracy problems caused by oversmoothing during GCN propagation and lag in the response of LSTM to some abrupt changes. At the same time, for the tail samples that are most difficult for the base model to predict, such as when the output of new energy sources fluctuates drastically or when the topology is reconstructed, XGBoost significantly reduces the prediction accuracy of the error quantile tail through node-level residual gradient boosting. Thus, this invention cascades the topology perception capability of graph neural networks, the temporal modeling capability of long short-term memory networks, and the node-level fine-grained correction capability of gradient boosting trees in three levels, forming a closed loop of spatial, temporal, and residual synergistic optimization, and ultimately achieving high-precision and high-fairness prediction of the carbon factor of power grid nodes.
[0047] The outflow and inflow adjacency matrices in this invention are calculated and updated in real time based on the node phase angle data at the current moment, rather than using a pre-fixed static topology adjacency matrix. When any change occurs in the power grid operation mode, including but not limited to the rescheduling of generator output leading to a redistribution of power flow amplitude, the shutdown of a transmission line due to maintenance or fault leading to a change in topology connection, and the switching of tie lines leading to a reconfiguration of the power grid structure, the adjacency matrix automatically reflects the new power flow direction and coupling strength distribution in the graph convolution operation at the next moment through the synchronous change of phase angle data to respond in real time.
[0048] This invention uses the sign of the phase angle difference to determine the power flow direction and the absolute value of the phase angle difference to quantify the branch coupling strength, thereby constructing a directed adjacency matrix for outflow and inflow. However, from the perspective of the physical nature of power systems, the phase angle difference is only one of the observable state quantities reflecting the energy flow relationship between nodes, not the only state quantity. Any power grid operation data that can equivalently characterize the power flow direction between nodes can be used as the basis for graph partitioning, replacing the phase angle difference to complete graph construction without changing the overall model architecture and technical effect. Therefore, this invention can also be implemented through the following two graph partitioning methods:
[0049] Option 1: Graph partitioning based on active power flow of branches.
[0050] Technical principle: In AC power grids, the phase angle difference between nodes and the active power flow of branches have a strong physical coupling relationship. Therefore, the active power flow data of branches obtained by measurement or estimation can be directly used to replace the phase angle difference as the basis for graph division.
[0051] Implementation method: The power flow direction is determined by the active power flow symbol on the branch, and the normalized absolute value of the active power flow on the branch is used as the edge weight to construct a directed adjacency matrix. This scheme is completely equivalent to the phase angle difference scheme, and when the active power flow measurement is directly available, it avoids the indirect conversion error from phase angle to power flow.
[0052] Applicable scenarios: When the SCADA / PMU system directly provides branch active power measurement, or when the branch power flow accuracy in the state estimation results is higher than the phase angle estimation accuracy; In the transmission network, active power transmission is the dominant objective of grid operation, and the node carbon emission factor is mainly determined by the active power transmission path of large-capacity thermal power units and new energy power plants through the high-voltage backbone network; Both phase angle difference and active power flow can accurately characterize this transmission mechanism, so the original phase angle scheme and Scheme 1 are preferred for transmission network scenarios; In such scenarios, the two schemes are physically equivalent and can be flexibly interchanged according to the configuration of the measurement system.
[0053] Option 2: Graph partitioning based on power transfer distribution factor (PTDF).
[0054] Technical principle: PTDF (Power Transfer Distribution Factor) is a classic analysis tool for power systems. It is defined as the change in branch power flow caused by unit power exchange between nodes. The PTDF matrix encodes the topological coupling strength of active power transmission between nodes. Its physical meaning is highly consistent with the adjacency matrix constructed by phase angle difference, both reflecting the ease of power transmission between nodes and path preference.
[0055] Implementation method: Based on the power grid topology and line reactance parameters, the power transmission distribution factor matrix is calculated offline. , of which elements Let represent the power flow change on branch k when node l injects unit power; for any pair of nodes (i,j), extract its power transmission correlation degree: ,in Let i be the set of branches on all paths connecting i and j; The active coupling strength of node pairs is quantified, and the energy flow direction is determined by combining the real-time sign difference of node injected power. A dynamic directed adjacency matrix is constructed. The PTDF is a static topological constant. When running online, only the node injected power is needed to dynamically update the direction information, and the computational efficiency is significantly higher than that of online DC power flow solution.
[0056] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. A method for predicting the carbon factor of power grid nodes based on a directed power flow graph convolutional network, characterized in that, Includes the following steps: Acquire measurement data of each power grid node within the target power grid at multiple historical moments; The measurement data is input into a pre-trained carbon factor prediction model, which includes a cascaded directed adjacency matrix construction module, a multi-channel graph convolution module, and an LSTM temporal coding module. The directed adjacency matrix construction module calculates the phase angle difference between the two ends of the power grid nodes of any branch in the target power grid based on the measurement data for each historical moment. When the phase angle difference is greater than the preset positive threshold, it is determined that the active power flows from the first node to the last node, and the corresponding branch belongs to the outflow channel. All branches belonging to the outflow channel are identified, and the outflow adjacency submatrix is constructed using the absolute value of the phase angle difference as the edge weight. When the phase angle difference is less than the preset negative threshold, it is determined that the active power flows from the end node to the beginning node, and the corresponding branch belongs to the inflow channel. All branches belonging to the inflow channel are identified, and the inflow adjacency submatrix is constructed using the absolute value of the phase angle difference as the edge weight. And to construct a self-loop adjacency submatrix by assigning other branches within the target power grid to self-loop channels; The multi-channel graph convolution module performs graph convolution operations on the outflow adjacency submatrix, inflow adjacency submatrix, and self-loop adjacency submatrix respectively to obtain outflow aggregation features, inflow aggregation features, and self-loop retained features, and then performs weighted summation to obtain the node space representation vector at the current historical moment, as well as the node space representation vector at each historical moment. The LSTM time-series coding module performs sequential modeling of the node spatial representation vectors at each historical moment in the time dimension to obtain the predicted value of the grid node carbon factor at the next moment.
2. The method for predicting the carbon factor of power grid nodes based on a directed power flow graph convolutional network according to claim 1, characterized in that, The acquisition of the outflow aggregation characteristics, inflow aggregation characteristics, and self-loop retention characteristics includes: When performing graph convolution operation on the outflow adjacency submatrix, the carbon propagation carbon value received by each grid node in the outflow adjacency submatrix from its downstream neighboring grid nodes is extracted to form outflow aggregation features. When performing graph convolution operation on the inflow adjacency submatrix, the carbon aggregation carbon value received by each grid node in the inflow adjacency submatrix from its upstream neighbor grid node is extracted to form inflow aggregation features. When performing graph convolution on the self-loop adjacency submatrix, the input features of each power grid node within the self-loop adjacency submatrix are preserved through independent linear transformations to form self-loop preserved features.
3. The method for predicting the carbon factor of power grid nodes based on a directed power flow graph convolutional network according to claim 2, characterized in that, The acquisition of the node spatial representation vector at the current historical moment includes: The outflow aggregation features, inflow aggregation features, and self-loop retention features are input into the node-level gated fusion network. The node-level gated fusion network uses the original input features of each power grid node at the current historical moment as a condition, and calculates the weight coefficients corresponding to the outflow channel, inflow channel, and self-loop channel for each power grid node independently through a multilayer perceptron. The three weight coefficients are then normalized to ensure that the sum of the three weights of the same power grid node is equal to the unit value. Based on the weight coefficients of the three channels after normalization constraints, the outflow aggregation features, inflow aggregation features, and self-loop retention features are weighted and fused to obtain the node space representation vector of the current historical moment.
4. The method for predicting the carbon factor of power grid nodes based on a directed power flow graph convolutional network according to claim 1, characterized in that, The acquisition of the predicted carbon factor value of the power grid node at the next moment includes: The node spatial representation vectors at each historical moment are arranged in temporal order and input into the parallel-running short-branch long short-term memory network and long-branch long short-term memory network, respectively. The short-branch long short-term memory network takes the continuous time sequence sampled hourly at the original sampling interval as input, and updates the network state through time step iteration to capture the nonlinear dynamic characteristics of carbon factor caused by intraday load peak and valley fluctuations, generator start and stop regulation and short-term power fluctuations of new energy, and outputs short-time encoded features. Long-branch long short-term memory network takes a sequence covering a week as input and expands the actual time span corresponding to each time step by downsampling in order to capture the differences in electricity consumption patterns between weekdays and rest days, the periodic scheduling patterns within the week, and the trend evolution characteristics of carbon factors caused by meteorological changes, thus obtaining long-time coding features. Short-time-series coding features and long-time-series coding features are concatenated along the feature dimension to form joint-time-series coding features. The joint-time-series coding features are then input into a multilayer perceptron (MLP) to map and obtain the predicted value of the carbon emission factor of the power grid node at the next time step.
5. The method for predicting the carbon factor of power grid nodes based on a directed power flow graph convolutional network according to claim 4, characterized in that, The step of arranging the node spatial representation vectors at each historical moment in temporal order and inputting them into the parallel-running short-branch long short-term memory network and long-branch long short-term memory network, also includes temporal feature enhancement of the node spatial representation vectors at each historical moment, including: A sinusoidal position coding based on time lag is adopted, and the actual time difference between each historical moment and the current prediction moment is used as the independent variable to perform a sinusoidal transformation to generate the sinusoidal position coding of the node spatial representation vector of each historical moment. Learnable static attribute embedding vectors for each power grid node are introduced to encode the inherent electrical role information of the power grid node, generating node static attribute embeddings of node spatial representation vectors at each historical moment. The original node spatial representation vectors at each historical moment are concatenated with the corresponding sinusoidal position codes and node static attributes embedded in the feature dimension to generate enhanced node spatial representation vectors at each historical moment. These enhanced node spatial representation vectors are then arranged in temporal order and input into the parallel-running short-branch long short-term memory network and long-branch long short-term memory network.
6. The method for predicting the carbon factor of power grid nodes based on a directed power flow graph convolutional network according to claim 4, characterized in that, The process of obtaining the predicted carbon emission factor value of the power grid node at the next moment also includes correcting the predicted carbon emission factor value of the power grid node, including: A gradient boosting decision tree correction model is constructed, with the identification information of power grid nodes in encoded form as input features. The residual between the basic predicted value of the carbon emission factor of the power grid node at the next time step output by the LSTM time-series coding module and the actual value of the carbon emission factor of the power grid node at the next time step in the training data is used as the optimization objective to train the gradient boosting decision tree correction model. The identification information of the power grid nodes includes the measurement features of each power grid node at the current time step, the time period code at the current time step, and the unique heat identification code of each power grid node. During the training of the gradient boosting decision tree correction model, the measurement features of each power grid node at the current time, the time period code at the current time, and the one-hot identifier code of each power grid node are used as input features, and the residuals are used as supervision labels to train the gradient boosting decision tree correction model. The measurement characteristics of each power grid node at the current moment, the time period code of the current moment, and the unique heat identification code of each power grid node are input into the trained gradient boosting decision tree correction model, and the estimated value of the residual for the next moment is output. The basic predicted value of the carbon emission factor of the power grid node at the next moment is added to the estimated value of the residual for the next moment to obtain the final predicted value of the carbon emission factor of the power grid node at the next moment.
7. The method for predicting the carbon factor of power grid nodes based on a directed power flow graph convolutional network according to claim 1, characterized in that, The measured data includes the voltage phase angle, active power, reactive power, load demand, and generator output information of each power grid node.
8. A power grid node carbon factor prediction device based on a directed power flow graph convolutional network, characterized in that, include: The data module is used to acquire measurement data of each power grid node in the target power grid at multiple historical moments; The model module is used to input measurement data into a pre-trained carbon factor prediction model, which includes a cascaded directed adjacency matrix construction module, a multi-channel graph convolution module, and an LSTM temporal coding module. The feature extraction module, the directed adjacency matrix construction module calculates the phase angle difference between the two ends of the power grid nodes of any branch in the target power grid based on the measurement data for each historical moment; When the phase angle difference is greater than the preset positive threshold, it is determined that the active power flows from the first node to the last node, and the corresponding branch belongs to the outflow channel. All branches belonging to the outflow channel are identified, and the outflow adjacency submatrix is constructed using the absolute value of the phase angle difference as the edge weight. When the phase angle difference is less than the preset negative threshold, it is determined that the active power flows from the end node to the beginning node, and the corresponding branch belongs to the inflow channel. All branches belonging to the inflow channel are identified, and the inflow adjacency submatrix is constructed using the absolute value of the phase angle difference as the edge weight. And to construct a self-loop adjacency submatrix by assigning other branches within the target power grid to self-loop channels; The multi-channel graph convolution module performs graph convolution operations on the outflow adjacency submatrix, inflow adjacency submatrix, and self-loop adjacency submatrix respectively to obtain outflow aggregation features, inflow aggregation features, and self-loop retained features, and then performs weighted summation to obtain the node space representation vector at the current historical moment, as well as the node space representation vector at each historical moment. The prediction module, namely the LSTM time-series coding module, performs sequential modeling of the node spatial representation vectors at each historical moment in the time dimension to obtain the predicted value of the grid node carbon factor at the next moment.
9. An electronic device, characterized in that, include: Memory and processor; The memory is used to store computer programs; When the processor executes the computer program stored in the memory, it implements the steps of the power grid node carbon factor prediction method based on a directed power flow graph convolutional network as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, implements the steps of the power grid node carbon factor prediction method based on a directed power flow graph convolutional network as described in any one of claims 1 to 7.