Dynamic Bayesian networks can effectively capture dynamic changes and uncertainty relationships in data. Conventional prediction methods do not consider the temporal characteristics between traffic flow sequences, which affects prediction accuracy. This article proposes a method for analyzing and predicting road traffic safety status based on DBN. Firstly, data matching is performed according to the “case-control” sample structure of the matching formula to minimize the influence of other factors on the modeling of traffic safety status; Secondly, the random forest model is applied to analyze and extract the variable with the highest correlation coefficient as the input variable for the traffic safety status prediction model; Then, a DBN prediction model is established using matched accident traffic flow and non-accident traffic flow sample data; Finally, by analyzing the effectiveness evaluation indicators of the model, multiple prediction results showed that the overall prediction accuracy of the DBN method was over 80%.