The invention discloses a travel time prediction method for optimizing an LSTM neural network through a particle swarm optimization algorithm, and the method comprises the following steps: S1, collecting travel time data, performing data normalization, and dividing the data into a training set and a test set proportionally; S2, optimizing each parameter of an LSTM neural network prediction model by using the particle swarm optimization algorithm; S3, inputting the parameters, optimized through the particle swarm optimization algorithm, and the training set, and performing the iterative optimization of the LSTM neural network prediction model; S4, predicting the test set through the trained LSTM neural network model, and evaluating a model error. The method is quick in optimization. Compared with a random forest, SVM and KNN in the traditional prediction algorithm, the method of the invention has the least mean square error and square error for the data prediction, and the model reducesthe calculation burden, so the method shows better prediction performance.