To address the issue of high accident rates in road traffic due to dangerous driving behaviors, this paper proposes a recognition algorithm for dangerous driving behaviors based on Long Short-Term Memory (LSTM) networks. Compared with traditional methods, this algorithm innovatively integrates high-frequency trajectory data, historical accident data, weather data, and features of the road network to accurately extract key temporal features that influence driving behavior. By modeling the behavioral data of high-accident-prone road sections, a comprehensive risk factor is consistent with historical accident-related driving conditions, and assess risks of current driving state. The study indicates that the model, in the conditions of movement track, weather, road network and conditions with other features, can accurately predict the consistent driving states in current and historical with accidents, to achieve an accuracy rate of 85% and F1 score of 0.82. It means the model can effectively detect the consistency of driving states in current and hazardous driving behaviors in historical, such as aggressive acceleration, abrupt deceleration, and speeding. It contributes to provide timely risk warnings for drivers, effectively reducing the occurrence of traffic accidents, and adherence to driving safety.