Abstract:Social network link prediction can help to reveal the potential connections between network nodes, and has important practical application value in friend recommendation and cooperation prediction. However, existing link prediction algorithms ignore the medium and long-term development trend of social network time series, and do not consider the interaction relationship between nodes in the network from a long-term perspective. To address the above-mentioned problems, a spatiotemporal attention-based multi-granularity link prediction algorithm is proposed, which can integrate the spatiotemporal features of social network time series with different granularities to improve the accuracy of link prediction. Firstly, the weights of the social network snapshot graph are constructed with the time decay function, and a graph-weighted moving average strategy is proposed to generate social network time series with different granularities reflecting short-term, medium-term, and long-term trends. Then, a neural network based on the multi-head attention mechanism is used to extract the global temporal features of social network sequences. Next, the historical interaction information of nodes within social network sequences is combined, and the neural network based on the mask attention mechanism is used to adaptively construct the network topology from a long-term perspective to dynamically adjust the interactions between nodes and is combined with graph convolutional network to model spatial information. Finally, the fusion attention neural network is proposed to extract useful short-term, medium-term and long-term information from short-term, medium-term and long-term spatiotemporal features, and perform feature fusion to accurately predict the future links of social networks. Experimental comparisons with seven existing link prediction algorithms on four social network public datasets confirm the effectiveness and superiority of the proposed method.