# A Scalable and Trust-Value-Based Consensus Algorithm for Internet of Vehicles
## 1 Introduction  
With the rapid development of the Internet of Things and the continuous progress of 5G technology, the Internet of Vehicles is gradually coming into people's view. The Internet of Vehicles plays an important fundamental role in the field of transportation. The collection and sharing of traffic data between vehicles can better optimize the service quality of intelligent transportation systems [1]. However, due to privacy and security concerns, vehicles may be reluctant to upload data to the Road Side Unit (RSU) for data sharing, thus hindering the development of future connected vehicles [2]. Due to the characteristics of blockchain technology such as distribution, anonymity, and non-comparability, many researchers have integrated blockchain technology with vehicle networking. Blockchain is used to establish a secure, trusted, and decentralized intelligent transportation ecosystem to solve part of the problem of vehicle data sharing [3]. However, after the introduction of blockchain, the system needs to consume a lot of computing resources and storage resources to meet the data-sharing service. At the same time, in a highly dynamic vehicular networking environment, it is difficult to maintain a long-term communication connection between vehicles and RSU nodes. When the data synchronization speed in the blockchain network does not match the moving speed of vehicles, the high latency may cause data inconsistency between nodes in different regions, resulting in meaningless old data for vehicles and other problems. As an integral component of blockchain technology, consensus algorithms serve the pivotal role of ensuring data consistency among distributed nodes. Many of the current studies combining IoV and blockchain consensus algorithms are based on traditional methods, including proof-of-work (PoW), proof-of-stake (PoS), entrusted proof-of-stake (DPoS), and practical Byzantine fault Tolerance (PBFT). However, the limited computational resources of RSU nodes within vehicular networks render them inadequate for the execution of PoW-based algorithms. Furthermore, consensus mechanisms such as PoS and DPoS, which hinge on stake-based incentives, may potentially introduce disparities in outcomes. A comparative analysis conducted by [PERSON] et al. [4] evaluated the efficacy of PoW, PoS, and PBFT, concluding that PBFT holds the highest promise as a consensus algorithm within the context of vehicular networks. Although there are many researches on the PBFT consensus algorithm in IOV [5; 6; 7], most of them are based on traditional single-chain structure. As the number of nodes increases, the communication complexity of traditional PBFT consensus algorithm increases rapidly and the consensus performance decreases sharply. Therefore, it is a great challenge to directly apply the PBFT consensus algorithm in the Internet of Vehicles. Therefore, this paper proposes a double-layer PBFT consensus algorithm by region. Meanwhile, the committee election algorithm elects appropriate RSU nodes to participate in the consensus according to the credibility value, which solves the problem of low scalability of the PBFT algorithm due to the superlinear complexity due to excessive RSU nodes. The main contributions of this paper are summarized as follows:  
1. We propose a multi-weight subjective logic model to calculate the RSUs node's credit value more accurately. 2. We propose a committee election algorithm to select appropriate nodes to participate in consensus based on node reputation, reduce communication complexity, and improve the scalability of blockchain. 3. We propose a double-layer consensus structure algorithm, which firstly carries out regional consensus and then global consensus to reduce consensus latency and communication complexity. 4. We experimentally tested the proposed reputation assessment model RCMWSL and the C-PBFT consensus algorithm. The rest of the paper is organized as follows.