In order to solve the problem that it is difficult to distinguish the non-line-of-sight (NLOS) propagation of ultra-wide-band (UWB) signals in the indoor positioning process, which leads to the serious damage to the positioning accuracy, a NLOS recognition method combining density-based spatial clustering of applications with noise (DBSCAN) optimization algorithm and support vector machine (SVM) is proposed in this paper. In this method, the multiverse optimization algorithm (MVO) is used to optimize the parameters of DBSCAN clustering, and then according to the different distribution of square sum of residuals under the condition of line-of-sight (LOS)/NLOS, the sum of squares of distance residuals(SSDR) is applied to DBSCAN clustering optimization algorithm as eigenvalues, and the optimized clustering results are applied to SVM model training. Finally, NLOS recognition is carried out based on SVM training model. The simulation results show that the classification accuracy of SVM training model based on DBSCAN optimized clustering results is as high as 99.9%, compared with DBSCAN clustering algorithm and DBSCAN clustering optimization algorithm, the year-on-year increase of 13.7% and 4.5%, recall and precision are as high as 100%. After many random experiments, the recognition accuracy of the SVM training model is more than 99%. It has certain stability and high reliability, and can better identify the NLOS error in the mixed environment of LOS/NLOS.