Blockchain-based data migration method and apparatus
Abstract
A latest block associated with a blockchain is received at a blockchain node device, where the blockchain node device includes a first storage system and a second storage system, and where the second storage system is interconnected with the first storage system. The latest block is stored at the blockchain node device and in the first storage system. Whether a migration trigger event for block data stored in the first storage system is detected determining by the blockchain node device. The block data stored in the first storage system and exists prior to a migration reference time is migrated to the second storage system.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A computer-implemented method, comprising:
receiving, at a blockchain node device, a latest block associated with a blockchain, wherein the blockchain node device includes a first storage system and a second storage system, and wherein the second storage system is interconnected with the first storage system; storing, at the blockchain node device and in the first storage system, the latest block; determining, by the blockchain node device, that a migration instruction for first blockchain data stored in the first storage system is received, wherein the migration instruction comprises a data migration reference time; in response to determining that the migration instruction is received, determining that a migration trigger event for the first blockchain data is detected; and upon determining that the migration trigger event is detected and that the first blockchain data stored in the first storage system satisfies the data migration reference time, migrating, to the second storage system in an ascending order of block heights, the first blockchain data.
2 . The computer-implemented method of claim 1 , wherein the first storage system is a centralized storage system, and wherein the second storage system is a distributed storage system including a coordinator node and a plurality of storage cluster nodes.
3 . The computer-implemented method of claim 1 , wherein determining that the migration trigger event is detected comprises determining that specified data stored in the first storage system satisfies a predetermined data migration rule, and wherein the predetermined data migration rule includes:
whether a data capacity of the specified data stored in the first storage system exceeds a predetermined threshold; or whether a capacity ratio of the data capacity of the specified data stored in the first storage system to a total data capacity of the first storage system exceeds a predetermined threshold;
and wherein:
whether the specified data includes at least one of total data associated with each block, transaction digest value data, block digest value data, or historical status data in a block.
4 . The computer-implemented method of claim 1 , wherein migrating the first blockchain data comprises invoking a data migration utility in the blockchain to migrate the first blockchain data that is stored in the first storage system and that exists before the data migration reference time to the second storage system.
5 . The computer-implemented method of claim 2 , further comprising:
successively allocating, by the coordinator node, block data of the blockchain that is migrated to the plurality of storage cluster nodes of the second storage system.
6 . The computer-implemented method of claim 5 , wherein successively allocating the block data comprises:
migrating the block data of the blockchain migrated to the second storage system to a first storage cluster node of the second storage system in an ascending order of block heights; and if a storage capacity of the first storage cluster node exceeds a predetermined capacity threshold, iteratively migrating remaining blockchain data to a next storage cluster node of the second storage system in ascending order of block heights.
7 . The computer-implemented method of claim 1 , wherein migrating the first blockchain data comprises:
invoking a smart contract that triggers data migration in the blockchain; and executing data migration logic included in the smart contract to migrate block data that is stored in the first storage system and that exists before the data migration reference time to the second storage system.
8 . A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:
receiving, at a blockchain node device, a latest block associated with a blockchain, wherein the blockchain node device includes a first storage system and a second storage system, and wherein the second storage system is interconnected with the first storage system; storing, at the blockchain node device and in the first storage system, the latest block; determining, by the blockchain node device, that a migration instruction for first blockchain data stored in the first storage system is received, wherein the migration instruction comprises a data migration reference time; in response to determining that the migration instruction is received, determining that a migration trigger event for the first blockchain data is detected; and upon determining that the migration trigger event is detected and that the first blockchain data stored in the first storage system satisfies the data migration reference time, migrating, to the second storage system in an ascending order of block heights, the first blockchain data.
9 . The non-transitory, computer-readable medium of claim 8 , wherein the first storage system is a centralized storage system, and wherein the second storage system is a distributed storage system including a coordinator node and a plurality of storage cluster nodes.
10 . The non-transitory, computer-readable medium of claim 8 , wherein determining that the migration trigger event is detected comprises determining that specified data stored in the first storage system satisfies a predetermined data migration rule, and wherein the predetermined data migration rule includes:
whether a data capacity of the specified data stored in the first storage system exceeds a predetermined threshold; or whether a capacity ratio of the data capacity of the specified data stored in the first storage system to a total data capacity of the first storage system exceeds a predetermined threshold;
and wherein:
whether the specified data includes at least one of total data associated with each block, transaction digest value data, block digest value data, or historical status data in a block.
11 . The non-transitory, computer-readable medium of claim 8 , wherein migrating the first blockchain data comprises invoking a data migration utility in the blockchain to migrate the first blockchain data that is stored in the first storage system and that exists before the data migration reference time to the second storage system.
12 . The non-transitory, computer-readable medium of claim 9 , the operations further comprise:
successively allocating, by the coordinator node, block data of the blockchain that is migrated to the plurality of storage cluster nodes of the second storage system.
13 . The non-transitory, computer-readable medium of claim 12 , wherein successively allocating the block data comprises:
migrating the block data of the blockchain migrated to the second storage system to a first storage cluster node of the second storage system in an ascending order of block heights; and if a storage capacity of the first storage cluster node exceeds a predetermined capacity threshold, iteratively migrating remaining blockchain data to a next storage cluster node of the second storage system in ascending order of block heights.
14 . The non-transitory, computer-readable medium of claim 8 , wherein migrating the first blockchain data comprises:
invoking a smart contract that triggers data migration in the blockchain; and executing data migration logic included in the smart contract to migrate block data that is stored in the first storage system and that exists before the data migration reference time to the second storage system.
15 . 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 one or more operations comprising:
receiving, at a blockchain node device, a latest block associated with a blockchain, wherein the blockchain node device includes a first storage system and a second storage system, and wherein the second storage system is interconnected with the first storage system;
storing, at the blockchain node device and in the first storage system, the latest block;
determining, by the blockchain node device, that a migration instruction for first blockchain data stored in the first storage system is received, wherein the migration instruction comprises a data migration reference time;
in response to determining that the migration instruction is received, determining that a migration trigger event for the first blockchain data is detected; and
upon determining that the migration trigger event is detected and that the first blockchain data stored in the first storage system satisfies the data migration reference time, migrating, to the second storage system in an ascending order of block heights, the first blockchain data.
16 . The computer-implemented system of claim 15 , wherein the first storage system is a centralized storage system, and wherein the second storage system is a distributed storage system including a coordinator node and a plurality of storage cluster nodes.
17 . The computer-implemented system of claim 15 , wherein determining that the migration trigger event is detected comprises determining that specified data stored in the first storage system satisfies a predetermined data migration rule, and wherein the predetermined data migration rule includes:
whether a data capacity of the specified data stored in the first storage system exceeds a predetermined threshold; or whether a capacity ratio of the data capacity of the specified data stored in the first storage system to a total data capacity of the first storage system exceeds a predetermined threshold;
and wherein:
whether the specified data includes at least one of total data associated with each block, transaction digest value data, block digest value data, or historical status data in a block.
18 . The computer-implemented system of claim 15 , wherein migrating the first blockchain data comprises invoking a data migration utility in the blockchain to migrate the first blockchain data that is stored in the first storage system and that exists before the data migration reference time to the second storage system.
19 . The computer-implemented system of claim 16 , the operations further comprise:
successively allocating, by the coordinator node, block data of the blockchain that is migrated to the plurality of storage cluster nodes of the second storage system.
20 . The computer-implemented system of claim 19 , wherein successively allocating the block data comprises:
migrating the block data of the blockchain migrated to the second storage system to a first storage cluster node of the second storage system in an ascending order of block heights; and if a storage capacity of the first storage cluster node exceeds a predetermined capacity threshold, iteratively migrating remaining blockchain data to a next storage cluster node of the second storage system in ascending order of block heights.Join the waitlist — get patent alerts
Track US2020265009A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.