The Ultra Dense Network (UDN), as a key enabler for future wireless networks (such as 5G), is comprised of a massive number of small cells in the network. Nonetheless, energy consumption will be non-negligible when a large number of smallcell Base Stations (BSs) are densely deployed. One practical and effective approach to reduce the energy consumption of the UDN is through dynamically controlling the power saving mode of BSs, while the challenge is to maintain network coverage and satisfy the performance requirements of User Equipment (UEs). In this paper, we formalize the problem of minimizing the energy consumption of BSs by optimally controlling the BS's power saving mode (switching between awake mode and sleep mode). We focus on optimal BS selection with the objective of energy efficiency, while the considering the constraints of the coverage of UEs, the capacity of BSs, and the data rate UEs. To validate the effectiveness of our proposed scheme, we have conducted performance evaluations with a comprehensive scenario design, consisting of UE density, distribution, and mobility, as well as BS deployment. The evaluation results demonstrate favorable energy efficiency improvement at averages of 38.82 % and 48.05 % in scenarios where UEs are uniformly distributed and non-uniformly distributed in the network. Meanwhile, network coverage and UE's Quality of Service (QoS) requirements are provided.