## 4 Application of Blockchain Technology in the Internet of Vehicles
### POS Consensus Algorithm Improvement
CA needs to record each RSU, that is, to record the energy value corresponding to the RSU in each stage from the first round to the last round. The energy value corresponding to the RSU of each round is set to \(Egy_{\times}\), and the energy value of the RSU differs at different moments. Therefore, the energy value of RSU cannot be uniformly estimated for a certain round, that is, the energy value does not have a certain value. In the current study, the energy value of the RSU in each round was considered as the energy value of the last moment corresponding to the RSU in this round. Part 3. While participating in the election, each RSU is counted by CA from the first registration election. RSU participates in and initiates many elections in the latest election, and the number of elections is recorded as J. Following the above steps, CA will calculate the energy value corresponding to the RSU in round J. In addition, the corresponding equity value in each RSU election is recorded as \(Stake_{R-l}\), and \(Stake_{R-l}\)'s calculation formula is as follows (in the formula, a represents the return growth rate in the POS algorithm mechanism, and the constant a generally takes a value of 0.05; \(Egy_{\times}\) means the corresponding energy value for each round of RSU, which is set to \(Egy_{\times}\)):\[\text{Stake}_{R-1}=\sum_{x=1}^{J}Egy_{x}\times(1+a\%)^{J}\]  
Part 4. If round F is set as a particular number, five rounds are generally selected during the calculation process, and the energy value of the corresponding RSU is in a stable state. Then, in the process of RSU equity value calculation, we the \(J\) value corresponding to RSU is chosen as zero. The corresponding \(J\) value should not be considered until the corresponding energy value of RSU changes. This is because, if the RSU does not participate in the network transaction for a very long time, the corresponding energy value will be in a stable and constant state; in other words, the energy value does not change. The F round is set as a specific round, and the equity value and \(J\) value are considered, aiming to stimulate RSU activity, and stimulate RSU to more actively participate in the election and network behavior. Part 5. Following the above steps, CA calculates the equity value of all candidate RSU candidates and determines that the accounting node of this round is the maximum equity value corresponding to RSU. After determining the new accounting node, CA will immediately update the energy value corresponding to the RSU. By setting the energy value of the RSU after the J election as \(Egy_{J}\), the energy value of the RSU after the (J \(-1\)) election is recorded as \(Egy_{J-1}\); the refund proportion of the deposit is expressed by \(P_{r}\); the reward issued by the successful RSU accounting node is recorded as \(\Delta Egy_{\text{reward}}\); the attenuation coefficient is \(\text{e}^{\frac{1}{\Delta T_{J-1-J}}}\). The correct update process is as follows:  
\[Egy_{J}=Egy_{J-1}\cdot\text{e}^{\frac{1}{\Delta T_{J-1-J}}}+\Delta Egy_{ \text{consume}}.P_{r}+\Delta Egy_{\text{reward}}\]  
To express the RSU revenue in the form of an increased energy value, the actual reward is calculated as follows:  
\[\Delta Egy_{\text{reward}}=\frac{1-\Delta Egy_{J-1}}{2}\]  
CA will also reset the J value of the accounting function RSU. After this round, the J value of the RSU is counted again. When the RSU obtains the bookkeeping function, CA will also reset ITS J value, and the J value of the RSU will start counting again after this round. The following algorithm details the incentive consensus mechanism (see Algorithm 1).