| In recent years,with the rapid growth of the number of Internet of Things applications and devices,security issues in the Internet of Things have gradually emerged.The openness and inclusiveness of the Internet of Things technology enable it to establish connectivity and data sharing among various devices.It also improves production efficiency,economic benefits,and user experience.But inevitably introduce hidden dangers in security such as privacy protection and trust management.In the centralized mode on which the Internet of Things relies,the devices connected to the Internet of Things by cloud computing cannot match the explosive growth of devices and data scale.The transmission bandwidth and latency between the devices on the edge of the network and the cloud server will be limited,thus affecting the response speed and performance of the system.At the same time,the data is centrally managed,which brings the problem of data privacy and security.Blockchain technology is characterized by decentralization,immutability,and traceability,which can bring new solutions to the trust and security of Io T devices and meet the increasingly complex needs of Io T.The consensus mechanism is the core mechanism of blockchain systems to maintain data consistency.Applying blockchain consensus mechanisms to the Internet of Things can improve processing speed and security.The consensus mechanism widely used presently has shortcomings,such as high energy consumption,low efficiency,and dependence on tokens,which cannot meet the development needs of the Internet of Things.Therefore,an in-depth study of the existing consensus mechanism is of great significance for integrating of blockchain and the Internet of Things.The research content of this paper is summarized as follows:(1)Aiming at the problem that the voting of the nodes in the delegated proof of stake(DPo S)was not active and malicious nodes manipulated the election results,an improved DPo S consensus algorithm based on similarity of common neighbor nodes(S-DPo S)was proposed.Firstly,the common neighbor node similarity model was introduced to realize community division,shorten the voting period and improve consensus efficiency.Secondly,based on the credit mechanism,node behavior was used to dynamically adjust the credibility and type of nodes,which increases the difficulty for malicious nodes to become witness nodes and makes the elected nodes more credible.Finally,the node was rewarded and punished through the reward and punishment mechanism to eliminate the wrong node quickly.Simulation experiments show that the node participation of the S-DPo S consensus algorithm was 30%~40% higher than that of DPo S and could effectively reduce the possibility of malicious nodes manipulating election results,which could enhance the security of the system.(2)Aiming at the problem that false vehicle information and data were easily tampered with in the Internet of Vehicles scenario,this paper proposes an Io V sharing scheme based on improved DPo S,which generated,verified,and stored blocks maintained by Road Side Units.Firstly,a trust value evaluation mechanism was proposed.The global trust value was calculated through the communication interaction between vehicle nodes and other vehicles,and the Road Side Unit node decided whether to receive the data of the vehicle node according to its trust value.Secondly,the V-DPo S consensus algorithm was used among Road Side Unit nodes to divide nodes into groups according to clustering,reducing nodes’ waiting time and communication time and improving consensus efficiency.Then,according to the node behavior weight value,the trusted node was selected to package the data information uploaded by the vehicle node into blocks so that the information uploaded by the vehicle node with a high trust value can be time released.Finally,nodes with positive behaviors were given income rewards to encourage nodes to maintain positive behaviors in the consensus process.The simulation results show that the scheme could reduce the probability of nodes doing evil and improve the security of the system. |