# A Scalable and Trust-Value-Based Consensus Algorithm for Internet of Vehicles
## 4 C-PBFT Consensus Algorithm
### Reputation Calculation Using Multi-Weighted Subjective Logic Model
#### 4.2.1 Local Opinions of Subjective Logic  
The \(RSU_{j}\) corresponds to the vehicle \(V_{i}\) in the region, and based on its communication data interaction with the \(RSU_{j}\) and the predefined subjective logic model, the local opinion vector \(\omega_{i\to j}^{I_{x}}:=\{b_{i\to j}^{I_{x}},d_{i\to j}^{I_{x}},u_{i\to j}^{I_{x}}\}\) of the vehicle \(V_{i}\) in the time window evaluates the reputation value of the \(RSU_{j}\):  
\begin{table}
\begin{tabular}{p{142.3 pt} p{142.3 pt}} \hline \hline
**Notation** & **Definition** \\ \hline \(\left\{b_{i\to j},d_{i\to j},u_{i\to j}\right\}\) & A local opinion vector \(\omega_{i\to j}\) from a vehicle \(V_{i}\) to \(RSU_{j}\) \\ \hline \(F_{i\to j}\) & Vi’s expected beliefs about RSU \\ \hline \(\alpha_{i},\beta_{i}\) & The number of positive/negative interactions \\ \hline \(\chi,\tau\) & The weight of positive/negative interactions \\ \hline \(R_{i}\) & Reputation value of node i \\ \hline \(n\) & Number of regions \\ \hline \(u\) & Average number of nodes in each committee \\ \hline \(m\) & Average number of nodes in each region \\ \hline Y & The given decay parameter for event freshness \\ \hline \(\mathcal{E}\) & The initial reputation value of the node predefined in the system \\ \hline \hline \end{tabular}
\end{table}
Table 1: The main symbols.  
\[\left\{\begin{array}{l}b_{i\to j}^{t_{x}}=\left(1-u_{i\to j}^{t_{x}} \right)\frac{a_{i\to j}^{t_{x}}}{a_{i\to j}^{t_{x-j}}+b_{i\to j}^{t_{x-j}}}\\ d_{i\to j}^{t_{x}}=\left(1-u_{i\to j}^{t_{x}}\right)\frac{b_{i\to j}^{t_{x-j}}}{a _{i\to j}^{t_{x-j}}+b_{i\to j}^{t_{x-j}}}\\ u_{i\to j}^{t_{x}}=1-q_{i\to j}^{t_{x}}\end{array}\right. \tag{1}\]  
In this case, vehicle \(V_{i}\) interacts with the \(RSU_{j}\) during traveling with data, such as crowdsensing or vehicle data sharing. The local opinion of the subjective logic model \(V_{i}\) on the \(RSU_{j}\) can be formally described as a local opinion vector \(\omega_{i\to j}^{t_{x}}:=\{b_{i\to j}^{t_{x}},d_{i\to j}^{t_{x}},u_{i\to j}^{t_{x}}\}\), where \(b_{i\to j}^{t_{x}},d_{i\to j}^{t_{x}},u_{i\to j}^{t_{x}}\) stand for trust, distrust, and uncertainty, respectively. \(b_{i\to j}^{t_{x}},d_{i\to j}^{t_{x}},u_{i\to j}^{t_{x}}\in[0,1]\) and \(b_{i\to j}^{t_{x}}+d_{i\to j}^{t_{x}}+u_{i\to j}^{t_{x}}=1\), where \(\{t_{1},\cdots t_{x},\cdots t_{X}\}\) represents part of the time period \(X\) as a time window. \(\alpha_{i\to j}^{t_{x}}\) is the number of positive interactions between vehicle \(V_{i}\) and \(RSU_{j}\), and \(\beta_{i\to j}^{t_{x}}\) is the number of negative interactions between vehicle \(V_{i}\) and \(RSU_{j}\), where positive interactions mean that vehicle \(V_{i}\) believes that the service provided by \(RSU_{j}\) is relevant and useful. A negative interaction means that vehicle \(V_{i}\) does not believe that the service provided by \(RSU_{j}\) is relevant and useful. \(q_{i\to j}^{t_{x}}\) is the communication quality of the link between vehicle \(V_{i}\) and \(RSU_{j}\), that is, the probability of successful packet transmission, which determines the uncertainty of \(u_{i\to j}\) in the local opinion vector. Based on the local opinion vector \(\omega_{i\to j}^{t_{x}}:=\{b_{i\to j}^{t_{x}},d_{i\to j}^{t_{x}},u_{i\to j}^{t_ {x}}\}\) in the time window of vehicle \(V_{i}\), the expression of the initial credit value evaluated by vehicle \(V_{i}\) to \(RSU_{j}\) is determined as follows:  
\[F_{i\to j}=b_{i\to j}+\gamma u_{i\to j} \tag{2}\]  
where \(0\leq\gamma\leq 1\) is a given constant, representing the degree of influence of uncertainty on credit value.