# A Blockchain Solution for the Internet of Vehicles with Better Filtering and Adaptive Capabilities
## 4 Gradually Accelerating Environment Adaptive Consensus Algorithm
### Node Trust Management Model Based on Gradual Acceleration Mechanism
#### 4.1.2 Trust Management Model Based on Gradual Acceleration Mechanism  
To intuitively describe the algorithm model we proposed, the parameter definition was performed in Table 1.  
As an efficient reward mechanism, the trust management model has significant advantages, such as strong scalability, high node participation, and high quality of information interaction. However, the traditional trust model only focuses on the improvement of the algorithm on the existing mechanism and does not take into account Credit score update efficiency and node screening speed. The proposed trust model based on the gradual acceleration mechanism largely solves problems of slow response to malicious behaviors and a long delay in determining the role of normal vehicles. Figure 4 shows a flowchart of the method, which has the following process:  
(1) System Initialization: Initialize the system nodes \(\mathcal{N}\), initial credit Scores [\(\mathcal{N}_{Node\_id}\)], and the consensus group ratio \(P_{0}\). At this point, the order of all nodes is randomly determined, and the system parameters are initialized. These include the reward weight coefficient \(\alpha\), penalty weight coefficient \(\beta\), trust coefficient \(\mathcal{W}_{t}\) based on historical behavior \(\mathcal{W}_{h}\), and the continuous historical behaviors \(\xi_{1}\) and \(\xi_{2}\). (2) Master Node Selection: Based on the master node selection rule \(n_{0}=v\)_mod len_(\(\mathcal{N}_{CO}\)), the master node for the current stage is selected. The client then sends a request to the master node \(n_{0}\) to initiate the consensus process, as outlined in Figure 2.  
(3) Reply Phase: During this phase, the master node \(n_{0}\) provides the confirmation result to all nodes, including both consensus nodes \(\mathcal{N}_{CO}\) and candidate nodes \(\mathcal{N}_{CA}\). Simultaneously, the credit Scores of all participating nodes are updated. (4) Credit Score Update: The RSU updates the parameters in the two counters \(\mathcal{W}_{h}\) and \(\mathcal{W}_{t}\) based on the correctness of the received results. If a node's judgment aligns with the final result, the corresponding \(\xi_{1}\) in \(\mathcal{W}_{h}\) for that node increases by 1; otherwise, \(\xi_{2}\) decreases by 1. When \(\xi_{1}\) or \(\xi_{2}\) reaches a threshold of \(\geq 3\) or \(\leq-3\), the system considers the node to be in a consistent behavioral state and adjusts the weight coefficient in the \(\mathcal{W}_{t}\) counter. This adjustment influences the node's credit score settlement in the current round, thereby accelerating the identification and classification of nodes with different roles. \begin{table}
\begin{tabular}{c c} \hline \hline
**Symbol** & **Definition** \\ \hline \(\mathcal{N}\) & All system nodes \\ \(\mathcal{N}_{Node\_id}\) & A system node with a corresponding id \\ \(\mathcal{W}_{h}\) & Historical behavior counter \\ \(\xi_{1}\xi_{2}\) & Parameters for recording continuous historical behavior \\ \(\mathcal{W}_{t}\) & Trust coefficient recorder \\ \(\alpha\),\(\beta\) & Reward and penalty weight coefficient \\ Scores & Record the current credit score of all system nodes \\ \(H_{Threshold}\) & Low score compensation warning threshold \\ \(P\) & Consensus group proportion coefficient \\ \(P_{0}\) & Initial consensus group ratio coefficient \\ \(\mathcal{N}_{CO}\) & Consensus Group Node \\ \(\mathcal{N}_{CA}\) & Candidate group nodes \\ \(a_{1}\),\(a_{2}\) & Weighting coefficient \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameters used and the definitions. (5) Consensus Group Adjustment: The RSU calculates the current overall average credit score of all nodes to assess the impact of external environmental factors. Since the consensus group directly participates in the consensus process, its weight in the calculation is higher. The new consensus group ratio \(P\) for the next round is determined using Equation (3), which helps to eliminate nodes that disrupt normal operations. All updated information will be recorded on the blockchain as permanent data storage.