Sequence anomaly detection has applications in many fields, such as financial risk control, network security, etc. Therefore, sequence anomaly detection algorithms based on artificial intelligence have become a hot research topic. This paper uses the PSO-PFCM (Particle Swarm Optimization based Possibilistic Fuzzy C-Means) clustering detection algorithm as the research method. This algorithm improves the accuracy of sequence anomaly detection. The algorithm can adapt to different data distributions and anomaly patterns by adaptively adjusting clustering parameters. Through simulation experiments on the PSO-PFCM algorithm, the clustering purity of the algorithm is between 0.8-0.99. The algorithm shows high accuracy in sequence anomaly detection, can accurately capture the characteristics and patterns of abnormal sequences, and handle complex situations such as noise and data changes. The algorithm has certain scalability when processing large-scale sequence data and can process a large amount of sequence data in a short time.