Time sequence link prediction system based on structure-time sequence coupling and gating interaction
By employing a two-stage prediction method involving time window segmentation and multi-operator gating fusion, the problem of segmentation and negative sampling in predicting user-focused network links is solved, improving prediction accuracy and robustness, adapting to changes in user interests, and supporting rapid user integration.
Patent Information
- Application Number
- CN202511784689.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-06
AI Technical Summary
Existing technologies suffer from problems such as improper segmentation and negative sampling, insufficient static modeling, and incomplete information on single routes in predicting network links of interest to users. These issues result in large deviations in prediction performance and make it difficult to adapt to changes in user interests.
A two-stage temporal link prediction method is adopted, which involves time window segmentation, nearest neighbor negative sampling, multi-operator gating fusion, and probability calibration. By constructing user encoders and candidate encoders, and utilizing structure-temporal features and gating interaction operators, the prediction accuracy and robustness are improved.
It significantly reduces the performance gap between offline and online environments, supports the rapid integration of new users, improves adaptability to dynamic scenarios, reduces risks, and provides reliable business decision-making support.
Smart Images

Figure CN121614867A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of graph data mining and machine learning technology, specifically to a temporal link prediction system based on structure-temporal coupling and gating interaction. Background Technology
[0002] In today's context of widespread social media use, users form directed relationship networks through "following / subscribing" and other means. To improve user experience and content distribution efficiency, platforms often need to predict potential attention edges (i.e., link prediction) based on existing relationship graphs for functions such as "people who might be interested," "creator growth," and "relationship completion." However, link prediction in attention networks is particularly complex and difficult due to multiple factors—such as the dynamic changes in user interests, the highly sparse and long-tail distribution of interaction behavior, the semantic fragmentation of different communities / circles, the lack of historical records for cold-start users (new users / new creators), and the differences in feature availability caused by compliance and privacy constraints.
[0003] Existing methods can be mainly divided into two categories: a) Graph representation learning: Node embeddings are obtained using DeepWalk / Node2Vec / NetMF, GCN / GraphSAGE, etc., and then the node representations are combined into edge representations using Hadamard / concatenation, etc. for binary classification, mapping the nodes in the graph to low-dimensional vectors (such as structural embedding, neighborhood embedding, GNN, etc.). b) Structural heuristics: Utilize the topological features of graphs such as degree, common neighbors, and Adamic-Adar to achieve prediction.
[0004] However, existing methods have the following shortcomings: 1. Improper partitioning and negative sampling: Randomly partitioning the training and test sets may introduce the problem of "the test set containing nodes not seen in the training set". Negative samples are often "balanced sampling from a distance", which does not reflect the competition between nearest neighbors and the extremely unbalanced distribution in real-world scenarios, resulting in large performance deviations between offline and online. 2. Insufficient static modeling: It lacks time decay and time encoding mechanisms, cannot display the dynamic evolution of modeling relationships, and is difficult to adapt to time-series scenarios such as changes in user interests; 3. Incomplete information from a single route: Relying solely on representation learning or structural heuristics may miss complementary information, leading to a limited upper limit for prediction. Summary of the Invention
[0005] This invention addresses the technical problems existing in the prior art by proposing a two-stage temporal link prediction method and system that integrates structure-temporal features and gating interaction. Through time window segmentation, nearest neighbor hard negative sampling, multi-operator gating fusion, and probability calibration, the accuracy, robustness, and reliability of link prediction are improved.
[0006] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: a time-series link prediction system based on structure-time coupling and gating interaction, comprising the following steps; S1. Data Preprocessing: Determining the time division point T and the increment. The edge events with timestamps are divided into training graphs. With the test edge set E, for the source node u, from its in In the two-hop unconnected nodes, nearest neighbor hard negative samples are constructed and paired with a small number of far-distance negative samples to form a training positive and negative sample set; S2, Feature and Representation Construction: In The structural heuristic features and temporal features of node pairs are calculated, and the node embedding model is trained to obtain node vectors. S3, Dual-Tower Recall: Building a User Encoder With candidate encoder By training with InfoNCE contrastive loss, the similarity of positive sample vectors is brought closer together and that of negative samples is moved further apart, thus improving the candidate node... Vectors are used to construct an approximate nearest neighbor index, and Top-N candidates are retrieved for each source node u to form a candidate set. ; S4, Interactive Refinement: For For each node pair, an edge interaction operator is constructed. The operator weights are calculated using a gating network, and the edge representations are fused. The fused result is then concatenated with structure-temporal features and input into a multilayer perceptron to obtain the predicted edge existence probability. The fine-ranking model is trained using Focal loss; S5. Probability Calibration and Uncertainty Estimation: The logarithmic probability of the fine-rank output is mapped to the calibration probability using temperature scaling. The optimal temperature is found on the validation set. Node pairs are sampled using Monte Carlo Dropout, and the probability mean and variance are calculated. The variance is used to measure the prediction uncertainty.
[0007] The beneficial effects of this invention are: First, information leakage is avoided by strictly dividing the time window, and the nearest neighbor negative sampling simulates the real candidate distribution, which significantly reduces the performance deviation between offline and online. Secondly, the inductive node encoding method does not require prior node knowledge, and the processing of rare node clusters supports the rapid integration of new users into the prediction process, shortens the first exposure window, and injects temporal features into structural heuristics and node embedding, taking into account both "topological association" and "temporal activity" to improve the adaptability of dynamic scenarios. Finally, by using a multi-operator gated network to automatically assign interactive feature weights, manual feature engineering is reduced, the model's generalization ability is improved, and temperature scaling is used to correct the probability scale. MC-Dropout provides uncertainty measurement, providing a reliable basis for business decisions and reducing risks. Attached Figure Description
[0008] Figure 1 This is a diagram of the overall architecture of the present invention. Detailed Implementation
[0009] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0010] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0011] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "set up," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this technology based on the specific circumstances.
[0012] In the description of this application, spatial relation terms such as “below,” “under,” “below,” “below,” “above,” “over,” etc., are used herein to describe the relationship between an element or feature shown in the figures and other elements or features. It should be understood that, in addition to the orientation shown in the figures, spatial relation terms also include different orientations of the device in use and operation. For example, if the device in the figures is flipped, an element or feature described as “below,” “under,” or “below” will be oriented “over” the other element or feature. Therefore, the exemplary terms “below” and “under” can include both upper and lower orientations. Furthermore, the device may also include other orientations (e.g., rotated 90 degrees or other orientations), and the spatial descriptive terms used herein are interpreted accordingly.
[0013] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0014] Example
[0015] See Figure 1 A time-series link prediction system based on structure-temporal coupling and gating interaction includes the following steps; S1. Data Preprocessing: Determining the time division point T and the increment. The edge events with timestamps are divided into training graphs. , With test edge set For any source node u, define its position in the training graph. A neighbor in the middle Neighbors who jumped twice Specifically: ; ; in, For training images The set of edges from which in Two-hop unconnected nodes In the middle, construct nearby negative samples and pair them with a small number of distant negative samples to form a training positive and negative sample set.
[0016] S2, Feature and Representation Construction: In The structural heuristic features and temporal features of node pairs are calculated, and the node embedding model is trained to obtain node vectors. The calculation method for the structural heuristic features is as follows: Mutual neighbors: ,in = ; Jaccard coefficient: ; Adamic-Adar Index: ,in Let x be the degree of node x; Resource allocation index: ; Priority connection: ; Katz Index: Where A is the training image. The adjacency matrix, , spectral radius, It is the identity matrix; Personalized PageRank: ,in , Let u be a unit vector with a value of 1 at the position u and a value of 0 elsewhere. For degree matrix, This represents the probability of restarting. The temporal features include exponential time decay weights and multi-frequency time coding, wherein The formula for exponential time decay weighting is: ; in, Here, t represents the attenuation coefficient, and t represents the evaluation time. For the historical edge timestamp; The formula for multi-frequency time coding is: ; in, For the time difference, , The time scale determines the frequency band coverage, and k is the coding dimension; Will As a timing condition for message passing, it is defined as follows: ,in For message functions, Let be the initial vectors for nodes i and j; Through formula Update the node vector, where It is a non-linear activation function. This is the weight matrix. This is a mean aggregation operation, and the model is trained iteratively until it converges.
[0017] S3, Dual-Tower Recall: Building a User Encoder With candidate encoder By training with InfoNCE contrastive loss, the similarity of positive sample vectors is brought closer together and that of negative samples is moved further apart, thus improving the candidate node... Vectors are used to construct an approximate nearest neighbor index, and Top-N candidates are retrieved for each source node u to form a candidate set. ; The expression for the InfoNCE contrastive loss function is as follows: ; in, For node-to-vector similarity, For temperature parameters, For positive sample nodes, is a negative sample node, and M is the number of negative samples; The approximate nearest neighbor index is constructed using the HNSW algorithm to achieve efficient Top-N candidate node retrieval.
[0018] S4, Interactive Refinement: For For each node pair, an edge interaction operator is constructed. The operator weights are calculated using a gating network, and the edge representations are fused. The fused result is then concatenated with structure-temporal features and input into a multilayer perceptron to obtain the predicted edge existence probability. The fine-ranking model is trained using Focal loss; The specific form of the edge interaction operator is as follows: Hadamard product: ,in , Let u and v be vector representations of nodes u and v. splicing: The dimension is 2d, where d is the dimension of the node vector; L1 distance vector: ; L2 distance vector: ; Dot product scalar: ; Bilinear scalar: ,in It is a bilinear weight matrix; The formula for calculating the weights of the interaction operators on each side of the gated network is as follows: ; in, The output of the interaction operators on each side, For pooling operations, Here is the weight matrix of the gated network. is the bias vector of the gated network; The merged edge representation: and structural heuristics Features and time series Feature concatenation, followed by multilayer perceptron outputting the edge existence probability: ; Where W is the weight matrix of the hidden layer of the multilayer perceptron, and b is the bias of the hidden layer of the multilayer perceptron. It is an activation function. These are the weights of the output layer. It is the bias of the output layer; The expression for the Focal loss function is as follows: ; in, For real labels, For balance coefficient, For focusing parameters.
[0019] S5. Probability Calibration and Uncertainty Estimation: Map the logarithmic odds of the fine-ranking output to calibration probabilities using temperature scaling. Find the optimal temperature on the validation set. Sample node pairs using Monte Carlo Dropout and calculate the probability mean. With variance Variance measures forecast uncertainty. The temperature scaling formula is as follows: ; in, Here, z is the sigmoid function, z is the log-odds output of the fine-ranking model, and T is the temperature parameter. The expression for the loss function used to solve for the optimal temperature parameter T by minimizing the negative log-likelihood loss on the independent validation set is as follows: ; in, To verify the true label of sample i in the validation set; The uncertainty estimation uses Monte Carlo Dropout to perform S samplings to obtain the probability set. : The average probability of the S predictions is used as the final "optimal estimate," reflecting the overall likelihood of a node having a link. The larger the variance, the higher the uncertainty. , which measures the dispersion of the S prediction results.
[0020] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the above embodiments are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.
Claims
1. A structure-timing coupling and gated interaction based temporal link prediction system, characterized in that, Comprising the following steps; S1, data preprocessing: determine time segmentation point T and increment Divide the timestamped edge events into training graphs With the test edge set E, from the two-hop unconnected nodes of u in Construct a near neighbor hard negative sample from the two-hop unconnected nodes of u in E, and a small number of long-distance negative samples to form a training positive and negative sample set; S2, feature and representation construction: in the structure heuristic features and timing features of the node pairs are calculated on the upper layer, and the node embedding model is trained to obtain node vectors; S3, double-tower recall: build user encoder With candidate encoder , through InfoNCE contrast loss training, make positive sample vector similarity close, negative sample away, and Vector construction approximate nearest neighbor index, retrieve Top-N candidates for each source node u to form candidate set ; S4, interactive fine arrangement: to The middle node pair constructs an edge interaction operator, calculates operator weights through a gating network, fuses edge representations, concatenates the fusion results with structure-temporal features, and inputs the concatenated results into a multi-layer perception machine to obtain edge existence probability prediction values The fine arrangement model is trained using a focal loss. S5, probability calibration and uncertainty estimation: mapping the logit output of the fine-tuning into calibrated probabilities with temperature scaling, finding the optimal temperature on the validation set, sampling node pairs with Monte-Carlo Dropout, computing the mean and variance of the probabilities, and measuring the prediction uncertainty with the variance.
2. The structure-timing coupled and gated interaction based timing link prediction system of claim 1, wherein, In S1, for any source node u, define its one-hop neighbors in the training graph Gtrain and two-hop neighbors Specifically: ; ; wherein, is a set of edges of the graph for training 3. The system and method of claim 1, wherein, In S2, the structural heuristic feature is calculated in the following way Common neighbors: wherein = ; Jaccard coefficient: ; Adamic-Adar index: wherein is the degree of node x; Resource allocation index: ; Preferred connections: ; Katz index: where A is the adjacency matrix of the training graph, , is the spectral radius, is the identity matrix; Personalized PageRank: where , is a unit vector with 1 at u and 0 elsewhere, is the degree matrix, is the restart probability.
4. The system and method of claim 1, wherein, In S2, the timing feature includes exponential time decay weights and multi-frequency time encoding, wherein The formula of the exponential time decay weights is ; wherein, is a decay coefficient, t is the evaluation time, is a history edge timestamp; The formula of the multi-frequency time encoding is ; wherein, is the time difference, , is the time scale, determines the coverage of the frequency band, and k is the coding dimension; The As a timing condition for message passing, define: wherein is a message function, is an initial vector for nodes i, j; By the formula updating the node vector, wherein is a nonlinear activation function, is a weight matrix, is a mean aggregation operation, iterating training until the model converges.
5. The structure-timing coupled and gated interaction based timing link prediction system of claim 1, wherein, In S3, the expression of the InfoNCE contrastive loss function is ; wherein, is a node pair vector similarity, is a temperature parameter, is a positive sample node, is a negative sample node, and M is a number of negative samples.
6. The structure-timing coupled and gated interaction based timing link prediction system of claim 1, wherein, In S3, the approximate nearest neighbor index is constructed using the HNSW algorithm to achieve efficient Top-𝑁 candidate node retrieval.
7. The structure-timing coupled and gated interaction based timing link prediction system of claim 1, wherein, In S4, the specific form of the edge interaction operator is Hadamard product: where , are the vector representations of nodes u, v; Concatenation: with dimension 2d, d being the dimension of the node vectors; L1 distance vector: ; L2 distance vector: ; Dot product scalar: ; Bilinear scalar: where is the bilinear weight matrix.
8. The structure-timing coupled and gated interaction based timing link prediction system of claim 1, wherein, In S4, the formula for calculating the weight of each edge interaction operator in the gating network is ; wherein, is an output of each edge interaction operator, is a pooling operation, is a weight matrix of the gating network, is a bias vector of the gating network; Fused edge representation: and structure heuristics feature and timing feature stitching, edge existence probability through multi-layer perceptron ; where W is a weight matrix of the multilayer perceptron hidden layer, b is a bias of the multilayer perceptron hidden layer, is an activation function, is a weight of the output layer, is a bias of the output layer.
9. The structure-timing coupled and gated interaction based timing link prediction system of claim 1, wherein, In S4, the expression of the Focal loss function is ; wherein, is a true label, is a balancing coefficient, is a focusing parameter.
10. The structure-timing coupled and gated interaction based timing link prediction system of claim 1, wherein, In S5, the temperature scaling formula is ; wherein, is a sigmoid function, z is the logit output of the fine-tuning model, and T is a temperature parameter. The loss function expression for solving the optimal temperature parameter T by minimizing the negative log-likelihood loss on the independent validation set is ; wherein, is the true label of the validation set sample i.