In network of vehicles, due to some roadside units (RSU) are remote and cannot be maintained timely by network administrator, they may be attacked and become untrustworthy RSUs, resulting in reduction of vehicle communication quality and network energy efficiency. To effectively identify the reliability of the RSU, a trust degree-based RSU recognition and resource allocation algorithm (TRRA) is proposed. In this algorithm, roadside unit identification, transmission mode selection, and power allocation are jointly modeled as the network energy efficiency optimization problem, which is divided into three sub-optimization problems to solve respectively. Firstly, the trust degree-based RSU recognition algorithm is used to identify the trusted and untrusted roadside units; Secondly, the resource block allocation and the link selection are optimized; Finally, the sub-gradient algorithm is used to optimize the transmission power and maximize the network energy efficiency. Simulations show that the proposed algorithm has lower complexity, which can achieve higher recognition accuracy of roadside units, and effectively improve the overall network energy efficiency.