The existing security problems in P2P were analyzed. A grouping mechanisms based on social network was presented. The mechanism based on the social networks members of the management divides nodes into different groups, and the nodes in the same group have the same resources. So it can avoid unnecessary requests effectively and reduce the possibility of mutual adverse comments. The requests between different groups of nodes can be more efficient.