CN115269550A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN115269550A
CN115269550A CN202210892406.XA CN202210892406A CN115269550A CN 115269550 A CN115269550 A CN 115269550A CN 202210892406 A CN202210892406 A CN 202210892406A CN 115269550 A CN115269550 A CN 115269550A
Authority
CN
China
Prior art keywords
database
migrated
information
objects
migrating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210892406.XA
Other languages
Chinese (zh)
Inventor
章锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202210892406.XA priority Critical patent/CN115269550A/en
Publication of CN115269550A publication Critical patent/CN115269550A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/214Database migration support

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a data processing method and device, which can be applied to the field of data processing and are used for solving the problem of low data migration efficiency in the prior art. The method comprises the following steps: acquiring information of a first database, information of a second database and object information of the first database, wherein the object information comprises the name of an object and metadata of the object; determining an object to be migrated and object information of the object to be migrated according to the object information of the first database; and migrating the object to be migrated to the second database according to the information of the second database. By the method, the object to be migrated can be automatically migrated from the first database to the second database, so that the efficiency of data migration can be improved.

Description

Data processing method and device
Technical Field
The present invention relates to the field of data processing, and in particular, to a data processing method and apparatus.
Background
With the rapid development of database technology, compared with the traditional database, the cloud database is more and more favored by application developers due to the characteristics of high expansibility, high recoverability, high controllability and the like, and the requirement for database migration is increased gradually.
Currently, a migration method of a database generally requires a database operation and maintenance person to generate a Structured Query Language (SQL) script for creating an object in a source database, and then execute the SQL script on a target database one by one. The migration method is complicated in process and low in migration efficiency.
Disclosure of Invention
The embodiment of the invention provides a data processing method and device, which are used for solving the problems that in the prior art, data migration needs manual processing of database operation and maintenance personnel, and the migration efficiency is low.
In a first aspect, an embodiment of the present invention provides a data processing method, where the method includes: acquiring information of a first database and information of a second database; acquiring object information of the first database, wherein the object information comprises the name of an object and metadata of the object; determining an object to be migrated and object information of the object to be migrated according to the object information of the first database; and migrating the object to be migrated to the second database according to the information of the second database.
Based on the scheme, the object information of the first database is obtained, then the object to be migrated and the object information of the object to be migrated are determined based on the object information of the first database, and then the object to be migrated is automatically migrated from the first database to the second database, so that the data migration efficiency can be improved. Moreover, the labor cost required in data migration can be reduced. Furthermore, the success rate of migration can be improved through automatic migration.
Optionally, migrating the object to be migrated to the second database according to the information of the second database, including: determining the topological structure of the object to be migrated; determining the migration sequence of the objects to be migrated according to the topological structure and the types of the objects to be migrated; and migrating the objects to be migrated to the second database according to the migration sequence of the objects to be migrated.
According to the topological structure and the type of the object to be migrated, the migration sequence of the object to be migrated can be determined, the object to be migrated is migrated to the second database according to the migration sequence of the object to be migrated, and migration of the object to be migrated with dependency relationship according to the migration sequence can be achieved.
Optionally, the information of the first database includes a type of the first database, and the information of the second database includes a type of the second database; the migrating the objects to be migrated to the second database according to the migration sequence of the objects to be migrated includes: and if the type of the first database is determined to be isomorphic with the type of a second database, migrating the object to be migrated to the second database according to a migration sequence of the object to be migrated according to a preset mapping rule.
Optionally, the information of the first database includes a type of the first database, the information of the second database includes a type of the second database, and the object to be migrated includes a table; the migrating the objects to be migrated to the second database according to the migration sequence of the objects to be migrated includes: if the type of the first database is determined to be different from the type of the second database, the field of the table of the object to be migrated is mapped to the field type of the second database, and the object to be migrated is migrated to the second database according to a preset mapping rule.
By adopting the method, when the type of the first database is inconsistent with the type of the second database, the field of the table of the object to be migrated can be automatically determined to be mapped, and the field of the table of the object to be migrated can be mapped, so that the manual process of mapping the field of the table of the object to be migrated is not needed.
Optionally, the determining a migration sequence of the objects to be migrated according to the topology and the types of the objects to be migrated includes: creating an empty ordered queue; and storing the objects to be migrated to the empty ordered queue according to the migration sequence.
In the above scheme, the migration sequence of the objects to be migrated can be stored by creating an empty ordered queue, so that the objects to be migrated can be migrated in the migration sequence.
Optionally, the sequence of the objects to be migrated includes: the priority of the table is higher than that of the view, the priority of the view is higher than that of the function, and the priority of the function is higher than that of the stored procedure.
Optionally, the migrating the object to be migrated to the second database includes: acquiring the object information of the mapped object to be migrated, and migrating the object to be migrated to the second database by adopting a Data Definition Language (DDL) statement.
In a second aspect, an embodiment of the present invention provides a data processing apparatus, including: the acquisition unit is used for acquiring the information of the first database and the information of the second database; acquiring object information of the first database, wherein the object information comprises the name of an object and metadata of the object; the processing unit is used for determining an object to be migrated and object information of the object to be migrated according to the object information of the first database; and migrating the object to be migrated to the second database according to the information of the second database.
Optionally, the processing unit is specifically configured to determine a topology structure of the object to be migrated; determining the migration sequence of the objects to be migrated according to the topological structure and the types of the objects to be migrated; and migrating the objects to be migrated to the second database according to the migration sequence of the objects to be migrated.
Optionally, the information of the first database includes a type of the first database, and the information of the second database includes a type of the second database; and the processing unit is specifically configured to, if it is determined that the type of the first database is isomorphic with the type of the second database, migrate the object to be migrated to the second database according to a migration sequence of the object to be migrated according to a preset mapping rule.
Optionally, the information of the first database includes a type of the first database, and the information of the second database includes a type of the second database; and the processing unit is specifically configured to map a field of the table of the object to be migrated to a field type of a second database if it is determined that the type of the first database is different from the type of the second database, and migrate the object to be migrated to the second database according to a preset mapping rule.
Optionally, the processing unit is specifically configured to: creating an empty ordered queue; and storing the objects to be migrated to the empty ordered queue according to the migration sequence.
Optionally, the priority of the table is higher than that of the view, the priority of the view is higher than that of the function, and the priority of the function is higher than that of the storage process.
Optionally, the processing unit is specifically configured to obtain object information of the mapped object to be migrated; and migrating the object to be migrated to the second database by adopting a data definition DDL statement.
In a third aspect, an embodiment of the present invention provides a computing device, including at least one processor and at least one memory, where the memory stores a computer program, and when the program is executed by the processor, the processor is caused to execute the data processing method according to any one of the above first aspects.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the storage medium stores a program, and when the program runs on a computer, the program causes the computer to implement a method for performing data processing according to any of the above first aspects.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of a possible application scenario provided in an embodiment of the present invention;
fig. 2 is a schematic diagram of a specific application scenario provided in the embodiment of the present invention;
fig. 3 is a schematic flowchart of a method of a data processing method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a method for migrating an object to be migrated to the second database according to an embodiment of the present invention;
FIG. 5 is a table dependency graph diagram provided in an embodiment of the present invention;
fig. 6 is a flowchart of a method for obtaining a topology structure of an object to be migrated according to an embodiment of the present invention;
fig. 7 is an interaction diagram of a management platform according to an embodiment of the present invention;
FIG. 8a is a schematic diagram of selecting an object to be migrated according to an embodiment of the present invention;
FIG. 8b is a diagram illustrating a migration progress according to an embodiment of the present invention;
FIG. 9 is a block diagram of a data processing apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a computing device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Fig. 1 is a schematic diagram of a possible application scenario provided in the embodiment of the present invention. The application scenario is exemplified by including a first database and a second database. The first database may be a source database and the second database may be a cloud database. The first database may also be referred to as a source database, and the second database may also be referred to as a target database.
As described in the background, the existing migration method for the database generally requires the operation of the database operation and maintenance personnel, resulting in low migration efficiency.
In view of this, an embodiment of the present invention provides a data processing method, which can automatically migrate an object to be migrated in a first database to a second database, so as to improve migration efficiency.
Fig. 2 is a schematic diagram of a specific application scenario provided in the embodiment of the present invention. The application scenario includes a first database, a second database, and a management platform. The description of the first database and the second database can be referred to the related description, and will not be repeated here. In this scenario, an example is to migrate an object to be migrated from a first database to a second database. The management platform can provide an interactive operation interface and a program processing background. The interactive operation interface can be used for displaying information of the first database, displaying all objects to be migrated or part of the objects to be migrated in the first database, and displaying the objects to be migrated to a user for selection and configuration. Further, the interactive operation interface may also be used to display the migration progress and the migration result of the data, and the implementation of the specific function will be further explained in fig. 8a or fig. 8b, which is not described herein in detail.
Based on the above, as shown in fig. 3, a schematic method flow diagram of a data processing method according to an embodiment of the present invention is provided. The method is suitable for the application scenario shown in fig. 2. The method comprises the following steps:
step 301, information of the first database and information of the second database are obtained.
In an embodiment of the present invention, the information of the first database includes a first database type, a first Internet Protocol (IP), a first Port (Port), a first username, and a first password. Wherein the first database type includes, but is not limited to, oracle, mySQL. The information of the second database comprises a second database type, a second IP, a second Port, a second user name and a second password. Wherein the second database type includes, but is not limited to, oracle, mySQL.
It will be appreciated that the first database type may be the same as the second database type, or may be different. If the first database type is different from the second database type, the first database and the second database are called as heterogeneous databases. And if the first database type is the same as the second database type, the first database and the second database are called as isomorphic databases.
Step 302, obtaining the object information of the first database.
In the embodiment of the invention, the object information comprises the name of the object and the metadata of the object. The names of objects include, but are not limited to, libraries, tables, views, functions, stored procedures, and the like. Where the tables in the library consist of rows (Row) and columns (Column). Columns are composed of the same kind of information, each column is also called a field, and the title of each column is called a field name. A row comprises several columns of information items. A line of data is called a record or record and it expresses a meaningful combination of information. A database table is composed of one or more records, and the tables without records are called empty tables. Each table typically has a primary key that uniquely identifies a record. A view is a virtual table that does not actually exist in the database, and has a set of named fields and data items. Views are generated by querying database tables, which limit the data that a user can see and modify. It can be seen that the view can be used to control the user's access to the data and can simplify the display of the data, i.e. only those data information that is required are displayed through the view. A Stored Procedure (Stored Procedure) is a kind of database object that stores a complex program in a database for external program calls. It is compiled and stored in a database and the user executes it by specifying the name of the stored procedure and giving the parameters (if the stored procedure carries the parameters).
Generally, metadata is used to support functions of indicating storage locations, history, resource lookups, file records, and the like, through information describing attributes of the material. In the database fields, metadata is used to interpret the contents of the database. Specifically, the metadata of the object can be read according to the name of the object.
Taking the name of an object as an example, the metadata of the object includes the field name, data type, constraint, foreign key, index, etc. of the table, please refer to table1. Where the index is built up in order from a specified list of database tables. It provides a fast way to access data and can supervise the data of the table so that the data in the column to which its index points is not duplicated. Table1 shows part of the metadata of the table and the contents corresponding to the metadata.
TABLE1 metadata information of tables
Figure BDA0003768105950000071
The following exemplary shows three ways of obtaining metadata for objects of the first database. Taking the first database as a MySQL database as an example, the metadata of the object may be acquired using a SHOW statement. Alternatively, the correlation table may be searched from an INFORMATION _ SCHEMA database, where INFORMATION _ SCHEMA is a system database owned by MySQL and stores all metadata therein, and the metadata of the desired object can be obtained by selecting the correlation table therein. Alternatively, the metadata of the object may be obtained by inputting a command line.
In a possible implementation manner, according to the obtained information of the first database, the management platform uses an SQL statement to connect with the first database and read object information in the first database, including a name of the object and metadata of the object.
Step 303, determining an object to be migrated and object information of the object to be migrated according to the object information of the first database.
In the embodiment of the invention, the acquired object information of the first database is displayed on an interactive interface of the management platform, and the object information of the first database can be partially selected as the object to be migrated or fully selected as the object to be migrated according to requirements. Fig. 8a is a schematic diagram of selecting an object to be migrated according to an embodiment of the present invention. The interactive interface displays all the objects in the first database, and whether the object is selected as a migration object or not can be selected through a button. It is worth noting that the interactive interface also provides a full selection button, so that all objects in the first database can be conveniently selected as the objects to be migrated.
And when the object to be migrated of the first database is determined, acquiring the object information of the object to be migrated based on the object to be migrated. For the manner of obtaining the object information of the object to be migrated, reference may be made to the manner of obtaining the object information of the first database, which is not described herein again. The object information of the object to be migrated includes a name of the object to be migrated and metadata of the object to be migrated.
And writing the information of the first database and the information of the second database obtained in the step 301, the object information of the first database obtained in the step 302, and the object information of the object to be migrated obtained in the step 303 into the management platform.
And step 304, migrating the object to be migrated to the second database according to the information of the second database.
With reference to fig. 4, a flowchart of a method for migrating the object to be migrated to the second database according to an embodiment of the present invention is shown. The method comprises the following steps:
step 400, writing the information of the first database, the information of the second database and the object information of the object to be migrated into the management platform.
For the information of the first database, the information of the second database, and the object information of the object to be migrated, reference may be made to the foregoing related descriptions, and details are not described here again.
Step 401, determine whether the object to be migrated needs the name mapping rule of the configured object. If so, go to step 402; if not, go to step 403.
It can be understood that in some service scenarios or application scenarios, the name of the object to be migrated needs to be modified, and the management platform obtains the name mapping information of the set object.
In the embodiment of the invention, the name mapping rule of the object refers to modifying the name of the object to be migrated according to the configured mapping rule. Modifications include, but are not limited to: and prefixing the names of all the objects to be migrated, and/or suffixing the names of all the objects to be migrated, and/or modifying the names of the specified objects to be migrated.
Taking the example that modifying the names of the objects to be migrated may be prefixing the names of all the objects to be migrated. For example, the object to be migrated includes a library (schema 1), and the mapping rule is configured to prefix "dst _" to the name of the object to be migrated, then the name of the object mapped to the second database will become dst _ schema1. For another example, the object to be migrated includes a table (table 1), and the configured mapping rule is to prefix "dst _" to the name of the object to be migrated, so the name of the object mapped to the second database will become dst _ table1.
Take the example that modifying the names of the objects to be migrated may be suffixing the names of all the objects to be migrated. For example, the object to be migrated includes a library (schema 1), and the configured mapping rule is to suffix "_ dst" to the name of the object to be migrated, then the name of the object mapped to the second database will become schema1_ dst. For another example, the object to be migrated includes a table (table 1), and the configured mapping rule is to suffix "_ dst" to the name of the object to be migrated, then the name of the object mapped to the second database will become table1_ dst.
Taking the example that modifying the name of the object to be migrated may be modifying the name of the specified object to be migrated. For example, the object to be migrated includes table1, and the configured mapping rule specifies that table1 is mapped to table2, then the name of the object mapped to the second database will become table2.
Step 402, writing the configured mapping rule into the management platform.
At step 403, an empty ordered queue is created.
For example, in a MySQL database, an empty ordered queue may be created by a List < Object > Object List = new ArrayList < >) statement.
In the following description, the object to be migrated includes a table as an example.
Step 404, obtaining the dependency relationship of the table in the object to be migrated from the first database, constructing a topological structure (or called as a dependency relationship graph) according to the dependency relationship, determining the migration sequence of the object to be migrated according to the topological structure, and writing the migration sequence into the created empty ordered queue.
In a database, references among objects are dependencies, references among tables are dependencies of tables, and dependencies can be viewed in various ways. For example, in a MySQL database, the dependency of the current database object can be checked by a sysdepends or sp _ depends statement.
Fig. 5 is a diagram illustrating a table dependency graph according to an embodiment of the present invention. The table connected by the arrow head is a parent table, the table pointed by the arrow head is a child table, and the table without the arrow head is independent of any other table. Where a parent table refers to a table storing a primary key and a child table refers to any table that uses a foreign key to reference the parent table. It can be seen that in fig. 5, table a is a parent table, table D is a parent table, table B is a child table of table a, table E is a child table of table D, and table C is a child table of tables B and E.
Fig. 6 is a flowchart of a method for obtaining a topology structure of an object to be migrated according to an embodiment of the present invention. The method comprises the following steps:
step 601, obtaining the dependency relationship of all tables in the object to be migrated through the SQL statement, and constructing a dependency relationship map.
The dependency graph may be the graph shown in fig. 5 described above, for example.
Step 602, traverse all tables in the graph.
The traversal refers to sequentially making one-time and only one-time access to each node in the tree or the graph along a certain search route. The operation performed by the access node depends on the particular application.
Step 603, determine whether the currently traversed table has an arrow pointing thereto. If the currently traversed table does not have an arrow pointing to it, which indicates that the currently traversed table does not depend on any other table in the dependency graph, then execute step 604; if the currently traversed table has an arrow pointing to indicate that there is a dependency relationship between the currently traversed table and other tables to be migrated in the database, execute step 608.
Step 604, inserting the table that is not dependent on any other table in the dependency graph into the created ordered queue, and removing the table from the dependency graph.
Step 605, determine whether the current table is the last table in the dependency graph. If the current table is the last table, step 606 is performed, and if the current table is not the last table, step 608 is performed.
And 606, judging whether the dependency relationship graph is empty or not. If the dependency relationship map is empty, it indicates that there is no table in the map, indicating that the dependency ordering of the table in the object to be migrated has been completed, and execute step 607. If the dependency graph is not empty, it indicates that there are other tables in the graph, which indicates that the dependency ranking of the table in the object to be migrated is not completed, and step 608 is executed.
Step 607, the ordered queue of the reordered table is output.
Step 608, continue to look up the next table in the dependency graph.
Through the steps 601 to 608, the topology of the object to be migrated can be obtained.
Step 405, sorting according to object types, and storing the sorted objects to be migrated into an ordered queue.
Specifically, the sorting is performed according to the priority of the object types. Wherein the priority of the object type is: the priority of the table is higher than that of the view, the priority of the view is higher than that of the function, and the priority of the function is higher than that of the stored procedure.
Step 406, obtaining the object information of the object to be migrated in the ordered queue.
The obtaining process of step 406 can refer to the related description, and is not described herein again.
Step 407, determine whether the object to be migrated is configured with the name mapping rule of the object. If the object to be migrated is configured with the name mapping rule of the object, step 408 is performed. If the object to be migrated does not have the name mapping rule of the configured object, step 409 is executed.
And step 408, modifying the name of the object to be migrated according to the configured mapping rule.
The specific implementation of this step 408 can be found in the related description above.
Step 409, judging whether the type of the first database is the same as that of the second database; if not, go to step 410. If so, go to step 411.
Step 410, mapping the field type of the table in the object to be migrated in the first database to the field type of the table in the second database.
The tables in the two databases which are mutually heterogeneous have different field types, so that the tables in the first database cannot be directly migrated to the second database. In this step 410, the field types of the tables in the first database are automatically mapped to field types that conform to the second database type.
For example, the first database is of Oracle type and the second database is of MySQL type. The object mapping module will automatically perform the type conversion as shown in table2 for the field types of the table.
TABLE2 Oracle to MySQL table migration field type mapping rules
Figure BDA0003768105950000111
Figure BDA0003768105950000121
Step 411, obtaining metadata of the object to be migrated in the mapped ordered queue, generating a DDL statement for creating the object, writing the DDL statement into the second database, and completing migration of the object to be migrated.
Depending on the different objects in the database, the management platform will generate the DDL statements using the following method. For example: for libraries, the DDL statements used to create objects are: DLL = create (create) + library name; for a table, the DDL statement used to create an object is: DDL = table name information + field information + primary key information + index information + foreign key information + engine information + character set information; for a view, the DDL statements used to create an object are: creating a DDL statement acquired from a first database; for a function, the DDL statement used to create an object is: creating a DDL statement acquired from a first database; a storing procedure, the DDL statement used to create the object is: a create DDL statement retrieved from a first database.
At step 412, the DDl statement is executed to complete the migration of the data object.
In a possible implementation manner, the management platform connects to the second database through an SQL statement, and writes the DDL statement generated in step 411 to the second database. And the second database executes the DDL statement to realize that the objects to be migrated selected in the first database are written into the second database according to the migration sequence in the ordered queue. In the process, the management platform displays the migration progress in real time in the interactive interface and displays the migration result after all the migration is completed. Fig. 8b is a schematic diagram for displaying a migration progress according to an embodiment of the present invention. The interactive interface displays the migration progress, and enables a user to monitor the migration result. It should be understood that FIG. 8b is exemplary of a migration progress of 50% completion.
Fig. 7 shows an interaction diagram of a management platform provided by an embodiment of the present invention. The management platform includes an interactive interface 701 and a management database backend 702. Management database backend 702 may read and execute operations in interactive interface 701. In the embodiment of the present invention, the management database background 702 obtains the information of the first database and the information of the second database input in the front-end interactive interface 701, the management database background 702 is connected to the first database and the second database respectively using SQL statements, and after the steps in fig. 3 are executed, the selected migration object of the first database is migrated to the second database. When the selected object to be migrated is migrated to the second database, the management database background 702 may read the migration progress of the second database at that time, and display the migration progress through the interactive interface 701. When the library is completed in the migration process, the management database background 702 may read the migration result of the second database, and display the migration result through the interactive interface 701.
Based on the same inventive concept, the embodiment of the present invention further provides a data processing apparatus, which can execute the method in the embodiment of the inventive method. The structure of a data processing apparatus provided in an embodiment of the present invention can be seen in fig. 9. The data processing apparatus 900 includes an acquisition unit 901 and a processing unit 902. The obtaining unit 901 is configured to obtain information of a first database and information of a second database; acquiring object information of the first database, wherein the object information comprises the name of an object and metadata of the object; the processing unit 902 is configured to determine an object to be migrated and object information of the object to be migrated according to the object information of the first database; and migrating the object to be migrated to the second database according to the information of the second database.
More detailed descriptions about the obtaining unit 901 and the processing unit 902 can be directly obtained by referring to the related descriptions in the embodiment of the method shown in fig. 3, and are not described again.
Based on the same technical concept, an embodiment of the present invention further provides a computing device, as shown in fig. 10, a computing device 1000 includes at least one processor 1001 and a memory 1002 connected to the at least one processor, a specific connection medium between the processor 1001 and the memory 1002 is not limited in this embodiment of the present invention, and the processor 1001 and the memory 1002 in fig. 10 are connected through a bus as an example. The bus may be divided into an address bus, a data bus, a control bus, etc.
In the embodiment of the present invention, the memory 1002 stores instructions executable by the at least one processor 1001, and the at least one processor 1001 may execute the steps included in the foregoing data processing method by executing the instructions stored in the memory 1002.
The processor 1001 is a control center of the computing device, and may connect various parts of the computing device by using various interfaces and lines, and implement data processing by executing or executing instructions stored in the memory 1002 and calling data stored in the memory 1002. Optionally, the processor 1001 may include one or more processing units, and the processor 1001 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application program, and the like, and the modem processor mainly processes an issued instruction. It will be appreciated that the modem processor described above may not be integrated into processor 1001. In some embodiments, the processor 1001 and the memory 1002 may be implemented on the same chip, or in some embodiments, they may be implemented separately on separate chips.
The processor 1001 may be a general-purpose processor, such as a Central Processing Unit (CPU), a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the data processing method embodiments may be embodied directly in a hardware processor, or in a combination of hardware and software modules within the processor.
The memory 1002, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 1002 may include at least one type of storage medium, and may include, for example, a flash Memory, a hard disk, a multimedia card, a card-type Memory, a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), a charge Erasable Programmable Read Only Memory (EEPROM), a magnetic Memory, a magnetic disk, an optical disk, and so on. The memory 1002 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 1002 of embodiments of the present invention may also be circuitry or any other device capable of performing a storage function to store program instructions and/or data.
Based on the same technical concept, embodiments of the present invention also provide a computer-readable storage medium storing a computer program executable by a computing device, the program causing the computing device to execute the steps of the data processing method when the program runs on the computing device.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method of data processing, comprising:
acquiring information of a first database and information of a second database;
acquiring object information of the first database, wherein the object information comprises the name of an object and metadata of the object;
determining an object to be migrated and object information of the object to be migrated according to the object information of the first database;
and migrating the object to be migrated to the second database according to the information of the second database.
2. The method of claim 1, wherein the migrating the object to be migrated to the second database according to the information of the second database comprises:
determining a topological structure of the object to be migrated;
determining the migration sequence of the objects to be migrated according to the topological structure and the types of the objects to be migrated;
and migrating the objects to be migrated to the second database according to the migration sequence of the objects to be migrated.
3. The method of claim 2, wherein the information of the first database comprises a type of the first database, and the information of the second database comprises a type of the second database;
the migrating the object to be migrated to the second database according to the migration sequence of the object to be migrated includes:
and if the type of the first database is determined to be isomorphic with the type of a second database, migrating the object to be migrated to the second database according to a migration sequence of the object to be migrated according to a preset mapping rule.
4. The method of claim 2, wherein the information of the first database comprises a type of the first database, the information of the second database comprises a type of the second database, and the object to be migrated comprises a table;
the migrating the object to be migrated to the second database according to the migration sequence of the object to be migrated includes:
if the type of the first database is determined to be different from that of a second database, mapping the field of the table of the object to be migrated to the field type of the second database, and migrating the object to be migrated to the second database according to a preset mapping rule.
5. The method according to claim 2, wherein the determining a migration order of the objects to be migrated according to the topology and the types of the objects to be migrated comprises:
creating an empty ordered queue;
and storing the objects to be migrated to the empty ordered queue according to the migration sequence.
6. The method of claim 2, wherein the order of objects to be migrated comprises:
the priority of the table is higher than that of the view, the priority of the view is higher than that of the function, and the priority of the function is higher than that of the stored procedure.
7. The method of any of claims 1-6, wherein said migrating the object to be migrated to the second database comprises:
acquiring the object information of the mapped object to be migrated;
and migrating the object to be migrated to the second database by adopting a data definition DDL statement.
8. A data processing apparatus, comprising:
the acquisition unit is used for acquiring the information of the first database and the information of the second database; acquiring object information of the first database, wherein the object information comprises the name of an object and metadata of the object;
the processing unit is used for determining an object to be migrated and object information of the object to be migrated according to the object information of the first database; and migrating the object to be migrated to the second database according to the information of the second database.
9. A computing device comprising at least one processor and at least one memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the method of any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the storage medium stores a program which, when run on a computer, causes the computer to carry out the method of any one of claims 1 to 7.
CN202210892406.XA 2022-07-27 2022-07-27 Data processing method and device Pending CN115269550A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210892406.XA CN115269550A (en) 2022-07-27 2022-07-27 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210892406.XA CN115269550A (en) 2022-07-27 2022-07-27 Data processing method and device

Publications (1)

Publication Number Publication Date
CN115269550A true CN115269550A (en) 2022-11-01

Family

ID=83770628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210892406.XA Pending CN115269550A (en) 2022-07-27 2022-07-27 Data processing method and device

Country Status (1)

Country Link
CN (1) CN115269550A (en)

Similar Documents

Publication Publication Date Title
US6654761B2 (en) Controlling which part of data defining a node-link structure is in memory
CN106598591B (en) Webpage dynamic menu generation method and device
US8332389B2 (en) Join order for a database query
CN106598612B (en) Operation method and system for data table in database
CN109189469B (en) Reflection-based android application micro-servitization method and system
US9195456B2 (en) Managing a catalog of scripts
CN112988782B (en) Hive-supported interactive query method and device and storage medium
CN113326314B (en) Data visualization method, device, electronic equipment and readable storage medium
CN109656950B (en) Recursive query method, device, server and storage medium
JP2020119348A (en) Analysis program, analysis method, and analysis device
CN113434533A (en) Data tracing tool construction method, data processing method, device and equipment
US10417234B2 (en) Data flow modeling and execution
US11055275B2 (en) Database revalidation using parallel distance-based groups
CN114185874A (en) Big data based modeling method and device, development framework and equipment
CN112231531A (en) Data display method, equipment and medium based on openstb
CN115269550A (en) Data processing method and device
US10310823B2 (en) Program development support system and program development support software
US20140222790A1 (en) Combined Code Searching and Automatic Code Navigation
CN114547083A (en) Data processing method and device and electronic equipment
CN115630086B (en) Method for converting Access application into Web application program
CN116955415B (en) Design hierarchy based data search system
JPH03260742A (en) Program trace display method
US11501062B1 (en) Systems and methods for displaying data including hierarchical headers
US20240193135A1 (en) Systems, methods, and media for accessing derivative properties from a post relational database utilizing a logical schema instruction that includes a base object identifier
CN115904968A (en) Interface testing method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination