Electric buses have the advantages of small noise, zero emission and simple control, which can effectively reduce urban pollutant emissions and energy consumption. Therefore, vigorously promoting the development of electric buses is of great significance to accelerate the low-carbon development of the city and realizes the goal of "carbon peak" and "carbon neutrality". The operating condition of electric buses is an important factor affecting their energy consumption. Ensure buses under reasonable working conditions can improve the operation efficiency, reduce the operation energy consumption and the operation cost of bus enterprises. For the bus route with dedicated bus lane, we divide road sections based on road characteristics and analyze the operation state of buses on different units. Considering the constraints such as the bus travel punctuality rate between stations and the intersection delay rate, we taking the minimum operation energy consumption between stations as the optimization objective. Taking the traveling speed of the bus on the road section unit between stations and the starting moment of green light on the intersection as the optimization variables, the dynamic control model of the electric buses is established. Finally, the simulated annealing algorithm is used to solve the built model. Comparing the optimization scheme with the original scheme target value and analyzing the model optimization effect, the numerical results show that the total operating energy consumption can be saved up to 8.29%, which proves the optimal travel can meet the needs of passengers while reducing operating energy consumption.