| The authenticity of luxury jewelry is the focus of the consumer industry,and the jewelry transaction traceability system is one of the important means to ensure the quality and authenticity of jewelry.The traditional jewelry transaction tracing system relies on a central enterprise server.Due to excessive dependence on the central server,if the central server fails or invades,the stored data will be lost or stolen.At the same time,in the process of jewelry trade circulation,Due to the delay of data update and sharing,trade information can not keep up with the rate of data query.Therefore,the traditional jewelry trade traceability system must be combined with the latest information technology to deal with these problems.Blockchain is a new distributed network structure accounting technology that combines distributed consensus,distributed storage and other new technologies to conduct decentralized untrusted transactions.Its characteristics can be used for traceability.Therefore,this thesis integrates the blockchain technology with the traceability system of jewelry trade,makes an overall design of the traceability system,makes a detailed design in terms of consensus efficiency and query speed,and implements and tests the system.Firstly,the problems of low consensus efficiency and high communication complexity of traditional practical Byzantine fault-tolerant consensus algorithm applied to jewelry transaction traceability system are analyzed,and a practical Byzantine fault-tolerant consensus algorithm with low communication cost based on multi-layer grouping is proposed.Firstly,through the node attribute grouping model,the nodes in the alliance chain are divided into different groups of consensus nodes and supervision nodes.The nodes with different attributes are divided into different consensus groups,and the group will continue to be layered.After the first layer of consensus,the nodes of different groups return to the lower layer to send consensus requests to know the consensus to the end layer,which greatly reduces the communication complexity of nodes.Secondly,the last layer combines the raft consensus algorithm to reduce the consensus delay.At the end of the node,the leader of the raft is responsible for the supervision of the malicious consensus algorithm.Experiments show that the practical Byzantine fault-tolerant consensus algorithm with low communication cost based on multi-layer packet has lower communication complexity,higher throughput and lower delay.Then it analyzes the low query efficiency of the traditional blockchain structure in the jewelry transaction traceability system,and puts forward a fast indexing algorithm based on blockchain.In the original blockchain system,the transaction information in the positioning block and the positioning of the last transaction block need to compare the information one by one,which greatly affects the query return speed.Firstly,the algorithm introduces the repeated index mechanism to reduce the access of continuous queries in a short time by controlling the cache attenuation.Secondly,the fast positioning leaf node model is introduced to store the index position and jewelry ID of each leaf node in the block.The index position is obtained directly during query to reduce the comparison delay.Finally,after querying the current block,the block distance model is used to calculate the distance of the last trading block,so as to realize fast jump and reduce the time consumption of traversing useless blocks.Experiments show that the algorithm is efficient in returning query information.Finally,the above consensus algorithm and fast index algorithm are applied to the jewelry transaction traceability system based on blockchain,and the main function module pages of the system are displayed and tested.The test results show that the traceability system can meet the application requirements of jewelry transaction traceability. |