IP Library Granted Patent US 10,789,222
Granted Patent B2
US 10,789,222 · App. 16/790,596 · Granted Sep 29, 2020

Blockchain-based hierarchical data storage

Inventors: Zhonghao Lu (Hangzhou, CN); Benquan Yu (Hangzhou, CN); Haizhen Zhuo (Hangzhou, CN)
Assignee: Alibaba Group Holding Limited
G06F16/214G06F11/3034G06F16/137G06F16/1824G06F16/2246H04L9/0637
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,789,222
App. No.
16/790,596
Granted
Sep 29, 2020
Kind
B2
Abstract

Disclosed herein are methods, systems, and apparatus, including computer programs encoded on computer storage media, for blockchain-based hierarchical data storage. One of the methods includes: determining, based on a blockchain stored in a database that includes multiple levels of storage, a block number interval that includes one or more block numbers associated with data nodes to be migrated to a lower level of storage in response to the data nodes meeting a data migration condition, wherein each of the data nodes is included in a state Merkle tree and is associated with a block number of a block of the blockchain where the corresponding data node was last updated, and the lower level of storage corresponds to a storage media with lower storage cost.

Claims (46)

1. A blockchain-based hierarchical data storage method comprising:

determining, based on a blockchain stored in a database that includes multiple levels of storage, a block number interval that includes one or more block numbers associated with data nodes to be migrated to a lower level of storage in response to the data nodes meeting a data migration condition, wherein:

each of the data nodes is included in a state Merkle tree and is associated with a block number of a block of the blockchain where the corresponding data node was last updated, and

the lower level of storage corresponds to a storage media with lower storage cost;

determining a migration threshold, wherein the migration threshold is a block number of a target block of the blockchain, and wherein determining the migration threshold comprises, if the block number interval is right-open, determining a right endpoint of the block number interval as the migration threshold, or, if the block number interval is right-closed, determining a sum of the right endpoint and a step size of the one or more block numbers in the block number interval as the migration threshold;

traversing a state Merkle tree corresponding to the target block to identify first one or more target data nodes associated with block numbers smaller than the migration threshold;

changing the block numbers associated with the first one or more target data nodes to the migration threshold;

traversing one or more state Merkle trees corresponding to one or more blocks of the blockchain with the one or more block numbers in the block number interval to identify second one or more target data nodes associated with block numbers smaller than the migration threshold; and

migrating the second one or more target data nodes to the lower level of storage.

2. The method according to claim 1 , wherein the database is a key-value database, the data nodes included in the state Merkle state tree are stored as key-value pairs (KVPs), keys of the KVPs are hash values of corresponding values of the KVPs, and the values of the KVPs are data content of the corresponding data nodes.

3. The method according to claim 1 , further comprising:

determining one or more data nodes updated in a state Merkle tree corresponding to the latest block of the blockchain; and

associating a block number of the latest block with the one or more data nodes.

4. The method according to claim 1 , wherein each of the one or more block numbers is stored in a block number field that is preserved in a corresponding data node.

5. The method according to claim 4 , wherein the block number field is preserved to identify a storage location of a value of the corresponding data node included in the state Merkle state tree.

6. The method according to claim 1 , wherein the state Merkle tree has a tree structure constructed based on a Merkle tree and a prefix tree.

7. The method according to claim 1 , wherein the state Merkle state is a Merkle Patricia Tree (MPT).

8. The method according to claim 1 , wherein the database is a LevelDB database.

9. The method according to claim 1 , wherein the database is a RocksDB database.

10. The method according to claim 1 , wherein the storage media with lower storage cost has lower read-write performance.

11. A computer-implemented system, comprising one or more computers, and one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform operations comprising:

determining, based on a blockchain stored in a database that includes multiple levels of storage, a block number interval that includes one or more block numbers associated with data nodes to be migrated to a lower level of storage in response to the data nodes meeting a data migration condition, wherein:

each of the data nodes is included in a state Merkle tree and is associated with a block number of a block of the blockchain where the corresponding data node was last updated, and

the lower level of storage corresponds to a storage media with lower storage cost;

determining a migration threshold, wherein the migration threshold is a block number of a target block of the blockchain, and wherein determining the migration threshold comprises, if the block number interval is right-open, determining a right endpoint of the block number interval as the migration threshold, or, if the block number interval is right-closed, determining a sum of the right endpoint and a step size of the one or more block numbers in the block number interval as the migration threshold;

traversing a state Merkle tree corresponding to the target block to identify first one or more target data nodes associated with block numbers smaller than the migration threshold;

changing the block numbers associated with the first one or more target data nodes to the migration threshold;

traversing one or more state Merkle trees corresponding to one or more blocks of the blockchain with the one or more block numbers in the block number interval to identify second one or more target data nodes associated with block numbers smaller than the migration threshold; and

migrating the second one or more target data nodes to the lower level of storage.

12. The computer-implemented system according to claim 11 , wherein the database is a key-value database, the data nodes included in the state Merkle state tree are stored as key-value pairs (KVPs), keys of the KVPs are hash values of corresponding values of the KVPs, and the values of the KVPs are data content of the corresponding data nodes.

13. The computer-implemented system according to claim 11 , further comprising:

determining one or more data nodes updated in a state Merkle tree corresponding to the latest block of the blockchain; and

associating a block number of the latest block with the one or more data nodes.

14. The computer-implemented system according to claim 11 , wherein each of the one or more block numbers is stored in a block number field that is preserved in a corresponding data node.

15. The computer-implemented system according to claim 14 , wherein the block number field is preserved to identify a storage location of a value of the corresponding data node included in the state Merkle state tree.

16. The computer-implemented system according to claim 11 , wherein the state Merkle tree has a tree structure constructed based on a Merkle tree and a prefix tree.

17. The computer-implemented system according to claim 11 , wherein the state Merkle state is a Merkle Patricia Tree (MPT).

18. A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:

determining, based on a blockchain stored in a database that includes multiple levels of storage, a block number interval that includes one or more block numbers associated with data nodes to be migrated to a lower level of storage in response to the data nodes meeting a data migration condition, wherein:

each of the data nodes is included in a state Merkle tree and is associated with a block number of a block of the blockchain where the corresponding data node was last updated, and

the lower level of storage corresponds to a storage media with lower storage cost;

determining a migration threshold, wherein the migration threshold is a block number of a target block of the blockchain, and wherein determining the migration threshold comprises, if the block number interval is right-open, determining a right endpoint of the block number interval as the migration threshold, or, if the block number interval is right-closed, determining a sum of the right endpoint and a step size of the one or more block numbers in the block number interval as the migration threshold;

traversing a state Merkle tree corresponding to the target block to identify first one or more target data nodes associated with block numbers smaller than the migration threshold;

changing the block numbers associated with the first one or more target data nodes to the migration threshold;

traversing one or more state Merkle trees corresponding to one or more blocks of the blockchain with the one or more block numbers in the block number interval to identify second one or more target data nodes associated with block numbers smaller than the migration threshold; and

migrating the second one or more target data nodes to the lower level of storage.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 10, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053754/0625 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 31, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053743/0464 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 4, 2020
From: LU, ZHONGHAO; YU, BENQUAN; ZHUO, HAIZHEN
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 052559/0707 →