In the context of the ubiquitous power Internet of Things (UPIoT), this paper attempts to make full use of distributed new energy, and rationalize the energy management strategy of households. Inspired by the energy management system (EMS) of intelligent buildings, the authors searched for the optimal control plan for energy based on deep reinforcement learning (DRL) algorithm. Under the overall architecture of the system, a distributed new energy generation system was modelled for consumers in intelligent buildings, including energy storage, household electrical loads, new energy vehicles, etc. Next, a Q-learning-based energy management model was established for intelligent buildings, and the corresponding constraints were set up. After that, the reward and penalty functions of the EMSs for households and the intelligent building were designed based on the daily economic dispatch (DED) model. Finally, the energy management strategy was optimized, creating the real-time optimization control process. The proposed energy management strategy was proved effective for intelligent buildings through simulations. The research results provide a reference for energy management in other microgrids.