Along with the continuous revolution of energy production and energy consumption structures, the information data of smart grids have exploded, and effective solutions are urgently needed to solve the problem of power devices resource scheduling and energy efficiency optimization. In this paper, we propose a fifth generation (5G) and satellite converged network architecture for power transmission and distribution scenarios, where power transmission and distribution devices (PDs) can choose to forward power data to a cloud server data center via ground networks or space-based networks for power grid regulation and control. We propose a Joint Device Association and Power Control Online Optimization (JDAPCOO) algorithm to maximize the long-term system energy efficiency while guaranteeing the minimum transmission rate requirement of PDs. Since the formulated issue is a mixed integer nonconvex optimization problem with high complexity, we decompose the original problem into two subproblems, i.e., device association and power control, which are solved using a genetic algorithm and improved simulated annealing algorithm, respectively. Numerical simulation results show that when the number of PDs is 50, the proposed algorithm can improve the system energy efficiency by 105%, 545.05% and 835.26%, respectively, compared with the equal power allocation algorithm, random power allocation algorithm and random device association algorithm.