Public transport is vital to people's daily travel, and bus dispatching plays a significant role in the public transport system. With deep learning having been widely applied and achieved great success in many fields, bus dispatching methods based on deep learning are proposed in succession. Currently, many bus dispatching models assume that the bus departure timetable is fixed and optimize the bus departure timetable interval according to passenger flow. However, the bus departure timetable is variable in general, only considering that the bus arrival time is insufficient. Targeting the above challenges, we propose a novel dynamic bus dispatching model based on arrival time and passenger flow prediction (D-ATPF). First, the historical origin-destination (OD) data and the transfer data are obtained by processing the bus trajectory data and the passenger card-swiping records, and the bus arrival time is extracted by analyzing the GPS trajectory. Second, the components of bus arrival time and passenger flow prediction based on long short-term memory (P-LSTM) are adopted to predict the future passenger flow and bus arrival time. Finally, the genetic algorithm-based bus dispatching model (GABD model) searches the minimum waiting time for passengers by using stay strategy. By using data of five lines with 124 bus stations and a total of 9 02 509 records in Guangzhou city, China, our experimental results show that: 1) the average mean absolute percentage error (MAPE) and root mean square error (RMSE) of passenger prediction are 14% and 7.5, respectively; 2) the average MAPE and RMSE of bus arrival time are 7.5% and 13.5, respectively; 3) regarding the passenger flow and arrival time prediction, the proposed D-ATPF model reduced waiting time by 829.68 min, accounting for 25.19% of the total waiting time; and 4) compared with the real-time stay strategy, the reduced waiting time of this method increased by 5.94%. Therefore, the D-ATPF model provided a more practical model for buses dispatching.