A flexible bus route optimization scheduling model that considers the dynamic changes of passenger demand is proposed to address the large difference in demand for flexible bus passengers and real-time variability. This model uses the heuristic algorithm based on gravity model to determine the following: passenger booking; vehicle passenger capacity; team known conditions such as size, according to the dynamic changes of passenger demand for real-time iterative update shuttle travel time; vehicle operating costs (vehicle); and time cost for passengers (passengers waiting time for the vehicle, actual time of arrival, and the difference between expected and actual times of arrival) before minimization as the target. Finally, the practicabilities of the model and algorithm are verified by an example. Analysis results show that for 102 travel demands of 15 randomly generated demand points, completing all services requires 17–21 vehicles with average travel time of 24.59 minutes each. The solution time of 100 groups of data is within 25 seconds and the average calculation time is 12.04 seconds. Under the premise of real-time adjustment of connection planning time, this optimization model can thus better meet the dynamic demand of passengers compared with the current scenario. The model effectively reduces the planning path error, shortens the travel distance and passenger travel time, and achieves better results than the flexible bus scheduling model that ignores changes of connection travel time.