The port container gantry crane studied in this paper is a four-degree-of-freedom spatial continuous system. In actual work, in order to make the container transfer smoothly, the response of the whole system needs to be accurately predicted and timely adjusted. The whole system is divided into rotary mechanism, lifting mechanism, lifting trolley mechanism, and big cart mechanism for detailed analysis. By constructing the field transfer matrix, a one-dimensional wave equation of continuous system and the Lagrange equation with redundant parameters, the response of each subsystem is solved precisely. The results of the study found that in some periods, the swing of the container was too large. In order to improve the safety and stability of transmission, an active control method of specific point in time excitation (SPE) is proposed for the first time. This method predicts the swing amplitude of the container in advance using the response results of the numerical model. When the set response interval is exceeded, the external excitation intervention can effectively inhibit the moving range of the container in the transit process. Finally, the results are compared with the simulation model to achieve the experimental purpose. It is in line with the expected experimental effect.