A Blockchain Storage Optimization Method Based on Dynamic Variable-Width Algorithm

Through dynamic widening algorithms, the blockchain storage structure is optimized, and the problem of low performance of blockchain networks at high transaction frequency is solved, and transaction processing performance is improved and network security is guaranteed.

CN114168598BActive Publication Date: 2025-07-29HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111515828.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2025-07-29
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

Existing blockchain consensus algorithms such as PoW and PBFT have low performance at high transaction frequency, and directed acyclic graph storage structure is difficult to ensure security and convergence during the expansion process, resulting in a decline in blockchain network transaction processing performance.

Method used

The dynamic widening algorithm is used to dynamically change the width of the blockchain storage structure according to the network transaction density, forming a directional acyclic graph that is continuously generated. Through dynamic teaming and global consensus mechanisms between nodes, the width is divergent when transactions are dense, and the width is converged when sparse, and the transaction processing performance is improved.

Benefits of technology

Through dynamic widening algorithms, the blockchain storage structure is optimized, and the peak improvement of transaction processing performance at high transaction frequency is achieved, and network security and stability are maintained.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114168598B_ABST
    Figure CN114168598B_ABST
Patent Text Reader

Abstract

The present invention belongs to the fields of distributed storage technology of computer systems, blockchain technology, and network communication technology, and discloses a blockchain performance optimization method based on a dynamic variable-width algorithm. The blockchain storage structure uses the dynamic variable-width algorithm, that is, the width of the blockchain storage structure changes dynamically according to the network transaction density; the storage structure is a continuously generated directed acyclic graph; the width of the blockchain storage structure is the number of nodes without out-degree in the directed acyclic graph, which can also be referred to as the current number of blockchain network shards; the blockchain network shard is a shard formed by blockchain nodes spontaneously networking peer-to-peer; the transaction density is a proportionality coefficient that is positively correlated with the number of blockchain network transactions per unit time; nodes perform transaction confirmation through this dynamic variable-width algorithm to reach a consensus. The present invention divides the blockchain into multiple sub-shards, enabling the blockchain to have a variable width attribute, and improving the peak performance of blockchain transaction processing through parallelization of the consensus mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical fields of distributed storage technology of computer systems, blockchain technology, and network communication technology, and particularly relates to a blockchain storage optimization method based on a dynamic variable-width algorithm. Background Art

[0002] Blockchain is a decentralized distributed ledger storage technology that plays an important role in fields such as logistics, justice, government affairs, and finance. With the diversification of application scenarios, the on-chain transaction data and frequency show a gradually increasing trend, posing higher requirements for on-chain transaction confirmation latency and throughput. The main bottleneck lies in the consensus algorithm of the blockchain.

[0003] Currently, the more popular consensus algorithms mainly include the PoW algorithm based on proof of work and the PBFT algorithm based on the Byzantine fault tolerance problem. Among them, the PoW algorithm is the consensus algorithm adopted by Bitcoin. Due to its unique proof-of-work mechanism that requires wasting a large amount of computing resources, it is relatively inefficient. The PBFT algorithm based on Byzantine fault tolerance does not require a large amount of computing resources. While ensuring availability and security, it provides a fault tolerance of at most (n - 1) / 3 and maintains a relatively high-efficiency consensus.

[0004] Specifically, the PBFT consensus algorithm stipulates that there is a node selected as the primary node in the blockchain system, and other nodes are called secondary nodes. All nodes in the system communicate with each other and finally reach a consensus on the data. Although PBFT reduces the complexity of the original Byzantine fault tolerance algorithm from exponential to polynomial, since each PBFT consensus requires all nodes in the network to participate in the interaction, the communication complexity is still relatively high. As the number of nodes increases, the transaction processing performance of the blockchain network using the PBFT consensus algorithm will decline sharply.

[0005] Similarly, a directed acyclic graph can replace the blockchain as the storage structure of the distributed ledger, and improve the transaction processing performance of the distributed ledger by means of parallelizing the storage process. A directed acyclic graph is a directed graph from which it is impossible to return to a point after passing through several edges starting from any node. Different from the chain structure, there is one or more reachable paths from one node to another node in the directed acyclic graph, which also means that a node may have multiple different predecessors and successors. Using this storage structure to replace the traditional chain structure of the distributed ledger, expansion can be carried out from different nodes at the same time, which can greatly improve the efficiency of ledger maintenance.

[0006] Currently, the distributed ledger storage based on the directed acyclic graph can maintain the topological structure of the directed acyclic graph within a controllable dynamic range on the premise of providing excellent block generation efficiency. However, due to the abandonment of the chained storage structure, some insurmountable disadvantages are also brought: to improve security, the distributed ledger storage based on the directed acyclic graph includes centralized functions, such as coordinators or preselected verifiers, which makes the entire network more vulnerable to manipulation and thus face security challenges; although the directed acyclic graph can maintain a certain width range during the expansion process, it is difficult to converge into a single chain, so the finality is difficult to guarantee. The directed acyclic graph cannot replace the blockchain, nor can it directly solve the performance degradation problem in the blockchain network using the PBFT consensus algorithm. Summary of the Invention

[0007] The purpose of the present invention is to provide an optimization method for blockchain storage based on a dynamic variable-width algorithm to solve the above technical problems.

[0008] To solve the above technical problems, the specific technical solution of an optimization method for blockchain storage based on a dynamic variable-width algorithm of the present invention is as follows:

[0009] A blockchain performance optimization method based on a dynamic variable-width algorithm, wherein the blockchain storage structure uses the dynamic variable-width algorithm, that is, the width of the blockchain storage structure changes dynamically according to the network transaction density; the storage structure is a continuously generated directed acyclic graph; the width of the blockchain storage structure is the number of nodes without out-degree in the directed acyclic graph, which can also be called the current number of shards in the blockchain network; the blockchain network shard is a shard formed by blockchain nodes spontaneously networking peer-to-peer; the transaction density is a proportionality coefficient positively correlated with the number of transactions in the blockchain network per unit time; the node is a node in the blockchain network that initiates, transmits, and verifies transactions, and the node reaches a consensus through transaction confirmation by the dynamic variable-width algorithm.

[0010] Furthermore, the participants in the dynamic variable-width algorithm are N blockchain nodes, N≥3; the nodes have the network information interaction ability and general computing ability between any two points; the network information interaction ability enables all blockchain nodes to initiate and transmit transactions through the network; the general computing ability enables all blockchain nodes to perform asymmetric encryption and decryption calculations, and then verify the authenticity of the transactions; the authenticity of the transactions means that the nodes can verify the transaction digital signatures through asymmetric encryption and decryption calculations; the blockchain nodes complete the transaction consensus based on the dynamic variable-width algorithm through the following steps:

[0011] Step 1: Initiate a transaction: The node initiates a transaction in order to obtain the consensus result for this transaction.

[0012] Step 2: Receive Messages: After a node receives a transaction through its network information interaction ability, it performs subsequent processing according to different transaction types;

[0013] Step 3: Node Grouping: When the number of newly collected and verified transactions by nodes in the blockchain network exceeds the specified grouping threshold, the node will initiate a grouping request to form a group and reach a consensus on generating a new block;

[0014] Step 4: Node Consensus: The successfully grouped nodes generate a new block to confirm the new transactions;

[0015] Step 5: Global Consensus: When a node receives a new block each time, it resets its timeout timer. When the timer of the node reaches the upper limit of the block production time, it will attempt to connect to the specified global leader node in round-robin order and try to reach a global consensus; if the connection times out, it will contact the next global leader node in round-robin order and broadcast; the global leader node refers to the leader node in the global consensus process. This node collects and verifies new transactions before global block production, and then initiates a global grouping request to perform global grouping and generate a new block.

[0016] Further, Step 1 includes the following specific steps:

[0017] The node initiates a transaction through broadcasting and enters a waiting state after completing the broadcast of the transaction to other nodes in the blockchain network.

[0018] Further, Step 2 includes the following specific steps:

[0019] The node verifies the transaction message, puts the verified transactions into the transaction pool, and discards the transactions that do not pass the verification. The verification process should be adjusted according to the specific business scenario.

[0020] Further, Step 3 includes the following specific steps:

[0021] The node contacts all initiators of new transactions and asks if they agree to form a group. Nodes that have not formed a group will return a message agreeing to form a group, and nodes that have already formed a group will return a message disagreeing to form a group. When the number of messages agreeing to form a group received by the node reaches the specified block production threshold, the node forms a shard with the nodes that agree to form a group and proceeds to the node consensus step.

[0022] Further, Step 4 includes the following specific steps:

[0023] The new block consists of two parts: a block header and a block body. The block header contains the hash value of the previous block of all successfully grouped nodes' local blockchains, and the block body includes all new transactions. At this stage, all nodes participating in the grouping synchronize all included but locally unknown blocks until they trace back to the previous global consensus; the consensus on the block within the group adopts the general consensus algorithm required by the business.

[0024] Further, Step 5 includes the following specific steps:

[0025] The global teaming request is that the global team leader node contacts all other nodes to ask if they agree to team up. Nodes that are not yet teamed up will return a message agreeing to team up, and nodes that are already teamed up will return a message rejecting the teaming request. When this node receives messages agreeing to team up from all other nodes, it proceeds with the global node consensus step.

[0026] Further, the node consensus step in Step 5 is the same as that in Step 4, except that the participating nodes are global nodes.

[0027] A blockchain storage optimization method based on a dynamic variable-width algorithm of the present invention has the following advantages: The present invention divides the blockchain into multiple sub-slices, enabling the blockchain to have a variable width attribute. It can perform width divergence consensus when transactions are intensive and width convergence consensus when transactions are sparse, thereby improving the peak performance of blockchain transaction processing through parallelization of the consensus mechanism. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 State transition diagram of the blockchain storage optimization method based on the dynamic variable-width algorithm;

[0029] Figure 2 Schematic diagram of the storage structure of the blockchain storage optimization method based on the dynamic variable-width algorithm. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0030] To better understand the purpose, structure, and function of the present invention, the following provides a more detailed description of a blockchain storage optimization method based on a dynamic variable-width algorithm of the present invention with reference to the accompanying drawings.

[0031] A blockchain performance optimization method based on a dynamic variable-width algorithm of the present invention, wherein the blockchain storage structure uses a dynamic variable-width algorithm, that is, the width of the blockchain storage structure changes dynamically according to the network transaction density; the storage structure is a continuously generated directed acyclic graph; the width of the blockchain storage structure is the number of nodes without out-degree in the directed acyclic graph, which can also be referred to as the number of shards in the current blockchain network; the blockchain network shards are shards formed by blockchain nodes spontaneously networking peer-to-peer; the transaction density is a proportionality coefficient that is positively correlated with the number of blockchain network transactions per unit time; the nodes are nodes in the blockchain network that initiate, transmit, and verify transactions, and the nodes reach a consensus through this dynamic variable-width algorithm for transaction confirmation.

[0032] The dynamic variable-width algorithm specifically includes the following steps:

[0033] A blockchain performance optimization method based on a dynamic variable-width algorithm, where the participants of this method are N (N≥3) blockchain nodes. These nodes have the ability to interact with network information and general computing power between any two points. Specifically, the ability to interact with network information enables all blockchain nodes to initiate and transfer transactions through the network; the general computing power enables all blockchain nodes to perform asymmetric encryption and decryption calculations, thereby verifying the authenticity of transactions. The authenticity of the transaction means that the node can verify the transaction digital signature through asymmetric encryption and decryption calculations.

[0034] Specifically, although there is the ability to interact with network information between any two points, blockchain nodes should still be independent of each other. Therefore, the step states of blockchain nodes are not synchronized. In particular, different nodes may be in different steps and states simultaneously, as can be seen specifically in Figure 1 the state transition diagram shown. Blockchain nodes complete transaction consensus based on the dynamic variable-width algorithm through the following steps:

[0035] Step 1: Initiate a transaction. The node initiates a transaction in the hope of obtaining a consensus result for this transaction. Specifically, the node initiates the transaction through broadcasting and enters the waiting state after completing the broadcast of the transaction to other nodes in the blockchain network.

[0036] Step 2: Receive messages. After the node receives a transaction through its network information interaction ability, it performs subsequent processing according to different transaction types. Specifically, the node verifies the transaction message, puts the transactions that pass the verification into the transaction pool, and discards the transactions that do not pass the verification. The verification process should be adjusted according to the specific business scenario.

[0037] Step 3: Node grouping. When the number of successfully collected and verified new transactions by nodes in the blockchain network exceeds the specified grouping threshold, the node will initiate a grouping request to form a group and generate a consensus for a new block. This node contacts the initiators of all new transactions to ask if they agree to form a group. Nodes that are not yet grouped will return a message agreeing to form a group, and nodes that are already grouped will return a message disagreeing to form a group. When the number of approving grouping messages received by the node reaches the specified block generation threshold, the node forms a shard with the nodes that agree to form a group and proceeds to the node consensus step.

[0038] Step 4: Node consensus. The successfully grouped nodes generate a new block to confirm the new transactions. The new block consists of two parts: a block header and a block body. The block header contains the hash value of the previous block of the local blockchain of all successfully grouped nodes, and the block body includes all new transactions. In this stage, all nodes participating in the grouping will synchronize all included but locally unknown blocks until they trace back to the previous global consensus. In particular, the consensus on the block within the team should adopt the general consensus algorithm required by the business.

[0039] Step 5: Global Consensus. When a node receives a new block each time, it resets its timeout timer. When the node's timer reaches the upper limit of the block generation time, it will attempt to connect to the specified global leader node in the round order to attempt global consensus. If the connection times out, it will contact the next global leader node in the round order and broadcast. The global leader node refers to the leader node in global consensus. This node collects and validates new transactions before global block generation, and then initiates a global teaming request to conduct global teaming and generate a new block. Specifically, the global teaming request is for the global leader node to contact all other nodes and ask if they agree to team up. Nodes that have not teamed up will return a message agreeing to team up, and nodes that have already teamed up will return a message refusing to team up. When this node receives messages agreeing to team up from all other nodes, it proceeds with the global node consensus step. Specifically, the node consensus step here is the same as Step 4, with the only difference being that the participating nodes are global nodes. As Figure 2 shown, it is a schematic diagram of the storage structure of the blockchain storage optimization method based on the dynamic variable-width algorithm.

[0040] It can be understood that the present invention is described through some embodiments. Those skilled in the art know that without departing from the spirit and scope of the present invention, various changes or equivalent replacements can be made to these features and embodiments. Additionally, under the teaching of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application belong to the scope protected by the present invention.

Claims

1. A blockchain performance optimization method based on a dynamic variable-width algorithm, characterized in that The blockchain storage structure uses a dynamic variable-width algorithm, that is, the width of the blockchain storage structure changes dynamically according to the network transaction density; the storage structure is a continuously generated directed acyclic graph; the width of the blockchain storage structure is the number of nodes without out-degree in the directed acyclic graph, which can also be referred to as the current number of shards in the blockchain network; the blockchain network shard is a shard formed by blockchain nodes spontaneously networking peer-to-peer. The transaction density is a proportionality coefficient that is positively correlated with the number of transactions in the blockchain network per unit time; the nodes are the nodes in the blockchain network that initiate, transfer, and verify transactions. The nodes reach a consensus through transaction confirmation using the dynamic variable-width algorithm. The participants in the dynamic variable-width algorithm are N blockchain nodes, where N ≥ 3; the nodes have the network information interaction ability and general computing ability between any two points; the network information interaction ability enables all blockchain nodes to initiate and transfer transactions through the network; the general computing ability enables all blockchain nodes to perform asymmetric encryption and decryption calculations, thereby verifying the authenticity of transactions; the authenticity of transactions means that nodes can verify the digital signature of transactions through asymmetric encryption and decryption calculations; the blockchain nodes complete transaction consensus based on the dynamic variable-width algorithm through the following steps: Step 1: Initiate a transaction: The node initiates a transaction in the hope of obtaining a consensus result for this transaction. Step 2: Receive a message: After the node receives a transaction through its network information interaction ability, it performs subsequent processing according to different transaction types. Step 3: Node grouping: When the number of successfully collected and verified new transactions by nodes in the blockchain network exceeds the specified grouping threshold, the node will initiate a grouping request to form a group and reach a consensus on generating a new block. Step 4: Node consensus: The successfully grouped nodes generate a new block to confirm the new transactions. Step 5: Global consensus: When a node receives a new block each time, it resets its timeout timer. When the timer of the node reaches the upper limit of the block generation time, it will try to connect to the specified global leader node in round-robin order and attempt to perform global consensus; if the connection times out, it will contact the next global leader node in round-robin order and broadcast; the global leader node refers to the leader node in the global consensus. This node collects and verifies new transactions before global block generation, and then initiates a global grouping request to form a global group and generate a new block.

2. The blockchain performance optimization method based on the dynamic variable-width algorithm according to claim 1, wherein Step 1 includes the following specific steps: The node initiates the transaction through broadcasting and enters a waiting state after completing the broadcast of the transaction to other nodes in the blockchain network.

3. The blockchain performance optimization method based on the dynamic variable-width algorithm according to claim 2, wherein, Step 2 includes the following specific steps: The node verifies the transaction message, puts the verified transactions into the transaction pool, and discards the transactions that do not pass the verification. The verification process should be adjusted according to specific business scenarios.

4. The blockchain performance optimization method based on the dynamic variable-width algorithm according to claim 3, characterized in that Step 3 includes the following specific steps: The node contacts all the initiators of new transactions and asks if they agree to form a group. Nodes that have not formed a group will return a message agreeing to form a group, and nodes that have already formed a group will return a message disagreeing to form a group. When the number of approved grouping messages received by the node reaches the specified block generation threshold, the node forms a shard with the nodes that agree to form a group and proceeds to the node consensus step.

5. The method for optimizing the performance of a blockchain based on a dynamic variable-width algorithm according to claim 4, wherein Step 4 includes the following specific steps: The new block consists of two parts: a block header and a block body. The block header contains the hash value of the previous block of all successfully grouped nodes' local blockchains. The block body includes all new transactions. At this stage, all nodes participating in the grouping synchronize all included but locally unknown blocks until they trace back to the previous global consensus. The consensus on the block within the group adopts the general consensus algorithm required by the business.

6. The blockchain performance optimization method based on the dynamic variable-width algorithm according to claim 5, wherein, Step 5 includes the following specific steps: The global grouping request is for the global leader node to contact all other nodes and ask if they agree to form a group. Nodes that are not grouped will return a message agreeing to group, and nodes that are already grouped will return a message rejecting the grouping. When this node receives messages agreeing to group from all other nodes, it proceeds with the global node consensus step.

7. The blockchain performance optimization method based on the dynamic variable-width algorithm according to claim 6, characterized in that The node consensus step in Step 5 is the same as that in Step 4, except that the participating nodes are global nodes.

Citation Information

Patent Citations

  • Byzantine fault-tolerant blockchain generation method based on rumor propagation protocol

    CN109246122A

  • Fragmentation method and device based on ordered balanced binary tree

    CN111083052A