# A Proof-of-Multiple-State Consensus Mechanism for Mobile Nodes in Internet of Vehicles
## 4 Consensus Mechanism Based on Integrated State
### State-Factors Calculations
Considering the difference in the vehicle's travel direction, we add an additional speed factor to the range factor, which ensures that the more vehicle nodes there are that maintain the same travel direction as node \(i\), the higher the probability that the node will win the competition and become a relay node. In this article we define the speed factor as:  
\[P_{velocity}^{i,j}=1-\alpha\frac{|v1-v2|}{|v1|+|v2|} \tag{6}\]  
where \(\alpha\) is the weight of the adjustment factor weights, and when this value is larger, the greater the effect of the speed factor on \(P(diff_{i})\) produces, the greater the effect it has, and vice versa, the weaker it is. For each vehicle's communication range we define as \(R\), so the probability that vehicle \(i\) and vehicle \(j\) are still in communication range after time period \(\Delta t\)can be expressed as \(P_{range}^{i,j}=\frac{\Delta D_{i,i}^{\prime 2}}{R}\). It can be obtained that the value of \(P\left(diff_{i}\right)\) between node \(i\) and node \(j\) at the moment \(t2\) is expressed as:  
\[P\Big{(}diff_{i,j}\Big{)}=P_{dis}.P_{velocity}^{i,j} \tag{7}\]  
And for a single vehicle node \(i\), there is  
\[P(diff_{i})=\sum_{j=1,j\
eq i}^{n_{range}}P\Big{(}diff_{i,j}\Big{)} \tag{8}\]  
\(n_{range}\) indicates the number of communicable mobile vehicles within the management area of the RSU to which the vehicle nodes belong. (2) \(P(SINR_{i})\): If node \(i\) is selected as a relay node, its channel quality at the moment \(t2\) is expressed as:  
\[SINR_{i,j}=\frac{\big{(}D_{i,j}\big{)}^{-\gamma}}{\sum_{k=1,k\
eq i}^{n_{range }}\big{(}D_{j,k}\big{)}^{-\gamma}+P_{n}} \tag{9}\]  
where \(D_{i,j}\) is the same as above, \(D_{j,k}\) denotes the distance between node \(j\) and the remaining interfering node \(k\), while \(\gamma\) is the path loss exponent and \(P_{n}\) denotes the noise power. To ensure that the channel quality meets the message delivery requirements, we set a threshold for the SINR value. If it is higher than this threshold, it means that the message can be transmitted smoothly. That is, the term can be written as:  
\[(SINR_{i}>\beta)=\left(\frac{\big{(}D_{i,j}\big{)}^{-\gamma}}{\sum_{k=1,k\
eq i }^{n_{range}}\Big{(}D_{j,k}\Big{)}^{-\gamma}+P_{n}}\geq\beta\right) \tag{10}\]  
A transformation is performed to obtain:  
\[(SINR_{i}>\beta)=\left(D_{i,j}\leq\left(\beta\bigg{(}\sum_{k=1,k\
eq i}^{n_{ range}}\Big{(}D_{j,k}\Big{)}^{-\gamma}+P_{n}\bigg{)}\right)^{-\frac{1}{ \gamma}}\right) \tag{11}\]  
Within a packet network, every time after exchanging information about all vehicles in a group through broadcast messages, vehicle \(i\) that wants to compete for a relay node calculates its own SINR value based on different vehicle position differences and finally aggregates them. This process can be represented as follows:  
\[D_{ijx}^{\Delta t}=\left(\left(v_{ix}^{t2}-v_{jx}^{t2}\right)-\left(v_{ix}^{t 1}-v_{jx}^{t1}\right)\right)\cdot\frac{\Delta t}{2} \tag{3}\]0  
Eventually, there is:  
\[D_{ijx}^{\Delta t}=\left(\left(v_{ix}^{t2}-v_{jx}^{t2}\right)-\left(v_{ix}^{t 1}-v_{jx}^{t1}\right)\right)\cdot\frac{\Delta t}{2} \tag{3}\]1  
(3) \(P(Com_{i})\): The value in question is dictated by the computational capability of the onboard processor, with those possessing higher arithmetic capacities enjoying a significant advantage. Given the different instruction set architectures and hardware components of CPUs, and given that a significant portion of a processor's computing capacity is dedicated to performing prediction tasks, the experiments aim to use program execution time as a metric to measure performance differences among CPUs. The main frequency of the processor, denoted by \(f\), is a critical parameter that significantly influences its computing performance.