Identifying abnormal network behavior is an important method for ensuring network security. The article proposes a network traffic analysis method that combines Long Short-Term Memory (LSTM) and Bayesian classifier,aiming to improve the accuracy of abnormal traffic recognition by automatically extracting time series features of network traffic. Specifically,the LSTM model is first used to extract hidden feature representations from network traffic,followed by traffic classification using a Bayesian classifier. Finally,the proposed method is tested using the NSL-KDD dataset and evaluated through multiple criteria. The experimental results show that the method performs well in identifying different types of traffic,verifying its practicality and robustness in the field of network anomaly detection.