Speed curve planning is one of the most important functions of automatic train operation (ATO). To improve the real‐time optimization capability and driver‐friendliness of the existing ATO, an extended ATO framework considering both automatic driving and assisted driving is designed. A multi‐objective optimization model based on quadratic programming is established considering energy‐saving, punctuality, and comfort. However, due to the influence of the weight of multi‐objectives, this method cannot directly obtain the speed curve satisfying the trip time constraint. Further, based on the analysis about the weight of multi‐objects, a time‐constrained quadratic programming algorithm is proposed. With the proposed method, the speed curve can be calculated in real‐time both before operations and during operations. For the former, time‐varying train mass and trip time are considered to guarantee an optimal solution. For the latter, deviations, delays, and maloperations on the way are corrected. Simulation experiments verify the solvability and real‐time performance of the proposed method. In particular, compared with the dynamic programming and (mixed‐integer linear programming) MILP method, the proposed method is more energy‐efficient and easier to be followed by the driver. In addition, a prototype is developed for commercial tests on a Beijing subway line. The relevant performance is verified in commercial tests.