Metadata migration method and device, computer equipment and storage medium

By collecting, converting, and executing DDL statements on the source database, the compatibility problem of metadata migration between heterogeneous databases is solved, the migration efficiency and accuracy are improved, and the cost is reduced.

CN118964331APending Publication Date: 2024-11-15JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411182559.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

There are compatibility issues with metadata migration between different database systems, resulting in mismatch in field types, error in default value, inability to establish foreign key relationships, and failed index creation, which hinders the effective migration of metadata between heterogeneous database systems. and data sharing increase the cost and risks of enterprises in the process of data migration and upgrading.

Method used

By detecting the collection instructions of the target user, the source DDL statement corresponding to the metadata that needs to be migrated to the target database is collected in the source database, and when the conversion instruction is received, it is converted into the target DDL statement executable by the target database. Finally, the target DDL statement is executed in the target database to generate corresponding metadata to realize metadata migration between heterogeneous databases.

Benefits of technology

It reduces manual intervention during the migration process, reduces migration costs, improves migration efficiency and accuracy, and realizes effective metadata migration between heterogeneous databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964331A_ABST
    Figure CN118964331A_ABST
Patent Text Reader

Abstract

The invention discloses a metadata migration method and device, computer equipment and a storage medium, and relates to the technical field of data migration.The method comprises the steps that when a collection instruction of a target user is detected, a source DDL statement corresponding to metadata needing to be migrated to a target end database is collected in a source end database; wherein the source end database and the target end database are heterogeneous databases; when a conversion instruction of the target user is detected, converting the source DDL statement into a target DDL statement executable by the target end database; and when a playback instruction of the target user is detected, executing the target DDL statement in the target end database to generate corresponding metadata. By means of the method, effective migration of the metadata between the heterogeneous databases can be achieved, manual intervention in the migration process is reduced, the migration cost is reduced, and the migration efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data migration, and in particular to a metadata migration method, device, computer equipment and non-volatile computer-readable storage medium. Background Art

[0002] At present, with the rapid development of information technology, databases have become the core tools for information management and data storage in modern society. The application of database technology is widespread in many industries such as communications, commerce, and medical care, and they play a vital role in data management and analysis. At present, with the continuous deepening of digital transformation, the demand for databases in various industries is growing, which has promoted the continuous innovation and development of database technology.

[0003] However, there are many database products on the market, each with its own unique design concept, architecture and implementation. These database products include but are not limited to relational databases such as MySQL, PostgreSQL, Oracle, and non-relational databases such as MongoDB, Cassandra, etc. Each database system has its own specific data definition language (DDL) and its corresponding metadata definition and storage method. Although the development of database technology has brought convenience to all walks of life, the problem of metadata migration between different database systems has gradually emerged. Due to the differences in metadata definitions among database products of different manufacturers, direct migration of metadata often leads to compatibility issues. For example, the table structure, field type, default value, foreign key constraint and index defined in one database system may not be directly used in another database system, resulting in field type mismatch, default value error, failure to establish foreign key relationship, index creation failure and other problems. The existence of these problems seriously hinders the effective migration and data sharing of metadata between heterogeneous database systems, limits the liquidity and availability of data, and increases the cost and risk of enterprises in the process of data migration and upgrade.

[0004] Based on this, how to provide a metadata migration method, apparatus, computer equipment and non-volatile computer-readable storage medium to achieve effective migration of metadata between heterogeneous databases, reduce manual intervention in the migration process, reduce migration costs, and improve migration efficiency and accuracy is a problem that needs to be urgently solved by technical personnel in this field. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide a metadata migration method, apparatus, computer device and non-volatile computer-readable storage medium, aiming to solve the problem of how to achieve effective migration of metadata between heterogeneous databases, reduce manual intervention in the migration process, reduce migration costs, and improve migration efficiency and accuracy.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A metadata migration method, wherein the method comprises:

[0008] When a collection instruction of a target user is detected, source DDL statements corresponding to metadata that needs to be migrated to a target database are collected in a source database; wherein the source database and the target database are heterogeneous databases;

[0009] When a conversion instruction of the target user is detected, the source DDL statement is converted into a target DDL statement executable by the target database;

[0010] When the playback instruction of the target user is detected, the target DDL statement is executed in the target-side database to generate corresponding metadata.

[0011] In a further technical solution, the metadata migration method, wherein when the target user's collection instruction is detected, source DDL statements corresponding to the metadata to be migrated to the target database are collected in the source database; wherein before the source database and the target database are heterogeneous databases, the method further includes:

[0012] Receive an interface opening instruction from the target user, and open and enter the metadata migration interface.

[0013] In a further technical solution, the metadata migration method, wherein when the target user's collection instruction is detected, source DDL statements corresponding to the metadata to be migrated to the target database are collected in the source database; wherein the source database and the target database are heterogeneous databases, including:

[0014] Detecting, through the metadata migration interface, a collection instruction issued by the target user by clicking a collection button;

[0015] In response to the collection instruction, source DDL statements corresponding to the metadata that needs to be migrated to the target database are collected in the source database; wherein the source database and the target database are heterogeneous databases.

[0016] In a further technical solution, the metadata migration method, wherein when the target user's collection instruction is detected, source DDL statements corresponding to the metadata to be migrated to the target database are collected in the source database; wherein the source database and the target database are heterogeneous databases, further comprising:

[0017] The source DDL statement is persisted to a preset intermediate database.

[0018] In a further technical solution, the metadata migration method, wherein when the conversion instruction of the target user is detected, converting the source DDL statement into a target DDL statement executable by the target database, comprises:

[0019] Detecting, through the metadata migration interface, a conversion instruction issued by the target user by clicking a conversion button;

[0020] In response to the conversion instruction, the source DDL statement stored in the intermediate database is converted into a target DDL statement executable by the target database.

[0021] In a further technical solution, the metadata migration method, wherein when the playback instruction of the target user is detected, the target DDL statement is executed in the target-side database to generate corresponding metadata, includes:

[0022] Detecting, through the metadata migration interface, a playback instruction issued by the target user by clicking a playback button;

[0023] In response to the playback instruction, the target DDL statement is migrated to the target-side database and executed to generate corresponding metadata.

[0024] In a further technical solution, the metadata migration method, wherein when the playback instruction of the target user is detected, after executing the target DDL statement in the target-side database to generate corresponding metadata, further comprises:

[0025] Receive the log viewing instruction of the target user, and display the relevant log information in the metadata migration process.

[0026] A metadata migration device, wherein the device comprises:

[0027] A collection module, for collecting source DDL statements corresponding to metadata to be migrated to a target database in a source database when a collection instruction of a target user is detected; wherein the source database and the target database are heterogeneous databases;

[0028] A conversion module, configured to convert the source DDL statement into a target DDL statement executable by the target database when a conversion instruction of the target user is detected;

[0029] The playback module is used to execute the target DDL statement in the target-side database to generate corresponding metadata when a playback instruction from the target user is detected.

[0030] A computer device, wherein the computer device comprises at least one processor; and

[0031] a memory communicatively connected to the at least one processor; wherein,

[0032] The memory stores a computer program that can be executed by the at least one processor. When the computer program is executed by the at least one processor, the metadata migration method as described in any one of the above items can be implemented.

[0033] A non-volatile computer-readable storage medium stores a computer program, wherein the computer program, when executed by at least one processor, can implement any of the metadata migration methods described above.

[0034] Compared with the prior art, the present invention provides a metadata migration method, device, computer equipment and non-volatile computer-readable storage medium, wherein the method includes: when a collection instruction of a target user is detected, the source DDL statement corresponding to the metadata to be migrated to the target database is collected in the source database; wherein the source database and the target database are heterogeneous databases; when a conversion instruction of the target user is detected, the source DDL statement is converted into a target DDL statement executable by the target database; when a playback instruction of the target user is detected, the target DDL statement is executed in the target database to generate corresponding metadata. In this way, the method of the present invention can realize the effective migration of metadata between heterogeneous databases, reduce manual intervention in the migration process, reduce migration costs, and improve migration efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0036] Figure 1 A flowchart of a metadata migration method provided by an embodiment of the present invention.

[0037] Figure 2 Another schematic diagram of a metadata migration method provided by an embodiment of the present invention.

[0038] Figure 3 A schematic diagram of functional modules of a metadata migration device provided by an embodiment of the present invention.

[0039] Figure 4 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0041] In the description of the present invention, the terms "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps therein is not limited and can be appropriately adjusted as needed.

[0042] Various non-limiting embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.

[0043] At present, with the rapid development of information technology, databases have become the core tools for information management and data storage in modern society. The application of database technology is widespread in many industries such as communications, commerce, and medical care, and they play a vital role in data management and analysis. At present, with the continuous deepening of digital transformation, the demand for databases in various industries is growing, which has promoted the continuous innovation and development of database technology.

[0044] However, there are many database products on the market, each with its own unique design concept, architecture and implementation. These database products include but are not limited to relational databases such as MySQL, PostgreSQL, Oracle, and non-relational databases such as MongoDB, Cassandra, etc. Each database system has its own specific data definition language (DDL) and its corresponding metadata definition and storage method. Although the development of database technology has brought convenience to all walks of life, the problem of metadata migration between different database systems has gradually emerged. Due to the differences in metadata definitions among database products of different manufacturers, direct migration of metadata often leads to compatibility issues. For example, the table structure, field type, default value, foreign key constraint and index defined in one database system may not be directly used in another database system, resulting in field type mismatch, default value error, failure to establish foreign key relationship, index creation failure and other problems. The existence of these problems seriously hinders the effective migration and data sharing of metadata between heterogeneous database systems, limits the liquidity and availability of data, and increases the cost and risk of enterprises in the process of data migration and upgrade.

[0045] Based on this, how to provide a metadata migration method, apparatus, computer equipment and non-volatile computer-readable storage medium to achieve effective migration of metadata between heterogeneous databases, reduce manual intervention in the migration process, reduce migration costs, and improve migration efficiency and accuracy is a problem that needs to be urgently solved by technical personnel in this field.

[0046] To solve the above problems, see Figure 1 The embodiment of the present invention provides a metadata migration method, wherein the method comprises the steps of:

[0047] S100: When a collection instruction of a target user is detected, source DDL statements corresponding to metadata to be migrated to a target database are collected in a source database; wherein the source database and the target database are heterogeneous databases;

[0048] S200, when a conversion instruction of the target user is detected, converting the source DDL statement into a target DDL statement executable by the target database;

[0049] S300: When a playback instruction of the target user is detected, the target DDL statement is executed in the target-side database to generate corresponding metadata.

[0050] For further information, see Figure 2, the metadata migration method, wherein, in step S100, when a collection instruction of a target user is detected, source DDL statements corresponding to metadata to be migrated to a target database are collected in a source database; wherein, before the source database and the target database are heterogeneous databases, the method further comprises the steps of:

[0051] S101, receiving an interface opening instruction from the target user, opening and entering a metadata migration interface.

[0052] In the specific implementation, in this embodiment, an interface opening instruction of the target user is received, and the metadata migration interface is opened and entered; wherein the specific implementation process is roughly as follows:

[0053] 1) User interface design

[0054] Design a user-friendly interface that includes an obvious "Turn on metadata migration" button or icon;

[0055] There should be clear instructions on the interface to inform users of the function of this button;

[0056] 2) Receive user instructions

[0057] Implement an event listener to monitor user operations on the interface, especially the click event of the "Start Metadata Migration" button;

[0058] When the user clicks the button, the event listener captures this action and triggers the corresponding processing logic;

[0059] 3) Permission verification (optional)

[0060] Before entering the metadata migration interface, you may need to verify the user's identity and permissions to ensure that only authorized users can access it;

[0061] Specifically, a permission verification module can be implemented to automatically check permissions when a user tries to open the interface;

[0062] If the user is authenticated, they are allowed to proceed to the next step; if not, an error message is displayed and further actions are blocked.

[0063] 4) Load metadata migration interface

[0064] Once the user passes the authorization verification (if any), the metadata migration interface will be loaded;

[0065] This interface may contain multiple components, such as source database selection, target database selection, migration option settings, etc.

[0066] Ensure that the interface loads smoothly and quickly to provide a good user experience;

[0067] 5) Initialize the migration interface

[0068] After the metadata migration interface is loaded, initialize all components and settings on the interface;

[0069] This may include loading a list of databases, setting default migration options, initializing the log area, etc.

[0070] Make sure all components are initialized correctly so that users can start the migration process right away;

[0071] 6) User operation guidance

[0072] Provide clear instructions and help documents to guide users on how to use the metadata migration interface;

[0073] You can set help icons or tips on the interface, and when the user hovers the mouse over these icons, operation instructions will be displayed;

[0074] 7) Feedback and error handling

[0075] A feedback mechanism can be implemented to provide instant feedback when the user's operation succeeds or fails;

[0076] For possible errors, such as database connection failure, exceptions during migration, etc., it should be able to capture and prompt the user with the corresponding error information;

[0077] Through the above process, the user's interface opening instruction can be received, and the user can be smoothly guided to enter and use the metadata migration interface, thereby starting the metadata migration process between heterogeneous databases.

[0078] Furthermore, the metadata migration method, wherein the step S100, when a collection instruction of a target user is detected, collects source DDL statements corresponding to metadata to be migrated to a target database in a source database; wherein the source database and the target database are heterogeneous databases, specifically includes:

[0079] Detecting, through the metadata migration interface, a collection instruction issued by the target user by clicking a collection button;

[0080] In response to the collection instruction, source DDL statements corresponding to the metadata to be migrated to the target database are collected in the source database; wherein the source database and the target database are heterogeneous databases;

[0081] The source DDL statement is persisted to a preset intermediate database.

[0082] In specific implementation, in this embodiment, the metadata migration interface detects a collection instruction issued by the target user by clicking a collection button; in response to the collection instruction, the source DDL statement corresponding to the metadata to be migrated to the target database is collected in the source database; wherein the source database and the target database are heterogeneous databases; the source DDL statement is persisted to a preset intermediate database; wherein both the source database and the target database are heterogeneous databases, and the specific implementation process is roughly as follows:

[0083] 1) Receive and process acquisition instructions

[0084] Event Listener: Set an event listener for the collection button. When the user clicks the collection button on the metadata migration interface, the collection process is triggered.

[0085] Collection operation: Write a function or call a database management tool to connect to the source database, execute a query or use the export function provided by the database to obtain the source DDL statement corresponding to the metadata;

[0086] 2) Persisting source DDL statements

[0087] Intermediate database settings: configure an intermediate database to store source DDL statements collected from the source database;

[0088] Data writing: Write the collected source DDL statements into the intermediate database to ensure persistent storage of data;

[0089] 3) User operation feedback

[0090] Status update: When the user is performing a collection operation, the status information on the metadata migration interface is updated in real time, such as "collecting", "collection completed", etc.

[0091] Error handling: If errors are encountered during the collection process, such as source database connection failure or query error, these errors should be captured and the corresponding error information should be displayed on the metadata migration interface;

[0092] Through the above process, it is possible to collect source DDL statements corresponding to the metadata in the source database that needs to be migrated to the target database, and persist the source DDL statements to the intermediate database.

[0093] Furthermore, the metadata migration method, wherein the step S200, when detecting the conversion instruction of the target user, converting the source DDL statement into a target DDL statement executable by the target database, specifically includes:

[0094] Detecting, through the metadata migration interface, a conversion instruction issued by the target user by clicking a conversion button;

[0095] In response to the conversion instruction, the source DDL statement stored in the intermediate database is converted into a target DDL statement executable by the target database.

[0096] In specific implementation, in this embodiment, the conversion instruction issued by the target user by clicking the conversion button is detected through the metadata migration interface; in response to the conversion instruction, the source DDL statement stored in the intermediate database is converted into a target DDL statement executable by the target database; wherein the specific implementation process is roughly as follows:

[0097] 1) Receive and process conversion instructions

[0098] Event listener settings: Set an event listener for the conversion button on the metadata migration interface so that the action can be captured when the user clicks the conversion button;

[0099] User command recognition: When the listener detects that the conversion button is clicked, it will trigger a function or method to handle the conversion request;

[0100] 2) Retrieve the source DDL statement from the intermediate database

[0101] Database connection: Establish a connection with the intermediate database, which is where the source DDL statements are stored;

[0102] Data retrieval: Write query statements or use database access APIs to retrieve source DDL statements that need to be converted;

[0103] 3) Execute DDL statement conversion

[0104] Conversion logic implementation: A conversion module can be developed that contains the necessary logic to convert the source DDL statements into DDL statements that are compatible with the target database; this may involve syntax adjustments, data type mapping, constraint conversion, etc.

[0105] Rule engine application: A rule engine may be needed to handle the differences between different database systems and automatically apply conversion rules;

[0106] 4) Conversion result verification

[0107] Syntax verification: During or after the conversion, the generated target DDL statements are syntax verified to ensure that they are valid in the target database.

[0108] Simulate execution (optional): Before actually applying it to the target database, you can simulate the execution of the target DDL statement in a test environment to verify its correctness and completeness.

[0109] 5) Persist the converted target DDL statement

[0110] Update the intermediate database: store the converted target DDL statements back to the intermediate database;

[0111] Record log: record all important and results of the conversion process to facilitate problem tracking and auditing;

[0112] 6) User feedback

[0113] Progress feedback: During the conversion process, provide users with real-time progress feedback, such as a conversion progress bar or status message;

[0114] Result notification: After the conversion is completed, the user will be notified of the conversion result;

[0115] 7) Error handling

[0116] Exception capture: During the conversion process, any exceptions or errors that may occur are captured and handled;

[0117] User prompts: If the conversion fails, provide the user with clear error messages and possible solutions or the option to contact technical support;

[0118] Through the above process, the source DDL statements of the source database can be effectively converted into target DDL statements executable by the target database in response to the user's conversion instruction, so as to prepare for the next playback operation.

[0119] Furthermore, the metadata migration method, wherein the step S300, when the playback instruction of the target user is detected, executing the target DDL statement in the target-side database to generate corresponding metadata, specifically includes:

[0120] Detecting, through the metadata migration interface, a playback instruction issued by the target user by clicking a playback button;

[0121] In response to the playback instruction, the target DDL statement is migrated to the target-side database and executed to generate corresponding metadata.

[0122] In the specific implementation, in this embodiment, the metadata migration interface detects the playback instruction issued by the target user by clicking the playback button; in response to the playback instruction, the target DDL statement is migrated to the target end database and executed to generate corresponding metadata; wherein the specific implementation process is roughly as follows:

[0123] 1) Receive and process playback instructions

[0124] Event listener settings: Set an event listener for the playback button on the metadata migration interface so that the user can capture this action when clicking the playback button;

[0125] User command recognition: When the listener detects that the playback button is clicked, it will trigger a function or method to handle the playback request;

[0126] 2) Retrieve the target DDL statement from the intermediate database

[0127] Database connection: Establish a connection with the intermediate database, which is where the target DDL statements are stored;

[0128] Data retrieval: Write query statements or use database access APIs to retrieve the target DDL statements that need to be executed;

[0129] 3) Migrate and execute the target DDL statement

[0130] Database connection: Establish a connection with the target database and prepare to migrate the target DDL statement to the target database;

[0131] Execute DDL statements: Send the retrieved target DDL statements to the target database for execution to generate corresponding metadata; this may include creating database objects such as tables, views, and indexes;

[0132] 4) Verify the migration results

[0133] Result verification: Check the results of the target DDL statement execution in the target database to ensure that all database objects have been created correctly;

[0134] Error handling: If the target DDL statement fails to execute, the error information is captured and feedback is provided to the user, which may require manual intervention or adjustment by the user;

[0135] 5) User feedback

[0136] Progress feedback: Provide users with real-time progress feedback, such as a progress bar or status message, during the migration and execution of target DDL statements.

[0137] Result notification: After the migration and execution are completed, the user is notified of the playback results. If everything goes well, a success message can be displayed; if there is an error, an error message can be displayed and further operation instructions can be provided;

[0138] 6) Record logs

[0139] Logging: During the entire playback process, logs of all key operations and results are recorded to facilitate problem tracking and auditing;

[0140] Audit trail (optional): If necessary, an audit trail can be provided for the playback operation to record who performed the playback operation and when;

[0141] 7) Exception handling

[0142] Exception capture: During the playback process, capture and handle any exceptions or errors that may occur;

[0143] User prompts: If playback fails, provide the user with clear error messages and possible solutions or the option to contact technical support;

[0144] Through the above process, the target DDL statement can be effectively migrated to the target database and executed in response to the user's playback instruction to generate the corresponding metadata, thereby completing the final migration of the metadata.

[0145] For further information, see Figure 2 , the metadata migration method, wherein, in step S300, after detecting the playback instruction of the target user, executing the target DDL statement in the target-side database to generate corresponding metadata, further comprises the steps of:

[0146] S400: Receive a log viewing instruction from the target user, and display relevant log information during metadata migration.

[0147] In the specific implementation, in this embodiment, a log viewing instruction of the target user is received, and relevant log information in the metadata migration process is displayed; wherein, the specific implementation process is roughly as follows:

[0148] 1) Design log viewing interface

[0149] Interface layout: Design a dedicated area in the metadata migration interface to display log information, which can be a separate tab or an expandable panel;

[0150] Function button: Provide a "View Log" button, which can load and display log information after the user clicks it;

[0151] 2) Implement event monitoring for log viewing instructions

[0152] Event listener: Set an event listener for the "View Log" button to capture the user's click event;

[0153] Instruction response: When the user clicks the "View Log" button, the event listener is triggered and calls the backend logic to load the log data;

[0154] 3) Storage and management of log data

[0155] Log storage: Ensure that the logs generated during metadata migration are properly stored, which can be a file system, database, or a dedicated log management system;

[0156] Log management: realize the management and retrieval functions of logs, and can retrieve relevant logs according to conditions such as timestamp and event type;

[0157] 4) Load and display log information

[0158] Log loading: Load the required log data from the log storage according to the user's instructions;

[0159] Log display: Format the loaded log data and display it on the log viewing interface to ensure that the log information is clear and easy to read;

[0160] 5) Provide log filtering and search functions (optional)

[0161] Filter options: Provides filtering options for log levels (such as INFO, ERROR, DEBUG) and time ranges to help users quickly locate specific logs;

[0162] Search function: implement the search function of log content, allowing users to search for related log entries by keywords;

[0163] 6) User interaction and feedback

[0164] Interactive design: Ensure that the log viewing interface is user-friendly, such as providing scroll bars, paging, or infinite loading functions to accommodate the display of large amounts of log data;

[0165] Operational feedback: Provide a loading indicator during the log loading process, such as a progress bar or a spinning icon, to inform the user that the log is being processed;

[0166] 7) Exception handling

[0167] Error capture: Capture possible exceptions during the process of loading and displaying logs, such as unreadable log files, incorrect data format, etc.

[0168] User prompts: If an error occurs, provide users with clear error prompts and the option to try again or contact technical support;

[0169] Through the above process, the user's log viewing instructions can be received, and the relevant log information in the metadata migration process can be effectively displayed, so that the user can easily monitor and audit the migration process.

[0170] It can be seen from the above method embodiments that the metadata migration method provided by the present invention at least includes: when the target user's collection instruction is detected, the source DDL statement corresponding to the metadata to be migrated to the target database is collected in the source database; wherein the source database and the target database are heterogeneous databases; when the target user's conversion instruction is detected, the source DDL statement is converted into a target DDL statement executable by the target database; when the target user's playback instruction is detected, the target DDL statement is executed in the target database to generate corresponding metadata; etc. In this way, the method of the present invention can realize the effective migration of metadata between heterogeneous databases, reduce manual intervention in the migration process, reduce migration costs, and improve migration efficiency and accuracy.

[0171] It should be understood that, although the present application provides method operation steps as described in the embodiments or flowcharts, more or less operation steps may be included based on conventional or non-creative labor, and these operation steps are not necessarily performed in sequence according to the embodiment or flowchart. The order of steps listed in the embodiment or flowchart is only one way of executing the order of many steps, and does not represent the only execution order. It should be noted that there is not necessarily a certain order between the above steps. A person of ordinary skill in the art can understand from the description of the embodiment of the present invention that in different embodiments, the above steps may have different execution orders, that is, they may be executed in parallel, or they may be executed in exchange, etc. Moreover, at least a part of the steps in the embodiment or flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but may be executed in turn, alternately or synchronously with other steps or at least a part of the sub-steps or stages of other steps.

[0172] Based on the above method embodiment, please refer to Figure 3 Another embodiment of the present invention further provides a metadata migration device, wherein the device comprises:

[0173] The collection module 11 is used to collect source DDL statements corresponding to metadata that needs to be migrated to the target database in the source database when a collection instruction of the target user is detected; wherein the source database and the target database are heterogeneous databases;

[0174] A conversion module 12, configured to convert the source DDL statement into a target DDL statement executable by the target database when a conversion instruction of the target user is detected;

[0175] The playback module 13 is used to execute the target DDL statement in the target database to generate corresponding metadata when a playback instruction from the target user is detected.

[0176] Furthermore, the metadata migration device further comprises:

[0177] The interface opening module is used to receive the interface opening instruction of the target user, and open and enter the metadata migration interface.

[0178] Furthermore, in the metadata migration device, the acquisition module 11 specifically includes:

[0179] A collection instruction detection unit, used to detect, through the metadata migration interface, a collection instruction issued by the target user by clicking a collection button;

[0180] A DDL statement collection unit, configured to respond to the collection instruction and collect source DDL statements corresponding to metadata to be migrated to the target database in the source database; wherein the source database and the target database are heterogeneous databases;

[0181] The DDL statement persistence unit is used to persist the source DDL statement to a preset intermediate database.

[0182] Furthermore, in the metadata migration device, the conversion module 12 specifically includes:

[0183] A conversion instruction detection unit, used to detect, through the metadata migration interface, a conversion instruction issued by the target user by clicking a conversion button;

[0184] The DDL statement conversion unit is used to respond to the conversion instruction and convert the source DDL statement stored in the intermediate database into a target DDL statement executable by the target database.

[0185] Furthermore, in the metadata migration device, the playback module 13 specifically includes:

[0186] A playback instruction detection unit, used to detect, through the metadata migration interface, a playback instruction issued by the target user by clicking a playback button;

[0187] The migration and execution unit is used to respond to the playback instruction, migrate the target DDL statement to the target database and execute it to generate corresponding metadata.

[0188] Furthermore, the metadata migration device further comprises:

[0189] The log viewing module is used to receive the log viewing instruction of the target user and display the relevant log information in the metadata migration process.

[0190] The specific implementation process and effects of the device embodiment of the present invention can be found in the above method embodiment, which will not be described in detail here.

[0191] It can be seen from the above device embodiments that the metadata migration device provided by the present invention at least includes: a collection module, which is used to collect source DDL statements corresponding to metadata that needs to be migrated to the target database in the source database when the collection instruction of the target user is detected; wherein the source database and the target database are heterogeneous databases; a conversion module, which is used to convert the source DDL statements into target DDL statements executable by the target database when the conversion instruction of the target user is detected; a playback module, which is used to execute the target DDL statements in the target database to generate corresponding metadata when the playback instruction of the target user is detected; and so on. In this way, the device of the present invention can realize the effective migration of metadata between heterogeneous databases, reduce manual intervention in the migration process, reduce migration costs, and improve migration efficiency and accuracy.

[0192] Based on the above method embodiment, please refer to Figure 4 Another embodiment of the present invention further provides a computer device, wherein the computer device 10 includes:

[0193] memory 120 and one or more processors 110, Figure 4 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a communication bus or other means. Figure 4 The example of connecting via a communication bus is taken as an example.

[0194] The processor 110 is used to complete various control logics of the computer device 10. It can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP, or any other such configuration.

[0195] The memory 120, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the computer program corresponding to the metadata migration method in any of the above method embodiments of the present invention. The processor 110 executes various functional applications and data processing of the computer device 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, implements the metadata migration method in any of the above method embodiments.

[0196] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an application required for operating the device or at least one function; the data storage area may store data created according to the use of the computer device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the computer device 10 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.

[0197] One or more units are stored in the memory 120, and when executed by one or more processors 110, the metadata migration method in any of the above method embodiments can be implemented, for example, the above described Figure 1 The method comprises steps S100 to S300.

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

[0199] Based on the above method embodiments, another embodiment of the present invention further provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the metadata migration method in any of the above method embodiments can be implemented, for example, the above described Figure 1 The method comprises steps S100 to S300.

[0200] As an example, the non-volatile storage medium can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable ROM (EEPROM), or a flash memory. Volatile memory can include a random access memory (RAM) as an external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synch link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0201] Based on the above method embodiments, another embodiment of the present invention further provides a computer program product, the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a processor, the metadata migration method in any of the above method embodiments can be implemented, for example, the above described Figure 1 The method comprises steps S100 to S300.

[0202] The embodiments described above are merely illustrative, in which the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0203] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can exist in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0204] Conditional language such as "can," "can," "might," or "may," unless specifically stated otherwise or otherwise understood within the context as used, is generally intended to convey, among other things, that a particular embodiment can include (while other embodiments do not) a particular feature, element, and / or operation. Thus, such conditional language is also generally intended to imply that a feature, element, and / or operation is required for one or more embodiments anyway or that one or more embodiments must include logic for determining, with or without input or prompting, whether such features, elements, and / or operations are included or will be performed in any particular embodiment.

[0205] What has been described herein, in this specification and in the drawings includes examples that can provide a metadata migration method, apparatus, computer equipment, and non-volatile computer-readable storage medium. Of course, it is not possible to describe every conceivable combination of elements and / or methods for the purpose of describing the various features of the present disclosure, but it can be recognized that many other combinations and permutations of the disclosed features are possible. Therefore, it is obvious that various modifications can be made to the present disclosure without departing from the scope or spirit of the present disclosure, but all these various modifications should fall within the scope of the claims attached to the present invention. In addition, or in the alternative, other embodiments of the present disclosure may be apparent from consideration of the present specification and drawings and from the practice of the present disclosure as presented herein. It is intended that the examples set forth in the present specification and drawings be considered illustrative and not restrictive in all respects. Although specific terms are employed herein, they are used in a general and descriptive sense and are not used for limiting purposes.

Claims

1. A metadata migration method, It is characterized in that The method comprises: When a collection instruction of a target user is detected, source DDL statements corresponding to metadata that needs to be migrated to a target database are collected in a source database; wherein the source database and the target database are heterogeneous databases; When a conversion instruction of the target user is detected, the source DDL statement is converted into a target DDL statement executable by the target database; When the playback instruction of the target user is detected, the target DDL statement is executed in the target-side database to generate corresponding metadata.

2. The metadata migration method according to claim 1, It is characterized in that When the target user's collection instruction is detected, source DDL statements corresponding to metadata that needs to be migrated to the target database are collected in the source database; wherein, before the source database and the target database are heterogeneous databases, the method further includes: Receive an interface opening instruction from the target user, and open and enter the metadata migration interface.

3. The metadata migration method according to claim 2, It is characterized in that When the target user's collection instruction is detected, source DDL statements corresponding to the metadata that needs to be migrated to the target database are collected in the source database; wherein the source database and the target database are heterogeneous databases, including: Detecting, through the metadata migration interface, a collection instruction issued by the target user by clicking a collection button; In response to the collection instruction, source DDL statements corresponding to the metadata that needs to be migrated to the target database are collected in the source database; wherein the source database and the target database are heterogeneous databases.

4. The metadata migration method according to claim 3, It is characterized in that When the target user's collection instruction is detected, source DDL statements corresponding to metadata that needs to be migrated to the target database are collected in the source database; wherein the source database and the target database are heterogeneous databases, and further comprising: The source DDL statement is persisted to a preset intermediate database.

5. The metadata migration method according to claim 4, It is characterized in that When the conversion instruction of the target user is detected, converting the source DDL statement into a target DDL statement executable by the target database includes: Detecting, through the metadata migration interface, a conversion instruction issued by the target user by clicking a conversion button; In response to the conversion instruction, the source DDL statement stored in the intermediate database is converted into a target DDL statement executable by the target database.

6. The metadata migration method according to claim 5, It is characterized in that When the playback instruction of the target user is detected, the target DDL statement is executed in the target-side database to generate corresponding metadata, including: Detecting, through the metadata migration interface, a playback instruction issued by the target user by clicking a playback button; In response to the playback instruction, the target DDL statement is migrated to the target-side database and executed to generate corresponding metadata.

7. The metadata migration method according to any one of claims 1 to 6, It is characterized in that When the playback instruction of the target user is detected, after executing the target DDL statement in the target-side database to generate corresponding metadata, the method further includes: Receive the log viewing instruction of the target user, and display the relevant log information in the metadata migration process.

8. A metadata migration device, It is characterized in that The device comprises: A collection module, for collecting source DDL statements corresponding to metadata to be migrated to a target database in a source database when a collection instruction of a target user is detected; wherein the source database and the target database are heterogeneous databases; A conversion module, configured to convert the source DDL statement into a target DDL statement executable by the target database when a conversion instruction of the target user is detected; The playback module is used to execute the target DDL statement in the target-side database to generate corresponding metadata when a playback instruction from the target user is detected.

9. A computer device, It is characterized in that The computer device comprises at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor. When the computer program is executed by the at least one processor, the metadata migration method according to any one of claims 1 to 7 can be implemented.

10. A non-volatile computer-readable storage medium, It is characterized in that The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the metadata migration method according to any one of claims 1 to 7 can be implemented.