In the context of the global epidemic, urban rail transit has the risk of spreading the virus. Taking Beijing Metro Line 1 as an example, this project establishes a dynamic model of train variable marshalling by studying passenger behavior and virus transmission, aiming to explore more intelligent marshalling mode, optimize transportation organization, and improve the flexibility of train marshalling and dispatching of urban rail transit, so as to improve its transportation efficiency and reduce the station personnel density, Then reduce the risk of disease infection of passengers in the process of taking urban rail transit under the background of the outbreak. The results show that: Dynamic marshalling technology can significantly improve the transport efficiency of urban rail transit trains and effectively control the risk of infection of passengers.