At present, lithium battery is the first choice of rechargeable battery for portable handheld electronic devices. However, in the process of using lithium battery, there may be problems such as over flushing, over discharging, over current charging and high temperature after too long charging time, which may affect the service life of battery and even cause safety accidents. In order to solve the above problems and improve the service efficiency of lithium battery, this paper is based on STM32 platform A lithium battery charge and discharge management system is designed. Through the design of software and hardware and the experiment test, the system realizes the charge and discharge path management of lithium battery, the real-time and accurate monitoring of the parameters of charge and discharge and the state of battery. The output voltage is stable, greatly improving the use efficiency of battery. This achievement has been applied in enterprise projects.