Optimizing and improving the level of container scheduling as an important means to reduce logistics costs is an important part of port logistics management. In this paper, based on the current container scheduling optimization problem, maximization objective function, and realistic constraint rules, the pre-optimization stage model is designed. At the same time, we use Elbow Mehtod and contour coefficient comprehensive determination method to obtain the optimal number of clusters, combine with improved genetic algorithm, construct improved GA-Kmeans algorithm, and comprehensively propose the container scheduling optimization model based on clustering algorithm. Port E is selected as the experimental object, and under the guidance of the designed container scheduling optimization model based on the clustering algorithm, the time limit of the port vessels’ in-port operation is controlled within 1h.