Power grid power flow prediction method and device, electronic equipment and storage medium

By establishing a topology graph and adjacency matrix in the power grid, extracting enhanced temporal features and combining temporal attention and spatial attention, the accuracy problem of traditional power flow prediction methods under the conditions of variable and nonlinear power grid topology is solved, and more accurate power flow prediction is achieved.

CN121618521APending Publication Date: 2026-03-06ISOFTSTONE INFORMATION TECHNOLOGY (GROUP) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511955034.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Traditional power flow forecasting methods cannot effectively address the issues of variable power grid topology, nonlinear power flow, and local dependence, especially in power grids with distributed generation, leading to uncertainty in current direction and increased complexity in control and management.

Method used

By constructing a topology graph and adjacency matrix, enhanced temporal features are extracted, and combined with temporal attention and global spatial attention, more accurate power flow prediction is achieved.

Benefits of technology

It overcomes the limitations of fixed topology, captures nonlinear characteristics, and improves the accuracy of power flow prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121618521A_ABST
    Figure CN121618521A_ABST
Patent Text Reader

Abstract

The invention discloses a power grid power flow prediction method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining power grid operation data corresponding to a target region, and building a topological graph and an adjacent matrix corresponding to the target region according to the power grid operation data; determining a node feature code corresponding to each node in the topological graph based on the adjacent matrix; determining an enhanced time sequence feature corresponding to the target area based on the node feature code; and performing linear transformation on the enhanced time sequence characteristics to determine a power flow prediction value corresponding to the target area. Based on the technical scheme, the enhanced time sequence characteristics corresponding to the power grid are extracted by establishing the topological graph and the adjacent matrix, and then the power flow prediction value is determined according to the enhanced time sequence characteristics, so that the limitation of dependence on a fixed topological structure is eliminated through global space attention, and nonlinear characteristics are captured in combination with time attention; and more accurate power grid power flow prediction is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system technology, and in particular to a power grid power flow prediction method, device, electronic equipment, and storage medium. Background Technology

[0002] With the widespread application of distributed power sources (such as photovoltaic power generation and wind power generation) in the power grid, the integration of distributed power sources has transformed the power grid from a radial passive network into an active network with distributed small and medium-sized power sources, bringing about problems such as uncertainty in current direction and increased complexity in control and management.

[0003] However, traditional power flow prediction methods calculate power flow prediction data based on power grid operation data or predict power flow based on a fixed topology model, which cannot solve the problems of variable power grid topology, nonlinear power flow, and local dependence. Summary of the Invention

[0004] This invention provides a power grid power flow prediction method, device, electronic device, and storage medium. By establishing a topology graph and adjacency matrix, it extracts enhanced time-series features corresponding to the power grid, and then determines the power flow prediction value based on the enhanced time-series features. It achieves more accurate power grid power flow prediction by overcoming the limitation of relying on fixed topology structure through global spatial attention and capturing nonlinear features by combining time attention.

[0005] According to one aspect of the present invention, a power grid power flow prediction method is provided, comprising:

[0006] Obtain power grid operation data corresponding to the target area, and establish a topology map and adjacency matrix corresponding to the target area based on the power grid operation data;

[0007] The node feature code corresponding to each node in the topology graph is determined based on the adjacency matrix.

[0008] Based on node feature encoding, enhanced temporal features corresponding to the target region are determined;

[0009] A linear transformation is performed on the enhanced time-series characteristics to determine the power flow prediction value corresponding to the target region.

[0010] According to another aspect of the present invention, a power grid power flow prediction device is provided, comprising:

[0011] The data processing module is used to acquire power grid operation data corresponding to the target area, and to establish a topology map and adjacency matrix corresponding to the target area based on the power grid operation data.

[0012] The feature encoding module is used to determine the node feature encoding corresponding to each node in the topology graph based on the adjacency matrix.

[0013] The temporal processing module is used to determine the enhanced temporal features corresponding to the target region based on node feature encoding;

[0014] The power flow prediction module is used to perform a linear transformation on the enhanced time-series characteristics to determine the power flow prediction value corresponding to the target area.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] At least one processor; and

[0017] A memory that is communicatively connected to at least one processor; wherein,

[0018] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the power flow prediction method of any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions for causing a processor to execute and implement the power flow prediction method of any embodiment of the present invention.

[0020] The technical solution of this invention involves acquiring power grid operation data corresponding to a target area, and establishing a topology graph and adjacency matrix corresponding to the target area based on the power grid operation data; determining the node feature code corresponding to each node in the topology graph based on the adjacency matrix; determining the enhanced time-series features corresponding to the target area based on the node feature codes; and performing a linear transformation on the enhanced time-series features to determine the power flow prediction value corresponding to the target area. Based on the above technical solution, by establishing a topology graph and adjacency matrix to extract enhanced time-series features corresponding to the power grid, and then determining the power flow prediction value based on the enhanced time-series features, this invention achieves more accurate power grid power flow prediction by overcoming the limitations of relying on fixed topology structures through global spatial attention and by combining time attention to capture nonlinear features.

[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of a power grid flow prediction method provided in an embodiment of the present invention;

[0024] Figure 2 This is a flowchart of a power grid flow prediction method provided in an embodiment of the present invention;

[0025] Figure 3 This is a flowchart of a power grid flow prediction method provided in an embodiment of the present invention;

[0026] Figure 4 This is a schematic diagram of the structure of a power grid flow prediction device provided in an embodiment of the present invention;

[0027] Figure 5 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0030] Figure 1 This is a flowchart illustrating a power flow prediction method provided in an embodiment of the present invention. This embodiment is applicable to situations where power flow data in a target area needs to be predicted. The method can be executed by a power flow prediction device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method specifically includes the following steps:

[0031] S110. Obtain the power grid operation data corresponding to the target area, and establish a topology map and adjacency matrix corresponding to the target area based on the power grid operation data.

[0032] The target area is a pre-defined geographical region where power grid status monitoring and analysis are required. Power grid operation data reflects various information about the operating status and interconnections of power grid components within the target area. A topology map can be a graphical model representing the interconnection structure of power grid components in the target area, showing the node relationships within the power grid. An adjacency matrix can be understood as a mathematical model that quantitatively describes the connection status between power grid components in matrix form.

[0033] Specifically, power grid operation data is collected through multiple channels, including sensors and data acquisition terminals deployed within the target area's power grid, and interfaces with the power grid dispatch center system. After collection, the data is cleaned to remove invalid and interfering data, and the data containing the types, locations, and connection relationships of power grid components such as generators, transformers, and lines is selected. Based on the selected data, the relationships between various power grid components are analyzed, and a topology map is constructed using graphical modeling tools. Different symbols are used to label various power grid components, and lines are used to represent the connection paths between components. This can be done by using power grid components as matrix nodes, setting matrix element values ​​based on whether there are direct connections between components, generating corresponding adjacency matrices, and then storing the constructed topology map and adjacency matrices together to form structured topology data of the target area's power grid.

[0034] Based on the above technical solution, a topology graph and adjacency matrix corresponding to the target area are established according to the power grid operation data, including: obtaining the node operation data corresponding to each node in the target area from the power grid operation data, and determining the node name and active power value of each node; constructing a topology graph with nodes as vertices and active power transmission relationships between nodes as edges, and establishing an adjacency matrix based on the topology graph.

[0035] In this context, a node can be a connection node corresponding to a core component in the target area's power grid that undertakes the functions of power generation, transmission, and distribution. Node operation data can be understood as information reflecting the working status of each node. Active power values ​​can be parameters characterizing the actual power transmission capacity between nodes, used to determine whether effective power transmission exists between nodes. Active power transmission relationships can be the power transfer associations between nodes determined based on active power values.

[0036] Specifically, from the cleaned power grid operation data, node operation data corresponding to each node is selected. The unique identifier information of the node is extracted through data parsing, and the node name is determined. At the same time, the active power value of each node is separated. Using a topology modeling tool, each node is mapped as a graph vertex, and the vertex is labeled with the node name. Based on the existence and transmission direction of active power values ​​between nodes, the active power transmission relationship between nodes is determined and mapped as an edge connecting the corresponding vertex to complete the construction of the topology graph. The nodes in the topology graph are used as the indexes of the matrix rows and columns. The matrix elements are set according to whether there is an active power transmission relationship between nodes (i.e., whether there is an edge connection), and an adjacency matrix is ​​generated.

[0037] Based on the above technical solution, an adjacency matrix is ​​established according to the topology graph, including: when there are active values ​​between nodes, the active value elements in the adjacency matrix are set to the first value; when there are no active values ​​between nodes, the active value elements in the adjacency matrix are set to the second value.

[0038] The active power value elements are matrix elements in the adjacency matrix used to characterize the active power transmission state between any two nodes. The first value is a preset matrix element value used to mark the existence of an active power transmission relationship between nodes. The second value is a preset matrix element value used to mark the absence of an active power transmission relationship between nodes.

[0039] Specifically, all nodes in the constructed topology graph are extracted, numbered, and sorted. The row and column indices of the adjacency matrix are determined to ensure that the matrix dimension matches the number of nodes. All node pairs are traversed, and it is checked whether there are connecting edges representing active power transmission relationships between corresponding nodes in the topology graph, i.e., whether active power values ​​exist. If active power values ​​are found between node pairs, the active power value element at the intersection of the corresponding row and column indices in the adjacency matrix is ​​assigned the first value; if no active power values ​​are found between node pairs, the active power value element at the corresponding position is assigned the second value. For example, when active power values ​​exist between nodes, the corresponding value in the adjacency matrix is ​​1; otherwise, it is 0.

[0040] S120. Determine the node feature encoding corresponding to each node in the topology graph based on the adjacency matrix.

[0041] Among them, node feature encoding is standardized encoding information that transforms the connection relationship and transmission status characteristics of nodes in the power grid topology.

[0042] Specifically, the row vector data corresponding to each node in the adjacency matrix is ​​extracted. This row vector data contains the active power transmission association status between the node and all other nodes in the topology graph. The extracted row vectors are then analyzed to extract key information that characterizes the core attributes of the node, including the number of connected nodes and the type association features of adjacent nodes. Using a preset encoding rule, the analyzed feature information is transformed into standardized node feature codes.

[0043] Based on the above technical solution, the node feature code corresponding to each node in the topology graph is determined based on the adjacency matrix, including: extracting the spatial features of the node based on the adjacency matrix; taking the active value of the node as the attribute feature, combining it with the spatial features to form the initial node features, and standardizing the initial node features to obtain the node feature code.

[0044] Spatial features include the out-degree and in-degree of a node. Spatial features can characterize the spatial connectivity of a node within the power grid topology. Out-degree can be understood as the number of connections from which a node outputs active power to other nodes. In-degree can be understood as the number of connections from which other nodes input active power to that node. Initial node features can be a set of raw features that integrates the node's spatial connectivity attributes and power transmission attributes. Standardization is used to adjust initial features of different dimensions to a preset range, eliminating dimensional differences between features and improving coding effectiveness.

[0045] Specifically, for each node, the out-degree is determined by counting the number of the first values ​​in its corresponding row vector, and the in-degree is determined by counting the number of the first values ​​in its corresponding column vector. These are integrated to form the node's spatial features. The stored active values ​​of each node are then retrieved as attribute features. The attribute features and spatial features are concatenated according to a preset format to generate initial node features. A preset standardization algorithm is then used to process the initial node features to obtain the node feature encoding. It should be noted that the standardization algorithm can be chosen by the technical personnel according to their needs. For example, if it is necessary to retain the absolute numerical relationships of features, such as node out-degree and in-degree, Min-Max standardization is preferred; if it is necessary to highlight the relative distribution of features, such as active values, Z-Score standardization can be used; if the focus is on the similarity calculation of feature vectors, L2 normalization is more suitable.

[0046] S130. Determine the enhanced temporal features corresponding to the target region based on node feature encoding.

[0047] Among them, enhanced temporal features can be composite features that integrate static feature encoding of nodes with dynamic change information in the time dimension.

[0048] Specifically, historical time-series sequences of node feature codes within the target area are retrieved, and node feature code data for the current time period are collected to construct a time-series dataset of node feature codes covering multiple time periods. A time-series feature extraction method is used to mine the temporal evolution patterns of node feature codes from the time-series dataset. This can include feature change trends, periodic fluctuations, and correlation features across different time periods. The mined time-series features are then fused with the original node feature codes to form initial time-series features. These initial time-series features are then optimized using feature enhancement algorithms to strengthen key time-series information and weaken interfering information, resulting in enhanced time-series features.

[0049] For example, by retrieving historical time-series data of the feature codes of each node in the target area and simultaneously collecting real-time node feature codes, a time-series dataset is constructed. The sliding window method is used to traverse the time-series dataset and extract the temporal evolution features of the feature codes of each node, including trend features such as the direction of change of feature codes, periodic features such as the repetition pattern of features in different time periods, and correlation features such as the temporal coordinated change relationship of feature codes of adjacent nodes. Combined with the characteristics of power grid operation, time-series features that are strongly correlated with the dynamic state of the power grid are retained. The extracted time-series features are concatenated with the original node feature codes according to a preset dimension to form the initial time-series features. Feature enhancement algorithms, such as attention mechanisms, are used to enhance key time-series information to obtain enhanced time-series features.

[0050] S140. Perform a linear transformation on the enhanced time series characteristics to determine the power flow prediction value corresponding to the target area.

[0051] The linear transformation can be a process of dimensional transformation and feature reconstruction of enhanced time-series features through a preset linear mapping relationship, used to convert high-dimensional time-series features into a feature form suitable for power flow prediction. The power flow prediction value can be the prediction result of the power, flow direction and other power flow states of power transmission within the target area power grid.

[0052] Specifically, a linear transformation is performed on the enhanced time-series features to determine the power flow prediction values ​​corresponding to the target area. For example, based on the power grid topology of the target area, including node connection relationships, line parameters, and historical power flow-feature correspondence data, the least squares method is used to fit and determine the parameters of the linear transformation matrix. The matrix dimension is matched with the dimensions of the enhanced time-series features and the dimensions of power flow prediction indicators (such as power, flow direction, etc.), and combined with the power grid operation constraints (such as line transmission limits and node power balance), the linear transformation matrix is ​​constrained and corrected to obtain the linear transformation model corresponding to the target area. The enhanced time-series features are input into the constructed linear transformation model in the form of feature matrices, and the linear mapping operation is completed through matrix multiplication to obtain the power flow prediction values ​​corresponding to the target area.

[0053] The technical solution of this invention involves acquiring power grid operation data corresponding to a target area, and establishing a topology graph and adjacency matrix corresponding to the target area based on the power grid operation data; determining the node feature code corresponding to each node in the topology graph based on the adjacency matrix; determining the enhanced time-series features corresponding to the target area based on the node feature codes; and performing a linear transformation on the enhanced time-series features to determine the power flow prediction value corresponding to the target area. Based on the above technical solution, by establishing a topology graph and adjacency matrix to extract enhanced time-series features corresponding to the power grid, and then determining the power flow prediction value based on the enhanced time-series features, this invention achieves more accurate power grid power flow prediction by overcoming the limitations of relying on fixed topology structures through global spatial attention and by combining time attention to capture nonlinear features.

[0054] In one possible implementation of the present invention Figure 2 A flowchart of a power grid flow prediction method provided in an embodiment of the present invention is shown below. Figure 2 As shown, the step of determining the enhanced temporal features corresponding to the target region based on node feature encoding in this embodiment further includes:

[0055] S210. The feature aggregation result is obtained by weighted aggregation of node feature encoding through spatial attention mechanism.

[0056] Spatial attention mechanism can be a feature enhancement mechanism that dynamically allocates attention weights based on the spatial relationships of nodes in the power grid topology, used to identify and highlight node features that have a significant impact on power grid analysis. Weighted aggregation can be understood as a process of fusing and integrating the feature codes of each node according to preset weights. The feature aggregation result can be the comprehensive feature data obtained after weighted aggregation.

[0057] Specifically, based on the topological connections and feature similarity between nodes, the attention weight of each node's feature encoding is dynamically calculated. Higher weights are assigned to the feature encodings of key nodes in the topological structure, while lower weights are assigned to the features of secondary or redundant nodes. Based on the calculated weights, a weighted summation operation is performed on the feature encodings of all nodes to complete feature aggregation in the spatial dimension and generate the feature aggregation result.

[0058] Based on the above technical solution, a spatial attention mechanism is used to perform weighted aggregation of node feature codes to obtain feature aggregation results, including: performing a linear transformation on the node feature codes to generate query vectors, key vectors, and value vectors; using the dot product of the query vector and the key vector as the initial weights, and normalizing the initial weights to generate spatial attention scores; and performing a weighted summation of the value vector and the spatial attention scores to obtain the feature aggregation results.

[0059] The query vector can be a feature vector used to match other node features after a linear transformation of the node feature encoding. The key vector can be understood as a vector representing the node's own feature attributes after a linear transformation of the node feature encoding. The value vector can be a vector carrying core feature information after a linear transformation of the node feature encoding. The initial weights can be the result of the dot product of the query vector and the key vector. The spatial attention score is the normalized weight after normalization of the initial weights.

[0060] Specifically, based on the topological correlation characteristics of the power grid, linear transformation parameters are determined, and three independent linear transformation branches are constructed. These branches perform linear transformations on the node feature codes, generating corresponding query vectors, key vectors, and value vectors. The query vector is then multiplied by the key vectors of all nodes one by one to obtain initial weights representing the correlation strength between nodes. A normalization algorithm is used to process all initial weights, ensuring the sum of the weights satisfies a preset rule, generating spatial attention scores. The value vector of each node is multiplied by its corresponding spatial attention score, and all results are summed to obtain the feature aggregation result. It should be noted that the preset rule can be a pre-defined maximum value of the total weight sum; for example, the total weight sum is no greater than 1.

[0061] S220. Construct feature time series data based on feature aggregation results, and determine enhanced time series features based on feature time series data.

[0062] Among them, the feature time series data is the sequence data formed by organizing the feature aggregation results of different time periods according to the time dimension.

[0063] Specifically, based on the feature aggregation results of the target area at different time periods, the collection timestamps corresponding to each result are synchronously associated, and the aggregation results are sorted and aligned according to a unified time granularity to construct a preliminary feature time series dataset. The feature time series data is then enhanced with time series features to obtain enhanced time series features.

[0064] Based on the above technical solution, feature time-series data is constructed according to the feature aggregation results, and enhanced time-series features are determined based on the feature time-series data. This includes: arranging the feature aggregation results in chronological order to obtain feature time-series data, and generating time query vectors and time key vectors based on the feature time-series data; multiplying the time query vectors and time key vectors element-wise to obtain initial time weights, normalizing the initial time weights to generate time attention scores; and multiplying the time attention scores element-wise with the feature aggregation results to obtain enhanced time-series features.

[0065] The time query vector can be a vector of processed feature time-series data used to match time-related features. The time key vector can be understood as a vector representing the time attribute of the processed feature time-series data, used to match the time query vector to measure the strength of the association between time periods. The initial time weight can be the result of element-wise multiplication of the time query vector and the time key vector, used to initially quantify the degree of association between features in different time periods. The time attention score can be the normalized weights of the initial time weights.

[0066] Specifically, based on the feature aggregation results of each time period, the corresponding timestamps are associated and arranged chronologically to form feature time-series data. Then, based on the time intervals and evolution patterns of the time-series data, linear transformation parameters are determined, transformation branches are constructed, and time query vectors and time key vectors are generated. The two vectors are multiplied element-wise to obtain the initial time weights. A normalization algorithm is used to process the initial weights, generating time attention scores that conform to the weight allocation rules. These scores are then multiplied element-wise with the feature aggregation results of the corresponding time period to obtain the initial enhanced time-series features.

[0067] Based on the above technical solutions, it is possible to combine Figure 3 The technical solutions of the embodiments of the present invention will be further described, such as... Figure 3 As shown, operational data files at different times are obtained from the power grid dispatching system. These files include active power values ​​flowing through each node. Node names and corresponding active power values ​​are extracted, and a topology graph for each time moment is constructed. An adjacency matrix is ​​then established based on the topology graph (the value in the adjacency matrix is ​​1 when active power values ​​exist between nodes, otherwise it is 0). The characteristics of the nodes are encoded according to the adjacency matrix, including spatial characteristics (out-degree, in-degree) and active power values, with the active power value used as the label for each node. The encoded node characteristics are then linearly transformed to form q (the query vector). The system consists of three vectors: q (key vector) and v (value vector). Initial weights are generated by the dot product of q and v, and then normalized to form attention scores. V is then weighted and summed with the attention scores to achieve weighted aggregation of node features for each topology graph. The above results are used to construct time-series data according to the topology graph. Through linear transformation, f (query vector) and g (key vector) are constructed in the time step dimension. F and g are multiplied element-wise to obtain the attention score in the time step dimension. The attention score in the time step dimension is normalized and multiplied element-wise with the node features after the above aggregation, and then subjected to linear transformation to obtain the predicted value.

[0068] The technical solution of this invention overcomes the limitations of traditional graph convolutional models in local modeling and fixed topology by integrating attention mechanisms of spatial and temporal dimensions. It captures the topological characteristics of power flow operation more comprehensively, gets rid of the limitation of relying on fixed topology by global spatial attention, and captures nonlinear features by combining temporal attention, thus achieving more accurate power flow prediction.

[0069] Figure 4 This is a schematic diagram of the structure of a power grid flow prediction device provided in an embodiment of the present invention. Figure 4 As shown, the device includes: a data processing module 410, a feature encoding module 420, a time series processing module 430, and a power flow prediction module 440.

[0070] The data processing module 410 is used to acquire power grid operation data corresponding to the target area, and to establish a topology map and adjacency matrix corresponding to the target area based on the power grid operation data.

[0071] The feature encoding module 420 is used to determine the node feature encoding corresponding to each node in the topology graph based on the adjacency matrix.

[0072] The timing processing module 430 is used to determine the enhanced timing features corresponding to the target region based on node feature encoding;

[0073] The power flow prediction module 440 is used to perform a linear transformation on the enhanced time series characteristics to determine the power flow prediction value corresponding to the target area.

[0074] Based on the above technical solution, the data processing module is used to obtain the node operation data corresponding to each node in the target area from the power grid operation data, and determine the node name and active power value of each node; construct a topology graph with nodes as vertices and active power transmission relationships between nodes as edges, and establish an adjacency matrix based on the topology graph.

[0075] Based on the above technical solution, the data processing module is used to set the active value element in the adjacency matrix to a first value when there is active value between nodes, and to set the active value element in the adjacency matrix to a second value when there is no active value between nodes.

[0076] Based on the above technical solution, the feature encoding module is used to extract the spatial features of nodes based on the adjacency matrix. The spatial features include the out-degree and in-degree of the nodes. The active value of the nodes is used as an attribute feature and combined with the spatial features to form the initial node features. The initial node features are then standardized to obtain the node feature encoding.

[0077] Based on the above technical solution, the temporal processing module is used to perform weighted aggregation of node feature encodings through spatial attention mechanism to obtain feature aggregation results; construct feature temporal data based on feature aggregation results; and determine enhanced temporal features based on feature temporal data.

[0078] Based on the above technical solution, the temporal processing module is used to perform linear transformation on the node feature encoding to generate query vector, key vector and value vector; the dot product of query vector and key vector is used as initial weight, and the initial weight is normalized to generate spatial attention score; the value vector and spatial attention score are weighted and summed to obtain feature aggregation result.

[0079] Based on the above technical solution, the time series processing module is used to arrange the feature aggregation results in chronological order to obtain feature time series data, and generate time query vector and time key vector based on the feature time series data; multiply the time query vector and time key vector element by element to obtain the initial time weight, normalize the initial time weight to generate time attention score; multiply the time attention score and feature aggregation results element by element to obtain enhanced time series features.

[0080] The technical solution of this invention involves acquiring power grid operation data corresponding to a target area, and establishing a topology graph and adjacency matrix corresponding to the target area based on the power grid operation data; determining the node feature code corresponding to each node in the topology graph based on the adjacency matrix; determining the enhanced time-series features corresponding to the target area based on the node feature codes; and performing a linear transformation on the enhanced time-series features to determine the power flow prediction value corresponding to the target area. Based on the above technical solution, by establishing a topology graph and adjacency matrix to extract enhanced time-series features corresponding to the power grid, and then determining the power flow prediction value based on the enhanced time-series features, this invention achieves more accurate power grid power flow prediction by overcoming the limitations of relying on fixed topology structures through global spatial attention and by combining time attention to capture nonlinear features.

[0081] The power flow prediction device provided in the embodiments of the present invention can execute the power flow prediction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0082] Figure 5 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0083] like Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0084] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0085] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as power grid flow prediction methods.

[0086] In some embodiments, the power flow prediction method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the power flow prediction method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the power flow prediction method by any other suitable means (e.g., by means of firmware).

[0087] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0088] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0089] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0090] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0091] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0092] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0093] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0094] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A power grid power flow prediction method, characterized by, The method comprises: obtaining power grid operation data corresponding to a target area, and establishing a topology graph and an adjacency matrix corresponding to the target area according to the power grid operation data; determining a node feature code corresponding to each node in the topology graph based on the adjacency matrix; determining an enhanced time sequence feature corresponding to the target area based on the node feature code; determining a power flow prediction value corresponding to the target area by linearly transforming the enhanced time sequence feature.

2. The method of claim 1, wherein, The method of establishing the topology graph and the adjacency matrix corresponding to the target area according to the power grid operation data comprises: obtaining node operation data corresponding to each node in the target area from the power grid operation data, and determining a node name and an active value of each node; constructing the topology graph with nodes as vertices and active transmission relationships between nodes as edges, and establishing the adjacency matrix according to the topology graph.

3. The method of claim 2, wherein, The method of establishing the adjacency matrix according to the topology graph comprises: in the case that there is an active value between nodes, setting an active value element in the adjacency matrix to a first value; in the case that there is no active value between nodes, setting an active value element in the adjacency matrix to a second value.

4. The method of claim 1, wherein, The method of determining a node feature code corresponding to each node in the topology graph based on the adjacency matrix comprises: extracting a spatial feature of a node based on the adjacency matrix, wherein the spatial feature comprises an out-degree and an in-degree of the node; combining an active value of the node as an attribute feature with the spatial feature to form an initial node feature, and performing standardization processing on the initial node feature to obtain a node feature code.

5. The method of claim 1, wherein, The method of determining an enhanced time sequence feature corresponding to the target area based on the node feature code comprises: performing weighted aggregation on the node feature code through a spatial attention mechanism to obtain a feature aggregation result; constructing feature time sequence data according to the feature aggregation result, and determining the enhanced time sequence feature based on the feature time sequence data.

6. The method of claim 5, wherein, The method of performing weighted aggregation on the node feature code through a spatial attention mechanism to obtain a feature aggregation result comprises: performing linear transformation on the node feature code to generate a query vector, a key vector and a value vector; taking a dot product of the query vector and the key vector as an initial weight, and performing normalization on the initial weight to generate a spatial attention score; performing weighted summation on the value vector and the spatial attention score to obtain the feature aggregation result.

7. The method of claim 5, wherein, The method of constructing feature time sequence data according to the feature aggregation result, and determining the enhanced time sequence feature based on the feature time sequence data comprises: arranging the feature aggregation result in time sequence to obtain the feature time sequence data, and generating a time query vector and a time key vector according to the feature time sequence data; element-wise multiplying the time query vector and the time key vector to obtain an initial time weight, and performing normalization on the initial time weight to generate a time attention score; element-wise multiplying the time attention score and the feature aggregation result to obtain the enhanced time sequence feature.

8. A power grid power flow prediction device, characterized by, The method comprises: The data processing module is configured to acquire power grid operation data corresponding to a target region, and establish a topology graph and an adjacency matrix corresponding to the target region according to the power grid operation data. The feature coding module is configured to determine a node feature code corresponding to each node in the topology graph based on the adjacency matrix. The time sequence processing module is configured to determine an enhanced time sequence feature corresponding to the target region based on the node feature code. The power flow prediction module is configured to perform linear transformation on the enhanced time sequence feature to determine a power flow prediction value corresponding to the target region.

9. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the power grid power flow prediction method in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to implement the power grid power flow prediction method in any one of claims 1-7 when executed.