This paper studies the optimal design of the fog computing assisted wireless powered network, where an access point (AP) transmits information and charges an energy-limited sensor device with Radio Frequency (RF) energy transfer. The sensor device then uses the harvested energy to decode information and execute computing. Two candidate computing modes, i.e., local computing and fog computing modes, are considered. Two multi-objective optimization problems are formulated to minimize the required energy and time for the two modes, where the time assignments and the transmit power are jointly optimized. For the local computing mode, we obtain the closed-form expression of the optimal time assignment for energy harvesting by solving a convex optimization problem, and then analyze the effects of scaling factor between the minimal required energy and time on the optimal time assignment. For the fog computing mode, we derive closed-form and semi-closed-form expressions of the optimal transmit power and time assignment for offloading by adopting the Lagrangian dual method, the Karush-Kuhn-Tucker (KKT) conditions and Lambert W Function. Simulation results show that, when the sensor device has poor computing capacity or when it is far away from the AP, the fog computing mode is the better choice; otherwise, the local computing is preferred to achieve a better performance.Electronics 2019, 8, 137 2 of 17 and far away from wireless sensor devices, thus offloading computation tasks to centralized cloud servers may results in heavy access burden and transmission delay. Therefore, a new communication and computing paradigm called fog computing was presented to extend cloud computing from network center to network edge [7,8]. Compared with cloud servers, fog servers are closer to user terminal equipments. Thus, fog computing is able to achieve lower response delay. Moreover, by offloading computation intensive tasks from ultra-low-power sensor devices to fog servers, the energy consumption of sensors may be saved and computation capabilities of wireless sensors is capable of being supplemented.Apart from the limited computation capacity of ultra-low-power sensor devices, another key issue is how to supply sustainable and stable power to sensor devices, because IoT sensor devices are often widely deployed in large-scale networks and powered by small-size batteries with limited energy storage capacities. To release the cost and risk of battery replacement, in large-scale applications and toxic environment, wireless power transfer (WPT) was presented as a promising solution. As for wireless power transfer, there are three different kinds of technologies, i.e., induction coupling, magnetic resonance coupling and RF radiation. Among them, induction coupling and magnetic resonance coupling are near-field power transfer technologies, which basically are able to charge the devices in the range of tenths of watts, over short distances of up to one meter [9]. Particularly, induction coupling needs tight alignment of the coils of chargers ...