The invention provides a peak clipping and valley filling method applied to a power supply of a communication base station in the field of power supply management. The peak clipping and valley fillingmethod comprises the steps of S1, sending a power failure command to a battery manager during power failure; S2, detecting whether a relay is closed or not, and if so, prompting a fault; if not, entering the step S3; S3, judging whether the electric quantity of the lithium battery is less than 15% or not, and if so, prompting a fault; if not, sending a relay closing command, and entering the stepS4; S4, judging whether the relay is closed or not, and if so, entering the step S5; if not, prompting a fault, and entering the step S3; S5, allowing the lithium battery to supply power to the direct-current load, judging whether power is on or not, and if not, entering the step S6; if yes, conducting peak clipping and valley filling according to the current time period; S6, judging whether theelectric quantity of the lithium battery is less than 15% or not, and if so, prompting a fault; and if not, entering the step S5. The method has the advantages that the performance of the lithium battery is fully utilized, and the reliability of the power supply of the communication base station is greatly improved.