The identification of network application based on port number is constrained by the status that more and more peer-to-peer applications make use of dynamic port numbers. Some clustering methods are used to cope with this problem, but they are time-consuming. In this paper, a method based on wavelet transforming and K-means is proposed. Its basic idea is doing data preprocessing with wavelet transformation prior to K-means algorithm. As the experiment results show, the time for data processing is shortened; moreover, the storage of data has been reduced; and finally, the classification precision of this method remain unaffected.