| With the development of artificial intelligence,big data and the Internet of Things,more and more data is generated and collected through traditional sensing devices or smart mobile devices.In order to improve the efficiency and availability of data transmission,the raw data often needs to be initially analysed and processed with the help of edge computing,so there will be a large amount of available data in the edge computing network.If this data can be shared directly in the edge network,it will greatly improve the utilisation of the data and speed up the modernisation process of the city.Therefore,how to share data between heterogeneous edge nodes is a hot research area.In order to solve the problem of how to establish trust relationship,guarantee privacy and single point of failure of central framework for data sharing in edge computing,in this thesis a blockchain-based access control mechanism is proposed.Smart contracts of blockchain are used in this scheme to manage access control and audit data.Decentralization and immutability of blockchain are used to solve the problems of single point of failure and node trust.To ensure data privacy,all data uploaded to third-party servers is encrypted using the AES-128 algorithm,while decryption keys are shared through SGX technology to build a secure program.System analysis shows that the solution meets scalability requirements and is highly secure against malicious service provider attacks and man-in-the-middle attacks.In order to solve the scalability problem of traditional blockchain networks,we combines the characteristics of the three-layer framework of edge computing and the idea of slicing,a two-layer slicing consensus protocol TTSP is proposed.It can be applied to the access control mechanism of edge computing.TTSP implements consensus in two steps,first,the edge servers and end nodes in the network are divided into multiple local blockchain by the improved K-means algorithm according to the location parameters.Each local blockchain network will process transactions and form blocks in parallel through Local Blockchain Network Consensus(LBNC).LBNC randomly selects a number of nodes to form a committee based on the number of funds,and the committee reaches an initial consensus through PBFT.Later,to prevent a single local blockchain network from being taken over by a malicious node,a global blockchain network with strong security running Po W consensus will collect blocks from individual local blockchain networks to provide security for the final consensus,relying on the powerful computing power and storage resources of cloud servers in edge computing.System analysis shows that the proposed scheme is highly secure,and simulation results show that LBNC has lower communication overhead and higher throughput than PBFT. |