Because of the uncertainty of renewable energy generation and load, batteries as energy storage devices play an important role in ensuring the safety and reliability of microgrid. To take full advantage of the batteries, the battery lifetime characteristics are analysed, and a weighted Wh throughput method is proposed to estimate the battery lifetime. To improve the economy of microgrid, an economic scheduling model of microgrid in grid-connected mode is established with the consideration of battery lifetime. For fast and efficiently solving the model, a technique is developed to convert the optimisation problem into a mixed integer linear programming problem and a mixed integer linear programming algorithm is applied to solve it. The proposed method has been validated on a microgrid, which consists of a wind turbine, a photovoltaic system, a micro turbine, a fuel cell, a diesel engine and a battery energy storage system (BESS). The simulation results show that the BESS is managed rationally and the total operation cost of microgrid over scheduling period is decreased by applying the proposed scheduling method.