In the process of deep-hole blasting, the quality of blasting stemming seriously affects the blasting effect, but the optimal stemming length is difficult to determine. In this paper, the movement process and length optimization of deep-hole blasting stemming were investigated. At first, the mechanical mechanism of stemming structure was theoretically analyzed, and the additional friction resistance of stemming structure caused by the compression of the blasting shock wave was considered. Then, a time-sharing piecewise solution method for the movement process of stemming structure based on the method of time-space discretization was proposed, which can reveal the distribution law of the decreasing friction resistance along the axial direction . Moreover, the movement law of stemming structure under the conditions of explosion pressure ranging from 0.2 to 1.2 GPa, duration of detonation gas ranging from 10 to 15 ms, sliding friction coefficients ranging from 0.02 to 0.06, borehole diameters ranging from 76 to 200 mm, and stemming length ranging from 1.6 to 3.0 m was studied. Results showed that explosion load, duration of detonation gas, sliding friction coefficients, borehole diameters and stemming length all have a great influence on the movement of stemming structure. Finally, aiming at the common stemming materials of rock debris in engineering blasting, the effects of rock mass properties, explosion load, and borehole diameters on the optimal stemming length have been discussed based on the optimization principle that allows the part of stemming structure to rush out of borehole. It is found that the optimal stemming length increases linearly with the logarithmic product of the explosion pressure and the borehole diameter by the statistical analysis of the optimal stemming length under different calculation conditions. In view of the above, a new method for calculating the optimal stemming length is proposed and its reliability has been verified preliminarily by field application.