WO2022027530A1 - Blockchain-based high-performance tamper-proof database construction method - Google Patents

Blockchain-based high-performance tamper-proof database construction method Download PDF

Info

Publication number
WO2022027530A1
WO2022027530A1 PCT/CN2020/107591 CN2020107591W WO2022027530A1 WO 2022027530 A1 WO2022027530 A1 WO 2022027530A1 CN 2020107591 W CN2020107591 W CN 2020107591W WO 2022027530 A1 WO2022027530 A1 WO 2022027530A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
blockchain
database
node
block
Prior art date
Application number
PCT/CN2020/107591
Other languages
French (fr)
Chinese (zh)
Inventor
李兴华
任彦冰
胡中元
李小强
王运帷
王航
Original Assignee
西安电子科技大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 西安电子科技大学 filed Critical 西安电子科技大学
Priority to US17/505,994 priority Critical patent/US20220043928A1/en
Publication of WO2022027530A1 publication Critical patent/WO2022027530A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the invention belongs to the technical field of blockchain, and in particular relates to a method for constructing a high-performance anti-tampering database based on blockchain.
  • the database system belongs to the basic and supporting software, which is widely used in major national industries such as government affairs and commerce, military defense, aerospace, banking and securities, and medical and health care. It is a key technology that is stuck by foreign countries. Under the trend of informatization and intelligence in today's society, data is the core and foundation of information systems, and data security is a key factor related to national security and social stability.
  • Two-layer database system structure based on distributed peer-to-peer network data is divided into two layers through hierarchical design, the bottom layer is the incremental data change stored in the blockchain data structure, and the chain data structure has a higher tail write Performance, the top layer is the final state set of data obtained by incremental changes in the underlying data, which is stored in a block structure, and uses a B+ tree to build an index;
  • the method for constructing the blockchain-based high-performance anti-tampering database includes:
  • Step 3 The top layer is the final state set of data obtained by incremental changes of the underlying data, which is stored in a block structure and indexed using a B+ tree.
  • FIG. 1 is a flowchart of a method for constructing a blockchain-based high-performance tamper-proof database provided by an embodiment of the present invention.
  • FIG. 8 is a time chart of the relationship between node self-checking and data volume in an experiment provided by an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of query throughput of different database systems in an experiment provided by an embodiment of the present invention.
  • the construction method of the high-performance tamper-proof database based on blockchain includes the following steps:
  • Double-layer database system structure based on distributed peer-to-peer network The data is divided into two layers through hierarchical design: the bottom layer is the data change increment stored in the blockchain data structure, and the chain data structure has a higher tail Write performance, the top layer is the final state set of data obtained by incremental changes in the underlying data, which is stored in a block structure and uses a B+ tree to build an index;
  • S102 Data self-inspection and inter-node mutual inspection method with low time complexity: the bottom layer uses the blockchain data structure for storage, and the tampered data is corrected through regular self-inspection of the chain structure's legitimacy through inter-node communication. The final state of the top-level storage data, the node needs to self-check before operating the data in the top-level database to further improve the anti-tampering performance of the system;
  • Modular and configurable system architecture provides a pluggable automatic cleaning function, supports a modular and pluggable consensus mechanism, and supports the required functions at the application layer under the existing blockchain double-layer architecture Sexual Expansion.
  • the construction method of the blockchain-based high-performance tamper-resistant database provided by the present invention can also be implemented by those skilled in the industry by other steps.
  • the construction method of the blockchain-based high-performance tamper-resistant database provided by the present invention in FIG. 1 Just one specific example.
  • S101 Two-tier database system structure based on distributed peer-to-peer network:
  • S103 Modular and configurable system architecture
  • Step 1 Divide the data into 2 layers through hierarchical design
  • the bottom layer is the data change increment stored in the blockchain data structure
  • the top layer is the final data state set obtained from the bottom layer data change increment.
  • the bottom layer uses a relational database for structured storage
  • the top layer can use the database type required by the business.
  • the bottom and top databases are stored in the same database instance.
  • Step 3 the top layer is the final state set of data obtained by the incremental change of the underlying data, which is stored in a block structure, and uses a B+ tree to establish an index at the same time;
  • the steps of the low time complexity data self-checking and inter-node mutual checking method of the present invention are as follows;
  • Step 1 the bottom layer uses the blockchain data structure for storage, through regular self-checks on the validity of the chain structure, and corrects the tampered data through inter-node communication to ensure that the data on the chain cannot be tampered with.
  • the node performs a self-check to check whether the hash before and after its own blockchain is correct; if it is not correct, it broadcasts a request message to the blockchain nodes with physical connections around it;
  • Cert_X represents the public key certificate of node X
  • t is the maximum block number of the current local blockchain
  • Nonce is the selected random number.
  • Response message After the neighbor node receives the Request, it first verifies its signature information to ensure the authenticity of the source of the request message and the integrity of the content, and then sends a response message Response containing the missing blockchain to the requesting node X.
  • Response_K ⁇ Cert_K, Block_lost, Nonce+1, Sign(Sk x , H(Cert_K
  • Cert_K represents the public key certificate responding to the neighbor node K
  • Node X will receive responses from multiple neighbor nodes, and recover all lost block data by selecting the response message that contains the most lost block sets and is valid for verification.
  • the verification here includes the verification of the chain relationship in the block and the verification of the signed message;
  • Step 2 the top-level database needs to self-check before operating the data
  • the node If the node learns that the current hash value of its top-level database is different from that of the entire network by more than 1/2 through the consensus process, the node will call the self-inspection and mutual-inspection process of the underlying blockchain to update the latest data of the underlying and top-level databases. state synchronization;
  • the node If the node confirms that the current hash value of its top-level database is consistent with more than 1/2 of the nodes in the entire network through the consensus process, it will continue to add, delete, and modify the database. This is done by sending the SQL statement of the top-level database operation to The underlying blockchain database network is implemented.
  • Step 1 support a modular consensus mechanism replacement scheme for the underlying blockchain database
  • Step 2 the top-level database supports data access through various interfaces, and is compatible with various common database accesses;
  • Step 3 Support under the existing blockchain double-layer architecture. Functional extensions that may be required are made at the application layer.
  • the built-in system provides a pluggable automatic cleaning function, which can be freely configured to store transaction data in recent months, and at the same time select a node to retain transaction data for all time. Old data will only be automatically cleaned up by the sliding window function, and there is no mechanism to modify existing data;
  • the anti-tampering database based on the block chain designed by the present invention has significant advantages in terms of security.
  • the traditional database adopts a centralized architecture, and the addition, deletion and modification of data are completed by a single node, which cannot prevent and detect malicious deletion and modification of data after a single node is compromised by attackers, nor can it prevent nodes from writing to the database. Enter fake data.
  • the tamper-proof database based on the blockchain designed by the present invention combines the blockchain with the local database, which can effectively solve the security bottleneck of the traditional database. Since the data is distributed and stored in a plurality of nodes in the network, the present invention can effectively detect and prevent malicious addition, tampering and deletion of data by malicious nodes.
  • the designed blockchain tamper-proof database is compared with the existing blockchain database service in throughput and response time of a single operation, as shown in Figure 10 and Figure 11.
  • the present invention deploys a virtual machine for testing (8 cores and 8G), and the test results are shown in FIG. 9 .
  • the number of consensus increases, the time spent on node self-checking also increases gradually.
  • the top layer is the final state set of data obtained by incremental changes of the underlying data, which is stored in a block structure and indexed using a B+ tree.
  • Data self-checking and inter-node mutual checking method with low time complexity The bottom layer uses the blockchain data structure for storage, and the tampered data is corrected through regular self-checking of the chain structure's legitimacy through inter-node communication.
  • the final state of the top-level storage data, the node needs to self-check before operating the data in the top-level database to further improve the anti-tampering performance of the system.
  • Modular and configurable system architecture provides a pluggable automatic cleaning function, supports a modular and pluggable consensus mechanism, and supports the required functional expansion at the application layer under the existing blockchain double-layer architecture .
  • This method designs a two-layer database system structure of a distributed peer-to-peer network, a data verification method for data self-checking and mutual checking between nodes, and applies it to the blockchain system as a distributed and tamper-resistant database system. It is used to store the final state data and block data, realizes data tamper-proof and anti-deletion in the double-layer database architecture, realizes the customization and expansion of system functions, and meets the needs of enterprises for trusted storage of sensitive data. .
  • the device and its modules of the present invention can be implemented by hardware circuits such as very large scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., It can also be implemented by software executed by various types of processors, or by a combination of the above-mentioned hardware circuits and software, such as firmware.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention pertains to the technical field of blockchains, and discloses a blockchain-based high-performance tamper-proof database construction method. The construction method comprises: a double-layer database system structure based on a distributed peer-to-peer network; low-time complexity data self-checking and inter-node mutual checking methods; and a modular configurable system architecture. The invention solves the single-point-of-failure problem of traditional data systems, establishes an efficient B+ tree-based indexing structure, and eliminates the bottleneck of low query performance under traditional blockchain architectures. The method solves the problem of high-speed verification for big data, realizes data tamperproofing and deletion protection in double-layer database architectures, and meets the demand of enterprises for trusted storage of sensitive data. The invention realizes customizability and scalability of system functions, meets various security requirements of different service scenarios, and reduces the cost of actual deployment processes for the enterprises. The present invention realizes data tamperproofing and deletion protection in double-layer database architectures, and achieves customizability and scalability of system functions.

Description

一种基于区块链的高性能防篡改数据库的构建方法A construction method of a high-performance anti-tampering database based on blockchain 技术领域technical field
本发明属于区块链技术领域,尤其涉及一种基于区块链的高性能防篡改数据库的构建方法。The invention belongs to the technical field of blockchain, and in particular relates to a method for constructing a high-performance anti-tampering database based on blockchain.
背景技术Background technique
目前:数据库系统属于基础和支撑软件,广泛应用于政务商务、军事国防、航空航天、银行证券、医疗卫生等国家重大行业,属于被国外卡脖子的关键技术。在当今社会信息化、智能化的趋势下,数据是信息系统的核心与基础,数据安全是关系到国家安全、社会稳定的关键因素。2020年3月中共中央政治局常务委员会召开会议,指出要加快数据中心等新型基础设施建设进度;2020年4月中共中央、国务院印发的《关于构建更加完善的要素市场化配置体制机制的意见》将数据列为五大核心要素之一。数据库系统作为数据存储、管理与加工的基础与支撑,其安全性与高效性对于发展数据中心等新型基础设施建设、发挥数据基础性资源和战略性资源的作用、探索以数据为关键要素的新增长方式具有重大意义。At present: the database system belongs to the basic and supporting software, which is widely used in major national industries such as government affairs and commerce, military defense, aerospace, banking and securities, and medical and health care. It is a key technology that is stuck by foreign countries. Under the trend of informatization and intelligence in today's society, data is the core and foundation of information systems, and data security is a key factor related to national security and social stability. In March 2020, the Standing Committee of the Political Bureau of the Central Committee of the Communist Party of China held a meeting, pointing out that the construction of new infrastructure such as data centers should be accelerated; in April 2020, the Central Committee of the Communist Party of China and the State Council issued the "Opinions on Building a More Perfect Market-based Allocation System and Mechanism for Factors" List data as one of the five core elements. As the foundation and support of data storage, management and processing, the security and efficiency of database system are important for developing new infrastructure construction such as data centers, giving full play to the role of data basic resources and strategic resources, and exploring new technologies with data as the key element. Growth patterns are significant.
尽管数据库系统对于经济发展与新型基础设施建设具有重要意义,其在安全性方面存在着以下挑战:1)传统中心化数据库在数据存储时面临单点失效的风险,2)数据库系统中存储的数据容易被非法篡改,且难以发觉。因此,确保数据库存储系统中数据的高可用性与不可篡改性是数据安全的关键。Although the database system is of great significance for economic development and new infrastructure construction, it has the following challenges in terms of security: 1) the traditional centralized database faces the risk of single-point failure during data storage, 2) the data stored in the database system It is easy to be illegally tampered with and difficult to detect. Therefore, ensuring the high availability and immutability of data in the database storage system is the key to data security.
为了解决上述问题,基于区块链的分布式数据库应运而生。相比于传统数据库,其具备去中心化、不可篡改性、公开透明等优势。然而现有的区块链数据库仍不能满足企业业务系统的需求,存在的主要问题包括:1)现有的大多数区块链数据库采用非关系存储结构,其在数据检索时存在效率低效的问题;2)现有的区块链数据库在数据储存层面不支持定制化扩展,需要企业做大量额外 的适配才能适用于已有业务系统。In order to solve the above problems, the distributed database based on blockchain came into being. Compared with traditional databases, it has the advantages of decentralization, immutability, openness and transparency. However, the existing blockchain databases still cannot meet the needs of enterprise business systems. The main problems include: 1) Most existing blockchain databases use non-relational storage structures, which are inefficient in data retrieval. Problems; 2) The existing blockchain database does not support customized expansion at the data storage level, and requires enterprises to make a lot of additional adaptations to apply to existing business systems.
通过上述分析,现有技术存在的问题及缺陷为:Through the above analysis, the existing problems and defects in the prior art are:
(1)现有的大多数区块链数据库采用非关系存储结构,其在数据检索时存在效率低效的问题。(1) Most of the existing blockchain databases use a non-relational storage structure, which has the problem of low efficiency in data retrieval.
(2)现有的区块链数据库在数据储存层面不支持定制化扩展,需要企业做大量额外的适配才能适用于已有业务系统。(2) The existing blockchain database does not support customized expansion at the data storage level, and requires enterprises to make a lot of additional adaptations to apply to existing business systems.
发明内容SUMMARY OF THE INVENTION
针对现有技术存在的问题,本发明提供了一种基于区块链的高性能防篡改数据库的构建方法。Aiming at the problems existing in the prior art, the present invention provides a method for constructing a high-performance tamper-proof database based on blockchain.
本发明是这样实现的,一种基于区块链的高性能防篡改数据库的构建方法,所述基于区块链的高性能防篡改数据库的构建方法包括:The present invention is implemented in this way, a method for constructing a high-performance anti-tampering database based on blockchain, and the method for constructing a high-performance anti-tampering database based on blockchain includes:
基于分布式对等网络的双层数据库系统结构:通过分层设计将数据分为两层,底层为采用区块链数据结构存储的数据变化增量,链式数据结构拥有较高的尾部写入性能,顶层是由底层数据变化增量得到的数据最终状态集,采用块式结构存储,同时使用B+树建立索引;Two-layer database system structure based on distributed peer-to-peer network: data is divided into two layers through hierarchical design, the bottom layer is the incremental data change stored in the blockchain data structure, and the chain data structure has a higher tail write Performance, the top layer is the final state set of data obtained by incremental changes in the underlying data, which is stored in a block structure, and uses a B+ tree to build an index;
低时间复杂度的数据自检与节点间互检方法:底层采用区块链数据结构进行存储,通过定期对链式结构的合法性自检,并通过节点间通讯修正被篡改的数据,顶层存储数据的最终状态,顶层数据库在对数据进行操作前进行自检;Data self-inspection and inter-node mutual inspection method with low time complexity: the bottom layer uses the blockchain data structure for storage, through regular self-inspection of the chain structure's legitimacy, and through inter-node communication to correct the tampered data, the top layer is stored The final state of the data, the top-level database performs self-checks before operating on the data;
模块化可配置的系统架构:提供了可插拔地自动清理功能,支持模块化的共识机制替换方案,支持在已有区块链双层架构下,在应用层进行所需要的功能性扩展。Modular and configurable system architecture: It provides a pluggable automatic cleaning function, supports a modular consensus mechanism replacement scheme, and supports the required functional expansion at the application layer under the existing blockchain double-layer architecture.
进一步,所述基于区块链的高性能防篡改数据库的构建方法包括:Further, the method for constructing the blockchain-based high-performance anti-tampering database includes:
(1)基于分布式对等网络的双层数据库系统结构;(1) Double-layer database system structure based on distributed peer-to-peer network;
(2)低时间复杂度的数据自检与节点间互检方法;(2) Data self-checking and inter-node mutual checking methods with low time complexity;
(3)模块化可配置的系统架构。(3) Modular and configurable system architecture.
进一步,所述基于分布式对等网络的双层数据库系统结构包括以下步骤:Further, the described double-layer database system structure based on distributed peer-to-peer network includes the following steps:
步骤一,通过分层设计将数据分为两层;Step 1: Divide the data into two layers through hierarchical design;
步骤二,底层为采用区块链数据结构存储的数据变化增量,链式数据结构拥有较高的尾部写入性能; Step 2, the bottom layer is the incremental data change stored in the blockchain data structure, and the chain data structure has higher tail write performance;
步骤三,顶层是由底层数据变化增量得到的数据最终状态集,采用块式结构存储,同时使用B+树建立索引。Step 3: The top layer is the final state set of data obtained by incremental changes of the underlying data, which is stored in a block structure and indexed using a B+ tree.
进一步,所述步骤一通过分层设计将数据分为两层包括以下步骤:底层为采用区块链数据结构存储的数据变化增量,顶层是由底层数据变化增量得到的数据最终状态集;底层采用关系型数据库进行结构化存储,顶层采用业务所需的数据库类型。Further, the step 1 divides the data into two layers by hierarchical design and includes the following steps: the bottom layer is the data change increment stored by using the blockchain data structure, and the top layer is the final data state set obtained from the bottom layer data change increment; The bottom layer adopts relational database for structured storage, and the top layer adopts the database type required by the business.
进一步,所述步骤二中底层为采用区块链数据结构存储的数据变化增量,链式数据结构拥有较高的尾部写入性能,包括以下步骤:Further, in the second step, the bottom layer is the data change increment stored in the blockchain data structure, and the chain data structure has higher tail write performance, including the following steps:
(1)通过API接受用户的上链请求;(1) Accept the user's on-chain request through the API;
(2)将该上链请求以待上链交易的形式在节点间广播;(2) The on-chain request is broadcast among nodes in the form of a pending on-chain transaction;
(3)共识出块时间到达时,节点将当前待上链交易打包为区块;(3) When the consensus block time arrives, the node will package the current transaction to be listed as a block;
(4)遵循区块链数据结构,存储在底层区块链数据库中。(4) Follow the blockchain data structure and store in the underlying blockchain database.
进一步,所述步骤三中顶层是由底层数据变化增量得到的数据最终状态集,采用块式结构存储,同时使用B+树建立索引,拥有较高的查询性能,包括以下步骤:Further, in the step 3, the top layer is the final state set of data obtained by incremental changes of the underlying data, which is stored in a block structure, and uses B+ tree to build indexes at the same time, which has higher query performance, including the following steps:
(1)每当节点出块时,或从其他节点获取更新区块时,会将新区块中的数据变化增量复现到顶层状态数据库中,顶层状态数据库为最新状态;(1) Whenever a node generates a block, or obtains an updated block from other nodes, the data changes in the new block will be incrementally reproduced in the top-level state database, and the top-level state database will be the latest state;
(2)利用B+树建立索引。(2) Use the B+ tree to build an index.
进一步,所述低时间复杂度的数据自检与节点间互检方法包括以下步骤:Further, the method for data self-checking and inter-node mutual checking with low time complexity includes the following steps:
(1)底层采用区块链数据结构进行存储,通过定期对链式结构的合法性自检,并通过节点间通讯修正被篡改的数据;(1) The bottom layer adopts the block chain data structure for storage, and the tampered data is corrected through the regular self-check of the chain structure's legitimacy through communication between nodes;
(2)顶层数据库在对数据进行操作前进行自检。(2) The top-level database performs self-inspection before operating the data.
进一步,所述步骤一中底层采用区块链数据结构进行存储,通过定期对链式结构的合法性自检,并通过节点间通讯修正被篡改的数据,保证已上链数据的不可篡改性;包括以下步骤:Further, in the first step, the bottom layer adopts the blockchain data structure for storage, and the tampered data is corrected through the regular self-check of the chain structure's legitimacy, and the tampered data is corrected through the communication between nodes, so as to ensure that the data on the chain cannot be tampered with; Include the following steps:
(1)首先节点进行自检,检查自己的区块链前后哈希是否正确;如果不正确执行(2);节点在顶层数据库在对数据进行操作前进行自检;包括以下步骤:(1) First, the node performs a self-check to check whether the hash before and after its own blockchain is correct; if it is not performed correctly (2); the node performs a self-check before operating the data in the top-level database; including the following steps:
节点对顶层数据库计算当前最新状态的哈希值,并将该哈希值进行全网广播,进而借助模块化共识协议确认其顶层数据库状态是当前全网一致的;The node calculates the hash value of the current latest state of the top-level database, broadcasts the hash value to the entire network, and then uses the modular consensus protocol to confirm that the state of its top-level database is currently consistent across the entire network;
如果通过共识过程该节点获知当前其顶层数据库的哈希值与全网超过1/2节点不同,那么该节点将调用底层区块链的自检互检过程,对底层与顶层数据库的最新状态进行同步;If the node learns that the current hash value of its top-level database is different from that of more than 1/2 of the nodes in the entire network through the consensus process, the node will call the self-check and mutual-check process of the underlying blockchain to check the latest status of the bottom and top-level databases. Synchronize;
如果通过共识过程该节点确认当前其顶层数据库的哈希值与全网超过1/2节点一致,则会继续进行数据库的增删改等操作,通过将顶层数据库操作的SQL语句发送到底层区块链数据库网络来实现的;If the node confirms that the current hash value of its top-level database is consistent with more than 1/2 of the nodes in the entire network through the consensus process, it will continue to add, delete, and modify the database, and send the SQL statement of the top-level database operation to the underlying blockchain. Database network to achieve;
(2)向其周围有物理连接的区块链节点广播请求消息;包括以下步骤:(2) Broadcast the request message to the blockchain nodes with physical connections around it; including the following steps:
1)请求消息:节点X先其有物理连接的一跳节点广播获取丢失区块的消息Request={Cert_X,t,Nonce,Sign(Sk x,H(Cert_X||t||Nonce))};其中,Cert_X表示节点X的公钥证书,t当前本地区块链的最大区块编号,Nonce为选取的随机数; 1) Request message: Node X first broadcasts the message Request={Cert_X, t, Nonce, Sign(Sk x , H(Cert_X||t||Nonce))}; Among them, Cert_X represents the public key certificate of node X, t is the maximum block number of the current local blockchain, and Nonce is the selected random number;
2)响应消息:邻居节点收到Request后,首先通过对其签名信息的验证以保证请求消息来源的真实性和内容的完整性,然后向该请求节点X发送包含丢失区块链的响应消息Response;以其中一邻居节点K为例,Response_K={Cert_K,Block_lost,Nonce+1,Sign(Sk x,H(Cert_K||Block_lost||Nonce+1))};其中,Cert_K表示响应邻居节点K的公钥证书,Block_lost表示丢弃区块集合Block_lost={Block t+1,…..,Block n}(假设当前全网最新的区块为Block n),节点X会收到多个邻居节点的应答,通过选取包含最多丢失区块集合且验证合法的响应消息来恢复所有丢失的区块数据。这里的验证包含对区块中链式关系的验证, 以及签名消息的验证。 2) Response message: After the neighbor node receives the Request, it first verifies its signature information to ensure the authenticity of the source of the request message and the integrity of the content, and then sends a response message Response containing the missing blockchain to the requesting node X ; Take one of the neighbor nodes K as an example, Response_K={Cert_K, Block_lost, Nonce+1, Sign(Sk x , H(Cert_K||Block_lost||Nonce+1))}; wherein, Cert_K represents the response of the neighbor node K Public key certificate, Block_lost indicates the discarded block set Block_lost={Block t+1 ,..., Block n } (assuming that the latest block of the entire network is Block n ), node X will receive responses from multiple neighbor nodes , and recover all lost block data by selecting the response message that contains the most lost block sets and is valid for verification. The verification here includes the verification of the chain relationship in the block and the verification of the signed message.
进一步,所述模块化可配置的系统架构,包括以下步骤:Further, the modular and configurable system architecture includes the following steps:
(1)针对底层区块链数据库,支持模块化的共识机制替换方案,内置兼具安全性与共识效率的基于Raft的共识协议,用户亦可切换到具有更高安全性的PBFT共识协议,或者手动指定出块时间;(1) For the underlying blockchain database, a modular consensus mechanism replacement scheme is supported, and a Raft-based consensus protocol with both security and consensus efficiency is built in. Users can also switch to the PBFT consensus protocol with higher security, or Manually specify the block time;
(2)顶层数据库支持以各种接口进行数据访问,兼容各种常见数据库接入,包括关系型数据库postgres、mysql,支持用户以业务需要进行选择,支持查询者使用标准SQL语句提交查询请求,包括筛选、聚类、连接、排序复杂操作;(2) The top-level database supports data access through various interfaces, compatible with various common database accesses, including relational databases postgres, mysql, supports users to choose according to business needs, and supports queryers to submit query requests using standard SQL statements, including Filter, cluster, join, sort complex operations;
(3)提供了可插拔地自动清理功能,可自由配置存储近几个月的交易数据,同时选择某一节点保留全部时间的交易数据,旧数据将仅能由滑动窗口功能自动清理,同时没有任何机制能够修改已有数据。(3) Provides a pluggable automatic cleaning function, which can be freely configured to store transaction data in recent months, and at the same time select a node to retain transaction data for all time, the old data will only be automatically cleaned by the sliding window function, and There is no mechanism to modify existing data.
进一步,提供了可插拔地自动清理功能,自由配置存储近几个月的交易数据,同时选择某一节点保留全部时间的交易数据,包括以下步骤:Further, it provides a pluggable automatic cleaning function, freely configures and stores transaction data in recent months, and selects a node to retain transaction data for all time, including the following steps:
(1)节点根据系统设置的滑动窗口大小检查区块链,发现区块链最近保留的完整的区块数大于滑动窗口的大小,则执行(2);(1) The node checks the blockchain according to the size of the sliding window set by the system, and finds that the number of complete blocks recently reserved by the blockchain is greater than the size of the sliding window, then execute (2);
(2)保持窗口内的全部区块以及创世区块,其余窗口外的区块删除区块体仅保留区块头。(2) Keep all the blocks in the window and the genesis block, and delete the blocks outside the window and only keep the block header.
结合上述的所有技术方案,本发明所具备的优点及积极效果为:鉴于已有区块链存在上述数据检索时存在效率低效,不支持定制化扩展等问题,本发明将在分布式数据库系统的安全参考结构下,设计了高度灵活的分布式双层数据存储结构,解决了传统数据系统存在单点失效的难题,以及传统区块链架构查询性能低下导致的性能瓶颈。基于双层存储架构,提出了高效的数据自检与节点间互检方法,满足了企业对敏感数据的可信存储需求。提出了模块化可配置的系统架构,满足了系统的扩展性和兼容性。Combined with all the above technical solutions, the advantages and positive effects of the present invention are: in view of the problems of inefficiency in the above-mentioned data retrieval in the existing blockchain, and the lack of support for customized expansion, the present invention will be implemented in a distributed database system. Under the security reference structure, a highly flexible distributed double-layer data storage structure is designed, which solves the problem of single-point failure in traditional data systems and the performance bottleneck caused by the low query performance of traditional blockchain architecture. Based on the double-layer storage architecture, an efficient data self-inspection and inter-node mutual inspection method is proposed, which meets the enterprise's trusted storage requirements for sensitive data. A modular and configurable system architecture is proposed, which satisfies the scalability and compatibility of the system.
本发明通过分层设计将数据分为2层:底层为采用区块链数据结构存储的数据变化增量,链式数据结构拥有较高的尾部写入性能。顶层是由底层数据变 化增量得到的数据最终状态集,采用块式结构存储,同时使用B+树建立索引。底层采用区块链数据结构进行存储,通过定期对链式结构的合法性自检,并通过节点间通讯修正被篡改的数据,保证已上链数据的不可篡改性。顶层存储数据的最终状态,节点在对顶层数据库中的数据进行操作前需要自检以进一步提升系统防篡改性能。提供了可插拔地自动清理功能,支持模块化的共识机制替换方案,支持在已有区块链双层架构下,在应用层进行所需要的功能性扩展。The present invention divides the data into two layers through layered design: the bottom layer is the data change increment stored in the block chain data structure, and the chain data structure has higher tail writing performance. The top layer is the final state set of data obtained by incremental changes in the underlying data, which is stored in a block structure and indexed using a B+ tree. The bottom layer uses the blockchain data structure for storage. Through regular self-checks of the chain structure's legitimacy, and through inter-node communication, the tampered data is corrected to ensure that the data on the chain cannot be tampered with. The final state of the top-level storage data, the node needs to self-check before operating the data in the top-level database to further improve the anti-tampering performance of the system. It provides a pluggable automatic cleaning function, supports a modular consensus mechanism replacement scheme, and supports the required functional expansion at the application layer under the existing blockchain double-layer architecture.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图做简单的介绍,显而易见地,下面所描述的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings that need to be used in the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.
图1是本发明实施例提供的基于区块链的高性能防篡改数据库的构建方法流程图。FIG. 1 is a flowchart of a method for constructing a blockchain-based high-performance tamper-proof database provided by an embodiment of the present invention.
图2是本发明实施例提供的实施的双层架构图。FIG. 2 is a diagram of a two-layer architecture of an implementation provided by an embodiment of the present invention.
图3是本发明实施例提供的实施的节点互检和自检架构图。FIG. 3 is an architecture diagram of node mutual inspection and self-inspection implemented by an embodiment of the present invention.
图4是本发明实施例提供的实施的总体流程图。FIG. 4 is an overall flow chart of the implementation provided by the embodiment of the present invention.
图5是本发明实施例提供的实施的基于分布式对等网络的双层数据库系统结构子流程图。FIG. 5 is a sub-flow diagram of the structure of a two-layer database system based on a distributed peer-to-peer network implemented by an embodiment of the present invention.
图6是本发明实施例提供的实施的低时间复杂度的数据自检与节点间互检的子流程图。FIG. 6 is a sub-flow chart of data self-checking and inter-node mutual checking with low time complexity implemented by an embodiment of the present invention.
图7是本发明实施例提供的实施的模块化可配置的系统架构的子流程图。FIG. 7 is a sub-flow diagram of the implemented modular and configurable system architecture provided by an embodiment of the present invention.
图8是本发明实施例提供的实验的节点自检与数据量的关系时间图。FIG. 8 is a time chart of the relationship between node self-checking and data volume in an experiment provided by an embodiment of the present invention.
图9是本发明实施例提供的实验的节点互检共识节点数量与时间的关系示意图。FIG. 9 is a schematic diagram of the relationship between the number of nodes and the time of mutual inspection consensus nodes in an experiment provided by an embodiment of the present invention.
图10是本发明实施例提供的实验的不同数据库系统查询吞吐量示意图。FIG. 10 is a schematic diagram of query throughput of different database systems in an experiment provided by an embodiment of the present invention.
图11是本发明实施例提供的实验的不同数据库系统单操作响应时间示意图。FIG. 11 is a schematic diagram of a single-operation response time of different database systems in an experiment provided by an embodiment of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.
针对现有技术存在的问题,本发明提供了一种基于区块链的高性能防篡改数据库的构建方法,下面结合附图对本发明作详细的描述。In view of the problems existing in the prior art, the present invention provides a method for constructing a high-performance anti-tampering database based on blockchain. The present invention is described in detail below with reference to the accompanying drawings.
如图1所示,本发明提供的基于区块链的高性能防篡改数据库的构建方法包括以下步骤:As shown in Figure 1, the construction method of the high-performance tamper-proof database based on blockchain provided by the present invention includes the following steps:
S101:基于分布式对等网络的双层数据库系统结构:通过分层设计将数据分为两层:底层为采用区块链数据结构存储的数据变化增量,链式数据结构拥有较高的尾部写入性能,顶层是由底层数据变化增量得到的数据最终状态集,采用块式结构存储,同时使用B+树建立索引;S101: Double-layer database system structure based on distributed peer-to-peer network: The data is divided into two layers through hierarchical design: the bottom layer is the data change increment stored in the blockchain data structure, and the chain data structure has a higher tail Write performance, the top layer is the final state set of data obtained by incremental changes in the underlying data, which is stored in a block structure and uses a B+ tree to build an index;
S102:低时间复杂度的数据自检与节点间互检方法:底层采用区块链数据结构进行存储,通过定期对链式结构的合法性自检,并通过节点间通讯修正被篡改的数据,顶层存储数据的最终状态,节点在对顶层数据库中的数据进行操作前需要自检以进一步提升系统防篡改性能;S102: Data self-inspection and inter-node mutual inspection method with low time complexity: the bottom layer uses the blockchain data structure for storage, and the tampered data is corrected through regular self-inspection of the chain structure's legitimacy through inter-node communication. The final state of the top-level storage data, the node needs to self-check before operating the data in the top-level database to further improve the anti-tampering performance of the system;
S103:模块化可配置的系统架构:提供了可插拔的自动清理功能,支持模块化可插拔的共识机制,支持在已有区块链双层架构下,在应用层进行所需要的功能性扩展。S103: Modular and configurable system architecture: provides a pluggable automatic cleaning function, supports a modular and pluggable consensus mechanism, and supports the required functions at the application layer under the existing blockchain double-layer architecture Sexual Expansion.
本发明提供的基于区块链的高性能防篡改数据库的构建方法业内的普通技术人员还可以采用其他的步骤实施,图1的本发明提供的基于区块链的高性能防篡改数据库的构建方法仅仅是一个具体实施例而已。The construction method of the blockchain-based high-performance tamper-resistant database provided by the present invention can also be implemented by those skilled in the industry by other steps. The construction method of the blockchain-based high-performance tamper-resistant database provided by the present invention in FIG. 1 Just one specific example.
下面结合附图对本发明的技术方案作进一步的描述。The technical solutions of the present invention will be further described below with reference to the accompanying drawings.
本发明将在分布式数据库系统的安全参考结构下,设计了高度灵活的分布式双层数据存储结构,解决了传统数据系统存在单点失效的难题,以及传统区块链架构查询性能低下导致的性能瓶颈。基于双层存储架构,提出了高效的数据自检与节点间互检方法,实现了对底层层数据的防篡改,满足了企业对敏感数据的可信存储需求。提出了模块化可配置的系统架构,满足了系统的扩展性和兼容性。The present invention designs a highly flexible distributed double-layer data storage structure under the security reference structure of the distributed database system, which solves the problem of single-point failure in the traditional data system and the problems caused by the low query performance of the traditional blockchain architecture. performance bottleneck. Based on the double-layer storage architecture, an efficient data self-check and inter-node mutual check method is proposed, which realizes the tamper-proof of the underlying data and satisfies the enterprise's trusted storage requirements for sensitive data. A modular and configurable system architecture is proposed, which satisfies the scalability and compatibility of the system.
下面结合附图对本发明的应用原理作详细的描述。The application principle of the present invention will be described in detail below with reference to the accompanying drawings.
如图4所示,本发明实施例的基于区块链的高性能防篡改数据库的构建方法中包括以下步骤:As shown in FIG. 4 , the method for constructing a blockchain-based high-performance tamper-proof database according to an embodiment of the present invention includes the following steps:
S101:基于分布式对等网络的双层数据库系统结构:S101: Two-tier database system structure based on distributed peer-to-peer network:
S102:低时间复杂度的数据自检与节点间互检方法;S102: Data self-checking and inter-node mutual checking method with low time complexity;
S103:模块化可配置的系统架构;S103: Modular and configurable system architecture;
下面结合具体实施例对本发明包含的上述应用原理作详细的说明。The above application principles included in the present invention will be described in detail below with reference to specific embodiments.
如图5所示,本发明基于分布式对等网络的双层数据库系统结构的步骤如下:As shown in Figure 5, the steps of the present invention based on the double-layer database system structure of the distributed peer-to-peer network are as follows:
步骤1,通过分层设计将数据分为2层; Step 1. Divide the data into 2 layers through hierarchical design;
1a)底层为采用区块链数据结构存储的数据变化增量,顶层是由底层数据变化增量得到的数据最终状态集。底层采用关系型数据库进行结构化存储,顶层可以采用业务所需的数据库类型。在本发明中,将底层和顶层数据库存放在同一个数据库实例中.1a) The bottom layer is the data change increment stored in the blockchain data structure, and the top layer is the final data state set obtained from the bottom layer data change increment. The bottom layer uses a relational database for structured storage, and the top layer can use the database type required by the business. In the present invention, the bottom and top databases are stored in the same database instance.
步骤2,底层为采用区块链数据结构存储的数据变化增量,链式数据结构拥有较高的尾部写入性能; Step 2, the bottom layer is the incremental data change stored in the blockchain data structure, and the chain data structure has high tail write performance;
2a)通过API接受用户的上链请求,将该上链请求以待上链交易的形式在节点间广播,共识出块时间到达时,节点将当前待上链交易打包为区块,遵循区块链数据结构,存储在底层区块链数据库中;2a) Accept the user's on-chain request through the API, and broadcast the on-chain request among nodes in the form of a pending on-chain transaction. When the consensus block time arrives, the node will package the current on-chain transaction into a block and follow the block Chain data structure, stored in the underlying blockchain database;
步骤3,顶层是由底层数据变化增量得到的数据最终状态集,采用块式结构 存储,同时使用B+树建立索引; Step 3, the top layer is the final state set of data obtained by the incremental change of the underlying data, which is stored in a block structure, and uses a B+ tree to establish an index at the same time;
3a)每当节点出块时,或从其他节点获取更新区块时,会将新区块中的数据变化增量复现到顶层状态数据库中,顶层状态数据库为最新状态。利用B+树建立索引;3a) Whenever a node produces a block, or obtains an updated block from other nodes, it will incrementally reproduce the data changes in the new block to the top-level state database, which is the latest state. Use B+ tree to build index;
如图6所示,本发明低时间复杂度的数据自检与节点间互检方法的步骤如下;As shown in FIG. 6 , the steps of the low time complexity data self-checking and inter-node mutual checking method of the present invention are as follows;
步骤1,底层采用区块链数据结构进行存储,通过定期对链式结构的合法性自检,并通过节点间通讯修正被篡改的数据,保证已上链数据的不可篡改性。 Step 1, the bottom layer uses the blockchain data structure for storage, through regular self-checks on the validity of the chain structure, and corrects the tampered data through inter-node communication to ensure that the data on the chain cannot be tampered with.
1a)首先节点进行自检,检查自己的区块链前后哈希是否正确;如果不正确向其周围有物理连接的区块链节点广播请求消息;1a) First, the node performs a self-check to check whether the hash before and after its own blockchain is correct; if it is not correct, it broadcasts a request message to the blockchain nodes with physical connections around it;
请求消息:节点X先其有物理连接的一跳节点(简称邻居节点)广播获取丢失区块的消息Request={Cert_X,t,Nonce,Sign(Sk x,H(Cert_X||t||Nonce))}。其中,Cert_X表示节点X的公钥证书,t当前本地区块链的最大区块编号,Nonce为选取的随机数。 Request message: Node X broadcasts the message to obtain the lost block first to its one-hop node (neighbor node for short) that has a physical connection Request={Cert_X, t, Nonce, Sign(Sk x , H(Cert_X||t||Nonce) )}. Among them, Cert_X represents the public key certificate of node X, t is the maximum block number of the current local blockchain, and Nonce is the selected random number.
响应消息:邻居节点收到Request后,首先通过对其签名信息的验证以保证请求消息来源的真实性和内容的完整性,然后向该请求节点X发送包含丢失区块链的响应消息Response。以其中一邻居节点K为例,Response_K={Cert_K,Block_lost,Nonce+1,Sign(Sk x,H(Cert_K||Block_lost||Nonce+1))}。其中,Cert_K表示响应邻居节点K的公钥证书,Block_lost表示丢弃区块集合Block_lost={Block t+1,…..,Block n}(假设当前全网最新的区块为Block n)。节点X会收到多个邻居节点的应答,通过选取包含最多丢失区块集合且验证合法的响应消息来恢复所有丢失的区块数据。这里的验证包含对区块中链式关系的验证,以及签名消息的验证; Response message: After the neighbor node receives the Request, it first verifies its signature information to ensure the authenticity of the source of the request message and the integrity of the content, and then sends a response message Response containing the missing blockchain to the requesting node X. Taking one of the neighbor nodes K as an example, Response_K={Cert_K, Block_lost, Nonce+1, Sign(Sk x , H(Cert_K||Block_lost||Nonce+1))}. Among them, Cert_K represents the public key certificate responding to the neighbor node K, and Block_lost represents the discarded block set Block_lost={Block t+1 ,  …, Block n } (assuming that the current latest block of the entire network is Block n ). Node X will receive responses from multiple neighbor nodes, and recover all lost block data by selecting the response message that contains the most lost block sets and is valid for verification. The verification here includes the verification of the chain relationship in the block and the verification of the signed message;
步骤2,顶层数据库在对数据进行操作前需要自检; Step 2, the top-level database needs to self-check before operating the data;
2a)节点对顶层数据库计算当前最新状态的哈希值,并将该哈希值进行全网广播,进而借助模块化共识协议确认其顶层数据库状态是当前全网一致的。2a) The node calculates the hash value of the current latest state of the top-level database, broadcasts the hash value to the entire network, and then confirms that the state of its top-level database is consistent across the entire network with the help of the modular consensus protocol.
2b)如果通过共识过程该节点获知当前其顶层数据库的哈希值与全网超过1/2节点不同,那么该节点将调用底层区块链的自检互检过程,对底层与顶层数据库的最新状态进行同步;2b) If the node learns that the current hash value of its top-level database is different from that of the entire network by more than 1/2 through the consensus process, the node will call the self-inspection and mutual-inspection process of the underlying blockchain to update the latest data of the underlying and top-level databases. state synchronization;
2c)如果通过共识过程该节点确认当前其顶层数据库的哈希值与全网超过1/2节点一致,则会继续进行数据库的增删改等操作,这是通过将顶层数据库操作的SQL语句发送到底层区块链数据库网络来实现的。2c) If the node confirms that the current hash value of its top-level database is consistent with more than 1/2 of the nodes in the entire network through the consensus process, it will continue to add, delete, and modify the database. This is done by sending the SQL statement of the top-level database operation to The underlying blockchain database network is implemented.
如图7所示,本发明模块化可配置的系统架构的步骤如下:As shown in Figure 7, the steps of the modular and configurable system architecture of the present invention are as follows:
步骤1,针对底层区块链数据库,支持模块化的共识机制替换方案; Step 1, support a modular consensus mechanism replacement scheme for the underlying blockchain database;
1a)内置兼具安全性与共识效率的基于Raft的共识协议。用户亦可切换到具有更高安全性的PBFT共识协议,或者手动指定出块时间,确保系统运行效率。1a) Built-in Raft-based consensus protocol with both security and consensus efficiency. Users can also switch to the PBFT consensus protocol with higher security, or manually specify the block time to ensure the efficiency of the system.
步骤2,顶层数据库支持以各种接口进行数据访问,兼容各种常见数据库接入; Step 2, the top-level database supports data access through various interfaces, and is compatible with various common database accesses;
2a)包括关系型数据库数据库postgres、mysql等,支持用户以业务需要进行选择。支持查询者使用标准SQL语句提交查询请求,包括筛选、聚类、连接、排序等复杂操作。企业不需要做过多的适配,即可将现有业务系统的后端关系型数据库直接切换为本数据库系统;2a) Including relational database databases such as postgres, mysql, etc., which supports users to choose according to business needs. Support queryers to submit query requests using standard SQL statements, including complex operations such as filtering, clustering, joining, and sorting. Enterprises can directly switch the back-end relational database of the existing business system to this database system without too much adaptation;
步骤3、支持在已有区块链双层架构下。在应用层进行也许所需要的功能性扩展。 Step 3. Support under the existing blockchain double-layer architecture. Functional extensions that may be required are made at the application layer.
3a)该系统内置提供了可插拔地自动清理功能,可自由配置存储近几个月的交易数据,同时选择某一节点保留全部时间的交易数据。旧数据将仅能由滑动窗口功能自动清理,同时没有任何机制能够修改已有数据;3a) The built-in system provides a pluggable automatic cleaning function, which can be freely configured to store transaction data in recent months, and at the same time select a node to retain transaction data for all time. Old data will only be automatically cleaned up by the sliding window function, and there is no mechanism to modify existing data;
与现有技术的对比:Comparison with existing technology:
(1)相比于传统数据库,本发明所设计的基于区块链的防篡改数据库在安全性方面存在显著优势。具体地,传统数据库采用集中式架构,数据的添加、删除、修改均由单个节点完成,无法防止与检测单个节点被攻击者攻破后对数据进行的恶意删除与修改,也无法阻止节点向数据库写入虚假数据。本发明所 设计的基于区块链的防篡改数据库,将区块链与本地数据库结合,可以有效解决传统数据库的安全瓶颈。由于数据被分布存储在网络中的多个节点,本发明可以有效检测、阻止恶意节点对数据的恶意添加、篡改与删除。此外,传统数据库中数据往往存储在单个节点,使得数据面临较为严重的单点失效问题。本发明通过利用区块链技术可以有效解决传统数据库的这一问题。本发明所设计的基于区块链的防篡改数据库与传统数据库的对比情况见表1。与传统数据库相比,本发明所设计的基于区块链的数据库在防篡改,防删除,抗单点失效等方面具有明显优势。(1) Compared with the traditional database, the anti-tampering database based on the block chain designed by the present invention has significant advantages in terms of security. Specifically, the traditional database adopts a centralized architecture, and the addition, deletion and modification of data are completed by a single node, which cannot prevent and detect malicious deletion and modification of data after a single node is compromised by attackers, nor can it prevent nodes from writing to the database. Enter fake data. The tamper-proof database based on the blockchain designed by the present invention combines the blockchain with the local database, which can effectively solve the security bottleneck of the traditional database. Since the data is distributed and stored in a plurality of nodes in the network, the present invention can effectively detect and prevent malicious addition, tampering and deletion of data by malicious nodes. In addition, data in traditional databases are often stored in a single node, which makes the data face a more serious single-point failure problem. The present invention can effectively solve this problem of the traditional database by using the block chain technology. The comparison of the anti-tampering database based on the block chain designed by the present invention and the traditional database is shown in Table 1. Compared with the traditional database, the blockchain-based database designed by the present invention has obvious advantages in anti-tampering, anti-deletion, and anti-single point failure.
表1 本发明项目与传统数据库对比Table 1 The project of the present invention is compared with the traditional database
Figure PCTCN2020107591-appb-000001
Figure PCTCN2020107591-appb-000001
(2)与其他区块链数据库对比(2) Comparison with other blockchain databases
表2.本发明数据库与现有区块链数据库对比Table 2. Comparison between the database of the present invention and the existing blockchain database
Figure PCTCN2020107591-appb-000002
Figure PCTCN2020107591-appb-000002
目前基于区块链的数据库研究与产品相对较少,其中最具代表性的成果为 去中心化的开源公共区块链平台以太坊,以及基于区块链的数据库应用平台ChainSQL。在以太坊中,可以通过平台提供的智能合约实现包括数据存储在内的多种应用,难以实现可插拔等功能,同时数据查询效率较低。而在ChainSQL中,对数据库操作的每一条指令都记录到一条交易中,即一个交易对应一个数据库操作,区块链网络会以交易的形式记录下所有对数据库的操作。对于配置了数据库的区块链节点,在区块链网络记录交易的同时会完成对数据库的操作。对于未配置数据库的网络结点,交易只会记录到本节点的区块中。尽管ChainSQL也实现了基于区块链的数据防篡改存储,且能够实现区块链与传统数据库的结合,但是ChainSQL主要存在以下几个缺点:(1)不能够减轻节点的存储负担;(2)没有考虑链上数据的定期自检与互检。本发明设计的防篡改区块链数据库与ChainSQL的性能对比见表2。与ChainSQL数据库相比,本发明所设计的防篡改数据库在数据可定制化轻量级存储等方便有明显优势。At present, there are relatively few database research and products based on blockchain, among which the most representative achievements are the decentralized open source public blockchain platform Ethereum, and the blockchain-based database application platform ChainSQL. In Ethereum, various applications including data storage can be implemented through the smart contracts provided by the platform, and it is difficult to implement functions such as pluggability, and the data query efficiency is low. In ChainSQL, each instruction of a database operation is recorded in a transaction, that is, a transaction corresponds to a database operation, and the blockchain network records all operations on the database in the form of transactions. For a blockchain node configured with a database, operations on the database are completed while the blockchain network records transactions. For network nodes without database configuration, transactions will only be recorded in the block of this node. Although ChainSQL also implements blockchain-based data tamper-proof storage and can realize the combination of blockchain and traditional databases, ChainSQL mainly has the following shortcomings: (1) It cannot reduce the storage burden of nodes; (2) Periodic self-inspection and mutual inspection of on-chain data are not considered. The performance comparison between the tamper-proof blockchain database designed by the present invention and ChainSQL is shown in Table 2. Compared with the ChainSQL database, the anti-tampering database designed by the present invention has obvious advantages in the convenience of customizable and lightweight storage of data.
在进行功能对比后,对设计的区块链防篡改数据库与现有的区块链数据库服务在吞吐量,单个操作响应时间进行比较,如图10和图11所示。After functional comparison, the designed blockchain tamper-proof database is compared with the existing blockchain database service in throughput and response time of a single operation, as shown in Figure 10 and Figure 11.
测试结果表明,与现有区块链数据库相比,所设计的基于区块链的高性能防篡改数据库系统并发查询性能提升了约70%,并且在百万条记录的数据库中执行增、删、改、查等操作的响应时间不超过100ms。The test results show that, compared with the existing blockchain database, the designed high-performance anti-tampering database system based on blockchain improves the concurrent query performance by about 70%, and performs addition and deletion in the database of millions of records. , change, check and other operations response time does not exceed 100ms.
在数据量对节点自检影响的性能方面,本发明部署了虚拟机进行测试(8核8G),测试的结果如图10所示。随着数据量的增加,节点自检花费的时间也在增加。In terms of the performance of the impact of data volume on node self-checking, the present invention deploys a virtual machine for testing (8 cores and 8G), and the test result is shown in FIG. 10 . As the amount of data increases, so does the time it takes for the node to self-check.
在共识节点数量对节点互检性能方面的影响,本发明部署了虚拟机进行测试(8核8G),测试的结果如图9所示。随着共识数量的增加,节点自检花费的时间也逐渐增加。Regarding the influence of the number of consensus nodes on the mutual inspection performance of nodes, the present invention deploys a virtual machine for testing (8 cores and 8G), and the test results are shown in FIG. 9 . As the number of consensus increases, the time spent on node self-checking also increases gradually.
本发明在分布式数据库系统的安全参考结构下,设计了高度灵活的分布式双层数据存储结构,解决了传统数据系统存在单点失效的难题,以及传统区块链架构查询性能低下导致的性能瓶颈。基于双层存储架构,提出了高效的数据 自检与节点间互检方法,实现了数据的防篡改。提出了模块化可配置的系统架构,满足了系统的扩展性和兼容性。其中方法包括:基于分布式对等网络的双层数据库系统结构:通过分层设计将数据分为两层:底层为采用区块链数据结构存储的数据变化增量,链式数据结构拥有较高的尾部写入性能。顶层是由底层数据变化增量得到的数据最终状态集,采用块式结构存储,同时使用B+树建立索引。低时间复杂度的数据自检与节点间互检方法:底层采用区块链数据结构进行存储,通过定期对链式结构的合法性自检,并通过节点间通讯修正被篡改的数据。顶层存储数据的最终状态,节点在对顶层数据库中的数据进行操作前需要自检以进一步提升系统防篡改性能。模块化可配置的系统架构:提供了可插拔的自动清理功能,支持模块化可插拔的共识机制,支持在已有区块链双层架构下,在应用层进行所需要的功能性扩展。The invention designs a highly flexible distributed double-layer data storage structure under the security reference structure of the distributed database system, and solves the problem of single point failure in traditional data systems and the performance caused by the low query performance of traditional blockchain architecture. bottleneck. Based on the double-layer storage architecture, an efficient data self-check and inter-node mutual check method is proposed, which realizes data tamper-proof. A modular and configurable system architecture is proposed, which satisfies the scalability and compatibility of the system. The methods include: a two-layer database system structure based on a distributed peer-to-peer network: the data is divided into two layers through a layered design: the bottom layer is the data change increment stored in the blockchain data structure, and the chain data structure has higher tail write performance. The top layer is the final state set of data obtained by incremental changes of the underlying data, which is stored in a block structure and indexed using a B+ tree. Data self-checking and inter-node mutual checking method with low time complexity: The bottom layer uses the blockchain data structure for storage, and the tampered data is corrected through regular self-checking of the chain structure's legitimacy through inter-node communication. The final state of the top-level storage data, the node needs to self-check before operating the data in the top-level database to further improve the anti-tampering performance of the system. Modular and configurable system architecture: provides a pluggable automatic cleaning function, supports a modular and pluggable consensus mechanism, and supports the required functional expansion at the application layer under the existing blockchain double-layer architecture .
本方法设计了分布式对等网络的双层数据库系统结构,数据自检与节点间互检的数据校验方法,应用于区块链系统,将其作为一个分布式、不可篡改的数据库系统,用来存储最终的状态数据和区块数据,实现了在双层数据库架构中数据的防篡改和防删除,实现了系统功能的可定制和可扩展,满足了企业对敏感数据可信存储的需求。This method designs a two-layer database system structure of a distributed peer-to-peer network, a data verification method for data self-checking and mutual checking between nodes, and applies it to the blockchain system as a distributed and tamper-resistant database system. It is used to store the final state data and block data, realizes data tamper-proof and anti-deletion in the double-layer database architecture, realizes the customization and expansion of system functions, and meets the needs of enterprises for trusted storage of sensitive data. .
应当注意,本发明的实施方式可以通过硬件、软件或者软件和硬件的结合来实现。硬件部分可以利用专用逻辑来实现;软件部分可以存储在存储器中,由适当的指令执行系统,例如微处理器或者专用设计硬件来执行。本领域的普通技术人员可以理解上述的设备和方法可以使用计算机可执行指令和/或包含在处理器控制代码中来实现,例如在诸如磁盘、CD或DVD-ROM的载体介质、诸如只读存储器(固件)的可编程的存储器或者诸如光学或电子信号载体的数据载体上提供了这样的代码。本发明的设备及其模块可以由诸如超大规模集成电路或门阵列、诸如逻辑芯片、晶体管等的半导体、或者诸如现场可编程门阵列、可编程逻辑设备等的可编程硬件设备的硬件电路实现,也可以用由各种类型的处理器执行的软件实现,也可以由上述硬件电路和软件的结合例如固件来实现。It should be noted that the embodiments of the present invention may be implemented by hardware, software, or a combination of software and hardware. The hardware portion may be implemented using special purpose logic; the software portion may be stored in memory and executed by a suitable instruction execution system, such as a microprocessor or specially designed hardware. Those of ordinary skill in the art will appreciate that the apparatus and methods described above may be implemented using computer-executable instructions and/or embodied in processor control code, for example on a carrier medium such as a disk, CD or DVD-ROM, such as a read-only memory Such code is provided on a programmable memory (firmware) or a data carrier such as an optical or electronic signal carrier. The device and its modules of the present invention can be implemented by hardware circuits such as very large scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., It can also be implemented by software executed by various types of processors, or by a combination of the above-mentioned hardware circuits and software, such as firmware.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,都应涵盖在本发明的保护范围之内。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited to this. Any person skilled in the art is within the technical scope disclosed by the present invention, and all within the spirit and principle of the present invention Any modifications, equivalent replacements and improvements made within the scope of the present invention should be included within the protection scope of the present invention.

Claims (10)

  1. 一种基于区块链的高性能防篡改数据库的构建方法,其特征在于,所述基于区块链的高性能防篡改数据库的构建方法包括:A method for constructing a high-performance anti-tampering database based on blockchain, characterized in that, the method for constructing the high-performance anti-tampering database based on blockchain comprises:
    基于分布式对等网络的双层数据库系统结构:通过分层设计将数据分为两层,底层为采用区块链数据结构存储的数据变化增量,链式数据结构拥有较高的尾部写入性能,顶层是由底层数据变化增量得到的数据最终状态集,采用块式结构存储,同时使用B+树建立索引;Two-layer database system structure based on distributed peer-to-peer network: data is divided into two layers through hierarchical design, the bottom layer is the incremental data change stored in the blockchain data structure, and the chain data structure has a higher tail write Performance, the top layer is the final state set of data obtained by incremental changes in the underlying data, which is stored in a block structure, and uses a B+ tree to build an index;
    低时间复杂度的数据自检与节点间互检方法:底层采用区块链数据结构进行存储,通过定期对链式结构的合法性自检,并通过节点间通讯修正被篡改的数据,顶层存储数据的最终状态,顶层数据库在对数据进行操作前进行自检;Data self-inspection and inter-node mutual inspection method with low time complexity: the bottom layer uses the blockchain data structure for storage, through regular self-inspection of the chain structure's legitimacy, and through inter-node communication to correct the tampered data, the top layer is stored The final state of the data, the top-level database performs self-checks before operating on the data;
    模块化可配置的系统架构:提供了可插拔地自动清理功能,支持模块化的共识机制替换方案,支持在已有区块链双层架构下,在应用层进行所需要的功能性扩展。Modular and configurable system architecture: It provides a pluggable automatic cleaning function, supports a modular consensus mechanism replacement scheme, and supports the required functional expansion at the application layer under the existing blockchain double-layer architecture.
  2. 如权利要求1所述的基于区块链的高性能防篡改数据库的构建方法,其特征在于,所述基于区块链的高性能防篡改数据库的构建方法包括:The method for constructing a high-performance anti-tampering database based on blockchain according to claim 1, wherein the method for constructing the high-performance anti-tampering database based on blockchain comprises:
    (1)基于分布式对等网络的双层数据库系统结构;(1) Double-layer database system structure based on distributed peer-to-peer network;
    (2)低时间复杂度的数据自检与节点间互检方法;(2) Data self-checking and inter-node mutual checking methods with low time complexity;
    (3)模块化可配置的系统架构。(3) Modular and configurable system architecture.
  3. 如权利要求2所述的基于区块链的高性能防篡改数据库的构建方法,其特征在于,所述基于分布式对等网络的双层数据库系统结构包括以下步骤:The method for constructing a blockchain-based high-performance tamper-resistant database according to claim 2, wherein the distributed peer-to-peer network-based double-layer database system structure comprises the following steps:
    步骤一,通过分层设计将数据分为两层;Step 1: Divide the data into two layers through hierarchical design;
    步骤二,底层为采用区块链数据结构存储的数据变化增量,链式数据结构拥有较高的尾部写入性能;Step 2, the bottom layer is the incremental data change stored in the blockchain data structure, and the chain data structure has higher tail write performance;
    步骤三,顶层是由底层数据变化增量得到的数据最终状态集,采用块式结构存储,同时使用B+树建立索引。Step 3: The top layer is the final state set of data obtained by incremental changes of the underlying data, which is stored in a block structure and indexed using a B+ tree.
  4. 如权利要求3所述的基于区块链的高性能防篡改数据库的构建方法,其特征在于,所述步骤一通过分层设计将数据分为两层包括以下步骤:底层为采 用区块链数据结构存储的数据变化增量,顶层是由底层数据变化增量得到的数据最终状态集;底层采用关系型数据库进行结构化存储,顶层采用业务所需的数据库类型。The method for constructing a blockchain-based high-performance tamper-resistant database according to claim 3, wherein the step 1 divides the data into two layers by hierarchical design and includes the following steps: the bottom layer is to use blockchain data Incremental data change in structured storage, the top layer is the final state set of data obtained by incremental data change at the bottom layer; the bottom layer uses a relational database for structured storage, and the top layer uses the database type required by the business.
  5. 如权利要求3所述的基于区块链的高性能防篡改数据库的构建方法,其特征在于,所述步骤二中底层为采用区块链数据结构存储的数据变化增量,链式数据结构拥有较高的尾部写入性能,包括以下步骤:The method for constructing a blockchain-based high-performance tamper-proof database according to claim 3, wherein in the second step, the bottom layer is a data change increment stored in a blockchain data structure, and the chain data structure has High tail write performance, including the following steps:
    (1)通过API接受用户的上链请求;(1) Accept the user's on-chain request through the API;
    (2)将该上链请求以待上链交易的形式在节点间广播;(2) The on-chain request is broadcast among nodes in the form of a pending on-chain transaction;
    (3)共识出块时间到达时,节点将当前待上链交易打包为区块;(3) When the consensus block time arrives, the node will package the current transaction to be listed as a block;
    (4)遵循区块链数据结构,存储在底层区块链数据库中。(4) Follow the blockchain data structure and store in the underlying blockchain database.
  6. 如权利要求3所述的基于区块链的高性能防篡改数据库的构建方法,其特征在于,所述步骤三中顶层是由底层数据变化增量得到的数据最终状态集,采用块式结构存储,同时使用B+树建立索引,拥有较高的查询性能,包括以下步骤:The method for constructing a high-performance anti-tampering database based on blockchain according to claim 3, wherein in the step 3, the top layer is the final state set of data obtained by incremental changes of the bottom layer data, which is stored in a block structure. , while using B+ tree to build index, which has high query performance, including the following steps:
    (1)每当节点出块时,或从其他节点获取更新区块时,会将新区块中的数据变化增量复现到顶层状态数据库中,顶层状态数据库为最新状态;(1) Whenever a node generates a block or obtains an updated block from other nodes, the incremental data changes in the new block will be reproduced to the top-level state database, and the top-level state database will be the latest state;
    (2)利用B+树建立索引。(2) Use the B+ tree to build an index.
  7. 如权利要求2所述的基于区块链的高性能防篡改数据库的构建方法,其特征在于,所述低时间复杂度的数据自检与节点间互检方法包括以下步骤:The method for constructing a blockchain-based high-performance tamper-proof database according to claim 2, wherein the low-time-complexity data self-checking and inter-node mutual checking method comprises the following steps:
    (1)底层采用区块链数据结构进行存储,通过定期对链式结构的合法性自检,并通过节点间通讯修正被篡改的数据;(1) The bottom layer adopts the blockchain data structure for storage, and the tampered data is corrected through the regular self-check of the chain structure's legitimacy and communication between nodes;
    (2)顶层数据库在对数据进行操作前进行自检。(2) The top-level database performs self-inspection before operating the data.
  8. 如权利要求7所述的基于区块链的高性能防篡改数据库的构建方法,其特征在于,所述步骤一中底层采用区块链数据结构进行存储,通过定期对链式结构的合法性自检,并通过节点间通讯修正被篡改的数据,保证已上链数据的不可篡改性;包括以下步骤:The method for constructing a blockchain-based high-performance tamper-proof database according to claim 7, wherein in the step 1, the bottom layer adopts a blockchain data structure for storage, and the validity of the chain structure is automatically checked by periodically checking the validity of the chain structure. Check and correct the tampered data through inter-node communication to ensure that the data on the chain cannot be tampered with; including the following steps:
    (1)首先节点进行自检,检查自己的区块链前后哈希是否正确;如果不正确执行(2);节点在顶层数据库在对数据进行操作前进行自检;包括以下步骤:(1) First, the node performs a self-check to check whether the hash before and after its own blockchain is correct; if it is not performed correctly (2); the node performs a self-check on the top-level database before operating the data; including the following steps:
    节点对顶层数据库计算当前最新状态的哈希值,并将该哈希值进行全网广播,进而借助模块化共识协议确认其顶层数据库状态是当前全网一致的;The node calculates the hash value of the latest state of the top-level database, broadcasts the hash value to the entire network, and then uses the modular consensus protocol to confirm that the state of its top-level database is currently consistent across the entire network;
    如果通过共识过程该节点获知当前其顶层数据库的哈希值与全网超过1/2节点不同,那么该节点将调用底层区块链的自检互检过程,对底层与顶层数据库的最新状态进行同步;If the node learns that the current hash value of its top-level database is different from that of the entire network by more than 1/2 through the consensus process, the node will call the self-inspection and mutual-inspection process of the underlying blockchain to check the latest status of the bottom and top-level databases. Synchronize;
    如果通过共识过程该节点确认当前其顶层数据库的哈希值与全网超过1/2节点一致,则会继续进行数据库的增删改等操作,通过将顶层数据库操作的SQL语句发送到底层区块链数据库网络来实现的;If the node confirms that the current hash value of its top-level database is consistent with more than 1/2 of the nodes in the entire network through the consensus process, it will continue to add, delete, and modify the database, and send the SQL statement of the top-level database operation to the underlying blockchain. Database network to achieve;
    (2)向其周围有物理连接的区块链节点广播请求消息;包括以下步骤:(2) Broadcast a request message to the blockchain nodes with physical connections around it; including the following steps:
    1)请求消息:节点X先其有物理连接的一跳节点广播获取丢失区块的消息Request={Cert_X,t,Nonce,Sign(Sk x,H(Cert_X||t||Nonce))};其中,Cert_X表示节点X的公钥证书,t当前本地区块链的最大区块编号,Nonce为选取的随机数; 1) Request message: Node X first broadcasts the message Request={Cert_X, t, Nonce, Sign(Sk x , H(Cert_X||t||Nonce))}; Among them, Cert_X represents the public key certificate of node X, t is the maximum block number of the current local blockchain, and Nonce is the selected random number;
    2)响应消息:邻居节点收到Request后,首先通过对其签名信息的验证以保证请求消息来源的真实性和内容的完整性,然后向该请求节点X发送包含丢失区块链的响应消息Response;以其中一邻居节点K为例,Response_K={Cert_K,Block_lost,Nonce+1,Sign(Sk x,H(Cert_K||Block_lost||Nonce+1))};其中,Cert_K表示响应邻居节点K的公钥证书,Block_lost表示丢弃区块集合Block_lost={Block t+1,…..,Block n}(假设当前全网最新的区块为Block n),节点X会收到多个邻居节点的应答,通过选取包含最多丢失区块集合且验证合法的响应消息来恢复所有丢失的区块数据,验证包含对区块中链式关系的验证,以及签名消息的验证。 2) Response message: After the neighbor node receives the Request, it first verifies its signature information to ensure the authenticity of the source of the request message and the integrity of the content, and then sends a response message Response containing the missing blockchain to the requesting node X ; Take one of the neighbor nodes K as an example, Response_K={Cert_K, Block_lost, Nonce+1, Sign(Sk x , H(Cert_K||Block_lost||Nonce+1))}; wherein, Cert_K represents the response of the neighbor node K Public key certificate, Block_lost indicates the discarded block set Block_lost={Block t+1 ,..., Block n } (assuming that the latest block of the entire network is Block n ), node X will receive responses from multiple neighbor nodes , restore all lost block data by selecting the response message that contains the most lost block sets and is valid for verification. The verification includes the verification of the chain relationship in the block and the verification of the signed message.
  9. 如权利要求2所述的基于区块链的高性能防篡改数据库的构建方法,其特征在于,所述模块化可配置的系统架构,包括以下步骤:The method for constructing a blockchain-based high-performance tamper-proof database according to claim 2, wherein the modular and configurable system architecture comprises the following steps:
    (1)针对底层区块链数据库,支持模块化的共识机制替换方案,内置兼具安全性与共识效率的基于Raft的共识协议,用户亦可切换到具有更高安全性的PBFT共识协议,或者手动指定出块时间;(1) For the underlying blockchain database, a modular consensus mechanism replacement scheme is supported, and a Raft-based consensus protocol with both security and consensus efficiency is built in. Users can also switch to the PBFT consensus protocol with higher security, or Manually specify the block time;
    (2)顶层数据库支持以各种接口进行数据访问,兼容各种常见数据库接入,包括关系型数据库postgres、mysql,支持用户以业务需要进行选择,支持查询者使用标准SQL语句提交查询请求,包括筛选、聚类、连接、排序复杂操作;(2) The top-level database supports data access through various interfaces, compatible with various common database accesses, including relational databases postgres, mysql, supports users to choose according to business needs, and supports queryers to submit query requests using standard SQL statements, including Filter, cluster, join, sort complex operations;
    (3)提供了可插拔地自动清理功能,可自由配置存储近几个月的交易数据,同时选择某一节点保留全部时间的交易数据,旧数据将仅能由滑动窗口功能自动清理,同时没有任何机制能够修改已有数据;(3) Provides a pluggable automatic cleaning function, which can be freely configured to store transaction data in recent months, and at the same time select a node to retain transaction data for all time, the old data will only be automatically cleaned by the sliding window function, and There is no mechanism to modify existing data;
    提供了可插拔地自动清理功能,自由配置存储近几个月的交易数据,同时选择某一节点保留全部时间的交易数据,包括以下步骤:Provides a pluggable automatic cleaning function, freely configures and stores transaction data in recent months, and selects a node to retain transaction data for all time, including the following steps:
    1)节点根据系统设置的滑动窗口大小检查区块链,发现区块链最近保留的完整的区块数大于滑动窗口的大小,则执行2);1) The node checks the blockchain according to the size of the sliding window set by the system, and finds that the number of complete blocks recently reserved by the blockchain is greater than the size of the sliding window, then execute 2);
    2)保持窗口内的全部区块以及创世区块,其余窗口外的区块删除区块体仅保留区块头。2) Keep all the blocks in the window and the genesis block, and delete the blocks outside the window and only keep the block header.
  10. 一种如权利要求1~9任意一项所述基于区块链的高性能防篡改数据库的构建方法构建的数据库。A database constructed by the method for constructing a blockchain-based high-performance tamper-proof database according to any one of claims 1 to 9.
PCT/CN2020/107591 2020-08-05 2020-08-07 Blockchain-based high-performance tamper-proof database construction method WO2022027530A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/505,994 US20220043928A1 (en) 2020-08-05 2021-10-20 Method of constructing high-performance anti-tampering database based on blockchain

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010779632.8A CN112115116B (en) 2020-08-05 2020-08-05 Construction method of high-performance tamper-proof database based on blockchain
CN202010779632.8 2020-08-05

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/505,994 Continuation-In-Part US20220043928A1 (en) 2020-08-05 2021-10-20 Method of constructing high-performance anti-tampering database based on blockchain

Publications (1)

Publication Number Publication Date
WO2022027530A1 true WO2022027530A1 (en) 2022-02-10

Family

ID=73799328

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/107591 WO2022027530A1 (en) 2020-08-05 2020-08-07 Blockchain-based high-performance tamper-proof database construction method

Country Status (2)

Country Link
CN (1) CN112115116B (en)
WO (1) WO2022027530A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615286A (en) * 2022-03-15 2022-06-10 上海万向区块链股份公司 Carbon-general service data circulation method and system based on cross-chain technology
CN115118737A (en) * 2022-08-25 2022-09-27 南京信息工程大学 Alliance chain block storage method based on node grouping
CN115297009A (en) * 2022-07-08 2022-11-04 中电信数智科技有限公司 Block chain-based distributed network digital encryption consistency optimization method
CN115766217A (en) * 2022-11-15 2023-03-07 武汉大学 Communication service topology authentication system and method for power grid safety and stability control system
CN116668466A (en) * 2023-08-02 2023-08-29 北京滴普科技有限公司 Internet-based carbon asset information cloud synchronization method
CN117149915A (en) * 2023-10-31 2023-12-01 湖南三湘银行股份有限公司 Method for migrating cloud database to open source database

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168685B (en) * 2021-12-15 2023-07-18 北京天德科技有限公司 Novel database architecture based on blockchain system and operation method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106775619A (en) * 2016-11-12 2017-05-31 杭州复杂美科技有限公司 Flexible block chain framework
CN107657059A (en) * 2017-10-20 2018-02-02 中国银行股份有限公司 Method of data synchronization, middleware and system based on block chain application system
US20180227119A1 (en) * 2017-02-09 2018-08-09 International Business Machines Corporation Managing a database management system using a blockchain database
CN108881163A (en) * 2017-05-16 2018-11-23 江峰 A kind of multicenter block catenary system with block issue mechanism
CN109815746A (en) * 2019-01-11 2019-05-28 西安企业资本服务中心有限公司 A kind of data tamper resistant method and system based on block chain technology
CN110365695A (en) * 2019-07-24 2019-10-22 中国工商银行股份有限公司 The block chain data interactive method and device of changeable common recognition algorithm

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11977537B2 (en) * 2018-12-28 2024-05-07 Hefei Dappworks Technology Co., Ltd. Method and device of processing data for blockchain, and blockchain system
CN111125787B (en) * 2019-12-27 2022-04-22 上海共链信息科技有限公司 Gas inspection data cochain system based on block chain and use method thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106775619A (en) * 2016-11-12 2017-05-31 杭州复杂美科技有限公司 Flexible block chain framework
US20180227119A1 (en) * 2017-02-09 2018-08-09 International Business Machines Corporation Managing a database management system using a blockchain database
CN108881163A (en) * 2017-05-16 2018-11-23 江峰 A kind of multicenter block catenary system with block issue mechanism
CN107657059A (en) * 2017-10-20 2018-02-02 中国银行股份有限公司 Method of data synchronization, middleware and system based on block chain application system
CN109815746A (en) * 2019-01-11 2019-05-28 西安企业资本服务中心有限公司 A kind of data tamper resistant method and system based on block chain technology
CN110365695A (en) * 2019-07-24 2019-10-22 中国工商银行股份有限公司 The block chain data interactive method and device of changeable common recognition algorithm

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DI JIAN, RUIDI JI: "Microgrid Operating And Scheduling Model Based On Double-layer Blockchain", INTERNATIONAL CORE JOURNAL OF ENGINEERING, BOYA CENTURY PUBLISHING LIMITED, vol. 5, no. 10, 30 April 2019 (2019-04-30), XP055895322, ISSN: 2414-1895, DOI: 10.6919/ICJE.201909_5(10).0001 *
DING QINGYANG, JIANMING ZHU, JIN ZHANG, BIAO SONG, YANJING XU, CHUANCHANG JIA, ZHENG GAO: "Traceability permissioned chain consensus mechanism based on double-layer architecture", CHINESE JOURNAL OF NETWORK AND INFORMATION SECURITY, vol. 5, no. 2, 30 April 2019 (2019-04-30), pages 1 - 12, XP055895320, ISSN: 2096-109X, DOI: 10.11959/j.issn.2096−109x.2019011 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615286A (en) * 2022-03-15 2022-06-10 上海万向区块链股份公司 Carbon-general service data circulation method and system based on cross-chain technology
CN114615286B (en) * 2022-03-15 2024-01-02 上海万向区块链股份公司 Cross-chain technology-based carbon universal service data flow method and system
CN115297009A (en) * 2022-07-08 2022-11-04 中电信数智科技有限公司 Block chain-based distributed network digital encryption consistency optimization method
CN115297009B (en) * 2022-07-08 2023-11-17 中电信数智科技有限公司 Digital encryption consistency optimization method based on blockchain distributed network
CN115118737A (en) * 2022-08-25 2022-09-27 南京信息工程大学 Alliance chain block storage method based on node grouping
CN115766217A (en) * 2022-11-15 2023-03-07 武汉大学 Communication service topology authentication system and method for power grid safety and stability control system
CN115766217B (en) * 2022-11-15 2024-04-30 武汉大学 Communication service topology authentication system and method for power grid safety and stability control system
CN116668466A (en) * 2023-08-02 2023-08-29 北京滴普科技有限公司 Internet-based carbon asset information cloud synchronization method
CN116668466B (en) * 2023-08-02 2023-10-13 北京滴普科技有限公司 Internet-based carbon asset information cloud synchronization method
CN117149915A (en) * 2023-10-31 2023-12-01 湖南三湘银行股份有限公司 Method for migrating cloud database to open source database
CN117149915B (en) * 2023-10-31 2024-03-29 湖南三湘银行股份有限公司 Method for migrating cloud database to open source database

Also Published As

Publication number Publication date
CN112115116A (en) 2020-12-22
CN112115116B (en) 2024-04-16

Similar Documents

Publication Publication Date Title
WO2022027530A1 (en) Blockchain-based high-performance tamper-proof database construction method
US11899684B2 (en) System and method for maintaining a master replica for reads and writes in a data store
US11894972B2 (en) System and method for data replication using a single master failover protocol
US10956601B2 (en) Fully managed account level blob data encryption in a distributed storage environment
US10929240B2 (en) System and method for adjusting membership of a data replication group
US20210182190A1 (en) Intelligent die aware storage device scheduler
US9965364B2 (en) Fault tolerant listener registration in the presence of node crashes in a data grid
US9411873B2 (en) System and method for splitting a replicated data partition
EP4254183A1 (en) Transaction processing method and apparatus, computer device, and storage medium
US10248704B2 (en) System and method for log conflict detection and resolution in a data store
US9489434B1 (en) System and method for replication log branching avoidance using post-failover rejoin
WO2020108289A1 (en) Database system, node and method
US10275400B1 (en) Systems and methods for forming a fault-tolerant federated distributed database
US11250019B1 (en) Eventually consistent replication in a time-series database
Wei et al. A survey of blockchain data management systems
US11263270B1 (en) Heat balancing in a distributed time-series database
CN111241589A (en) Database system, node and method
US11409771B1 (en) Splitting partitions across clusters in a time-series database
CN111241590A (en) Database system, node and method
US10853370B2 (en) Devices and/or methods to provide a query response based on ephemeral data
JP7416768B2 (en) Methods, apparatus and systems for non-destructively upgrading distributed coordination engines in distributed computing environments
WO2020108288A1 (en) Database system, node, and method
US20220043928A1 (en) Method of constructing high-performance anti-tampering database based on blockchain
WO2023147469A1 (en) Restoring lost data
CN116414848A (en) Database master-slave copy consistency verification method and device and computer equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20948612

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20948612

Country of ref document: EP

Kind code of ref document: A1