The invention relates to a link prediction method and system. The method comprises the following steps: acquiring social network data; constructing an undirected graph data network according to the social network data, wherein the undirected graph data network takes a person in the social network data as a node and takes a connection between persons in the social network data as a connection edge; layering the undirected graph data network by adopting a k-shell algorithm, and then deleting nodes which are not linked to inner layer nodes in an external network layer; and performing link prediction according to the deleted undirected graph data network. According to the invention, the accuracy of link prediction can be improved.