A data migration processing method, device and equipment and storage medium

CN117312277BActive Publication Date: 2026-09-08CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311519518.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-15
Publication Date
2026-09-08
Estimated Expiration
2043-11-15

AI Technical Summary

Technical Problem

[0005]本申请提供一种数据迁移的处理方法、装置、设备及存储介质,用以解决现有技术中在进行DTS配置时,在目标端数据库中建表,目标端表名默认会添加随机码,需要人为手动修改目标端的表名的工作量增加,从而导致数据迁移或者同步的效率相对较低的问题

Benefits of technology

[0038] This application provides a data migration processing method, apparatus, device, and storage medium. A plug-in obtains the table name of the source table to be modified, the table name of the target table to be modified, and the interface information to be called. Based on the interface information, it obtains initial interface parameters, which include: relevant parameters of the source table to be modified, a pre-configured mapping relationship, relevant parameters of the target table to be modified, and connection information between the source and target tables. The pre-configured mapping relationship is a mapping between the source table name and the initially configured target table name, and the source table name and the initially configured target table name are the same. Then, based on the relevant parameters of the source and target tables to be modified, the table name of the source table to be modified, and the table name of the target table to be modified, the initially configured target table name in the pre-configured mapping relationship is modified to obtain a new mapping relationship. Based on the new mapping relationship, the initial interface parameters are updated to obtain new interface parameters, thereby enabling migration processing of the source table to be modified based on the new interface parameters. In this new mapping relationship, the target table name in the modified initial configuration is the same as the target table name to be modified. Compared to existing technologies where manual modification of the target table name increases workload and leads to relatively low efficiency in data migration or synchronization, this application uses a plugin to batch modify the target table name in the initial configuration of the pre-configured mapping relationship to obtain a new mapping relationship and new interface parameters. This avoids the tediousness and errors caused by manual modification, thus improving the efficiency of data migration or synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117312277B_ABST
    Figure CN117312277B_ABST
Patent Text Reader

Abstract

The application provides a data migration processing method and device, equipment and a storage medium. The application solves the problem of relatively low efficiency of data migration or synchronization in the prior art. The application obtains the table name of the source table to be modified, the table name of the target table to be modified, and the interface information to be called through a plug-in, and obtains initial interface parameters. The preconfigured mapping relationship is the mapping relationship between the table name of the source table and the table name of the target table in the initial configuration, and the table name of the source table and the table name of the target table in the initial configuration are the same. The table name of the target table in the initial configuration in the preconfigured mapping relationship is modified to obtain a new mapping relationship, and based on the new mapping relationship, the initial interface parameters are updated to obtain new interface parameters, so as to realize migration processing on the source table to be modified based on the new interface parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to data migration technology, and more particularly to a data migration processing method, apparatus, device, and storage medium. Background Technology

[0002] Data Transmission Service (DTS) is a real-time data streaming service provided by Alibaba Cloud. This service supports data interaction between data sources such as relational databases (RDBMS), non-relational databases (NoSQL), and online multidimensional analysis (OLAP). It is generally used for database migration or synchronization, and therefore, this service is widely used in production projects.

[0003] Currently, configuring DTS requires configuring connection information for both the source and target databases, and selecting the source table to be migrated or synchronized. When migrating or synchronizing this source table to the target database, a target table must first be created in the target database. However, when creating the target table, a random code is added to its name by default, resulting in a discrepancy between the source and target table names. Therefore, after creating the target table, its name must be modified before migrating or synchronizing data.

[0004] However, the modification process requires manual modification of the table names on each target end. Therefore, when there are many source tables to migrate or synchronize, this may lead to further modification errors, resulting in technical problems such as unsuccessful data migration or synchronization. Additionally, it increases the workload of manually modifying the table names on the target end, thus making the data migration or synchronization relatively inefficient. Summary of the Invention

[0005] This application provides a data migration processing method, apparatus, device, and storage medium to solve the problem in the prior art where, during DTS configuration, tables are created in the target database and random codes are added to the target table names by default, increasing the workload of manually modifying the target table names and thus leading to relatively low efficiency in data migration or synchronization.

[0006] On the one hand, this application provides a data migration processing method, including:

[0007] Get the table name of the source table to be modified, the table name of the target table to be modified, and the API information to be called;

[0008] Based on the invoked interface information, initial interface parameters are obtained; wherein, the initial interface parameters include: relevant parameters of the source table to be modified and a pre-configured mapping relationship, relevant parameters of the target table to be modified, and connection information between the source table to be modified and the target table to be modified; the pre-configured mapping relationship is the mapping relationship between the table name of the source table and the table name of the initially configured target table, and the table name of the source table and the table name of the initially configured target table are the same;

[0009] Based on the relevant parameters corresponding to the source table to be modified, the relevant parameters corresponding to the target table to be modified, the table name of the source table to be modified, and the table name of the target table to be modified, the table name of the target table in the initial configuration of the pre-configured mapping relationship is modified to obtain a new mapping relationship. Based on the new mapping relationship, the initial interface parameters are updated to obtain new interface parameters, so as to realize the migration processing of the source table to be modified based on the new interface parameters.

[0010] In the new mapping relationship, the table name of the target end of the modified initial configuration is the same as the table name of the target end table to be modified.

[0011] The steps of obtaining the source table name to be modified and the target table name to be modified include:

[0012] Use SQL query statements to query the source database to be migrated and the target database to be migrated to, in order to obtain the table names of the source tables to be migrated and the table names of the target tables to be migrated to.

[0013] Use the names of the source table to be migrated and the target table to be migrated to, which have different names, as the names of the source table to be modified and the target table to be modified, respectively.

[0014] The interface information being called includes: header information, the URL address being called, the method being called, and the request body parameters being called.

[0015] Secondly, this application provides a data migration processing method, including:

[0016] Obtain a data migration request, the data migration request including: the source database to be migrated, the source tables to be migrated in the source database, and the target database to be migrated to;

[0017] According to the data migration request, the target database to be migrated to is triggered to create a target table that matches the source table, and a connection is established between the source table to be migrated and the target table to be migrated to, and the connection information of the connection is obtained; wherein, the table name of the source table to be migrated is different from the first table name of the target database to be migrated to.

[0018] Invoke new interface parameters corresponding to the source table to be migrated, the target table to be migrated to, and the connection information, so as to realize the migration process of the source table to be migrated based on the new mapping relationship in the new interface parameters;

[0019] The new mapping relationship is the mapping relationship between the table name of the source table to be migrated and the first table name of the target table to be migrated to.

[0020] Also includes:

[0021] Based on the data migration request, a pre-configured mapping relationship is generated; wherein, the pre-configured mapping relationship is a mapping relationship between the table name of the source table to be migrated and the second table name of the target table to be migrated to, and the table name of the source table to be migrated and the second table name of the target table to be migrated to are the same.

[0022] Also includes:

[0023] Obtain the call request to send initial interface parameters carrying the pre-configured mapping relationship.

[0024] Thirdly, this application provides a data migration processing apparatus, comprising:

[0025] The data acquisition module is used to obtain the table name of the source table to be modified, the table name of the target table to be modified, and the interface information to be called.

[0026] The acquisition module is further configured to obtain initial interface parameters based on the invoked interface information; wherein the initial interface parameters include: relevant parameters of the source table to be modified and a pre-configured mapping relationship, relevant parameters of the target table to be modified, and connection information between the source table to be modified and the target table to be modified; the pre-configured mapping relationship is a mapping relationship between the table name of the source table and the table name of the initially configured target table, and the table name of the source table and the table name of the initially configured target table are the same;

[0027] The processing module is used to modify the target table name in the initial configuration of the pre-configured mapping relationship according to the relevant parameters corresponding to the source table to be modified, the relevant parameters corresponding to the target table to be modified, the table name of the source table to be modified, and the table name of the target table to be modified, so as to obtain a new mapping relationship, and update the initial interface parameters based on the new mapping relationship to obtain new interface parameters, so as to realize the migration processing of the source table to be modified based on the new interface parameters;

[0028] In the new mapping relationship, the table name of the target end of the modified initial configuration is the same as the table name of the target end table to be modified.

[0029] Fourthly, this application provides a data migration processing apparatus, comprising:

[0030] The acquisition module is used to acquire data migration requests, which include: a source database to be migrated, a source table to be migrated in the source database, and a target database to be migrated to.

[0031] The processing module is configured to, based on the data migration request, trigger the creation of a target table in the target database to which the data is to be migrated, which matches the source table, establish a connection between the source table to be migrated and the target table to which the data is to be migrated, and obtain the connection information of the connection; wherein, the table name of the source table to be migrated is different from the first table name of the target database to which the data is to be migrated.

[0032] The processing module is also used to call new interface parameters corresponding to the source table to be migrated, the target table to be migrated to, and the connection information, so as to realize the migration processing of the source table to be migrated based on the new mapping relationship in the new interface parameters.

[0033] The new mapping relationship is the mapping relationship between the table name of the source table to be migrated and the first table name of the target table to be migrated to.

[0034] Fifthly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0035] The memory stores computer-executed instructions;

[0036] The processor executes computer execution instructions stored in the memory to implement the method described above.

[0037] In a sixth aspect, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described above.

[0038] This application provides a data migration processing method, apparatus, device, and storage medium. A plug-in obtains the table name of the source table to be modified, the table name of the target table to be modified, and the interface information to be called. Based on the interface information, it obtains initial interface parameters, which include: relevant parameters of the source table to be modified, a pre-configured mapping relationship, relevant parameters of the target table to be modified, and connection information between the source and target tables. The pre-configured mapping relationship is a mapping between the source table name and the initially configured target table name, and the source table name and the initially configured target table name are the same. Then, based on the relevant parameters of the source and target tables to be modified, the table name of the source table to be modified, and the table name of the target table to be modified, the initially configured target table name in the pre-configured mapping relationship is modified to obtain a new mapping relationship. Based on the new mapping relationship, the initial interface parameters are updated to obtain new interface parameters, thereby enabling migration processing of the source table to be modified based on the new interface parameters. In this new mapping relationship, the target table name in the modified initial configuration is the same as the target table name to be modified. Compared to existing technologies where manual modification of the target table name increases workload and leads to relatively low efficiency in data migration or synchronization, this application uses a plugin to batch modify the target table name in the initial configuration of the pre-configured mapping relationship to obtain a new mapping relationship and new interface parameters. This avoids the tediousness and errors caused by manual modification, thus improving the efficiency of data migration or synchronization. Attached Figure Description

[0039] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0040] Figure 1 A flowchart illustrating a data migration processing method according to an embodiment of this application;

[0041] Figure 2 A flowchart illustrating a data migration processing method according to a second embodiment of this application;

[0042] Figure 3 A flowchart illustrating a data migration processing method according to Embodiment 3 of this application;

[0043] Figure 4 A schematic flowchart of a data migration processing method according to an embodiment of this application, in embodiment four;

[0044] Figure 5A schematic diagram of the structure of a data migration processing device according to an embodiment of this application;

[0045] Figure 6 This is a schematic diagram of the structure of an electronic device embodiment provided in this application.

[0046] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0048] In existing technologies, when configuring DTS and migrating or synchronizing source tables to the target database, a target table needs to be created in the target database first. When creating the target table, a random code is added to its name by default. Therefore, after creating the target table, the table name needs to be changed before migrating or synchronizing the data. This modification requires manual modification of each target table name. Therefore, when there are many source tables to migrate or synchronize, this may lead to further modification errors, resulting in data migration or synchronization failures. Furthermore, it increases the workload of manually modifying target table names, leading to relatively low efficiency in data migration or synchronization.

[0049] In order to solve the above-mentioned technical problems, the inventive concept of this application is: how to effectively improve the efficiency of data migration or synchronization.

[0050] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0051] Figure 1 A flowchart illustrating a data migration processing method according to an embodiment of this application is shown below. Figure 1 As shown, the method includes:

[0052] Step S101: Obtain the table name of the source table to be modified, the table name of the target table to be modified, and the interface information to be called.

[0053] In this embodiment, for example, the user can input the name of the source table to be modified, the name of the target table to be modified, and the interface information to be called on the browser's display interface. Thus, the data migration processing device (e.g., a plug-in module) can detect and obtain the name of the source table to be modified, the name of the target table to be modified, and the interface information to be called.

[0054] For example, the interface information called may include, but is not limited to: header information, the URL address of the call, the method called, and the request body parameters of the call.

[0055] Specifically, the header information is the header information sent in the request; the URL address to be called is the address of the resource to be called; the method to be called is the HTTP request method; the request body parameters include all information of the source table and the target table, such as table name, username, department name, database name, connection information, address, and the mapping relationship between the source table name and the target table name.

[0056] Step S102: Obtain the initial interface parameters based on the interface information being called.

[0057] In this embodiment, the initial interface parameters include: relevant parameters of the source table to be modified and the pre-configured mapping relationship, relevant parameters of the target table to be modified, and connection information between the source table to be modified and the target table to be modified; the pre-configured mapping relationship is the mapping relationship between the table name of the source table and the table name of the target table in the initial configuration, and the table name of the source table and the table name of the target table in the initial configuration are the same.

[0058] Additionally, the parameters of the source table to be modified may include one or more combinations of the following: If the number of source tables with inconsistent names is small, then the names of the source tables with inconsistent names are collected as the names of the source tables to be modified; if the number of source tables with inconsistent names is large, to avoid errors in identifying whether the table names are consistent, all the obtained source table names to be migrated in sequential order are collected as the names of the source tables to be modified. The parameters of the target table to be modified may include one or more combinations of the following: If the number of target tables with inconsistent names is small, then the names of the target tables with inconsistent names are collected as the names of the target tables to be modified; if the number of target tables with inconsistent names is large, to avoid errors in identifying whether the table names are consistent, all the obtained target tables to be migrated in sequential order are collected as the names of the target tables to be modified.

[0059] Step S103: Based on the relevant parameters of the source table to be modified, the relevant parameters of the target table to be modified, the table name of the source table to be modified, and the table name of the target table to be modified, modify the table name of the target table in the initial configuration of the pre-configured mapping relationship to obtain a new mapping relationship. Based on the new mapping relationship, update the initial interface parameters to obtain new interface parameters, so as to realize the migration processing of the source table to be modified based on the new interface parameters.

[0060] In this embodiment, for example, the table name in the relevant parameters corresponding to the source table to be modified is inconsistent with the table name in the relevant parameters corresponding to the target table to be modified. That is, the table name in the relevant parameters corresponding to the target table to be modified is also inconsistent with the table name of the target table in the initial configuration of the pre-configured mapping relationship. Therefore, based on the relevant parameters corresponding to the source table to be modified, the relevant parameters corresponding to the target table to be modified, the table name of the source table to be modified, and the table name of the target table to be modified, the table name of the target table in the initial configuration of the pre-configured mapping relationship is modified so that in the new mapping relationship, the table name of the target table in the modified initial configuration is consistent with the table name in the relevant parameters corresponding to the target table to be modified, thereby forming a new mapping relationship with the table name of the source table to be modified.

[0061] In this embodiment, the plugin obtains the table name of the source table to be modified, the table name of the target table to be modified, and the interface information to be called. Based on the interface information, it obtains initial interface parameters, which include: relevant parameters of the source table to be modified, a pre-configured mapping relationship, relevant parameters of the target table to be modified, and connection information between the source and target tables. The pre-configured mapping relationship is a mapping between the source table name and the initially configured target table name, and the source table name and the initially configured target table name are the same. Then, based on the relevant parameters of the source and target tables to be modified, the initial configured target table name in the pre-configured mapping relationship is modified to obtain a new mapping relationship. Based on the new mapping relationship, the initial interface parameters are updated to obtain new interface parameters, thereby enabling migration processing of the source table to be modified based on the new interface parameters. In this new mapping relationship, the target table name in the modified initial configuration is the same as the target table name to be modified. Compared to existing technologies where manual modification of the target table name increases workload and leads to relatively low efficiency in data migration or synchronization, this application uses a plugin to batch modify the target table name in the initial configuration of the pre-configured mapping relationship to obtain a new mapping relationship and new interface parameters. This avoids the tediousness and errors caused by manual modification, thus improving the efficiency of data migration or synchronization.

[0062] Figure 2 This is a flowchart illustrating a second embodiment of a data migration processing method provided in this application. Based on the above embodiments, as follows... Figure 2 As shown, the method includes:

[0063] Step S201: Use SQL query statements to query the source database to be migrated and the target database to be migrated to, so as to obtain the table names of the source tables to be migrated and the table names of the target tables to be migrated to in order.

[0064] In this embodiment, the SQL query statement `show tables` is used to query the source database to be migrated and the target database to be migrated to. The query results are sorted using the `ORDER BY` keyword in the `show tables` statement to obtain the table names of the source table to be migrated and the table names of the target table to be migrated to in order.

[0065] Step S202: Use the table name of the source table to be migrated and the table name of the target table to be migrated to, which have inconsistent table names, as the table name of the source table to be modified and the table name of the target table to be modified, respectively.

[0066] In this embodiment, optionally, after the plugin obtains the table names of the source table to be migrated and the table names of the target table to be migrated in order, it identifies whether the table names are consistent. If the number of inconsistent table names of the source table to be migrated and the target table to be migrated is small, then the inconsistent table names of the source table to be migrated and the target table to be migrated are collected as the table names of the source table to be modified and the table names of the target table to be modified, respectively.

[0067] In this embodiment, more optionally, after the plugin obtains the table names of the source table to be migrated and the table names of the target table to be migrated in order, it identifies whether the table names are consistent. If there are a large number of inconsistent table names of the source table to be migrated and the target table to be migrated, in order to avoid errors in the process of identifying whether the table names are consistent, all the obtained table names of the source table to be migrated and the target table to be migrated in order are collected as the table names of the source table to be modified and the table names of the target table to be modified, respectively.

[0068] Furthermore, the plugin obtains the following information about the invoked interface: header information, the URL address of the call, the method called, and the request body parameters.

[0069] The header information is the header information sent in the request; the URL address to be called is the address of the resource to be called; the method to be called is the HTTP request method; the request body parameters include all information of the source table and the target table, such as table name, username, department name, database name, connection information, address, and the mapping relationship between the source table name and the target table name.

[0070] Step S203: Obtain the initial interface parameters based on the interface information being called.

[0071] Step S204: Based on the relevant parameters of the source table to be modified, the relevant parameters of the target table to be modified, the table name of the source table to be modified, and the table name of the target table to be modified, modify the table name of the target table in the initial configuration of the pre-configured mapping relationship to obtain a new mapping relationship. Based on the new mapping relationship, update the initial interface parameters to obtain new interface parameters, so as to realize the migration processing of the source table to be modified based on the new interface parameters.

[0072] In the new mapping relationship, the table name of the target end of the modified initial configuration is the same as the table name of the target end table to be modified.

[0073] In this embodiment, the query results are sorted based on the SQL query statement and the ORDER BY keyword to obtain the table names of the source tables to be migrated and the table names of the target tables to be migrated to in order. This ensures that the table names of the source tables to be migrated and the table names of the target tables to be migrated are in one-to-one correspondence. This avoids the possibility of errors that may occur when manually modifying the table names of each target table when there are many source tables to migrate or synchronize. While ensuring accuracy, batch operations are realized, and operational efficiency is improved.

[0074] Figure 3 A flowchart illustrating a data migration processing method according to Embodiment 3 of this application is shown below. Figure 3 As shown, the method includes:

[0075] Step S301: Obtain a data migration request. The data migration request includes: the source database to be migrated, the source tables to be migrated in the source database, and the target database to which the data is to be migrated.

[0076] In this embodiment, the data migration processing device (e.g., a DTS product) can obtain a data migration request, wherein the data migration request includes: a source database to be migrated, a source table to be migrated in the source database, and a target database to be migrated to, wherein the database structure of the source database to be migrated and the database structure of the target database to be migrated to are the same.

[0077] Step S302: According to the data migration request, trigger the creation of a target table in the target database to be migrated, matching the source table, and establish a connection between the source table to be migrated and the target table to be migrated, and obtain the connection information of the connection; wherein, the table name of the source table to be migrated and the first table name of the target table to be migrated are different.

[0078] In this embodiment, the data migration processing device (e.g., a DTS product) triggers the creation of a target table in the target database to be migrated, matching the source table, based on the acquired data migration request. The target table has the same table structure as the source table to be migrated. A connection is established between the source table and the target table, and connection information is obtained. Because the target database adds a random number to the table name by default when creating the target table, the table name of the source table and the first table name of the target table are different.

[0079] Step S303: Call the new interface parameters corresponding to the source table to be migrated, the target table to be migrated, and the connection information, so as to realize the migration processing of the source table to be migrated based on the new mapping relationship in the new interface parameters.

[0080] In this embodiment, the data migration processing device (e.g., a DTS product) calls new interface parameters corresponding to the source table to be migrated, the target table to be migrated to, and the connection information. These new interface parameters represent a new mapping relationship integrated with the source table to be migrated, the target table to be migrated to, and the connection information. Based on the new mapping relationship in the new interface parameters, the data migration processing of the source table to be migrated is thus achieved.

[0081] The new mapping relationship is the mapping relationship between the table name of the source table to be migrated and the first table name of the target table to be migrated to.

[0082] In this embodiment, based on the data migration request, the data migration processing device (e.g., a DTS product) calls the new mapping relationship in the new interface parameters, thereby achieving accurate and error-free migration of the data in the source table to be migrated. This ensures the accuracy of data migration and thus improves the efficiency of data migration.

[0083] Figure 4 This is a flowchart illustrating a data migration processing method according to Embodiment 4 of this application. Figure 3 Based on the illustrated embodiments, as Figure 4 As shown, the method includes:

[0084] Step S401: Obtain a data migration request. The data migration request includes: the source database to be migrated, the source tables to be migrated in the source database, and the target database to which the data is to be migrated.

[0085] Step S402: Based on the data migration request, trigger the creation of a target table in the target database to be migrated, matching the source table, and establish a connection between the source table to be migrated and the target table to be migrated, as well as obtain the connection information of the connection; wherein, the table name of the source table to be migrated and the first table name of the target table to be migrated are different.

[0086] Step S403: Generate a pre-configured mapping relationship according to the data migration request; wherein, the pre-configured mapping relationship is the mapping relationship between the table name of the source table to be migrated and the second table name of the target table to be migrated to, and the table name of the source table to be migrated and the second table name of the target table to be migrated to are the same.

[0087] In this embodiment, the data migration processing device (e.g., a DTS product) also generates a pre-configured mapping relationship based on the data migration request; wherein, the pre-configured mapping relationship is a mapping relationship between the table name of the source table to be migrated and the second table name of the target table to be migrated to. Simultaneously, the data migration processing device (e.g., a DTS product) assumes that the table name of the source table and the table name of the target table are the same, that is, the table name of the source table to be migrated and the second table name of the target table to be migrated to are the same.

[0088] Step S404: Obtain the call request to send initial interface parameters carrying the pre-configured mapping relationship.

[0089] In this embodiment, the data migration processing device (e.g., a DTS product) obtains the call request, captures the interface parameters, and sends the initial interface parameters carrying the pre-configured mapping relationship.

[0090] Step S405: Call the new interface parameters corresponding to the source table to be migrated, the target table to be migrated to, and the connection information, so as to realize the migration processing of the source table to be migrated based on the new mapping relationship in the new interface parameters.

[0091] The new mapping relationship is the mapping relationship between the table name of the source table to be migrated and the first table name of the target table to be migrated to.

[0092] In this embodiment, based on the data migration request, the data migration processing device (e.g., a DTS product) generates pre-configured mapping relationships in batches and sends initial interface parameters carrying the pre-configured mapping relationships based on the call request. For the pre-configured mapping relationships, new mapping relationships are generated, and these new mapping relationships are integrated with the initial interface parameters to generate new interface parameters. Based on the new mapping relationships in the new interface parameters, accurate and error-free migration of data from the source table to be migrated can be achieved. This ensures the accuracy of data migration and thus improves the efficiency of data migration.

[0093] Figure 5 This is a schematic diagram of the structure of a data migration processing apparatus according to an embodiment of this application; as shown in the diagram. Figure 5 As shown, the device can be a plug-in module and mainly includes: a data acquisition module 51 and a processing module 52.

[0094] Specifically, the acquisition module 51 is used to obtain the table name of the source table to be modified, the table name of the target table to be modified, and the interface information to be called; the acquisition module 51 is also used to obtain the initial interface parameters based on the interface information to be called. The processing module 52 is used to modify the target table name in the initial configuration of the pre-configured mapping relationship according to the relevant parameters corresponding to the source table to be modified, the relevant parameters corresponding to the target table to be modified, the table name of the source table to be modified, and the table name of the target table to be modified, so as to obtain a new mapping relationship, and update the initial interface parameters based on the new mapping relationship to obtain new interface parameters, so as to realize the migration processing of the source table to be modified based on the new interface parameters.

[0095] The initial interface parameters include: relevant parameters of the source table to be modified and the pre-configured mapping relationship, relevant parameters of the target table to be modified, and connection information between the source table to be modified and the target table to be modified; the pre-configured mapping relationship is the mapping relationship between the table name of the source table and the table name of the target table in the initial configuration, and the table name of the source table and the table name of the target table in the initial configuration are the same.

[0096] In the new mapping relationship, the table name of the target end in the modified initial configuration is the same as the table name of the target end table to be modified.

[0097] This application also provides a data migration processing device, which can be a DTS product, and mainly includes: a data acquisition module 51 and a processing module 52.

[0098] Specifically, the acquisition module 51 is used to acquire data migration requests. The processing module 52 is used to trigger the creation of a target table matching the source table in the target database to be migrated, and to establish a connection between the source table to be migrated and the target table to be migrated, and to acquire the connection information of the connection; the processing module 52 is also used to use new interface parameters corresponding to the source table to be migrated, the target table to be migrated, and the connection information, to realize the migration processing of the source table to be migrated based on the new mapping relationship in the new interface parameters.

[0099] The data migration request includes: the source database to be migrated, the source tables in the source database to be migrated, and the target database to which it is to be migrated.

[0100] The table name of the source table to be migrated is different from the first table name of the target table to be migrated to.

[0101] The new mapping relationship is the mapping relationship between the table name of the source table to be migrated and the first table name of the target table to be migrated to.

[0102] The data migration processing apparatus of this embodiment can perform the above-described... Figures 1 to 4The implementation principle and effect of any of the method embodiments are similar, and will not be described again here.

[0103] Figure 6 This is a schematic diagram of the structure of an electronic device embodiment provided in this application; see also Figure 6 This embodiment provides an electronic device including a processor 61 and a memory 62 communicatively connected to the processor 61. The processor 61 and the memory 62 are connected via a bus 63.

[0104] The specific implementation process of processor 61 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0105] In the above Figure 6 In the illustrated embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0106] The memory may include random access memory (RAM) and non-volatile memory (NVM), such as at least one disk storage device.

[0107] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0108] This application also provides a computer-readable storage medium storing computer-executable instructions thereon, which, when executed by a processor, implement the data migration processing method of the above embodiments.

[0109] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The computer-readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0110] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0111] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0112] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0113] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0114] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0115] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

[0116] The technical solutions of this application have been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it is readily understood by those skilled in the art that the scope of protection of this application is obviously not limited to these specific embodiments. The above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A data migration processing method, characterized in that, The method, executed by the plugin, includes: Using SQL queries, the source database to be migrated and the target database to be migrated are queried to obtain the table names of the source tables to be migrated and the table names of the target tables to be migrated, arranged in order. The table names of the source tables to be migrated and the table names of the target tables to be migrated, which are inconsistent, are used as the table names of the source tables to be modified and the table names of the target tables to be modified, respectively, along with the interface information to be called. The table name of the target table to be modified is the table name with a random code added when the target table was created, which is inconsistent with the table name of the source table to be modified. Based on the invoked interface information, initial interface parameters are obtained; wherein, the initial interface parameters include: relevant parameters of the source table to be modified and a pre-configured mapping relationship, relevant parameters of the target table to be modified, and connection information between the source table to be modified and the target table to be modified; the pre-configured mapping relationship is the mapping relationship between the table name of the source table and the table name of the initially configured target table, and the table name of the source table and the table name of the initially configured target table are the same; Based on the relevant parameters corresponding to the source table to be modified, the relevant parameters corresponding to the target table to be modified, the table name of the source table to be modified, and the table name of the target table to be modified, the table name of the target table in the initial configuration of the pre-configured mapping relationship is modified to obtain a new mapping relationship. Based on the new mapping relationship, the initial interface parameters are updated to obtain new interface parameters, so as to realize the migration processing of the source table to be modified based on the new interface parameters. In the new mapping relationship, the table name of the target end of the modified initial configuration is the same as the table name of the target end table to be modified.

2. The method according to claim 1, characterized in that, The interface information being called includes: header information, the URL address being called, the method being called, and the request body parameters being called.

3. A data migration processing method, characterized in that, Applied to a data migration processing apparatus, the method includes: Obtain a data migration request, the data migration request including: the source database to be migrated, the source tables to be migrated in the source database, and the target database to be migrated to; Based on the data migration request, a pre-configured mapping relationship is generated; wherein, the pre-configured mapping relationship is a mapping relationship between the table name of the source table to be migrated and the second table name of the target table to be migrated to, and the table name of the source table to be migrated and the second table name of the target table to be migrated to are the same. According to the data migration request, the target database to be migrated to is triggered to create a target table that matches the source table, and a connection is established between the source table to be migrated and the target table to be migrated to, and the connection information of the connection is obtained; wherein, the table name of the source table to be migrated is different from the first table name of the target database to be migrated to. Using SQL query statements, query the source database to be migrated and the target database to be migrated to obtain the table names of the source tables to be migrated and the table names of the target tables to be migrated to in order; the table names of the source tables to be migrated and the table names of the target tables to be migrated to, which are inconsistent, are respectively used as the table names of the source tables to be modified and the table names of the target tables to be modified. Invoke new interface parameters corresponding to the source table to be migrated, the target table to be migrated to, and the connection information, so as to realize the migration process of the source table to be migrated based on the new mapping relationship in the new interface parameters; The new mapping relationship is the mapping relationship between the table name of the source table to be migrated and the first table name of the target table to be migrated to. The first table name of the target table to be modified is the table name with a random code added when the target database creates the target table, which is inconsistent with the table name of the source table to be modified.

4. The method according to claim 3, characterized in that, Also includes: Obtain the call request to send initial interface parameters carrying the pre-configured mapping relationship.

5. A data migration processing apparatus, characterized in that, Executed by a plug-in, the device includes: The data acquisition module uses SQL queries to query the source database to be migrated and the target database to be migrated to, in order to obtain the table names of the source tables to be migrated and the table names of the target tables to be migrated to. Table names of source tables and target tables with inconsistent names are used as the names of the source tables to be modified and the names of the target tables to be modified, respectively, along with the interface information to be called. The target table name to be modified is the name of the target table created with a random code, and is inconsistent with the name of the source table to be modified. The acquisition module is further configured to obtain initial interface parameters based on the invoked interface information; wherein the initial interface parameters include: relevant parameters of the source table to be modified and a pre-configured mapping relationship, relevant parameters of the target table to be modified, and connection information between the source table to be modified and the target table to be modified; the pre-configured mapping relationship is a mapping relationship between the table name of the source table and the table name of the initially configured target table, and the table name of the source table and the table name of the initially configured target table are the same; The processing module is used to modify the target table name in the initial configuration of the pre-configured mapping relationship according to the relevant parameters corresponding to the source table to be modified, the relevant parameters corresponding to the target table to be modified, the table name of the source table to be modified, and the table name of the target table to be modified, so as to obtain a new mapping relationship, and update the initial interface parameters based on the new mapping relationship to obtain new interface parameters, so as to realize the migration processing of the source table to be modified based on the new interface parameters; In the new mapping relationship, the table name of the target end of the modified initial configuration is the same as the table name of the target end table to be modified.

6. A data migration processing apparatus, characterized in that, include: The acquisition module is used to obtain data migration requests, which include: a source database to be migrated, source tables to be migrated in the source database, and a target database to be migrated to. The module enables the plugin to use SQL queries to query the source database and the target database to obtain the table names of the source tables and the target tables in a sequential order. The table names of the source tables and the target tables with inconsistent names are used as the names of the source tables and the target tables to be modified, respectively. A mapping module is used to generate a pre-configured mapping relationship according to the data migration request; wherein the pre-configured mapping relationship is a mapping relationship between the table name of the source table to be migrated and the second table name of the target table to be migrated to, and the table name of the source table to be migrated and the second table name of the target table to be migrated to are the same. The processing module is configured to, based on the data migration request, trigger the creation of a target table in the target database to which the data is to be migrated, matching the source table, establish a connection between the source table to be migrated and the target table, and obtain connection information for the connection; wherein the table name of the source table to be migrated is different from the first table name of the target table; the processing module is further configured to call new interface parameters corresponding to the source table to be migrated, the target table to be migrated, and the connection information, so as to realize the migration processing of the source table to be migrated based on the new mapping relationship in the new interface parameters; The new mapping relationship is the mapping relationship between the table name of the source table to be migrated and the first table name of the target table to be migrated to. The first table name of the target table to be modified is the table name with a random code added when the target database creates the target table, which is inconsistent with the table name of the source table to be modified.

7. An electronic device, comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as claimed in claim 1 or 2, or the method as claimed in claim 3 or 4.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as claimed in claim 1 or 2, or the method as claimed in claim 3 or 4.

Citation Information

Patent Citations

  • Data migration method and device, server and storage medium

    CN114185873A

  • Data migration method, system and equipment and storage medium

    CN116701349A