Link prediction method and device, equipment, storage medium and program product

By assigning Jaccard similarity as edge weight in the power network topology diagram, a heuristic network diagram is generated, and node features are extracted using the trained link prediction model, the problem of low accuracy of traditional link prediction methods is solved, and a higher link prediction accuracy is achieved.

CN120046775APending Publication Date: 2025-05-27CHINA SOUTHERN POWER GRID DIGITAL GRID GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510090594.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The traditional link prediction method based on graph autoencoder has low accuracy in power scenarios and cannot effectively utilize the indirect connection information in the network topology graph.

Method used

By assigning Jaccard similarity to power equipment nodes that do not have edge-connections as edge weights in the power network topology graph, a heuristic network graph is generated and inputted to the trained link prediction model to extract richer node features for link prediction.

Benefits of technology

The accuracy of link prediction is improved, and by using indirect connection information in the network topology graph, the understanding and prediction capabilities of the node relationship of power equipment are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120046775A_ABST
    Figure CN120046775A_ABST
Patent Text Reader

Abstract

The invention relates to a link prediction method and device, equipment, a storage medium and a program product, and relates to the technical field of artificial intelligence. The method comprises the following steps: in an electric power scene, obtaining an electric power network topological graph containing a plurality of electric power equipment nodes; any two power equipment nodes with an incidence relation in the power network topological graph are connected through an edge; aiming at any two power equipment nodes without edge connection in the power network topological graph, taking the Jaccard similarity between the two power equipment nodes as the edge weight of the two power equipment nodes to obtain a heuristic network graph of the power network topological graph; and inputting the heuristic network graph into a trained link prediction model to extract node features of each power equipment node in the heuristic network graph through the link prediction model, and performing link prediction based on the node features. By adopting the method, the link prediction accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and particularly to a link prediction method, apparatus, device, storage medium, and program product. Background Art

[0002] Link prediction refers to predicting whether a connection will be formed between two nodes in a network. Due to the wide existence of networks in various fields, this problem is of great significance in many applications. In the power scenario, link prediction has application value in optimizing power grid operation, improving the knowledge graph in the smart grid, etc. In the research of smart grids, link prediction is particularly important because it directly affects resource allocation and scheduling in the power system.

[0003] The method based on graph autoencoder (GAE) provides a solution for link prediction. The graph autoencoder first uses a graph neural network to generate embeddings of all nodes, and then represents the connection between them by aggregating the embeddings of the source node and the target node. However, the traditional link prediction process based on graph autoencoder only extracts features from the adjacency matrix, resulting in a low accuracy of link prediction. Summary of the Invention

[0004] Based on this, it is necessary to provide a link prediction method, apparatus, device, storage medium, and program product that can improve the accuracy of link prediction for the above technical problems.

[0005] In a first aspect, the present application provides a link prediction method, the method comprising:

[0006] In the power scenario, obtain a power network topology graph including multiple power device nodes; any two power device nodes with an association relationship in the power network topology graph are connected by an edge;

[0007] For any two power device nodes in the power network topology graph that are not connected by an edge, use the Jaccard similarity between the two power device nodes as the edge weight between the two power device nodes to obtain a heuristic network graph of the power network topology graph;

[0008] Input the heuristic network graph into a trained link prediction model to extract node features of each power device node in the heuristic network graph through the link prediction model, and perform link prediction based on the node features.

[0009] In a second aspect, the present application provides a link prediction apparatus, the apparatus comprising:

[0010] An acquisition module, configured to acquire a power network topology graph including multiple power device nodes in a power scenario; any two power device nodes with an association relationship in the power network topology graph are connected by an edge; for any two power device nodes that are not connected by an edge in the power network topology graph, the Jaccard similarity between the two power device nodes is used as the edge weight between the two power device nodes, so as to obtain a heuristic network graph of the power network topology graph;

[0011] A prediction module, configured to input the heuristic network graph into a trained link prediction model, so as to extract the node features of each power device node in the heuristic network graph through the link prediction model, and perform link prediction based on the node features.

[0012] In a third aspect, the present application provides a computer device, including a memory and a processor, where a computer program is stored in the memory, and when the processor executes the computer program, the steps in the method embodiments of the present application are implemented.

[0013] In a fourth aspect, the present application provides a computer-readable storage medium, storing a computer program, and when the computer program is executed by a processor, the steps in the method embodiments of the present application are implemented.

[0014] In a fifth aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps in the method embodiments of the present application are implemented.

[0015] The above link prediction method, device, equipment, storage medium and program product, by acquiring a power network topology graph including multiple power device nodes in a power scenario; any two power device nodes with an association relationship in the power network topology graph are connected by an edge; for any two power device nodes that are not connected by an edge in the power network topology graph, the Jaccard similarity between the two power device nodes is used as the edge weight between the two power device nodes, so as to obtain a heuristic network graph of the power network topology graph; inputting the heuristic network graph into a trained link prediction model, so as to extract the node features of each power device node in the heuristic network graph through the link prediction model, and perform link prediction based on the node features. Compared with the traditional link prediction method, the present application embeds the Jaccard similarity between two power device nodes that are not connected by an edge in the power network topology graph into the power network topology graph to obtain a heuristic network graph, and then inputs the heuristic network graph into a trained link prediction model to extract richer node features, and performs link prediction based on the rich node features, which can improve the accuracy of link prediction. Description of the Drawings

[0016] Figure 1It is an application environment diagram of the link prediction method in an embodiment;

[0017] Figure 2 It is a schematic flowchart of the link prediction method in an embodiment;

[0018] Figure 3 It is a structural diagram of the link prediction model in an embodiment;

[0019] Figure 4 It is a structural block diagram of the link prediction device in an embodiment;

[0020] Figure 5 It is an internal structural diagram of a computer device in an embodiment;

[0021] Figure 6 It is an internal structural diagram of a computer device in another embodiment. Detailed implementation manners

[0022] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0023] The link prediction method provided by the present application can be applied to the application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can be set up separately and can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or can be placed on the cloud or other servers. Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, vehicle-mounted terminals, intelligent voice interaction devices, aircraft, intelligent home appliances and portable wearable devices. The intelligent home appliances can be intelligent speakers, smart TVs, smart air conditioners, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or can also be a cloud server providing network security services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, cloud security, host security, etc., CDN, as well as basic cloud computing services such as big data and artificial intelligence platforms. The terminal 102 and the server 104 can be directly or indirectly connected through wired or wireless communication methods, and the present application does not make any restrictions here.

[0024] In a power scenario, server 104 can obtain a power network topology map containing multiple power device nodes from terminal 102; any two power device nodes with an association relationship in the power network topology map are connected by an edge. For any two power device nodes in the power network topology map that are not connected by an edge, server 104 can use the Jaccard similarity between the two power device nodes as the edge weight between the two power device nodes to obtain a heuristic network graph of the power network topology map. Server 104 can input the heuristic network graph into a trained link prediction model to extract the node features of each power device node in the heuristic network graph through the link prediction model and perform link prediction based on the node features.

[0025] It can be understood that this embodiment does not limit this, and it can be understood that Figure 1 the application scenarios in are only for illustrative purposes and are not limited thereto.

[0026] In one embodiment, as Figure 2 shown, a link prediction method is provided. This method can be applied to a computer device, and the computer device can be a terminal or a server. That is, this method can be executed independently by the terminal or the server, or can be implemented through the interaction between the terminal and the server. This embodiment takes the application of this method to a computer device as an example for illustration, including the following steps:

[0027] Step 202, in a power scenario, obtain a power network topology map containing multiple power device nodes; any two power device nodes with an association relationship in the power network topology map are connected by an edge.

[0028] Among them, a power device node refers to a power device in a power scenario as a network node in a power network topology map. Two power device nodes with an association relationship can mean that data transmission is supported between the power devices corresponding to the two power device nodes respectively.

[0029] Step 204, for any two power device nodes in the power network topology map that are not connected by an edge, use the Jaccard similarity between the two power device nodes as the edge weight between the two power device nodes to obtain a heuristic network graph of the power network topology map.

[0030] Step 206, input the heuristic network graph into a trained link prediction model to extract the node features of each power device node in the heuristic network graph through the link prediction model and perform link prediction based on the node features.

[0031] It can be understood that link prediction can predict whether there is a hidden edge between two power device nodes that are not originally connected in a power network topology map. Based on the link prediction result, the power network topology map can be further improved.

[0032] In the above link prediction method, in the power scenario, a power network topology graph including multiple power equipment nodes is obtained; any two power equipment nodes with an association relationship in the power network topology graph are connected by an edge; for any two power equipment nodes that are not connected by an edge in the power network topology graph, the Jaccard similarity between the two power equipment nodes is used as the edge weight between the two power equipment nodes to obtain a heuristic network graph of the power network topology graph; the heuristic network graph is input into a trained link prediction model to extract the node features of each power equipment node in the heuristic network graph through the link prediction model, and link prediction is performed based on the node features. Compared with the traditional link prediction method, in this application, the Jaccard similarity between pairwise power equipment nodes that are not connected by an edge in the power network topology graph is embedded into the power network topology graph to obtain a heuristic network graph, and then the heuristic network graph is input into a trained link prediction model to extract richer node features, and link prediction is performed based on the rich node features, which can improve the accuracy of link prediction.

[0033] In one embodiment, the method further includes: obtaining a sample power network topology graph and a sample heuristic network graph of the sample power network topology graph; inputting the sample heuristic network graph into a link prediction model to be trained to extract the sample node features of each sample power equipment node in the sample heuristic network graph through the link prediction model to be trained, and performing link prediction based on the sample node features to obtain the prediction link probability between pairwise sample power equipment nodes in the sample heuristic network graph; determining a target loss value according to the sample adjacency matrix and the prediction link probability of the sample power network topology graph; training the link prediction model to be trained based on the target loss value to obtain a trained link prediction model.

[0034] In one embodiment, the computer device can determine a first loss value according to the sample adjacency matrix and the prediction link probability of the sample power network topology graph, and use the first loss value as the target loss value, and then train the link prediction model to be trained based on the target loss value to obtain a trained link prediction model.

[0035] In the above embodiment, by inputting the sample heuristic network graph into the link prediction model for link prediction, obtaining the prediction link probability between pairwise sample power equipment nodes in the sample heuristic network graph, and determining the target loss value according to the sample adjacency matrix and the prediction link probability of the sample power network topology graph to train the link prediction model, the link prediction accuracy of the link prediction model can be improved.

[0036] In one embodiment, determining the target loss value according to the sample adjacency matrix and the predicted link probability of the sample power network topology diagram includes: determining a first loss value according to the sample adjacency matrix and the predicted link probability of the sample power network topology diagram; determining the distance and cosine similarity between each pair of sample power equipment nodes according to the sample node features of each pair of sample power equipment nodes in the sample heuristic network diagram; determining a second loss value according to the distance, cosine similarity and predicted link probability; and determining the target loss value according to the first loss value and the second loss value.

[0037] In one embodiment, the first loss value can be calculated by the following formula:

[0038]

[0039] Where, Ai,j represents the sample adjacency matrix. It can be understood that if we set G=(V, E) as the sample power network topology diagram, where V is the vertex set, that is, the set of sample power equipment nodes, i, j ∈ V, and E is the observed connection set, that is, the set of edges (i, j). If (i, j) ∈ E, then Ai,j =1, otherwise Ai,j =0. represents the predicted link probability. l oss_1 represents the first loss value.

[0040] In one embodiment, the second loss value can be calculated by the following formula:

[0041]

[0042] Where, f i , f j respectively represent the sample node features of the two sample power equipment nodes i and j in the sample heuristic network diagram, distance(f i , f j ) represents the distance between the two sample power equipment nodes i and j, and cosine(f i , f j ) represents the cosine similarity between the two sample power equipment nodes i and j. loss_cn represents the second loss value.

[0043] In one embodiment, the target loss value l oss can be calculated by the following formula:

[0044]

[0045] In one embodiment, such as Figure 3As shown, in the model training stage, the computer device can obtain a sample power network topology graph and a sample heuristic network graph of the sample power network topology graph; and input the sample heuristic network graph into the link prediction model to be trained (MHGAT model). Among them, the link prediction model includes a multi-scale hybrid self-attention layer for capturing graph structure information at different scales. The computer device can extract the sample node features of each sample power device node in the sample heuristic network graph through the link prediction model to be trained, and perform link prediction based on the sample node features to obtain the predicted link probability between pairwise sample power device nodes in the sample heuristic network graph; determine the first loss value (i.e., the prediction loss value) according to the sample adjacency matrix and the predicted link probability of the sample power network topology graph; determine the distance and cosine similarity between pairwise sample power device nodes according to the sample node features of pairwise sample power device nodes in the sample heuristic network graph; determine the second loss value (i.e., the reconstruction loss value) according to the distance, cosine similarity, and predicted link probability; determine the target loss value according to the first loss value and the second loss value; and train the link prediction model to be trained based on the target loss value to obtain a trained link prediction model. In the model inference stage, in a power scenario, the computer device can obtain a power network topology graph including multiple power device nodes; any two power device nodes with an association relationship in the power network topology graph are connected by an edge; for any two power device nodes in the power network topology graph that are not connected by an edge, the Jaccard similarity between the two power device nodes is used as the edge weight between the two power device nodes to obtain a heuristic network graph of the power network topology graph; and input the heuristic network graph into the trained link prediction model to extract the node features of each power device node in the heuristic network graph through the link prediction model and perform link prediction based on the node features.

[0046] In the above embodiment, determining the first loss value according to the sample adjacency matrix and the predicted link probability of the sample power network topology graph, and determining the second loss value according to the distance between pairwise sample power device nodes, the cosine similarity between pairwise sample power device nodes, and the predicted link probability, and then further determining the target loss value according to the first loss value and the second loss value to train the link prediction model can further improve the link prediction accuracy of the link prediction model.

[0047] In one embodiment, the link prediction model includes a multi-scale hybrid self-attention layer for capturing graph structure information at different scales; the multi-scale hybrid self-attention layer includes a hybrid similarity function component, an attention coefficient component, and a multi-scale attention feature component; the hybrid similarity function defined by the hybrid similarity function component is used to evaluate the similarity between two corresponding power equipment nodes by determining the similarity between two input node features; the attention coefficient defined by the attention coefficient component is used to measure the importance of power equipment nodes in the link prediction process; the multi-scale attention feature component is used to extract node features of power equipment nodes based on the attention coefficient.

[0048] In the above embodiment, by introducing a multi-scale hybrid self-attention layer into the link prediction model, the graph structure information at different scales in the heuristic network graph can be captured. Compared with the graph structure information of a single scale, link prediction using multi-scale graph structure information can further improve the link prediction accuracy.

[0049] In one embodiment, the hybrid similarity function is constructed from a cosine similarity function and a distance function; the cosine similarity function is used to determine the cosine similarity between two power equipment nodes in the heuristic network graph; the distance function is used to determine the distance between two power equipment nodes in the heuristic network graph.

[0050] In one embodiment, the link prediction model (MHGAT model) uses a graph convolutional network (GCN) to calculate node features z i and z j for power equipment nodes i and j. The predicted link probability of link (i, j) can be calculated by the following formula:

[0051]

[0052] where Z is the node feature matrix output by the link prediction model, and the i-th row of Z is the representation z of power equipment node i i , is the predicted link probability of link (i, j), and σ is the Sigmoid function. The link prediction model introduces a multi-scale attention mechanism for extracting features of different-sized neighborhoods.

[0053] In one embodiment, the hybrid similarity function is defined as follows:

[0054]

[0055] where the subscript i is the i-th component, z a ,z bThey are vectors of two node features respectively. To capture different levels of influence caused by node similarity and customize this influence to adapt to specific tasks, this application defines the hybrid similarity function as follows:

[0056] Hyb_Sim ij∈adj_1 = MLP(Hz i , Hz j )

[0057] = ReLU(W × [Cosine(Hz i , Hz j ), Distance(Hz i , Hz j )])

[0058] Among them, W and H are learnable weights, z i and z j are node features respectively, adj1 is an attention of one scale, and MLP() is a multi-layer perceptron (MLP) containing a single layer, and this layer uses the ReLU activation function to avoid the vanishing gradient of the hybrid similarity function.

[0059] In one embodiment, based on the hybrid similarity function defined above, this application introduces an attention coefficient, which is defined as follows:

[0060]

[0061] Among them, according to the attention coefficient, the attention feature of the power equipment node i can be expressed as:

[0062] h i = ReLU(Σ j α ij∈adj_1 Vz j )

[0063] In one embodiment, an average multi-head attention mechanism is introduced to construct the attention feature of the power equipment node i:

[0064]

[0065] It can be understood that k represents the attention of the kth scale. After calculating the attention feature of the small-scale neighborhood adj1, this application can continue to calculate the attention features of two larger-scale neighborhoods. Specifically, this application can consider three different scales: 1, 2, and 3.

[0066] In the above embodiment, a hybrid similarity function is constructed through the cosine similarity function and the distance function to obtain the hybrid similarity between pairwise power equipment nodes in the heuristic network graph. Compared with the single similarity, link prediction through the hybrid similarity can further improve the link prediction accuracy.

[0067] In one embodiment, the method further includes: for any two power device nodes that are not connected by an edge in the power network topology graph, obtaining the respective neighbor node sets of the two power device nodes; and determining the Jaccard similarity between the two power device nodes according to the ratio of the intersection to the union of the respective neighbor node sets of the two power device nodes.

[0068] In one embodiment, the Jaccard similarity between two power device nodes can be calculated by the following formula:

[0069]

[0070] where x and y respectively represent the respective neighbor node sets of two power device nodes that are not connected by an edge in the power network topology graph. Jac(x, y) represents the Jaccard similarity between the two power device nodes.

[0071] In the above embodiment, by determining the Jaccard similarity between two power device nodes based on the ratio of the intersection to the union of the respective neighbor node sets of the two power device nodes, the accuracy of the Jaccard similarity can be improved, thereby further improving the accuracy of link prediction.

[0072] It should be understood that although the steps in the flowcharts of the above embodiments are shown in sequence, these steps are not necessarily executed in sequence. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.

[0073] In one embodiment, as Figure 4 shown, a link prediction device 400 is provided, and the device specifically includes:

[0074] An acquisition module, configured to obtain a power network topology graph including multiple power device nodes in a power scenario; any two power device nodes with an association relationship in the power network topology graph are connected by an edge; for any two power device nodes that are not connected by an edge in the power network topology graph, taking the Jaccard similarity between the two power device nodes as the edge weight between the two power device nodes to obtain a heuristic network graph of the power network topology graph;

[0075] A prediction module, configured to input a heuristic network graph into a trained link prediction model, extract node features of each power equipment node in the heuristic network graph through the link prediction model, and perform link prediction based on the node features.

[0076] In one embodiment, the apparatus further includes:

[0077] A training module, configured to obtain a sample power network topology graph and a sample heuristic network graph of the sample power network topology graph; input the sample heuristic network graph into a link prediction model to be trained, extract sample node features of each sample power equipment node in the sample heuristic network graph through the link prediction model to be trained, and perform link prediction based on the sample node features to obtain prediction link probabilities between pairwise sample power equipment nodes in the sample heuristic network graph; determine a target loss value according to the sample adjacency matrix and the prediction link probabilities of the sample power network topology graph; and train the link prediction model to be trained based on the target loss value to obtain a trained link prediction model.

[0078] In one embodiment, the training module is further configured to determine a first loss value according to the sample adjacency matrix and the prediction link probabilities of the sample power network topology graph; determine the distance and cosine similarity between pairwise sample power equipment nodes according to the sample node features of each pairwise sample power equipment node in the sample heuristic network graph; determine a second loss value according to the distance, cosine similarity, and prediction link probabilities; and determine the target loss value according to the first loss value and the second loss value.

[0079] In one embodiment, the link prediction model includes a multi-scale hybrid self-attention layer for capturing graph structure information at different scales; the multi-scale hybrid self-attention layer includes a hybrid similarity function component, an attention coefficient component, and a multi-scale attention feature component; the hybrid similarity function defined by the hybrid similarity function component is used to evaluate the similarity between corresponding two power equipment nodes by determining the similarity between two input node features; the attention coefficient defined by the attention coefficient component is used to measure the importance of the power equipment node in the link prediction process; and the multi-scale attention feature component is used to extract node features of the power equipment node based on the attention coefficient.

[0080] In one embodiment, the hybrid similarity function is constructed by a cosine similarity function and a distance function; the cosine similarity function is used to determine the cosine similarity between pairwise power equipment nodes in the heuristic network graph; and the distance function is used to determine the distance between pairwise power equipment nodes in the heuristic network graph.

[0081] In one embodiment, the obtaining module is further configured to obtain the respective neighbor node sets of any two power device nodes that are not connected by an edge in the power network topology diagram; and determine the Jaccard similarity between the two power device nodes according to the ratio of the intersection to the union of the respective neighbor node sets of the two power device nodes.

[0082] The above-mentioned link prediction device obtains a power network topology diagram including multiple power device nodes in a power scenario; any two power device nodes with an association relationship in the power network topology diagram are connected by an edge; for any two power device nodes that are not connected by an edge in the power network topology diagram, the Jaccard similarity between the two power device nodes is used as the edge weight between the two power device nodes to obtain a heuristic network diagram of the power network topology; the heuristic network diagram is input into a trained link prediction model to extract the node features of each power device node in the heuristic network diagram through the link prediction model, and link prediction is performed based on the node features. Compared with the traditional link prediction method, in this application, the Jaccard similarity between any two power device nodes that are not connected by an edge in the power network topology diagram is embedded into the power network topology diagram to obtain a heuristic network diagram, and then the heuristic network diagram is input into a trained link prediction model to extract richer node features, and link prediction is performed based on the rich node features, which can improve the accuracy of link prediction.

[0083] Each module in the above-mentioned link prediction device can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above-mentioned modules.

[0084] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 5As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it realizes a link prediction method.

[0085] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as Figure 6 shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be achieved through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it realizes a link prediction method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad set on the shell of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0086] Those skilled in the art can understand that Figure 5 and Figure 6The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0087] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0088] In one embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0089] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0090] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.

[0091] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the above method embodiments. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in this application may include at least one of non-volatile and volatile memories. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0092] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0093] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.

Claims

1. A link prediction method, characterized in that: The method comprises: In an electric power scenario, a power network topology diagram including a plurality of electric power equipment nodes is obtained; any two electric power equipment nodes having an associated relationship in the power network topology diagram are connected through an edge; For any two power equipment nodes that are not connected by an edge in the power network topology graph, the Jaccard similarity between the two power equipment nodes is used as the edge weight of the two power equipment nodes to obtain a heuristic network graph of the power network topology graph; The heuristic network diagram is input into a trained link prediction model to extract node features of each power equipment node in the heuristic network diagram through the link prediction model, and link prediction is performed based on the node features.

2. The method according to claim 1, characterized in that The method further comprises: Obtaining a sample power network topology map and a sample heuristic network map of the sample power network topology map; The sample heuristic network graph is input into the link prediction model to be trained, so as to extract the sample node features of each sample power equipment node in the sample heuristic network graph through the link prediction model to be trained, and link prediction is performed based on the sample node features to obtain the predicted link probability between each two sample power equipment nodes in the sample heuristic network graph; Determining a target loss value according to a sample adjacency matrix of the sample power network topology graph and the predicted link probability; The link prediction model to be trained is trained based on the target loss value to obtain a trained link prediction model.

3. The method according to claim 2, characterized in that The step of determining a target loss value according to the sample adjacency matrix of the sample power network topology graph and the predicted link probability comprises: Determining a first loss value according to a sample adjacency matrix of the sample power network topology graph and the predicted link probability; Determine the distance and cosine similarity between the two sample power equipment nodes according to the sample node characteristics of each two sample power equipment nodes in the sample heuristic network diagram; Determining a second loss value according to the distance, the cosine similarity and the predicted link probability; A target loss value is determined according to the first loss value and the second loss value.

4. The method according to claim 1, characterized in that: The link prediction model includes a multi-scale hybrid self-attention layer for capturing graph structure information at different scales; the multi-scale hybrid self-attention layer includes a hybrid similarity function component, an attention coefficient component and a multi-scale attention feature component; The hybrid similarity function defined by the hybrid similarity function component is used to evaluate the similarity between two corresponding power equipment nodes by determining the similarity between the features of two input nodes; the attention coefficient defined by the attention coefficient component is used to measure the importance of the power equipment node in the link prediction process; the multi-scale attention feature component is used to extract the node features of the power equipment node based on the attention coefficient.

5. The method according to claim 4, characterized in that The hybrid similarity function is constructed by a cosine similarity function and a distance function; the cosine similarity function is used to determine the cosine similarity between any two power equipment nodes in the heuristic network diagram; the distance function is used to determine the distance between any two power equipment nodes in the heuristic network diagram.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: For any two power equipment nodes that are not connected by an edge in the power network topology graph, obtaining respective neighbor node sets of the two power equipment nodes; The Jaccard similarity between the two power equipment nodes is determined according to the ratio of the intersection and the union of the neighbor node sets of the two power equipment nodes.

7. A link prediction device, characterized in that: The device comprises: An acquisition module is used to acquire, in an electric power scenario, an electric power network topology diagram including a plurality of electric power equipment nodes; any two electric power equipment nodes having an associated relationship in the electric power network topology diagram are connected by an edge; for any two electric power equipment nodes that are not connected by an edge in the electric power network topology diagram, the Jaccard similarity between the two electric power equipment nodes is used as the edge weight of the two electric power equipment nodes to obtain a heuristic network diagram of the electric power network topology diagram; A prediction module is used to input the heuristic network diagram into a trained link prediction model to extract node features of each power equipment node in the heuristic network diagram through the link prediction model, and perform link prediction based on the node features.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.