Database parallel migration method, system and equipment based on dependency graph and medium

By building a dependency graph between database objects and performing batch-by-batch parallel migration, the problem of low serial migration efficiency is solved, efficient and fast database migration is achieved, and business risks are reduced.

CN119807161AInactive Publication Date: 2025-04-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411755433.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-04-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, database migration mainly adopts serial method, resulting in low efficiency and slow performance during large-scale data migration, which may bring potential risks to the business, such as long delivery time and long service downtime.

Method used

By building a dependency graph between objects, filter out objects that do not depend on other objects for parallel migration, and schedule migration of objects that depend on other objects according to the dependency graph to realize batch parallel migration.

Benefits of technology

Improves the efficiency and performance of database migration, shortens migration time, reduces business impact, and ensures faster business development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807161A_ABST
    Figure CN119807161A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of database migration, and discloses a database parallel migration method, system and device based on a dependency graph and a medium, and the method comprises the following steps: reading dependency relationship information among a plurality of objects in a source database; constructing a dependency graph among the plurality of objects according to the dependency relationship information; when the first object set exists in the multiple objects, each first object in the first object set is migrated in parallel; wherein the first object is an object independent of other objects, and the first object is determined according to the dependency graph. According to the embodiment of the invention, the dependency relationship between the objects is summarized through the dependency graph, and the objects without the dependency objects are screened out from the summarized dependency graph for parallel migration in batches, so that the data can be rapidly migrated, the efficiency is high, and the service influence is further reduced to promote the service development more rapidly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database migration, and in particular to a dependency graph-based database parallel migration method, system, device and medium. Background Art

[0002] A database cluster is a collection of storage media that an enterprise builds to handle large amounts of data storage. Multiple database clusters are included in a resource pool to jointly complete internal data services. Enterprises have gradually migrated local database resources to the cloud to reduce hardware and maintenance costs, improve business flexibility, and enhance data security.

[0003] For enterprises that need to go to the cloud, the database needs to be migrated from the cloud to the cloud; for enterprises that are already on the cloud, the database version needs to be upgraded from a low version to a high version, or the same version may need to be in the same cloud based on business development, or based on business considerations, new clusters need to be built in different clouds to provide overall greater service capabilities. All of the above scenarios require that objects such as tables / views and data in the source database cluster be migrated to the target database cluster. In related technologies, database migration mostly uses a serial method to create objects such as tables / views and data copies. However, when faced with large-scale data migration, the serial method is inefficient and has slow performance, which may bring potential risks to the business, such as long delivery time and long service outage time.

[0004] Therefore, a more efficient large-scale database migration method is urgently needed. Summary of the invention

[0005] In view of this, the present invention provides a database parallel migration method, system, device and medium based on a dependency graph to solve the problem of low efficiency and slow performance caused by using a serial method for large-scale data migration in the related technology, which in turn brings potential risks to the business.

[0006] In a first aspect, the present invention provides a method for parallel migration of a database based on a dependency graph, the method comprising:

[0007] Read dependency information between multiple objects in the source database;

[0008] Constructing a dependency graph among multiple objects according to the dependency relationship information;

[0009] When a first object set exists in the plurality of objects, each first object in the first object set is migrated in parallel; wherein the first object is an object that is not dependent on other objects, and the first object is determined according to a dependency graph.

[0010] In an optional implementation, the existence of the first object set in the plurality of objects is determined based on the existence of a plurality of identifiers in the executable queue; and the method further includes:

[0011] When the first object is determined according to the dependency graph, an identifier of the first object is added to the executable queue.

[0012] In an optional embodiment, the method further includes:

[0013] When it is determined according to the dependency graph that there is a second object among the multiple objects, adding an identifier of the second object to the waiting queue; wherein the second object is an object that depends on other objects;

[0014] After other objects that the second object depends on complete data migration, the identifier of the second object is added to the executable queue.

[0015] In an optional embodiment, the method further includes:

[0016] When the second object set exists in the plurality of objects, each second object in the second object set is migrated in parallel; the existence of the second object set in the plurality of objects is determined according to the existence of a plurality of identifiers in the executable queue.

[0017] In a second aspect, the present invention provides a database parallel migration system based on a dependency graph, the system comprising:

[0018] A dependency reading module is used to read dependency information between multiple objects in a source database;

[0019] A dependency graph construction module, which constructs a dependency graph between multiple objects according to the dependency relationship information;

[0020] The parallel migration module is used to migrate each first object in the first object set in parallel when there is a first object set in multiple objects; wherein the first object is an object that does not depend on other objects and is determined according to a dependency graph.

[0021] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0022] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to cause a computer to execute the method of the first aspect or any corresponding embodiment thereof.

[0023] The embodiment of the present invention summarizes the dependencies between objects through a dependency graph, and filters out objects without dependent objects from the summarized dependency graph for parallel migration in batches, ensuring that data can be migrated quickly and efficiently, thereby reducing business impact and promoting business development more quickly. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1 is a flowchart of a method for parallel database migration based on a dependency graph according to an embodiment of the present invention;

[0026] Figure 2 is a schematic diagram of the structure of a dependency graph according to an embodiment of the present invention;

[0027] Figure 3 is a schematic diagram of the structure of another dependency graph according to an embodiment of the present invention;

[0028] Figure 4 is a structural block diagram of a database parallel migration system based on a dependency graph according to an embodiment of the present invention;

[0029] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0031] A database cluster is a collection of storage media that an enterprise builds to handle large amounts of data storage. Multiple database clusters are included in a resource pool to jointly complete internal data services. Enterprises have gradually migrated local database resources to the cloud to reduce hardware and maintenance costs, improve business flexibility, and enhance data security.

[0032] For enterprises that need to go to the cloud, the database needs to be migrated from the cloud to the cloud; for enterprises that are already on the cloud, the database version needs to be upgraded from a low version to a high version, or the same version may need to be in the same cloud based on business development, or based on business considerations, new clusters need to be built in different clouds to provide overall greater service capabilities. All of the above scenarios require that objects such as tables / views and data in the source database cluster be migrated to the target database cluster. In related technologies, database migration mostly uses a serial method to create objects such as tables / views and data copies. However, when faced with large-scale data migration, the serial method is inefficient and has slow performance, which may bring potential risks to the business, such as long delivery time and long service outage time.

[0033] In view of this, an embodiment of the present invention provides a database parallel migration method, system, device and medium based on a dependency graph, which summarizes the dependency relationships between objects through the dependency graph, and screens out objects without dependent objects from the summarized dependency graph for parallel migration in batches, ensuring that data can be migrated quickly and efficiently, thereby reducing business impact and promoting business development more quickly.

[0034] According to an embodiment of the present invention, an embodiment of a database parallel migration method based on a dependency graph is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0035] Figure 1 FIG. 1 is a flow chart of a method for parallel database migration based on a dependency graph according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0036] Step S101: read dependency information between multiple objects in a source database.

[0037] In step S101, objects, metadata of objects, and dependency information between objects are stored in a source database. Each object has a unique identifier (UniqueID, a number or a string) in the source database.

[0038] Among them, the types of objects may include: library, schema / namespace, table, function, protocol, extension, sorting rule, type, procedural language, transformation, external data wrapper, text search, operator, aggregation function, type conversion, access method, view, sequence, constraint, character set conversion, index, rule, trigger, permission, row security policy, extended statistics, etc. Each of the above objects has a specific syntax and a unique expression form.

[0039] The metadata of an object is stored in different system tables in the source database, mainly describing the object's properties, behaviors, and other related information.

[0040] The dependency information between objects is also stored in different system tables in the source database. Each row of data in the system table contains the unique identifier of the dependent object and the unique identifier of the dependent object and other information.

[0041] As an example, taking PostgreSQL / Greenplum database as an example, there are two tables in the database, namely the products table and the orders table. The dependency relationship is that the item ID column in the order table depends on the item table.

[0042] The system table pg_class stores the metadata of the two objects, the products table and the order table. The system table pg_depend stores the dependency between the item id column in the products table and the products table. The system table pg_constraint stores the primary and foreign key constraints between the products table and the order table.

[0043] At this point, by querying the system tables (pg_class, pg_depend, pg_constraint), it can be concluded that the orders table orders depends on the products table.

[0044] Of course, in addition to PostgreSQL / Greenplum databases, other types of databases also store similar information. The dependencies between objects can be read from different types of databases on the source side. The database type can be selected according to the specific application scenario and is not specifically limited here.

[0045] In an optional implementation, the dependency relationship between objects can be in the form of a HashMap data storage structure with a time complexity of constant complexity O(1). In scenarios where the database object scale is large, the search time will maintain a relatively stable horizontal curve and will not increase linearly or more rapidly. Compared with other implementations with O(N) or O(logN) time complexity, it has a strong performance advantage.

[0046] As an example, the dependency relationship between objects is represented by a HashMap data storage structure as follows:

[0047] map[UniqueID-1]map[UniqueID-2]bool

[0048] Among them, UniqueID-1 represents the unique identifier of the dependent object, and UniqueID-2 represents the unique identifier of the dependent object. When it is necessary to determine whether the object UniqueID-1 depends on UniqueID-2, the HashMap will be checked to see if there is a dependency relationship.

[0049] Step S102: construct a dependency graph between multiple objects according to the dependency information.

[0050] In step S102, all dependency relationships between all objects in the source database to be migrated are read out, and a logical structure diagram completely composed of dependency relationships is constructed.

[0051] Step S103, when there is a first object set in the multiple objects, each first object in the first object set is migrated in parallel; wherein the first object is an object that does not depend on other objects, and the first object is determined according to the dependency graph.

[0052] In step S103, after the dependency graph among the multiple objects is constructed, objects that do not depend on other objects are screened out in the dependency graph, and the screened out objects are migrated to the target database in parallel.

[0053] As an example, the source database includes objects 1 to 7, where object 1 depends on object 2, object 4 depends on object 2, object 7 depends on object 6, and object 5 depends on object 1. After reading these dependencies, construct Figure 2 The dependency graph shown.

[0054] At this time, objects that do not depend on other objects, that is, the first object set includes object 3, object 6 and object 2, and then objects 3, object 6 and object 2 in the first object set are migrated in parallel, and the remaining objects 1, object 4, object 5 and object 7 can continue to be migrated in serial or parallel manner.

[0055] The embodiment of the present invention summarizes the dependencies between objects through a dependency graph, and filters out objects without dependent objects from the summarized dependency graph for parallel migration in batches, ensuring that data can be migrated quickly and efficiently, thereby reducing business impact and promoting business development more quickly.

[0056] In an optional implementation, the existence of the first object set in the plurality of objects is determined based on the existence of a plurality of identifiers in the executable queue; and the method for parallel database migration based on a dependency graph further includes:

[0057] When the first object is determined according to the dependency graph, an identifier of the first object is added to the executable queue.

[0058] Specifically, when a first object, that is, an object that does not depend on other objects, is screened out from the dependency graph, an identifier corresponding to the first object is added to the executable queue. At this time, a first object set can be determined based on the first objects corresponding to multiple identifiers in the executable queue, and all first objects in the first object set are executed concurrently, that is, parallel data migration.

[0059] In an optional implementation, the dependency graph-based database parallel migration method further includes:

[0060] When it is determined according to the dependency graph that there is a second object among the multiple objects, adding an identifier of the second object to the waiting queue; wherein the second object is an object that depends on other objects;

[0061] After other objects that the second object depends on complete data migration, the identifier of the second object is added to the executable queue.

[0062] Specifically, when the second object, that is, the object that depends on other objects, is screened out from the dependency graph, the unique identifier corresponding to the second object is added to the waiting queue, and data migration is not performed at this time. Only when the object that the second object depends on completes data migration, the identifier of the second object is added to the executable queue, and the second object performs data migration.

[0063] It should be noted that the addition of multiple first objects to the executable queue (channel) and the addition of the second object to the waiting queue and then to the executable queue are scheduled by the coordinator. According to the identifiers corresponding to the multiple first objects or second objects in the executable queue, the parallel migration of multiple first objects and the sequential migration of the second objects are performed by the workers. The whole process can be called execution scheduling. Specifically, the scheduling execution is divided into two types of logical entities. One is the worker responsible for the final execution object creation DDL (data manipulation language) and migration data DML (data manipulation language). There are many such workers, and the number can be controlled by parameters. The other is the brain-like coordinator, which is responsible for task generation and distribution.

[0064] Coordinator: Based on the unique ID of the target object, determine whether the target object has any dependent objects. If there are no dependent objects, it means that concurrency is possible and scheduling is performed. If the object has dependent objects, check whether the dependent objects have completed migration. If the dependent objects have not completed migration, do not schedule, otherwise schedule.

[0065] The set of workers (Goroutines) is initially created by the coordinator according to the configured concurrency. After creation, all worker coroutines take tasks from the executable task queue (Channel) and process them. The tasks in the queue are objects that the coordinator has determined to have no dependencies and are completely concurrent. Each worker processes the task it has received and marks the object as having completed migration after processing.

[0066] In an optional implementation, the dependency graph-based database parallel migration method further includes:

[0067] When the second object set exists in the plurality of objects, each second object in the second object set is migrated in parallel; the existence of the second object set in the plurality of objects is determined according to the existence of a plurality of identifiers in the executable queue.

[0068] Specifically, when there are multiple identifiers corresponding to multiple second objects in the executable queue, data of the multiple second objects corresponding to the multiple identifiers in the executable queue may be migrated in parallel.

[0069] As an example, the source database includes objects 1 to 7, where object 1 depends on object 2, object 4 depends on object 2, object 7 depends on object 6, and object 5 depends on object 1. After reading these dependencies, construct Figure 2 The dependency graph shown.

[0070] Objects that are not dependent on other objects, that is, the first object set includes object 3, object 6 and object 2, and then objects 3, object 6 and object 2 in the first object set are migrated in parallel.

[0071] At this time, there are only objects 1, 4, 5, and 7 to be migrated in the source database. Based on objects 1, 4, 5, and 7, the following Figure 3 From the dependency graph shown, we can see that objects 4, 7 and 1 change from objects that depend on other objects to objects that do not depend on other objects. At this time, objects 4, 7 and 1 can perform data migration in parallel after objects 3, 6 and 2 have all completed data migration.

[0072] For object 5, you can wait until objects 4, 7, and 1 have all completed data migration before performing data migration.

[0073] The embodiment of the present invention summarizes the dependency relationships between objects through a dependency graph, and selects objects without dependent objects from the summarized dependency graph for parallel migration first. For objects that depend on other objects, parallel migration or sequential migration can be performed after the objects without dependent objects have migrated data in parallel. By migrating in batches in parallel, it is ensured that data can be migrated quickly and efficiently, thereby reducing business impact and promoting business development more quickly.

[0074] In an optional implementation, whether the object migration is complete may also be determined in the form of a HashMap data storage structure, specifically:

[0075] map[UniqueID-1]bool

[0076] When it is necessary to determine whether the object UniqueID-1 has completed the migration, the HashMap will be searched.

[0077] As an example, a database parallel migration method based on a dependency graph according to an embodiment of the present invention is described in combination with a HashMap data storage structure, a HashMap data search method, and a scheduling execution:

[0078] -initial

[0079] -map static dependency

[33686]

[38679] = true (i.e. object 33686 depends on object 38679)

[0080] - Dynamic migration completion status

[0081] map real-time migration completed status

[38679] = false

[0082] map real-time migration completed status

[33686] = false

[0083] - When processing 33686, check that it depends on 38679. If 38679 has not yet completed the migration, put 33686 in the waiting queue.

[0084] -When processing 38679, check that it does not depend on any object, then put 38679 into the execution queue. After waiting for 38679 to be migrated, update

[0085] map real-time migration completion status

[38679] = false (when the object is migrated, set false to true)

[0086] - Process 33686 again and check that it depends on 38679. Since 38679 has completed the migration, 33686 will be put into the executable queue.

[0087] In some optional implementations, HashMap uses a spin lock.

[0088] Since HashMap will be accessed / updated by multiple coroutines at the same time, it will be locked during the operation. Since the locking time is very short, selecting a spin lock can provide the highest throughput.

[0089] In some optional implementations, the embodiments of the present invention can be developed in the cloud-native Go language, utilizing the native coroutine mechanism of the Go language. Compared with traditional Java / C++ language development, this can save memory resources in high-concurrency scenarios (a coroutine only occupies a few thousand bytes of resources while a thread occupies several megabytes of resources, an order of magnitude difference), and has a strong cost advantage.

[0090] In summary, the embodiment of the present invention first performs dependency analysis on a large number of migration objects in the database cluster, then stores them in the memory in an optimal data structure to provide a fast search method, and finally implements it in the Go language with high concurrency performance and small memory usage, which has many cloud-native development features.

[0091] In terms of performance, compared with the general serial method, the embodiment of the present invention adopts a parallel method to perform migration, which can complete the migration at the fastest speed.

[0092] In terms of memory resource usage, compared with commonly used development languages ​​such as Java / C++, the embodiment of the present invention is developed using the Go language, which saves an order of magnitude of memory and has greater advantages in cloud scenarios. Fewer resources used also means less energy consumption, more environmental protection, and cost reduction and efficiency improvement.

[0093] The embodiment of the present invention is also applicable to large-scale database clusters. Before implementation, the corresponding databases and components are installed and deployed on the database cluster machines, mainly including the following steps:

[0094] Step 1: Determine the connection information (machine name, port number, user name, password) of the source database cluster and the target database cluster.

[0095] Step 2: Determine the objects to be migrated (libraries, schemas, tables, etc.).

[0096] Step 3: Determine the configuration specifications and current load conditions of the source database cluster and the target data cluster.

[0097] Step 4. Determine the configuration specifications and current load of the machine running hashcopy.

[0098] Step 5: Estimate the number of concurrent workers based on the specifications obtained in steps 3 and 4 and the current load.

[0099] Step 6. Execute the hashcopy command, specifying the previously determined connection parameters and the number of concurrent workers.

[0100] Step 7: Observe the load of the source database cluster, the target database cluster, and the hashcopy running machine, and perform appropriate concurrency parameter tuning.

[0101] Among them, Hashcopy is a tool for data migration, which is mainly used to help users migrate the local database cluster deployed offline to the cloud database cluster on the cloud, or to migrate and copy data between cloud database clusters of different versions.

[0102] In this embodiment, a database parallel migration system based on a dependency graph is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0103] This embodiment provides a database parallel migration system based on a dependency graph. Figure 4 As shown, including:

[0104] The dependency reading module 401 is used to read dependency information between multiple objects in the source database.

[0105] The dependency graph construction module 402 is used to construct a dependency graph between multiple objects according to the dependency relationship information.

[0106] The parallel migration module 403 is used to migrate each first object in the first object set in parallel when there is a first object set in multiple objects; wherein the first object is an object that does not depend on other objects and is determined according to the dependency graph.

[0107] In some optional implementations, the existence of the first object set in the plurality of objects is determined based on the existence of a plurality of identifiers in the executable queue, and the dependency graph-based database parallel migration system further includes:

[0108] The first object execution module 404 is configured to add the identifier of the first object to the executable queue when the first object is determined according to the dependency graph.

[0109] In some optional implementations, a dependency graph-based database parallel migration system further includes a second object execution module 405 .

[0110] The second object execution module 405 further includes:

[0111] A second object waiting unit 4051 is used to add the identifier of the second object to the waiting queue when it is determined that there is a second object among the multiple objects according to the dependency graph; wherein the second object is an object that depends on other objects;

[0112] The second object migration unit 4052 is used to add the identifier of the second object to the executable queue after other objects that the second object depends on complete data migration.

[0113] In some optional implementations, a dependency graph-based database parallel migration system further includes a second object parallel module 406 .

[0114] When the second object set exists in the plurality of objects, each second object in the second object set is migrated in parallel; the existence of the second object set in the plurality of objects is determined according to the existence of a plurality of identifiers in the executable queue.

[0115] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0116] A database parallel migration system device based on a dependency graph in an embodiment of the present invention is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0117] The embodiment of the present invention also provides a computer device having the above Figure 4 A database parallel migration system based on a dependency graph is shown.

[0118] Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0119] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0120] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0121] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0122] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0123] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0124] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0125] A portion of the embodiments of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in a computer-readable medium includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which the computer program instructions are executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0126] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A database parallel migration method based on dependency graph, characterized in that: The method comprises: Read dependency information between multiple objects in the source database; Constructing a dependency graph among multiple objects according to the dependency relationship information; When a first object set exists in the plurality of objects, each first object in the first object set is migrated in parallel; wherein the first object is an object that is not dependent on other objects, and the first object is determined according to a dependency graph.

2. The method according to claim 1, characterized in that The existence of the first object set in the plurality of objects is determined based on the existence of a plurality of identifiers in the executable queue; and the method further comprises: When the first object is determined according to the dependency graph, an identifier of the first object is added to the executable queue.

3. The method according to claim 1, characterized in that The method further comprises: When it is determined according to the dependency graph that there is a second object among the multiple objects, adding an identifier of the second object to the waiting queue; wherein the second object is an object that depends on other objects; After other objects that the second object depends on complete data migration, the identifier of the second object is added to the executable queue.

4. The method according to claim 3, characterized in that: The method further comprises: When the second object set exists in the plurality of objects, each second object in the second object set is migrated in parallel; the existence of the second object set in the plurality of objects is determined according to the existence of a plurality of identifiers in the executable queue.

5. A database parallel migration system based on dependency graph, characterized in that: The system comprises: A dependency reading module is used to read dependency information between multiple objects in a source database; A dependency graph building module, which builds a dependency graph between multiple objects according to the dependency relationship information; The parallel migration module is used to migrate each first object in the first object set in parallel when there is a first object set in multiple objects; wherein the first object is an object that does not depend on other objects and is determined according to a dependency graph.

6. An electronic device, characterized in that: include: a memory storing computer-readable instructions; A processor reads the computer-readable instructions stored in the memory to execute the method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Data migration method and device, server and storage medium

    CN108509556A

  • Data migration method, device and equipment

    CN115982136A