Data migration method, device, computer equipment and storage medium

By using multiple synchronization nodes and multi-threads to synchronize data during the MongoDB data migration process, the problem of slow migration speed caused by limited disk space on the source server is solved, and efficient data migration on multiple servers is achieved.

CN111930715BActive Publication Date: 2024-09-13BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010686922.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-16
Publication Date
2024-09-13
Estimated Expiration
2040-07-16

AI Technical Summary

Technical Problem

During the MongoDB data migration process, the source server disk space is limited, resulting in a slow data migration speed. Especially when the data level is high, the physical migration speed is limited.

Method used

By starting the same number of synchronization nodes as the logical database on the source server and distributing these nodes on multiple servers, multi-threads are used to synchronize data to increase the data migration rate.

Benefits of technology

When the disk space of a single server is limited, through multiple synchronization nodes and multi-thread synchronization, the speed of data migration is significantly improved and migration bottlenecks caused by disk space limitations are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111930715B
    Figure CN111930715B
Patent Text Reader

Abstract

The present application relates to a data migration method, device, computer equipment and storage medium, and relates to the field of cloud computing. The method includes: receiving a data migration request, the data migration request includes a source server address and a target server address; obtaining source data information according to the source server address, the source data information includes a logical database; counting the number of logical databases in the source data information to obtain a first value; starting the same number of synchronization nodes as the first value, each synchronization node corresponding to a logical database; each synchronization node synchronizes the data in the corresponding logical database according to the target server address. By setting the same number of synchronization nodes as the logical database in the source server on the server, and each synchronization node is distributed on multiple servers, multiple synchronization nodes can still be started when the disk space of a single server is limited, thereby speeding up the data migration rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data migration method, apparatus, computer equipment and storage medium. Background Art

[0002] As time goes by, the data stored in MongoDB continues to increase. When the MongoDB kernel needs to be upgraded, the MongoDB data needs to be migrated. Currently, the main methods of data migration include physical migration and logical migration. Physical migration relies on the storage space of the server, but the disk space of the server (source server) is relatively limited. When the amount of stock data is high, the data migration speed is slow due to the limitation of the disk space of the source server when performing data migration. Summary of the invention

[0003] In order to solve the above technical problems, the present application provides a data migration method, apparatus, computer device and storage medium.

[0004] In a first aspect, the present application provides a data migration method, comprising:

[0005] receiving a data migration request, wherein the data migration request includes a source server address and a target server address;

[0006] Acquire source data information according to the source server address, wherein the source data information includes a logical database;

[0007] Counting the number of the logical databases in the source data information to obtain a first value;

[0008] Start the same number of synchronization nodes as the first value, each synchronization node corresponding to one of the logical databases;

[0009] Each of the synchronization nodes synchronizes the data in the corresponding logical database according to the target server address.

[0010] In a second aspect, the present application provides a data migration device, including:

[0011] A request receiving module, used to receive a data migration request, wherein the data migration request includes a source server address and a target server address;

[0012] A data acquisition module, used to acquire source data information according to the source server address, wherein the source data information includes a logical database;

[0013] A numerical statistics module, used for counting the number of the logical databases in the source data information to obtain a first numerical value;

[0014] A synchronization node startup module, used for starting the same number of synchronization nodes as the first value, each synchronization node corresponding to one of the logical databases;

[0015] The data synchronization module is used for each synchronization node to synchronize the data in the corresponding logical database according to the target server address.

[0016] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:

[0017] receiving a data migration request, wherein the data migration request includes a source server address and a target server address;

[0018] Acquire source data information according to the source server address, wherein the source data information includes a logical database;

[0019] Counting the number of the logical databases in the source data information to obtain a first value;

[0020] Start the same number of synchronization nodes as the first value, each synchronization node corresponding to one of the logical databases;

[0021] Each of the synchronization nodes synchronizes the data in the corresponding logical database according to the target server address.

[0022] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0023] receiving a data migration request, wherein the data migration request includes a source server address and a target server address;

[0024] Acquire source data information according to the source server address, wherein the source data information includes a logical database;

[0025] Counting the number of the logical databases in the source data information to obtain a first value;

[0026] Start the same number of synchronization nodes as the first value, each synchronization node corresponding to one of the logical databases;

[0027] Each of the synchronization nodes synchronizes the data in the corresponding logical database according to the target server address.

[0028] The above-mentioned data migration method, device, computer equipment and storage medium, the method includes: receiving a data migration request, the data migration request includes a source server address and a target server address; obtaining source data information according to the source server address, the source data information includes a logical database; counting the number of logical databases in the source data information to obtain a first value; starting the same number of synchronization nodes as the first value, each synchronization node corresponding to a logical database; each synchronization node synchronizes the data in the corresponding logical database according to the target server address. By setting the same number of synchronization nodes as the logical database in the source server on the server, and each synchronization node is distributed on multiple servers, multiple synchronization nodes can still be started in the case of limited disk space on a single server, thereby accelerating the data migration rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0031] Figure 1 An application environment diagram of a data migration method in an embodiment;

[0032] Figure 2 A schematic diagram of a data migration method in one embodiment;

[0033] Figure 3 is a structural block diagram of a data migration device in one embodiment;

[0034] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0036] Figure 1 FIG. 1 is an application environment diagram of a data migration method in an embodiment. Figure 1 , the data migration method is applied to a data migration system. The data migration system includes a source server cluster 110 (including source server 111, source server 112, source server 113) and a target server cluster 120 (including target server 121, target server 122, target server 123). The control node can be set on any source server in the source server cluster 110, and each synchronization node is set in each source server in the source server cluster 110. The number of synchronization nodes set on each source server can be customized, such as determined according to the resources of the source server, wherein the resources include memory resources, computing resources, network resources, etc. Different resources set different numbers of synchronization nodes. Taking the control node set on the source server 111 as an example, the control node on the source server 111 receives a data migration request, which includes the source server address and the target server address; obtains source data information according to the source server address, and the source data information includes a logical database; counts the number of logical databases in the source data information to obtain a first value; starts the same number of synchronization nodes as the first value, each synchronization node corresponds to a logical database, and the synchronization node is located in the source server; each synchronization node synchronizes the data in the corresponding logical database according to the target server address.

[0037] The control node and synchronization node may also be set on other servers besides the source server cluster 110 and the target server cluster 120 .

[0038] like Figure 2 As shown, in one embodiment, a data migration method is provided. This embodiment mainly applies the method to the above Figure 1 The source server 111 (source server 112 or source server 113) in FIG. 1 is used as an example, and the control node and the synchronization node are set on the source server. Figure 2 , the data migration method specifically includes the following steps:

[0039] Step S201: receiving a data migration request.

[0040] In this specific embodiment, the data migration request includes a source server address and a target server address.

[0041] Step S202, obtaining source data information according to the source server address.

[0042] In this embodiment, the source data information includes a logical database.

[0043] Step S203, counting the number of logical databases in the source data information to obtain a first value.

[0044] Step S204, starting the synchronization nodes whose number is the same as the first value, each synchronization node corresponding to a logical database.

[0045] Step S205: Each synchronization node synchronizes the data in the corresponding logical database according to the target server address.

[0046] Specifically, a data migration request refers to a request for performing data migration. The source server address is used to uniquely identify the source server, and the target server address is used to uniquely identify the target server. The source data information is obtained from the source server according to the source server address. The source data information includes data meta information, and the data meta information includes all logical database information of the logical database. The MongoDB database also includes config, local and admin logical databases. The above three logical libraries are system libraries of the MongoDB database. In this case, the above system libraries can be synchronized or not.

[0047] After receiving the data meta information, the control node counts the number of logical databases according to the data meta information to obtain a first value. The data of the synchronization node is determined according to the amount of data in the logical database, that is, each synchronization node corresponds to a logical database. If the business of Company A includes three logical databases, the first value is 3. If it includes four logical databases, the first value is 4, and 4 synchronization nodes are required to perform the data synchronization process. The synchronization node can be set on the source server, such as the source server where each logical database table is located, or it can be set on other source servers. The specific setting can be determined based on the resources of each source server. The resources of the source server include but are not limited to disk space, computing resources, etc. The synchronization node can also be set on other servers other than the source server.

[0048] In one embodiment, when the synchronization node synchronizes data in the logical database, it can use a single thread or a multi-thread method to synchronize data. The logical database may include one or more logical data tables, each of which may correspond to one thread, or multiple logical data tables may correspond to one thread.

[0049] In one embodiment, the logical data table includes document data and index data. Document data refers to the real stored data, and index data is used to facilitate the query of document data. The data in the synchronization logical table can be synchronized with document data first, then synchronized with index data, or synchronized with index data first and then synchronized with documents.

[0050] In one embodiment, when synchronizing data in a logical data table, a driver of a source server may be used to obtain data in the logical data table, and the obtained data may be synchronized to a target server.

[0051] In one embodiment, when synchronizing index data, data synchronization can be performed in a foreground indexing method or a background indexing method. The background indexing method is to let the database build the index. After the data is migrated, the data migration task is terminated, and it is impossible to know whether the index is built or whether it is completed.

[0052] In one embodiment, the current thread of the current synchronization node synchronizes the index data in the logical data table, including: synchronizing the index data in the logical data table by the current thread of the current synchronization node in a foreground indexing manner. The foreground indexing manner allows the corresponding index to be established when the migration of the logical data table ends, so that the establishment of the index can be clearly known.

[0053] In one embodiment, after the current thread of the current synchronization node synchronizes the index data in the logical data table, the task completion information of the current thread of the current synchronization node is reported to the current synchronization node, a stop instruction for stopping the current thread of the current synchronization node is generated, and the stop instruction is executed.

[0054] Specifically, when the current thread of the current synchronization node completes synchronizing the index data in the logic data table, it indicates that the data in the logic data table corresponding to the current thread has been transmitted. The data transmission has been completed, and the current synchronization node receives the task completion information of the thread, and then generates a stop instruction for stopping the thread, executes the stop instruction, and stops the thread.

[0055] In one embodiment, after each thread of the current synchronization node completes synchronizing the index data in the logic data table, the task completion information of the current node is reported to the control node, a shutdown instruction for shutting down the current synchronization node is generated, and the shutdown instruction is executed. Each thread directly stops the thread after completing the task.

[0056] Specifically, when all threads of the current synchronization node have synchronized the index data in the logical data table, it means that the data in the logical database corresponding to the current synchronization node has been synchronized, and the synchronization node is closed. When the control node receives the task completion information reported by the current synchronization node, it generates a shutdown instruction and executes the shutdown instruction to close the synchronization node.

[0057] In one embodiment, when the control node receives task completion information reported by all synchronization nodes, the task status of the data migration request is modified to completed.

[0058] Specifically, if the control node receives task completion information reported by each synchronization node, it indicates that data migration has been completed. Therefore, when receiving information reported by each synchronization node, the task status of the data synchronization task corresponding to the data migration request is modified to completed. Each synchronization node closes the synchronization node after completing the corresponding data synchronization.

[0059] The above data migration method includes: receiving a data migration request, the data migration request includes a source server address and a target server address; obtaining source data information according to the source server address, the source data information includes a logical database; counting the number of logical databases in the source data information to obtain a first value; starting the same number of synchronization nodes as the first value, each synchronization node corresponding to a logical database; each synchronization node synchronizes the data in the corresponding logical database according to the target server address. By setting the same number of synchronization nodes as the logical database on the source server, and each synchronization node is distributed on multiple source servers, multiple synchronization nodes deployed in multiple source servers can still be started when the disk space of a single source server is limited, and the data migration rate is improved by starting multiple threads of multiple synchronization nodes.

[0060] In one embodiment, the logic database includes logic data tables. Step S205 includes: the thread of the current synchronization node synchronizes the corresponding logic data table according to the target server address, wherein each logic data table corresponds to one thread.

[0061] Specifically, the data in each logical data table is synchronized using a corresponding thread. The current synchronization node can be any synchronization node among the synchronization nodes started by the control node. The number of logical data tables corresponding to each synchronization node is determined according to the business. When each synchronization node performs data transmission, the number of threads started is determined according to the number of logical data tables, that is, the thread data started by each synchronization node is the same as the number of logical data tables in the logical database corresponding to the synchronization node. One thread corresponds to one logical data table, which can better control the thread. And the synchronization node with more logical data tables uses more threads, which can speed up the data transmission efficiency and avoid affecting the transmission efficiency of the entire data transmission task due to the transmission efficiency of the thread.

[0062] In one embodiment, the logical data table includes document data and index data, and step S205 includes: the current thread of the current synchronization node synchronizes the document data of the logical data table according to the target server address; after the current thread of the current synchronization node completes synchronization of the document data of the logical data table, the current thread of the current synchronization node synchronizes the index data in the logical data table.

[0063] Specifically, the current thread can refer to any thread in the current synchronization node. When the current thread synchronizes the data in the logical data table corresponding to the thread, the document data is synchronized first, and the index data is synchronized after the document data is synchronized. Prioritizing the synchronization of document data can first ensure that the stored data can be transmitted first, and secondly, it is more efficient and has better performance to transmit the document data first. Because when the index data is synchronized first, new index data will be inserted into the synchronized document data during the subsequent synchronization of the document data, thereby affecting the data synchronization performance. Therefore, the synchronization efficiency is better by synchronizing the document data first and then synchronizing the index data.

[0064] In one embodiment, the current thread of the current synchronization node synchronizes the document data of the logical data table according to the target server address, including: obtaining the document data of the data table from the source end according to the driver of the source end server through the current thread of the current synchronization node; and driving the document data of the data table to write the target end server corresponding to the target end server address through the current thread of the current synchronization node. Specifically, the driver obtains the document data of the synchronization node and writes the obtained data to the target end server.

[0065] In a specific embodiment, the data migration method includes:

[0066] For the source MongoDB (data in the MongoDB database stored in the source server), start the control node and obtain the data metadata information of the source MongoDB through the control node, including all logical database information except the config, local, and admin logical databases.

[0067] The control node calculates the number of all logical databases, starts the same number of synchronization nodes, and sends the corresponding synchronization tasks, that is, the names of the corresponding logical databases, to the corresponding synchronization nodes. For example, S Company has three logical databases, train (train ticket business), ticket (travel ticket business) and hotel (hotel business). Three synchronization nodes are needed to synchronize the corresponding business line logical databases. Synchronization node a synchronizes the train logical database, synchronization node b synchronizes the ticket logical database, and synchronization node c synchronizes the hotel logical database.

[0068] Synchronous node a obtains all logical data tables under train. If it includes two tables, namely collection1 and collection2, two child threads are started, such as thread1 and thread2. Thread1 synchronizes the document data and index data of collection1, while thread2 synchronizes the document data and index data of collection2. After the synchronization of child thread 1 is completed, it reports to the synchronization node a and automatically exits. After the synchronization of child thread 2 is completed, it reports to the synchronization node a and automatically exits. After receiving the completion of all child threads, the synchronization node a reports to the control node and automatically exits.

[0069] When thread1 and thread2 perform data synchronization, the document data is synchronized first, and the index data is synchronized second. When synchronizing document data, the corresponding driver of MongoDB is used to pull data from the source MongoDB and then write it to the target MongoDB. When synchronizing index data, the foreground indexing method is used, which ensures that the corresponding index has been established when the migration of this logical data table is completed.

[0070] Synchronization node b synchronizes the ticket logical database, synchronization node c synchronizes the hotel logical database, and synchronizes the train logical database with synchronization node a using a unified synchronization method.

[0071] When the control node receives the reporting information from all synchronization nodes, it updates the status of this stock data migration task, and this stock data migration task ends.

[0072] The above data migration method controls multiple synchronization nodes through a control node, and each synchronization node controls multiple threads, which greatly improves the parallel characteristics of data synchronization and avoids the limitation of the local disk on the source side during physical migration.

[0073] The control node is responsible for building and starting the synchronization node according to the data distribution of the database in the source server. For each logical database, a synchronization node is started. Each synchronization node corresponds to a process and is responsible for synchronizing the corresponding logical database. At the same time, the synchronization node will start a thread to synchronize the corresponding data table for each data table according to the distribution of the data tables contained in the logical database, that is, one data table is synchronized with one thread. This method significantly improves the data transmission rate when the data volume is relatively large.

[0074] Figure 2 FIG. 1 is a flow chart of a data migration method in one embodiment. It should be understood that although Figure 2The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0075] In one embodiment, Figure 3 As shown, a data migration device 200 is provided, comprising:

[0076] The request receiving module 201 is used to receive a data migration request, where the data migration request includes a source server address and a target server address;

[0077] The data acquisition module 202 is used to acquire source data information according to the source server address, wherein the source data information includes a logical database;

[0078] A numerical statistics module 203 is used to count the number of logical databases in the source data information to obtain a first numerical value;

[0079] A synchronization node starting module 204, used to start the same number of synchronization nodes as the first value, each synchronization node corresponding to a logical database;

[0080] The data synchronization module 205 is used for each synchronization node to synchronize the data in the corresponding logical database according to the target server address.

[0081] In one embodiment, the data synchronization module 205 is specifically used to synchronize the logical data tables according to the target server address using the thread of the current synchronization node, wherein each logical data table corresponds to one thread.

[0082] In one embodiment, the logical data table includes document data and index data, and the data synchronization module 205 is specifically used for the current thread of the current synchronization node to synchronize the document data of the logical data table according to the target server address; after the current thread of the current synchronization node completes the synchronization of the document data of the logical data table, the current thread of the current synchronization node synchronizes the index data in the logical data table.

[0083] In one embodiment, the data synchronization module 205 is specifically used to synchronize the index data in the logical data table by using the current thread of the current synchronization node and establishing the index in the foreground.

[0084] In one embodiment, the data synchronization module 205 is specifically used to obtain the document data of the data table from the source end according to the driver of the source server through the current thread of the current synchronization node; and drive the document data of the data table to be written to the target server corresponding to the target server address through the current thread of the current synchronization node.

[0085] In one embodiment, the data migration device 200 further includes:

[0086] The thread stop module is used to report the task completion information of the current thread of the current synchronization node to the current synchronization node after the current thread of the current synchronization node synchronizes the index data in the logical data table, generate a stop instruction for stopping the current thread of the current synchronization node, and execute the stop instruction.

[0087] In one embodiment, the data migration device 200 further includes:

[0088] The synchronization node closing module is used to report the task completion information of the current node to the control node after each thread of the current synchronization node synchronizes the index data in the logical data table, generate a closing instruction for closing the current synchronization node, and execute the closing instruction.

[0089] In one embodiment, the data migration device 200 further includes:

[0090] The task status update module is used to modify the task status of the data migration request to completed when the control node receives the task completion information reported by all the synchronization nodes.

[0091] Figure 4 The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be Figure 1 The terminal 110 (or server 120) in FIG. Figure 4 As shown, the computer device includes a processor, a memory, a network interface, an input device and a display screen connected via a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program, which, when executed by the processor, enables the processor to implement a data migration method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to execute a data migration method. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0092] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0093] In one embodiment, the data migration device provided by the present application can be implemented in the form of a computer program. The computer program can be Figure 4 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the data migration device, such as: Figure 3 The request receiving module 201, data acquisition module 202, numerical statistics module 203, synchronization node startup module 204 and data synchronization module 205 are shown. The computer program composed of various program modules enables the processor to execute the steps of the data migration method of each embodiment of the present application described in this specification.

[0094] For example, Figure 4 The computer device shown can be Figure 3 The request receiving module 201 in the data migration device shown executes receiving a data migration request, and the data migration request includes a source server address and a target server address. The computer device can obtain source data information according to the source server address through the data acquisition module 202, and the source data information includes a logical database. The computer device can execute the statistical number of logical databases in the source data information through the numerical statistics module 203 to obtain a first numerical value. The computer device can execute the startup of the same number of synchronization nodes as the first numerical value through the synchronization node startup module 204, each synchronization node corresponds to a logical database, and the synchronization node is located in the source server. The computer device can execute each synchronization node to synchronize the data in the corresponding logical database according to the target server address through the data synchronization module 205.

[0095] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps in any one of the embodiments of the above-mentioned data migration method are implemented.

[0096] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in any embodiment of the above-mentioned data migration method are implemented.

[0097] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0098] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0099] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A data migration method, characterized in that: The method comprises: receiving a data migration request, wherein the data migration request includes a source server address and a target server address; Acquire source data information according to the source server address, wherein the source data information includes a logical database; Counting the number of the logical databases in the source data information to obtain a first value; Start the same number of synchronization nodes as the first value, each synchronization node corresponding to one of the logical databases; Each of the synchronization nodes synchronizes the data in the corresponding logical database according to the target server address; The logic database includes a logic data table, and each of the synchronization nodes synchronizes the data in the logic database according to the target server address, including: The thread of the current synchronization node synchronizes the logical data table according to the target server address, wherein each logical data table corresponds to one thread; The logical data table includes document data and index data. The thread of the current synchronization node synchronizes the logical data table according to the target server address, including: The current thread of the current synchronization node synchronizes the document data of the logical data table according to the target server address; After the current thread of the current synchronization node completes synchronization of the document data of the logical data table, the index data in the logical data table is synchronized through the current thread of the current synchronization node.

2. The method according to claim 1, characterized in that The step of synchronizing the index data in the logic data table using the current thread of the current synchronization node includes: The index data in the logic data table is synchronized by the current thread of the current synchronization node in a foreground indexing manner.

3. The method according to claim 1, characterized in that The current thread of the current synchronization node synchronizes the document data of the logical data table according to the target end server address, including: Obtaining document data of a data table from the source end through the current thread of the current synchronization node according to the driver of the source end server; The driver writes the document data of the data table to the target server corresponding to the target server address through the current thread of the current synchronization node.

4. The method according to claim 1, characterized in that: The method further comprises: After the current thread of the current synchronization node completes synchronizing the index data in the logical data table, the task completion information of the current thread of the current synchronization node is reported to the current synchronization node, a stop instruction for stopping the current thread of the current synchronization node is generated, and the stop instruction is executed.

5. The method according to claim 4, characterized in that The method further comprises: After each thread of the current synchronization node completes synchronizing the index data in the logic data table, the task completion information of the current node is reported to the control node, a shutdown instruction for shutting down the current synchronization node is generated, and the shutdown instruction is executed.

6. The method according to claim 5, characterized in that The method further comprises: When the control node receives the task completion information reported by all the synchronization nodes, the task status of the data migration request is modified to completed.

7. A data migration device, characterized in that: The device comprises: A request receiving module, used to receive a data migration request, wherein the data migration request includes a source server address and a target server address; A data acquisition module, used to acquire source data information according to the source server address, wherein the source data information includes a logical database; A numerical statistics module, used for counting the number of the logical databases in the source data information to obtain a first numerical value; A synchronization node startup module, used for starting the same number of synchronization nodes as the first value, each synchronization node corresponding to one of the logical databases; A data synchronization module, used for each synchronization node to synchronize the data in the corresponding logical database according to the target server address; The data synchronization module is used for the thread of the current synchronization node to synchronize the logical data table according to the target server address, wherein each logical data table corresponds to one thread; The logical data table includes document data and index data. The data synchronization module is used for the current thread of the current synchronization node to synchronize the document data of the logical data table according to the target server address; after the current thread of the current synchronization node completes synchronization of the document data of the logical data table, the index data in the logical data table is synchronized through the current thread of the current synchronization node.

8. The device according to claim 7, characterized in that The data synchronization module is used to synchronize the index data in the logic data table by using the current thread of the current synchronization node and adopting the foreground indexing method.

9. The device according to claim 7, characterized in that The data synchronization module is used to obtain the document data of the data table from the source end through the current thread of the current synchronization node according to the driver of the source end server; through the current thread of the current synchronization node, the driver writes the document data of the data table to the target end server corresponding to the target end server address.

10. The device according to claim 7, characterized in that The device also includes: A thread stop module is used to report the task completion information of the current thread of the current synchronization node to the current synchronization node after the current thread of the current synchronization node synchronizes the index data in the logical data table, generate a stop instruction for stopping the current thread of the current synchronization node, and execute the stop instruction.

11. The device according to claim 10, characterized in that The device also includes: The synchronization node closing module is used to report the task completion information of the current node to the control node after each thread of the current synchronization node synchronizes the index data in the logical data table, generate a closing instruction for closing the current synchronization node, and execute the closing instruction.

12. The device according to claim 11, characterized in that The device also includes: The task status updating module is used to modify the task status of the data migration request to completed when the control node receives the task completion information reported by all the synchronization nodes.

13. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.