When several microgrids are interconnected into microgrid cluster (MGC), the network topology of MGC system would be more complex. Traditional hierarchical control based on droop control tends to make full use of all networks so that the costs of energy exchange could be high. Considering the voltage stability and power sharing of MGC system, a distributed cooperative control method based on network topology optimisation for MGC is proposed to control the power flow of multi-microgrid system. Specially, preliminary Q-leaning algorithm is utilised with establishment of new adjacency matrices for the distributed cooperative control to decrease the costs. Moreover, multi-level controls based on consensus protocol are proposed in the distributed cooperative MGC system to eliminate the necessity of a central controller. The adaptive regulation based on the state of charge among the battery groups will be taken as the first-level control. The second-level control including the current controller, voltage controller and power controller is implemented among the DGs and a novel third-level control based on consensus is applied in eliminating the voltage deviation caused by the first-level control and the second-level control. The effectiveness of the proposed method is verified through the simulation by simulink.