In recent years, the network scale is gradually expanding, and the number of netizens is constantly increasing. With the rapid development of the network in the direction of diversification, the traditional intrusion detection system (IDS) has problems such as low accuracy and high false alarm rate, which are difficult to guarantee the current network security. In this paper, the author proposes a method that combines conditional variational autoencoder (CVAE) and long-short-term memory (LSTM) network to identify and detect abnormal flow, and then some key technologies of traffic detection model is discussed. At present, the main problems in network traffic anomaly detection include imbalanced data distribution and low detection efficiency of traditional models. Due to the fact that most network detection data often has the characteristics of a small number of attack category samples and imbalanced data distribution, CVAE is used to enhance and expand the attack samples to obtain balanced data samples in this paper, and then the LSTM network is used for anomaly identification and detection. In order to prove the superiority of the model, the author evaluates the model through the accuracy, precision, recall and F1. Compared with traditional machine learning methods, the model has higher accuracy and lower training complexity.