# 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
(6) Next Consensus Round: The credit scores and the composition of the consensus group are updated, and the system proceeds to the next round of the consensus cycle. As shown in Algorithm 1, to track the continuous historical behavior of nodes, we have established a counter dictionary, \(\mathcal{W}_{h}\), to record each node's behavior. For each node ID \(\mathcal{N}_{Node\_id}\), it stores two count values: \(\xi_{1}\) and \(\xi_{2}\). \(\xi_{1}\) tracks the cumulative score increases for the node, starting at 0 and incrementing by 1 with each increase. Conversely, \(\xi_{2}\) tracks the cumulative score decreases, starting at 0 and decrementing by 1 with each decrease. When either \(\xi_{1}\) reaches 3 or \(\xi_{2}\) reaches \(-3\), it indicates that the node has exhibited continuous increasing or decreasing behavior three times. At this point, the node is considered to have demonstrated a consistent pattern of correct or incorrect behavior. We then gradually adjust the node's reward weight coefficient \(\alpha\) and penalty weight coefficient \(\beta\) in the trust coefficient counter \(\mathcal{W}_{t}\), which corresponds to the node. Both coefficients initially start at 1, and as the node continues to exhibit consistent behavior, these values increase, up to a maximum of 4. The opposing coefficient (reward or penalty) will remain unchanged. The specific rules are outlined in Tables 2 and 3. This means that in each round of credit score settlement, a node's credit score can change up to four times faster than the initial rate, depending on its behavior. Nodes with a history of positive behavior will see their credit scores increase more rapidly, while those with a history of malicious behavior will experience faster declines. Unlike the fixed scoring model of traditional credit systems, this dynamic mechanism allows for a quicker divergence in scores between nodes of different behavioral patterns. As a result, the system becomes more efficient at role selection, which indirectly enhances the robustness of the IoV system. It is important to note that when a node is in an accelerated credit score accumulation phase due to continuous correct historical behavior and it suddenly performs an incorrect action, how should this accelerated state be adjusted? Our proposed solution is to interrupt the process and revert the node to its initial state. That is, once a behavior contrary to the current pattern is observed, all accumulated state benefits for the node are canceled, and the accumulation process must restart from the beginning. This is because the continuous behavior has been disrupted by the anomalous action, necessitating a fresh accumulation process. We implement a simulated semaphore mechanism to achieve mutually exclusive recording of node historical behavior, which will be discussed in detail in the next section. Figure 4: Trust management model based on gradual acceleration mechanism. ```
0: Reward weight coefficient \(\alpha\), Penalty weight coefficient \(\beta\), System Nodes \(\mathcal{N}\), historical_behavior \(\mathcal{W}_{h}=\{\}\),trust_coefficient \(\mathcal{W}_{t}=\{\}\). 1: System initialization
2:\(\alpha=1\), \(\beta=1\)
3:\(\mathcal{W}_{h}[\mathcal{N}]=[0,0]\), \(\mathcal{W}_{t}[\mathcal{N}]=[1,1]\)
4: Note that the parameter \(\mathcal{W}_{h}[\mathcal{N}_{Node\_id}][0]\) is here equal to \(\xi_{1}\) and that \(\mathcal{W}_{h}[\mathcal{N}_{Node\_id}][1]\) is \(\xi_{2}\).