Unmanned aerial vehicles (UAVs) play an essential role in scenarios such as smart grid data collection and power line inspection for their maneuverability and low cost. However, the most obvious defect of UAVs is still the energy problem. The battery life of UAVs is too short of completing long-term tasks. Therefore, this paper proposes a distributed cooperative and continuous coverage strategy for UAVs. When the UAV is short of power, we select the path through the relay algorithm and send backhaul information such as the remaining power to the macro base station (mBS). mBS will send auxiliary UAVs to replace UAVs with weak power to complete the task of UAV replacement. We jointly optimize the relay information transmission path and UAV trajectory to achieve the goal of minimizing the total energy consumption of the system. The simulation results show that the optimization algorithm can significantly reduce the energy consumption of UAVs.