In order to better accelerate the transition from traditional trade to cross-border e-commerce, a cross-border e-commerce transportation route optimization model was designed in the context of the prevention and control of new crown pneumonia. Against the background of the new coronavirus pneumonia, through the analysis and research of the current situation of domestic and foreign e-commerce logistics, optimize the cross-border e-commerce logistics distribution model, establish an environmental model, and use efficient search algorithms to search for walking paths that meet environmental requirements. Based on the Dijkstra algorithm model of demand, and based on the linear relationship between demand and delivery distance, an optimal route selection model is established to select the optimal route with the shortest total travel distance. The simulation results show that the cross-border e-commerce transportation time of this model is within 13 h, which is shorter than that of the traditional model. The search efficiency of the optimal route for cross-border e-commerce transportation is higher, and the time for cross-border e-commerce transportation is shorter.