The characteristics of port dangerous goods are complicated and diverse in danger, which is very likely to cause chain effects once a fire and explosion accident occurs. Based on the distribution characteristics of dangerous goods container yards and the special national storage requirements for dangerous goods containers, the paper establishes a multiobjective optimization model with a double priority of safety and economy, starting from reducing the number of reversals. The improved non-dominated sorting genetic algorithm based on the elite strategy was used to solve the model and the algorithm was tested and improved. Based on the Pareto optimal solution set, the entropy weight-TOPSIS method was used to optimize the sorting of multiple solution sets, which improved the performance of the algorithm. The analysis further clarifies the important relationship between attributes, and the running time is shortened by 85.7% compared with the traditional NSGA algorithm. The optimization model and algorithm can provide decision support for the actual operation and management of container storage, and provide a good reference for accident risk prevention and control.