Dynamic graph prediction method and device based on tense motif message passing
By introducing a temporal model extension module and a temporal model message delivery network in dynamic graph prediction, the problem that the prior art is difficult to capture the higher-order correlation between dynamic graph nodes is solved, and more accurate dynamic graph prediction is achieved.
Patent Information
- Application Number
- CN202510261306.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-04-08
AI Technical Summary
Existing dynamic graph prediction methods only model interactions between dynamic graph nodes, making it difficult to capture higher-order correlations between nodes.
The dynamic graph prediction method based on temporal model message delivery is adopted, and the temporal model is expanded through the temporal model expansion module, and the relationship between the temporal model edges is modeled using the temporal model message delivery network, and the representation of the temporal model edges and nodes is updated to capture the higher-order correlation between nodes.
By introducing the temporal model expansion module and the temporal model message delivery network, it is possible to capture the complex interaction modes and higher-order correlations between nodes in the dynamic graph more carefully, and improve the accuracy of dynamic graph prediction.
Smart Images

Figure CN119782823A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of dynamic graph prediction, and in particular to a dynamic graph prediction method and device based on temporal motif message transmission. Background Art
[0002] The entities in the network and the relationships between them can be modeled as nodes and edges in the graph structure, respectively. These networks are commonly found in many complex systems in the real world, such as email communication networks, social networking platforms, knowledge sharing communities, and e-commerce systems. In the past, researchers modeled complex systems in the real world as static graphs that do not change over time, but this has the disadvantage of not being able to perceive changes in complex systems over time. Therefore, researchers have begun to focus more and more attention on dynamic graphs, which are graph structures that can change over time. The nodes, edges, and attributes of dynamic graphs can be continuously added, deleted, or updated over time.
[0003] Dynamic graph prediction refers to predicting the edges of the network that may be generated next based on past dynamic graph data. According to the representation of the dynamic graph, dynamic graph prediction can be divided into discrete time dynamic graph prediction and continuous time dynamic graph prediction.
[0004] Discrete-time dynamic graphs divide the complete dynamic graph into a sequence of snapshots at pre-set time intervals, where each snapshot can be regarded as a static graph. These snapshots capture the state of the graph at different time points. The addition and deletion of nodes, the formation and disappearance of edges, and the changes in node and edge attributes between different snapshots reflect the changes of the dynamic graph over time. Discrete-time dynamic graph prediction methods capture the spatial structure information of the graph in the snapshots and mine the change rules of the dynamic graph from the snapshot sequence at fixed time intervals. However, this type of method describes the changes of the dynamic graph over time in the form of a snapshot sequence, which will lose the time information in the snapshot, making it difficult to obtain fine-grained time information, and cannot capture the spatial and temporal information of the dynamic graph at the same time.
[0005] Continuous-time dynamic graphs represent dynamic graphs as sequences of edges with timestamps. Compared with discrete-time dynamic graphs, continuous-time dynamic graphs can capture the situations of nodes at different time points more finely, provide more fine-grained temporal information, and more accurately reflect the changes in the dynamic graph structure over time. In continuous-time dynamic graphs, temporal neighbors are crucial for understanding the historical behavior of nodes, predicting their future behavior, and analyzing their roles in the entire dynamic graph. Temporal neighbors refer to all other nodes that have directly interacted with a node before the current moment. Current continuous-time dynamic graph prediction methods capture the fine-grained spatial and temporal structural information of dynamic graphs by aggregating information from temporal neighbors, but ignore the high-order structure of dynamic graphs, making it difficult to model complex interaction patterns between nodes in dynamic graphs.
[0006] A motif refers to a subgraph structure that appears more times than the random expectation in a graph. It is composed of a certain number of nodes in a specific structure. It is a basic building block in complex graph structure data and a high-order structure that can reflect the important characteristics of the graph. Temporal motifs are motifs in dynamic graphs. They introduce time information on the basis of general motifs and can reflect the complex interaction patterns between nodes in dynamic graphs. Each edge in a temporal motif has specific semantic information, and the nodes that constitute the same temporal motif edge have certain high-order correlations. Some existing continuous-time dynamic graph prediction methods introduce temporal motifs. These methods construct additional features based on temporal motifs to enhance the perception of complex interaction patterns between nodes. However, these methods only model direct interactions between nodes and find it difficult to capture high-order correlations between nodes. Summary of the invention
[0007] The purpose of the present invention is to provide a dynamic graph prediction method and device based on temporal motif message passing, which is used to solve the problem that the existing dynamic graph prediction methods only model the interaction between dynamic graph nodes and are difficult to capture the high-order correlation between nodes.
[0008] To achieve the above-mentioned purpose of the invention, an embodiment provides a dynamic graph prediction method based on temporal motif message transmission, comprising the following steps: The edges in the dynamic graph of the friend relationship network on the social platform are used as samples to construct a training data set and the training data set is divided into batches. The extended temporal motifs are obtained based on the temporal motif extension module. Index a batch of training samples from the training data set, and based on the edges composed of two target nodes on the edges to be predicted in the training samples, respectively construct subgraphs of the two target nodes, and generate corresponding subgraph co-occurrence codes; Combined with subgraph co-occurrence encoding, in the temporal motif message passing network, the representation of the temporal motif edge is obtained according to the indicator matrix, the relationship between the temporal motif edges is modeled by graph structure learning and the representation of the temporal motif edge is updated, and then the representation of the node in the subgraph is updated based on the updated representation of the temporal motif edge combined with the indicator matrix; The updated representations of the nodes in the aggregated subgraphs are used to obtain the representation of the target node, and the dynamic graph prediction model is constructed. All training data sets are iteratively trained to optimize the dynamic graph prediction model, and the edges that may be generated in the dynamic graph are predicted based on the optimized dynamic graph prediction model.
[0009] In one embodiment, the temporal motif expansion module is used to obtain the extended temporal motif, including: defining the temporal motif as an edge sequence that is sorted in chronological order and occurs within a time window; in the temporal motif expansion module, for a predefined temporal motif set For each temporal motif in , the predefined temporal motif is expanded into several temporal motifs according to the time window size, and the expanded temporal motif set is recorded as .
[0010] In one embodiment, the generating of the corresponding subgraph co-occurrence code includes: obtaining subgraph co-occurrence features of the nodes in the subgraph based on the frequency of occurrence of the nodes in the subgraph in the two target node sequences, and encoding the subgraph co-occurrence features to obtain the subgraph co-occurrence code.
[0011] In one embodiment, encoding the subgraph co-occurrence features comprises: encoding the subgraph co-occurrence features from the subgraph co-occurrence features Extract the first column and the second column , input these two columns into the same multi-layer perceptron encoder for feature transformation, and add the two outputs to get the sub-graph co-occurrence code : , in, is a multi-layer perceptron encoder, sub-graph co-occurrence feature Represents a node sequence The middle node in the node sequence and The frequency of occurrence in is the subgraph co-occurrence feature The first column represents the node sequence The middle node in the node sequence The frequency of occurrence in is the subgraph co-occurrence feature The second column represents the node sequence The middle node in the node sequence The frequency of occurrence in For the moment.
[0012] In one embodiment, the indicator matrix is used to describe the affiliation between a node in a subgraph and all temporal motif edges, including: for each temporal motif, searching all instances of the temporal motif in the subgraph, counting the frequency of occurrence of the node on each edge of the instance in the subgraph, expressing the frequency of occurrence as a feature of the node in the subgraph based on the temporal motif and normalizing it, obtaining an indicator vector describing the affiliation between the node in the subgraph and the edge of the temporal motif, aggregating the indicator vectors of all nodes in the subgraph to construct an indicator matrix describing the affiliation between the node in the subgraph and the edge of the temporal motif, and obtaining an indicator matrix describing the affiliation between the node in the subgraph and all temporal motif edges by splicing the indicator matrices corresponding to each temporal motif.
[0013] In one embodiment, the method of obtaining the representation of temporal motif edges according to the indicator matrix includes: obtaining time difference coding by encoding the time difference between nodes, generating an initial representation of the nodes in the node sequence based on the node features, edge features, time difference coding and subgraph co-occurrence coding of the nodes in the node sequence, and obtaining the representation of the temporal motif edges in the subgraph based on the initial representation of the nodes in the node sequence in combination with the indicator matrix.
[0014] In one embodiment, the method of using graph structure learning to model the relationship between temporal motif edges and updating the representation of temporal motif edges includes: obtaining an adjacency matrix describing the relationship between temporal motif edges through graph structure learning, and obtaining an updated representation of the temporal motif edges through a multilayer perceptron encoder based on the adjacency matrix, wherein the adjacency matrix is represented as Constructed by: , , in, is a parameterized memory state that constructs the graph structure between the edges of the temporal motifs. represents the expanded temporal motif set, and It is a fully connected network. represents the transpose operation, Normalize the input to between 0 and 1 to generate soft relationships between temporal motif edges. Indicates For input The output of the code, Indicates For input Encoded output.
[0015] In one embodiment, the updated representation of the nodes in the aggregated subgraph obtains the representation of the target node, including: using a Transformer encoder to capture the spatial and temporal information between the nodes in the subgraph of the two target nodes, wherein the Transformer encoder is composed of a plurality of layers of network modules, each layer of the network module has a multi-head self-attention network and a fully connected network, and average pooling is used to obtain the representation of the target node from the output of the multi-head self-attention network.
[0016] In one embodiment, the construction of the dynamic graph prediction model includes: splicing the representation of the target node and inputting it into the multi-layer perceptron encoder, calculating the target node at time Generate edge probabilities and loss functions to complete the construction of the dynamic graph prediction model.
[0017] The present invention also provides a dynamic graph prediction device based on temporal motif message passing, comprising a memory and a processor, wherein the memory is used to store a computer program, and wherein the processor is used to implement the dynamic graph prediction method based on temporal motif message passing when executing the computer program.
[0018] Compared with the prior art, the present invention has the following beneficial effects: (1) By introducing the temporal motif extension module, the temporal motif is expanded into several types of temporal motifs according to the time window size to capture more fine-grained complex interaction pattern information; (2) By introducing a temporal motif message passing network, the representation of the temporal motif edges is obtained according to the indicator matrix that describes the affiliation between the nodes in the subgraph and all the temporal motif edges. The relationship between the temporal motif edges is constructed using graph structure learning to update the representation of the temporal motif edges. The updated representation of the temporal motif edges is used to update the representation of the nodes to capture the high-order correlation between the nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0020] Figure 1 A schematic flow chart of a dynamic graph prediction method based on temporal motif message passing provided in an embodiment.
[0021] Figure 2 A schematic diagram of a specific implementation structure of dynamic graph prediction based on temporal motif message transmission provided in an embodiment.
[0022] Figure 3 These are the five common temporal motifs in dynamic graphs.
[0023] Figure 4 To construct a temporal-based Examples of features. DETAILED DESCRIPTION
[0024] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.
[0025] In order to collect more fine-grained complex interaction pattern information and capture high-order correlations between nodes, the embodiment provides a dynamic graph prediction method based on temporal motif message passing, such as Figure 1 As shown, the following steps are included: S1. Use the edges in the dynamic graph of the friend relationship network on the social platform as samples to construct a training data set and divide the training data set into batches, and obtain the extended temporal motif based on the temporal motif expansion module.
[0026] like Figure 2 As shown, based on the friend recommendation on the social networking platform, the input is defined as The dynamic graph represents the friendship network, and the dynamic graph contains edges sorted in chronological order. As a sample, we get the training data set, where the triples Representation Node and exist There is an edge at all times, indicating that the user and users exist A friendship was formed at all times.
[0027] Next, the temporal motif is defined as a sequence of edges that are sorted in chronological order and occur within a time window. In the temporal motif extension module, for the predefined temporal motif set For each temporal motif in , the predefined temporal motif is expanded into several temporal motifs according to the time window size, and the expanded temporal motif set is recorded as .
[0028] Specifically, the time window size is The temporal motif is specifically defined as , where the number of edges within the temporal motif is , No. side and , whose timestamp satisfies and , Figure 3 Five common temporal motifs in dynamic graphs are given in.
[0029] In the temporal pattern extension module, according to the time window size Temporal motifs Expand to kind of tense pattern. , after expansion Temporal motifs The corresponding time window size is ,in , the expanded temporal motif set is recorded as .
[0030] The dynamic graph The edge set in is used as the training data set, and the batch size is set based on human experience. , divided into batches according to the order of interaction occurrence and fixed batch size, the total number of batches is , the specific calculation method is as follows: ,in Represents the total number of samples in the training dataset.
[0031] S2. Index a batch of training samples from the training data set, and based on the edges composed of two target nodes on the edges to be predicted in the training samples, respectively construct subgraphs of the two target nodes and generate corresponding subgraph co-occurrence codes.
[0032] Sequentially select indexes from the training dataset as A batch of training samples, where , and perform subsequent steps for each sample in the batch. For example, according to the target node exist Participated in the formation before the moment Get dynamic graph of edges A subgraph of ,in and , used to reflect the node Spatial structure, temporal structure and interaction pattern; The characteristic of the moment is recorded as . Subgraph The node sequence is , the node characteristics of the nodes in this node sequence are . Similarly, the target node can be obtained Subgraph of , edge features , node sequence And the node characteristics of the nodes in the node sequence .
[0033] In the embodiment, in order to model the subgraph and The relationship between the nodes, let the nodes is a node sequence The nodes, using Subgraph co-occurrence features at each moment Representation Node In the node sequence and The frequency of occurrence in is a node sequence The nodes, using subgraph co-occurrence features Representation Node In the node sequence and The frequency of occurrence in and is a two-dimensional vector.
[0034] Assumptions , then the node sequence Nodes in , , and exist The frequencies of occurrence in are , , and , so the node sequence The subgraph co-occurrence features of each node in are ; Node sequence Nodes in , , and exist The frequencies of occurrence in are , , and , so the node sequence The subgraph co-occurrence features of each node in are .Will Time node sequence The subgraph co-occurrence feature of the midpoint is recorded as , encode it to obtain the node sequence Subgraph co-occurrence encoding of midpoints : , in, is a multi-layer perceptron encoder, sub-graph co-occurrence feature Represents a node sequence The middle node in the node sequence and The frequency of occurrence in is the subgraph co-occurrence feature The first column represents the node sequence The middle node in the node sequence The frequency of occurrence in is the subgraph co-occurrence feature The second column represents the node sequence The middle node in the node sequence The frequency of occurrence in is the time. Similarly, we can get the node sequence Subgraph co-occurrence encoding of midpoints .
[0035] S3. Combined with subgraph co-occurrence encoding, in the temporal motif message passing network, the representation of the temporal motif edges is obtained according to the indicator matrix, the relationship between the temporal motif edges is modeled using graph structure learning and the representation of the temporal motif edges is updated, and then the representation of the nodes in the subgraph is updated based on the updated representation of the temporal motif edges combined with the indicator matrix.
[0036] In the temporal motif message passing network, for the temporal motif set Any temporal motif in , in the subgraph Search for temporal motifs in All instances of Node is a node sequence The nodes, whose timestamp is ,feature For timestamp equal to Node In all the above examples, The frequency of occurrence in the edge. Aggregation node In the temporal mode The above features on all edges get nodes In the subgraph Temporal motifs Features Similarly, let the node is a node sequence The nodes, you can get the node In the subgraph Temporal motifs Features .
[0037] Figure 4 To construct a temporal-based An example of a feature of . The time window size is , there are 3 edges in total, the first edge , the second edge , the third edge The timestamp of the edge is in seconds (s), and the subgraph is constructed based on the dynamic graph. and ,like Figure 4 From the subgraph Search in Examples , we can get Search in Examples and .from Figure 4 Zhongkede , and its corresponding timestamp is , , and its corresponding timestamp is .when hour, , only one edge satisfies the condition: The first edge of hour, , only one edge satisfies the condition: The second side of . Therefore .when hour, , there are 2 edges that satisfy the condition: No. Strip edge and No. edge; when hour, , there are 2 edges that satisfy the condition: The second side and The second side of . Therefore . For nodes In the subgraph Temporal motifs Features Normalize and get the description node exist Moment subgraph Middle and tense motifs The indicator vector of the membership relationship between the edges : .
[0038] Aggregate Node Sequence The indicator vectors of all nodes in get the description node sequence Midpoints and Temporal Motifs The indicator matrix of the membership relationship between the edges The description node sequence is obtained by splicing in the following way Indicator matrix of membership relationship between midpoint nodes and all temporal motif edges : , in Represents a splicing operation, Indicates time.
[0039] Then based on the description subgraph The indicator matrix of the membership relationship between the midpoint and all temporal motif edges obtains the representation of the temporal motif edges. Similarly, the subgraph Representation of temporal motif edges in .
[0040] Specifically, the node is a node sequence The nodes, whose timestamp is , in order to obtain the time information between nodes, the encoding time difference , get the time difference code ,in is a trainable parameter, is the dimension of the temporal difference encoding.
[0041] The node sequence The time difference encoding of the intermediate nodes is recorded as . Similarly, we can get the node sequence The time difference encoding of the intermediate nodes is recorded as .
[0042] The node sequence Node characteristics of midpoint , edge features , Time Difference Coding and subgraph co-occurrence encoding The node sequence is obtained by processing in the following way Initial representation of midpoints : , , in Can be , and is a trainable parameter, Represents a splicing operation, Indicates time.
[0043] Based on description subgraph Indicator matrix of membership relationship between midpoint nodes and all temporal motif edges , the subgraph is obtained by Representation of Temporal Motif Edges : , in represents the transpose operation, represents a fully connected network. Similarly, we can get the subgraph Representation of Temporal Motif Edges , Indicates the time, is a node sequence Initial representation of midpoints.
[0044] Then, we use graph structure learning to obtain the adjacency matrix describing the relationship between the edges of the temporal motifs. , used to model subgraphs The relationship between the temporal motif edges: , , in, is a parameterized memory state that constructs the graph structure between the edges of the temporal motifs. represents the expanded temporal motif set, and It is a fully connected network. represents the transpose operation, Normalize the input to between 0 and 1 to generate soft relationships between temporal motif edges. Indicates For input The output of the code, Indicates For input Encoded output.
[0045] Using the adjacency matrix Get subgraph Representation of the updated temporal motif edge in : , in is a multilayer perceptron encoder that updates the representation of temporal motif edges.
[0046] Subgraph-based Representation of the updated temporal motif edge in and describe the node sequence Indicator matrix of membership relationship between midpoint nodes and all temporal motif edges , the node sequence is obtained by The updated representation of all nodes in can be obtained : , in is the multi-layer perceptron encoder that updates the node representation. Similarly, the node sequence can be obtained The updated representation of all nodes in .
[0047] S4. Aggregate the updated representations of the nodes in the subgraph to obtain the representation of the target node, complete the construction of the dynamic graph prediction model, iteratively train all the training data sets to optimize the dynamic graph prediction model, and predict the edges that may be generated in the dynamic graph based on the optimized dynamic graph prediction model.
[0048] The encoder can capture the spatial and temporal information between nodes in the subgraph and is composed of a multi-layer network module, where each layer of the network module contains a multi-head self-attention network and a fully connected network. ,use Encoder capture subgraph and Spatial and temporal information between nodes: , , in , is a multi-head attention network. The three parameters are used to generate the multi-head attention network. matrix, Matrix and matrix, It is Layer fully connected network, is the layer normalization operation. Layer Input , the first The layer output is recorded as , Represents the output of the multi-head attention network.
[0049] Using average pooling from Get Time Node Representation and nodes Representation : , , in, represents average pooling, and is a trainable parameter, is a node sequence and The length of is used to represent the node sequence and The number of nodes in is a node sequence The representation obtained after all nodes in the Transformer encoder pass through, is a node sequence The representation obtained after all nodes in are passed through the Transformer encoder.
[0050] The target node and The representations are concatenated and input into the multi-layer perceptron encoder to calculate the target node and At the moment Probability of generating an edge , the specific calculation method is as follows: , in is a nonlinear activation function, It is a fully connected network. Represents an addition operation.
[0051] The loss function of the prediction task is defined as the cross entropy loss function. Since all interactions are positive samples, Proportionally sampling the same number of negative samples, the loss function is calculated as follows: , in For negative sampling distribution, the construction of dynamic graph prediction model is completed.
[0052] Calculate the prediction loss for all samples in the current batch , the specific calculation method is as follows: , in represents the loss of a single sample, Indicates the number of samples in the batch.
[0053] Through iterative training, all batches of the training data set are involved in model training. If the specified number of training epochs is reached, the training ends. Otherwise, the data set is re-batch and the subsequent training steps are performed. According to the prediction loss of all samples , adjust the network parameters in the entire model to optimize the dynamic graph prediction model, and use the optimized dynamic graph prediction model to calculate the probability of future edge generation to realize the prediction of the dynamic graph.
[0054] The present invention uses the edges in the dynamic graph of the friend relationship network of the social platform as samples, expands them into several temporal motifs in the temporal motif extension module, uses the temporal motif extension module to capture more fine-grained complex interaction pattern information, and uses the temporal motif message passing network to model the interaction between nodes and temporal motif edges to capture high-order correlations between nodes. The present invention has broad application prospects in the field of friend recommendation on social network platforms.
[0055] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A dynamic graph prediction method based on temporal motif message passing, characterized in that: The dynamic graph prediction method comprises the following steps: The edges in the dynamic graph of the friend relationship network on the social platform are used as samples to construct a training data set and the training data set is divided into batches. The extended temporal motifs are obtained based on the temporal motif extension module. Index a batch of training samples from the training data set, and based on the edges composed of two target nodes on the edges to be predicted in the training samples, respectively construct subgraphs of the two target nodes, and generate corresponding subgraph co-occurrence codes; Combined with subgraph co-occurrence encoding, in the temporal motif message passing network, the representation of the temporal motif edge is obtained according to the indicator matrix, the relationship between the temporal motif edges is modeled by graph structure learning and the representation of the temporal motif edge is updated, and then the representation of the node in the subgraph is updated based on the updated representation of the temporal motif edge combined with the indicator matrix; The updated representations of the nodes in the aggregated subgraphs are used to obtain the representation of the target node, and the dynamic graph prediction model is constructed. All training data sets are iteratively trained to optimize the dynamic graph prediction model, and the edges that may be generated in the dynamic graph are predicted based on the optimized dynamic graph prediction model.
2. The dynamic graph prediction method according to claim 1, characterized in that: The method of obtaining the extended temporal motif based on the temporal motif extension module includes: defining the temporal motif as an edge sequence that is sorted in chronological order and occurs within a time window; in the temporal motif extension module, for a predefined temporal motif set For each temporal motif in , the predefined temporal motif is expanded into several temporal motifs according to the time window size, and the expanded temporal motif set is recorded as .
3. The dynamic graph prediction method according to claim 1, characterized in that: The generating of the corresponding subgraph co-occurrence code includes: obtaining the subgraph co-occurrence features of the nodes in the subgraph based on the frequencies of occurrence of the nodes in the subgraph in the two target node sequences, and encoding the subgraph co-occurrence features to obtain the subgraph co-occurrence code.
4. The dynamic graph prediction method according to claim 3, characterized in that: The encoding of the subgraph co-occurrence features comprises: Extract the first column and the second column , input these two columns into the same multi-layer perceptron encoder for feature transformation, and add the two outputs to get the sub-graph co-occurrence code : , in, is a multi-layer perceptron encoder, sub-graph co-occurrence feature Represents a node sequence The middle node in the node sequence and The frequency of occurrence in is the subgraph co-occurrence feature The first column represents the node sequence The middle node in the node sequence The frequency of occurrence in is the subgraph co-occurrence feature The second column represents the node sequence The middle node in the node sequence The frequency of occurrence in For the moment.
5. The dynamic graph prediction method according to claim 1, characterized in that: The indicator matrix is used to describe the affiliation between the nodes in the subgraph and all the temporal motif edges, including: for each temporal motif, searching for all instances of the temporal motif in the subgraph, counting the frequency of occurrence of the nodes on each edge of the instance in the subgraph, expressing the frequency of occurrence as the feature of the node in the subgraph based on the temporal motif and normalizing it, obtaining an indicator vector describing the affiliation between the node in the subgraph and the edge of the temporal motif, aggregating the indicator vectors of all nodes in the subgraph to construct an indicator matrix describing the affiliation between the nodes in the subgraph and the edges of the temporal motif, and obtaining the indicator matrix describing the affiliation between the nodes in the subgraph and all the temporal motif edges by splicing the indicator matrices corresponding to each temporal motif.
6. The dynamic graph prediction method according to claim 1, characterized in that: The method of obtaining the representation of the temporal motif edge according to the indicator matrix includes: obtaining the time difference coding by encoding the time difference between nodes, generating the initial representation of the nodes in the node sequence based on the node features, edge features, time difference coding and subgraph co-occurrence coding of the nodes in the node sequence, and obtaining the representation of the temporal motif edge in the subgraph based on the initial representation of the nodes in the node sequence in combination with the indicator matrix.
7. The dynamic graph prediction method according to claim 1, characterized in that: The method of using graph structure learning to model the relationship between temporal motif edges and updating the representation of temporal motif edges includes: obtaining an adjacency matrix describing the relationship between temporal motif edges through graph structure learning, and obtaining the updated representation of temporal motif edges through a multi-layer perceptron encoder based on the adjacency matrix, wherein the adjacency matrix is represented as Constructed by: , , in, is a parameterized memory state that constructs the graph structure between the edges of the temporal motifs. represents the expanded temporal motif set, and It is a fully connected network. represents the transpose operation, Normalize the input to between 0 and 1 to generate soft relationships between temporal motif edges. Indicates For input The output of the code, Indicates For input Encoded output.
8. The dynamic graph prediction method according to claim 1, characterized in that: The updated representation of the nodes in the aggregated subgraph obtains the representation of the target node, including: using a Transformer encoder to capture the spatial and temporal information between the nodes in the subgraph of the two target nodes, wherein the Transformer encoder is composed of a combination of multi-layer network modules, each layer of the network module has a multi-head self-attention network and a fully connected network, and average pooling is used to obtain the representation of the target node from the output of the multi-head self-attention network.
9. The dynamic graph prediction method according to claim 1, characterized in that: The construction of the dynamic graph prediction model includes: splicing the representation of the target node and inputting it into the multi-layer perceptron encoder, calculating the target node at time Generate edge probabilities and loss functions to complete the construction of the dynamic graph prediction model.
10. A dynamic graph prediction device based on temporal motif message transmission, comprising a memory and a processor, wherein the memory is used to store a computer program, characterized in that: The processor is used to implement the dynamic graph prediction method based on temporal motif message passing as described in any one of claims 1 to 9 when executing the computer program.