A discrete dynamic graph neural network link prediction method and system based on mask mechanism

Through the discrete dynamic graph neural network method based on mask mechanism and frequency domain enhancement, the problems of redundant interference and structural drift in social networks are solved, and efficient and accurate link prediction and large-scale deployment are achieved, which is suitable for relationship prediction tasks of social platforms.

CN120258051BActive Publication Date: 2025-08-08OCEAN UNIV OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510740354.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-08-08
Estimated Expiration
2045-06-05

AI Technical Summary

Technical Problem

The existing dynamic graph neural networks have problems such as severe redundant structural information interference, significant distribution drift in structural evolution, and large computing resource overhead in social network link prediction, making it difficult to deploy and efficiently predict potential relationships on large-scale social platforms in real time.

Method used

A discrete dynamic graph neural network method based on masking mechanism is adopted, combined with the self-supervised masking mechanism and frequency domain enhancement module, through node activity score, self-supervised time mask and frequency domain modeling, redundant interference is reduced, the model's sensitivity and generalization ability to structural changes are enhanced, and the computing efficiency is optimized.

Benefits of technology

It significantly improves the accuracy and robustness of link prediction, can effectively filter out about 20% to 40%, improves prediction accuracy by 5% to 6%, reduces computing resources by 30%, and achieves rapid convergence and good engineering deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120258051B_ABST
    Figure CN120258051B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of link prediction technology, and in particular to a discrete dynamic graph neural network link prediction method and system based on a mask mechanism. The method includes constructing a dynamic graph neural network model based on a mask mechanism, which includes constructing a discrete time dynamic graph snapshot sequence based on a user interaction log data set, introducing a node activity scoring mechanism to measure the interactive activity and structural importance of user nodes in different time step graphs; constructing a self-supervised time mask mechanism based on node activity to reduce redundant edge interference in the dynamic graph; using a dynamic graph neural network model to perform dynamic graph feature representation learning based on frequency domain enhancement; using a link prediction optimization mechanism based on self-supervised structural reconstruction to optimize the model; and using the optimized model to perform link prediction. The present invention can operate stably and achieve rapid convergence without sacrificing accuracy, and has good industrial deployability and scalability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of link prediction technology, and in particular to a discrete dynamic graph neural network link prediction method and system based on a mask mechanism. Background Art

[0002] As the number of users and interactions on social platforms continues to grow, the structural evolution of social networks is becoming increasingly frequent and complex. Relationships between users are constantly established, disappearing, and evolving, forming a typical dynamic graph structure. Effectively modeling user relationships in such dynamic environments and predicting potential social connections has become a research hotspot in graph computing and artificial intelligence. To this end, Dynamic Graph Neural Network (DGNN) technology has emerged and is widely used to capture the behavioral patterns of nodes and edges in social networks as they evolve over time.

[0003] Link prediction is a crucial task in social network modeling. Its goal is to predict potential future relationships, such as friend recommendations and follow suggestions, based on historical user interaction data. This task not only directly impacts the quality of recommendations and user activity on social platforms but also has significant implications for downstream tasks such as information dissemination analysis and modeling the evolution of community structures. Therefore, improving the accuracy, robustness, and real-time responsiveness of link prediction in dynamic graphs is a core concern of both academia and industry.

[0004] Currently, mainstream dynamic graph modeling methods can be divided into two categories: one is continuous-time modeling methods, which construct time series to represent node states and introduce temporal encoders (such as recurrent networks and Transformers) to learn the continuous evolution of the graph structure. This type of method can capture fine-grained temporal changes, but because it requires maintaining a complete historical sequence, it has high computational complexity, making it difficult to efficiently deploy in large-scale social graphs or low-latency recommendation tasks. The other type is discrete-time modeling methods, which divide interaction behavior into multiple time windows, construct a snapshot graph structure at each time step, and then model the evolution process through graph sequences. This type of method is computationally efficient and more suitable for real-time processing and engineering implementation, and has become the current mainstream solution for social network link prediction tasks.

[0005] Although discrete dynamic graph modeling methods have made some progress, the following outstanding technical difficulties still exist in actual social networks:

[0006] 1) Redundant structural information is severely disruptive and lacks an effective filtering mechanism. Social networks are characterized by high sparsity and local stability. Redundant edge structures persist in some areas with low user activity or where relationships change slowly. If these redundant edge structures are fed into the model without filtering, the model's ability to model key social behaviors will be weakened, affecting link prediction accuracy.

[0007] 2) Structural evolution suffers from significant distribution drift, and the model lacks dynamic adaptability. In situations such as hot events, public opinion outbreaks, or sudden changes in user interests, social network structures can undergo drastic changes in a short period of time. Most existing methods assume a stable graph distribution, making it difficult to adjust modeling strategies in a timely manner to address sudden structural changes.

[0008] 3) High computing resource overhead and a lack of deployment capabilities for high-frequency prediction scenarios. As the platform's user base grows and recommendation frequency increases, traditional dynamic graph models, based on full-graph training, struggle to support the demands of real-time recommendation systems due to resource consumption and response latency, limiting their widespread application in engineering environments.

[0009] Therefore, to address these technical bottlenecks, there is an urgent need to design a dynamic graph link prediction method that supports discrete-time modeling, suppresses redundant information, adapts to structural changes, and boasts high deployment efficiency. In particular, a dynamic graph modeling framework that combines a masking mechanism with a structural reconstruction strategy is expected to fundamentally alleviate redundant interference, improve the model's sensitivity to structural changes and generalization capabilities, and ultimately drive the development of social network link prediction technology towards a more efficient and intelligent direction. Summary of the Invention

[0010] To address the aforementioned challenges with existing dynamic graph neural networks in link prediction tasks, this paper provides a discrete dynamic graph neural network link prediction method and system based on a masking mechanism. By using a discrete dynamic graph neural network, combined with a self-supervised masking mechanism and a frequency domain enhancement module, high-value interactions in the dynamic graph are modeled, significantly improving the accuracy, robustness, and efficiency of the recommendation system.

[0011] In a first aspect, the present invention provides a discrete dynamic graph neural network link prediction method based on a mask mechanism, which adopts the following technical solutions:

[0012] A discrete dynamic graph neural network link prediction method based on a mask mechanism, comprising:

[0013] Obtain user interaction log dataset;

[0014] Construct a dynamic graph neural network model based on a masking mechanism. This includes constructing a discrete-time dynamic graph snapshot sequence based on a user interaction log dataset, introducing a node activity scoring mechanism to measure the interactive activity and structural importance of user nodes in the graph at different time steps, and constructing a self-supervised time masking mechanism based on node activity to reduce redundant edge interference in the dynamic graph.

[0015] Use dynamic graph neural network model to learn dynamic graph feature representation based on frequency domain enhancement;

[0016] Model optimization is performed using a link prediction optimization mechanism based on self-supervised structure reconstruction;

[0017] Use the optimized model for link prediction.

[0018] Furthermore, the discrete time dynamic graph snapshot sequence is constructed based on the user interaction log dataset, including inputting the interaction log dataset containing timestamps , and divided by timestamp into discrete time windows: , each time window Corresponding to a graph snapshot ,in, and Indicates time The two nodes that interact, , are the static attributes and statistical feature vectors of the corresponding nodes, is the total number of interactions; in each time window In the example, we extract the interaction pairs that occurred in this time period. , which is constructed as an edge set , node set It is composed of all users who interact with each other, and then constructs an adjacency matrix and a node feature matrix for each node.

[0019] Furthermore, the node activity scoring mechanism is introduced to measure the interactive activity and structural importance of user nodes in different time step graphs, including the score , both at each time step Nodes in Defining an activity score , the score consists of two parts: node dynamic change score The importance of the nodes is integrated according to the weight ratio, where the dynamic change score of the nodes is used Characterize the changes in the user's neighbor structure in the time series, expressed as:

[0020]

[0021] Among them, the parameters Used to adjust the sensitivity of node dynamic scoring, node exist Degrees of time Represents the basic level of past interactive activity of the node, and They are used to avoid the denominator being zero during the calculation process and ensure the stability of the calculation.

[0022] Furthermore, the node activity scoring mechanism is introduced to measure the interactive activity and structural importance of user nodes in different time step graphs, and also includes using node importance scores This method measures the overall importance of a node in the graph structure, comprehensively considering the random access probability of a node in the graph and the importance contribution of neighboring nodes, so as to fully reflect the user's communication potential and structural influence in the overall social network. The PageRank algorithm is used as the calculation method for the global importance score of the node, which is expressed as:

[0023] ,

[0024] in, is the damping coefficient, represents the total number of nodes, the first term represents the probability of randomly jumping to any node, and the second term represents the influence propagation contribution from neighboring nodes.

[0025] Furthermore, the self-supervised time masking mechanism based on node activity is constructed to reduce the interference of redundant edges in dynamic graphs, including using activity information to adaptively adjust the masking probability of edges and guide the model to focus on high-value structural signals, wherein, the current time step is set to Any two nodes 、 There are edges between , then the initial mask probability of the edge for:

[0026] ,

[0027] in, and Node and At time step The activity score on , the function Mean( ) means taking the average of the two and calculating the mask probability of all edges after correction , based on the modified mask probability, the retained sub-image is determined, and the modified mask power is expressed as:

[0028] ,

[0029] in, Represents the time step The total number of edges in the above figure, It is a preset target mask ratio hyperparameter used to control the ratio of masked edges in the overall graph structure.

[0030] Furthermore, the method of using a dynamic graph neural network model to perform dynamic graph feature representation learning based on frequency domain enhancement includes using a dynamic graph neural network model to perform dynamic graph feature representation learning based on frequency domain enhancement, including introducing a graph convolution mechanism based on spectral domain approximation in the graph structure encoding stage to model the structural dependency relationship between a node and its multi-order neighbors, approximating the frequency domain filter through Chebyshev polynomial expansion, and using the node multi-order neighbor representation learning within a single time snapshot to capture the local difference characteristics of the structural mutation area; after the graph structure feature extraction, introducing an adaptive frequency domain enhancement mechanism based on a sliding window, and performing spectral modeling on the graph convolution representation sequence of the node by constructing a local time segment, setting the time step Previous The nodes of the layer are represented as , then The structural feature update form of the layer is expressed as:

[0031] ,

[0032] in, represents the normalized graph Laplacian matrix, For the Chebyshev polynomial expansion of order, is the corresponding learnable frequency domain convolution kernel parameter, is the activation function (ReLU is used in this invention), is the fusion coefficient of the residual connection.

[0033] Furthermore, the link prediction optimization mechanism based on self-supervised structure reconstruction is used to optimize the model, including introducing a self-supervised reconstruction loss function ,Will The edges in are used as positive samples to optimize the edge prediction ability of the model. By minimizing the loss function, the model learns to restore missing edges when the graph structure is incomplete, and improves the modeling ability of the overall structural evolution of the graph. The loss function is expressed as:

[0034] ,

[0035] Where, Indicates the The set of edges that are covered at any moment, For the covered edge The real label in the actual graph structure has a value of 1, which means there is a real connection. The probability of edge existence predicted by the model.

[0036] Furthermore, the model optimization using the link prediction optimization mechanism based on self-supervised structure reconstruction also includes embedding the node features extracted by the graph neural network into the multi-layer perceptron MLP to predict the probability that any node pair may form a connection in the future, which is expressed as:

[0037] ,

[0038] Where, and Represents nodes respectively and nodes At time step The feature representation of For the prediction results.

[0039] Furthermore, the model optimization using the link prediction optimization mechanism based on self-supervised structure reconstruction also includes integrating the self-supervision loss, the retained edge supervision loss, and the negative sample prediction loss to jointly optimize the structure recovery and edge prediction tasks, and constructing an overall training objective function, which is expressed as:

[0040] ,

[0041] in, The self-supervised loss term proposed above is used to predict the masked edge information, which effectively enhances the model’s understanding of the overall structure of the dynamic graph. The second term calculates the retained edge The loss of , to ensure that the model accurately learns the existing key edge information; the third item is the negative sample edge The loss is used to enable the model to distinguish the non-existent side information.

[0042] In the second aspect, a discrete dynamic graph neural network link prediction system based on a mask mechanism includes:

[0043] The data acquisition module is configured to acquire a user interaction log dataset;

[0044] The model building module is configured to construct a dynamic graph neural network model based on a masking mechanism, which includes constructing a discrete-time dynamic graph snapshot sequence based on a user interaction log dataset, introducing a node activity scoring mechanism to measure the interactive activity and structural importance of user nodes in the graph at different time steps; and constructing a self-supervised time masking mechanism based on node activity to reduce redundant edge interference in the dynamic graph.

[0045] The feature module is configured to use a dynamic graph neural network model to perform dynamic graph feature representation learning based on frequency domain enhancement;

[0046] The optimization module is configured to optimize the model using a link prediction optimization mechanism based on self-supervised structure reconstruction;

[0047] The prediction module is configured to perform link prediction using the optimized model.

[0048] In a third aspect, the present invention provides a computer-readable storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, a discrete dynamic graph neural network link prediction method based on a mask mechanism.

[0049] In a fourth aspect, the present invention provides a terminal device comprising a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; and the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded and executed by the processor to implement the discrete dynamic graph neural network link prediction method based on a mask mechanism.

[0050] In summary, the present invention has the following beneficial technical effects:

[0051] (1) Reduce redundant interference and improve the focus of structural modeling.

[0052] Existing methods generally treat all historical edge structures in social graphs equally, failing to effectively identify redundant connections or short-lived ineffective interactions between low-activity users, which can easily lead to noise interference. The node activity-driven masking mechanism proposed in this paper combines the frequency of structural changes with node importance scores to adaptively filter out redundant social edge structures. In real-world social network datasets (such as UCI-Message and MOOC), this mechanism can filter out an average of approximately 20% to 40% of redundant edges, reducing the training graph size by approximately 30%. This effectively improves the model's ability to focus on high-quality interactions and enhances the learning of potential friendships and connections between highly active users.

[0053] (2) Enhance modeling capabilities under structural distribution drift and improve generalization robustness.

[0054] User interests and behavior patterns in social networks have obvious temporal non-stationarity, such as structural mutations caused by hot events, interest transfers, or periodic social rhythms. The present invention introduces a frequency domain enhancement module, which extracts the frequency response of node behavior in the time dimension through Fourier transform, and uses a learnable filter to highlight the key change frequency bands, so that the model has the ability to perceive periodic patterns and respond to sudden changes in behavior. In trading network datasets with strong volatility, such as Bitcoin-Alpha and Bitcoin-OTC, the frequency domain mechanism of the present invention improves the prediction accuracy of the model by an average of 5% to 6% in the stage of drastic structural changes, demonstrating excellent robustness and generalization performance in non-stationary dynamic environments.

[0055] (3) Improve the ability to restore structure and alleviate the problem of incomplete graphs in real data.

[0056] On social platforms, graph structures are often missing due to incomplete information or unobserved interactions. This paper introduces a self-supervised structure reconstruction mechanism, which uses masked edges as positive examples for prediction. This allows the model to fill in structural information gaps during training, thereby enhancing its ability to recognize potential friendships or unobserved interactions. Experiments show that across multiple link prediction tasks, this reconstruction mechanism improves Recall@10 by an average of approximately 7.3%, significantly enhancing the model's ability to understand and complete incomplete social graph structures.

[0057] (4) Optimize computing efficiency and adapt to the engineering deployment requirements of large-scale graphs.

[0058] Traditional dynamic graph modeling methods often rely on the entire graph for training, consuming large amounts of computing resources and hindering real-time deployment on large social platforms. This invention combines a masking mechanism with a frequency-domain modeling strategy to significantly reduce the edge size of the input graph and the number of computational traversals. In large-scale social collaboration networks with millions of nodes, such as Wiki-Talk, mainstream methods often experience out-of-memory (OOM) issues due to resource bottlenecks. However, this invention operates stably and achieves rapid convergence without sacrificing accuracy, demonstrating excellent industrial deployability and scalability.

[0059] In summary, the discrete dynamic graph neural network link prediction method based on the mask mechanism proposed in this invention focuses on key issues such as redundant information control, behavior evolution adaptation, structure reconstruction and completion, and system deployment efficiency, and provides a set of systematic modeling solutions with reasonable structure, complete mechanism, and superior performance. It is suitable for a variety of social graph modeling and relationship prediction scenarios, and has good practical application prospects and engineering deployment value. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is the overall framework diagram of the present invention;

[0061] Figure 2 It is a dynamic mask frame diagram;

[0062] Figure 3 A diagram showing the learning framework for frequency domain enhanced dynamic graph feature representation.

[0063] Figure 4 Reconstructing the framework diagram for self-supervised architecture. DETAILED DESCRIPTION

[0064] The present invention will be further described in detail below with reference to the accompanying drawings.

[0065] Example 1

[0066] Reference Figure 1 , a discrete dynamic graph neural network link prediction method based on a mask mechanism in this embodiment includes:

[0067] Obtain user interaction log dataset;

[0068] Construct a dynamic graph neural network model based on a masking mechanism. This includes constructing a discrete-time dynamic graph snapshot sequence based on a user interaction log dataset, introducing a node activity scoring mechanism to measure the interactive activity and structural importance of user nodes in the graph at different time steps, and constructing a self-supervised time masking mechanism based on node activity to reduce redundant edge interference in the dynamic graph.

[0069] Use dynamic graph neural network model to learn dynamic graph feature representation based on frequency domain enhancement;

[0070] Model optimization is performed using a link prediction optimization mechanism based on self-supervised structure reconstruction;

[0071] Use the optimized model for link prediction.

[0072] Specifically:

[0073] Step 1: Construct a discrete-time dynamic graph snapshot sequence,

[0074] 1.1 The first step of this invention is to construct a discrete-time dynamic graph snapshot sequence, aiming to convert continuous-time user interaction behavior into structured graph data input so that the subsequent graph neural network model can effectively learn the temporal evolution characteristics of the graph. Specifically, the input is a timestamp-containing interaction log dataset, represented as:

[0075] ,

[0076] in, and Indicates time The two nodes that interact, , are the static attributes or statistical feature vectors of the corresponding nodes, is the total number of interactions.

[0077] 1.2 In order to extract the time evolution information, the complete interaction log is first divided into discrete time windows:

[0078] ,

[0079] Each time window Corresponding to a graph snapshot . The window division strategy can select fixed time intervals (such as daily, weekly) or adaptive division based on event density according to the actual application. Taking the prediction of friend relationships in social networks as an example, the UCI-Message dataset was used in the experiment of the present invention. This dataset was collected from an online social platform of the University of California, Irvine, and contains records of private messages sent between users. Each edge represents that a user sent a private message to another user at a certain moment, which has obvious dynamic interaction characteristics. The dataset contains a total of 1,899 user nodes, 59,835 timestamp-annotated message edges, and a time span of 193 days. In specific processing, the present invention divides the entire time span into fixed time windows of 7 days each, and constructs a total of 27 graph snapshots. In each time window, the system extracts private message records between all users and constructs an edge set , node set Includes all users who participated in the interaction during the time period.

[0080] Then, in each time window In the example, we extract the interaction pairs that occurred in this time period. , which is constructed as an edge set , node set It consists of all users or entities that have interacted. Further construct the adjacency matrix :

[0081] ,

[0082] At the same time, construct a node feature matrix for each node ,in is the number of nodes, is the node feature dimension (in the present invention Set to 64). Node features can be composed of two types of information:

[0083] One type is static features that do not change over time, such as user registration attributes, initial influence, etc.; the other type is statistical features that change over time, such as the number of messages sent, the number of messages received, degree centrality, and the historical cumulative number of interactions within the snapshot time window.

[0084] 1.3 Finally, the entire discrete-time dynamic graph snapshot sequence is represented as:

[0085] ,

[0086] Based on the above, the link prediction task is further formalized as: learning a mapping function , before the given Predicting future time steps based on the condition of a graph snapshot The set of possible edges in :

[0087] ,

[0088] in, , represents the predicted edge pair set. This snapshot construction method not only preserves the temporal evolution of node interactions in social networks, but also effectively extracts active social relationships and evolution trends through window modeling of node behaviors.

[0089] Step 2: Node activity score calculation mechanism,

[0090] To further improve the modeling accuracy of social network link prediction tasks, this paper introduces a node activity scoring mechanism based on the construction of dynamic graph snapshot sequences. This mechanism measures the interactive activity and structural importance of user nodes at different time steps in the graph. This scoring mechanism can adaptively identify key users with frequent behavior and significant structural mutations in social networks, providing precise guidance for subsequent masking mechanisms, thereby improving the ability to predict potential social relationships.

[0091] Specifically, the present invention provides a Nodes in Defining an activity score , the score consists of two parts: node dynamic change score and node importance scores The two are fused according to the weight ratio, and the calculation formula is as follows:

[0092] ,

[0093] in, is an adjustable fusion coefficient used to flexibly balance the importance of local variation features and global structure. .

[0094] 2.1 Node Dynamic Change Score It aims to characterize the changes in the neighborhood structure of users in a time series. In social networks, this score can be used to identify users who frequently establish or disconnect connections recently, reflecting their behavioral activity and potential relationship changes. The specific definition is as follows:

[0095]

[0096] Among them, the parameters Used to adjust the sensitivity of node dynamic scoring, node exist Degrees of time Represents the basic level of past interactive activity of the node, and They are used to avoid the denominator being zero during the calculation process and ensure the stability of the calculation. Defined as:

[0097] ,

[0098] in, Represents the time step Time Node The neighbor set of . The above symmetric difference operation It can effectively capture the addition and reduction of neighbor node sets and more accurately reflect the activity of nodes in recent structural changes.

[0099] In social networks, when users begin to frequently make new friends or disconnect from old connections, their adjacency structure changes significantly, causing the score to rise. These nodes typically correspond to users whose social behavior patterns have changed, indicating a high probability of forming new connections in the future.

[0100] 2.2 Node Importance Score The starting point of the design is to measure the overall importance of nodes in the graph structure. Even if some users have stable behavior in the short term, their structural centrality in the graph may be high, which still has a key impact on the propagation path of social relationships. To measure this impact, the present invention adopts the classic PageRank algorithm as the calculation method for node global importance score:

[0101] ,

[0102] in, is the damping coefficient (generally set to 0.85), represents the total number of nodes, the first term represents the probability of randomly jumping to any node, and the second term represents the influence propagation contribution from neighboring nodes. This formula comprehensively considers the random access probability of a node in the graph and the importance contribution of neighboring nodes, thereby more comprehensively reflecting the propagation potential and structural influence of a user in the overall social network.

[0103] Step 3: Dynamic masking mechanism,

[0104] After completing the calculation of the node activity score, in order to effectively reduce the interference of redundant edges in the dynamic graph and further improve the focus and accuracy of structural modeling, the present invention designs a self-supervised time masking mechanism based on node activity. This mechanism uses activity information to adaptively adjust the masking probability of edges, guiding the model to focus on high-value structural signals, thereby improving the learning efficiency and generalization ability of link prediction, and is particularly suitable for modeling tasks of user relationship evolution in social networks. In social networks, the interaction frequency and activity level between different users vary significantly. The edges between a large number of low-activity users often constitute noise or invalid relationships, which directly affect the performance of link prediction tasks such as potential friend recommendations. Therefore, by introducing a masking mechanism to shield low-value edges, it helps the model focus on more meaningful user behavior patterns.

[0105] 3.1 Specifically, let the current time step Any two nodes 、 There are edges between , then the initial mask probability of the edge The definition is as follows:

[0106] ,

[0107] in, and Node and At time step The activity score on , function Mean( ) represents the average of the two. This formula intuitively reflects the following logic: if both nodes connected by an edge are low-activity nodes, the edge has a higher mask probability and is more likely to be blocked; on the other hand, if both nodes are highly active, the edge is more likely to be retained, thus focusing on modeling user groups that are likely to interact again in the near future.

[0108] 3.2 To ensure the stability and controllability of the global mask ratio, the present invention further normalizes the initial mask probabilities of all edges and calculates the corrected mask probabilities. , the specific formula is as follows:

[0109] ,

[0110] in, Represents the time step The total number of edges in the above figure, is a preset target mask ratio hyperparameter, which is used to control the ratio of masked edges in the overall graph structure, ensuring that the masking behavior neither interferes with the structure too much nor is too loose and ineffective. In practical settings, we usually set Set to to For example, on the UCI-Message social network dataset, , set as , to more effectively compress the size of the graph structure.

[0111] Subsequently, the present invention is based on the modified mask probability , Bernoulli sampling is used to determine whether each edge is covered. The specific decision mechanism is as follows:

[0112] ,

[0113] in, indicates that the edge is masked (discarded), Indicates that the edge is retained. The model performs Bernoulli sampling on each edge to decide whether to mask the edge. The retained edges constitute the retained subgraph , used for structural learning of graph neural network models, and the masked edges form subgraphs , which will be used as positive sample targets in subsequent self-supervised tasks for model structure reconstruction.

[0114] Messaging behavior between users exhibits significant differences in periodicity and activity. Through the dynamic masking mechanism proposed in this paper, the system automatically identifies low-value interaction edges (e.g., long periods of no interaction, single communications, etc.) in each time snapshot and effectively masks them. At the same time, it retains the edge structure of repeated communications between highly active users, guiding the model to focus on key interactions that may form or maintain friendships.

[0115] Step 4: Dynamic graph feature representation learning module based on frequency domain enhancement,

[0116] To address the problem of time-varying distribution drift of node features in dynamic graph link prediction tasks, traditional graph convolutional networks struggle to effectively model the temporal evolution of node representations, resulting in insufficient generalization performance in practical applications. To this end, this paper designs a dynamic graph feature representation learning module based on frequency domain enhancement. This module aims to capture the important temporal trends of node features through frequency domain information representation, thereby improving the model's ability to model the dynamic evolution of nodes and its prediction accuracy. This module is particularly suitable for modeling the evolution of user relationships in social networks.

[0117] In real social networks, user behavior patterns often exhibit significant time dependence and cyclical patterns. For example, some users are most active during specific time periods (such as commuting or the beginning of a semester), while their activity decreases during other times. This behavioral evolution is difficult to accurately capture in the time domain, but it typically manifests as low- or medium-frequency signal components in the frequency domain. Frequency domain enhancement allows the model to better capture these underlying behavioral rhythms and interaction trends, thereby improving the ability to predict potential friendships or future communication behaviors.

[0118] 4.1 To extract the structural feature representation of the subgraph at each time step, this paper introduces a graph convolution mechanism based on spectral domain approximation in the graph structure encoding stage to model the structural dependency between nodes and their multi-order neighbors. This method approximates the frequency domain filter by expanding the Chebyshev polynomial, which has good local perception and computational efficiency. Assume that the time step Previous The nodes of the layer are represented as , then The structural feature update form of the layer is as follows:

[0119] ,

[0120] in, represents the normalized graph Laplacian matrix, For the Chebyshev polynomial expansion of order, is the corresponding learnable frequency domain convolution kernel parameter, is the activation function (ReLU is used in this invention), is the fusion coefficient of the residual connection. This structural modeling module focuses on learning multi-order neighbor representations of nodes within a single time snapshot. It can effectively capture the local difference characteristics of the structural mutation area and provide high-quality input for subsequent frequency domain modeling.

[0121] 4.2 To enhance the model's ability to model the temporal evolution of node behavior, this paper introduces an adaptive frequency domain enhancement mechanism based on a sliding window after extracting graph structural features. This mechanism constructs local time segments to perform spectral modeling on the convolutional graph representation sequence of nodes, capturing their response patterns along temporal feature dimensions such as periodic changes, high- and low-frequency fluctuations, and sudden behaviors, thereby enhancing the model's ability to discern future link formation trends.

[0122] Specifically, suppose the recent In each time step, the node The graph convolution output sequence is , by setting the window length and sliding step length , construct Segment overlapping sliding window sequence. A sliding window is defined as:

[0123] ,

[0124] The present invention performs a sliding window sequence on each segment. Perform a one-dimensional fast Fourier transform (FFT) and map it to the frequency domain to obtain the complex response tensor of the node in the spectrum space:

[0125] ,

[0126] To model the periodic preference of nodes on different frequency channels, the first The energy normalized value of the frequency channel is defined as:

[0127] ,

[0128] The energy ratios of all channels are combined into a length of The vector of The present invention further combines the energy vector with the learnable spectral channel weights Perform Hadamard product to guide attention weighting, and obtain the spectrum enhancement expression as:

[0129] ,

[0130] in, represents the Hadamard product in the channel dimension, is a dimensional vector containing each frequency channel The normalized energy value of This mechanism explicitly introduces the spectral energy structure and combines it with learnable channel weights to achieve adaptive frequency domain enhancement. This enhances the model's ability to focus on behavioral features such as periodicity, short cycles, and high-frequency fluctuations. Together with the learned channel preferences, it guides selective modeling in the frequency dimension. Subsequently, the spectral representations under all sliding windows are averaged and pooled to obtain the final enhanced representation of the node in the frequency space:

[0131] ,

[0132] Finally, the frequency domain features are mapped back to the time domain using the inverse fast Fourier transform (IFFT), and a residual connection is performed with the original graph convolution representation to obtain the node at the current time step. The final frequency domain enhancement on is represented as:

[0133] ,

[0134] While maintaining computational efficiency, this mechanism effectively enhances the model's ability to perceive node behavior dynamics through sliding window segmentation modeling and spectral attention weighting. The overlapping window design alleviates the problem of missing temporal boundary information, while frequency-domain energy modeling highlights the response strength of nodes in different frequency bands. The attention mechanism further enhances the ability to identify periodic behavior patterns. Compared to traditional methods that rely on global temporal modeling, this mechanism can capture the dynamic evolution of user relationships in social networks at a finer granularity and with lower overhead.

[0135] Taking the UCI-Message dataset as an example, user messaging behavior often exhibits multi-periodic and multi-frequency characteristics. For example, scenarios such as exam times, weekday peaks, and late-night activity exhibit significant low- and medium-frequency patterns. Directly using time-domain features often struggles to effectively capture periodic signals across snapshots, while frequency-domain modeling can clearly visualize such behavior as frequency peaks in the spectrogram. By introducing a frequency-domain enhancement mechanism, the model can automatically identify user nodes with stable periodic behavior or recurring interactions, thereby improving its ability to predict future user interactions (e.g., whether to send private messages again or establish friendships). Experiments on real social network data such as UCI-Message demonstrate that the inclusion of the frequency-domain enhancement module improves link prediction metrics such as AUC and MRR by approximately 4.7% to 6.2%, and demonstrates enhanced stability and robustness during time periods with significant structural changes.

[0136] Step 5: Link prediction optimization mechanism based on self-supervisory structure reconstruction,

[0137] To address the problem that important structural information in existing dynamic graph link prediction methods is directly discarded after being masked during the training process, resulting in incomplete model learning objectives, weak perception of graph structure, and limited prediction effect, the present invention proposes an optimization mechanism based on joint modeling of structure masking and self-supervised reconstruction, thereby enhancing the model's ability to understand the evolution of dynamic graph structure and the accuracy of link generation.

[0138] The core idea of this invention is: after constructing the time snapshot graph, some redundant edge structures are actively masked through an activity-driven masking mechanism, and a self-supervised reconstruction task is introduced to guide the model to actively predict these "hidden real edges" during training, so as to achieve modeling and understanding of the complete graph structure.

[0139] Unlike traditional methods, traditional dynamic graph modeling approaches often completely ignore masked edges—neither inputting them into the graph neural network model for representation learning nor participating in the final prediction process, effectively treating them as non-existent. While this approach reduces the model's computational burden, it also loses the ability to model the true graph structure, which can lead to degraded model performance, especially in scenarios with incomplete graph structures or incomplete observations.

[0140] 5.1 Traditional dynamic graph methods often completely ignore masked edges. Masked edges are not fed into the graph neural network model for representation learning, nor do they participate in the final prediction process. While this approach reduces the computational burden, it severely compromises the ability to learn the complete social structure. To address this, this paper proposes a mechanism that balances efficiency and completeness: During the structure masking phase, while edges are not fed into the model representation learning module, they still participate in the self-supervised structure reconstruction as positive samples. This means that the model predicts the connection probability of these edges through a global structural inference mechanism, without directly accessing the feature aggregation information of these edges.

[0141] Specifically, under the self-supervised time mask mechanism in step 2, the original graph structure at each moment Divided into two complementary subgraphs: the set of subgraphs consisting of masked edges , and the set of retained subgraphs consisting of unmasked edges , satisfying the relationship .

[0142] Subsequently, the present invention introduces the self-supervised reconstruction loss function ,Will The edges in are used as positive samples to optimize the edge prediction ability of the model:

[0143]

[0144] Where, Indicates the The set of edges that are covered at any moment, For the covered edge The real label in the actual graph structure has a value of 1, which means there is a real connection. The probability of an edge existing as predicted by the model. By minimizing this loss function, the model can learn how to restore missing edges when the graph structure is incomplete, improving its ability to model the overall structural evolution of the graph.

[0145] 5.2 To further complete the link prediction task, the present invention embeds the node features extracted by the graph neural network into a multi-layer perceptron (MLP) to predict the probability that any node pair may form a connection in the future. The formula is as follows:

[0146] ,

[0147] Where, and Represents nodes respectively and nodes At time step The feature representation of is the prediction result. In social networks, this prediction task can be corresponded to: judging the user Will it be with users in the future Sending messages, establishing friendships, or forming collaborative relationships. For example, in the UCI-Message dataset, this task involves predicting new private messaging behaviors that may occur within a certain period of time. Experiments show that the introduction of the structure reconstruction mechanism improves the model's ability to identify potential relationships in unobserved historical interactions.

[0148] To jointly optimize the structure recovery and edge prediction tasks, this paper integrates the self-supervision loss, the retained edge supervision loss, and the negative sample prediction loss to construct an overall training objective function:

[0149] ,

[0150] in, The self-supervised loss term proposed above is used to predict the masked edge information, which effectively enhances the model’s understanding of the overall structure of the dynamic graph. The second term calculates the retained edge The loss of , to ensure that the model accurately learns the existing key edge information; the third item is the negative sample edge The loss helps the model distinguish non-existent edge information. We sample unconnected node pairs from the current snapshot as negative samples, and keep the sampling ratio 1:1 with positive samples to alleviate the training bias caused by the imbalance of positive and negative sample ratios.

[0151] Through the above-mentioned mechanism, the present invention achieves efficient recovery and utilization of masked structural information, while improving the accuracy of link prediction, and enhancing the robustness and generalization ability of the model in scenarios with incomplete real graph structures. Experimental results in the UCI-Message dataset show that after introducing the structural reconstruction mechanism, the model outperforms the baseline model without structural reconstruction in link prediction indicators such as AUC, MRR, and Recall@10, with an average improvement of 3.5% to 5.2%. In summary, the structural reconstruction optimization mechanism proposed in the present invention can effectively model the implicit connection trends and future interaction probabilities between users in social networks, significantly improving the prediction effect and system practicality in scenarios such as friend recommendation on social platforms, private message prediction, and community structure evolution modeling.

[0152] Step 6: Apply downstream tasks of link prediction,

[0153] After completing dynamic graph structure modeling and feature learning, the proposed model was applied to a typical downstream task, link prediction, to verify its predictive capabilities and effectiveness in real social networks. Link prediction aims to predict potential new interaction edges between users in future time slices, such as private messaging, course interactions, or community editing collaborations, based on historical user interactions and graph structure evolution trends. This task has significant practical value in social networking platforms and is widely used in key business scenarios such as friend recommendations, potential relationship discovery, and behavioral intention prediction.

[0154] This paper conducts extensive experiments on three typical social network datasets, including:

[0155] (1) UCI-Message dataset: a small private messaging social network,

[0156] UCI-Message is a private messaging social network dataset collected from the University of California, Irvine. It contains 1,899 user nodes and 59,835 timestamped edges, divided into 28 time snapshots, reflecting the evolution of private messaging behavior between users. This dataset exhibits significant periodicity and behavioral volatility, making it suitable for studying the formation and maintenance of short-term communication relationships between users.

[0157] On this dataset, the proposed method effectively shields redundant edge structures between users communicating less frequently through an activity-aware edge masking mechanism. Combined with a frequency-domain enhanced modeling strategy, it further extracts user communication rhythm signals, enabling accurate modeling of short-term interaction trends. This method achieves an average improvement of approximately 7.6% compared to the optimal baseline model, significantly enhancing the ability to identify potential communication relationships.

[0158] (2) MOOC dataset: medium-sized educational social network,

[0159] The MOOC dataset records the course behavior of 7,144 users across 97 course objectives, including viewing, clicking, and answering questions. This data forms a dynamic, heterogeneous interaction network with user behavior attributes and timestamps. The data contains 411,749 edges, divided into 30 time snapshots. User activity on the platform varies widely, with behavioral changes occurring in phases and jumps, which can easily lead to structural distribution drift.

[0160] In MOOC networks, this invention utilizes a masking mechanism to effectively filter out highly repetitive, low-value interaction edges, preventing over-modeling and the resulting reduction in model generalization. Furthermore, the frequency domain enhancement module effectively captures the cyclical variations in user behavior across courses. In terms of predicting future learning behavior (e.g., whether to continue interacting), this model achieves optimal performance in all four metrics: Accuracy, AUC, MRR, and Recall@10. In particular, the accuracy rate improves by approximately 9.5% compared to the optimal baseline model, demonstrating its strong ability to model the evolving trends of user interests within educational platforms.

[0161] (3) Wiki-Talk dataset: a large social collaboration network,

[0162] Wiki-Talk is a massive social collaboration network formed by Wikipedia users through editing discussion pages. It consists of over 1.14 million user nodes and 7.8 million timestamped edges, spanning 2,320 days and divided into 73 snapshots. This network is highly sparse and has an extremely uneven distribution of node activity, making it extremely challenging to analyze.

[0163] Faced with this type of large-scale, highly sparse graph data, traditional dynamic graph models are prone to operational bottlenecks such as out-of-memory (OOM) errors. However, this invention significantly compresses the input graph structure through an activity masking strategy, reducing the number of edges by an average of approximately 30%-40%, ensuring the stability and scalability of the training process. The frequency domain enhancement module helps the model focus on long-term behavioral rhythms, alleviating the problems of large time spans and strong distribution drift. Ultimately, on the Wiki-Talk dataset, this invention achieved an accuracy of 94.31% and a recall@10 of 63.4%, effectively addressing the task of relationship prediction in ultra-large-scale social networks.

[0164] Example 2

[0165] This embodiment provides a discrete dynamic graph neural network link prediction system based on a mask mechanism, including:

[0166] The dynamic graph link prediction method of the present invention is composed of six main functional modules, including a discrete dynamic graph snapshot construction module 101, a node activity score calculation module 102, an activity-based dynamic mask module 105, a multi-layer graph convolutional network coding module 106, an adaptive frequency domain enhancement feature modeling module 107, a self-supervised contrastive learning optimization module 108 and a link prediction downstream application module 109. The system structure is as follows: Figure 1 As shown. The following is a detailed description of each module:

[0167] Discrete Dynamic Graph Snapshot Construction Module 101: This module divides the continuously timestamped interaction log into discrete time windows based on the method described in Step 1. At each time step, it generates a corresponding graph snapshot, including an adjacency matrix and a node feature matrix. This construction method fully preserves the temporal evolution of node interactions and provides the basic structural input for subsequent dynamic graph modeling.

[0168] Node activity score calculation module 102: This module calculates the node's dynamic change score (local neighborhood structure change intensity) and node importance score (global graph structure influence) according to the method proposed in step 2, and weightedly integrates them into the final node activity score, providing an important basis for the masking strategy.

[0169] Activity-based dynamic masking module 105: This module is based on the self-supervised temporal masking mechanism proposed in step 3. It uses node activity information to adaptively determine the masking probability of edges, and regulates the masking ratio through global normalization. It is finally divided into a masked edge set and a retained edge set for use by subsequent modules. The masked edges will not participate in the graph structure encoding, but will still be input as positive samples into the structure reconstruction loss, such as Figure 2 .

[0170] Multi-layer graph convolutional network coding module 106: According to the method described in step 4, this module models the retained subgraph and introduces a graph convolution mechanism based on spectral domain approximation to model the structural dependency between nodes and their multi-order neighbors as the basic input for frequency domain modeling.

[0171] Adaptive frequency domain enhancement feature modeling module 107: This module performs sliding window modeling on the graph convolution output, extracts frequency domain features through fast Fourier transform, and performs spectrum enhancement by combining learnable weights and energy normalization vectors. Subsequently, an inverse transform is performed to restore to the time domain and concatenate with the original representation residual to obtain the final node representation. This mechanism enhances the model's ability to model periodic behavior and dynamic changes, such as Figure 3 shown.

[0172] Self-supervised contrastive learning optimization module 108: This module integrates graph convolution features and frequency domain enhancement features, and introduces a three-objective joint optimization model of masked edge structure reconstruction loss, retained edge supervision loss, and negative sample prediction loss to improve its structure restoration ability and generalization robustness. The specific loss function design is shown in step 5, such as Figure 4 .

[0173] Link prediction downstream application module 109: This module applies the node representation output by the self-supervised optimization module to the link prediction task, predicting new edge connections that may appear in future time steps. It is suitable for practical scenarios such as recommendation systems, financial transaction discovery, and social network structure evolution, reflecting the wide practicality and engineering deployability of the present invention.

[0174] A computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, a discrete dynamic graph neural network link prediction method based on a mask mechanism.

[0175] A terminal device includes a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, and the instructions are suitable for being loaded and executed by the processor to implement the discrete dynamic graph neural network link prediction method based on the mask mechanism.

[0176] The above are all preferred embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A discrete dynamic graph neural network link prediction method based on a mask mechanism, characterized in that: include: Obtain user interaction log dataset; Construct a dynamic graph neural network model based on a masking mechanism. This includes constructing a discrete-time dynamic graph snapshot sequence based on a user interaction log dataset, introducing a node activity scoring mechanism to measure the interactive activity and structural importance of user nodes in the graph at different time steps, and constructing a self-supervised time masking mechanism based on node activity to reduce redundant edge interference in the dynamic graph. Use dynamic graph neural network model to learn dynamic graph feature representation based on frequency domain enhancement; Model optimization is performed using a link prediction optimization mechanism based on self-supervised structure reconstruction; Use the optimized model to perform link prediction; The dynamic graph neural network model is used to perform dynamic graph feature representation learning based on frequency domain enhancement, including introducing a graph convolution mechanism based on spectral domain approximation in the graph structure encoding stage to model the structural dependency relationship between a node and its multi-order neighbors, approximating the frequency domain filter through Chebyshev polynomial expansion, and using the node multi-order neighbor representation learning within a single time snapshot to capture the local difference characteristics of the structural mutation area; after the graph structure feature is extracted, an adaptive frequency domain enhancement mechanism based on a sliding window is introduced to perform spectral modeling on the graph convolution representation sequence of the node by constructing a local time segment, and setting the time step Previous The nodes of the layer are represented as , then The structural feature update form of the layer is expressed as: , in, represents the normalized graph Laplacian matrix, For the Chebyshev polynomial expansion of order, is the corresponding learnable frequency domain convolution kernel parameter, is the activation function, is the fusion coefficient of the residual connection; The link prediction optimization mechanism based on self-supervised structure reconstruction is used to optimize the model, including the introduction of self-supervised reconstruction loss function ,Will The edges in are used as positive samples to optimize the edge prediction ability of the model. By minimizing the loss function, the model learns to restore missing edges when the graph structure is incomplete, and improves the modeling ability of the overall structural evolution of the graph. The loss function is expressed as: , Where, Indicates the The set of edges that are covered at any moment, For the covered edge The real label in the actual graph structure has a value of 1, which means there is a real connection. The probability of edge existence predicted by the model; The model optimization using the link prediction optimization mechanism based on self-supervised structure reconstruction also includes embedding the node features extracted by the graph neural network into the multi-layer perceptron MLP to predict the probability that any node pair may form a connection in the future, which is expressed as: , Where, and Represents nodes respectively and nodes At time step The feature representation of To predict the results; The model optimization using the link prediction optimization mechanism based on self-supervised structure reconstruction also includes integrating the self-supervised loss, the retained edge supervision loss, and the negative sample prediction loss to jointly optimize the structure recovery and edge prediction tasks, and constructing an overall training objective function, which is expressed as: , in, The self-supervised loss term proposed above is used to predict the masked edge information, which effectively enhances the model’s understanding of the overall structure of the dynamic graph. The second term calculates the retained edge The loss of , to ensure that the model accurately learns the existing key edge information; the third item is the negative sample edge The loss is used to enable the model to distinguish the non-existent side information.

2. The discrete dynamic graph neural network link prediction method based on a mask mechanism according to claim 1 is characterized in that: The discrete time dynamic graph snapshot sequence is constructed based on the user interaction log dataset, including inputting the interaction log dataset containing timestamps , and divided by timestamp into discrete time windows: , each time window Corresponding to a graph snapshot ,in, and Indicates time The two nodes that interact, , are the static attributes and statistical feature vectors of the corresponding nodes, is the total number of interactions; in each time window In the example, we extract the interaction pairs that occurred in this time period. , which is constructed as an edge set , node set It is composed of all users who interact with each other, and then constructs an adjacency matrix and a node feature matrix for each node.

3. The discrete dynamic graph neural network link prediction method based on a mask mechanism according to claim 2 is characterized in that: The node activity scoring mechanism is introduced to measure the interactive activity and structural importance of user nodes in different time step graphs, including Nodes in Defining an activity score , the score consists of two parts: node dynamic change score and node importance scores , the two are fused according to the weight ratio, where the dynamic change score of the node is used Characterize the changes in the user's neighbor structure in the time series, expressed as: Among them, the parameters Used to adjust the sensitivity of node dynamic scoring, node exist Degrees of time Represents the basic level of past interactive activity of the node, and They are used to avoid the denominator being zero during the calculation process and ensure the stability of the calculation.

4. The discrete dynamic graph neural network link prediction method based on a mask mechanism according to claim 3 is characterized in that: The node activity scoring mechanism is introduced to measure the interactive activity and structural importance of user nodes in different time step graphs, and also includes the use of node importance scores This method measures the overall importance of a node in the graph structure, comprehensively considering the random access probability of a node in the graph and the importance contribution of neighboring nodes, so as to fully reflect the user's communication potential and structural influence in the overall social network. The PageRank algorithm is used as the calculation method for the global importance score of the node, which is expressed as: , in, is the damping coefficient, represents the total number of nodes, the first term represents the probability of randomly jumping to any node, and the second term represents the influence propagation contribution from neighboring nodes.

5. The discrete dynamic graph neural network link prediction method based on a mask mechanism according to claim 4 is characterized in that: The self-supervised time masking mechanism based on node activity is constructed to reduce the interference of redundant edges in dynamic graphs, including using activity information to adaptively adjust the masking probability of edges and guide the model to focus on high-value structural signals. Any two nodes 、 There are edges between , then the initial mask probability of the edge for: ,in, and Node and At time step The activity score on , the function Mean( ) means taking the average of the two and calculating the mask probability of all edges after correction , based on the modified mask probability, the retained sub-image is determined, and the modified mask power is expressed as: , in, Represents the time step The total number of edges in the above figure, It is a preset target mask ratio hyperparameter used to control the ratio of masked edges in the overall graph structure.

6. A discrete dynamic graph neural network link prediction system based on a mask mechanism, executing a discrete dynamic graph neural network link prediction method based on a mask mechanism as claimed in claim 1, characterized in that: include: The data acquisition module is configured to acquire a user interaction log dataset; The model building module is configured to construct a dynamic graph neural network model based on a masking mechanism, which includes constructing a discrete-time dynamic graph snapshot sequence based on a user interaction log dataset, introducing a node activity scoring mechanism to measure the interactive activity and structural importance of user nodes in the graph at different time steps; and constructing a self-supervised time masking mechanism based on node activity to reduce redundant edge interference in the dynamic graph. The feature module is configured to use a dynamic graph neural network model to perform dynamic graph feature representation learning based on frequency domain enhancement; The optimization module is configured to optimize the model using a link prediction optimization mechanism based on self-supervised structure reconstruction; The prediction module is configured to perform link prediction using the optimized model.

Citation Information

Patent Citations

  • Graph neural network-based transaction fraud detection method and system

    WO2022088408A1

  • Social recommendation method based on cross-topic contrastive learning

    WO2025011132A1