Link prediction method and system of social network based on block chain

By constructing a blockchain-based social network link prediction method, collecting and analyzing on-chain social interaction data, generating graph snapshots, and performing multi-dimensional feature extraction and dynamic modeling, the method solves the problems of multi-dimensional characterization of on-chain behavior and link prediction accuracy in existing technologies, and achieves high-quality link prediction and interpretable analysis.

CN120952227APending Publication Date: 2025-11-14HUAIAN COLLEGE OF INFORMATION TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511046310.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing technologies cannot achieve multi-dimensional characterization of on-chain behavior, cannot comprehensively assess the structural importance and influence of nodes, cannot output structured features that integrate individuals and groups, static and dynamic characteristics, and cannot accurately capture the long-term trends of embedded sequences, thus reducing the accuracy of potential link predictions.

Method used

By collecting on-chain social interaction data from blockchain and Web3 social protocols, we construct subgraphs based on transaction, follow, like, comment, and forward behavior types. We generate graph snapshots using time window slicing, perform user behavior clustering analysis, node centrality calculation, and co-occurrence analysis of group behavior events, model node embeddings and predict potential links using graph neural networks, and model the temporal evolution of node relationships using graph snapshot sequences.

Benefits of technology

It enables multi-dimensional characterization of on-chain behavior, integrates graph neural networks and temporal modeling techniques, improves the accuracy and interpretability of link prediction, supports the identification of abnormal behavior and decision transparency, and provides high-quality link prediction input.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120952227A_ABST
    Figure CN120952227A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of social networks and block chains, in particular to a link prediction method and system for a social network based on a block chain, and aims to solve the problems that multi-dimensional description of behaviors on the chain cannot be realized, the structural importance and influence of nodes cannot be comprehensively evaluated, and the link prediction efficiency is low in the prior art. The problems that individual and group and static and dynamic structured features cannot be output and fused, and high-quality input cannot be provided for link prediction are solved; according to the method, through user behavior clustering, node centrality calculation, behavior trajectory modeling and group co-occurrence analysis, multi-dimensional description of behaviors on a chain is achieved, structural importance and influence of nodes are comprehensively evaluated through multiple centrality indexes, evolution paths and stability are revealed through behavior trajectory sequence modeling, and multi-dimensional analysis of the behaviors on the chain is achieved. According to the group behavior co-occurrence analysis, a collaborative mode is found through similarity calculation, individual and group and static and dynamic structured features are output and fused, and high-quality input is provided for link prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of social networks and blockchain technology, and more specifically, to a link prediction method and system for blockchain-based social networks. Background Technology

[0002] In the wave of digitalization, social networks have become deeply integrated into people's lives. Link prediction, as a core analytical direction, is of great significance for understanding network mechanisms, predicting potential relationships, and implementing recommendation systems. Traditional methods rely on network structure and node attributes, but face two major challenges: first, dynamic changes in data are difficult to capture in real time, affecting accuracy; second, user privacy is easily leaked in centralized processing. Blockchain technology, with its decentralized characteristics, provides a new approach to solving these problems: it can achieve decentralized data storage, improving security and privacy; and it can support automated prediction through smart contracts, enhancing reliability and real-time performance.

[0003] Reference patent application CN118428547A discloses a link prediction method, system, and storage medium for strongly sparse mobile social networks. The method includes: an encoder in a graph autoencoder (GAE) receives an input graph sequence of the mobile social network, performs feature extraction, and obtains a feature matrix; a matrix aggregation module aggregates the feature matrix output by the encoder and the degree matrix of the graph sequence to obtain an aggregated feature matrix; a long short-term memory (LSTM) module receives the aggregated feature matrix output by the matrix aggregation module, performs temporal feature extraction, and inputs the extracted temporal features into a decoder in the GAE; the decoder decodes to obtain the predicted link graph. This method can reduce the cost of model learning, eliminate the negative impact of the strong sparsity of mobile social networks on deep neural networks, and improve the accuracy of link prediction.

[0004] However, while the aforementioned reference patents reduce model learning costs by extracting feature matrices using graph autoencoders (GAEs), eliminate the negative impact of strong sparsity on deep neural networks by utilizing graph convolutional networks (GCNs) fusion degree matrices and output matrices, and improve link prediction accuracy by employing multi-layer long short-term memory (LSTM) networks to learn temporal sequence changes, they cannot achieve multi-dimensional characterization of on-chain behavior, cannot comprehensively evaluate the structural importance and influence of nodes, cannot output structured features that integrate individuals and groups, and static and dynamic features, and cannot provide high-quality input for link prediction. Furthermore, they cannot achieve dynamic modeling of node relationships and potential link prediction, and cannot accurately capture the long-term trends of embedded sequences, thus reducing the accuracy of potential link prediction.

[0005] To address these issues, we propose a blockchain-based link prediction method and system for social networks. Summary of the Invention

[0006] The purpose of this invention is to provide a link prediction method and system for blockchain-based social networks, which solves the problems of existing technologies that cannot achieve multi-dimensional characterization of on-chain behavior, cannot comprehensively evaluate the structural importance and influence of nodes, cannot output structured features that integrate individuals and groups, static and dynamic features, and cannot provide high-quality input for link prediction; at the same time, they cannot achieve dynamic modeling of node relationships and potential link prediction, cannot accurately capture the long-term trend of embedded sequences, and reduce the accuracy of potential link prediction.

[0007] The objective of this invention is achieved through the following technical solution:

[0008] A blockchain-based method for predicting links in a social network includes the following steps:

[0009] Step 1: Collect on-chain social interaction data from multiple blockchains and Web3 social protocols, and perform preprocessing operations on the collected on-chain social interaction data;

[0010] Step 2: Based on the preprocessed on-chain social interaction data, construct subgraphs according to the types of behaviors such as transactions, following, likes, comments, and reposts, and generate graph snapshots at multiple time points through time window slicing;

[0011] Step 3: Based on the preprocessed on-chain social interaction data and the time slice results of various types of subgraphs, perform user behavior clustering analysis, node centrality calculation, behavior trajectory sequence modeling, and group behavior event co-occurrence analysis, and output user behavior labels, node centrality features, behavior evolution paths, and group behavior patterns.

[0012] Step 4: Based on the time slice results and behavioral analysis features of each type of subgraph, a graph neural network is used to model node embeddings and predict potential links. Combined with graph snapshot sequences, the temporal evolution of node relationships is modeled, and the link prediction results and interpretability features are output.

[0013] In a preferred embodiment of the present invention, the process of constructing sub-graphs according to the transaction, follow, like, comment, and repost behavior types in step two includes:

[0014] Obtain preprocessed on-chain social interaction data, which includes transaction behavior data, social interaction data, and decentralized identity data. Using the preprocessed on-chain social interaction data as input, construct a subgraph according to behavior type. The construction steps are as follows:

[0015] S1: Create an empty set;

[0016] S2: Traverse all transaction records, extract from_address and to_address from each record, add these addresses to the node set, construct directed edges, and add the current node set and edge set as a transaction behavior subgraph to the graph set;

[0017] S3: Traverse all the records of interest, extract the actor and target from each record, add these addresses to the node set, construct directed edges, and add the current node set and edge set as a subgraph of interest behavior to the graph set;

[0018] S4: Traverse all like records, extract the actor and target from each record, add these addresses to the node set, construct directed edges, and add the current node set and edge set as a like behavior subgraph to the graph set;

[0019] S5: Traverse all comment records, extract the actor and target from each record, add these addresses to the node set, construct directed edges, and add the current node set and edge set as a comment behavior subgraph to the graph set;

[0020] S6: Traverse all forwarding records, extract the actor and target from each record, add these addresses to the node set, construct directed edges, and add the current node set and edge set as a forwarding behavior subgraph to the graph set;

[0021] The output is a graph set containing five subgraphs, corresponding to the behavior types of transactions, following, likes, comments, and reposts.

[0022] In a preferred embodiment of the present invention, the process of generating multiple time point snapshots by slicing through a time window in step two includes:

[0023] Using preprocessed on-chain social interaction data as input, the entire time range is set to [T] based on the analysis requirements. start ,T end The time range is divided into multiple consecutive time windows, each with a size of W and a sliding step size of S between adjacent windows.

[0024] Within each time window, all behavior records whose timestamps fall within that window are filtered from the input data to form a subset. Within each time window, for each behavior type, a corresponding subgraph is constructed based on the filtered behavior records.

[0025] Output a series of graph snapshots, each containing multiple subgraphs, each corresponding to a different behavior type.

[0026] In a preferred embodiment of the present invention, the process of performing user behavior clustering analysis and outputting user behavior tags in step three includes:

[0027] The system obtains preprocessed on-chain social interaction data and time slice results for each type of subgraph. Each subgraph's time slice result is a snapshot of multiple time points generated by dividing it into time windows. Using the preprocessed on-chain social interaction data and time slice results for each type of subgraph as input data, the system extracts the following three features for each user and each time window:

[0028] The number of transactions the user makes within this window, the number of interactions the user has with other addresses within this window, and the total number of social behaviors the user engages in within this window;

[0029] The system standardizes each feature dimension within the current time window, and then uses the K-Means algorithm to cluster the standardized feature vectors.

[0030] The system assigns a behavior label to each user in each time window and outputs a semantic explanation for each label.

[0031] In a preferred embodiment of the present invention, the process of performing node centrality calculation and outputting node centrality features in step three includes:

[0032] The system receives a set of on-chain social interaction data. Each record contains the following fields: the address of the behavior initiator, the address of the behavior target, the timestamp of the behavior, and the intensity of the behavior. The system constructs a directed weighted graph based on these records.

[0033] The system calculates the following five centrality metrics: degree centrality, weighted degree centrality, betweenness centrality, PageRank centrality, and eigenvector centrality.

[0034] The system outputs a centrality feature vector for each user in each time window, which includes the following fields: degree centrality value, weighted degree centrality value, betweenness centrality value, PageRank centrality value, and feature vector centrality value.

[0035] In a preferred embodiment of the present invention, step three, which involves performing behavioral trajectory sequence modeling and co-occurrence analysis of group behavioral events and outputting user behavior evolution paths and group behavior patterns, includes:

[0036] The system receives a sequence of behavioral labels for each user in multiple time windows. The system combines the behavioral labels of each user in each time window into a state sequence. The system counts the frequency of each state transitioning to other states after the time window, constructs a state transition probability matrix, and calculates the state transition entropy.

[0037] The system outputs the following: the behavioral state of each user in each time window, the state transition matrix of all users, and the path disorder metric for each user;

[0038] The system receives the following data: user cluster label number, user behavior vector, and time window information;

[0039] The system divides users into several groups based on their clustering tags or community affiliations. For each group, the system aggregates the behavioral vectors of its members within a time window, calculates the average behavioral characteristics of the group, and calculates the cosine similarity of the behavioral vectors between groups.

[0040] The system sets a similarity threshold. If the similarity between two groups is greater than the threshold within a certain time window, it is determined that the two groups have co-occurring behavioral events within that time window.

[0041] The system outputs the following: the average behavioral state of each group in each time window, the set of co-occurrence events between groups, and the co-occurrence intensity matrix between all groups.

[0042] In a preferred embodiment of the present invention, the process of modeling node embeddings and predicting potential links using graph neural networks in step four includes:

[0043] Modeling is performed based on the obtained subgraph time slice results and behavioral analysis features. The behavioral analysis features include user behavior labels, node centrality features, behavioral evolution paths, and group behavior patterns. Each time slice represents a subgraph snapshot, containing the nodes and edges that appear within the time window. Each node has an input feature vector in each snapshot, which is composed of attribute features and behavioral features.

[0044] At each snapshot, a graph neural network is used to model the subgraph. The graph neural network contains a multi-layer propagation structure, and each layer updates the representation of the current node by aggregating the embedding information of the neighboring nodes.

[0045] The initial embedding is the concatenated input feature vector. After multiple propagations, the output node is the final embedding vector at that time snapshot.

[0046] For any node pair (u,v), concatenate their embedding vectors from the snapshot at that time and input them into a binary classifier to calculate the probability that a link exists between the node pair.

[0047] In a preferred embodiment of the present invention, step four, which combines graph snapshot sequences to model the temporal evolution of node relationships and outputs link prediction results and interpretability features, includes:

[0048] For each node, its embedding vectors from all time snapshots are arranged in chronological order to form a temporal embedding sequence;

[0049] The sequence is then fed into a Long Short-Term Memory (LSTM) network. The processing steps are as follows:

[0050] T1: Initialize the hidden state and cell state as zero vectors;

[0051] T2: Input the embedding vector for each time point in chronological order;

[0052] T3: In each step, LSTM updates the current hidden state based on the current input and the hidden state of the previous step;

[0053] T4: Finally, output the hidden state of the last time step as the evolutionary representation of this node;

[0054] For any pair of nodes (u,v), their evolutionary representation vectors are concatenated and input into a binary classifier. The probability of a link existing between the pair of nodes is calculated. If the output value is greater than or equal to 0.5, it is determined that there is a potential link between the pair of nodes; otherwise, it is determined that there is no link.

[0055] While outputting the link prediction results, based on the node evolution representation and behavioral feature sequence, the following interpretable features are output: structural similarity, centrality change, behavioral evolution path similarity, and group behavior consistency.

[0056] As a preferred embodiment of the present invention, the blockchain-based social network link prediction system includes an on-chain social data acquisition module, a behavior subgraph construction module, a behavior feature extraction and analysis module, and a dynamic graph interpretable link prediction module.

[0057] The on-chain social data collection module is used to collect on-chain social interaction data from multiple blockchains and Web3 social protocols, and to perform preprocessing operations on the collected on-chain social interaction data.

[0058] The behavior subgraph construction module is used to construct subgraphs based on preprocessed on-chain social interaction data, according to the behavior types of transactions, following, likes, comments and reposts, and generate graph snapshots at multiple time points through time window slicing;

[0059] The behavioral feature extraction and analysis module is used to perform user behavior clustering analysis, node centrality calculation, behavioral trajectory sequence modeling, and group behavior event co-occurrence analysis based on preprocessed on-chain social interaction data and time slice results of various types of subgraphs, and output user behavior labels, node centrality features, behavioral evolution paths, and group behavior patterns.

[0060] The dynamic graph interpretable link prediction module is used to model node embeddings and predict potential links based on the time slice results and behavioral analysis features of various types of subgraphs. It combines graph neural networks to model the temporal evolution of node relationships with graph snapshot sequences, and outputs link prediction results and interpretability features.

[0061] Compared with the prior art, the advantages of this invention are:

[0062] (1) In this invention, multi-dimensional characterization of on-chain behavior is achieved through user behavior clustering, node centrality calculation, behavior trajectory modeling and group co-occurrence analysis. Interpretable behavior labels are generated based on feature clustering of time windows. Multiple centrality indicators are used to comprehensively evaluate the structural importance and influence of nodes. Behavior trajectory sequence modeling reveals evolution path and stability, supports abnormal behavior identification, and group behavior co-occurrence analysis discovers collaborative patterns through similarity calculation. The output is a structured feature that integrates individuals and groups, static and dynamic features, providing high-quality input for link prediction.

[0063] (2) In this invention, by integrating graph neural networks and temporal modeling techniques, dynamic modeling of node relationships and prediction of potential links are realized. Node embeddings are learned by aggregating neighbor information and semantics are enhanced by combining behavioral features. LSTM captures the long-term trend of the embedding sequence to improve prediction accuracy. The prediction is based on evolutionary representation for binary classification, outputting link probabilities and generating structural similarity, centrality change, behavioral path similarity and group consistency to enhance decision transparency. The overall method takes into account both performance and interpretability, providing fine-grained support for dynamic graph link prediction. Attached Figure Description

[0064] Figure 1 This is a flowchart of the method in Embodiment 1 of the present invention;

[0065] Figure 2 This is a flowchart of the LSTM processing steps in this invention;

[0066] Figure 3 This is a system block diagram of Embodiment 3 of the present invention. Detailed Implementation

[0067] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0068] Example 1: As Figure 1 As shown, the present invention proposes a blockchain-based link prediction method for social networks, comprising the following steps:

[0069] Step 1: Collect on-chain social interaction data from multiple blockchains and Web3 social protocols, and perform preprocessing operations on the collected on-chain social interaction data, including timestamp normalization, address standardization, data deduplication, and invalid data filtering.

[0070] On-chain social interaction data includes transaction behavior data, social interaction data, and decentralized identity data. Transaction behavior data represents the transfer behavior between two blockchain addresses, and each transaction record consists of the following fields:

[0071] rom_address: The address of the transaction initiator;

[0072] to_address: The address of the transaction recipient;

[0073] value: Transaction amount, representing the specific value of the transaction, in the smallest unit;

[0074] method: The method type of the transaction, which can be one of the following strings: "transfer", "contract_call", or "contract_creation";

[0075] timestamp: The timestamp of the transaction, accurate to the second;

[0076] All transactions constitute a set of edges. Each transaction record corresponds to a directed edge in the graph, with the direction pointing from from_address to to_address. The attributes of the edge consist of value, method, and timestamp.

[0077] Social interaction data represents the behavioral relationships between users, and each interaction record consists of the following fields:

[0078] actor: The address of the initiator of the interactive behavior;

[0079] target: The target address or content identifier for the interactive behavior;

[0080] action_type: The interaction type, which can be one of the following strings: "follow", "like", "comment", or "retweet";

[0081] timestamp: The timestamp of the interaction, accurate to the second;

[0082] Each interaction type constitutes a separate set of edges;

[0083] Decentralized identity data is used to map standardized identity identifiers to blockchain addresses, with supported types including ENS names and LensHandles;

[0084] Each address is uniquely identified by a standardized identifier according to the following rules:

[0085] If the address is bound to an ENS name, then the bound ENS name is used as the identity identifier;

[0086] Otherwise, if the address is bound to a LensHandle, the bound LensHandle is used as the identity identifier;

[0087] Otherwise, use the original address as the identity identifier;

[0088] By preprocessing on-chain social interaction data collected from multiple blockchains and Web3 social protocols, the consistency, accuracy, and usability of the data can be effectively improved. Timestamp standardization unifies the time format and achieves time alignment, facilitating subsequent time series analysis. Address standardization ensures the uniqueness and compatibility of different on-chain addresses, improving system compatibility and query efficiency. Data deduplication eliminates redundant records, reducing the waste of storage and computing resources. Invalid data filtering improves the overall data quality and avoids abnormal or erroneous data interfering with model training and analysis results. These preprocessing operations work together to provide a high-quality, well-structured data foundation for subsequent graph structure construction, behavioral feature extraction, and link prediction, significantly enhancing system processing efficiency and model performance.

[0089] Step 2: Based on the preprocessed on-chain social interaction data, construct subgraphs according to the types of behaviors such as transactions, following, likes, comments, and reposts, and generate graph snapshots at multiple time points through time window slicing;

[0090] Step two involves constructing subgraphs based on the types of behavior: transactions, following, likes, comments, and reposts.

[0091] Obtain preprocessed on-chain social interaction data, which includes transaction behavior data, social interaction data, and decentralized identity data. Using the preprocessed on-chain social interaction data as input, construct a subgraph according to behavior type. The construction steps are as follows:

[0092] S1: Create an empty collection to store the completed subgraphs;

[0093] S2: Traverse all transaction records, extract from_address and to_address from each record, add these addresses to the node set, construct directed edges with the direction from from_address to to_address, and the attributes of the edges include transaction amount (value), transaction method (method), and transaction timestamp (timestamp). Add the current node set and edge set as a transaction behavior subgraph to the graph set.

[0094] S3: Traverse all follow records, extract the actor and target from each record, add these addresses to the node set, construct directed edges from actor to target, and the edge attributes include timestamp and platform source. The platform source value is one of the following strings: "twitter", "lens", "ens", "other". Add the current node set and edge set as a follow behavior subgraph to the graph set.

[0095] S4: Traverse all like records, extract the actor and target from each record, add these addresses to the node set, construct directed edges from actor to target, and the edge attributes include timestamp and platform source. The platform source value is one of the following strings: "twitter", "lens", "ens", "other". Add the current node set and edge set as a like behavior subgraph to the graph set.

[0096] S5: Traverse all comment records, extract the actor and target from each record, add these addresses to the node set, construct directed edges from actor to target, and the edge attributes include timestamp and platform source. The platform source value is one of the following strings: "twitter", "lens", "ens", "other". Add the current node set and edge set as a comment behavior subgraph to the graph set.

[0097] S6: Traverse all forwarding records, extract the actor and target from each record, add these addresses to the node set, construct directed edges from actor to target, and the edge attributes include timestamp and platform source. The platform source value is one of the following strings: "twitter", "lens", "ens", "other". Add the current node set and edge set as forwarding behavior subgraph to the graph set.

[0098] The output is a graph set containing five subgraphs, corresponding to the behavior types of transaction, follow, like, comment, and forward. Each subgraph consists of a set of nodes and a set of edges. All field names, field types, and field value ranges are uniquely defined in the input data type description.

[0099] Step two involves generating multiple time-point snapshots by slicing through a time window, including:

[0100] Using preprocessed on-chain social interaction data as input, the entire time range is set to [T] based on the analysis requirements. start ,T end The time range is divided into multiple consecutive time windows, each with a size of W and a sliding step size of S between adjacent windows. The start and end time range of the k-th time window is:

[0101] Δk=[T start +(k-1)S,T start +(k-1)S+W), where k is a positive integer representing the time window number;

[0102] Within each time window, all behavior records whose timestamps fall within that window are selected from the input data, forming a subset. These records are used to construct the graph structure within that time window. Within each time window, for each behavior type, a corresponding subgraph is constructed based on the selected behavior records, following the following construction rules:

[0103] The node set consists of the initiator's address and the target's address from all records of this behavior type within the time window;

[0104] The edge set consists of all records of this behavior type within the time window, and the direction of each edge is from the initiator address to the target address;

[0105] Edge attribute fields are defined according to the behavior type. For example, for transaction behavior, edge attributes include transaction amount (value), transaction method (method), transaction timestamp (timestamp), etc. For social interaction behavior (follow, like, comment, share), edge attributes must at least include timestamp (timestamp) and platform source (platform).

[0106] Output a series of graph snapshots, each graph snapshot corresponding to the k-th time window, and each graph snapshot contains multiple subgraphs, each corresponding to a different behavior type;

[0107] By constructing multiple types of subgraphs based on behavior types and generating graph snapshots using time window slicing, the structural heterogeneity and dynamic evolution characteristics of on-chain social interactions can be effectively captured. Modeling different behaviors such as transactions, following, liking, commenting, and forwarding separately helps to distinguish the role mechanisms of various social behaviors in the network structure. Defining node and edge attributes separately for each type of behavior enhances the semantic expressiveness of the graph structure. The time window slicing mechanism supports temporal modeling of social relationships, providing a clear and granular dynamic graph data foundation for subsequent graph neural network modeling and link prediction, significantly improving the model's ability to learn and predict complex behavior patterns.

[0108] Step 3: Based on the preprocessed on-chain social interaction data and the time slice results of various types of subgraphs, perform user behavior clustering analysis, node centrality calculation, behavior trajectory sequence modeling, and group behavior event co-occurrence analysis, and output user behavior labels, node centrality features, behavior evolution paths, and group behavior patterns.

[0109] Step three, which involves performing user behavior clustering analysis and outputting user behavior labels, includes:

[0110] The system obtains preprocessed on-chain social interaction data and time slice results for each type of subgraph. Each subgraph's time slice result is a snapshot of multiple time points generated by dividing it into time windows. Using the preprocessed on-chain social interaction data and time slice results for each type of subgraph as input data, the system extracts the following three features for each user and each time window:

[0111] The number of transactions the user makes within this window, the number of interactions the user has with other addresses within this window, and the total number of social behaviors the user engages in within this window;

[0112] The system standardizes each feature dimension within the current time window. The standardization method is as follows: calculate the mean and standard deviation of each dimension within the current window, subtract the mean from the original value, and divide by the standard deviation to obtain the standardized value.

[0113] The system uses the K-Means algorithm to cluster the standardized feature vectors. The number of clusters is a preset parameter of the system. The clustering objective is to minimize the sum of squared distances between the samples in each cluster and the cluster center.

[0114] The K-Means clustering objective function expression is as follows:

[0115] Where C1,…,C K Let x represent the total number of K clusters formed. i Let μ represent the standardized feature vector of the i-th user. k Let x represent the center vector of the k-th cluster.i -μ k || 2 Let represent the squared Euclidean distance from the i-th sample to the k-th cluster center. The entire formula represents minimizing the sum of the squared distances from all samples to their respective cluster centers, given the number of clusters K.

[0116] The system assigns a behavior label to each user in each time window, representing the category of their behavior pattern within that time window. The behavior label number ranges from 1 to the number of clusters K. The system also outputs the semantic explanation of each label, including the average number of transactions, average number of interactions, and average number of social behaviors corresponding to that label.

[0117] Step three, which involves calculating node centrality and outputting node centrality features, includes:

[0118] The system receives a set of on-chain social interaction data to construct a graph structure. Each record contains the following fields: the address of the behavior initiator, the address of the behavior target, the timestamp of the behavior, and the behavior intensity (values ​​are transaction amount or number of interactions). The system constructs a directed weighted graph based on these records. Each node in the graph represents a user address, the edges represent the behavior from the initiator to the target, the direction of the edge represents the flow of the behavior, and the weight of the edge represents the behavior intensity (transaction amount or number of interactions).

[0119] The system calculates the following five centrality indicators:

[0120] Degree centrality: Calculate the in-degree and out-degree of each node;

[0121] Weighted degree centrality: Calculates the total weight of the incoming and outgoing edges for each node;

[0122] Betweenness centrality: Counts the frequency with which each node is visited in all shortest paths in the graph;

[0123] PageRank centrality: Iterative calculation based on the connection relationships between nodes using a fixed damping coefficient;

[0124] Eigenvector centrality: Calculated by finding the largest eigenvector in the adjacency matrix;

[0125] The formula for expressing PageRank centrality is as follows:

[0126] Where PR(v) i (t) represents node v in time window t. i The PageRank value, where d represents the damping coefficient, is typically set to 0.85, and M(v) i ) represents all pointers to node v i The set of nodes, PR(v j(t) indicates a pointer to node v i node v j PageRank value, L(v j ) represents node v j The number of outgoing edges, the entire formula represents the number of outgoing edges of node v. i The PageRank value consists of two parts: the probability of a random jump and the contribution from other nodes. The contribution is directly proportional to the PageRank value of the node pointing to it and inversely proportional to the number of its outgoing edges.

[0127] The system outputs a centrality feature vector for each user in each time window, which includes the following fields: degree centrality value (node ​​connectivity), weighted degree centrality value (connectivity considering behavioral intensity), betweenness centrality value (node's mediating role in the network path), PageRank centrality value (node's global influence), and feature vector centrality value (node's importance in the network structure).

[0128] Step three, which involves performing behavioral trajectory sequence modeling and co-occurrence analysis of group behavioral events to output user behavior evolution paths and group behavior patterns, includes:

[0129] The system receives a sequence of behavioral tags for each user across multiple time windows. Each record contains the following fields: user unique identifier, time window start timestamp, and behavioral tag number.

[0130] The system combines each user's behavioral tags in each time window into a state sequence (each time window corresponds to a state (i.e., behavioral tag number), the state sequence reflects the changing trend of user behavior patterns over time, and the sequence length is determined by the number of time windows). The system counts the frequency of each state transitioning to other states after the time window and constructs a state transition probability matrix (by counting the state sequences of all users, a state transition probability matrix is ​​constructed, where each element represents the probability of transitioning from one state to another; this matrix can be used to predict behavioral evolution trends and identify high-frequency transition paths). The system calculates state transition entropy to measure the randomness of behavioral trajectories. The higher the entropy value, the more unstable and random the behavioral trajectory; the lower the entropy value, the more stable the behavioral pattern. Entropy values ​​can be used to identify abnormal behavior, behavioral mutations, or role transitions.

[0131] The system outputs the following: each user's behavioral state (i.e., label number) in each time window, the state transition matrix of all users (recording the probability of transitioning from one state to another), and the path chaos metric (state transition entropy) for each user;

[0132] The system receives the following data: user cluster label ID, user behavior vector (including number of transactions, number of interactions, and number of social behaviors), and time window information;

[0133] The system divides users into several groups based on their clustering tags or community affiliations. Each group represents a group of users with similar behavioral patterns. For each group, the system aggregates the behavioral vectors of its members within a time window and calculates the average behavioral characteristics of the group. The average behavioral characteristics are used to represent the behavioral patterns of the group in the current time window. The system also calculates the cosine similarity of the behavioral vectors between groups to measure the degree of similarity in the behavioral patterns of the two groups.

[0134] The cosine similarity expression is as follows: Where Sim(g) p ,g q ,t) represents the population g within the time window t. p With group g q Behavioral similarity, y p (t) represents the group g p The average behavior vector, y, within the time window t. q (t) represents the group g q The average behavior vector, ‖y, within the time window t p (t)|| represents the group g p The magnitude of the behavior vector is the cosine of the angle between the behavior vectors of two groups. The value ranges from [-1, 1]. The closer the value is to 1, the more similar the behaviors of the two groups are.

[0135] The system sets a similarity threshold. If the similarity between two groups is greater than the threshold within a certain time window, it is determined that the two groups have co-occurring behavioral events within that time window. Co-occurring events can be used to identify cooperative behavior, abnormal group activities, and potential attack behaviors.

[0136] The system outputs the following: the average behavioral state of each group in each time window, the set of co-occurrence events between groups, and the co-occurrence intensity matrix between all groups (recording the behavioral similarity between groups);

[0137] This step achieves a multi-dimensional and fine-grained characterization of on-chain social behavior through user behavior clustering analysis, node centrality calculation, behavior trajectory sequence modeling, and co-occurrence analysis of group behavior events. Based on time-slice feature extraction and K-Means clustering, behavioral labels are assigned to each user in different time windows, effectively identifying dynamic behavior patterns and supporting semantic interpretation. The joint calculation of multiple centrality indicators comprehensively characterizes the connection activity, influence, and mediating role of nodes in the network structure. Behavior trajectory sequence modeling, by constructing a state transition matrix and calculating transition entropy, reveals the evolutionary path and stability of user behavior patterns, which can be used to identify behavioral mutations or abnormal activities. Group-level co-occurrence analysis, by aggregating group behavior features and calculating cosine similarity, identifies groups with similar behavior patterns and their collaborative behavior events, helping to discover potential organized activities or abnormal group behaviors. The overall analysis process integrates individuals and groups, static structure and dynamic evolution, providing rich and structured behavioral feature inputs for subsequent link prediction and interpretable modeling.

[0138] Example 2: The technical solution of this embodiment of the invention differs from that of Example 1 in that:

[0139] like Figure 1 and Figure 2 As shown, step four: Based on the time slice results and behavioral analysis features of each type of subgraph, a graph neural network is used to model node embedding and predict potential links. The temporal evolution of node relationships is modeled by combining graph snapshot sequences, and the link prediction results and interpretability features are output.

[0140] Step four, which involves using graph neural networks to model node embeddings and predict potential links, includes:

[0141] Modeling is performed based on the obtained subgraph time slice results and behavioral analysis features. The behavioral analysis features include user behavior labels, node centrality features, behavioral evolution paths, and group behavior patterns. Each time slice represents a subgraph snapshot, containing the nodes and edges that appear within the time window. Each node has an input feature vector in each snapshot, which is composed of attribute features and behavioral features.

[0142] At each snapshot, a graph neural network is used to model the subgraph. The graph neural network contains a multi-layer propagation structure, and each layer updates the representation of the current node by aggregating the embedding information of the neighboring nodes.

[0143] The node embedding update process follows the formula below:

[0144]

[0145] in N represents the embedding of node v at the k-th layer in the t-th time snapshot.s(t) (v) represents the set of neighboring nodes connected to node v in that snapshot time. AGG (k) (·) represents the aggregation function for neighbor embedding, using a weighted summation method, W (k) and B (k) Let σ(·) be the learnable parameter matrix, and let σ(·) be the nonlinear activation function.

[0146] The initial embedding is the concatenated input feature vector. After multiple propagations, the output node is the final embedding vector at that time snapshot.

[0147] For any pair of nodes (u,v), their embedding vectors at that time snapshot are concatenated and input into a binary classifier to calculate the probability that a link exists between the pair of nodes. The classifier is trained using the cross-entropy loss function.

[0148] Step four, which combines graph snapshot sequences to model the temporal evolution of node relationships and outputs link prediction results and interpretability features, includes:

[0149] For each node, its embedding vectors from all time snapshots are arranged in chronological order to form a temporal embedding sequence. This sequence is a fixed-length vector sequence, where each element corresponds to the node embedding representation at a given time point.

[0150] The sequence is input into a Long Short-Term Memory (LSTM) network. LSTM includes an input gate, a forget gate, and an output gate, and controls the flow of information through a gating mechanism. The processing steps of LSTM are as follows:

[0151] T1: Initialize the hidden state and cell state as zero vectors;

[0152] T2: Input the embedding vector for each time point in chronological order;

[0153] T3: In each step, LSTM updates the current hidden state based on the current input and the hidden state of the previous step;

[0154] T4: Finally, output the hidden state of the last time step as the evolutionary representation of this node;

[0155] The evolutionary representation is a fixed-dimensional vector that contains comprehensive information about the node over time.

[0156] For any pair of nodes (u,v), concatenate their evolved representation vectors, input them into a binary classifier, and calculate the probability that a link exists between the node pair:

[0157] Where e u and e vLet w and b be the evolutionary representations of nodes u and v, respectively, and σ(·) be the Sigmoid activation function.

[0158] If the output value is greater than or equal to 0.5, it is determined that there is a potential link between the node pairs; otherwise, it is determined that there is no link.

[0159] While outputting the link prediction results, based on the node evolution representation and behavioral feature sequence, the following interpretable features are output:

[0160] Structural similarity: Based on the cosine similarity between the node evolution representation vectors, the structural similarity of node pairs is calculated, reflecting their degree of association in the graph structure;

[0161] Centrality change: Based on the behavioral characteristics at each time point, calculate the centrality change value of the node in the time dimension. The specific method is to calculate the degree centrality, proximity centrality or betweenness centrality of the node at each time point, and calculate the variance or rate of change of its time series to reflect the dynamic change of the node's importance in the network.

[0162] Behavioral evolution path similarity: For the behavioral feature sequences of nodes u and v, calculate the cosine similarity of their time series to measure the degree of matching between their behavioral patterns;

[0163] Group behavior consistency: Calculate the overall consistency of the groups to which nodes u and v belong at the level of behavioral features. The specific method is as follows: For each time point, extract the mean vector of behavioral features of the group to which the node belongs, and calculate the cosine similarity between the node's behavioral features and the group mean, as its group consistency index.

[0164] By integrating graph neural networks and temporal modeling techniques, dynamic modeling of node relationships and prediction of potential links are achieved. Graph neural networks aggregate neighbor information and learn the structural representation of nodes in each time snapshot, combining behavioral features to enhance the semantic expression of the embeddings. LSTM further models the temporal evolution path of node embeddings, capturing their long-term behavioral trends and improving prediction accuracy. The link prediction module performs binary classification based on the node evolution representation, outputting quantifiable probabilities of potential links. Simultaneously, the system outputs interpretable features such as structural similarity, centrality changes, behavioral path similarity, and group consistency, enhancing the transparency of model decisions and supporting manual review and risk analysis. The overall process balances model performance and interpretability, providing structured and fine-grained technical support for link prediction on dynamic graphs.

[0165] Example 3: The technical solution of this embodiment of the invention differs from that of Example 1 and Example 2 in that:

[0166] like Figure 3As shown, this blockchain-based social network link prediction system includes an on-chain social data acquisition module, a behavior subgraph construction module, a behavior feature extraction and analysis module, and a dynamic graph interpretable link prediction module.

[0167] The on-chain social data collection module is used to collect on-chain social interaction data from multiple blockchains and Web3 social protocols, and to perform preprocessing operations on the collected on-chain social interaction data.

[0168] The behavior subgraph construction module is used to construct subgraphs based on preprocessed on-chain social interaction data, according to the behavior types of transactions, following, likes, comments and reposts, and generate graph snapshots at multiple time points through time window slicing;

[0169] The behavioral feature extraction and analysis module is used to perform user behavior clustering analysis, node centrality calculation, behavioral trajectory sequence modeling, and group behavior event co-occurrence analysis based on preprocessed on-chain social interaction data and time slice results of various types of subgraphs, and output user behavior labels, node centrality features, behavioral evolution paths, and group behavior patterns.

[0170] The dynamic graph interpretable link prediction module is used to model node embeddings and predict potential links based on the time slice results and behavioral analysis characteristics of various types of subgraphs. It combines graph neural networks to model the temporal evolution of node relationships with graph snapshot sequences and outputs link prediction results and interpretability features.

[0171] This blockchain-based social network link prediction system possesses modular, end-to-end modeling capabilities. It supports the collection and preprocessing of on-chain social data from multiple chains and Web3 protocols, constructing dynamic subgraph snapshots according to behavior types to achieve heterogeneity and temporal modeling of social behavior. Through user behavior clustering, node centrality calculation, behavior trajectory modeling, and group co-occurrence analysis, it extracts structured and semantically rich behavioral features. Combining graph neural networks and LSTM to model node evolution paths, it achieves high-precision link prediction, outputting interpretable features such as structural similarity, behavior path matching degree, centrality change, and group consistency, improving model transparency and risk controllability. The overall process is complete and highly scalable, providing technical support with both performance and interpretability for on-chain social relationship analysis and governance.

[0172] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and its improved concept, should be covered within the scope of protection of the present invention.

Claims

1. A link prediction method for blockchain-based social networks, characterized in that, Includes the following steps: Step 1: Collect on-chain social interaction data from multiple blockchains and Web3 social protocols, and perform preprocessing operations on the collected on-chain social interaction data; Step 2: Based on the preprocessed on-chain social interaction data, construct subgraphs according to the types of behaviors such as transactions, following, likes, comments, and reposts, and generate graph snapshots at multiple time points through time window slicing; Step 3: Based on the preprocessed on-chain social interaction data and the time slice results of various types of subgraphs, perform user behavior clustering analysis, node centrality calculation, behavior trajectory sequence modeling, and group behavior event co-occurrence analysis, and output user behavior labels, node centrality features, behavior evolution paths, and group behavior patterns. Step 4: Based on the time slice results and behavioral analysis features of each type of subgraph, a graph neural network is used to model node embeddings and predict potential links. Combined with graph snapshot sequences, the temporal evolution of node relationships is modeled, and the link prediction results and interpretability features are output.

2. The link prediction method for a blockchain-based social network according to claim 1, characterized in that, The process of constructing sub-graphs according to the types of behaviors such as transaction, follow, like, comment, and share in step two includes: Obtain preprocessed on-chain social interaction data, which includes transaction behavior data, social interaction data, and decentralized identity data. Using the preprocessed on-chain social interaction data as input, construct a subgraph according to behavior type. The construction steps are as follows: S1: Create an empty set; S2: Traverse all transaction records, extract from_address and to_address from each record, add these addresses to the node set, construct directed edges, and add the current node set and edge set as a transaction behavior subgraph to the graph set; S3: Traverse all the records of interest, extract the actor and target from each record, add these addresses to the node set, construct directed edges, and add the current node set and edge set as a subgraph of interest behavior to the graph set; S4: Traverse all like records, extract the actor and target from each record, add these addresses to the node set, construct directed edges, and add the current node set and edge set as a like behavior subgraph to the graph set; S5: Traverse all comment records, extract the actor and target from each record, add these addresses to the node set, construct directed edges, and add the current node set and edge set as a comment behavior subgraph to the graph set; S6: Traverse all forwarding records, extract the actor and target from each record, add these addresses to the node set, construct directed edges, and add the current node set and edge set as a forwarding behavior subgraph to the graph set; The output is a graph set containing five subgraphs, corresponding to the behavior types of transactions, following, likes, comments, and reposts.

3. The link prediction method for a blockchain-based social network according to claim 2, characterized in that, The process of generating multiple time point snapshots by slicing through a time window in step two includes: Using preprocessed on-chain social interaction data as input, the entire time range is set to [T] based on the analysis requirements. start ,T end The time range is divided into multiple consecutive time windows, each with a size of W and a sliding step size of S between adjacent windows. Within each time window, all behavior records whose timestamps fall within that window are filtered from the input data to form a subset. Within each time window, for each behavior type, a corresponding subgraph is constructed based on the filtered behavior records. Output a series of graph snapshots, each containing multiple subgraphs, each corresponding to a different behavior type.

4. The link prediction method for a blockchain-based social network according to claim 1, characterized in that, The process of performing user behavior clustering analysis and outputting user behavior labels in step three includes: The system obtains preprocessed on-chain social interaction data and time slice results for each type of subgraph. Each subgraph's time slice result is a snapshot of multiple time points generated by dividing it into time windows. Using the preprocessed on-chain social interaction data and time slice results for each type of subgraph as input data, the system extracts the following three features for each user and each time window: The number of transactions the user makes within this window, the number of interactions the user has with other addresses within this window, and the total number of social behaviors the user engages in within this window; The system standardizes each feature dimension within the current time window, and then uses the K-Means algorithm to cluster the standardized feature vectors. The system assigns a behavior label to each user in each time window and outputs a semantic explanation for each label.

5. The link prediction method for a blockchain-based social network according to claim 4, characterized in that, The process of performing node centrality calculation and outputting node centrality features in step three includes: The system receives a set of on-chain social interaction data. Each record contains the following fields: the address of the behavior initiator, the address of the behavior target, the timestamp of the behavior, and the intensity of the behavior. The system constructs a directed weighted graph based on these records. The system calculates the following five centrality metrics: degree centrality, weighted degree centrality, betweenness centrality, PageRank centrality, and eigenvector centrality. The system outputs a centrality feature vector for each user in each time window, which includes the following fields: degree centrality value, weighted degree centrality value, betweenness centrality value, PageRank centrality value, and feature vector centrality value.

6. The link prediction method for a blockchain-based social network according to claim 5, characterized in that, The process of performing behavioral trajectory sequence modeling and group behavior event co-occurrence analysis in step three, and outputting user behavior evolution paths and group behavior patterns, includes: The system receives a sequence of behavioral labels for each user in multiple time windows. The system combines the behavioral labels of each user in each time window into a state sequence. The system counts the frequency of each state transitioning to other states after the time window, constructs a state transition probability matrix, and calculates the state transition entropy. The system outputs the following: the behavioral state of each user in each time window, the state transition matrix of all users, and the path disorder metric for each user; The system receives the following data: user cluster label number, user behavior vector, and time window information; The system divides users into several groups based on their clustering tags or community affiliations. For each group, the system aggregates the behavioral vectors of its members within a time window, calculates the average behavioral characteristics of the group, and calculates the cosine similarity of the behavioral vectors between groups. The system sets a similarity threshold. If the similarity between two groups is greater than the threshold within a certain time window, it is determined that the two groups have co-occurring behavioral events within that time window. The system outputs the following: the average behavioral state of each group in each time window, the set of co-occurrence events between groups, and the co-occurrence intensity matrix between all groups.

7. The link prediction method for a blockchain-based social network according to claim 1, characterized in that, Step four, which involves modeling node embeddings and predicting potential links using graph neural networks, includes: Modeling is performed based on the obtained subgraph time slice results and behavioral analysis features. The behavioral analysis features include user behavior labels, node centrality features, behavioral evolution paths, and group behavior patterns. Each time slice represents a subgraph snapshot, containing the nodes and edges that appear within the time window. Each node has an input feature vector in each snapshot, which is composed of attribute features and behavioral features. At each snapshot, a graph neural network is used to model the subgraph. The graph neural network contains a multi-layer propagation structure, and each layer updates the representation of the current node by aggregating the embedding information of the neighboring nodes. The initial embedding is the concatenated input feature vector. After multiple propagations, the output node is the final embedding vector at that time snapshot. For any node pair (u,v), concatenate their embedding vectors from the snapshot at that time and input them into a binary classifier to calculate the probability that a link exists between the node pair.

8. The link prediction method for a blockchain-based social network according to claim 1, characterized in that, The process in step four, which combines graph snapshot sequences to model the temporal evolution of node relationships and outputs link prediction results and interpretability features, includes: For each node, its embedding vectors from all time snapshots are arranged in chronological order to form a temporal embedding sequence; The sequence is then fed into a Long Short-Term Memory (LSTM) network. The processing steps are as follows: T1: Initialize the hidden state and cell state as zero vectors; T2: Input the embedding vector for each time point in chronological order; T3: In each step, LSTM updates the current hidden state based on the current input and the hidden state of the previous step; T4: Finally, output the hidden state of the last time step as the evolutionary representation of this node; For any pair of nodes (u,v), their evolutionary representation vectors are concatenated and input into a binary classifier. The probability of a link existing between the pair of nodes is calculated. If the output value is greater than or equal to 0.5, it is determined that there is a potential link between the pair of nodes; otherwise, it is determined that there is no link. While outputting the link prediction results, based on the node evolution representation and behavioral feature sequence, the following interpretable features are output: structural similarity, centrality change, behavioral evolution path similarity, and group behavior consistency.

9. A blockchain-based link prediction system for social networks, characterized in that, The system is used to perform a link prediction method for a blockchain-based social network as described in claim 1. The blockchain-based social network link prediction system includes an on-chain social data acquisition module, a behavior subgraph construction module, a behavior feature extraction and analysis module, and a dynamic graph interpretable link prediction module. The on-chain social data collection module is used to collect on-chain social interaction data from multiple blockchains and Web3 social protocols, and to perform preprocessing operations on the collected on-chain social interaction data. The behavior subgraph construction module is used to construct subgraphs based on preprocessed on-chain social interaction data, according to the behavior types of transactions, following, likes, comments and reposts, and generate graph snapshots at multiple time points through time window slicing; The behavioral feature extraction and analysis module is used to perform user behavior clustering analysis, node centrality calculation, behavioral trajectory sequence modeling, and group behavior event co-occurrence analysis based on preprocessed on-chain social interaction data and time slice results of various types of subgraphs, and output user behavior labels, node centrality features, behavioral evolution paths, and group behavior patterns. The dynamic graph interpretable link prediction module is used to model node embeddings and predict potential links based on the time slice results and behavioral analysis features of various types of subgraphs. It combines graph neural networks to model the temporal evolution of node relationships with graph snapshot sequences, and outputs link prediction results and interpretability features.

Citation Information

Patent Citations

  • Link prediction method and system for strong sparsity mobile social network, and storage medium

    CN118428547A