| Blockchain is a distributed shared database technology emerging on the basis of the application of digital cryptocurrencies.It provides a unified data platform with weak centralization,high transparency and strong credibility,and has broad application prospects in smart cities,tax auditing,fintech and other fields.With the enrichment of blockchain application scenarios,the scale of blockchain data continues to expand,the retrieval needs continue to increase and become more complicated.However,most of the existing blockchain platforms only consider a single application scenario and use coarse-grained organization method for increasing blockchain data,which leads to the widespread problems,such as poor data availability,poor searchability and low retrieval efficiency.Existing blockchain platforms have been difficult to efficiently manage blockchain data that has the basic characteristics of big data,the organization and management of blockchain data need to be solved urgently.From the perspective of data management,this thesis studies efficient blockchain data organization and management methods.Combining the existing blockchain technology with the mature traditional database management technology,a blockchain data management system that supporting multi-granularity efficient retrieval and complex transaction processing is designed based on the relational model.Compared with existing blockchain systems,the blockchain data management system designed in this thesis is the first one to support the direct use of native SQL to provide on-chain transaction services.The main work of this thesis are as follows:1.This thesis deeply studied the data organization structure and storage method of blockchain.On the premise of ensuring blockchain features such as decentralization,traceability and immutability,the relational modeling and mapping methods of blockchain data are designed and implemented based on blockchain structure and ledger system.We reconstruct the block data,transaction data,state data and historical data of Hyperledger Fabric underlying ledger storage system based on relational database My SQL.Storing relational blockchain data with built-in My SQL of each node in the blockchain network can refine the granularity of data organization and provide more efficient data support and services.2.This thesis deeply studied chaincode system and application development mode of Hyperledger Fabric.On the basis of the first point,a relational chaincode supporting common SQL is proposed.On the premise of ensuring the distributed consistency protocol and transaction processing mechanism of blockchain,the simulation execution stage and verification submission stage of blockchain transaction process are reconstructed based on read-write set.The relational chaincode provides a convenient on-chain application programming interface for users to create transaction proposals,which supports users to carry out fine-grained retrieval and model complex application scenarios by directly using SQL,so as to realize the blockchain’s support for relational complex query and transaction processing.This thesis uses two benchmark test sets: TPC-H and TPC-C,which are commonly used in relational database,to carry out experiments.The results show that the blockchain data management system designed in this thesis combines the advantages of blockchain and relational database.It not only has similar read and write performance to Hyperledger Fabric,but also has better data management ability and complex retrieval performance.It greatly improves the manageability and searchability of blockchain data. |