The existing P2P network flow identification methods are analyzed in this paper. The data structure of P2P flow identification is first designed. Secondly, during the traffic identification stage, the packets of TCP and UDP are captured on the transport layer, and the P2P flow of the TCP/UDP traffic is identified according to the main traffic characteristics of the P2P flow on the transport layer. Thirdly, during the payload characteristics identification stage, the database of payload characteristics is updated periodically, the payload characteristics are precisely identified from the P2P flow distinguished on the traffic identification stage, and the payload characteristics are also identified from the missed traffic on the traffic identification stage. Fourthly, during the pattern matching procedure, the value of the fingerprint function is applied to improve the speed of flow identification. Finally, an algorithm for identifying accurately the new and encrypted P2P flow and its name is presented. The experiments show that the presented algorithm can identify and classify the P2P flow more effectively.