Short-term traffic flow prediction has always been a hot topic for scholars. Data processing is the focus of machine learning prediction. The quality of data processing directly affects the accuracy of prediction. Taking the city bus as the floating car and using the GPS data collected by the bus company in real time as the forecast data, not only can the data collection cost be reduced, but also a good prediction and recognition effect can be achieved. Format conversion, missing value processing, data cleaning and denoising of GPS data are predicted by GRU algorithm in neural network and compared with LSTM algorithm. The results show that the accuracy of GRU algorithm is 7.84% higher than that of LSTM algorithm.