To optimize the missed appointment in the traditional reservation system of trucks, a two-stage truck reservation optimization model with credit constraints was established, with the goal of minimizing the average waiting time of a single truck in the decision-making period. The genetic algorithm was designed to solve the problem. By comparing the traditional reservation model with the optimized reservation model, the validity of the model was verified. The results showed that the truck reservation system with credit constrains could better control the arrival time of the trucks. The average waiting time at the gate reduced by 23.94-26.95% and the average waiting time at yard reduced by 11.17%-29.22% compared with traditional mode. The model reduces the rate of missed arrvial of trucks and improves the efficiency of port operation.