Oriented by the best matching between express demand and train service, an optimization model for demand assignment was first constructed with a consideration of the train loading capacity, stop plan, departure time and uniqueness. The mathematical model captured the transport service plan of the scheduled (passenger) trains to express demand, with the minimization of the total number of remaining express boxes at all stations as optimization goal. If the total capacity of passenger trains cannot satisfy the express demand, the specialized express trains should be added and the train plan to serve the remaining demand should be optimized. By introducing the candidate train set, an optimization model of specialized express train plan was proposed to make decision for the operation pairs, operation sections, stop plan and demand assignment plan of the specialized express trains. The model considered the constraints of train capacity, station capacity, section carrying capacity and box flow conservation. According to the characteristics of the constructed model, an improved simulated annealing algorithm was designed with the neighborhood solution search strategies such as increasing and reducing the number of stops and the specialized express trains. Besides, a special heuristic strategy about the generation of initial solution and demand assignment was proposed. Finally, the correctness of the proposed model was further examined by numerical experiments based on Lanzhou-Wulumuqi high-speed rail corridor. The experimental results demonstrate that the proposed method can effectively meet the express demand and solve the retention problem of express boxes. In addition, the train plan has a high full-load rate, and the optimized stop plan can fit with the demand of each station. In summary, this paper effectively solved the matching problem between the express demand and train plan. The research findings are helpful to improve the service level of high-speed rail express and the economic benefits of railway enterprises. © 2022, Central South University Press. All rights reserved.