The invention relates to a multi-target area multi-microgrid structure and capacity optimization planning method. The method includes steps of obtaining the capacity and type of a load, the position, capacity, and type of a distributed power supply, a multi-microgrid network structure, and initialized data of energy storage position, and capacity, and type; setting the requirement values of networking flexibility, distributed energy consumption, and multi-energy comprehensive utilization target; obtaining a series of antibody populations that meet the value requirements of networking flexibility, distributed energy consumption and multi-energy utilization target; operating the antibody populations by means of an immune genetic algorithm; and outputting an economic and optimal area multi-microgrid structure and capacity planning method meeting the networking flexibility, distributed energy consumption, and multi-energy comprehensive utilization target. On the premise of guaranteeing the economy, the networking flexibility, distributed energy consumption capability, and multi-energy comprehensive utilization efficiency can be improved.