| In traditional centralized data storage,data is controlled by a small number of people,which cannot guarantee the security of data.Therefore,distributed storage will become the trend of data storage in the future.Blockchain naturally has the characteristics of decentralization and is an ideal technology to realize distributed storage.As one of the core contents of blockchain technology,consensus algorithm affects the security and performance of blockchain consensus.As one of the most widely used consensus algorithms,The practical byzantine fault tolerant algorithm has the disadvantages of high consensus delay and high communication cost.In this paper,an average stability byzantine fault tolerant algorithm(ASPBFT)is proposed to improve the existing problems of PBFT consensus algorithm.A node evaluation mechanism was added,and the average stability of all nodes in the system was correlated with the proportion of nodes participating in consensus in each round,so as to control the number of consensus nodes and improve the performance and adaptability of the consensus algorithm.This paper applies the AS-PBFT consensus algorithm to design and implement a storage system based on blockchain technology,To complete the decentralized storage of data,and improve the security of data storage,the main research contents and innovative achievements are as follows:(1)An adaptive AS-PBFT consensus algorithm is proposed to control consensus nodes based on average stability.In view of the lack of node evaluation in PBFT algorithm,the algorithm sets stability coefficient for nodes,proposes a node evaluation mechanism based on historical performance,and determines the proportion of consensus node cluster in the total number of nodes in each round according to the average stability of the system.The stability coefficient is taken as the index to reduce the number of nodes participating in the consensus,so as to achieve the optimization of algorithm performance.(2)Building a blockchain storage system using AS-PBFT consensus algorithm.The initialization process of the system is designed to complete the initialization work.Design the initialization process of the system and complete the initialization work.Configure an encryption module to encrypt source files in a combination of symmetric encryption and asymmetric encryption to enhance data security.Inter Planetary File System(IPFS)is introduced as the data storage platform under the chain to reduce the storage cost.Finally,the document hash is taken as the consensus information,and the consensus is completed according to the AS-PBFT consensus algorithm.So as to realize the decentralized storage of data.(3)An asynchronous packet key distribution strategy is proposed.When asymmetric encryption is used to complete the distribution of symmetric encryption keys,nodes in the system are divided into groups,and corresponding key distribution nodes are set for group distribution.Symmetric encryption keys are transmitted asynchronously to avoid the decryption time of key distribution nodes in the distribution process,and improve the efficiency of key distribution in a large scale system.This paper completes the design and construction of the blockchain storage system based on AS-PBFT algorithm,and verifies the optimization effect of AS-PBFT consensus algorithm and asynchronous packet key distribution strategy through experiments,which proves the feasibility of the scheme. |