In order to handle the increasing difficulty of power grid dispatching, this paper expounds an optimization model of power grid dispatching when flexible load is connected. The flexible load is divided into three types: interruptible load, translational load and adjustable load. And the Latin square quantum genetic algorithm(LSQGA) is used to solve the optimization problem in nonlinear programming, which improves the efficiency of the optimization model and solves the local optimal problem. Finally, a distribution network in a certain region is taken as a case study...