In order to improve the speed, efficiency and robustness of the automatic sorting system, this paper proposes an improved ant colony algorithm based dynamic sorting strategy. Under the operating condition of automatic sorting scenario on the assembly line, two city sets are established to divide the picking area and the placing area as two countries. In addition, an improved ant colony algorithm optimization approach with variation operator is added, which get inspired by genetic algorithms. This optimization approach has the properties of broad adaptability, high feasibility and capability to achieve global optimization. Simulation and experimental results show that the proposed sorting strategy has better robustness for sorting operations with different objects density. Meanwhile, it can effectively reduce the sorting path length and working time compared with traditional sorting strategies.