Due to the massive congestion in ground transportation in Beijing, underground rail transit has gradually become the main mode of travel for residents of large urban areas. Because the average daily traffic of the Beijing subway is over 12 million passengers, ensuring the safety of underground rail transit is particularly important. Big data shows that more than 4000 passengers participate in Long-term Stay in the Subway every day. However, the behaviors of these passengers have not been characterized. This paper proposes a method for identifying the Long-term Staying in Subway System (LSSS) in the subway based on the shortest path and analyze its travel mode. In combination with the past research of scholars, we try to quantify the suspected behavior with a database of assumed suspected behavior records. Finally, we extract the spatial-temporal travel characteristics of passengers and we propose a SAE-DNN algorithm to identify suspected anomalies; the accuracy of the training set can reach 95.7%, and the accuracy of the test set can also reach 93.5%, which provides a reference for the subway operators and the public security system.