A database migration system, method, and computer-readable storage medium

By employing a multi-threaded processor and a shared memory table design, the problems of high memory consumption and low efficiency in database migration are solved, achieving efficient database object migration and reducing memory usage.

CN115269551BActive Publication Date: 2026-08-04CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CLOUD TECH CO LTD
Filing Date
2022-07-28
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

During database migration, existing technologies require loading a large number of objects into memory for sorting, resulting in high memory consumption and low migration efficiency, especially when the number of objects is large.

Method used

A multi-threaded processor is used, and the creation identifier of objects is recorded in a shared table in shared memory. Only objects that have not yet been created and their dependent objects are created in the target database, avoiding loading all object information into memory for sorting. A data distributor is used for block processing and parallel migration.

Benefits of technology

It improves the efficiency of database migration, reduces memory usage, and enables a highly efficient object migration process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269551B_ABST
    Figure CN115269551B_ABST
Patent Text Reader

Abstract

The application provides a database migration system, method and computer readable storage medium, which can have high efficiency. The system comprises a processor, the processor comprises a plurality of threads: any thread in the plurality of threads is configured to: query whether a creation identifier of a target object in a shared table is an uncreated identifier, the shared table being in a shared memory, the uncreated identifier representing that the object is not created in a second database; when it is queried that the creation identifier of the target object is the uncreated identifier, detect whether creation information of the target object comprises a dependency relationship between the target object and at least one other object; if it is detected that the creation information of the target object comprises the dependency relationship between the target object and the at least one other object, create the target object in the second database after it is queried that a creation identifier of each other object in the shared table is a created identifier, and set the creation identifier of the target object in the shared table as the created identifier, the created identifier representing that the object is created in the second database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database technology, and discloses a database migration system, method, and computer-readable storage medium. Background Technology

[0002] With the widespread use of databases, various database types have emerged. This has led to a need for data migration between different databases. Currently, when migrating between different databases, object creation requires addressing interdependencies. Especially when the number of objects in the database is large, existing migration methods load all objects from the source database into memory, sort them, and then create them sequentially in the new database. This migration method consumes a significant amount of memory and is inefficient. Summary of the Invention

[0003] This application provides a database migration system, method, and computer-readable storage medium that can achieve high migration efficiency.

[0004] In a first aspect, embodiments of this application provide a database migration system, including a processor, the processor including multiple threads: any one of the multiple threads is configured to: obtain a first block, the first block including creation information of at least one object in a first database, the first block being a block after processing the creation information of all objects included in the first database; query whether the creation identifier of a target object in a shared table is an uncreated identifier, the shared table being in shared memory, the target object being any one of the at least one object, the uncreated identifier indicating that the object has not been created in a second database; when the creation identifier of the target object is found to be the uncreated identifier, detect whether the creation information of the target object includes a dependency relationship between the target object and at least one other object; if the creation information of the target object includes a dependency relationship between the target object and at least one other object, then after querying that the creation identifier of each of the other objects in the shared table is a created identifier, create the target object in the second database, and set the creation identifier of the target object to a created identifier in the shared table, the created identifier indicating that the object has been created in the second database.

[0005] In one possible implementation, any thread is further configured to: after detecting that the creation information of the target object includes a dependency relationship between the target object and at least one other object, query the shared table to see if the creation identifier of each of the other objects is the uncreated identifier; if the creation identifier of the first object among the at least one other object is found to be the uncreated identifier, then obtain the creation information of the first object and detect whether the creation information of the first object includes a dependency relationship between the first object and any other object; if the creation information of the first object does not include a dependency relationship between the first object and any other object, then create the first object and set the creation identifier of the first object to the created identifier in the shared table; if the creation information of the first object includes a dependency relationship between the first object and at least one second object, then after querying that the creation identifier of each of the second objects in the shared table is the created identifier, create the first object in the second database and set the creation identifier of the first object to the created identifier in the shared table.

[0006] In one possible implementation, the thread is further configured to: if it is detected that the creation information of the target object does not include the dependency relationship between the target object and any object, then create the target object in the second database and set the creation identifier of the target object to a created identifier in the shared table.

[0007] In one possible implementation, the system further includes a data distributor; the data distributor is configured to: divide the creation information of all objects into blocks to obtain multiple blocks, and send the multiple blocks to the multiple threads respectively.

[0008] In one possible implementation, the system further includes a data acquisition module; the data acquisition module is configured to: acquire creation information of all objects from the first database; and save the creation information of all objects to a disk.

[0009] In one possible implementation, when any thread obtains the creation information of the first object, it is specifically used to: obtain the creation information of the first object from the first block; or, obtain the creation information of the first object from the disk.

[0010] Secondly, embodiments of this application provide a database migration method, including:

[0011] Obtain a first block, which includes creation information of at least one object in a first database. The first block is a block after processing the creation information of all objects included in the first database. Query whether the creation identifier of the target object in the shared table is an "uncreated" identifier. The shared table is in shared memory, and the target object is any one of the at least one objects. The "uncreated" identifier indicates that the object has not been created in the second database. When the creation identifier of the target object is found to be an "uncreated" identifier, check whether the creation information of the target object includes a dependency relationship between the target object and at least one other object. If the creation information of the target object includes a dependency relationship between the target object and at least one other object, after querying that the creation identifier of each of the other objects in the shared table is a "created" identifier, create the target object in the second database and set the creation identifier of the target object in the shared table to a "created" identifier. The "created" identifier indicates that the object has been created in the second database.

[0012] In one possible implementation, in the database migration method provided in this application embodiment, after detecting that the creation information of the target object includes a dependency relationship between the target object and at least one other object, before creating the target object in the second database, the method further includes: querying the shared table to see if the creation identifier of each of the other objects is the uncreated identifier; if the creation identifier of the first object among the at least one other object is found to be the uncreated identifier, then the creation information of the first object is obtained, and the creation information of the first object is detected to include a dependency relationship between the first object and any object; if the creation information of the first object is detected to not include a dependency relationship between the first object and any object, then the first object is created, and the creation identifier of the first object is set to the created identifier in the shared table; if the creation information of the first object includes a dependency relationship between the first object and at least one second object, then after querying that the creation identifier of each second object in the shared table is the created identifier, the first object is created in the second database, and the creation identifier of the first object is set to the created identifier in the shared table.

[0013] In one possible implementation, the database migration method provided in this application further includes: if the creation information of the target object does not include the dependency relationship between the target object and any object, then the target object is created in the second database, and the creation identifier of the target object is set to a created identifier in the shared table.

[0014] Thirdly, this application provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform a database migration method.

[0015] Fourthly, this application provides a computer program product comprising a computer program that, when executed by a computer, implements the steps of the above-described database migration method.

[0016] The beneficial effects of the embodiments of this application are as follows:

[0017] This application provides a database migration system, method, and computer-readable storage medium. Multiple threads can create objects in each block of a second database, or objects that have dependencies on the objects, based on shared tables in shared memory, to migrate objects to the second database. Multiple threads can migrate all objects, which can improve migration efficiency. Furthermore, the shared tables can record the creation identifiers of each object, occupying less memory space, and can avoid loading all the information of all objects included in the first database into memory for sorting.

[0018] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram illustrating an application scenario provided in the embodiments of this application;

[0021] Figure 2 This is a schematic diagram of the structure of the database migration system provided in the embodiments of this application;

[0022] Figure 3 A flowchart of a database migration method according to an exemplary embodiment is shown;

[0023] Figure 4 A flowchart illustrating another database migration method according to an exemplary embodiment. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this application. Obviously, the described embodiments are only some embodiments of the technical solutions of this application, and not all embodiments. Based on the embodiments recorded in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the technical solutions of this application.

[0025] With the widespread use of relational databases, different database types have different focuses in their use. Database users (hereinafter referred to as users) have the need to migrate data between databases. For example, a user needs to replace an Oracle database with PostgreSQL. In cases where the number of objects in the Oracle database may be large, loading all the objects from the Oracle database into memory and then sorting them requires a large amount of memory and is uncontrollable. Creating objects after sorting can only be done in the sorted order, which makes data migration inefficient.

[0026] To address the aforementioned problem of low database migration efficiency, embodiments of this application provide a database migration system with high migration efficiency. It should be noted that the specific examples of databases described above are only used to illustrate the shortcomings in data migration and are not intended to limit the specific application scenarios of the database migration system and method provided in this application.

[0027] Figure 1 An exemplary embodiment illustrates an application scenario of a database migration system, which can migrate objects from a source database (hereinafter referred to as the first database) to a destination database (hereinafter referred to as the second database).

[0028] Figure 2 A schematic diagram of a database migration system is shown according to an exemplary embodiment. The database migration system can perform data migration using the creation information of all objects included in the first database. In this embodiment, data migration refers to database object migration. Optionally, the object can be any type of database object, such as table objects, view objects, stored procedure objects, etc., and this application does not impose excessive limitations on this.

[0029] The database migration system may include processor 201. Optionally, the processor involved in the embodiments of this application may be a central processing unit (CPU), a general-purpose processor, a graphics processing unit (GPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.

[0030] In this embodiment of the application, the processor 201 may include multiple first threads 201A. Each first thread 201 can execute the database migration method provided in this embodiment of the application. The following description uses one first thread 201A as an example.

[0031] Any one of the multiple first threads 201A can obtain the first block. The first block includes creation information of at least one object. The first block can be any block after the creation information of all objects included in the first database has been segmented.

[0032] In one possible design, the object creation information can be the object's creation statement in the first database. In this application, object A and object B have a dependency relationship, indicating that object A depends on object B. Object B can also be called a dependent object of object A. Generally, if object A and object B have a dependency relationship, then the creation statement of object A includes object B. The first thread 201A can determine whether object A and object B have a dependency relationship based on whether the creation statement of object A includes object B, or in other words, whether the creation statement of object A includes the dependency relationship between object A and object B. If object A has no dependency relationship with any other object, then the creation statement of object A does not include other objects. The first thread 201A can determine whether object A has no creation relationship with any object based on whether the creation statement of object A does not include other objects, or in other words, whether the creation statement of object A does not include the dependency relationship between object A and object B. The process by which the first thread 201A determines whether the creation information of object A includes the dependency relationship between object A and other objects can also be called resolving the dependency relationship of object A.

[0033] Thread 201A can obtain n objects by parsing the creation information of n objects in the first block. To facilitate the explanation of the processing of Thread 201A, any one of the n objects will be designated as the target object.

[0034] First thread 201A can query the shared table to see if the creation identifier of the target object is "not created". The shared table is located in shared memory 204, and each first thread 201A can access the shared table in shared memory 204. The shared table can record the creation identifiers of each object. In this embodiment, "not created" indicates that the object has not been created in the second database. "Created" indicates that the object has been created in the second database. Optionally, the shared table can be a linked list, and objects not recorded in the linked list can be considered to have a "not created" creation identifier. In one possible application scenario, the target's creation identifier can be a "creating in progress" identifier, indicating that the process of creating the object in the second database has not yet ended. If first thread 201A finds that the target object's creation identifier is "creating in progress" in the shared table, it reflects that other first threads in processor 201 are creating the target object in the second database. First thread 201A can choose not to create the target object and wait for the target object's creation identifier to switch to "created" before processing the next object in the first block.

[0035] After thread 201A queries the shared table to check if the creation identifier of the target object is not yet created, in one possible scenario, the creation identifier of the target object in the shared table is already created. This indicates that the target object has already been created in the second database, meaning that the target object has been migrated. Thread 201A can then ignore this target object and process the other objects in the first block.

[0036] In another possible scenario, the creation identifier of the target object is set to "not created," indicating that the target object was not created in the second database. In this case, the first thread 201A can detect whether the creation information of the target object includes a dependency relationship between the target object and at least one other object. If the first thread 201A detects that the creation information of the target object does not include a dependency relationship between the target object and any other object, then the first thread 201A creates the target object in the second database and sets the creation identifier of the target object to "created" in the shared table. In this embodiment, creating the target object in the second database also means migrating the target object to the second database.

[0037] The first thread 201A queries the shared table and finds that the creation identifier of the target object is not created. It also detects that the creation information of the target object includes the dependency relationship between the target object and at least one other object. The first thread 201A can query the shared table for the creation identifier of each object that has a dependency relationship with the target object.

[0038] In one example, after querying the creation identifier of each object that depends on the target object in the shared table, and after confirming that the creation identifiers of each object that depends on the target object are all created, the first thread 201A creates the target object in the second database and sets the creation identifier of the target object to the created identifier in the shared table. The created identifier indicates that the object has been created in the second database. In this embodiment, the first thread 201A can create the target object in the second database after determining that all objects that depend on the target object have been created in the second database, and set the creation identifier of the target object to the created identifier in the shared table. It should be understood that the first thread 201A creates the target object in the second database only after determining that each dependent object of the target object has been created in the second database.

[0039] In another example, after querying the creation identifier of each object that depends on the target object in the shared table, thread 201A finds that at least one of the other objects that depends on the target object has a creation identifier of at least one first object that is not created. For each first object, the following creation operation is performed:

[0040] The first thread 201A obtains the creation information of the first object and detects whether the creation information of the first object includes the dependency relationship between the first object and any other object. For example, the first thread 201A may obtain the creation information of the first object in the first block, or obtain the creation information of the first object from the disk, wherein the disk stores the creation information of all objects included in the first database.

[0041] If the creation information of the first object does not include the dependency relationship between the first object and any other object, then the first object is created, and the creation identifier of the first object is set to the created identifier in the shared table.

[0042] If the creation information of the first object includes a dependency relationship between the first object and at least one second object, then after querying the shared table and finding that the creation identifier of each second object is the already created identifier, the first object is created in the second database, and the creation identifier of the first object is set to the already created identifier in the shared table. That is, after determining that all dependent objects of the first object have been created in the second database, the first thread 201A creates the first object in the second database.

[0043] Similarly, if among all the dependent objects of the first object, there is one whose creation identifier is "not created", the first thread 201A can process that dependent object according to the above-mentioned preset creation operation. Then, after querying and confirming that the creation identifiers of all dependent objects of the first object are all "created", the first thread 201A creates the first object and sets the creation identifier of the first object to "created" in the shared table.

[0044] As explained above, multiple first threads 201 can create objects in parallel and maintain the shared table in shared memory 204, which improves the object creation efficiency in the second database, i.e., object migration efficiency. In this application, for each object, the object is created only after all its dependent objects have been created in the second database. This design can be called a recursive creation method. This method, which can be referred to as a recursive method, avoids the need to load all the information of all objects included in the first database into memory for sorting. Therefore, the data migration system provided in this application embodiment has high migration efficiency and occupies less memory.

[0045] Shared memory 204 can store the aforementioned shared table. Multiple first threads 201A of processor 201 can query and modify the shared table in shared memory 204. In this design, multiple first threads 201A respectively create target objects or dependent objects of target objects in the second database based on the shared table in shared memory 204, thus migrating objects to the second database. For another possible implementation, please refer to... Figure 2 The database migration system may also include a data acquisition module 202. The data acquisition module 202 can be used to acquire creation information for all objects from the first database. In some examples, the data acquisition module 202 can save the creation information of all objects included in the first database to disk or the application database. Optionally, the application database is the local database of the data migration system.

[0046] Please continue reading Figure 2 The database migration system may also include a data distributor 203. The data distributor 203 may have the capability or function of data chunking. The data distributor 203 can chunk the dependencies of all objects included in the first database, resulting in multiple chunks. The data distributor 203 can then send these multiple chunks to multiple first threads 203A.

[0047] In one possible design, the data distributor 203 can perform block processing on the creation information of all objects included in the first database through multiple loading operations.

[0048] In each load operation, the data distributor 203 can retrieve part or all of the unprocessed creation information from the creation information of all objects included in the first database from the disk. The creation information retrieved in each load operation can be unique. In each load operation, the data distributor 203 can process the retrieved creation information into blocks, obtaining multiple blocks, and send them to multiple first threads 201A respectively.

[0049] Based on the same inventive concept, embodiments of this application also provide a database migration method. Figure 3 An exemplary embodiment illustrates a database migration method, which can be applied to a data migration system. The method may include the following steps:

[0050] Step S301: Obtain the first block. The first block includes creation information of at least one object in the first database. The first block is a block after processing the creation information of all objects included in the first database.

[0051] In some possible scenarios, the data migration system may include processors, each comprising multiple threads, with each thread capable of independently executing the operations in steps S301 to S305. Parallel processing by multiple threads, enabling the creation of all objects included in the first database within the second database, can improve migration efficiency. In other possible scenarios, the data migration system may include multiple processors, each capable of independently executing the operations in steps S301 to S305. Parallel processing by multiple processors, enabling the creation of all objects included in the first database within the second database, can also improve migration efficiency.

[0052] Step S302: Query whether the creation identifier of the target object in the shared table is a non-creation identifier. The shared table is in shared memory, the target object is any one of the at least one objects, and the non-creation identifier indicates that the object has not been created in the second database.

[0053] Step S303: When the creation identifier of the target object is found to be the non-created identifier, check whether the creation information of the target object includes the dependency relationship between the target object and at least one other object.

[0054] Step S304: If the creation information of the target object is detected to include the dependency relationship between the target object and at least one other object, then after querying that the creation identifier of each other object in the shared table is a created identifier, the target object is created in the second database, and the creation identifier of the target object is set to a created identifier in the shared table. The created identifier indicates that the object has been created in the second database.

[0055] In one possible implementation, after detecting that the creation information of the target object includes a dependency relationship between the target object and at least one other object, before creating the target object in the second database, the following operations may also be performed:

[0056] The creation identifier of each of the other objects is queried in the shared table to determine if it is the "not created" identifier. If the creation identifier of the first object among the at least one other object is found to be the "not created" identifier, the creation information of the first object is obtained, and it is checked whether the creation information of the first object includes a dependency relationship between the first object and any other object. If the creation information of the first object does not include a dependency relationship between the first object and any other object, the first object is created, and the creation identifier of the first object is set to the "created" identifier in the shared table. If the creation information of the first object includes a dependency relationship between the first object and at least one second object, after the creation identifier of each second object in the shared table is found to be the "created" identifier, the first object is created in the second database, and the creation identifier of the first object is set to the "created" identifier in the shared table.

[0057] Step S305: If the creation information of the target object does not include the dependency relationship between the target object and any other object, then the target object is created in the second database, and the creation identifier of the target object is set to the created identifier in the shared table.

[0058] Furthermore, in the database migration method provided in this application embodiment, the creation identifiers of each object in shared memory 204 are used to determine whether the object is created in the second database, thus avoiding loading all objects included in the first database into memory. Therefore, the database migration method provided in this application consumes less memory during implementation.

[0059] In one possible implementation, the database migration method provided in this application, before obtaining the first block, further includes: collecting creation information of all objects included in the first database and saving it to disk. Multiple loading operations are performed, wherein in each loading operation, the following steps are executed: retrieving partial or complete creation information from the disk before block processing, performing block processing on the retrieved information to obtain multiple blocks, and sending them to the multiple threads respectively. After each loading operation, each thread can perform the operations in steps S302 to S305 above on the obtained blocks.

[0060] For ease of understanding, Figure 4 An exemplary embodiment illustrates a database migration method, which may include the following steps:

[0061] Step S401: Obtain the first block.

[0062] In this embodiment of the application, the first block is any one of the multiple blocks obtained after dividing the creation information of all objects included in the first database into blocks, and the first block includes the creation information of at least one object.

[0063] Step S402: Based on the first block, at least one target object is obtained.

[0064] Step S403: Determine whether the creation identifier of the i-th target object in the shared table is an uncreated identifier. If not, set i = i + 1 and then execute step S403. If yes, proceed to step S404.

[0065] Step S404: Determine whether the i-th target object has dependent objects. If not, proceed to step S405. If yes, proceed to step S406.

[0066] Step S405: Create the i-th target object in the second database and set the creation identifier of the i-th target object to the created identifier in the shared table.

[0067] Then set i = i + 1 and repeat the operation in step S403.

[0068] Step S406: Determine whether the creation identifier of all dependent objects of the i-th target object in the shared table is an uncreated identifier. If yes, proceed to step S407; otherwise, proceed to step S405.

[0069] Step S407: For all dependent objects of the i-th target object, create each first object with the creation identifier not marked as created. If the creation identifier of all dependent objects of the first object is marked as created in the shared table, then create the first object in the second database and set the creation identifier of the first object to the created identifier in the shared table.

[0070] In one possible design, for each of the first objects mentioned above, the thread can refer to the operations on the i-th target object in steps S404 to S407 to process each first object.

[0071] On the other hand, embodiments of this application provide a data migration device, which may include a processing unit. The processing unit is configured to: obtain a first block, the first block including creation information of at least one object in a first database, the first block being a block after processing the creation information of all objects included in the first database; query whether the creation identifier of a target object in a shared table is an uncreated identifier, the shared table being in shared memory, the target object being any one of the at least one objects, the uncreated identifier indicating that the object has not been created in a second database; when the creation identifier of the target object is found to be the uncreated identifier, detect whether the creation information of the target object includes a dependency relationship between the target object and at least one other object; if the creation information of the target object includes a dependency relationship between the target object and at least one other object, then after querying that the creation identifier of each of the other objects in the shared table is a created identifier, create the target object in the second database, and set the creation identifier of the target object to a created identifier in the shared table, the created identifier indicating that the object has been created in the second database.

[0072] In one possible implementation, the processing unit is further configured to: after detecting that the creation information of the target object includes a dependency relationship between the target object and at least one other object, query the shared table to see if the creation identifier of each of the other objects is the uncreated identifier; if the creation identifier of the first object among the at least one other object is found to be the uncreated identifier, then obtain the creation information of the first object and detect whether the creation information of the first object includes a dependency relationship between the first object and any other object; if the creation information of the first object does not include a dependency relationship between the first object and any other object, then create the first object and set the creation identifier of the first object to the created identifier in the shared table; if the creation information of the first object includes a dependency relationship between the first object and at least one second object, then after querying that the creation identifier of each of the second objects in the shared table is the created identifier, create the first object in the second database and set the creation identifier of the first object to the created identifier in the shared table.

[0073] In one possible implementation, the processing unit is further configured to: if it is detected that the creation information of the target object does not include the dependency relationship between the target object and any object, then create the target object in the second database and set the creation identifier of the target object to a created identifier in the shared table.

[0074] In one possible implementation, the device further includes a data acquisition unit; the data acquisition unit is used to: acquire creation information of all objects included in the first database and save it to a disk.

[0075] On the other hand, this application provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform a database migration method.

[0076] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0077] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0078] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0079] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0080] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A database migration system, characterized in that, Includes a processor, the processor comprising multiple threads: any one of the multiple threads is used for: Obtain the first block, which includes creation information of at least one object in the first database. The first block is a block after processing the creation information of all objects included in the first database. Query whether the creation identifier of the target object in the shared table is a non-created identifier. The shared table is in shared memory. The target object is any one of the at least one objects. The non-created identifier indicates that the object has not been created in the second database. When the creation identifier of the target object is found to be the non-created identifier, it is detected whether the creation information of the target object includes the dependency relationship between the target object and at least one other object; If the creation information of the target object is detected to include a dependency relationship between the target object and at least one other object, then after querying the shared table and finding that the creation identifier of each other object is a created identifier, the target object is created in the second database, and the creation identifier of the target object is set to a created identifier in the shared table. The created identifier indicates that the object has been created in the second database. Alternatively, if at least one first object is found among the at least one other object in the shared table, a creation operation is performed on the first object, whereby the first object represents any one of the at least one other object, and the first object represents an object whose creation identifier is the uncreated identifier.

2. The system as described in claim 1, characterized in that, Each of these threads is also used for: After detecting that the creation information of the target object includes the dependency relationship between the target object and at least one other object, the creation identifier of each other object in the shared table is queried to see if it is the non-created identifier. The step of performing a creation operation on the first object includes: Obtain the creation information of the first object, and detect whether the creation information of the first object includes the dependency relationship between the first object and any other object; If it is detected that the creation information of the first object does not include the dependency relationship between the first object and any object, then the first object is created in the second database, and the creation identifier of the first object is set to the created identifier in the shared table; If the creation information of the first object includes the dependency relationship between the first object and at least one second object, then after querying the shared table and finding that the creation identifier of each second object is the already created identifier, the first object is created in the second database, and the creation identifier of the first object is set to the already created identifier in the shared table.

3. The system as described in claim 1 or 2, characterized in that, Each of these threads is also used for: If the creation information of the target object does not include the dependency relationship between the target object and any other object, then the target object is created in the second database, and the creation identifier of the target object is set to the created identifier in the shared table.

4. The system as described in claim 1 or 2, characterized in that, The system further includes a data distributor; the data distributor is used for: The creation information of all objects is divided into blocks to obtain multiple blocks, and the multiple blocks are sent to the multiple threads respectively.

5. The system as described in claim 4, characterized in that, The system further includes a data acquisition module; the data acquisition module is used for: Collect creation information of all objects from the first database; Save the creation information of all the objects to the disk.

6. The system as described in claim 5, characterized in that, When any thread obtains the creation information of the first object, it is specifically used for: Obtain the creation information of the first object from the first block; or, Retrieve the creation information of the first object from the disk.

7. A database migration method, characterized in that, The method, applied to any one of multiple threads of a processor, includes: Obtain the first block, which includes creation information of at least one object in the first database. The first block is a block after processing the creation information of all objects included in the first database. Query whether the creation identifier of the target object in the shared table is a non-created identifier. The shared table is in shared memory. The target object is any one of the at least one objects. The non-created identifier indicates that the object has not been created in the second database. When the creation identifier of the target object is found to be the non-created identifier, it is detected whether the creation information of the target object includes the dependency relationship between the target object and at least one other object; If the creation information of the target object is detected to include a dependency relationship between the target object and at least one other object, then after querying the shared table and finding that the creation identifier of each other object is a created identifier, the target object is created in the second database, and the creation identifier of the target object is set to a created identifier in the shared table. The created identifier indicates that the object has been created in the second database; or, if at least one first object is found among the at least one other object in the shared table, then a creation operation is performed on the first object. The first object represents any one of the at least one other object, and the first object represents the object whose creation identifier is the uncreated identifier.

8. The method as described in claim 7, characterized in that, Before creating the target object in the second database after detecting that the creation information of the target object includes the dependency relationship between the target object and at least one other object, the method further includes: In the shared table, query whether the creation identifier of each of the other objects is the non-created identifier; The step of performing a creation operation on the first object includes: Obtain the creation information of the first object, and detect whether the creation information of the first object includes the dependency relationship between the first object and any other object; If it is detected that the creation information of the first object does not include the dependency relationship between the first object and any object, then the first object is created in the second database, and the creation identifier of the first object is set to the created identifier in the shared table; If the creation information of the first object includes the dependency relationship between the first object and at least one second object, then after querying the shared table and finding that the creation identifier of each second object is the already created identifier, the first object is created in the second database, and the creation identifier of the first object is set to the already created identifier in the shared table.

9. The method as described in claim 7 or 8, characterized in that, The method further includes: If the creation information of the target object does not include the dependency relationship between the target object and any other object, then the target object is created in the second database, and the creation identifier of the target object is set to the created identifier in the shared table.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 7-9.