## 1 Introduction  
Internet of things (IoT) can be used in many environments such as healthcare, smart grids, and security monitoring, with the aim of providing a wide range of connections for various terminals [1]. Wireless sensor networks (WSNs) own a dominant position in IoT on account of their convenient communication mode for attractive applications [2]. However, lifespans of sensors are subject to limited battery power, and battery replacement is usually quite difficult [3]. Thus, prolonging the network lifetime of WSNs is a key consideration point for researchers [4].  
Many studies were committed to prolonging the network lifetime through energy replenishment. Kurs [5] demonstrated that it is viable to wirelessly transfer energy. Within a certain distance, energy can be transferred to sensors via coupling resonances. The wireless energy transfer device placed on the mobile vehicle can supply energy for sensors, such that the lifetime of network is steadily extended [6].  
In addition, a mobile sink is also an effective method to prolong the network lifetime [7]. Compared with a mobile sink, large-scale networks with a static data collector usually have poor energy balance. Many nodes have to upload data through a multi-hop relay, and the nodes near the sink bear heavy traffic load [8]. Thus, the mobile data gathering mode can decentralize the load and effectively extend the network lifetime [9].  
Attracted by the advanced energy replenishment scheme and high efficiency of the mobile data gathering mode, some works proposed schemes that combined data gathering with wireless charging. However, the mobile collector cannot visit each node under the constraints of charging efficiency. Energy consumption differences caused by different upload distances impose a great challenge in balancing energy.  
Based on the analyses above, an adaptive dual-mode routing-based mobile data gathering algorithm (ADRMDGA) in rechargeable wireless sensor networks (RWSNs) for IoT is proposed in this paper. A mobile vehicle with both wireless charging and data gathering functions (MCGV) is proposed. The moving path of MCGV is determined based on the charging efficiency and moving distance threshold. The energy replenishment capability of the MCGV is reasonably allocated to low-energy nodes according to our objective function. In addition, an innovative adaptive dual-mode routing is used to balance energy when the MCGV gathers data. Each node can choose a direct upload or multi-hop upload mode according to its relative upload distance. The empirical study confirms that ADRMDGA has excellent performance in extending the network lifetime via an energy balance strategy.  
Our major contributions in this paper are summarized below. Firstly, we consider comprehensive factors of energy replenishment including energy consumption, residual energy, and an optimal energy allocation scheme, to better charge the network. Secondly, we empower a data gathering function on the mobile charging vehicle in order to better develop the effectiveness of its mobility. Thirdly, an adaptive dual-mode routing strategy is proposed, which can effectively balance the energy consumption of nodes when the MCGV gathers data. Finally, we prove its performance, where the MCGV can prolong the network lifetime by balancing energy when gathering data and by replenishing the low-energy nodes in a timely manner.  
The rest of the paper consists of five sections. In Section 2, we summarize related works of routing algorithms and charging scheme. The system model is given in Section 3. Section 4 shows our energy replenishment strategy, and Section 5 proposes the data gathering algorithm. Section 6 introduces the performance of our algorithm. Section 7 provides a conclusion and proposes future work.