# Efficient Mobile Vehicle Data Sharing Scheme Based on Consortium Blockchain
## 3 Data Sharing Process
RSU plays the game and feeds back the results to both parties  
After receiving the feedback from seller, \(RSU_{j}\) calculates the equilibrium point through the Stackelberg game and calculates the corresponding relationship between the most suitable buyer's bid and the amount of data that can be enjoyed. After this, both parties receive the results from \(RSU_{j}\), where \(p_{i}{}^{*}\) and \(d_{k}{}^{*}\) both are the buyer's \(b_{i}\) unit of data that should be bid and the total amount of data provided to \(b_{i}\) via vehicle \(s_{k}\); \(time\) represents the timestamp of the reply. 6. Data sharing and payment  
After vehicle \(s_{k}\) obtains the matching result of \(RSU_{j}\), it will de-duplicate and de-old the data, and then transmit the processed data to \(RSU_{j}\). After that, a series of processing steps such as de-duplication are completed using the data filter. If the result shows that the data from vehicle \(s_{k}\) contain duplicate, expired or harmful content, a certain penalty will be deducted from the security deposit of the vehicle, penalizing sellers who offer worthless or harmful data in pursuit of profit. Actually, if the vehicles send duplicated data to the RSU, the data transmission efficiency will be affected directly, which is important for data sharing in IoV. After the buyer obtains the data successfully, the resource currency of \(p^{*}d^{*}\) is retrieved from the wallet and paid to the seller. At the end of this data transaction, a record is generated in the memory pool of \(RSU_{j}\), which will be broadcasted across the entire network and added to the block in subsequent links. 7. Block generation and linking to the blockchain  
Aiming at the contention of accounting rights among different nodes, we formulated the proof of work (POW) workload proof mechanism. Although it requires more resources, it is more mature among consensus mechanisms and is immune to attacks such as double-spending attacks and selfish mining attacks with a mining power below 51% [16; 17]. The steps of block generation and linking are shown in Figure 3.  
Examination of Figure 3 reveals that the operation process of the POW mechanism is as follows:  
1. After RSU generates a data sharing record, it saves it in the memory pool and then informs all RSU nodes. These nodes will also store the record after being notified. The RSU fuses the data sharing records in the memory pool together to obtain a new block during a time period;
2. All RSU nodes use the POW workload proof mechanism to compete for accounting rights. The essence of the POW mechanism is to continuously adjust the input value of a hash function to obtain the target value. In the block generation time period, the RSU that obtains the qualified random number in the shortest time is the accounting node;10. The accounting node broadcasts its own block within the network range. After other RSUs determine that the accounting node has obtained the qualified value, it will not continue to calculate, and then verifies the latter's block. The final verification result will be reported to the accounting node in the form of \"valid\" or \"invalid\";
11. The accounting node counts all notifications. When more than half of the notifications are valid, it proves that the block is valid. At this time, the accounting node establishes a connection between the block and the copy of the local consortium blockchain. It is valid for all RSUs, which perform the same operation of establishing a connection;
12. After judging the block to be valid, the accounting node successfully \"mines\". The system will award resource coins, and in this way, it will be motivated to continue \"mining\". In addition, the accounting RSU retrieves the data sharing records contained in the memory pool, identifies all of the mobile vehicles participating in the data sharing, determines the degree of participation and reward resource coins, and directly deposits coins in the vehicle's wallet to encourage them to continue data sharing.