Database migration method, device, equipment, storage medium and system

By collecting and analyzing the meta-information of the source database, we generate database portrait information and automatically select the target database, which solves the problem of inaccurate database migration evaluation caused by manual analysis and improves the accuracy and matching of database selection.

CN114064606BActive Publication Date: 2025-01-24ALIBABA CLOUD COMPUTING CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111177175.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-09
Publication Date
2025-01-24
Estimated Expiration
2041-10-09

AI Technical Summary

Technical Problem

During the database migration process, the existing technology relies on manual analysis, which makes it impossible for inexperienced users to obtain objective evaluation results, affecting the selection of the target database.

Method used

By collecting the meta-information of the source database, determining its various feature tags, and generating database portrait information based on these tags, the target database that matches the source database is automatically selected.

Benefits of technology

It realizes automated database portrait analysis, can comprehensively and accurately characterize the source database from multiple dimensions, and improves the accuracy and matching of target database selection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064606B_ABST
    Figure CN114064606B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a database migration method, device, equipment, storage medium and system, the method comprising: collecting metadata of a source database; determining multiple feature tags of the source database according to the metadata; determining image information of the source database according to the multiple feature tags; determining a target database according to the image information, so as to migrate the source database to the target database. By automatically performing image analysis on the source database, the source database can be comprehensively and accurately characterized from many dimensions. The image result is used as the basis for selecting the target database, so that the selected target database can be more matched with the source database and more suitable for use as the migration object of the source database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technology, and in particular to a database migration method, device, equipment, storage medium and system. Background Art

[0002] When users want to use a new database system, they need to migrate the database, that is, migrate the data in the source database to the target database.

[0003] The database migration process is usually divided into several stages: migration feasibility analysis, migration implementation, and migration acceptance. In the migration feasibility analysis stage, manual analysis is usually performed, which results in users who are inexperienced in using and managing databases being unable to obtain objective and prepared evaluation results, which in turn affects the selection of the target database. Summary of the invention

[0004] Embodiments of the present invention provide a database migration method, apparatus, device, storage medium and system for selecting a target database that better matches a source database to complete database migration.

[0005] In a first aspect, an embodiment of the present invention provides a database migration method, the method comprising:

[0006] Collect metadata of source database;

[0007] Determine multiple feature tags of the source database according to the meta information;

[0008] Determine the image information of the source database according to the multiple feature tags;

[0009] A target database is determined according to the portrait information to migrate the source database to the target database.

[0010] In a second aspect, an embodiment of the present invention provides a database migration device, the device comprising:

[0011] A collection module, used to collect metadata of the source database;

[0012] A determination module, configured to determine a plurality of feature tags of the source database according to the meta information; and determine the image information of the source database according to the plurality of feature tags;

[0013] A migration module is used to determine a target database according to the portrait information so as to migrate the source database to the target database.

[0014] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the database migration method described in the first aspect.

[0015] In a fourth aspect, an embodiment of the present invention provides a non-transitory machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor can at least implement the database migration method described in the first aspect.

[0016] In a fifth aspect, an embodiment of the present invention provides a computer program product, comprising: a computer program, which, when executed by a processor of an electronic device, enables the processor to execute the database migration method as described in the first aspect.

[0017] In a sixth aspect, an embodiment of the present invention provides a database profiling system for database migration, including:

[0018] A source database and an electronic device for profiling the source database, wherein the electronic device includes an information collection unit, an intelligent engine unit, a profiling unit and a decision unit;

[0019] The information collection unit is used to collect the meta information of the source database;

[0020] The intelligent engine unit is used to determine multiple feature tags of the source database according to the meta information;

[0021] The portrait unit is used to determine the portrait information of the source database according to the multiple feature tags;

[0022] The decision unit is used to determine the target database according to the portrait information, so as to migrate the source database to the target database.

[0023] In the solution provided by the embodiment of the present invention, during the migration of the source database, first, the metadata of the source database is collected, such as the structural information of the source database, information related to the operating status, information related to the capacity, and the like. Afterwards, the source database is feature-labeled based on the metadata of the source database to obtain a variety of feature tags of the source database, so as to profile the source database based on the multiple feature tags of the source database to obtain the profile information of the source database. In this way, it can be determined based on the profile information of the source database to which the source database should be migrated, and finally, the source database is migrated to the target database. By automatically performing a profile analysis on the source database, the source database can be comprehensively and accurately portrayed from many dimensions. The profile result can be used as the basis for selecting the target database, so that the selected target database can be more matched with the source database and more suitable for use as the migration object of the source database. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0025] Figure 1 A flowchart of a database migration method provided by an embodiment of the present invention;

[0026] Figure 2 A schematic diagram of a database profiling system provided by an embodiment of the present invention;

[0027] Figure 3 A schematic diagram of a database profiling result provided by an embodiment of the present invention;

[0028] Figure 4 A schematic diagram of a grammar parsing process provided by an embodiment of the present invention;

[0029] Figure 5 A schematic diagram of the structure of a database migration device provided by an embodiment of the present invention;

[0030] Figure 6 For Figure 5 A schematic diagram of the structure of an electronic device corresponding to the database migration device provided in the illustrated embodiment. DETAILED DESCRIPTION

[0031] 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.

[0033] The database migration method provided in the embodiment of the present invention can be executed by an electronic device, which can be a terminal device such as a PC, a laptop, or a server. The server can be a physical server, a virtual server, or a server instance in the cloud.

[0034] Figure 1 A flowchart of a database migration method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the following steps may be included:

[0035] 101. Collect metadata of the source database.

[0036] 102. Determine multiple feature tags of the source database based on the metadata.

[0037] 103. Determine the image information of the source database based on multiple feature tags.

[0038] 104. Determine a target database based on the profile information to migrate the source database to the target database.

[0039] The database migration method provided in the embodiment of the present invention can be applied to the migration of heterogeneous databases, and the so-called heterogeneous database migration refers to the migration between different types of databases. For example, a user migrates data in a local database to another database in the cloud for storage.

[0040] In this article, the database to be migrated is called the source database, and the database to which the data is migrated is called the target database. In the process of migrating the source database, first, you need to select the type of target database to which the source database is migrated, that is, select the target database. From the selection results, generally, the target database is a database of a different type from the source database, of course, it can also be the same.

[0041] In an embodiment of the present invention, in order to select a target database that is more suitable for storing data in a source database, a database portrait system is provided (the database portrait system can be run in an electronic device that executes the present solution) to portrait the source database. Based on the portrait of the source database, it can help users (referring to the party that implements the database migration operation) to more clearly and intuitively understand what the database to be migrated is like, thereby helping users to select a more suitable target database and formulate a suitable migration plan.

[0042] In order to obtain the image information of the source database, first, the source database is subjected to metadata collection to obtain various metadata related to the source database, including the data dictionary of the source database, including the structural information related to the database, and may also include the operation status data corresponding to the source database, operation log data, and the like. Afterwards, the collected metadata is imported into the database image system provided by the embodiment of the present invention, and then, based on the various labeling rules set in the database image system, the source database is subjected to data labeling processing according to the collected metadata to obtain a variety of feature labels corresponding to the source database. Optionally, for example, labels related to the structure of the source database, labels related to performance, and labels related to capacity may be included. The feature label determination process will be described below. Afterwards, by comprehensively analyzing the respective feature labeling results of the source database, the image information of the source database can be obtained, and finally the target database for migrating the source database is determined based on the image information of the source database. Among them, the image information of the source database may provide evaluation indicators including multiple dimensions such as capacity, performance, hot spots, complexity, sessions, load, specifications, etc., to achieve a comprehensive evaluation of the source database.

[0043] To more intuitively understand the process of determining the source database profile, Figure 2 An example is given. Figure 2 In the database portrait system for database migration, there are: a source database and an electronic device for profiling the source database, wherein the electronic device includes an information collection unit, an intelligent engine unit, a portrait unit and a decision unit. The information collection unit is used to collect metadata of the source database. The intelligent engine unit is used to determine multiple feature tags of the source database based on the metadata. The portrait unit is used to determine the portrait information of the source database based on the multiple feature tags. The decision unit is used to determine the target database based on the portrait information.

[0044] Assuming that for a source database, the collected meta-information may include a data dictionary, a system view, a structured query language (SQL) statement triggered by a user on the source database, and the like.

[0045] The data dictionary may include information related to the structure of the source database, such as the structural information of many objects contained in the source database. The structural information is generally described by the database model definition language (Data Definition Language, DDL) or procedural SQL (Procedural Language SQL, PLSQL).

[0046] The system view may include data related to the operating performance of the source database. The SQL statements triggered by the user may be recorded in the operating log of the source database.

[0047] Afterwards, if Figure 2 As shown in , the database profiling system includes an intelligent engine unit for data tagging, and the intelligent engine unit records the tagging rules corresponding to different features. After the collected meta-information is input into the intelligent engine unit, the intelligent engine unit determines the tagging rules used for different meta-information, and completes the tagging process of the corresponding feature tags based on the determined tagging rules.

[0048] like Figure 2 As shown in , optionally, the feature tags may include syntax feature tags, scenario feature tags, SQL execution performance tags, capacity tags, and the like.

[0049] Afterwards, the profiling unit can comprehensively analyze the labeling results of the above feature tags to obtain the corresponding profiling information of the source database, including evaluation indicators of dimensions such as hot spots, risks, complexity, scale, load, and sessions. Optionally, for each evaluation indicator, its corresponding score can be determined, and the score range is set to [1,5], for example, Figure 3 As shown in Figure 3 The figure shows a way to display the portrait results of a source database, so that users can intuitively see the performance of the source database in different evaluation indicators.

[0050] Afterwards, the decision-making unit recommends a matching target database to the user based on the profile information of the source database. For example, it recommends the type of target database suitable for use as the migration source database, such as different types of databases such as online transaction processing (OLTP), online analytical processing (OLAP), and hybrid transaction and analytical processing (HTAP).

[0051] The above is a macro introduction to the execution idea of ​​the solution provided in the embodiment of the present invention. The following is a detailed introduction to the feature tag marking process and the portrait information determination process.

[0052] As mentioned above, in order to have a more comprehensive and accurate understanding of the source database, multiple feature dimensions can be set to characterize the source database. Each feature dimension can be set with different feature labels as needed, and the basis for determining different feature labels is mainly the various meta-information collected from the source database.

[0053] In an optional embodiment, the metadata may include structural information of multiple objects in the source database. The objects included in the source database may be, for example, tables, views, fields, SQL, and the like. In combination with the grammatical parsing results of the structural information of multiple objects, feature labels of the multiple objects may be determined, including at least one of the following: grammatical feature labels, scene feature labels. In addition, in the process of grammatical parsing of the structural information of each object, the dependency relationship between different objects and the dependency relationship between objects and SQL query statements (indicating which SQL statement is used to query which object) may also be obtained. The dependency relationship between different objects, for example, a view object, actually has a table at the bottom layer, so it can be said that the view depends on the table; for example, there are foreign keys between tables, which is also a dependency relationship.

[0054] The grammatical feature tag is used to describe the grammatical type of the object, and the scene feature tag is used to describe the purpose of the object.

[0055] In fact, different types of databases have their own unique syntax. Syntax feature labels are defined from the perspective of the unique syntax of different types of databases, which can distinguish different types of databases. Based on this, the syntax feature labels obtained by parsing the objects in the source database in this article describe the user's unique syntax usage behavior for different objects in the source database.

[0056] Scenario feature labels are defined as being used to describe the usage behaviors of different users in operating database objects. In this article, they describe the usage of objects in the source database. For example, a table can be used as an adhoc table, base table, pseudo table, fact table, dimension table, and so on.

[0057] Generally, for a certain object, its corresponding scene feature label is often obtained based on its corresponding grammatical feature label, for example, the scene feature label of a certain object is comprehensively determined based on the grammatical feature label combined with other information. Taking a table as an example, its scene feature label can be comprehensively determined based on the grammatical feature label corresponding to the table, the SQL to access the table, and the capacity of the table.

[0058] The metadata collected from the source database contains many pieces of structural information. Each piece of structural information corresponds to an object. By parsing each piece of structural information, the grammatical feature label of the corresponding object can be obtained. Any object among the multiple objects in the source database is called the target object. Taking the target object as an example, the process of determining its corresponding grammatical feature label is explained:

[0059] Perform grammatical analysis on the structural information of the target object to obtain the corresponding abstract syntax tree;

[0060] Performing semantic analysis on the structural information of the target object based on the abstract syntax tree to obtain an abstract syntax tree with semantic tags, and marking corresponding semantic information on nodes in the abstract syntax tree with semantic tags;

[0061] According to the grammatical feature rule base corresponding to the source database, the abstract syntax tree with semantic tags is traversed to determine the grammatical feature label of the target object.

[0062] For ease of understanding, combined Figure 4 To illustrate the execution process of syntax parsing.

[0063] The structural information of the target object is generally described in DDL or PLSQL language. After the structural information of the target object is parsed, an initial abstract syntax tree (Abstract Syntax Tree, AST for short) will be obtained. After that, the structural information of the target object is semantically analyzed to obtain the semantic information corresponding to each node in the AST tree (including the nodes of the syntax used by the user), and these semantic information are annotated on the AST tree to obtain an AST tree with semantic tags. The corresponding grammatical feature rules are defined in advance for the grammar unique to the source database. In this way, based on these preset grammatical feature rules, the grammatical feature labels of the target object can be determined by traversing the AST tree with semantic tags. Among them, the traversal method can be, for example, a depth-first search method.

[0064] For example, through syntax analysis, it can be determined that there is a node in the AST tree corresponding to the target object, and this node may be a table or a view. Through semantic analysis, it can be determined based on the context corresponding to this node that this node actually corresponds to a table, and this semantics can be associated with this node.

[0065] In an optional embodiment, the collected metadata of the source database may also include operating status data corresponding to the source database. In this case, the performance feature label corresponding to the source database may also be determined based on the operating status data corresponding to the source database.

[0066] Optionally, the collected operation status data may include at least one operation status information of the source database and / or the execution status information of the query statement (SQL statement). Based on this, on the one hand, the operation performance characteristic label corresponding to the source database can be determined according to the at least one operation status information. On the other hand, the execution performance characteristic label of the query statement can also be determined according to the execution status information of the query statement.

[0067] In this embodiment, the operating status of the source database is divided into two levels for description: one is the macro level, which reflects the overall operating status of the source database, and the other is the micro level, which is used to reflect the execution performance of the SQL statements triggered by the user on the source database.

[0068] In practical applications, optionally, the at least one operating status information used to measure the overall operating status of the source database may be, for example, CPU utilization, load, throughput, etc. The throughput may be represented by the query rate per second (QPS) or the number of transactions processed per second (TPS).

[0069] A corresponding threshold can be set in advance for each of the above-mentioned operation status information, and based on the comparison results of the various operation status information of the source database actually collected and the corresponding threshold, the performance characteristic labels of the source database in various operation status information dimensions can be determined. For example, if the QPS of the source database collected is greater than the corresponding threshold, it can be determined that the corresponding label of the source database in the QPS dimension is: a high throughput label, otherwise, it is a low throughput label.

[0070] For SQL statements, the execution status of each SQL statement triggered on the source database can be analyzed, so as to label each SQL statement with a corresponding performance tag. Optionally, the indicators used to measure the execution performance of SQL statements can include the execution time, execution risk, CPU usage, etc. of the SQL statement.

[0071] For example, an execution time threshold for measuring the execution speed of SQL statements can be set in advance. If the actual execution time of a SQL statement is greater than the threshold, it can be determined that the SQL statement has an execution performance label of "slow SQL". Conversely, if it is less than the threshold, it can be determined that the SQL statement has an execution performance label of "fast SQL".

[0072] For example, in actual applications, SQL statements may have various risk factors that may affect their normal execution, such as no index, or a user's query behavior may not be suitable for SQL statements. You can pre-set multiple risk factors that affect the normal execution of SQL statements. Based on a SQL statement that needs to be analyzed, you can determine whether it hits one of the risk factors. If it does, the SQL statement will be labeled with the corresponding risk factor.

[0073] In an optional embodiment, the collected source database meta information may also include: storage capacity information of multiple storage carriers in the source database. At this time, the capacity feature tags corresponding to the multiple storage carriers may also be determined based on the storage capacity information of the multiple storage carriers in the source database.

[0074] The storage medium may include, for example, tables, large objects (LOBs), etc. The above storage capacity information refers to the amount of data actually stored in the storage medium.

[0075] For example, for a table, different thresholds can be set in advance to divide the table into two capacity characteristic labels: large table and small table. If the amount of data stored in a table is less than a certain threshold, the table is determined to be a small table; if the amount of data stored in a table is greater than a certain threshold, the table is determined to be a large table.

[0076] For example, for LOB, the capacity characteristic label division method of the above table can also be used, or it can be divided into whether there is a LOB.

[0077] In summary, based on the various metadata collected from the source database, the source database can be labeled from many feature dimensions to obtain various feature labels of the source database. Afterwards, these feature labels can be combined to obtain a portrait of the source database.

[0078] In summary, the values ​​of multiple evaluation indicators corresponding to the source database can be determined according to the mapping relationship between the set feature tags and the evaluation indicators, and the image information of the source database includes the values ​​of the multiple evaluation indicators. In other words, the image of the source database can be reflected by the set multiple evaluation indicators.

[0079] As mentioned above, these multiple evaluation indicators may include, for example, scale, session, hotspot, complexity, risk, load, etc. A score of 1 to 5 (for example only) may be set for each evaluation indicator. For any evaluation indicator, the score of the evaluation indicator may be obtained according to the specific performance of the corresponding influencing factors.

[0080] Optionally, a neural network model may be pre-trained, and various feature label determination results obtained by labeling the source database may be input into the neural network model to output the score values ​​of each evaluation index according to the neural network model. It should be noted that the factors affecting each evaluation index may include not only the feature labels of the source database, but also other information.

[0081] Sessions are used to measure the connection status of the source database. The higher the score, the more sessions are connected to the source database at the same time. Therefore, the score corresponding to the session can be determined by collecting the number of sessions connected to the source database at the same time.

[0082] The complexity of the source database can be calculated based on the scene feature labels, grammatical feature labels, performance feature labels and other dimensions of the source database. In simple terms, the contribution weights of different feature labels to the complexity can be set to calculate the score value corresponding to the complexity based on the weights.

[0083] Risk is used to measure whether the source database has SQL or object execution performance risks. The higher the score, the greater the possibility that the source database has risks. Factors that affect the risk score value may include, for example, SQL execution performance feature labels and source database operation performance feature labels. You can set the contribution weights of different performance feature labels to the risk value, and calculate the score value corresponding to the risk based on the weights.

[0084] Hotspots are used to measure whether there are objects with high access frequency in the source database. The higher the hotspot score, the more frequently accessed objects are in the source database. The number of accesses to each object can be obtained by counting the query objects corresponding to each SQL statement. If the number of accesses to an object is greater than a set threshold, the object is considered a hotspot.

[0085] Scale is used to measure the scale of the source database resources. The higher the score, the larger the scale of the source database. The scale of the source database can be determined based on the capacity feature label of the source database. For example, if the source database contains many tables with large capacity, it means that the scale of the source database is large.

[0086] Load is used to measure the operating performance of the source database. The higher the score, the higher the operating load utilization of the source database. The load score of the source database can be determined in combination with the performance feature label of the source database.

[0087] After obtaining the image information of the source database, the values ​​of multiple evaluation indicators reflecting the image information and the characteristic labels of the source database obtained previously can be displayed to the user, so that the user can have a more intuitive and comprehensive understanding of the source database. In the target database recommended in combination with the image information of the source database, the user can also confirm or modify the recommended target database.

[0088] In summary, in the embodiments of the present invention, by automatically performing a portrait analysis on the source database, the source database can be comprehensively and accurately characterized from many dimensions. The portrait result serves as a basis for selecting a target database, which can make the selected target database more compatible with the source database and more suitable for use as a migration object of the source database.

[0089] The following will describe in detail the database migration device of one or more embodiments of the present invention. Those skilled in the art will appreciate that these devices can be configured using commercially available hardware components through the steps taught in this solution.

[0090] Figure 5 A schematic diagram of a database migration device provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the device includes: a collection module 11, a determination module 12, and a migration module 13.

[0091] The collection module 11 is used to collect the meta information of the source database.

[0092] The determination module 12 is used to determine a plurality of feature tags of the source database according to the meta-information; and determine the portrait information of the source database according to the plurality of feature tags.

[0093] The migration module 13 is used to determine the target database according to the portrait information, so as to migrate the source database to the target database.

[0094] Optionally, the determination module 12 may be specifically used to determine the values ​​of multiple evaluation indicators corresponding to the source database according to a mapping relationship between set feature labels and evaluation indicators, and the portrait information includes the values ​​of the multiple evaluation indicators.

[0095] Optionally, the meta-information includes: structural information of multiple objects in the source database. In this case, the determination module 12 is specifically used to: perform grammatical parsing on the structural information of the multiple objects to determine feature tags of the multiple objects; the feature tags include at least one of the following: a grammatical feature tag, a scene feature tag; wherein the grammatical feature tag is used to describe the grammatical type used by the object, and the scene feature tag is used to describe the purpose of the object.

[0096] Among them, optionally, the determination module 12 can be used to: perform grammatical analysis on the structural information of the target object to obtain a corresponding abstract syntax tree, where the target object is any one of the multiple objects; perform semantic analysis on the structural information based on the abstract syntax tree to obtain an abstract syntax tree with semantic tags, in which the nodes in the tree are marked with corresponding semantic information; and traverse the abstract syntax tree with semantic tags according to a grammatical feature rule base corresponding to the source database to determine the grammatical feature label of the target object.

[0097] Optionally, the meta information includes: operation status data corresponding to the source database. At this time, the determination module 12 can be used to: determine the performance feature label corresponding to the source database according to the operation status data corresponding to the source database.

[0098] Optionally, the operation status data includes at least one operation status information of the source database and / or the execution status information of the query statement. Therefore, the determination module 12 can be specifically used to: determine the operation performance characteristic label corresponding to the source database according to the at least one operation status information; and / or determine the execution performance characteristic label of the query statement according to the execution status information of the query statement.

[0099] Optionally, the meta information includes: storage capacity information of multiple storage carriers in the source database. In this case, the determination module 12 can be used to: determine the capacity feature tags corresponding to the multiple storage carriers according to the storage capacity information of the multiple storage carriers in the source database.

[0100] Figure 5 The device shown can execute the steps introduced in the aforementioned embodiments. For detailed execution process and technical effects, please refer to the description in the aforementioned embodiments, which will not be repeated here.

[0101] In one possible design, the above Figure 5 The structure of the database migration device shown can be implemented as an electronic device, such as Figure 6 As shown, the electronic device may include: a processor 21, a memory 22, and a communication interface 23. The memory 22 stores executable codes, and when the executable codes are executed by the processor 21, the processor 21 can at least implement the database migration method provided in the above embodiments.

[0102] As mentioned above, the memory 22 may include a cache and SRAM in the processor 21, and may also include a memory.

[0103] In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the database migration method provided in the aforementioned embodiment.

[0104] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.

[0105] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A database migration method, characterized in that: include: Collect metadata of source database; Determine multiple feature tags of the source database according to the meta information; Determine the image information of the source database according to the multiple feature tags; Determine a target database according to the portrait information to migrate the source database to the target database; Wherein, determining the portrait information of the source database according to the multiple feature tags includes: determining the values ​​of the multiple evaluation indicators corresponding to the source database according to the mapping relationship between the set feature tags and the evaluation indicators, and the portrait information includes the values ​​of the multiple evaluation indicators; The feature tag includes at least one of the following: a grammatical feature tag and a scenario feature tag; wherein the grammatical feature tag is used to describe the grammatical type used by the object, and the scenario feature tag is used to describe the purpose of the object, and the object is contained in the source database; the evaluation index includes evaluation indicators of at least one of the following dimensions: session, risk, hot spot, complexity, and load.

2. The method according to claim 1, characterized in that The meta information includes: structural information of multiple objects in the source database; The determining of the multiple feature tags of the source database according to the meta information includes: The structural information of the multiple objects is parsed to determine feature tags of the multiple objects.

3. The method according to claim 2, characterized in that The performing grammatical parsing on the structural information of the multiple objects to determine the feature tags of the multiple objects includes: Performing syntax analysis on structural information of a target object to obtain a corresponding abstract syntax tree, wherein the target object is any one of the multiple objects; Performing semantic analysis on the structural information based on the abstract syntax tree to obtain an abstract syntax tree with semantic tags, wherein corresponding semantic information is marked on nodes in the abstract syntax tree with semantic tags; According to the grammatical feature rule base corresponding to the source database, the abstract syntax tree with semantic tags is traversed to determine the grammatical feature label of the target object.

4. The method according to claim 1, characterized in that The meta information includes: operation status data corresponding to the source database; The determining of the multiple feature tags of the source database according to the meta information includes: A performance feature label corresponding to the source database is determined according to the operating status data corresponding to the source database.

5. The method according to claim 4, characterized in that The operation status data includes at least one operation status information of the source database and / or execution status information of the query statement; The determining, according to the operating status data corresponding to the source database, the performance characteristic label corresponding to the source database includes: Determine the operation performance characteristic label corresponding to the source database according to the at least one operation status information; and / or, An execution performance characteristic tag of the query statement is determined according to the execution status information of the query statement.

6. The method according to claim 1, characterized in that The meta information includes: storage capacity information of multiple storage media in the source database; The determining of the multiple feature tags of the source database according to the meta information includes: According to the storage capacity information of the plurality of storage carriers in the source database, capacity feature tags corresponding to the plurality of storage carriers are determined.

7. A database migration device, characterized in that: include: A collection module, used to collect metadata of the source database; A determination module, configured to determine a plurality of feature tags of the source database according to the meta information; Determine the image information of the source database according to the multiple feature tags; A migration module, used to determine a target database according to the portrait information, so as to migrate the source database to the target database; The determination module is specifically used to: determine the values ​​of multiple evaluation indicators corresponding to the source database according to the mapping relationship between the set feature labels and the evaluation indicators, and the portrait information includes the values ​​of the multiple evaluation indicators; The feature tag includes at least one of the following: a grammatical feature tag and a scenario feature tag; wherein the grammatical feature tag is used to describe the grammatical type used by the object, and the scenario feature tag is used to describe the purpose of the object, and the object is contained in the source database; the evaluation index includes evaluation indicators of at least one of the following dimensions: session, risk, hot spot, complexity, and load.

8. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the database migration method according to any one of claims 1 to 6.

9. An electronic device, characterized in that: include: A memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the database migration method according to any one of claims 1 to 6.

10. A computer program product, characterized in that include: A computer program, when executed by a processor of an electronic device, causes the processor to execute the database migration method according to any one of claims 1 to 6.

11. A database profiling system for database migration, characterized in that: include: A source database and an electronic device for profiling the source database, wherein the electronic device includes an information collection unit, an intelligent engine unit, a profiling unit and a decision unit; The information collection unit is used to collect the meta information of the source database; The intelligent engine unit is used to determine multiple feature tags of the source database according to the meta information; The portrait unit is used to determine the portrait information of the source database according to the multiple feature tags; The decision unit is used to determine a target database according to the portrait information, so as to migrate the source database to the target database; The portrait unit is specifically used to: determine the values ​​of multiple evaluation indicators corresponding to the source database according to the mapping relationship between the set feature labels and the evaluation indicators, and the portrait information includes the values ​​of the multiple evaluation indicators; The feature tag includes at least one of the following: a grammatical feature tag and a scenario feature tag; wherein the grammatical feature tag is used to describe the grammatical type used by the object, and the scenario feature tag is used to describe the purpose of the object, and the object is contained in the source database; the evaluation index includes evaluation indicators of at least one of the following dimensions: session, risk, hot spot, complexity, and load.

Citation Information

Patent Citations

  • Heterogeneous database application code adaptation evaluation device and method and storage medium

    CN112269774A

  • Implementing a logically partitioned data warehouse using a container map

    US20170116278A1