In order to improve the analysis effect of legal issues of the crime of endangering public safety, this paper analyzes the legal issues of the crime of endangering public safety based on the actual mining algorithm and uses numerical methods to qualitatively study the evolution behavior across phase intervals. Moreover, this paper improves the algorithm based on the actual needs of legal mining. When solving the eigenvalues of the given Hamiltonian’s duration equation, the zero-energy solution can be found in the case of open boundaries. In addition, this paper applies the improved algorithm proposed in this paper to the mining of criminal law legal issues of crimes against public safety, assigns a dynamic IP to each process, and builds a model based on this. Through the above simulation research, it can be seen that the legal problem analysis model of the crime of endangering public safety based on the data mining algorithm proposed in this paper has a good legal data mining effect.