Transforming the traffic scheduling problem of Time-sensitive networking (TSN) into a packing problem has better global optimization ability and lower algorithm complexity compared to traditional TSN communication scheduling, which can save network resources and reduce power consumption. Therefore, the paper proposes a TSN traffic scheduling algorithm based on remaining time domain using a two-dimensional packaging algorithm based on remaining space. The paper first transforms the time-triggered (TT) message scheduling problem in time sensitive networks into a two-dimensional packaging problem for research. Then, the large boxes converted from time domain are segmented, and the items are packaged into small boxes using a two-dimensional packaging algorithm based on remaining space. Finally, the small boxes are re-packed, providing a more numerous and dispersed available scheduling time period for subsequent low priority burst business flows. The simulation results show that the algorithm reduces the end-to-end average delay and jitter of sudden traffic flow, improves system stability, and reduces system power consumption while ensuring TT packet delay and jitter.