A tree-shaped blockchain generation method and device for improving blockchain transaction throughput

By introducing a tree structure into the blockchain, dividing the global chain and contract chain, and grouping transactions by transaction type, the technical bottlenecks of traditional blockchain in transaction performance and business expansion are solved, and efficient transaction processing and Throughput increases.

CN114064802BActive Publication Date: 2025-02-11CHINA ZHESHANG BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111280167.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-29
Publication Date
2025-02-11
Estimated Expiration
2041-10-29

AI Technical Summary

Technical Problem

The traditional single-chain structure of blockchain has technical bottlenecks in transaction performance and business expansion, and cannot meet the complex and diversified business needs.

Method used

By using the tree-shaped blockchain generation method, by dividing the accounts in the blockchain into user accounts and smart contract accounts, establishing a global chain and contract chain, and grouping them by transaction type during the transaction packaging stage, selecting contract deployment transactions as a fork Points form a blockchain in a tree-like form.

Benefits of technology

It realizes effective isolation and classification management of data on chains of various businesses, improves transaction processing efficiency, and improves transaction throughput.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064802B_ABST
    Figure CN114064802B_ABST
Patent Text Reader

Abstract

The present invention discloses a tree-shaped blockchain generation method and device for improving the transaction throughput of blockchain. The blockchain structure includes a global chain and a contract chain. The global chain is composed of blocks containing non-contract call transactions initiated by users, and the contract chain is composed of blocks containing contract call transactions initiated by users; the block where the contract deployment transaction is located is selected as the fork point; the transactions are packaged into different blocks according to the transaction type; when each block is generated, the global chain or contract chain identifier and the fork identifier are written, and the latest block of the corresponding chain is found as the parent block through the chain identifier and the fork identifier; the above operations are cycled to finally form a tree-shaped blockchain. Based on the tree-shaped blockchain structure, when the blockchain nodes reach a transaction consensus, the transaction verification for the global chain and the contract chain can be processed in parallel. The method of the present invention can firstly realize the effective isolation and classification management of various types of business chain data, and secondly, effectively improve the transaction processing efficiency and improve the transaction throughput.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer systems and blockchain technology, and in particular to a tree-shaped blockchain generation method and device for improving blockchain transaction throughput. Background Art

[0002] As an emerging distributed accounting technology, blockchain combines data blocks into a chain data structure by connecting them in chronological order, and uses cryptography to ensure that the data cannot be tampered with, forged, and traceable. By applying blockchain technology, the integrity and reliability of information can be guaranteed, and the trust and security issues in the process of information interaction can be effectively resolved. At present, blockchain technology has been widely used in finance, justice, government affairs, medical care, public welfare and other fields.

[0003] At present, mainstream blockchains including FISCO BCOS and Hyperledger Fabric are all single-chain structures, which process all on-chain business transactions on one chain. Although it is easy to manage account data, it is difficult to achieve classified management and data isolation of different on-chain businesses, and it limits transaction performance. Therefore, traditional single-chain blockchains have technical bottlenecks in transaction performance and business expansion, and cannot meet the complex and diversified business needs of real-world scenarios. Summary of the invention

[0004] The purpose of the present invention is to provide a tree-shaped blockchain generation method and device for improving blockchain transaction throughput in view of the deficiencies in the prior art.

[0005] To achieve the above object, the present invention has the following technical solutions:

[0006] On one hand, the present invention provides a tree-shaped blockchain generation method for improving blockchain transaction throughput, the method comprising:

[0007] Divide the accounts in the blockchain into user accounts and smart contract accounts;

[0008] The blockchain structure includes a global chain and a contract chain. The global chain consists of blocks containing non-contract call transactions initiated by users, and the contract chain consists of blocks containing contract call transactions initiated by users.

[0009] The block where the contract deployment transaction is located is selected as the fork point. This block becomes the parent block of the next block consisting of non-contract call transactions and the next block consisting of contract call transactions that call the contract.

[0010] In the transaction packaging stage, transactions are grouped into different blocks according to transaction types;

[0011] When each block is generated, the global chain or contract chain ID and fork ID are written in, and the latest block of the corresponding chain is found as the parent block through the chain ID and fork ID.

[0012] The above operations are repeated to eventually form a tree-like blockchain.

[0013] Furthermore, the accounts in the blockchain include two types of accounts: external accounts, which are controlled by the user's public-private key pair, referred to as user accounts in this article, and are identified by account addresses; smart contract accounts, which are accounts that store smart contract codes and are identified by contract addresses.

[0014] Furthermore, in the blockchain structure including the global chain and the contract chain, transactions occurring on the blockchain can be divided into three categories. The first category is regular transactions, in which the transaction specifies the sender account address and the receiver account address; the second category is contract deployment transactions, in which the transaction specifies the contract creator account address and an empty receiver address; the third category is contract call transactions, in which the transaction specifies the sender account address and the contract address to be called; the first and second categories of transactions are divided into non-contract call transactions, and the third category of transactions is divided into contract call transactions. Blocks composed of non-contract call transactions are sequentially connected to form a global chain, and blocks composed of contract call transactions are sequentially connected to form a contract chain; transactions between the global chain and the contract chain, and transactions between contract chains do not affect each other.

[0015] Furthermore, the structure of the block includes a block header and a block body, wherein the block header contains information such as block hash, parent block hash, chain identifier, fork identifier, block height, etc., wherein the chain identifier field marks the global chain or contract chain to which the block belongs, the fork identifier field marks whether the block is a fork point, and the block height is the height of the global chain / contract chain to which the block belongs; the block body contains all packaged transaction information, and the transaction body contains information such as transaction hash, transaction type, sender address, receiver address, transaction payload, etc. Transaction types are divided into regular transactions, contract deployment transactions, and contract call transactions. The sender address of regular transactions is the sender account address, and the receiver address is the receiver account address. The sender address of contract deployment transactions is the contract creator account address, and the receiver address is empty. The sender address of contract call transactions is the contract caller address, and the receiver address is the contract address to be called.

[0016] Furthermore, the block where the contract deployment transaction is located is selected as the fork point, and during the transaction packaging process, the contract deployment transaction is selected and packaged into a block separately. This block serves as the fork point and becomes the parent block of the next block composed of non-contract call transactions and the next block composed of contract call transactions that call the contract.

[0017] Furthermore, in the transaction packaging stage, transactions are grouped by transaction type and packaged into different blocks. Specifically, transaction types are divided into contract call transactions and non-contract call transactions. At the same time, contract call transactions are divided according to the corresponding different contracts, and non-contract call transactions are divided according to regular transactions and contract deployment transactions. Transactions divided into different groups are packaged separately.

[0018] Furthermore, the generated blocks are packaged, and each block writes the identifier of the global chain or contract chain according to the type of transactions contained in it. If it is a forked block, the fork identifier is written. The latest block of the corresponding global chain or contract chain is found as the parent block through the chain identifier and the fork identifier. Specifically, the block node with the largest block height in the branch chain is found as the parent block through the graph search algorithm.

[0019] Furthermore, the identifier of the global chain can be represented by the genesis block address or a "global" string, the identifier of the contract chain can be represented by a contract name, and the fork identifier can be represented by a contract name.

[0020] Furthermore, the tree-like blockchain that is ultimately formed includes a main chain consisting of blocks identified by the global chain and a branch chain consisting of blocks identified by the contract chain.

[0021] Another aspect of the present invention provides a computer device, comprising: a memory and a processor; the memory stores a computer program that can be executed by the processor; when the processor executes the computer program, the steps of the above-mentioned tree-shaped blockchain generation method are executed.

[0022] The beneficial effects of the present invention are: based on the tree-shaped blockchain structure constructed by the method of the present invention, when the blockchain nodes reach a consensus on a transaction, the transaction verification for the global chain and the contract chain can be processed in parallel. The present invention can firstly realize the effective isolation and classification management of various types of business on-chain data, and secondly, effectively improve the transaction processing efficiency and increase the transaction throughput. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 This is a schematic diagram of a tree-shaped blockchain structure according to one embodiment of the present invention;

[0025] Figure 2 This is a schematic diagram of a blockchain block structure according to one embodiment of the present invention;

[0026] Figure 3 This is a flowchart of a tree-shaped blockchain generation according to one embodiment of the present invention. DETAILED DESCRIPTION

[0027] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention, and are not used to limit the present invention.

[0028] The embodiment of the present invention provides a tree-shaped blockchain structure, such as Figure 1 As shown, in the solution provided by the present invention, the blockchain structure is a tree structure, including a global chain and a contract chain. In the figure, blocks 1, 2, 3, 4, and 5 belong to the global chain, blocks A1, A2, and A3 belong to contract chain A, blocks B1 and B2 belong to contract chain B, and blocks 2 and 3 are fork points.

[0029] The embodiment of the present invention provides a block structure of a blockchain, such as Figure 2 As shown in the figure, the block structure includes a block header and a block body. The block header contains information such as block hash, parent block hash, chain identifier, fork identifier, block height, etc., wherein the chain identifier field marks the global chain or contract chain to which the block belongs. The global chain identifier can be represented by the genesis block address or the "global" string, the contract chain identifier can be represented by the contract name, the fork identifier field marks whether the block is a fork point, which can be represented by the contract name, and the block height is the height of the global chain / contract chain where the block is located; the block body contains all packaged transaction information, and the transaction body contains information such as transaction hash, transaction type, sender address, receiver address, transaction payload, etc. as shown in the figure. The transaction types are divided into regular transactions, contract deployment transactions, and contract call transactions. The sender address of regular transactions (such as transfers) is the sender account address, and the receiver address is the receiver account address. The sender address of contract deployment transactions is the contract creator account address, and the receiver address is empty. The sender address of contract call transactions is the contract caller address, and the receiver address is the contract address to be called.

[0030] The embodiment of the present invention provides a tree-shaped blockchain generation method, the flow chart is as follows: Figure 3 As shown, the steps include:

[0031] Receive transactions from clients;

[0032] Group transactions by transaction type, and package each group of transactions into a block after they meet the packaging conditions. Group transactions into three types: regular transactions, contract deployment transactions, and contract call transactions. Contract deployment transactions are packaged according to the rule of one block per transaction, while regular transactions and contract call transactions are packaged according to control rules such as transaction quantity, block size, and transaction time.

[0033] After the block is packaged, the chain ID and fork ID are written, and the parent block is found through the chain ID and fork ID. Figure 1 For example, there are two cases for a newly generated block to find its parent block:

[0034] The first is that the newly generated block in the global chain looks for the parent block. For example, when block 4 is generated, the latest block of the global chain is queried through the chain identifier, and block 3 is found as the parent block of block 4.

[0035] The second method is to find the parent block of the newly generated block in the contract chain. First, query the latest block of the contract chain to which it belongs through the chain identifier. If it exists, it will be used as the parent block. For example, block A2 finds block A1 as the parent block. If it does not exist, it means that the block is the first block of the contract chain. It is necessary to query the fork point, as shown in block A1. At this time, by looking for the fork identifier, the fork point block 2 can be found as the parent block;

[0036] The above steps are repeated to eventually form a tree-like blockchain. The blockchain as a whole has a tree-like structure, consisting of a main chain composed of blocks identified by the global chain and branch chains composed of blocks identified by the contract chain.

[0037] The present invention can deploy different contract chains for chain-on-chain scenarios of different types of businesses, thereby realizing effective isolation and classified management of chain-on-chain data of various types of businesses; at the same time, transaction consensus can be carried out in parallel for blocks on different chains, thereby effectively improving transaction processing efficiency and increasing transaction throughput.

[0038] In one embodiment, a computer device is proposed, including a memory and a processor, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the processor executes the steps in the tree-shaped blockchain generation method in the above embodiments.

[0039] In one embodiment, a storage medium storing computer-readable instructions is proposed. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps in the tree-shaped blockchain generation method in each of the above embodiments. The storage medium may be a non-volatile storage medium.

[0040] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0041] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A tree-shaped blockchain generation method for improving blockchain transaction throughput, characterized in that: The method includes: Divide the accounts in the blockchain into user accounts and smart contract accounts; The blockchain structure includes a global chain and a contract chain. The global chain consists of blocks containing non-contract call transactions initiated by users, and the contract chain consists of blocks containing contract call transactions initiated by users. The block where the contract deployment transaction is located is selected as the fork point. This block becomes the parent block of the next block consisting of non-contract call transactions and the next block consisting of contract call transactions that call the contract. In the transaction packaging stage, transactions are grouped into different blocks according to transaction types; When each block is generated, the global chain or contract chain ID and fork ID are written in, and the latest block of the corresponding chain is found as the parent block through the chain ID and fork ID. The above operations are repeated to eventually form a tree-like blockchain.

2. According to claim 1, a tree-shaped blockchain generation method for improving blockchain transaction throughput is characterized in that: The accounts in the blockchain include two types of accounts: external accounts, which are controlled by the user's public and private key pairs, i.e. user accounts, identified by account addresses; and smart contract accounts, which are accounts that store smart contract codes, identified by contract addresses.

3. According to claim 1, a tree-shaped blockchain generation method for improving blockchain transaction throughput is characterized in that: The blockchain structure includes a global chain and a contract chain. Transactions on the blockchain are divided into three categories: The first type is a regular transaction, where the transaction specifies the sender account address and the receiver account address; The second type is a contract deployment transaction, which specifies the contract creator account address and an empty recipient address; The third type is a contract call transaction, which specifies the sender's account address and the contract address to be called; The first and second categories of transactions are classified as non-contract call transactions, and the third category of transactions are classified as contract call transactions. Blocks consisting of non-contract call transactions are sequentially connected to form a global chain, and blocks consisting of contract call transactions are sequentially connected to form a contract chain; transactions between the global chain and the contract chain, and transactions between contract chains do not affect each other.

4. A tree-shaped blockchain generation method for improving blockchain transaction throughput according to claim 1, characterized in that: The structure of the block includes a block header and a block body; The block header contains block hash, parent block hash, chain identifier, fork identifier, and block height information, wherein the chain identifier field marks the global chain or contract chain to which the block belongs, the fork identifier field marks whether the block is a fork point, and the block height is the height of the global chain / contract chain where the block is located; The block body contains all packaged transaction information. The transaction body contains transaction hash, transaction type, sender address, receiver address, and transaction payload information. The transaction types are divided into regular transactions, contract deployment transactions, and contract call transactions. The sender address of regular transactions is the sender account address, and the receiver address is the receiver account address. The sender address of contract deployment transactions is the contract creator account address, and the receiver address is empty. The sender address of contract call transactions is the contract caller address, and the receiver address is the contract address to be called.

5. A tree-shaped blockchain generation method for improving blockchain transaction throughput according to claim 1, characterized in that: The block where the contract deployment transaction is located is selected as the fork point. During the transaction packaging process, the contract deployment transaction is selected and packaged into a block separately. This block serves as the fork point and becomes the parent block of the next block composed of non-contract call transactions and the next block composed of contract call transactions that call the contract.

6. A tree-shaped blockchain generation method for improving blockchain transaction throughput according to claim 1, characterized in that: In the transaction packaging stage, transactions are grouped by transaction type and packaged into different blocks. Specifically, transaction types are divided into contract call transactions and non-contract call transactions. At the same time, contract call transactions are divided according to the corresponding different contracts, and non-contract call transactions are divided according to regular transactions and contract deployment transactions. Transactions divided into different groups are packaged separately.

7. A tree-shaped blockchain generation method for improving blockchain transaction throughput according to claim 1, characterized in that: The generated blocks are packaged, and each block is written with the identifier of the global chain or contract chain according to the type of transactions contained. If it is a forked block, the fork identifier is written. The latest block of the corresponding global chain or contract chain is found as the parent block through the chain identifier and fork identifier. Specifically, the block node with the largest block height in the branch chain is found as the parent block through the graph search algorithm.

8. A tree-shaped blockchain generation method for improving blockchain transaction throughput according to claim 1, characterized in that: The identifier of the global chain can be represented by the genesis block address or the "global" string, the identifier of the contract chain can be represented by the contract name, and the fork identifier can be represented by the contract name.

9. A tree-shaped blockchain generation method for improving blockchain transaction throughput according to claim 1, characterized in that: The tree-like blockchain that is ultimately formed includes a main chain consisting of blocks identified by the global chain and a branch chain consisting of blocks identified by the contract chain.

10. A computer device comprising: Memory and processor; The memory stores a computer program executable by the processor; When the processor runs the computer program, the processor performs the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Blockchain transaction processing method, device, and storage medium

    CN108596613A

  • Methods, blockchain nodes, and storage media for deploying smart contract

    US20210319438A1