In recent years, the deep packet inspection technology and traffic identification technology based on the statistical characteristics of data packet have developed rapidly. But they have some disadvantages. The deep packet inspection technology can’t identify the encrypted network traffic, and the other technology heavily relies on subjectively chosen statistical features. A network traffic identification method based on convolutional neural network algorithm is proposed in this paper. According to certain rules, the network data is converted to gray images. In order to improve the recognition rate, the original network data is extended according to the order of the TCP packets and the disorder of the UDP packets. Experimental data shows that this method has a high detection rate both in the application and application layer protocol.