This paper studies the energy utilization of the quay crane, one of the major energy using equipment for the container terminal. We establish an optimization model for the loading and unloading of the quay crane, use the genetic algorithm to solve it, and verify the validity of the model by actual operation data of container terminals. The results show that the model has a significant effect on reducing energy consumption of quay cranes.