Data migration method and apparatus

CN115729888BActive Publication Date: 2026-09-08AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211530103.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-30
Publication Date
2026-09-08
Estimated Expiration
2042-11-30

AI Technical Summary

Technical Problem

较为常见的数据迁移方式是文件拷贝,需要用户对数据文件,例如HDFS数据文件,手动执行数据文件的迁移,迁移效率较低

Benefits of technology

[0025] According to the technology disclosed herein, the target cluster can respond to a data migration request and obtain a table creation statement, which can be the generation statement for a first data table stored in the source cluster. This allows the target cluster to read the generation statement from the source cluster. After obtaining the table creation statement, the target cluster can execute it and generate a second data table according to the data table format of the first data table. The generation of the second data table is based on the automatic execution of the table creation statement. Upon receiving a data migration instruction, the target cluster can run the instruction to migrate data from the first data table to the second data table. The data migration instruction is automatically generated by a migration schedule table and does not require user intervention. Simultaneously, through the creation of data tables and the migration of data within those tables, data migration is achieved on a table-by-table basis. The data tables can be directly used for data querying and other processing logic, enabling more comprehensive data migration and improving the success rate and efficiency of data migration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115729888B_ABST
    Figure CN115729888B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data migration method and device, the method comprising: in response to a data migration request, obtaining a table creation statement, the table creation statement being a generation statement of a first data table stored in a source cluster; executing the table creation statement to generate a second data table according to a data table format of the first data table; receiving a data migration instruction, the data migration instruction being generated according to configuration parameters in a migration scheduling table; and running the data migration instruction to migrate data in the first data table to the second data table. The technical solution of the present disclosure improves the data migration efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a data migration method and apparatus. Background Technology

[0002] Distributed data storage systems utilize clusters of multiple nodes to store data, which can be stored in table-like file formats within the cluster. Common distributed storage systems are built upon distributed system infrastructures, typically by encapsulating data processing systems that handle data reading, writing, and storage within the distributed system framework. For example, the Hadoop architecture can be used to encapsulate systems like Hive or HBase (Hadoop database).

[0003] Currently, distributed data storage systems often encounter scenarios such as cold and hot data classification and storage, overall cluster data migration, and near-synchronization of data between clusters, requiring data migration or backup between different clusters. A common data migration method is file copying, which requires users to manually perform data file migration, such as HDFS data files, resulting in low migration efficiency. Summary of the Invention

[0004] This disclosure provides a method and apparatus for data migration between distributed data storage systems.

[0005] According to a first aspect of this disclosure, a data migration method is provided, applied to a target cluster, comprising:

[0006] In response to a data migration request, a table creation statement is obtained, specifically the statement for generating the first data table stored in the source cluster;

[0007] Execute the table creation statement to generate a second data table according to the data table format of the first data table;

[0008] Receive a data migration instruction, which is generated according to the configuration parameters in the migration schedule table;

[0009] Run the data migration instruction to migrate the data from the first data table to the second data table.

[0010] According to a second aspect of this disclosure, a data migration method is provided, comprising:

[0011] Display the migration scheduling page, obtain the configuration parameters input by the user on the migration scheduling page, and obtain the migration scheduling table corresponding to the configuration parameters. The configuration parameters include parameters involved in the data migration process.

[0012] The source cluster controls the sending of a table creation statement to the target cluster. The table creation statement is the generation statement of the first data table stored in the source cluster. The table creation statement is used to instruct the target cluster to generate a second data table according to the data table format of the first data table.

[0013] Data migration instructions are generated based on the configuration parameters in the migration schedule table;

[0014] The data migration instruction is sent to the target cluster, which instructs the target cluster to migrate the data in the first data table to the second data table.

[0015] According to a third aspect of this disclosure, a data migration apparatus is provided, comprising:

[0016] The statement acquisition unit is used to acquire the table creation statement in response to the data migration request. The table creation statement is specifically the generation statement of the first data table stored in the source cluster.

[0017] The table generation unit is used to execute the table creation statement and generate a second data table according to the data table format of the first data table.

[0018] The instruction receiving unit is used to receive data migration instructions, which are generated according to the configuration parameters of the migration scheduling table.

[0019] The instruction execution unit is used to execute the data migration instruction to migrate data from the first data table to the second data table.

[0020] According to a fourth aspect of this disclosure, a data migration apparatus is provided, comprising:

[0021] The parameter acquisition unit is used to display the migration scheduling page, acquire the configuration parameters input by the user on the migration scheduling page, and obtain the migration scheduling table corresponding to the configuration parameters. The configuration parameters include parameters involved in the data migration process.

[0022] The statement control unit is used to control the source cluster to send the table creation statement to the target cluster. The table creation statement is the generation statement of the first data table stored in the source cluster. The table creation statement is used to instruct the target cluster to generate the second data table according to the data table format of the first data table.

[0023] The instruction generation unit is used to generate data migration instructions based on the configuration parameters in the migration scheduling table;

[0024] The instruction sending unit is used to send the data migration instruction to the target cluster, wherein the data migration instruction instructs the target cluster to migrate the data in the first data table to the second data table.

[0025] According to the technology disclosed herein, the target cluster can respond to a data migration request and obtain a table creation statement, which can be the generation statement for a first data table stored in the source cluster. This allows the target cluster to read the generation statement from the source cluster. After obtaining the table creation statement, the target cluster can execute it and generate a second data table according to the data table format of the first data table. The generation of the second data table is based on the automatic execution of the table creation statement. Upon receiving a data migration instruction, the target cluster can run the instruction to migrate data from the first data table to the second data table. The data migration instruction is automatically generated by a migration schedule table and does not require user intervention. Simultaneously, through the creation of data tables and the migration of data within those tables, data migration is achieved on a table-by-table basis. The data tables can be directly used for data querying and other processing logic, enabling more comprehensive data migration and improving the success rate and efficiency of data migration.

[0026] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0027] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0028] Figure 1 This is an example diagram illustrating an application scenario of the data migration method provided in this disclosure embodiment;

[0029] Figure 2 This is a flowchart of one embodiment of a data migration method provided in this disclosure;

[0030] Figure 3 This is a flowchart of yet another embodiment of a data migration method provided in this disclosure;

[0031] Figure 4 This is a flowchart of yet another embodiment of a data migration method provided in this disclosure;

[0032] Figure 5 This is a schematic diagram of the structure of one embodiment of a data migration apparatus provided in this disclosure;

[0033] Figure 6 This is a schematic diagram of the structure of yet another embodiment of a data migration apparatus provided in this disclosure;

[0034] Figure 7 This is a block diagram of an electronic device used to implement the data migration method of the embodiments of this disclosure. Detailed Implementation

[0035] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0036] First, in order to fully illustrate the data migration example, the following section will provide a detailed explanation of the technical terms involved.

[0037] Hadoop (Hadoop Distributed Computing) is a distributed system infrastructure that allows users to develop distributed programs without understanding the underlying details of distributed systems, fully utilizing the performance of clusters for high-speed computation and storage. Hadoop can include different versions.

[0038] Hive (bee colony) is a data warehouse tool based on Hadoop. It can be used for data extraction, transformation, and loading, and is a data processing mechanism that allows data storage, querying, and analysis within Hadoop. Hive is a data processing system encapsulated on top of Hadoop.

[0039] Impala is an MPP (Massively Parallel Processor) SQL (Structured Query Language) query engine for processing large amounts of data stored in Hadoop clusters. It allows you to write SQL queries for existing Hadoop data.

[0040] HBase (Hadoop Database) is a distributed, column-oriented data storage system built on top of HDFS (Hadoop Distributed File System). It enables real-time read / write operations and random access to extremely large datasets. HBase is a data processing system that can be wrapped around the Hadoop system.

[0041] Phoenix is ​​an open-source SQL engine for distributed file systems. Its goal is to provide low-latency queries on data stored in HBase through an embedded JDBC (Java Database Connect) driver. Phoenix provides read and write operations for HBase data. The technical solution disclosed herein can be applied to data migration scenarios in distributed data storage systems. By obtaining table creation statements from the source cluster and automatically generating data migration instructions through migration scheduling table settings, it achieves automated execution of data table migration, improving the success rate and efficiency of data migration.

[0042] In existing technologies, distributed data storage systems can be used to store data. These systems utilize multiple nodes, which can be referred to as a cluster. There are needs for data migration and backup between different clusters. Currently, data migration between clusters typically involves directly migrating the files containing the stored data to another cluster.

[0043] Analysis of the data migration process between the two distributed data storage systems revealed that the data was actually stored in the form of data tables. The general principle of distributed data storage is to separate the data in a data table and store it on different nodes. Therefore, a data table can include multiple data files. After migrating the data files, the query logic of the data table needs to be built on the data files. This process usually needs to be done manually, which is the main reason for the low efficiency of data migration.

[0044] To address the aforementioned issues, in this embodiment, the target cluster can respond to a data migration request by obtaining a table creation statement. This statement can be a generation statement for a first data table stored in the source cluster, which can be retrieved from the data table. Obtaining the table creation statement automatically creates the data table in the target cluster. Executing the table creation statement creates a second data table according to the format of the first data table. After the second data table is created, data migration can begin. Data migration requires a data migration instruction, which can be received and obtained. This instruction can be generated according to a migration schedule table. After running the data migration instruction, data from the first data table can be migrated to the second data table, achieving automated data migration on a table-by-table basis. The migrated second data table can be directly used for data querying and other processing logic, enabling more comprehensive data migration and improving the success rate and efficiency of data migration.

[0045] The technical solution of this disclosure will now be described in detail with reference to the accompanying drawings.

[0046] refer to Figure 1This diagram illustrates an application scenario of the data migration method provided in this embodiment. The scenario may include an electronic device 1, and a target cluster 2 and a source cluster 3 connected to the electronic device 1 via wired or wireless communication. The electronic device is, for example, a computer 1, and the target and source clusters are, for example, cloud services. The source cluster 3 may store a first data table and its creation statements. The electronic device 1 can read the creation statements of the first data table from the source cluster 3 and initiate a data migration request to the target cluster 2 based on these statements. The target cluster 2 can respond to the data migration request initiated by the electronic device 1 and obtain the creation statements from the source cluster 1. Furthermore, a migration schedule table can be configured in the electronic device 1, including configuration parameters involved in the data migration process. Therefore, the electronic device 1 can generate a data migration instruction according to the migration schedule table and send the instruction to the target cluster 2. The target cluster 2 can receive and execute the data migration instruction, migrating data from the first data table to the second data table, thus completing efficient data migration on a table-by-table basis.

[0047] Figure 2 A flowchart illustrating an embodiment of a data migration method provided in this disclosure, which can be applied to a target cluster, and may include the following steps:

[0048] 201: In response to a data migration request, retrieve the table creation statement, which is specifically the statement for generating the first data table stored in the source cluster.

[0049] The data migration request can be sent by the source cluster and received by the target cluster. The target cluster may include a central node for the processing steps. The central node can be configured with the technical solution disclosed herein to complete the data migration.

[0050] Optionally, step 201 may include receiving a table creation statement sent by the source cluster.

[0051] Optionally, the technical solution disclosed herein can be applied to the field of big data migration, especially big data migration of distributed data storage systems based on the Hadoop framework, which can effectively improve the efficiency of big data migration under Hadoop.

[0052] 202: Execute the table creation statement to generate the second data table according to the data table format of the first data table.

[0053] The table attributes of the second data table are the same as those of the first data table. Table attributes may include: header, table name layout, etc. Optionally, the data table may store data in a table name-value structure. The first data table may include table names and corresponding key values. Step 202 may specifically include generating the second data table according to the table names and table name structure of the first data table. Alternatively, the second data table can be generated using the table attributes of the first data table. Of course, the second data table can also be generated using the table attributes and keys of the first data table.

[0054] 203: Receive data migration instructions, which are generated according to the configuration parameters in the migration schedule table.

[0055] Data migration instructions can be generated for electronic devices using configuration parameters in the migration schedule table.

[0056] 204: Run the data migration command to migrate the data from the first data table to the second data table.

[0057] Optionally, the data migration command may include multiple configuration parameters such as the IP address of the target cluster, the IP address of the source cluster, the system architecture version of the target cluster, bandwidth usage parameters, and migration mode parameters. Step 204 may specifically include: migrating data from a first data table in the source cluster to a second data table in the target cluster, so that the data in the second data table is identical to the data in the first data table. There may be multiple first data tables, and each second data table may correspond one-to-one with a first data table.

[0058] Optionally, step 204 may specifically include: when the source cluster and the target cluster meet the migration conditions, a data migration instruction can be run to migrate the data in the first data table to the second data table.

[0059] Furthermore, the source and target clusters must meet the migration conditions, which may include: all machines in the target cluster are connected to the IP addresses (Internet Protocol, the protocol for interconnecting networks) of all nodes in the source cluster; the source cluster directory has read permissions; the target cluster has read and write permissions for the copy save directory; the firewall on ports such as 50070 in the source cluster is enabled; and the host-to-IP mapping relationship of the source cluster is set in at least one of the hosts file of the target cluster.

[0060] In this embodiment, the target cluster can respond to a data migration request and obtain a table creation statement. This statement can be a generation statement for a first data table stored in the source cluster, which can be read from the data table. Obtaining the table creation statement allows the data table to be automatically created in the target cluster. Executing the table creation statement creates a second data table according to the data table format of the first data table. After the second data table is created, data migration can begin. Data migration requires a data migration instruction, which can be received and obtained. This instruction can be generated according to a migration schedule table. After running the data migration instruction, data from the first data table can be migrated to the second data table, achieving automated data migration on a table-by-table basis. The migrated second data table can be directly used for data querying and other processing logic, achieving more comprehensive data migration functionality and improving data migration success rate and efficiency.

[0061] As an example, the table creation statement includes: a first table creation statement, and the data table format includes a first table format;

[0062] Execute the table creation statement to generate the second data table according to the data table format of the first data table, including:

[0063] Execute the first table creation statement to generate the second data table according to the first table format.

[0064] Optionally, the first table creation statement can be a Hive table creation statement, and executing the first table creation statement can generate a second data table in Hive mode.

[0065] After executing the first table creation statement and migrating the data from the first table to the second table, you can execute the corresponding data query commands from the Impala system.

[0066] In this embodiment of the disclosure, a second data table can be generated according to a first table format by executing a first table creation statement, so that the second data table can have the same table format as the first data table, ensuring that the data is accurately migrated according to the format of the first data table.

[0067] As another embodiment, the table creation statement includes: a second table creation statement and a third table creation statement, and the data table format includes a second table format corresponding to the second table creation statement and a third table format corresponding to the third table creation statement;

[0068] Execute the table creation statement to generate the second data table according to the data table format of the first data table, including:

[0069] Execute the second table creation statement to generate the first sub-data table according to the second table format;

[0070] Execute the third table creation statement to generate the second sub-data table according to the third table format;

[0071] The mapping table is determined based on the correspondence between the table names of the first and second sub-data tables;

[0072] The mapping table, the second sub-data table, and the first sub-data table are defined as the second data table. The second data table performs data processing operations on the data in the second sub-data table based on the mapping table and the first sub-data table.

[0073] When the first table in the source cluster contains two table formats, two table creation statements can be obtained from the source cluster: a second table creation statement and a third table creation statement. The second sub-table can be a table created at the level above the first sub-table. The second sub-table can be queried through the first sub-table. The first sub-table can be a Phoenix table, and the second sub-table can be an HBase table. Table name mapping refers to the correspondence between data in the two tables that share the same table name. A table name can be an independent table name, without any prefix or suffix strings. Table names can be strings formed by combining English letters, characters, symbols, etc.

[0074] To query HBase tables from Phoenix tables, a mapping relationship can be established between the names of Phoenix tables and HBase tables. This mapping relationship enables the query. The mapping table represents the relationship between the names of the first and second sub-tables. For example, suppose the names of the second sub-tables are A, B, and C, and the names of the first sub-tables are PA, PB, and PC. Table names A and PA have a correspondence, B and PB have a correspondence, and C and PC have a correspondence. That is, table names A and PA share the same name A, B and PB share the same name B, and C and PC share the same name C. Therefore, a mapping table containing table names A and PA, B and PB, and C and PC can be established. Of course, the above mapping relationship is merely an example; in practical applications, nested mappings can exist, meaning table names can map to table names in multi-level joins.

[0075] In this embodiment of the disclosure, when there are second and third table creation statements, they can be executed respectively to establish the first and second sub-data tables. At the same time, by establishing the correspondence between the keywords of the first and second sub-data tables, a mapping table is obtained. The mapping table is used to implement data processing operations based on the first and second sub-data tables, thereby realizing the establishment of the second data table with a mapping relationship, improving the efficiency and accuracy of data table establishment.

[0076] Furthermore, based on the above embodiments, the configuration parameters include the system framework version of the source cluster and the system framework version of the target cluster, and the receiving of data migration instructions includes:

[0077] If the system framework version of the target cluster is the same as that of the source cluster, then the data migration instruction corresponding to the first migration identifier is determined. The first migration identifier is used to indicate data migration between the same versions.

[0078] If the system framework version of the target cluster is different from that of the source cluster, then the data migration instruction corresponding to the second migration identifier is determined. The second migration identifier is used to indicate data migration between different versions.

[0079] Optionally, the system framework version can refer to the framework version of the distributed data storage system used when the target cluster was established. Taking Hadoop as an example, the first migration identifier between the same Hadoop version can be HDFS, and the second migration identifier between different Hadoop versions can be HFTP.

[0080] For ease of understanding, for the same version of data migration instructions, the data migration instructions can be, for example:

[0081] The Hadoop command `distcp hdfs: / / IP1:9000 / ... / A1 / hdfs: / / IP2 / ... / B1 / ` sets the migration identifier for the source cluster to `hdfs`. `IP1` is the network address of the namenode in the source cluster, and `IP2` is the network address of the namenode in the target cluster. `9000` is the RPC port of the source cluster, through which data is read. `A1` is the directory for the first data table, and `B1` is the directory for the second data table.

[0082] For different versions of data migration commands, such as copying data from Hadoop 2.6.0 to Hadoop 2.7.1, the data migration command could be:

[0083] The Hadoop distribution uses the following URLs: `hadoop distcp hftp: / / IP1:50070 / ... / A1 / hdfs: / / IP2 / ... / B1 / `. Here, `hftp` is the migration identifier for the source cluster, `IP1` is the network address of the namenode in the source cluster, and `IP2` is the network address of the namenode in the target cluster. `50070` is the RPC port of the source cluster, through which data is read. `A1` is the directory for the first data table, and `B1` is the directory for the second data table.

[0084] In addition, in practical applications, data migration instructions may include other parameters, such as migration mode parameters and bandwidth occupancy index. For details, please refer to the descriptions of relevant technologies, which will not be elaborated here.

[0085] In this embodiment, the system framework versions of the target cluster and the source cluster can be compared. When the versions are the same, a data migration instruction can be generated using a first migration identifier. When the versions are different, a data migration instruction can be generated using a second migration identifier. By using two different migration identifiers, the first and second migration identifiers, to distinguish migration instructions for different system framework versions, the target cluster can differentiate data migrations based on version comparison results, thus improving migration accuracy.

[0086] As another embodiment, the configuration parameters include: bandwidth usage parameters; running data migration instructions to migrate data from the first data table to the second data table includes:

[0087] Run the data migration command to migrate the data from the first data table to the second data table according to the data transmission rate indicated by the bandwidth occupancy parameter.

[0088] Optionally, the bandwidth usage parameter can refer to the bandwidth used during data migration, specifically the data transmission rate. When migrating data from the first data table to the second data table, the transmission rate is less than or equal to the data transmission bandwidth.

[0089] In this embodiment, after running the data migration command, the data migration process can be rate-limited based on the data transmission rate indicated by the bandwidth occupancy parameter in the data migration command, so as to ensure that the data migration process does not consume too much bandwidth and to ensure data transmission security.

[0090] Furthermore, based on the above embodiments, the configuration parameters include: migration mode parameters, running data migration instructions, and migrating data from the first data table to the second data table, including:

[0091] Run the data migration command and migrate the data from the first data table to the second data table according to the data migration mode indicated by the migration mode parameter.

[0092] Optionally, the data migration mode may include either a full migration mode or an incremental migration mode.

[0093] The full migration mode refers to migrating all the data from the first data table to the second data table in one go.

[0094] In this embodiment of the disclosure, a data migration mode can be indicated by a migration mode parameter so that, during the data migration process, data in the first data table can be migrated to the second data table according to the data migration mode, thereby realizing data mode migration and improving data migration efficiency and accuracy.

[0095] As another embodiment, running a data migration instruction to migrate data from the first data table to the second data table includes:

[0096] Run the data migration command to generate a data migration task;

[0097] The data is migrated from the first data table to the second data table using a data migration task.

[0098] The method also includes:

[0099] Monitor the migration status of the data migration task, including whether the migration is in progress or completed;

[0100] If the migration status is determined to be complete, a feedback message indicating successful data migration will be output.

[0101] In this embodiment of the disclosure, when running a data migration instruction, a data migration task can be generated. Through this task, data from a first data table is migrated to a second data table. During the data migration process, the migration status of the task is monitored in real time. When the migration status is "completed," feedback information indicating successful data migration can be output. By monitoring the migration status of the data migration task, the timeliness of the data migration task can be assessed, improving the user experience.

[0102] As another embodiment, after running the data migration instruction to migrate data from the first data table to the second data table, the method further includes:

[0103] Determine the data query instruction for the second data table;

[0104] Use data query commands to execute a query operation on the second data table and obtain the query results;

[0105] If the query result indicates that the data query was successful, a message indicating that the migration of the second data table was successful will be output.

[0106] If the query result indicates that the data query failed, then output a message indicating that the migration of the second data table failed.

[0107] In this embodiment, a data query instruction for the second data table can be determined. The second data table is then queried using this instruction to test its usability, and the query results are used to verify the usability of the second data table. Verifying the second data table through this query provides feedback on the migration effectiveness, thereby improving the overall efficiency of the data table migration.

[0108] Taking the distributed data storage system corresponding to the Hadoop framework as an example, the technical solution disclosed herein will be described in detail. Figure 3 The diagram shown is a system application example of the data migration method provided in this disclosure. The method may include the following steps:

[0109] S301: The electronic device responds to the cluster scheduling request and obtains the migration scheduling table, which includes the configuration parameters involved in the data migration process.

[0110] S302: The electronic device selects the data type of the first data table from Hive and HBase.

[0111] S303: If the electronic device determines that the first data table is of type Hive, it controls the target cluster to obtain the first table creation statement of the first data table through the first viewing instruction.

[0112] S304: The target cluster executes the first table creation statement, generating the second data table according to the first table format. The first table format is in Hive mode.

[0113] S305: If the electronic device determines that the first data table is of type HBase, it controls the target cluster to obtain the second table creation statement through the first read instruction. The second table creation statement includes the HBase table creation statement. The control target cluster also obtains the third table creation statement through the second read instruction. The third table creation statement includes the Phoenix table creation statement.

[0114] S306: The target cluster executes the second table creation statement, generating the first sub-table according to the second table format; it then executes the third table creation statement, generating the second sub-table according to the third table format. The first sub-table is an HBase table, and the second sub-table is a Phoenix table.

[0115] S307: Based on the table name correspondence between the first and second sub-data tables, determine the mapping table; determine the mapping table, the second sub-data table, and the first sub-data table as the second data table. The second data table performs data processing operations on the data in the second sub-data table based on the mapping table and the first sub-data table. The mapping table can be a mapping between the table names of HBase data tables and the table names of Phoenix data tables.

[0116] After executing the first table creation statement and migrating the data from the first table to the second table, you can update the metadata and partition information of the HBase table.

[0117] S308: The electronic device generates a data migration instruction based on the configuration parameters in the migration schedule table.

[0118] S309: The electronic device sends a data migration instruction to the target cluster, and the target cluster migrates the data from the first data table to the second data table.

[0119] The technical solution disclosed herein, through the interaction of electronic devices, a source cluster, and a target cluster, enables the copying of a table creation statement from a first data table in the source cluster. This table creation statement then establishes a second data table with the same format as the first data table. Subsequently, migration instructions are generated from migration data in a migration schedule table. The execution of these instructions migrates data from the first data table to the second data table, resulting in a migrated second data table. By creating data tables and migrating data within them, data migration is achieved on a table-by-table basis. These data tables can be directly used for data querying and other processing logic, enabling more comprehensive data migration and improving the success rate and efficiency of data migration.

[0120] like Figure 4 The diagram shown is a flowchart of one embodiment of a data migration method provided in this disclosure, applied to an electronic device. The method includes:

[0121] 401: Display the migration scheduling page, obtain the configuration parameters entered by the user on the migration scheduling page, and obtain the migration scheduling table corresponding to the configuration parameters. The configuration parameters include the parameters involved in the data migration process.

[0122] Optionally, obtaining the migration schedule table may include: detecting the user's input operation on the migration schedule page, obtaining the configuration parameters input by the user, and obtaining the migration schedule table corresponding to the configuration parameters.

[0123] Optionally, the migration scheduling page can be a page for setting up data migration scheduling. The data migration scheduling page can display multiple parameter input controls, such as text controls, selection controls, etc. Each parameter input control corresponds to a specific scheduling parameter.

[0124] Scheduling parameters may include at least one of the following: the source cluster's IP address (Internet Protocol Address), the target cluster's IP address, the source cluster's system framework version, the target cluster's system framework version, the source cluster's data source, the data table name, the full / incremental migration mode, and bandwidth usage parameters (bandwidth limit values).

[0125] 402: The source cluster controls the sending of a table creation statement to the target cluster. The table creation statement is the statement that generates the first data table stored in the source cluster. The table creation statement is used to instruct the target cluster to generate a second data table according to the data table format of the first data table.

[0126] Controlling the source cluster to send table creation statements to the target cluster can include: sending a table creation statement sending command to the source cluster, and sending a table creation statement receiving command to the target cluster. The source cluster sends the table creation statement to the target cluster based on the statement sending command. The target cluster receives the table creation statement based on the statement receiving command. Alternatively, read or view commands can be directly sent to the target cluster, allowing the target cluster to retrieve the table creation statement from the source cluster via these commands.

[0127] Optionally, when the data processing system is a Hive system, step 402 may include: controlling the target cluster to obtain the first table creation statement of the first data table through the first viewing instruction, wherein the first table format includes: the data table format in Hive mode.

[0128] Optionally, when the data processing system is an HBase system, system 402 may include: controlling the target cluster to obtain a second table creation statement through a first read instruction, the second table creation statement including an HBase table creation statement; controlling the target cluster to obtain a third table creation statement through the second read instruction, the third table creation statement including a Phoenix table creation statement.

[0129] The HBase system can be configured with tables in both HBase and Phoenix schemas. You can query HBase tables from Phoenix schema tables, but you need to establish a mapping between the table names of the Phoenix and HBase tables.

[0130] Electronic devices can generate data migration requests and send them to the target cluster. The target cluster can receive the data migration requests and respond to them by obtaining the table creation statements.

[0131] 403: Generate data migration instructions based on the configuration parameters in the migration schedule table.

[0132] Optionally, step 404 may include: encapsulating a distcp command based on multiple configuration parameters in the migration scheduling table, such as the IP address of the target cluster, the IP address of the source cluster, the system architecture version of the target cluster, bandwidth usage parameters, and migration mode parameters, to obtain a data migration instruction. That is, the data migration instruction may include a distcp command encapsulated with multiple configuration parameters.

[0133] The migration mode parameter indicates the data migration mode, which can be either a full migration mode or an incremental migration mode. Different migration modes can be identified using different mode identifiers. The migration mode parameter can take the value corresponding to any data migration mode. The migration mode parameter can be set according to specific usage requirements.

[0134] 404: A data migration instruction is sent to the target cluster, instructing the target cluster to migrate data from the first data table to the second data table.

[0135] In this embodiment, a migration schedule table can be obtained in response to a cluster scheduling request. The migration schedule table may include configuration parameters involved in the data migration process. The source cluster sends a table creation statement to the target cluster, instructing the target cluster to generate a second data table according to the data format of the first data table, thus achieving automatic generation of the second data table. After the second data table is generated, a data migration instruction can be generated according to the migration schedule table and sent to the target cluster. The data migration instruction can be executed in the target cluster to migrate data from the first data table to the second data table. The data migration instruction is automatically generated by the migration schedule table and does not require user intervention. Simultaneously, through the creation of data tables and the migration of data within the tables, data migration is achieved on a table-by-table basis. The data tables can be directly used for data querying and other processing logic, achieving more comprehensive data migration functionality and improving the success rate and efficiency of data migration.

[0136] like Figure 5 The diagram shown is a structural schematic of one embodiment of a data migration apparatus provided in this disclosure. This apparatus can be configured in a target cluster, and the data migration apparatus 500 may include:

[0137] Statement Acquisition Unit 501: Used to retrieve table creation statements in response to data migration requests. Specifically, the table creation statement is the generation statement of the first data table stored in the source cluster.

[0138] Table generation unit 502: Used to execute table creation statements and generate a second data table according to the data table format of the first data table.

[0139] Instruction receiving unit 503: Used to receive data migration instructions, which are generated according to the configuration parameters of the migration schedule table.

[0140] Instruction execution unit 504: Used to execute data migration instructions to migrate data from the first data table to the second data table.

[0141] As one embodiment, the table creation statement includes: a first table creation statement, and the data table format includes a first table format. The table generation unit 502 may include:

[0142] The first generation module is used to execute the first table creation statement and generate the second data table according to the first table format.

[0143] As one embodiment, the table creation statements include: a second table creation statement and a third table creation statement; the data table format includes a second table format corresponding to the second table creation statement and a third table format corresponding to the third table creation statement. The table generation unit includes:

[0144] The second generation module is used to execute the second table creation statement and generate the first sub-data table according to the second table format.

[0145] The third generation module is used to execute the third table creation statement and generate the second sub-data table according to the third table format.

[0146] The mapping establishment module is used to determine the mapping table based on the table name correspondence between the first sub-data table and the second sub-data table;

[0147] The table determination module is used to determine the mapping table, the second sub-data table, and the first sub-data table as the second data table. The second data table performs data processing operations on the data in the second sub-data table based on the mapping table and the first sub-data table.

[0148] As another embodiment, the configuration parameters include the system framework version of the source cluster and the system framework version of the target cluster. The instruction receiving unit 503 may include:

[0149] The first receiving unit is configured to determine the data migration instruction corresponding to the first migration identifier if the system framework version of the target cluster is the same as that of the source cluster. The first migration identifier is used to indicate data migration between the same versions.

[0150] The second receiving unit is used to determine the data migration instruction corresponding to the second migration identifier if the system framework version of the target cluster is different from the system framework version of the source cluster. The second migration identifier is used to indicate data migration between different versions.

[0151] As another embodiment, the configuration parameters include: bandwidth usage parameters; the instruction execution unit 504 may include:

[0152] The first running module is used to run data migration instructions and migrate data from the first data table to the second data table according to the data transmission rate indicated by the bandwidth occupancy parameter.

[0153] As yet another embodiment, the instruction execution unit 504 may include:

[0154] The task creation module is used to run data migration instructions and generate data migration tasks;

[0155] The task execution module is used to migrate data from the first data table to the second data table through a data migration task;

[0156] The device also includes:

[0157] The status detection unit is used to detect the migration status of the data migration task, including whether the migration is in progress or has been completed.

[0158] The status indicator unit is used to output feedback information indicating that the data migration was successful if the migration status is determined to be complete.

[0159] As yet another embodiment, it also includes:

[0160] The query instruction unit is used to determine the data query instruction for the second data table.

[0161] The data query unit is used to execute query operations on the second data table using data query instructions to obtain query results;

[0162] The first prompt unit is used to output a prompt message indicating that the migration of the second data table was successful if the query result is that the data query was successful.

[0163] The second prompt unit is used to output a prompt message indicating that the migration of the second data table failed if the query result is a data query failure.

[0164] like Figure 6 The diagram shown is a structural schematic of one embodiment of a data migration device provided in this disclosure. The device 600 can be configured in an electronic device and may include:

[0165] Parameter acquisition unit 601: used to display the migration scheduling page, acquire the configuration parameters input by the user on the migration scheduling page, and obtain the migration scheduling table corresponding to the configuration parameters. The configuration parameters include the parameters involved in the data migration process.

[0166] Statement control unit 602: Used to control the source cluster to send the table creation statement to the target cluster. The table creation statement is the generation statement of the first data table stored in the source cluster. The table creation statement is used to instruct the target cluster to generate the second data table according to the data table format of the first data table.

[0167] Instruction generation unit 603: used to generate data migration instructions based on the configuration parameters in the migration schedule table;

[0168] Instruction sending unit 604: Used to send data migration instructions to the target cluster, the data migration instructions instructing the target cluster to migrate data from the first data table to the second data table.

[0169] The steps in this embodiment can execute the data migration method shown in the above embodiments. For details on the specific content executed by each unit and module, please refer to the method description, which will not be repeated here.

[0170] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0171] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product. The control device or testing device involved in the embodiments of this disclosure can be an electronic device, and the specific type of electronic device is not limited herein; for example, it may include a computer, a server, a cloud server, etc.

[0172] According to embodiments of this disclosure, this disclosure also provides a computer program product comprising: a computer program stored in a readable storage medium, at least one processor of an electronic device being able to read the computer program from the readable storage medium, and the at least one processor executing the computer program causing the electronic device to perform the scheme provided in any of the above embodiments.

[0173] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0174] The device structure of the control device or testing device in the foregoing embodiments can be as follows: Figure 7 The electronic device shown.

[0175] like Figure 7 As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 702 or a computer program loaded into random access memory (RAM) 703 from storage unit 708. RAM 703 may also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.

[0176] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0177] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as data migration methods. For example, in some embodiments, the data migration method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the data migration method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the data migration method by any other suitable means (e.g., by means of firmware).

[0178] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0179] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0180] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0181] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0182] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0183] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.

[0184] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0185] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A data migration method, characterized in that, include: In response to a data migration request, a table creation statement is obtained, specifically the statement for generating the first data table stored in the source cluster. Execute the table creation statement to generate a second data table according to the data table format of the first data table; The system receives a data migration instruction, which is generated according to the configuration parameters in the migration schedule table. The migration schedule table is obtained by the user after inputting configuration parameters on the migration schedule page displayed on the electronic device. The parameters include at least one of the following: the IP address of the source cluster, the IP address of the target cluster, the system framework version of the source cluster, the system framework version of the target cluster, the data source where the source cluster is located, the data table name, the full / incremental migration mode, and the bandwidth usage parameters. Run the data migration instruction to migrate the data from the first data table to the second data table; If the table creation statement includes a second table creation statement and a third table creation statement, and the data table format includes a second table format corresponding to the second table creation statement and a third table format corresponding to the third table creation statement; correspondingly, executing the table creation statement to generate a second data table according to the data table format of the first data table includes: Execute the second table creation statement to generate the first sub-data table according to the second table format; Execute the third table creation statement to generate a second sub-data table according to the third table format; the first sub-data table is a Phoenix data table, and the second sub-data table is an HBase data table; The mapping table is determined based on the table name correspondence between the first sub-data table and the second sub-data table; The mapping table, the second sub-data table, and the first sub-data table are determined to be the second data table. The second data table performs data processing operations on the data in the second sub-data table based on the mapping table and the first sub-data table. The configuration parameters include the system framework version of the source cluster and the system framework version of the target cluster. Receiving the data migration instruction includes: If the system framework version of the target cluster is the same as the system framework version of the source cluster, then the data migration instruction corresponding to the first migration identifier is determined. The first migration identifier is used to indicate data migration between the same versions. If the system framework version of the target cluster is different from the system framework version of the source cluster, then the data migration instruction corresponding to the second migration identifier is determined. The second migration identifier is used to indicate data migration between different versions. The configuration parameters include: bandwidth usage parameters; the step of running the data migration instruction to migrate data from the first data table to the second data table includes: Run the data migration instruction to migrate the data from the first data table to the second data table according to the data transmission rate indicated by the bandwidth occupancy parameter; After executing the data migration instruction to migrate data from the first data table to the second data table, the process further includes: Determine the data query instruction for the second data table; Using the data query instruction, execute the query operation on the second data table to obtain the query results; If the query result indicates that the data query was successful, a message indicating that the migration of the second data table was successful will be output. If the query result indicates that the data query failed, a message indicating that the migration of the second data table failed will be output.

2. The method according to claim 1, characterized in that, The table creation statement includes: a first table creation statement, and the data table format includes a first table format; The execution of the table creation statement, generating the second data according to the data table format of the first data table, includes: Execute the first table creation statement to generate the second data table according to the first table format.

3. The method according to claim 1, characterized in that, The step of running the data migration instruction to migrate data from the first data table to the second data table includes: Run the data migration instructions to generate a data migration task; The data migration task is used to migrate data from the first data table to the second data table. The method further includes: Detect the migration status of the data migration task, whereby the migration status includes migration in progress or completed. If the migration status is determined to be completed, a feedback message indicating successful data migration will be output.

4. A data migration method, characterized in that, include: Display the migration scheduling page, obtain the configuration parameters input by the user on the migration scheduling page, and obtain the migration scheduling table corresponding to the configuration parameters. The configuration parameters include parameters involved in the data migration process. The parameters include at least one of the following: source cluster IP address, target cluster IP address, source cluster system framework version, target cluster system framework version, source cluster data source, data table name, full / incremental migration mode, and bandwidth usage parameters. The source cluster sends a table creation statement to the target cluster. This table creation statement is a statement that generates a first data table stored in the source cluster. The statement instructs the target cluster to generate a second data table according to the data table format of the first data table. If the table creation statement includes a second table creation statement and a third table creation statement, the data table format includes a second table format corresponding to the second table creation statement and a third table format corresponding to the third table creation statement. The target cluster executes the second table creation statement to generate a first sub-data table according to the second table format; it then executes the third table creation statement to generate a second sub-data table according to the third table format. The first sub-data table is a Phoenix data table, and the second sub-data table is an HBase data table. A mapping table is determined based on the table name correspondence between the first and second sub-data tables. The mapping table, the second sub-data table, and the first sub-data table are determined to be the second data table. The second data table performs data processing operations on the data in the second sub-data table based on the mapping table and the first sub-data table. Data migration instructions are generated based on the configuration parameters in the migration schedule table. The configuration parameters include the system framework version of the source cluster and the system framework version of the target cluster. If the system framework version of the target cluster is the same as that of the source cluster, a data migration instruction corresponding to a first migration identifier is determined. The first migration identifier is used to indicate data migration between the same versions. If the system framework version of the target cluster is different from that of the source cluster, a data migration instruction corresponding to a second migration identifier is determined. The second migration identifier is used to indicate data migration between different versions. The data migration instruction is sent to the target cluster, instructing the target cluster to migrate data from the first data table to the second data table. The configuration parameters include bandwidth usage parameters. The target cluster executes the data migration instruction, migrating data from the first data table to the second data table according to the data transmission rate indicated by the bandwidth usage parameters. The target cluster determines a data query instruction for the second data table. Using the data query instruction, a query operation is performed on the second data table to obtain the query result. If the query result indicates a successful data query, a message indicating successful migration of the second data table is output; if the query result indicates a failed data query, a message indicating a failed migration of the second data table is output.

5. A data migration device, characterized in that, include: The statement acquisition unit is used to acquire the table creation statement in response to the data migration request. The table creation statement is specifically the generation statement of the first data table stored in the source cluster. The table generation unit is used to execute the table creation statement and generate a second data table according to the data table format of the first data table. The first sub-table is a Phoenix table, and the second sub-table is an HBase table; The instruction receiving unit is used to receive data migration instructions, which are generated according to the configuration parameters of the migration schedule table. The migration schedule table is obtained by the user after inputting configuration parameters on the migration schedule page displayed on the electronic device. The parameters include at least one of the following: the IP address of the source cluster, the IP address of the target cluster, the system framework version of the source cluster, the system framework version of the target cluster, the data source where the source cluster is located, the data table name, the full / incremental migration mode, and the bandwidth usage parameters. An instruction execution unit is used to execute the data migration instruction to migrate data from the first data table to the second data table; If the table creation statement includes a second table creation statement and a third table creation statement, and the data table format includes a second table format corresponding to the second table creation statement and a third table format corresponding to the third table creation statement; correspondingly, the table generation unit includes: The second generation module is used to execute the second table creation statement and generate the first sub-data table according to the second table format. The third generation module is used to execute the third table creation statement and generate the second sub-data table according to the third table format. The mapping establishment module is used to determine the mapping table based on the table name correspondence between the first sub-data table and the second sub-data table; The table determination module is used to determine that the mapping table, the second sub-data table, and the first sub-data table are the second data table, and the second data table performs data processing operations on the data in the second sub-data table based on the mapping table and the first sub-data table; The configuration parameters include the system framework version of the source cluster and the system framework version of the target cluster; the instruction receiving unit includes: The first receiving unit is configured to determine a data migration instruction corresponding to the first migration identifier if the system framework version of the target cluster is the same as the system framework version of the source cluster. The first migration identifier is used to indicate data migration between the same versions. The second receiving unit is configured to determine a data migration instruction corresponding to the second migration identifier if the system framework version of the target cluster is different from the system framework version of the source cluster. The second migration identifier is used to indicate data migration between different versions. The configuration parameters include: bandwidth occupancy parameters; the instruction execution unit includes: a first execution module, used to: execute the data migration instruction and migrate data from the first data table to the second data table according to the data transmission rate indicated by the bandwidth occupancy parameters; The device further includes: A query instruction unit is used to determine a data query instruction for the second data table; The data query unit is used to execute a query operation on the second data table using the data query instruction to obtain query results; The first prompting unit is used to output a prompt message indicating that the migration of the second data table was successful if the query result is that the data query was successful. The second prompting unit is used to output a prompt message indicating that the migration of the second data table has failed if the query result is a data query failure.

6. A data migration device, characterized in that, include: The parameter acquisition unit is used to display the migration scheduling page, acquire the configuration parameters input by the user on the migration scheduling page, and obtain the migration scheduling table corresponding to the configuration parameters. The configuration parameters include parameters involved in the data migration process. The parameters include at least one of the following: source cluster IP address, target cluster IP address, source cluster system framework version, target cluster system framework version, source cluster data source, data table name, full / incremental migration mode, and bandwidth usage parameters. A statement control unit is used to control the source cluster to send a table creation statement to the target cluster. The table creation statement is a statement that generates a first data table stored in the source cluster. The table creation statement instructs the target cluster to generate a second data table according to the data table format of the first data table. If the table creation statement includes a second table creation statement and a third table creation statement, the data table format includes a second table format corresponding to the second table creation statement and a third table format corresponding to the third table creation statement. The target cluster executes the second table creation statement to generate a first sub-data table according to the second table format; executes the third table creation statement to generate a second sub-data table according to the third table format; the first sub-data table is a Phoenix data table, and the second sub-data table is an HBase data table; a mapping table is determined based on the table name correspondence between the first sub-data table and the second sub-data table; the mapping table, the second sub-data table, and the first sub-data table are determined to be the second data table, and the second data table performs data processing operations on the data in the second sub-data table based on the mapping table and the first sub-data table. The instruction generation unit is used to generate data migration instructions based on the configuration parameters in the migration scheduling table. The configuration parameters include the system framework version of the source cluster and the system framework version of the target cluster. If the system framework version of the target cluster is the same as the system framework version of the source cluster, a data migration instruction corresponding to a first migration identifier is determined. The first migration identifier is used to indicate data migration between the same versions. If the system framework version of the target cluster is different from the system framework version of the source cluster, a data migration instruction corresponding to a second migration identifier is determined. The second migration identifier is used to indicate data migration between different versions. An instruction sending unit is configured to send the data migration instruction to the target cluster, the data migration instruction instructing the target cluster to migrate data from the first data table to the second data table; the configuration parameters include: bandwidth occupancy parameters; the target cluster executes the data migration instruction and migrates the data from the first data table to the second data table according to the data transmission rate indicated by the bandwidth occupancy parameters; the target cluster determines a data query instruction for the second data table; using the data query instruction, it executes a query operation on the second data table to obtain a query result; if the query result indicates a successful data query, it outputs a message indicating that the migration of the second data table was successful; if the query result indicates a failed data query, it outputs a message indicating that the migration of the second data table failed.

Citation Information

Patent Citations

  • Data migration method and device

    CN104462119A

  • Data migration method and device, equipment and computer readable storage medium

    CN110162517A