IP Library Granted Patent US 12,481,628
Granted Patent B2
US 12,481,628 · App. 18/043,892 · Granted Nov 25, 2025

Data migration method and apparatus, device, distributed system and storage medium

Inventors: Yanxin Luo (Zhejiang, CN); Feifei Li (Zhejiang, CN); Wei Cao (Zhejiang, CN)
Assignee: ALIBABA CLOUD COMPUTING CO., LTD.
G06F16/214G06F16/2282G06F16/27
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 12,481,628
App. No.
18/043,892
Granted
Nov 25, 2025
Kind
B2
Abstract

A data migration method and apparatus, a device, a distributed system and a storage medium are provided. Said method is applied to each data node in a distributed system comprising a plurality of data nodes. Said method comprises: determining, in a current data migration task, a table to be migrated of a current node, and a target data node (S 101 ); and writing incremental data in the table to be migrated into the table to be migrated, and a target data table of the target data node, the incremental data being data obtained by performing, after the data migration task is started, a change operation on data in the table to be migrated (S 102 ).

Claims (51)

1 . A data migration method, applied to each data node of a plurality of data nodes comprised in a distributed system, wherein the method comprises:

determining a target data node and a table to be migrated of a present data node for a present data migration task;

determining a migration state of the table to be migrated as a first state, wherein the first state indicates that a double write operation is performed on incremental data;

synchronizing state information indicating the first state with the target data node, so that the target data node determines a migration state of a target data table of the target data node as the first state; and

writing, to the target data table of the target data node and the table to be migrated of the present data node, the incremental data for the table to be migrated under the first state of both the table to be migrated and the target data table by using the double write operation, such that a change operation on the table to be migrated is performed in both the table to be migrated of the present data node and the target data table of the target data node, wherein the incremental data is data obtained by performing, after both the migration state of the table to be migrated and the migration state of the target data table are determined as the first state, the change operation on data in the table to be migrated.

2 . The method according to claim 1 , wherein, after determining the target data node and the table to be migrated of the present data node for the present data migration task, the method further comprises:

acquiring, from a database of the present data node, metadata of the table to be migrated; and

establishing, according to the metadata, the target data table in a database of the target data node.

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

writing, to the target data table of the target data node, stock data in the table to be migrated, wherein the stock data is data in the table to be migrated before both the migration state of the table to be migrated and the migration state of the target data table are determined as the first state.

4 . The method according to claim 3 , wherein, before writing, to the target data table of the target data node and the table to be migrated, the incremental data in the table to be migrated, the method further comprises:

recording site information, wherein the site information indicates a value range of a primary key in the table to be migrated before the incremental data is written to the table to be migrated and the target data table;

the writing, to the target data table of the target data node, the stock data in the table to be migrated, comprises:

acquiring the site information of the table to be migrated;

determining, according to the value range of the primary key in the table to be migrated indicated by the site information, the stock data in the table to be migrated; and

reading the stock data in the table to be migrated and writing the stock data to the target data table.

5 . The method according to claim 3 , wherein, in a case where both a migration state of the table to be migrated and a migration state of the target data table are a second state, an operation of writing the stock data to the target data table is performed;

before writing, to the target data table of the target data node, the stock data in the table to be migrated, the method further comprises:

determining the migration state of the table to be migrated as the second state; and

synchronizing state information indicating the second state with the target data node, so that the target data node determines the migration state of the target data table as the second state.

6 . The method according to claim 1 , wherein the change operation performed on the data in the table to be migrated and the operation of determining the migration state of the table to be migrated and the migration state of the target data table are mutually exclusive.

7 . The method according to claim 6 , wherein the change operation performed on the data in the table to be migrated is performed after a read lock for the table to be migrated is acquired;

the operation of determining the migration state of the table to be migrated and the migration state of the target data table is performed after a write lock for the table to be migrated is acquired; and the read lock and the write lock are mutually exclusive.

8 . The method according to claim 1 , wherein, before writing, to the target data table of the target data node and the table to be migrated, the incremental data in the table to be migrated, the method further comprises:

recording site information, wherein the site information indicates a value range of a primary key in the table to be migrated before both the migration state of the table to be migrated and the migration state of the target data table are determined as the first state; and the site information is used to determine the stock data of the table to be migrated.

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

after the stock data has been written to the target data table of the target data node, sending a switch request to the target data node, wherein the switch request is used to switch, to the target data table, a read operation on the table to be migrated; and

after the switching is completed, stopping a write operation on the table to be migrated.

10 . The method according to claim 9 , wherein the change operation performed on the data in the table to be migrated and the operation of switching, to the target data table, the read operation on the table to be migrated are mutually exclusive.

11 . The method according to claim 10 , wherein the change operation performed on the data in the table to be migrated is performed after a read lock for the table to be migrated is acquired;

the operation of switching, to the target data table, the read operation on the table to be migrated is performed after a write lock for the table to be migrated is acquired; and the read lock and the write lock are mutually exclusive.

12 . The method according to claim 9 , wherein the sending the switch request to the target data node, further comprises:

after verifying that the data in the table to be migrated is consistent with the data in the target data table, sending the switch request to the target data node.

13 . A computer device, comprising a memory, a processor, and a computer program which is stored in the memory and is run on the processor, wherein the processor, when executing the computer program, implements the method according to claim 1 .

14 . A non-transitory computer-readable storage medium, wherein the computer-readable storage medium has stored a computer program, and the computer program, when executed by a processor, implements the method according to claim 1 .

15 . The method according to claim 5 , wherein the change operation performed on the data in the table to be migrated and the operation of determining the migration state of the table to be migrated and the migration state of the target data table are mutually exclusive.

16 . The method according to claim 15 , wherein the change operation performed on the data in the table to be migrated is performed after a read lock for the table to be migrated is acquired;

the operation of determining the migration state of the table to be migrated and the migration state of the target data table is performed after a write lock for the table to be migrated is acquired; and the read lock and the write lock are mutually exclusive.

17 . A data migration apparatus, applied to each data node of a plurality of data nodes comprised in a distributed system, wherein the apparatus comprises:

at least one processor; and

a memory communicatively connected with the at least one processor,

wherein the memory stores instructions executable by the at least one processor, and the instructions, when executed by the at least one processor, cause the at least one processor to perform operations of:

determining a target data node and a table to be migrated of a present data node for a present data migration task;

determining a migration state of the table to be migrated as a first state, wherein the first state indicates that a double write operation is performed on incremental data;

synchronizing state information indicating the first state with the target data node, so that the target data node determines a migration state of a target data table of the target data node as the first state; and

writing, to the target data table of the target data node and the table to be migrated of the present data node, the incremental data for the table to be migrated under the first state of both the table to be migrated and the target data table by using the double write operation, such that a change operation on the table to be migrated is performed in both the table to be migrated of the present data node and the target data table of the target data node, wherein the incremental data is data obtained by performing, after both the migration state of the table to be migrated and the migration state of the target data table are determined as the first state, the change operation on data in the table to be migrated.

18 . A distributed system comprising a plurality of data nodes, wherein each data node of the plurality of data nodes is a computer device comprising a memory, a processor, and a computer program which is stored in the memory and is run on the processor, wherein the processor of each computer device, when executing the computer program, implements operations of:

determining a target data node and a table to be migrated of a present data node for a present data migration task;

determining a migration state of the table to be migrated as a first state, wherein the first state indicates that a double write operation is performed on incremental data;

synchronizing state information indicating the first state with the target data node, so that the target data node determines a migration state of a target data table of the target data node as the first state; and

writing, to the target data table of the target data node and the table to be migrated of the present data node, the incremental data for the table to be migrated under the first state of both the table to be migrated and the target data table by using the double write operation, such that a change operation on the table to be migrated is performed in both the table to be migrated of the present data node and the target data table of the target data node, wherein the incremental data is data obtained by performing, after both the migration state of the table to be migrated and the migration state of the target data table are determined as the first state, the change operation on data in the table to be migrated.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 12, 2026
From: ALIBABA CLOUD COMPUTING CO., LTD.
To: CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PRIVATE LIMITED
Reel/Frame 075561/0252 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 30, 2026
From: ALIBABA CLOUD COMPUTING LTD.
To: CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PRIVATE LIMITED
Reel/Frame 075366/0397 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 18, 2023
From: LUO, YANXIN; LI, FEIFEI; CAO, WEI
To: ALIBABA CLOUD COMPUTING CO., LTD.
Reel/Frame 064940/0157 →
Priority Claims (1)
CN 202010923655.1 · Sep 4, 2020 · national
Continuity (1)
Related Publication 20240028568A1 · Jan 25, 2024
References Cited (17)
US 10657154B1 · Dugar · 2020 [cited by examiner]
US 20090300037A1 · Kariv · 2009 [cited by examiner]
US 20120137098A1 · Wang · 2012 [cited by examiner]
US 20180074749A1 · Kabakura · 2018 [cited by examiner]
US 20190179808A1 · Xu · 2019 [cited by examiner]
US 20210334252A1 · Tong · 2021 [cited by examiner]
US 20210406229A1 · Taranov · 2021 [cited by examiner]
CN 104486373A · 2015 [cited by applicant]
CN 105824846A · 2016 [cited by applicant]
CN 107016029A · 2017 [cited by applicant]
CN 110019140A · 2019 [cited by applicant]
CN 110399356A · 2019 [cited by applicant]
CN 111104392A · 2020 [cited by applicant]
CN 111797172A · 2020 [cited by applicant]
WO WO2018099397A1 · 2018 [cited by applicant]
International Search Report of PCT/CN2021/116371, Nov. 25, 2021, 4 pages. [cited by applicant]
Written Opinion of the International Searching Authority for PCT/CN2021/116371, Nov. 25, 2021, 4 pages. [cited by applicant]