BP neural network method can deal with nonlinear and uncertain problems well and is widely used in the construction of classification, clustering, prediction, and other models. However, BP neural network method has some limitations in fitting nonlinear functions, such as slow convergence speed and easy local optimal convergence rather than global optimal convergence. In order to solve the insufficiency, the optimization approach applying BP neural networks is discussed. This paper proposes a simplified PSO algorithm based on stochastic inertia weight (SIWSPSO) algorithm to optimize BP neural network. In order to test the effect and applicability of the method, this paper established a quality safety risk warning based on SIWSPSO-BP network and selected the detection data of intelligent door lock products for risk warning experiment. The experimental results show that the convergence speed of SIWSPSO-BP model was increased by two times and the accuracy of product quality risk warning reached 85%, which significantly improves the accuracy and learning efficiency of risk warning.