As an essential technology in the sixth generation of wireless communication, the reconfigurable intelligent surface (RIS) offers transformative solutions for the evolution of intelligent transportation. In the secondary network, RIS is equipped on an unmanned aerial vehicle (UAV) to establish a communication link between secondary base station (SBS) and secondary mobile vehicles (SMVs). At the same time, the communication within the secondary network must not interfere with the primary users (PUs) in the primary network. To achieve the optimal energy efficiency, we need to optimize the RIS passive beamforming, SMVs communication scheduling, SBS radiation power allocation and RIS-UAV trajectory. Since the original problem is difficult to solve, we use an alternating iteration framework to decompose the original problem into four subproblems and solve them with successive convex approximations (SCA). We have developed the CEEM scheme to compare it with benchmark schemes and demonstrate its superior performance, achieving up to a 43.48% improvement. In addition, RIS improves the communication quality by up to 57.53% in the simulation results, which have verified the correctness and effectiveness of the algorithm proposed in this paper.