The combination of battery and supercapacitor to form a hybrid energy storage system (HESS) can achieve the complementary advantages of the two, and therefore has received extensive research attention. In response to the capacity configuration and the power dispatching of HESS in the isolated microgrid, this paper proposes a cooperative optimization method considering battery grouping. The capacity configuration model and power dispatching model of HESS are designed as the outer loop and inner loop, and improved particle swarm optimization is used to implement the two-loop cooperative optimization, so that the total cost of the HESS in the isolated microgrid is the smallest. The battery grouping is considered, whose impact on capacity configuration and power dispatching is analyzed. Finally, the effectiveness and feasibility of the method mentioned in this article was verified by case studies. The results show that the proposed cooperative optimization method can improve the economy of the HESS.