A power distribution network carbon emission factor prediction method and system based on Graphormer
By using the Graphermer graph convolutional network learning method, a carbon emission factor prediction model for distribution networks is constructed, which solves the problem of real-time prediction of carbon emission factors in distribution networks, and achieves efficient and accurate carbon emission factor prediction, supporting user-side carbon asset management and demand-side response.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
- Filing Date
- 2026-02-10
- Publication Date
- 2026-06-19
Smart Images

Figure CN122241053A_ABST
Abstract
Description
Technical Field
[0002] This invention relates to the fields of electrical technology and information technology, and more specifically, to a method and system for predicting carbon emission factors in power distribution networks based on Graphormer. Background Technology
[0003] As a public infrastructure connecting energy production and consumption, the power grid plays a crucial role in achieving "dual carbon" goals. The distribution network, a vital component of the power grid, not only has inherent requirements for carbon reduction in production but also, as a provider of high-quality electricity services, directly serves users and plays an irreplaceable role in promoting user-side carbon asset management and demand-side response. Currently, carbon flow theory has been proposed for carbon emission accounting in distribution networks. Based on power flow state estimation information from the transmission network, it can calculate indirect carbon emissions in real time and accurately quantify the differences in carbon emission factors among different nodes within the smallest spatial scale region of the average carbon emission factor.
[0004] Unlike transmission networks, which have comprehensive electrical measurement systems, distribution networks typically have measurement systems distributed at the source and load sides. Considering engineering practicality and economy, installing measurement equipment at all nodes is difficult to achieve and cannot cover complete system observability. Furthermore, due to inherent limitations of the equipment and data transmission issues, SCADA equipment always has some errors. Currently, carbon emission factors calculated based on carbon flow can only provide historical carbon emission factors, not future grid carbon emission factors for real-time demand guidance. Therefore, there is an urgent need for a calculation model that combines grid topology information and historical data to predict grid carbon emission factors. The predicted values would help users promptly perceive the cleanliness of their purchased electricity. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a method and system for predicting carbon emission factors in power distribution networks based on Graphormer.
[0006] According to one aspect of the present invention, a method for calculating the carbon emission factor of a power distribution network based on graph convolutional network learning is provided, comprising: Based on the extracted distribution network topology information and node monitoring data, a power grid topology map and a calculation model for the historical carbon emission factor of the distribution network are constructed. Based on topological graphs and historical carbon emission factor sequence data, and building upon Graphormer, we map carbon emission factors to a high-dimensional space using gated temporal convolutional blocks, embedding node features with center and position encodings. Based on node characteristics, spatiotemporal data mining is performed using encoders and decoders to predict the carbon emission factor values of the distribution network at different times.
[0007] Optionally, the node monitoring data includes unit active power, load active power, unit carbon emission data, and unit power generation data.
[0008] The power grid topology diagram is as follows G, Given an ordered binary ( V , E () represents a diagram of a power distribution network. V Represents the set of power grid nodes. E Indicates power grid G The set of connecting edges in the middle, Represents a node. Represents a node i , j The edges between them.
[0009] The historical carbon emission factor of the distribution network is calculated based on the carbon potential of the grid nodes according to the principle of proportional sharing. The calculation formula is as follows:
[0010] In the formula, It is the set of inflow nodes. and This represents the carbon emission intensity of the generating units at this node and the carbon emission intensity of the generating units flowing into this node. and These represent the power generation of the node's own units and the active power flow injected into the node, respectively.
[0011] Optionally, based on the topological graph and historical carbon emission factor sequence data, and building upon Graphormer, the carbon emission factors are mapped to a high-dimensional space using gated temporal convolutional blocks, embedding center-encoded and position-encoded node features, including: Based on the power grid node topology, historical carbon emission factor sequence values, and prediction window size The formula for predicting carbon emission factors at distribution network nodes is defined as follows:
[0012] In the formula, For distribution network nodes in t + i Carbon emission factors over a given period of time For distribution network nodes in time t Carbon emission factors at that time It is the length of the time series. f It is a mapping function.
[0013] Gated temporal convolutional blocks extract initial information features and map them to a high-dimensional space through a one-dimensional convolutional network and a residual connection network. The gated temporal convolutional block includes a kernel width of... One convolutional layer and a linear gated unit.
[0014] One-dimensional convolution mines the location information of adjacent nodes, with a length of l The input features are Time series data of carbon emission factors in power grids One-dimensional convolution kernel The time-series data is processed through a one-dimensional convolution, and the resulting data is divided into two identical blocks, including... P and Q , P The main feature branch expresses temporal feature information. Q For the gated feature branch, generate the gated signal. The expression for the gated convolution time block is as follows:
[0015] In the formula: The input data after linear transformation and P For data of the same dimension, V For learnable parameter matrix, , The Hadamard product is the same width as the matrix. For activation function, This is the output feature length.
[0016] The center-coded and location-coded node features are input through the encoder. Information on the node's unit carbon emission and power generation carbon emission factors is used to add these features to the node characteristics. At time t, the encoding input is:
[0017] In the formula, Let be the node feature vector at time t. for t A new node characteristic is composed of time node characteristics, central coding, and unit carbon emission factors. for t Node features encoded by time location, It is a linear mapping function that maps node features to a high-dimensional space.
[0018] Position codes are generated using sine and cosine functions, and the time-position code length is [length missing]. The i-th vector feature in the position encoding at time t for
[0019] Optionally, based on node characteristics, spatiotemporal data mining is performed using encoders and decoders to predict the carbon emission factor values of the distribution network at different times, including: The encoder is made by NThe encoder consists of a series of interconnected network layers. Attention is calculated using the Graphormer algorithm, and residual connections are added between the modules. The encoder output... Attention calculations are performed in the decoder.
[0020] The decoder structure is similar to the encoder structure. The node features in the decoder only include center encoding and position encoding. The calculated value after N layers of decoders are passed through a multilayer perceptron to obtain the predicted value of the power grid carbon emission factor.
[0021] Optionally, the carbon emission factor of the distribution network at different times can be predicted, including: The training steps for the prediction model are as follows: (1) Obtain the topology of the selected distribution network and the time series data of the historical carbon emission factors of the distribution network; (2) Select input and output data according to the prediction window size, divide the sample data into training set and test set in a 7:3 ratio, normalize the sample data to reduce the impact of the difference in units on the training effect; (3) Construct a prediction network based on Graphormer and set the network parameter values; (4) Input the divided training data into the network for training, calculate the gradient of the loss function with respect to the model parameters through the backpropagation algorithm, and update the model parameters along the negative gradient direction. After the parameters are updated multiple times, the model training is completed.
[0022] If research m At time n, the loss function is defined as:
[0023] In the formula, Let be the carbon emission factor vector calculated based on measurement data at time t. The carbon emission factor vector output by the prediction model at time t. It is a vector The L2 norm is used to define the loss function, which can prevent overfitting and improve the generalization ability of the model.
[0024] According to another aspect of the present invention, a graphormer-based carbon emission factor prediction system for power distribution networks is provided, comprising: The module is used to construct a power grid topology map and a calculation model for historical carbon emission factors of the power grid based on the extracted distribution network topology information and node monitoring data. The embedding module is used to map carbon emission factors to a high-dimensional space based on the power grid topology map and historical carbon emission factor sequence data, and embeds node features with center encoding and location encoding through gated temporal convolutional blocks on the basis of Graphormer. The prediction module is used to predict the carbon emission factor of the distribution network at different times by performing spatiotemporal data mining based on node characteristics through encoders and decoders.
[0025] According to another aspect of the present invention, a computer-readable storage medium is provided, the storage medium storing a computer program for performing the method of any of the above aspects of the present invention.
[0026] According to another aspect of the present invention, an electronic device is provided, comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the method described in any of the preceding aspects of the present invention.
[0027] Therefore, this invention constructs a power grid topology map and a calculation model for historical carbon emission factors of the power grid based on the extracted distribution network topology information and node monitoring data; based on the topology map and historical carbon emission factor sequence data, and on the basis of Graphormer, the carbon emission factors are mapped to a high-dimensional space through gated temporal convolutional blocks, embedding central and location-encoded node features; and spatiotemporal data mining is performed through encoder and decoder to predict the carbon emission factor values of the distribution network at different times. Attached Figure Description
[0028] Exemplary embodiments of the present invention can be more fully understood by referring to the following figures: Figure 1 This is a flowchart illustrating a graphormer-based carbon emission factor prediction method for power distribution networks provided in an exemplary embodiment of the present invention. Figure 2 This is another flowchart illustrating the graphormer-based carbon emission factor prediction method for power distribution networks provided in an exemplary embodiment of the present invention. Figure 3 This is a schematic diagram of the structure of a distribution network carbon emission factor prediction system based on Graphormer provided in an exemplary embodiment of the present invention; Figure 4 This is the structure of an electronic device provided in an exemplary embodiment of the present invention. Detailed Implementation
[0029] Hereinafter, exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments of the present invention. It should be understood that the present invention is not limited to the exemplary embodiments described herein.
[0030] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of the invention.
[0031] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of the present invention are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.
[0032] It should also be understood that in the embodiments of the present invention, "multiple" can refer to two or more, and "at least one" can refer to one, two or more.
[0033] It should also be understood that any component, data or structure mentioned in the embodiments of the present invention can generally be understood as one or more unless explicitly defined or given contrary instructions in the context.
[0034] Furthermore, the term "and / or" in this invention is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this invention generally indicates that the preceding and following related objects have an "or" relationship.
[0035] It should also be understood that the description of the various embodiments in this invention emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.
[0036] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.
[0037] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.
[0038] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, they should be considered part of the specification.
[0039] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0040] The embodiments of this invention can be applied to electronic devices such as terminal devices, computer systems, and servers, and can operate together with a wide range of other general-purpose or special-purpose computing system environments or configurations. Well-known examples of terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, and servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments including any of the above systems, etc.
[0041] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are executed by remote processing devices linked through communication networks. In distributed cloud computing environments, program modules can reside on local or remote computing system storage media, including storage devices.
[0042] Exemplary methods Figure 1 This is a flowchart illustrating a graphormer-based carbon emission factor prediction method for power distribution networks, provided by an exemplary embodiment of the present invention. This embodiment can be applied to electronic devices, such as… Figure 1 As shown, the distribution network carbon emission factor prediction method 100 based on Graphormer includes the following steps: Step 101: Based on the extracted distribution network topology information and node monitoring data, construct a power grid topology map and a calculation model for the historical carbon emission factor of the distribution network. Step 102: Based on the topological graph and historical carbon emission factor sequence data, and building upon Graphormer, the carbon emission factors are mapped to a high-dimensional space using gated temporal convolutional blocks, embedding center-encoded and position-encoded node features. Step 103: Spatiotemporal data mining is performed using encoders and decoders to predict the carbon emission factor values of the power distribution network at different times.
[0043] Step S1: Based on the extracted distribution network topology information and node monitoring data, construct a power grid topology map and a calculation model for the historical carbon emission factors of the distribution network, including: The monitoring data for each node includes active power of the unit, active power of the load, carbon emission data of the unit, and power generation data of the unit.
[0044] The topology diagram of the power grid is as follows G, Given an ordered binary ( V , E () represents a diagram of a power distribution network. V Represents the set of power grid nodes. E Indicates power grid G The set of connecting edges in the middle, Represents a node. Represents a node i , j The edges between them.
[0045] The historical carbon emission factor of the distribution network is calculated based on the carbon potential of the grid nodes according to the principle of proportional sharing. The calculation formula is as follows:
[0046] In the formula, It is the set of inflow nodes. and This represents the carbon emission intensity of the generating units at this node and the carbon emission intensity of the generating units flowing into this node. and These represent the power generation of the node's own units and the active power flow injected into the node, respectively.
[0047] Step S2, based on the topological graph and historical carbon emission factor sequence data, uses gated temporal convolutional blocks to map carbon emission factors into a high-dimensional space, embedding center-encoded and position-encoded node features, including: Based on the power grid node topology, historical carbon emission factor sequence values, and prediction window size The formula for predicting carbon emission factors at distribution network nodes is defined as follows:
[0048] In the formula, For distribution network nodes in t + i Carbon emission factors over a given period of time For distribution network nodes in time t Carbon emission factors at that time It is the length of the time series. f It is a mapping function.
[0049] Gated temporal convolutional blocks extract initial information features and map them to a high-dimensional space through a one-dimensional convolutional network and a residual connection network. The gated temporal convolutional block includes a kernel width of... One convolutional layer and a linear gated unit.
[0050] One-dimensional convolution mines the location information of adjacent nodes, with a length of l The input features are Time series data of carbon emission factors in power grids One-dimensional convolution kernel The time-series data is processed through a one-dimensional convolution, and the resulting data is divided into two identical blocks, including... P and Q , P The main feature branch expresses temporal feature information. Q For the gated feature branch, generate the gated signal. The expression for the gated convolution time block is as follows:
[0051] In the formula: The input data after linear transformation and P For data of the same dimension, V For learnable parameter matrix, , The Hadamard product is the same width as the matrix. For activation function, This is the output feature length.
[0052] The center-coded and location-coded node features are input through the encoder. Information on the node's unit carbon emission and power generation carbon emission factors is used to add these features to the node characteristics. At time t, the encoding input is:
[0053] In the formula, Let be the node feature vector at time t. for t A new node characteristic is composed of time node characteristics, central coding, and unit carbon emission factors. for t Node features encoded by time location, It is a linear mapping function that maps node features to a high-dimensional space.
[0054] Position codes are generated using sine and cosine functions, and the time-position code length is [length missing]. The i-th vector feature in the position encoding at time t for
[0055] Step S3, based on node characteristics, performs spatiotemporal data mining using an encoder and decoder to predict the carbon emission factor values of the distribution network at different times, including: The encoder is made by N The encoder consists of a series of interconnected network layers. Attention is calculated using the Graphormer algorithm, and residual connections are added between the modules. The encoder output... Attention calculations are performed in the decoder.
[0056] The decoder structure is similar to the encoder structure. The node features in the decoder only include center encoding and position encoding. The calculated value after N layers of decoders are passed through a multilayer perceptron to obtain the predicted value of the power grid carbon emission factor.
[0057] Optionally, the carbon emission factor of the distribution network at different times can be predicted, including: The training steps for the prediction model are as follows: (1) Obtain the topology of the selected distribution network and the time series data of the historical carbon emission factors of the distribution network; (2) Select input and output data according to the prediction window size, divide the sample data into training set and test set in a 7:3 ratio, normalize the sample data to reduce the impact of the difference in units on the training effect; (3) Construct a prediction network based on Graphormer and set the network parameter values; (4) Input the divided training data into the network for training, calculate the gradient of the loss function with respect to the model parameters through the backpropagation algorithm, and update the model parameters along the negative gradient direction. After the parameters are updated multiple times, the model training is completed.
[0058] If research m At time n, the loss function is defined as:
[0059] In the formula, Let be the carbon emission factor vector calculated based on measurement data at time t. The carbon emission factor vector output by the prediction model at time t. It is a vector The L2 norm is used to define the loss function, which can prevent overfitting and improve the generalization ability of the model.
[0060] In one specific embodiment of the present invention, an improved IEEE-123 node system was used for testing. Excluding the interconnection node, there are a total of 114 nodes. Distributed wind turbines are connected to nodes 5, 13, 26, 57, 67, 84, and 89, distributed gas turbines are connected to nodes 21, 45, and 63, and distributed photovoltaics are connected to nodes 74 and 109.
[0061] In this embodiment, the dataset consists of node injected power, source-side unit carbon emission intensity, non-source-side node dynamic carbon emission factor values, and target values of carbon emission factors calculated by carbon flow. When acquiring power flow data, due to the volatility of distributed unit output, it is assumed that each distributed unit fluctuates between its lower output limit and rated power, and any load fluctuates within 50% to 150% of the standard example load. All power flow samples obtained from the load converge. The unit carbon emission intensity is assumed to remain constant. A total of 5000 valid samples are obtained, of which 4000 are randomly selected for constructing the training set, 500 are used as the validation set, and the remaining 500 are used as the test set.
[0062] The model was trained using the Adam optimizer with 2000 iterations. Since the number of convolutional kernels in the Graphormer prediction network model is typically set to a power of 2, the loss function values and average time required for each iteration were statistically analyzed for different convolutional kernels (2¹~2¹⁰) after ten iterations (the first ten iterations showed the largest decrease in loss function). The results are shown in Table 1. Table 1. Effect of different numbers of convolutional kernels on the loss function after ten iterations.
[0063] In this embodiment, , The calculated MAE of the prediction model on the test set is 0.0342 kgCO2 / kWh, and the MAPE is 9.55%. MAE reflects the actual magnitude of the error; 0.0342 represents the average absolute error of the prediction model across different nodes in the test set. MAPE reflects the relative magnitude of the error; 9.55% is the average relative error of the GCN model across different nodes in the test set.
[0064] Most nodes have relatively small errors, but nodes 29, 30, 33, 51, 61, 96, and 109-113 have larger errors. These nodes with larger errors are all located at the ends of radial branches, and the errors increase the closer the node is to the end. This is because nodes near the end of the branch have less information during the two-layer update. The mean absolute errors of nodes 29, 30, 33, 51, 96, and 109-113 are 0.0746, 0.1061, 0.0865, 0.0742, 0.0892, 0.1037, 0.0997, 0.1009, 0.1069, 0.1498, and 0.1812, respectively.
[0065] Therefore, this invention constructs a power grid topology map and a calculation model for historical carbon emission factors of the power grid based on the extracted distribution network topology information and node monitoring data; based on the topology map and historical carbon emission factor sequence data, and on the basis of Graphormer, the carbon emission factors are mapped to a high-dimensional space through gated temporal convolutional blocks, embedding central and location-encoded node features; and spatiotemporal data mining is performed through encoder and decoder to predict the carbon emission factor values of the distribution network at different times.
[0066] Exemplary device Figure 3 This is a schematic diagram of the structure of a power distribution network carbon emission factor calculation device based on graph convolutional network learning, provided in an exemplary embodiment of the present invention. Figure 3 As shown, the device 300 includes: Module 310 is used to construct a power grid topology map and a calculation model for historical carbon emission factors of the power grid based on the extracted distribution network topology information and node monitoring data. The embedding module 320 is used to map carbon emission factors to a high-dimensional space based on the power grid topology map and the historical carbon emission factor sequence data, and embed the node features of center encoding and location encoding through gated temporal convolutional blocks on the basis of Graphormer. The prediction module 330 is used to predict the carbon emission factor value of the distribution network at different times by performing spatiotemporal data mining through encoder and decoder based on the node characteristics.
[0067] Optionally, the node monitoring data includes unit active power, load active power, unit carbon emission data, and unit power generation data; The power grid topology diagram is as follows: G, Given an ordered binary ( V , E A diagram representing a power distribution network. V Represents the set of power grid nodes. E Indicates power grid G The set of connecting edges in the middle, Represents a node. Represents a node i , j The edge between; The historical carbon emission factor of the distribution network is calculated based on the carbon potential of the grid nodes according to the principle of proportional sharing. The calculation formula is as follows:
[0068] In the formula, It is the set of inflow nodes. and This represents the carbon emission intensity of the generating units at this node and the carbon emission intensity of the generating units flowing into this node. and These represent the power generation of the node's own units and the active power flow injected into the node, respectively.
[0069] Optionally, the embedded module includes: Based on the power grid topology, the historical carbon emission factor sequence values, and the prediction window size The formula for predicting carbon emission factors at distribution network nodes is defined as follows:
[0070] In the formula, For distribution network nodes in t + i Carbon emission factors over a given period of time For distribution network nodes in time t Carbon emission factors at that time It is the length of the time series. f It is a mapping function; Gated temporal convolutional blocks are used to extract initial information features, which are then mapped to a high-dimensional space through a one-dimensional convolutional network and a residual connection network. The gated temporal convolutional blocks include kernels with a width of [missing information]. One convolutional layer and a linear gated unit; The one-dimensional convolution mining of adjacent node position information has a length of [missing information]. l The input features are Time series data of carbon emission factors in power grids One-dimensional convolution kernel The time-series data is processed by one-dimensional convolution, and the convolutional data is divided into two identical blocks, including... P and Q , P The main feature branch expresses temporal feature information. Q For the gated feature branches, a gated signal is generated. The expression for the gated convolution time block is as follows:
[0071] In the formula: The input data after linear transformation and P For data of the same dimension, V For learnable parameter matrix, , The Hadamard product is the same width as the matrix. For activation function, Output feature length; The center-coded and location-coded node features are input through the encoder. Information on the node's unit carbon emission and power generation carbon emission factors is used to add these features to the node characteristics. At time t, the encoding input is:
[0072] In the formula, Let be the node feature vector at time t. for t A new node characteristic is composed of time node characteristics, central coding, and unit carbon emission factors. for t Node features encoded by time location, This is a linear mapping function that maps node features to a high-dimensional space. Position codes are generated using sine and cosine functions, and the time-position code length is [length missing]. The i-th vector feature in the position encoding at time t for: .
[0073] Optionally, the encoder is composed of N The encoder consists of a series of interconnected network layers. Attention is calculated using the Graphormer algorithm, and residual connections are added between the modules of the encoder. The encoder output... Attention calculations are performed in the decoder; The decoder structure is similar to the encoder structure. The node features in the decoder only include center encoding and position encoding. The calculated value after N layers of decoders are connected in series, and the predicted value of the power grid carbon emission factor is obtained through a multilayer perceptron.
[0074] Optionally, the training steps for the prediction model to predict the carbon emission factor values of the distribution network at different times are as follows: (1) Obtain the topology of the selected distribution network and the time series data of the historical carbon emission factors of the distribution network; (2) Select input and output data according to the prediction window size, divide the sample data into training set and test set in a 7:3 ratio, normalize the sample data to reduce the impact of the difference in units on the training effect; (3) Construct a prediction network based on Graphormer and set the network parameter values; (4) Input the divided training data into the network for training. Calculate the gradient of the loss function with respect to the model parameters using the backpropagation algorithm. Update the model parameters along the negative gradient direction. After multiple parameter updates, the model training is complete. If research m At time n, the loss function is defined as:
[0075] In the formula, Let be the carbon emission factor vector calculated based on measurement data at time t. The carbon emission factor vector output by the prediction model at time t. It is a vector The L2 norm is used to define the loss function, which can prevent overfitting and improve the generalization ability of the model.
[0076] Exemplary electronic devices Figure 4 This is the structure of an electronic device provided in an exemplary embodiment of the present invention. For example... Figure 4 As shown, the electronic device 40 includes one or more processors 41 and a memory 42.
[0077] The processor 41 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0078] The memory 42 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 41 may execute the program instructions to implement the methods of the software programs of the various embodiments of the present invention described above, and / or other desired functions. In one example, the electronic device may also include an input device 43 and an output device 44, these components being interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0079] In addition, the input device 43 may also include, for example, a keyboard, a mouse, etc.
[0080] The output device 44 can output various information to the outside. The output device 44 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0081] Of course, for the sake of simplicity, Figure 4 Only some of the components of this electronic device relevant to the present invention are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.
[0082] Exemplary computer program products and computer-readable storage media In addition to the methods and apparatus described above, embodiments of the present invention may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the methods according to various embodiments of the present invention described in the "Exemplary Methods" section above.
[0083] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of the present invention. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0084] Furthermore, embodiments of the present invention may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps of the methods according to various embodiments of the present invention described in the "Exemplary Methods" section above.
[0085] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0086] The basic principles of the present invention have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in the present invention are merely examples and not limitations, and should not be considered as essential features of each embodiment of the present invention. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the present invention to the necessity of employing the aforementioned specific details.
[0087] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0088] The block diagrams of devices, systems, devices, and systems involved in this invention are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, systems, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0089] The methods and systems of the present invention may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of the present invention are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, the present invention may also be implemented as a program recorded on a recording medium, the program comprising machine-readable instructions for implementing the methods according to the present invention. Thus, the present invention also covers recording media storing programs for performing the methods according to the present invention.
[0090] It should also be noted that in the systems, apparatus, and methods of the present invention, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered equivalents of the present invention. The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the invention. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the invention. Therefore, the invention is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0091] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the invention to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A method for predicting carbon emission factors in distribution networks based on Graphormer, characterized in that, include: Based on the extracted distribution network topology information and node monitoring data, a power grid topology map and a calculation model for the historical carbon emission factor of the distribution network are constructed. Based on the power grid topology and the historical carbon emission factor sequence data, and building upon Graphormer, the carbon emission factors are mapped to a high-dimensional space through gated temporal convolutional blocks, embedding node features with center encoding and location encoding. Based on the node characteristics, spatiotemporal data mining is performed using encoders and decoders to predict the carbon emission factor values of the distribution network at different times.
2. The method according to claim 1, characterized in that, The node monitoring data includes unit active power, load active power, unit carbon emission data, and unit power generation data; The power grid topology diagram is as follows: G, Given an ordered binary ( V , E A diagram representing a power distribution network. V Represents the set of power grid nodes. E Indicates power grid G The set of connecting edges in the middle, Represents a node. Represents a node i , j The edge between; The historical carbon emission factor of the distribution network is calculated based on the carbon potential of the grid nodes according to the principle of proportional sharing. The calculation formula is as follows: In the formula, It is the set of inflow nodes. and This represents the carbon emission intensity of the generating units at this node and the carbon emission intensity of the generating units flowing into this node. and These represent the power generation of the node's own units and the active power flow injected into the node, respectively.
3. The method according to claim 1, characterized in that, Based on the power grid topology and the historical carbon emission factor sequence data, and building upon Graphormer, gated temporal convolutional blocks are used to map carbon emission factors into a high-dimensional space, embedding node features with center and location encodings, including: Based on the power grid topology, the historical carbon emission factor sequence values, and the prediction window size The formula for predicting carbon emission factors at distribution network nodes is defined as follows: In the formula, For distribution network nodes in t + i Carbon emission factors over a given period of time For distribution network nodes in time t Carbon emission factors at that time It is the length of the time series. f It is a mapping function; Gated temporal convolutional blocks are used to extract initial information features, which are then mapped to a high-dimensional space through a one-dimensional convolutional network and a residual connection network. The gated temporal convolutional blocks include kernels with a width of [missing information]. One convolutional layer and a linear gated unit; The one-dimensional convolution mining of adjacent node position information has a length of [missing information]. l The input features are Time series data of carbon emission factors in power grids One-dimensional convolution kernel The time-series data is processed by one-dimensional convolution, and the convolutional data is divided into two identical blocks, including... P and Q , P The main feature branch expresses temporal feature information. Q For the gated feature branches, a gated signal is generated. The expression for the gated convolution time block is as follows: In the formula: The input data after linear transformation and P For data of the same dimension, V For learnable parameter matrix, , The Hadamard product is the same width as the matrix. For activation function, Output feature length; The center-coded and location-coded node features are input through the encoder. Information on the node's unit carbon emission and power generation carbon emission factors is used to add these features to the node characteristics. At time t, the encoding input is: In the formula, Let be the node feature vector at time t. for t A new node characteristic is composed of time node characteristics, central coding, and unit carbon emission factors. for t Node features encoded by time location, This is a linear mapping function that maps node features to a high-dimensional space. Position codes are generated using sine and cosine functions, and the time-position code length is [length missing]. The i-th vector feature in the position encoding at time t for: 。 4. The method according to claim 1, characterized in that, The encoder is composed of N The encoder consists of a series of interconnected network layers. Attention is calculated using the Graphormer algorithm, and residual connections are added between the modules of the encoder. The encoder output... Attention calculations are performed in the decoder; The decoder structure is similar to the encoder structure. The node features in the decoder only include center encoding and position encoding. The calculated value after N layers of decoders are connected in series, and the predicted value of the power grid carbon emission factor is obtained through a multilayer perceptron.
5. The method according to claim 4, characterized in that, The training steps for the prediction model to predict the carbon emission factor values of the distribution network at different times are as follows: (1) Obtain the topology of the selected distribution network and the time series data of the historical carbon emission factors of the distribution network; (2) Select input and output data according to the prediction window size, divide the sample data into training set and test set in a 7:3 ratio, normalize the sample data to reduce the impact of the difference in units on the training effect; (3) Construct a prediction network based on Graphormer and set the network parameter values; (4) Input the divided training data into the network for training. Calculate the gradient of the loss function with respect to the model parameters using the backpropagation algorithm. Update the model parameters along the negative gradient direction. After multiple parameter updates, the model training is complete. If research m At time n, the loss function is defined as: In the formula, Let be the carbon emission factor vector calculated based on measurement data at time t. The carbon emission factor vector output by the prediction model at time t. It is a vector The L2 norm is used to define the loss function, which can prevent overfitting and improve the generalization ability of the model.
6. A Graphormer distribution network carbon emission factor prediction system, used to implement the steps of the method according to any one of claims 1-5, comprising: The module is used to construct a power grid topology map and a calculation model for historical carbon emission factors of the power grid based on the extracted distribution network topology information and node monitoring data. The embedding module is used to map carbon emission factors to a high-dimensional space based on the power grid topology map and the historical carbon emission factor sequence data, and embed the node features of center encoding and location encoding through gated temporal convolutional blocks on the basis of Graphormer. The prediction module is used to predict the carbon emission factor values of the distribution network at different times by performing spatiotemporal data mining through encoders and decoders based on the node characteristics.
7. The system according to claim 6, characterized in that, The node monitoring data includes unit active power, load active power, unit carbon emission data, and unit power generation data; The power grid topology diagram is as follows: G, Given an ordered binary ( V , E A diagram representing a power distribution network. V Represents the set of power grid nodes. E Indicates power grid G The set of connecting edges in the middle, Represents a node. Represents a node i , j The edge between; The historical carbon emission factor of the distribution network is calculated based on the carbon potential of the grid nodes according to the principle of proportional sharing. The calculation formula is as follows: In the formula, It is the set of inflow nodes. and This represents the carbon emission intensity of the generating units at this node and the carbon emission intensity of the generating units flowing into this node. and These represent the power generation of the node's own units and the active power flow injected into the node, respectively.
8. The system according to claim 6, characterized in that, Embedded modules, including: Based on the power grid topology, the historical carbon emission factor sequence values, and the prediction window size The formula for predicting carbon emission factors at distribution network nodes is defined as follows: In the formula, For distribution network nodes in t + i Carbon emission factors over a given period of time For distribution network nodes in time t Carbon emission factors at that time It is the length of the time series. f It is a mapping function; Gated temporal convolutional blocks are used to extract initial information features, which are then mapped to a high-dimensional space through a one-dimensional convolutional network and a residual connection network. The gated temporal convolutional blocks include kernels with a width of [missing information]. One convolutional layer and a linear gated unit; The one-dimensional convolution mining of adjacent node position information has a length of [missing information]. l The input features are Time series data of carbon emission factors in power grids One-dimensional convolution kernel The time-series data is processed by one-dimensional convolution, and the convolutional data is divided into two identical blocks, including... P and Q , P The main feature branch expresses temporal feature information. Q For the gated feature branches, a gated signal is generated. The expression for the gated convolution time block is as follows: In the formula: The input data after linear transformation and P For data of the same dimension, V For learnable parameter matrix, , The Hadamard product is the same width as the matrix. For activation function, Output feature length; The center-coded and location-coded node features are input through the encoder. Information on the node's unit carbon emission and power generation carbon emission factors is used to add these features to the node characteristics. At time t, the encoding input is: In the formula, Let be the node feature vector at time t. for t A new node characteristic is composed of time node characteristics, central coding, and unit carbon emission factors. for t Node features encoded by time location, This is a linear mapping function that maps node features to a high-dimensional space. Position codes are generated using sine and cosine functions, and the time-position code length is [length missing]. The i-th vector feature in the position encoding at time t for: 。 9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for performing the method described in any one of claims 1-5.
10. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1-5.