# A Proof-of-Multiple-State Consensus Mechanism for Mobile Nodes in Internet of Vehicles
## 1 Introduction  
The rapid development of the automotive industry and the Internet of Vehicles (IoV) has escalated concerns regarding the security of vehicle networks [1]. A primary benefit of the Internet of Vehicles (IoV) is the enhancement of traffic safety and efficiency, notably through real-time vehicle information sharing. While most vehicle information requires sharing only among nearby vehicles, certain types (e.g., announcements) demand broader dissemination. However, due to the extensive user privacy contained in these data, they are easily leaked during storage and distribution, posing significant risks to users. The presence of data security and privacy protection issues [2] presents numerous difficulties and challenges for the IoV messaging process. Given the emergence of blockchain technology, with its benefits of decentralization, immutability, and transparency [3], well-suited to the IoV complex scenarios, it can alleviate various security issues in the transmission and distribution of in-vehicle data, thereby transforming the IoV traditional centralized architecture and gaining widespread application within IoV. In recent years, blockchain technology, particularly its consensus mechanism [4], has emerged as a significant research focus, attracting considerable scholarly interest. Blockchain technology integrates various technologies, including P2P networks, smart contracts, consensus mechanisms, and cryptography, culminating in an innovative form of distributed ledger technology. Its decentralized, tamper-proof, traceable, and transparent characteristics afford it vast application potential in the Internet of Vehicles (IoV), particularly in addressing issues of centralization, data security, and privacy protection. Initially, blockchains employ a Proof-of-Work (PoW) mechanism, which necessitated extensive computations among nodes for transaction verification. Despite guaranteeing network security, the mechanism's high computational resource consumption makes it difficult to implement in actual scenarios with a range of computational requirements. Later suggestions focus on the PBFT algorithm to address Byzantine fault tolerance problems and Proof-of-Stake (PoS) consensus mechanisms and their improvements [5; 6]. In addition, the IoV requirement for low latency and the arithmetic bottlenecks present in vehicles limit the wider application of traditional consensus algorithms within the IoV. These traditional algorithms, despite their advancements, have limitations. First, they are designed for cryptocurrency protection and the impact of mobile nodes' dynamic characteristics is ignored in the process of consensus. Building on the existing Proof-of-Work consensus algorithms, this paper presents an improved message transmission model for vehicular networks. The goal of the model is to ensure transmission security and stability while addressing the deterioration of communication quality brought on by fast nodes mobility in vehicular networks. It makes use of a consensus mechanism that is based on Quality of Service (PoMS). The network is initially divided into different service areas based on communication states, and nodes are first loosely clustered together. Then, using the obtained data to determine its future travel conditions, a trained machine learning model forecasts the vehicle's movement state. This method improves the efficiency and dependability of network communication by having the model determine the best transmission path. The main contributions of this article can be summarized as follows:  
1. We achieve consensus in different partitions and manage it uniformly through a two-layer chain to speed up the consensus process. 2. We have developed a consensus on speed change factors for mobile nodes in the network so that they can adapt to dynamic networks. 3. Based on this, we propose the PoMS consensus algorithm that takes multiple factors into account to evaluate vehicle levels and filter out better relay nodes based on this.