Data online migration method, device, electronic device and storage medium

By determining the data to be migrated when controlling the first business device to provide transaction services and migrating it to the second database, and controlling the second business device to provide transaction services to the outside, the problems of low data migration efficiency and downtime migration in the prior art affecting the business, and efficient online data migration is achieved.

CN114218187BActive Publication Date: 2025-03-21CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111356539.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-16
Publication Date
2025-03-21
Estimated Expiration
2041-11-16

AI Technical Summary

Technical Problem

In the prior art, data migration is inefficient and downtime migration affects the normal progress of the business.

Method used

When controlling the first business device to provide transaction services, the data to be migrated is determined and initialized from the first database to the second database, and at the same time, the second business device to provide transaction services to the outside, the online migration of data between databases is realized.

Benefits of technology

It effectively improves the efficiency of data migration between databases, reduces the impact of data migration on transaction business, and realizes online non-stop migration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114218187B_ABST
    Figure CN114218187B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, device, electronic device and storage medium for online data migration, and belongs to the field of data processing technology. The method includes: when controlling a first business device to provide transaction services, determining the data to be migrated, the first business device corresponds to a first database; initializing the migration of the data to be migrated from the first database to a second database, the second database corresponds to a second business device; after initializing the migration of the data to be migrated from the first database to the second database, controlling the second business device to provide external transaction services. It is possible to achieve online migration of data between databases, effectively improving the efficiency of data migration between databases, and because the corresponding business device is still controlled to provide external transaction services during the migration process, it is possible to effectively reduce the impact of data migration on transaction services, and achieve online migration without downtime.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of big data processing, and in particular to a method, device, electronic device and storage medium for online data migration. Background Art

[0002] With the rapid development of the Internet, the number of users of Internet mobile applications has reached an unprecedented scale, with the number of users of large applications reaching billions and the amount of data reaching hundreds of billions. During the process of system operation and maintenance upgrades, the technical team will almost always encounter the problem of upgrading and relocation. Data migration is a key part of data system integration to ensure smooth system upgrades and updates.

[0003] In the related art, data migration is performed during downtime. In business scenarios with huge data volumes and high-frequency access, data migration efficiency is low, and downtime migration affects the normal operation of the business. Summary of the invention

[0004] The present disclosure provides a method, device, electronic device and storage medium for online data migration, so as to at least solve the technical problems in the related art that data migration efficiency is low and downtime migration affects the normal operation of business.

[0005] The technical solution of the present disclosure is as follows:

[0006] According to a first aspect of an embodiment of the present disclosure, a method for online data migration is provided, comprising: determining data to be migrated when controlling a first business device to provide transaction services, the first business device corresponding to a first database; initializing the migration of the data to be migrated from the first database to a second database, the second database corresponding to a second business device; after initializing the migration of the data to be migrated from the first database to the second database, controlling the second business device to provide transaction services to the outside.

[0007] In some embodiments of the present disclosure, the step of controlling the second business device to provide external transaction services includes:

[0008] Acquiring transaction service data provided by the first business device;

[0009] Migrating transaction service data to a second business device;

[0010] The second business device is controlled to provide external transaction services based on the transaction service data and the migrated data, wherein the migrated data is data that is migrated from the data to be migrated to the second database.

[0011] In some embodiments of the present disclosure, the second service device includes: a data synchronization module, wherein the data synchronization module is used to store transaction service data in real time;

[0012] The step of controlling the second business device to provide external transaction services based on the transaction service data and the migrated data includes:

[0013] In response to the online transaction request, reading transaction service data from the data synchronization module;

[0014] The second business device is controlled to provide external transaction services based on the transaction service data and the migrated data.

[0015] In some embodiments of the present disclosure, the second service device further includes: a timing device, the timing device has a corresponding timing time, and before acquiring the transaction service data provided by the first service device, further includes:

[0016] When initially migrating the data to be migrated from the first database to the second database, detecting the current time;

[0017] If the current time reaches the timing time, the transaction flow data in the first database is determined, and the transaction flow data is used as transaction service data.

[0018] In some embodiments of the present disclosure, the method further includes:

[0019] In response to the data rollback request, the transaction service data that has been migrated to the second database is migrated back to the first database.

[0020] In some embodiments of the present disclosure, the first database corresponds to a first data model, and the data to be migrated stored in the first database is stored with reference to the first data model;

[0021] The method of initially migrating the data to be migrated from the first database to the second database, where the second database corresponds to the second service device, includes:

[0022] determining a second data model corresponding to the second database;

[0023] According to the first data model and the second data model, performing structural transformation on the data to be migrated;

[0024] The converted data to be migrated is initially migrated to the second database, wherein the converted data to be migrated is stored in the second database with reference to the second data model.

[0025] In some embodiments of the present disclosure, performing structural conversion on the data to be migrated according to the first data model and the second data model includes:

[0026] Determining a reference data mapping relationship between the first database and the second database according to the first data model and the second data model;

[0027] According to the reference data mapping relationship, the structure of the data to be migrated is transformed.

[0028] In some embodiments of the present disclosure, there are multiple second databases, and the multiple second databases form a database cluster, wherein the method further includes:

[0029] In response to the cluster deployment instruction, adjusting the deployment information of the second database in the database cluster to obtain target deployment information;

[0030] Adjusting the reference data mapping relationship according to the target deployment information to obtain the target data mapping relationship;

[0031] Among them, according to the reference data mapping relationship, the structure of the data to be migrated is converted, including:

[0032] According to the target data mapping relationship, the data to be migrated is structurally transformed.

[0033] According to a second aspect of an embodiment of the present disclosure, there is provided a data online migration device, comprising a determination module for determining data to be migrated when controlling a first business device to provide transaction services, the first business device corresponding to a first database; a migration module for initializing the migration of the data to be migrated from the first database to a second database, the second database corresponding to a second business device; and a control module for controlling the second business device to provide external transaction services after initializing the migration of the data to be migrated from the first database to the second database.

[0034] In some embodiments of the present disclosure, the control module includes:

[0035] An acquisition submodule, used to acquire transaction service data provided by the first business device;

[0036] A first migration submodule, used to migrate transaction service data to a second business device;

[0037] The control submodule is used to control the second business device to provide transaction services based on the transaction service data and the migrated data, wherein the migrated data is the data to be migrated that is migrated to the second database.

[0038] In some embodiments of the present disclosure, the second service device includes: a data synchronization module, wherein the data synchronization module is used to store transaction service data in real time;

[0039] Among them, the control submodule is specifically used for:

[0040] In response to the online transaction request, reading transaction service data from the data synchronization module;

[0041] The second business device is controlled to provide external transaction services based on the transaction service data and the migrated data.

[0042] In some embodiments of the present disclosure, the second service device further includes: a timing device, the timing device has a corresponding timing time, and the control module further includes:

[0043] A detection submodule, used for detecting the current time when the data to be migrated is initially migrated from the first database to the second database before acquiring the transaction service data provided by the first business device;

[0044] The first determination submodule is used to determine the transaction flow data in the first database if the current time reaches the timing time, and use the transaction flow data as transaction service data.

[0045] In some embodiments of the present disclosure, the apparatus further comprises:

[0046] The migration module is used to migrate the transaction service data that has been migrated to the second database back to the first database in response to a data rollback request.

[0047] In some embodiments of the present disclosure, the first database corresponds to a first data model, and the data to be migrated stored in the first database is stored with reference to the first data model;

[0048] The migration module includes:

[0049] A second determination submodule, used to determine a second data model corresponding to a second database;

[0050] A conversion submodule, configured to perform structural conversion on the data to be migrated according to the first data model and the second data model;

[0051] The second migration submodule is used to initialize the migration of the converted data to be migrated to the second database, wherein the converted data to be migrated is stored in the second database with reference to the second data model.

[0052] In some embodiments of the present disclosure, the conversion submodule is specifically used to:

[0053] Determining a reference data mapping relationship between the first database and the second database according to the first data model and the second data model;

[0054] According to the reference data mapping relationship, the structure of the data to be migrated is transformed.

[0055] In some embodiments of the present disclosure, there are multiple second databases, and the multiple second databases form a database cluster, wherein the device further includes:

[0056] A first adjustment module, configured to adjust the deployment information of the second database in the database cluster in response to the cluster deployment instruction to obtain target deployment information;

[0057] A second adjustment module, used to adjust the reference data mapping relationship according to the target deployment information to obtain a target data mapping relationship;

[0058] Among them, the conversion submodule is specifically used for:

[0059] According to the target data mapping relationship, the data to be migrated is structurally transformed.

[0060] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the online data migration method as described above.

[0061] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the online data migration method as described above.

[0062] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the online data migration method as described above is implemented.

[0063] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0064] By determining the data to be migrated when controlling the first business device to provide transaction services, the first business device corresponds to the first database, and then the data to be migrated is initialized to be migrated from the first database to the second database, the second database corresponds to the second business device, and then after the data to be migrated is initialized to be migrated from the first database to the second database, the second business device is controlled to provide transaction services externally, thereby realizing online migration of data between databases, effectively improving the efficiency of data migration between databases, and because the corresponding business devices are still controlled to provide transaction services externally during the migration process, the impact of data migration on transaction business can be effectively reduced, thereby realizing online migration without downtime.

[0065] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0067] Figure 1 is a flow chart of a method for online data migration according to the first embodiment;

[0068] Figure 2 is a schematic diagram of initialization migration according to the first embodiment;

[0069] Figure 3 is a flow chart of a method for online data migration according to the second embodiment;

[0070] Figure 4 is a schematic diagram of application of a data synchronization module according to a second embodiment;

[0071] Figure 5 is a schematic diagram of an application of a timing device according to a second embodiment;

[0072] Figure 6 is a schematic diagram of data abnormal rollback according to the second embodiment;

[0073] Figure 7 is a flow chart of a method for online data migration according to a third embodiment;

[0074] Figure 8 is a flow chart of a method for online data migration according to a fourth embodiment;

[0075] Fig. 9 is a block diagram of a data online migration device according to the present disclosure;

[0076] Fig.10 is a block diagram of a data online migration device according to the present disclosure;

[0077] Fig.11 It is a block diagram of an electronic device according to the present disclosure. DETAILED DESCRIPTION

[0078] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0079] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.

[0080] It should be noted that the processes of data acquisition, storage, use, and processing in the technical solution disclosed in this disclosure comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0081] Figure 1 The figure is a flow chart of a method for online data migration according to the first embodiment.

[0082] This embodiment is described by taking the case where the online data migration method is configured as an online data migration device as an example.

[0083] In this embodiment, the online data migration method may be configured in an online data migration device, and the online data migration device may be set in a server.

[0084] It should be noted that the execution subject of the embodiment of the present disclosure may be, for example, a central processing unit (CPU) of a server in terms of hardware, or may be, for example, a related background service of the server in terms of software, without limitation.

[0085] like Figure 1 As shown, the online data migration method includes the following steps:

[0086] In step S101, when controlling a first business device to provide a transaction service, data to be migrated is determined, and the first business device corresponds to a first database.

[0087] The first business device may be a software algorithm logic and / or hardware system or functional module that provides transaction services to the outside before initializing data migration, and there is no limitation to this.

[0088] Among them, the first database can be a database corresponding to the first business device and containing the data to be migrated. The first business device corresponds to the first database, and the first business device can communicate data with the first database. In an actual business processing scenario, when the first business device provides corresponding business services to the outside world, it can read data from the first database or any other database that has an association with the business service to support the business service, and there is no restriction on this.

[0089] Correspondingly, the subsequent second business device may be a software algorithm logic and / or hardware system or functional module that receives the data to be migrated and provides external transaction services after the initialization migration process is completed, and there is no limitation on this.

[0090] Among them, the second database can be a database corresponding to the second business device that receives the data to be migrated. The second business device corresponds to the second database, and the second business device can communicate data with the second database. In the actual business processing scenario, when the second business device provides corresponding business services to the outside world, it can read data from the second database or any other database that has an association with the business service to support the business service. There is no restriction on this.

[0091] Before the migration is initialized, the static data in the first database that needs to be migrated to the second database may be referred to as data to be migrated.

[0092] In the disclosed embodiment, to determine the data to be migrated, the functional modules and processing flows of the first business device and the second business device can be analyzed respectively to determine the differences in business and data between the two. In combination with the needs of the data migration scenario, the business demand for static data in the first database can be analyzed. The data can be screened according to business needs, and data that meets the needs can be selected as the data to be migrated, and there is no restriction on this.

[0093] In step S102, the data to be migrated is initially migrated from the first database to the second database, where the second database corresponds to the second service device.

[0094] The disclosed embodiment can extract the data to be migrated from the first database, and initialize the migration of the data to be migrated to the second database. The initialization migration can be a batch migration. Before the initialization migration, the transactions in the first business device can be modified for applicability according to the transaction rules, and the business logic of the alternative transaction service of the second business device can be developed and processed accordingly to ensure that the transaction service can be executed continuously after the online migration of the data to be migrated, while avoiding the impact of the online data migration process on the transaction service as much as possible.

[0095] For example, Figure 2 is a schematic diagram of initialization migration according to the first embodiment, such as Figure 2 As shown, the transaction line can be an operation line representing the transaction business in the electronic bank, and the data line can be a line representing the data migration in the database. The transactions are distributed and switched through the transaction routing. During the static migration process, the data in the first database corresponding to the first business device is still used to process the transaction business. While the first business device is processing the transaction business, the data in the first database is initialized for migration, and the static data is migrated to the second database of the second business device.

[0096] In step S103, after the data to be migrated is initially migrated from the first database to the second database, the second business device is controlled to provide transaction services externally.

[0097] In the disclosed embodiment, after the data to be migrated is initially migrated from the first database to the second database, the processing of the transaction service can be switched from the first service device to the second service device, so that the second service device can provide external transaction services.

[0098] In this embodiment, by determining the data to be migrated when controlling the first business device to provide transaction services, the first business device corresponds to the first database, and then the data to be migrated is initialized to migrate from the first database to the second database, the second database corresponds to the second business device, and after the data to be migrated is initialized to migrate from the first database to the second database, the second business device is controlled to provide transaction services to the outside, thereby realizing online migration of data between databases, effectively improving the efficiency of data migration between databases, and because the corresponding business devices are still controlled to provide transaction services to the outside during the migration process, the impact of data migration on transaction business can be effectively reduced, thereby realizing online migration without downtime.

[0099] Figure 3 The figure is a flow chart of a method for online data migration according to the second embodiment.

[0100] like Figure 3 As shown, the online data migration method includes the following steps:

[0101] In step S301, when controlling a first business device to provide a transaction service, data to be migrated is determined, and the first business device corresponds to a first database.

[0102] In step S302, the data to be migrated is initially migrated from the first database to the second database, where the second database corresponds to the second service device.

[0103] The description of steps S301 - S302 can be found in the above embodiment and will not be repeated here.

[0104] In step S303, transaction service data provided by the first business device is obtained.

[0105] Among them, the transaction service data can be used to record transaction information such as transaction workload and work progress. It can be incremental data about transaction information generated by the first business device during the process of initializing the migration of static data and conducting transactions. During the initialization migration process, the first business device can automatically update the transaction service data based on the ongoing transaction business, or it can automatically update the transaction service data based on the ongoing transaction business at a certain period, and there is no restriction on this.

[0106] In the disclosed embodiment, when the data to be migrated is initially migrated from the first database to the second database, the first business device is still synchronously performing transaction business and generating transaction service data. For the acquisition of transaction service data, an acquisition cycle can be set, for example, the transaction service data can be acquired every 15 minutes, or the transaction service data can be scanned in real time to acquire the updated transaction service data in real time when the transaction service data is updated.

[0107] In step S304, the transaction service data is migrated to the second business device.

[0108] In the disclosed embodiment, after the initial migration, the transaction can be switched to the second business device. At this time, the transaction service data acquired in the first business device can be sent to the second database of the second business device. The second business device obtains the transaction service data and parses the transaction service data to obtain transaction status information. The transaction status information can be used to assist the second business device in launching corresponding business services.

[0109] In the disclosed embodiment, the transaction service data is sent from the first business device to the second business device by using the same data transmission line as the initialization migration, or a database for receiving the transaction service data may be set up in the second business device and the transaction service data may be transmitted to the database through the line. There is no limitation on this.

[0110] In step S305, the second business device is controlled to provide external transaction services based on the transaction service data and the migrated data, wherein the migrated data is the data to be migrated that is migrated to the second database.

[0111] In the disclosed embodiment, the second service device may read the migrated data from the second database, and may also process the transaction service based on the transaction status information obtained by parsing the transaction service data in combination with the migrated data.

[0112] Optionally, the second business device includes: a data synchronization module, wherein the data synchronization module is used to store transaction service data in real time, read transaction service data from the data synchronization module in response to an online transaction request, and control the second business device to provide transaction services to the outside based on the transaction service data and the migrated data. By configuring the data synchronization module in the second business device and using the data synchronization module to store and read transaction service data, the data recognition efficiency during the migration process can be improved, and at the same time, the real-time and response efficiency of the transaction services provided by the second business device can be guaranteed without stopping the migration.

[0113] Among them, the online transaction request can be used to call the transaction service data in the data synchronization module, and then control the second business device to synchronize the transaction progress of the first business device in time after the transaction is switched.

[0114] In the disclosed embodiment, after the initialization migration is completed, the transaction is switched to the second business device. The data synchronization module can obtain the transaction service data generated during the initialization transaction and adjust the transaction progress of the second business device according to the online transaction request.

[0115] Figure 4 is a schematic diagram of the application of the data synchronization module according to the second embodiment. Figure 4 As shown, while the data to be migrated is migrated to the second business device, the transaction synchronization can be switched to the second business device based on the migrated data and the transaction service data migrated to the data synchronization module, thereby reducing the impact on the transaction business during the data migration process.

[0116] Optionally, the second business device also includes: a timing device, the timing device having a corresponding timing time, before obtaining the transaction service data provided by the first business device, when initializing the migration of the data to be migrated from the first database to the second database, the current time is detected, if the current time reaches the timing time, the transaction flow data in the first database is determined, and the transaction flow data is used as the transaction service data, through the setting of the timing device, the transaction flow data generated in the process of the first business device providing transaction services to the outside world can be collected in time, and the transaction flow data can be used as the transaction service data, after the initialization migration is completed, the incremental data can be migrated in time, which reduces the error of data synchronization between the first database and the second database, helps reduce the impact of data on transaction services during online migration, and improves the reliability of transaction services during the migration process.

[0117] Among them, the timing device can be used to detect in real time the incremental data generated by the first database during the transaction process. The timing device can be a timer module installed in the second business device, or it can be a computer program code that implements the timing function contained in the software part of the second business device. There is no limitation on this.

[0118] Figure 5 is a schematic diagram of the application of the timing device according to the second embodiment, such as Figure 5 As shown, a time can be preset for the timing device, for example, 1 minute or 30 seconds. Every preset time, the incremental data (i.e., transaction service data) in the first database is detected in real time, and the generated incremental data is synchronized by means of incremental complement to complete the synchronization of the transaction service data of the first database and the second database.

[0119] In step S306, in response to the data rollback request, the data that has been migrated to the second database is migrated back to the first database, wherein the data that has been migrated to the second database includes: the migrated data and the incremental data that has been migrated to the second database.

[0120] Among them, the data rollback request can be a request generated by a tool for detecting anomalies after the migration is completed or an anomaly detection program when an anomaly is found. It can be used to perform data rollback operations on transaction service data that has been migrated to the second business device when an anomaly is detected after the data migration is completed.

[0121] In the disclosed embodiment, when a system-level data anomaly occurs, the transaction service data in the second business device can be rolled back to the first business device, the transaction can be switched to the first business device, and then wait for subsequent data anomaly processing.

[0122] Figure 6 is a schematic diagram of data abnormal rollback according to the second embodiment, such as Figure 6 As shown, when an abnormal situation is found after the data migration is completed, the transaction can be switched to the first business device, and the transaction service data in the second database can be rolled back, ensuring fast transaction switching and data rollback operations in the event of migration abnormalities.

[0123] In this embodiment, when controlling the first business device to provide transaction services, the data to be migrated is determined, the first business device corresponds to the first database, the data to be migrated is initialized to be migrated from the first database to the second database, the second database corresponds to the second business device, the transaction service data provided by the first business device is obtained, the transaction service data is synchronously migrated to the second business device, and the second business device is controlled to provide transaction services to the outside based on the transaction service data and the migrated data, wherein the migrated data is the data to be migrated to the second database, and then in response to the data rollback request, the data migrated to the second database is migrated back to the first database. Since the migrated data is traded based on the acquisition of the transaction service data, the impact on the business during the data migration process is reduced. At the same time, the use of the data synchronization module can effectively reduce the synchronization error of the transaction progress in the first business device and the second business device during the transaction switching process, and ensure the real-time synchronization of the transaction during the device switching process. The use of fast abnormal rollback can quickly switch the business device when an abnormality is found, reducing the impact of the migration abnormality on the transaction process.

[0124] Figure 7 The figure is a flow chart of a method for online data migration according to the third embodiment.

[0125] like Figure 7 As shown, the data online migration method includes the following steps:

[0126] In step S701, when controlling a first business device to provide a transaction service, data to be migrated is determined, and the first business device corresponds to a first database.

[0127] The description of step S701 can be found in the above embodiment and will not be repeated here.

[0128] In step S702, a second data model corresponding to the second database is determined.

[0129] Among them, the first database corresponds to the first data model, and the data to be migrated stored in the first database is stored with reference to the first data model. The first data model can describe the static characteristics, dynamic behaviors and constraints of the data stored in the first database from an abstract level, and is used to represent the information and data operations of the data in the first database. Abstract framework, correspondingly, the second data model can be an abstract framework that describes the static characteristics, dynamic behaviors and constraints of the data stored in the first database from an abstract level, and is used to represent the information and data operations of the data in the second database. The static characteristics, dynamic behaviors and constraints in the first data model and the second data model may be the same or different, and there is no restriction on this.

[0130] In the disclosed embodiment, data dictionaries of the first database and the second database can be established respectively to analyze the differences in data structures and code data in the first business device and the second business device, and to generate a first data model corresponding to the first database and a second data model corresponding to the second database respectively.

[0131] In step S703, the data to be migrated is structurally converted according to the first data model and the second data model.

[0132] In the embodiments of the present disclosure, before performing structural conversion on the data to be migrated, the data to be migrated may be checked according to the first data model and the second data model, for example, data format, data length, data interval range, definition of null values ​​and default values, integrity and consistency may be checked. The structural conversion on the data to be migrated may be conversion of data format, data length, and definition of null values ​​and default values, and there is no limitation on this.

[0133] In the disclosed embodiment, after checking the data in the first database and the second database, some of the data to be migrated may be structurally converted, or at least some of the redundant data to be migrated may be deleted according to actual needs, without limitation.

[0134] In step S704, the converted data to be migrated is initially migrated to the second database, wherein the converted data to be migrated is stored in the second database with reference to the second data model.

[0135] In the embodiment of the present disclosure, based on the differences in data structure and processing flow between the first data model and the second data model, after the data to be migrated is structurally converted, the data to be migrated is migrated to the second database corresponding to the second data model through initialization migration. The initialization migration can be a static migration method, in which the static data at the time point after the data conversion is used as the data to be migrated and migrated to the second database.

[0136] In step S705, after the data to be migrated is initially migrated from the first database to the second database, the second business device is controlled to provide transaction services externally.

[0137] The description of step S705 can be found in the above embodiment and will not be repeated here.

[0138] In this embodiment, when controlling the first business device to provide transaction services, the data to be migrated is determined, the first business device corresponds to the first database, and the second data model corresponding to the second database is determined. According to the first data model and the second data model, the data to be migrated is structurally converted, and the converted data to be migrated is initialized to migrate to the second database, wherein the converted data to be migrated is stored in the second database with reference to the second data model. After the data to be migrated is initially migrated from the first database to the second database, the second business device is controlled to provide transaction services to the outside. Since the data to be migrated is structurally converted according to the difference between the first data model and the second data model before the online migration of the data to be migrated, data errors introduced by system differences during the migration process can be reduced. At the same time, the structural conversion can make the data to be migrated match the second data model. After the data to be migrated is migrated, the data to be migrated can be directly used for transaction services, thereby reducing the impact on the transaction services and ensuring the coherent execution of the transaction services.

[0139] Figure 8 is a flow chart of a method for online data migration according to a fourth embodiment.

[0140] like Figure 8 As shown, the online data migration method includes the following steps:

[0141] In step S801, when controlling a first business device to provide a transaction service, data to be migrated is determined, and the first business device corresponds to a first database.

[0142] In step S802, a second data model corresponding to the second database is determined.

[0143] The description of steps S801 - S802 can be found in the above embodiment and will not be repeated here.

[0144] In step S803, a reference data mapping relationship between the first database and the second database is determined according to the first data model and the second data model.

[0145] Among them, the reference data mapping relationship between the first database and the second database can be a mapping relationship between the data in the first database and the data in the second database that express the same meaning. For example, the data representing "transaction completed" in the first database may be "0000" and in the second database may be "1111". At this time, the data to be migrated in the first database cannot be directly migrated to the second database. It is necessary to convert "0000" into "1111" through relationship mapping and then migrate it to the second database.

[0146] In the embodiment of the present disclosure, the reference data mapping relationship between the first database and the second database may be determined by generating a data mapping tool based on the data expression meaning of the first database and the second database, such as by generating a data mapping table or generating a data mapping program, to perform relationship mapping on the data.

[0147] In step S804, in response to the cluster deployment instruction, the deployment information of the second database in the database cluster is adjusted to obtain target deployment information.

[0148] There may be multiple second databases, and the multiple second databases form a database cluster. Different second databases may have the same or different data mapping relationships, and there is no limitation on this.

[0149] Among them, information such as the number of second databases and the geographical locations and deployment configurations of the second databases may be referred to as deployment information.

[0150] In the disclosed embodiment, data to be migrated is deployed for multiple second databases according to the cluster deployment instructions generated by the second business device. By adjusting the number of second databases and the geographical location, deployment configuration and other information of the deployment of the second databases, target deployment information about the multiple second databases is generated. This can effectively assist the expansion deployment of the second databases and facilitate adaptive regulation of the system scale.

[0151] In step S805, the reference data mapping relationship is adjusted according to the target deployment information to obtain a target data mapping relationship.

[0152] The reference data mapping relationship is adjusted, and the adjusted data mapping relationship may be referred to as a target data mapping relationship.

[0153] In the disclosed embodiment, the reference data mapping relationship between the first database and the plurality of second databases is adjusted according to the target deployment information in the plurality of second service devices to obtain a plurality of target data mapping relationships adapted to the plurality of second databases.

[0154] For example, multiple second databases can be divided into "Library A", "Library B" and "Library C". The data mapping relationship between Library A and Library B can be the same, and the data mapping relationship between Library A and Library C can be different. At this time, it is necessary to adjust the reference data mapping relationship according to the target deployment information of the three second databases Library A, Library B and Library C, and generate target data mapping relationships respectively.

[0155] In step S806, the data to be migrated is structurally converted according to the target data mapping relationship.

[0156] In the disclosed embodiment, according to the first database and the second database that needs to receive the data to be migrated, the data to be migrated and the reverse structure are converted according to the target data mapping relationship corresponding to the second database, and the data to be migrated are converted into data suitable for the second database.

[0157] In step S807, the converted data to be migrated is initially migrated to the second database, wherein the converted data to be migrated is stored in the second database with reference to the second data model.

[0158] In step S808, after the data to be migrated is initially migrated from the first database to the second database, the second business device is controlled to provide transaction services externally.

[0159] The description of steps S807-S808 can be found in the above embodiment and will not be repeated here.

[0160] In this embodiment, when controlling the first business device to provide transaction services, the data to be migrated is determined, the first business device corresponds to the first database, and the second data model corresponding to the second database is determined. According to the first data model and the second data model, a reference data mapping relationship between the first database and the second database is determined. In response to the cluster deployment instruction, the deployment information of the second database in the database cluster is adjusted to obtain the target deployment information. According to the target deployment information, the reference data mapping relationship is adjusted to obtain the target data mapping relationship. According to the target data mapping relationship, the data to be migrated is structurally converted, and the converted data to be migrated is initially migrated to the second database, wherein the converted data to be migrated is stored in the second database with reference to the second data model. After the data to be migrated is initially migrated from the first database to the second database, the second business device is controlled to provide transaction services externally. Since the reference data mapping relationship between the first data model and the second data model is adjusted according to the target deployment information, homogeneous and heterogeneous data migration can be supported. At the same time, multiple second databases form a database cluster, so that the server can be rapidly expanded horizontally, and the business processing performance of the second business device is optimized. The establishment of the target mapping relationship can ensure the synchronization of data transmission and reduce the generation of erroneous data.

[0161] Fig. 9 The present invention is a block diagram of an online data migration device.

[0162] like Fig. 9 As shown, the data online migration device 90 includes:

[0163] A determination module 901 is used to determine data to be migrated when controlling a first business device to provide a transaction service, the first business device corresponding to a first database;

[0164] A migration module 902, configured to initialize the migration of the data to be migrated from the first database to the second database, where the second database corresponds to the second service device;

[0165] The control module 903 is used to control the second business device to provide transaction services externally after the data to be migrated is initially migrated from the first database to the second database.

[0166] In some embodiments of the present disclosure, Fig.10 As shown, Fig.10 903 is a block diagram of a data online migration device according to the present disclosure, wherein the control module 903 includes:

[0167] The acquisition submodule 9031 is used to acquire transaction service data provided by the first business device;

[0168] A first migration submodule 9032, used to migrate transaction service data to a second business device;

[0169] The control submodule 9033 is used to control the second business device to provide transaction services based on the transaction service data and the migrated data, wherein the migrated data is the data to be migrated that is migrated to the second database.

[0170] In some embodiments of the present disclosure, Fig.10 As shown, the second business device includes: a data synchronization module, wherein the data synchronization module is used to store transaction service data in real time;

[0171] Wherein, the control submodule 9033 is specifically used for:

[0172] In response to the online transaction request, reading transaction service data from the data synchronization module;

[0173] The second business device is controlled to provide external transaction services based on the transaction service data and the migrated data.

[0174] In some embodiments of the present disclosure, Fig.10 As shown, the second service device further includes: a timing device, the timing device has a corresponding timing time, and the control module 903 further includes:

[0175] A detection submodule 9034 is used to detect the current time when the data to be migrated is initially migrated from the first database to the second database before acquiring the transaction service data provided by the first business device;

[0176] The first determination submodule 9035 is used to determine the transaction flow data in the first database if the current time reaches the timing time, and use the transaction flow data as transaction service data.

[0177] In some embodiments of the present disclosure, Fig.10 As shown, the device also includes:

[0178] The migration module 904 is used to migrate the transaction service data that has been migrated to the second database back to the first database in response to a data rollback request.

[0179] In some embodiments of the present disclosure, Fig.10 As shown, the first database corresponds to the first data model, and the data to be migrated stored in the first database is stored with reference to the first data model;

[0180] The migration module 902 includes:

[0181] A second determining submodule 9021, configured to determine a second data model corresponding to a second database;

[0182] A conversion submodule 9022, configured to perform structural conversion on the data to be migrated according to the first data model and the second data model;

[0183] The second migration submodule 9023 is used to initialize the migration of the converted data to be migrated to the second database, wherein the converted data to be migrated is stored in the second database with reference to the second data model.

[0184] In some embodiments of the present disclosure, Fig.10 As shown, the conversion submodule 9022 is specifically used for:

[0185] Determining a reference data mapping relationship between the first database and the second database according to the first data model and the second data model;

[0186] According to the reference data mapping relationship, the structure of the data to be migrated is transformed.

[0187] In some embodiments of the present disclosure, Fig.10 As shown, the number of the second databases is multiple, and the multiple second databases form a database cluster, wherein the device further includes:

[0188] A first adjustment module 905, configured to adjust the deployment information of the second database in the database cluster in response to the cluster deployment instruction to obtain target deployment information;

[0189] A second adjustment module 906, configured to adjust the reference data mapping relationship according to the target deployment information to obtain a target data mapping relationship;

[0190] The conversion submodule 9022 is specifically used for:

[0191] According to the target data mapping relationship, the data to be migrated is structurally transformed.

[0192] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0193] In this embodiment, by determining the data to be migrated when controlling the first business device to provide transaction services, the first business device corresponds to the first database, and then the data to be migrated is initialized to migrate from the first database to the second database, the second database corresponds to the second business device, and after the data to be migrated is initialized to migrate from the first database to the second database, the second business device is controlled to provide transaction services to the outside, thereby realizing online migration of data between databases, effectively improving the efficiency of data migration between databases, and because the corresponding business devices are still controlled to provide transaction services to the outside during the migration process, the impact of data migration on transaction business can be effectively reduced, thereby realizing online migration without downtime.

[0194] The present disclosure also provides an electronic device, Fig.11 1 is a block diagram of an electronic device according to the present disclosure. For example, the electronic device 1100 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0195] Reference Fig.11 , the electronic device 1100 may include one or more of the following components: a processing component 1102 , a memory 1104 , a power component 1106 , a multimedia component 1108 , an audio component 1110 , an input / output (I / O) interface 1112 , a sensor component 1114 , and a communication component 1116 .

[0196] The processing component 1102 generally controls the overall operation of the electronic device 1100, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1102 may include one or more processors 1120 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1102 may include one or more modules to facilitate the interaction between the processing component 1102 and other components. For example, the processing component 1102 may include a multimedia module to facilitate the interaction between the multimedia component 1108 and the processing component 1102.

[0197] The memory 1104 is configured to store various types of data to support operations on the electronic device 1100. Examples of such data include instructions for any application or method operating on the electronic device 1100, contact data, phone book data, messages, pictures, videos, etc. The memory 1104 may 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 memory, flash memory, magnetic disk, or optical disk.

[0198] The power supply component 1106 provides power to various components of the electronic device 1100. The power supply component 1106 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 1100. The multimedia component 1108 includes a touch display screen that provides an output interface between the electronic device 1100 and the user. In some embodiments, the touch display screen may include a liquid crystal display (LCD) and a touch panel (TP). The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1108 includes a front camera and / or a rear camera. When the electronic device 1100 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0199] The audio component 1110 is configured to output and / or input audio signals. For example, the audio component 1110 includes a microphone (MIC), and when the electronic device 1100 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1104 or sent via the communication component 1116.

[0200] In some embodiments, the audio component 1110 also includes a speaker for outputting audio signals.

[0201] I / O interface 1112 provides an interface between processing component 1102 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0202] The sensor assembly 1114 includes one or more sensors for providing various aspects of status assessment for the electronic device 1100. For example, the sensor assembly 1114 can detect the open / closed state of the electronic device 1100, the relative positioning of components, such as the display and keypad of the electronic device 1100, and the sensor assembly 1114 can also detect the position change of the electronic device 1100 or a component of the electronic device 1100, the presence or absence of user contact with the electronic device 1100, the orientation or acceleration / deceleration of the electronic device 1100, and the temperature change of the electronic device 1100. The sensor assembly 1114 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1114 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1114 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0203] The communication component 1116 is configured to facilitate wired or wireless communication between the electronic device 1100 and other devices. The electronic device 1100 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In one embodiment, the communication component 1116 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In one embodiment, the communication component 1116 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0204] In an embodiment, the electronic device 1100 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned data online migration method.

[0205] In an embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1104 including instructions, and the instructions can be executed by a processor 1120 of the electronic device 1100 to complete the above method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0206] In an embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the online data migration method as described above is implemented.

[0207] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0208] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for online data migration, characterized in that: include: When controlling a first business device to provide a transaction service, determining data to be migrated, the first business device corresponds to a first database, the first database corresponds to a first data model, and the data to be migrated stored in the first database is stored with reference to the first data model; Determine a second data model corresponding to a second database, determine a reference data mapping relationship between the first database and the second database according to the first data model and the second data model, perform structural conversion on the data to be migrated according to the reference data mapping relationship, and initialize the migration of the converted data to be migrated to the second database, wherein the second database corresponds to a second business device, the second business device includes a timing device and a data synchronization module for storing transaction service data in real time, and the timing device has a corresponding timing time; wherein the converted data to be migrated is stored in the second database with reference to the second data model; After the data to be migrated is initially migrated from the first database to the second database, the transaction is switched to the second business device, the data synchronization module acquires the transaction service data generated during the initialization transaction, and controls the second business device to provide the transaction service based on the transaction service data and the migrated data according to the online transaction request, wherein the transaction service data is the incremental data of the transaction information generated by the first business device during the initialization migration process, and the migrated data is the data obtained by migrating the data to be migrated to the second database; a migration module, configured to migrate the transaction service data that has been migrated to the second database back to the first database in response to a data rollback request; The online data migration method also includes: before obtaining the transaction service data provided by the first business device, when initializing the migration of the data to be migrated from the first database to the second database, detecting the current time, and if the current time reaches the timing time, using the incremental data as the transaction service data.

2. The method for online data migration according to claim 1, characterized in that: There are multiple second databases, and the multiple second databases form a database cluster, wherein the method further includes: In response to the cluster deployment instruction, adjusting the deployment information of the second database in the database cluster to obtain target deployment information; Adjusting the reference data mapping relationship according to the target deployment information to obtain a target data mapping relationship; The step of performing structural conversion on the data to be migrated according to the reference data mapping relationship includes: According to the target data mapping relationship, the data to be migrated is structurally converted.

3. A data online migration device, characterized in that: include: a determination module, configured to determine data to be migrated when controlling a first business device to provide a transaction service, the first business device corresponding to a first database, the first database corresponding to a first data model, and the data to be migrated stored in the first database is stored with reference to the first data model; a migration module, configured to determine a second data model corresponding to a second database, determine a reference data mapping relationship between the first database and the second database according to the first data model and the second data model, perform structural conversion on the data to be migrated according to the reference data mapping relationship, and initialize the migration of the converted data to be migrated to the second database, wherein the second database corresponds to a second business device, the second business device includes a timing device and a data synchronization module for storing transaction service data in real time, the timing device has a corresponding timing time; wherein the converted data to be migrated is stored in the second database with reference to the second data model; a control module, configured to, after the data to be migrated is initially migrated from the first database to the second database, switch the transaction to the second business device, obtain the transaction service data generated during the initialization transaction by the data synchronization module, and control the second business device to provide the transaction service externally based on the transaction service data and the migrated data according to the online transaction request; wherein the transaction service data is incremental data on transaction information generated by the first business device during the initialization migration process, and the migrated data is data obtained by migrating the data to be migrated to the second database; a migration module, configured to migrate the transaction service data that has been migrated to the second database back to the first database in response to a data rollback request; The data online migration device also includes: before obtaining the transaction service data provided by the first business device, when initializing the migration of the data to be migrated from the first database to the second database, detecting the current time, and if the current time reaches the timing time, using the incremental data as the transaction service data.

4. The online data migration device according to claim 3, characterized in that: The number of the second databases is multiple, and the multiple second databases form a database cluster, wherein the device further includes: a first adjustment module, configured to adjust the deployment information of the second database in the database cluster in response to a cluster deployment instruction to obtain target deployment information; A second adjustment module, configured to adjust the reference data mapping relationship according to the target deployment information to obtain a target data mapping relationship; Wherein, the conversion submodule is specifically used for: According to the target data mapping relationship, the data to be migrated is structurally converted.

5. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to claim 1 or 2.

6. A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method according to claim 1 or 2.

7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to claim 1 or 2 is implemented.

Citation Information

Patent Citations

  • Data migration method of virtual node and virtual node

    CN107885758A

  • Data migration method and device, electronic equipment and computer storage medium

    CN112860670A