As the era of Internet of Things (IoT) approaches, we are facing a new level of awareness about our world. It has been predicted that almost 50 billion devices will be connected by 2020 to realize the Internet of Things. A large number of devices will communicate with each other to gather, share and forward information to connect people in a more intelligent, convenient and efficient way. Therefore, Device-to-Device (D2D) communications is expected to be the intrinsic part of IoT. However, most existing researches in D2D communications are based on the D2D and cellular communications coexisted architecture. Provisioning D2D and cellular communications in the same cellular network quickly exhaust the limited resources, thus leading to performance degradation. We envision a novel architecture of green relay assisted D2D communications with dual battery for IoT. We adopt low power small base stations (BSs) as the relay BSs in the network. By optimally allocating the network resource, our proposed architecture enables the source- destination device pairs to reach their required transmission data rates to satisfy their different application services. The relay BSs are powered by both green energy and on-grid energy, and equipped with dual battery. By balancing the residual green energy among the relay BSs, we maximize the utilization of green energy in the network and achieve the goal of furthest saving the on-grid energy. Finally, we validate the performance of the proposed architecture through extensive simulations.