Data migration method and device, storage medium and electronic equipment

By obtaining multiple configuration information and migration modes, the data migration progress between databases is controlled, which solves the problem of being unable to control the data migration progress in the existing technology and improves the reliability and stability of data migration.

CN118550899APending Publication Date: 2024-08-27HANGZHOU PINGPONG INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410840013.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

The existing technology cannot control the progress of data migration during the data migration process between databases, and there are certain business risks and difficulties in repairing data anomalies.

Method used

By obtaining multiple configuration information, each configuration information corresponds to different dimensions, it is used to control the progress of data migration, determine the objects to be migrated, and perform data migration according to the migration mode and target value, thereby controlling when the functions of the new business system are not fully verified. Data migration progress to improve the reliability of data migration.

Benefits of technology

It realizes controlling the progress of data migration from multiple dimensions, improves the reliability of data migration, reduces the risk of data migration, and ensures the stability and consistency of the data migration process between databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550899A
    Figure CN118550899A
Patent Text Reader

Abstract

The invention discloses a data migration method and device, a storage medium and electronic equipment, and relates to the technical field of data processing. The method comprises the steps that multiple pieces of configuration information are obtained, the dimensions corresponding to the configuration information are different, and the configuration information is used for controlling the progress of data migration; determining a to-be-migrated object corresponding to each piece of configuration information, and obtaining business data corresponding to the to-be-migrated object; data migration is carried out on the business data corresponding to the to-be-migrated object so as to migrate the business data corresponding to the to-be-migrated object from the first database to the second database, and the version of a first business system corresponding to the first database is lower than the version of a second business system corresponding to the second database. The technical problem that in the prior art, when data migration is carried out between databases, the progress of data migration cannot be controlled is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data migration method, device, storage medium and electronic device. Background Art

[0002] In order to meet the future needs of the system or solve the current system bottleneck, it is often necessary to restructure or upgrade the system. During the update and iteration of the enterprise's business system, it is often necessary to migrate data or users between different databases due to business adjustments. Different databases correspond to the new and old business systems respectively.

[0003] Traditional data migration solutions are usually implemented offline, first shutting down the old business system, then cleaning and migrating the data once, and then starting the new business system and switching all traffic to the new business system. This method cannot meet the needs of users who frequently access the system. In addition, if the data after the upgrade is abnormal due to insufficient analysis before the system upgrade, data repair will be extremely difficult.

[0004] Existing online data migration solutions are generally between homogeneous databases, and the new and old databases are copied by reading and parsing the log files of the database itself. Or migration between heterogeneous databases is achieved through batch processing of data conversion programs. However, whether it is log reading or conversion program to achieve migration, the progress of data migration cannot be controlled. In addition, the new business system has not yet undergone a certain amount of user traffic and data verification, and there is a high risk for the migrated data and users.

[0005] To sum up, in the existing technology, offline data migration is used during data migration, which cannot meet the user's access needs. If an exception occurs during the data migration process, it is difficult to roll back effectively; online data migration is used, the progress of data migration cannot be controlled, and there are certain business risks. Summary of the invention

[0006] The embodiments of the present invention provide a data migration method, device, storage medium and electronic device to at least solve the technical problem in the prior art that the progress of data migration cannot be controlled when data is migrated between databases.

[0007] According to one aspect of an embodiment of the present invention, there is provided a data migration method, comprising: obtaining multiple configuration information, wherein each configuration information corresponds to a different dimension, and the configuration information is used to control the progress of data migration; determining an object to be migrated corresponding to each configuration information, and obtaining business data corresponding to the object to be migrated; performing data migration on the business data corresponding to the object to be migrated, so as to migrate the business data corresponding to the object to be migrated from a first database to a second database, wherein a version of a first business system corresponding to the first database is lower than a version of a second business system corresponding to the second database.

[0008] Further, determining the objects to be migrated corresponding to each configuration information includes: determining the objects to be migrated corresponding to each configuration information according to the migration mode and target value contained in each configuration information, wherein the migration mode is used to indicate the migration method of the business data corresponding to the object to be migrated, and the target value is used to determine the number of objects to be migrated.

[0009] Further, the configuration information includes first configuration information, the migration mode contained in the first configuration information is an ID-based migration mode, and the target value contained in the first configuration information is the ID of the object to be migrated, wherein the object to be migrated corresponding to each configuration information is determined based on the migration mode and the target value contained in each configuration information, including: if the configuration information is the first configuration information, then based on the ID-based migration mode and the ID of the object to be migrated, the object to be migrated corresponding to the first configuration information is determined from multiple IDs in the first database.

[0010] Further, the configuration information includes second configuration information, the migration mode contained in the second configuration information is a mode based on quantity migration, and the target value contained in the second configuration information is the number of objects to be migrated, wherein the objects to be migrated corresponding to each configuration information are determined based on the migration mode and the target value contained in each configuration information, including: if the configuration information is the second configuration information, then based on the mode based on quantity migration and the number of objects to be migrated, the objects to be migrated corresponding to the second configuration information are determined from objects in the first database other than the objects to be migrated corresponding to the first configuration information.

[0011] Further, the configuration information includes third configuration information, the migration mode contained in the third configuration information is a mode based on percentage migration, and the target value contained in the third configuration information is the proportion of objects to be migrated, wherein the objects to be migrated corresponding to each configuration information are determined based on the migration mode and the target value contained in each configuration information, including: if the configuration information is the third configuration information, then based on the mode based on percentage migration and the proportion of objects to be migrated, determining the objects to be migrated corresponding to the third configuration information from objects in the first database other than the objects to be migrated corresponding to the first configuration information and the objects to be migrated corresponding to the second configuration information.

[0012] Further, data migration is performed on the business data corresponding to the object to be migrated, including: based on the first configuration information, migrating the business data corresponding to the object to be migrated corresponding to the first configuration information from the first database to the second database, so as to provide the first business service for the object to be migrated corresponding to the first configuration information based on the second business system; when the migration is detected to be successful, judging whether there is an abnormality in the first business service provided by the second business system, and obtaining a first judgment result; if the first judgment result indicates that there is no abnormality in the first business service, migrating the business data corresponding to the object to be migrated corresponding to the second configuration information from the first database to the second database based on the second configuration information, so as to provide the second business service for the object to be migrated corresponding to the second configuration information based on the second business system; when the migration is detected to be successful, judging whether there is an abnormality in the second business service provided by the second business system, and obtaining a second judgment result; if the second judgment result indicates that there is no abnormality in the second business service, migrating the business data corresponding to the object to be migrated corresponding to the third configuration information from the first database to the second database based on the third configuration information, so as to provide the third business service for the object to be migrated corresponding to the third configuration information based on the second business system.

[0013] Furthermore, after performing data migration on the business data corresponding to the migration object, the method further includes: performing data consistency verification on the first business system and the second business system to obtain a verification result; if the verification result indicates that the verification is passed, determining that the data migration is completed.

[0014] According to another aspect of an embodiment of the present invention, a data migration device is also provided, including: an acquisition unit, used to acquire multiple configuration information, wherein each configuration information corresponds to a different dimension, and the configuration information is used to control the progress of data migration; a first determination unit, used to determine the object to be migrated corresponding to each configuration information, and acquire the business data corresponding to the object to be migrated; a first processing unit, used to perform data migration on the business data corresponding to the object to be migrated, so as to migrate the business data corresponding to the object to be migrated from a first database to a second database, wherein the version of the first business system corresponding to the first database is lower than the version of the second business system corresponding to the second database.

[0015] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and the computer program implements the above-mentioned data migration method when executed by a processor.

[0016] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned data migration method when running.

[0017] According to another aspect of an embodiment of the present invention, an electronic device is also provided, which includes one or more processors; a memory for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the above-mentioned data migration method when running.

[0018] In an embodiment of the present invention, a method of controlling the progress of data migration through configuration information is adopted. First, multiple configuration information is obtained, wherein each configuration information corresponds to a different dimension, and the configuration information is used to control the progress of data migration; the object to be migrated corresponding to each configuration information is determined, and the business data corresponding to the object to be migrated is obtained; data migration is performed on the business data corresponding to the object to be migrated, so as to migrate the business data corresponding to the object to be migrated from the first database to the second database, wherein the version of the first business system corresponding to the first database is lower than the version of the second business system corresponding to the second database.

[0019] In the above process, by obtaining multiple configuration information and determining the objects to be migrated corresponding to each configuration information, the speed of data migration can be controlled from multiple dimensions. When the functions of the new business system are not fully verified, the progress of data migration can be controlled, thereby effectively improving the reliability of data migration and reducing the risk of data migration.

[0020] It can be seen that through the technical solution of the present invention, the purpose of improving the reliability of data migration is achieved, thereby realizing the technical effect of controlling the progress of data migration from multiple dimensions, and further solving the technical problem in the prior art that the progress of data migration cannot be controlled when migrating data between databases. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0022] Figure 1 is a flow chart of an optional data migration method according to an embodiment of the present invention;

[0023] Figure 2 is a schematic diagram of an optional data migration process according to an embodiment of the present invention;

[0024] Figure 3 is a schematic diagram of a simple process of optional data migration according to an embodiment of the present invention;

[0025] Figure 4 is a schematic diagram of an optional grayscale solution for data migration according to an embodiment of the present invention;

[0026] Figure 5 is a schematic diagram of an optional data migration device according to an embodiment of the present invention;

[0027] Figure 6 is a schematic diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set between the system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0031] Example 1

[0032] According to an embodiment of the present invention, an embodiment of a data migration method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0033] Figure 1is a flow chart of an optional data migration method according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:

[0034] Step S101, obtaining multiple pieces of configuration information, wherein each piece of configuration information corresponds to a different dimension, and the configuration information is used to control the progress of data migration.

[0035] In the above steps, multiple configuration information can be obtained through application systems, processors, electronic devices and other devices, and optionally, multiple configuration information can be obtained through a data migration system. Optionally, the configuration information includes a grayscale routing switch (switch), a grayscale routing mode (mode), and a grayscale routing value (value). For example, the configuration information is {"switch":"OFF","mode":"","value":""}, which means that the grayscale is not turned on, that is, data migration is not started.

[0036] Optionally, according to the content of different configuration information, migration can be implemented according to the dimensions of user ID, number of users, and user percentage. For example, the configuration information is {"switch":"ON","mode":"BY_ID","value":"user ID1, user ID2"}, which means migration according to the user ID dimension.

[0037] Step S102: determine the object to be migrated corresponding to each piece of configuration information, and obtain the business data corresponding to the object to be migrated.

[0038] Optionally, the objects to be migrated corresponding to each configuration information can be determined based on the content of the configuration information, and the business data corresponding to the objects to be migrated can be obtained to prepare for data migration. For example, if the configuration information is {"switch":"ON","mode":"BY_ID","value":"user ID1, user ID2"}, the objects to be migrated corresponding to the configuration information can be determined to be users corresponding to user ID1 and user ID2 based on the grayscale routing value (value), and the business data corresponding to user ID1 and user ID2 can be obtained to prepare for data migration.

[0039] In an optional embodiment, determining the objects to be migrated corresponding to each configuration information includes: determining the objects to be migrated corresponding to each configuration information based on the migration mode and target value contained in each configuration information, wherein the migration mode is used to indicate the migration method of the business data corresponding to the object to be migrated, and the target value is used to determine the number of objects to be migrated.

[0040] Optionally, in the process of determining the object to be migrated corresponding to each configuration information, the object to be migrated corresponding to each configuration information can be determined based on the migration mode and target value contained in each configuration information, wherein the migration mode can be the aforementioned grayscale routing mode (mode), and the target value can be the aforementioned grayscale routing value (value). For example, the configuration information is {"switch":"ON","mode":"BY_ID","value":"user ID1, user ID2"}, and it is determined according to the grayscale routing mode (mode) that the configuration information indicates migration according to the user ID dimension, and it is determined according to the grayscale routing value (value) that the object to be migrated corresponding to the configuration information is the user corresponding to user ID1 and user ID2.

[0041] It should be noted that, according to the migration mode and target value included in each configuration information, the object to be migrated corresponding to each configuration information is determined, so that the process of data migration is controlled, thereby improving the reliability of data migration.

[0042] Step S103 , performing data migration on the business data corresponding to the object to be migrated, so as to migrate the business data corresponding to the object to be migrated from the first database to the second database, wherein the version of the first business system corresponding to the first database is lower than the version of the second business system corresponding to the second database.

[0043] Optionally, after obtaining the business data corresponding to the object to be migrated, data migration can be started, that is, data migration is performed on the business data corresponding to the object to be migrated, so as to migrate the business data corresponding to the object to be migrated from the first database to the second database, wherein the first database can be a database corresponding to the old business system (i.e., the first business system), and the second database can be a database corresponding to the new business system (i.e., the second business system).

[0044] Based on the scheme defined by the above steps S101 to S103, it can be known that in an embodiment of the present invention, a method of controlling the progress of data migration through configuration information is adopted. First, multiple configuration information is obtained, wherein each configuration information corresponds to a different dimension, and the configuration information is used to control the progress of data migration; the object to be migrated corresponding to each configuration information is determined, and the business data corresponding to the object to be migrated is obtained; data migration is performed on the business data corresponding to the object to be migrated, so as to migrate the business data corresponding to the object to be migrated from the first database to the second database, wherein the version of the first business system corresponding to the first database is lower than the version of the second business system corresponding to the second database.

[0045] It is easy to notice that in the above process, by obtaining multiple configuration information and determining the objects to be migrated corresponding to each configuration information, the speed of data migration can be controlled from multiple dimensions. When the functions of the new business system are not fully verified, the progress of data migration can be controlled, thereby effectively improving the reliability of data migration and reducing the risk of data migration.

[0046] It can be seen that through the technical solution of the present invention, the purpose of improving the reliability of data migration is achieved, thereby realizing the technical effect of controlling the progress of data migration from multiple dimensions, and further solving the technical problem in the prior art that the progress of data migration cannot be controlled when migrating data between databases.

[0047] In an optional embodiment, it is possible to use Figure 2 , Figure 3 The schematic diagram shown in the figure realizes data migration. Figure 2 is a schematic diagram of an optional data migration process according to an embodiment of the present invention. Figure 3 is a simplified flow chart of an optional data migration process according to an embodiment of the present invention, such as Figure 2 As shown, the detailed process of the whole scheme is shown, where S01-S04 corresponds to Figure 3 P01-P02 of the system is the preparation work before data migration; S05-S13 corresponds to Figure 3 P03-P05 is the core work process of data migration. Specifically, first develop a new business system, create a data table corresponding to the old system, initialize the configuration information of the migration progress, and use it to control the speed of migration in the later stage, and migrate according to the expected users. Then initialize the migration process table to record the migrated users, and then migrate according to the migration configuration information. The configuration information can be changed in real time. According to the configuration content, migration can be realized according to the dimensions of user ID, number of users, and user percentage. When all users are migrated, it ends.

[0048] Alternatively, if Figure 2 As shown in the figure, data migration mainly includes the following steps:

[0049] (1) S01 develops a new business system that corresponds to the functions of the old business system and defines the data table structure of the new system. For example, the old business system is system A and the new business system is system B.

[0050] (2) S02 determines the business and data conversion relationship between the new and old systems and implements it accordingly. For example, the business and data conversion relationship between system A and system B is analyzed and the conversion is implemented accordingly, for example, the data migration system is system C.

[0051] (3) S03 initializes the migration progress configuration information. For example, in the C system, the configuration information of the migration progress is initialized, and the configuration information includes the grayscale routing switch (switch), the grayscale routing mode (mode), and the grayscale routing value (value). For example, the configuration information is {"switch":"OFF","mode":"","value":""}, which means that the grayscale is not turned on, that is, the data migration has not started.

[0052] (4) S04 Initialize the migration process table, which is a table created to record the migrated users and includes at least field information such as user ID, migration mode, and migration status.

[0053] (5) S05 migrates data according to the migration configuration information. For example, modify the grayscale configuration in system C, migrate according to the user ID dimension, configure 1-5 user IDs, for example, {"switch":"ON","mode":"BY_ID","value":"user ID1, user ID2"}, and start migrating the business data corresponding to the specified users (i.e. user ID1 and user ID2). In the early stage, migrate a small number of users to verify the compatibility of system B.

[0054] (6) S06 and S08, during the migration process, query the migration process table to check whether the data has been migrated. If the data already exists in the table, it means that it has been migrated, and the user is skipped.

[0055] (7) S06 and S07, if the data does not exist in the table, migrate the data from system A to system B through system C.

[0056] (8) S09 If the migration fails, an exception will be triggered and the data will be rolled back. For example, try{ / / normal migration process}catch(Exception e){ / / rollback data process}, and the exception handling process in catch will be entered. In this process, the business data that has been migrated by the abnormal user will be deleted from system B.

[0057] (9) S10 If the migration is successful, the migrated data is recorded in the migration process table, for example, the ID of the successfully migrated user is recorded in the migration record table, indicating that the migration has been completed. After the migration is successful, the relevant business of the user will be executed in the B system.

[0058] (10) S11 Change the migration configuration and replace the migration strategy. For example, if a portion of users have been migrated through user IDs and it has been verified that there are no business anomalies in system B, the migration configuration table can be changed in real time. For example, {"switch":"ON","mode":"BY_QUANTITY","value":"100"} means that the first 100 users among the remaining users under grayscale control are migrated to system B. Repeat the above steps (5)-(9). When it is detected that it is the 101st user, it will not be migrated.

[0059] (11) If no business anomalies occur after verification of the users migrated to system B by number in (10), the migration configuration table can be modified in real time to be based on the dimension of user percentage. For example, {"switch":"ON","mode":"BY_PERCENTAGE","value":"10"} means that 10% of the remaining users are migrated to system B. After that, the value can be gradually changed to increase the proportion of migrated users, and the above steps (5)-(9) can be repeated.

[0060] (12) S12 data consistency check. From grayscale user ID to user number, and finally to user ratio, it is a process of increasing the number of users, realizing the control of migration speed from different dimensions, while controlling the business risks of system B. When the final grayscale configuration ratio is 100, it means that 100% of users have been migrated. After 100% of users have been migrated, observe for a period of time to verify the data consistency of system A and system B. If the verification passes, the migration is completed.

[0061] Figure 4 is a schematic diagram of an optional grayscale solution for data migration according to an embodiment of the present invention, such as Figure 4As shown in the figure, when the grayscale routing switch (switch) is OFF, the grayscale is not turned on, that is, no grayscale; when the grayscale routing switch (switch) is ON, the current dimension is determined according to the value of the grayscale routing mode (mode). For example, when the grayscale routing mode (mode) is BY_ID, it means migration according to the user ID dimension. By judging whether the IDs are equal, users with equal IDs are determined from multiple users as users to be migrated, that is, participating in grayscale, and migrating the users to be migrated to the new business system; when the grayscale routing mode (mode) is BY_QUANTITY, it means Migrate according to the dimension of user quantity. By judging whether the number of users is sufficient, it can be determined whether to perform grayscale. If the number is sufficient, users to be migrated who meet the quantity requirements can be determined from multiple users, that is, participate in grayscale, and migrate the users to be migrated to the new business system; when the grayscale routing mode (mode) is BY_PERCENTAGE, it means migrating according to the dimension of user percentage. By judging whether the proportion is sufficient, it can be determined whether to perform grayscale. If it is sufficient, users to be migrated who meet the proportion requirements can be determined from multiple users, that is, participate in grayscale, and migrate the users to be migrated to the new business system.

[0062] In an optional embodiment, the configuration information includes first configuration information, the migration mode contained in the first configuration information is an ID-based migration mode, and the target value contained in the first configuration information is the ID of the object to be migrated, wherein the object to be migrated corresponding to each configuration information is determined based on the migration mode and the target value contained in each configuration information, including: if the configuration information is the first configuration information, then based on the ID-based migration mode and the ID of the object to be migrated, the object to be migrated corresponding to the first configuration information is determined from multiple IDs in the first database.

[0063] Optionally, in the process of determining the object to be migrated corresponding to each configuration information according to the migration mode and target value contained in each configuration information, if the configuration information is the first configuration information, the object to be migrated corresponding to the first configuration information is determined from multiple IDs in the first database according to the ID-based migration mode and the ID of the object to be migrated. For example, if the first configuration information is {"switch":"ON","mode":"BY_ID","value":"user ID1, user ID2"}, users with the same ID as user ID1 and user ID2 can be found from the database corresponding to the old business system as the corresponding users to be migrated in the BY_ID mode.

[0064] In an optional embodiment, the configuration information includes second configuration information, the migration mode contained in the second configuration information is a mode based on quantity migration, and the target value contained in the second configuration information is the number of objects to be migrated, wherein the objects to be migrated corresponding to each configuration information are determined based on the migration mode and the target value contained in each configuration information, including: if the configuration information is the second configuration information, then based on the mode based on quantity migration and the number of objects to be migrated, the objects to be migrated corresponding to the second configuration information are determined from objects in the first database other than the objects to be migrated corresponding to the first configuration information.

[0065] Optionally, in the process of determining the objects to be migrated corresponding to each configuration information according to the migration mode and target value contained in each configuration information, if the configuration information is the second configuration information, then the objects to be migrated corresponding to the second configuration information are determined from the objects in the first database other than the objects to be migrated corresponding to the first configuration information according to the mode based on quantity migration and the number of objects to be migrated. For example, if the second configuration information is {"switch":"ON","mode":"BY_QUANTITY","value":"100"}, the first 100 users among the remaining users of the database corresponding to the old business system can be used as the users to be migrated corresponding to the BY_QUANTITY mode.

[0066] In an optional embodiment, the configuration information includes third configuration information, the migration mode contained in the third configuration information is a mode based on percentage migration, and the target value contained in the third configuration information is the proportion of objects to be migrated, wherein the objects to be migrated corresponding to each configuration information are determined based on the migration mode and the target value contained in each configuration information, including: if the configuration information is the third configuration information, then based on the mode based on percentage migration and the proportion of objects to be migrated, determining the objects to be migrated corresponding to the third configuration information from objects in the first database other than the objects to be migrated corresponding to the first configuration information and the objects to be migrated corresponding to the second configuration information.

[0067] Optionally, in the process of determining the objects to be migrated corresponding to each configuration information according to the migration mode and target value contained in each configuration information, if the configuration information is the third configuration information, then according to the mode based on percentage migration and the proportion of the objects to be migrated, the objects to be migrated corresponding to the third configuration information are determined from the objects in the first database except the objects to be migrated corresponding to the first configuration information and the objects to be migrated corresponding to the second configuration information. For example, if the third configuration information is {"switch":"ON","mode":"BY_PERCENTAGE","value":"10"}, 10% of the remaining users of the database corresponding to the old business system can be used as the users to be migrated corresponding to the BY_PERCENTAGE mode.

[0068] In an optional embodiment, data migration is performed on business data corresponding to an object to be migrated, including: migrating business data corresponding to the object to be migrated corresponding to the first configuration information from a first database to a second database based on first configuration information, so as to provide a first business service for the object to be migrated corresponding to the first configuration information based on a second business system; in the case where migration success is detected, judging whether there is an abnormality in the first business service provided by the second business system, and obtaining a first judgment result; if the first judgment result indicates that there is no abnormality in the first business service, migrating business data corresponding to the object to be migrated corresponding to the second configuration information from the first database to the second database based on the second configuration information, so as to provide a second business service for the object to be migrated corresponding to the second configuration information based on the second business system; in the case where migration success is detected, judging whether there is an abnormality in the second business service provided by the second business system, and obtaining a second judgment result; if the second judgment result indicates that there is no abnormality in the second business service, migrating business data corresponding to the object to be migrated corresponding to the third configuration information from the first database to the second database based on third configuration information, so as to provide a third business service for the object to be migrated corresponding to the third configuration information based on the second business system.

[0069] Optionally, in the process of migrating business data corresponding to the object to be migrated, first, based on the first configuration information, the business data corresponding to the object to be migrated corresponding to the first configuration information is migrated from the first database to the second database, so as to provide the first business service for the object to be migrated corresponding to the first configuration information based on the second business system. For example, first, the business data corresponding to the user to be migrated under the BY_ID mode is migrated from the database corresponding to the old business system to the database corresponding to the new business system. After the migration is successful, the relevant business of these users (i.e., the first business service) will be executed in the new business system to verify the compatibility of the new business system.

[0070] Optionally, when the migration is detected to be successful, it is determined whether there is an abnormality in the first business service provided by the second business system, and a first judgment result is obtained. If the first judgment result indicates that there is no abnormality in the first business service, then the business data corresponding to the object to be migrated corresponding to the second configuration information is migrated from the first database to the second database according to the second configuration information, so as to provide the second business service for the object to be migrated corresponding to the second configuration information according to the second business system. For example, if a part of users have been migrated through user IDs, and it is verified that there are no business abnormalities in the new business system, then the corresponding users to be migrated in the BY_QUANTITY mode are migrated from the database corresponding to the old business system to the database corresponding to the new business system. After the migration is successful, the relevant businesses of these users (i.e., the second business services) will be executed in the new business system to verify the compatibility of the new business system.

[0071] Optionally, when the migration is detected to be successful, it is determined whether there is an abnormality in the second business service provided by the second business system, and a second judgment result is obtained. If the second judgment result indicates that there is no abnormality in the second business service, then the business data corresponding to the object to be migrated corresponding to the third configuration information is migrated from the first database to the second database according to the third configuration information, so as to provide the third business service for the object to be migrated corresponding to the third configuration information according to the second business system. For example, if the migrated users are verified to have no business abnormalities in the new business system, the corresponding users to be migrated in the BY_PERCENTAGE mode will continue to be migrated from the database corresponding to the old business system to the database corresponding to the new business system. After the migration is successful, the relevant businesses of these users (i.e., the third business service) will be executed in the new business system, and then the value can be gradually changed to increase the proportion of migrated users until 100% of the users are migrated.

[0072] It should be noted that the process from grayscale user ID to the number of users and finally to the user ratio is a process with an increasing number of users. It realizes the control of the speed of data migration from multiple dimensions and the control of the progress of data migration when the functions of the new business system are not fully verified, thereby effectively improving the reliability of data migration and reducing the risk of data migration.

[0073] In an optional embodiment, after data migration is performed on the business data corresponding to the migration object, data consistency verification is performed on the first business system and the second business system to obtain a verification result; if the verification result indicates that the verification is passed, it is determined that the data migration is completed.

[0074] Optionally, from the grayscale user ID to the number of users, and finally by the user ratio, it is a process of increasing the number of users, which realizes the control of the speed of migration from different dimensions, while controlling the business risks of system B. When the final grayscale configuration ratio is 100, it means 100% user migration. After 100% of the users are migrated, observe for a period of time to verify the data consistency between system A and system B. If the verification passes, the migration is completed. Therefore, after the business data corresponding to the migration object is migrated, the first business system (ie, the old business system) and the second business system (ie, the new business system) are verified for data consistency to obtain the verification result. If the verification result indicates that the verification passes, it is determined that the data migration is complete.

[0075] In an embodiment of the present invention, a method of controlling the progress of data migration through configuration information is adopted. First, multiple configuration information is obtained, wherein each configuration information corresponds to a different dimension, and the configuration information is used to control the progress of data migration; the object to be migrated corresponding to each configuration information is determined, and the business data corresponding to the object to be migrated is obtained; data migration is performed on the business data corresponding to the object to be migrated, so as to migrate the business data corresponding to the object to be migrated from the first database to the second database, wherein the version of the first business system corresponding to the first database is lower than the version of the second business system corresponding to the second database.

[0076] In the above process, by obtaining multiple configuration information and determining the objects to be migrated corresponding to each configuration information, the speed of data migration can be controlled from multiple dimensions. When the functions of the new business system are not fully verified, the progress of data migration can be controlled, thereby effectively improving the reliability of data migration and reducing the risk of data migration.

[0077] It can be seen that through the technical solution of the present invention, the purpose of improving the reliability of data migration is achieved, thereby realizing the technical effect of controlling the progress of data migration from multiple dimensions, and further solving the technical problem in the prior art that the progress of data migration cannot be controlled when migrating data between databases.

[0078] Example 2

[0079] According to an embodiment of the present invention, an embodiment of a data migration device is provided, wherein: Figure 5 is a schematic diagram of an optional data migration device according to an embodiment of the present invention. Figure 5 As shown, the device includes: an acquisition unit 501, used to acquire multiple configuration information, wherein each configuration information corresponds to a different dimension, and the configuration information is used to control the progress of data migration; a first determination unit 502, used to determine the object to be migrated corresponding to each configuration information, and acquire the business data corresponding to the object to be migrated; a first processing unit 503, used to perform data migration on the business data corresponding to the object to be migrated, so as to migrate the business data corresponding to the object to be migrated from the first database to the second database, wherein the version of the first business system corresponding to the first database is lower than the version of the second business system corresponding to the second database.

[0080] It should be noted that the above-mentioned acquisition unit 501, first determination unit 502 and first processing unit 503 correspond to steps S101 to S103 in the above-mentioned embodiment, and the examples and application scenarios implemented by the three units and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.

[0081] Optionally, the first determination unit includes: a determination subunit, used to determine the object to be migrated corresponding to each configuration information based on the migration mode and target value contained in each configuration information, wherein the migration mode is used to indicate the migration method of the business data corresponding to the object to be migrated, and the target value is used to determine the number of objects to be migrated.

[0082] Optionally, the configuration information includes first configuration information, the migration mode contained in the first configuration information is an ID-based migration mode, and the target value contained in the first configuration information is the ID of the object to be migrated, wherein the determination subunit includes: a first determination module, which is used to determine the object to be migrated corresponding to the first configuration information from multiple IDs in the first database based on the ID-based migration mode and the ID of the object to be migrated if the configuration information is the first configuration information.

[0083] Optionally, the configuration information includes second configuration information, the migration mode contained in the second configuration information is a mode based on quantity migration, and the target value contained in the second configuration information is the number of objects to be migrated, wherein the determination subunit includes: a second determination module, which is used to determine the objects to be migrated corresponding to the second configuration information from the objects in the first database other than the objects to be migrated corresponding to the first configuration information, based on the mode based on quantity migration and the number of objects to be migrated if the configuration information is the second configuration information.

[0084] Optionally, the configuration information includes third configuration information, the migration mode contained in the third configuration information is a mode based on percentage migration, and the target value contained in the third configuration information is the proportion of objects to be migrated, wherein the determination subunit includes: a third determination module, which is used to determine, if the configuration information is the third configuration information, the objects to be migrated corresponding to the third configuration information from the objects in the first database other than the objects to be migrated corresponding to the first configuration information and the objects to be migrated corresponding to the second configuration information, based on the mode based on percentage migration and the proportion of objects to be migrated.

[0085] Optionally, the first processing unit includes: a first processing sub-unit, which is used to migrate the business data corresponding to the object to be migrated corresponding to the first configuration information from the first database to the second database according to the first configuration information, so as to provide the first business service for the object to be migrated corresponding to the first configuration information according to the second business system; a second processing sub-unit, which is used to determine whether there is an abnormality in the first business service provided by the second business system when the migration is detected to be successful, and obtain a first judgment result; a third processing sub-unit, which is used to migrate the business data corresponding to the object to be migrated corresponding to the second configuration information from the first database to the second database according to the second configuration information if the first judgment result indicates that there is no abnormality in the first business service, so as to provide the second business service for the object to be migrated corresponding to the second configuration information according to the second business system; a fourth processing sub-unit, which is used to determine whether there is an abnormality in the second business service provided by the second business system when the migration is detected to be successful, and obtain a second judgment result; a fifth processing sub-unit, which is used to migrate the business data corresponding to the object to be migrated corresponding to the third configuration information from the first database to the second database according to the third configuration information if the second judgment result indicates that there is no abnormality in the second business service, so as to provide the third business service for the object to be migrated corresponding to the third configuration information according to the second business system.

[0086] Optionally, the data migration device also includes: a second processing unit, used to perform data consistency verification on the first business system and the second business system after migrating the business data corresponding to the migration object to obtain a verification result; and a second determination unit, used to determine that the data migration is completed if the verification result indicates that the verification is passed.

[0087] Example 3

[0088] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and the computer program implements the above-mentioned data migration method when executed by a processor.

[0089] Example 4

[0090] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned data migration method when it is run.

[0091] Example 5

[0092] According to another aspect of an embodiment of the present invention, an electronic device is provided, wherein: Figure 6 is a schematic diagram of an optional electronic device according to an embodiment of the present invention, such as Figure 6As shown, the electronic device includes one or more processors; a memory for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors are used to run the programs, wherein the programs are set to execute the above-mentioned data migration method when running. When the processor executes the program, the following steps are implemented: obtaining multiple configuration information, wherein each configuration information corresponds to a different dimension, and the configuration information is used to control the progress of data migration; determining the object to be migrated corresponding to each configuration information, and obtaining the business data corresponding to the object to be migrated; performing data migration on the business data corresponding to the object to be migrated, so as to migrate the business data corresponding to the object to be migrated from the first database to the second database, wherein the version of the first business system corresponding to the first database is lower than the version of the second business system corresponding to the second database.

[0093] Optionally, when the processor executes the program, the following steps are also implemented: determining the object to be migrated corresponding to each configuration information based on the migration mode and target value contained in each configuration information, wherein the migration mode is used to indicate the migration method of the business data corresponding to the object to be migrated, and the target value is used to determine the number of objects to be migrated.

[0094] Optionally, when the processor executes the program, the following steps are further implemented: if the configuration information is first configuration information, determining the object to be migrated corresponding to the first configuration information from multiple IDs in the first database according to the ID-based migration mode and the ID of the object to be migrated.

[0095] Optionally, when the processor executes the program, the following steps are further implemented: if the configuration information is the second configuration information, then based on the quantity-based migration mode and the number of objects to be migrated, the objects to be migrated corresponding to the second configuration information are determined from the objects in the first database except the objects to be migrated corresponding to the first configuration information.

[0096] Optionally, when the processor executes the program, the following steps are also implemented: if the configuration information is third configuration information, then based on the percentage-based migration mode and the proportion of objects to be migrated, the objects to be migrated corresponding to the third configuration information are determined from the objects in the first database except the objects to be migrated corresponding to the first configuration information and the objects to be migrated corresponding to the second configuration information.

[0097] Optionally, when the processor executes the program, the following steps are also implemented: based on the first configuration information, the business data corresponding to the object to be migrated corresponding to the first configuration information is migrated from the first database to the second database, so as to provide the first business service for the object to be migrated corresponding to the first configuration information based on the second business system; when the migration is detected to be successful, it is judged whether there is an abnormality in the first business service provided by the second business system to obtain a first judgment result; if the first judgment result indicates that there is no abnormality in the first business service, then based on the second configuration information, the business data corresponding to the object to be migrated corresponding to the second configuration information is migrated from the first database to the second database, so as to provide the second business service for the object to be migrated corresponding to the second configuration information based on the second business system; when the migration is detected to be successful, it is judged whether there is an abnormality in the second business service provided by the second business system to obtain a second judgment result; if the second judgment result indicates that there is no abnormality in the second business service, then based on the third configuration information, the business data corresponding to the object to be migrated corresponding to the third configuration information is migrated from the first database to the second database, so as to provide the third business service for the object to be migrated corresponding to the third configuration information based on the second business system.

[0098] Optionally, when the processor executes the program, the following steps are also implemented: after performing data migration on the business data corresponding to the migration object, performing data consistency verification on the first business system and the second business system to obtain a verification result; if the verification result indicates that the verification is passed, it is determined that the data migration is completed.

[0099] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0100] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0101] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0102] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0104] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0105] If the integrated unit is implemented in the form of 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 the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0106] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A data migration method, characterized in that: include: Acquire multiple pieces of configuration information, where each piece of configuration information corresponds to a different dimension, and the configuration information is used to control the progress of data migration; Determine the object to be migrated corresponding to each configuration information, and obtain the business data corresponding to the object to be migrated; Data migration is performed on the business data corresponding to the object to be migrated, so as to migrate the business data corresponding to the object to be migrated from the first database to the second database, wherein the version of the first business system corresponding to the first database is lower than the version of the second business system corresponding to the second database.

2. The method according to claim 1, characterized in that Determining the object to be migrated corresponding to each configuration information includes: According to the migration mode and target value included in each configuration information, the objects to be migrated corresponding to each configuration information are determined, wherein the migration mode is used to indicate a migration method for the business data corresponding to the objects to be migrated, and the target value is used to determine the number of the objects to be migrated.

3. The method according to claim 2, characterized in that The configuration information includes first configuration information, wherein the migration mode included in the first configuration information is an ID-based migration mode, and the target value included in the first configuration information is an ID of an object to be migrated, wherein determining the object to be migrated corresponding to each configuration information according to the migration mode and the target value included in each configuration information includes: If the configuration information is the first configuration information, the object to be migrated corresponding to the first configuration information is determined from a plurality of IDs in the first database according to the ID-based migration mode and the ID of the object to be migrated.

4. The method according to claim 3, characterized in that The configuration information includes second configuration information, the migration mode included in the second configuration information is a mode of migration based on quantity, and the target value included in the second configuration information is the number of objects to be migrated, wherein, according to the migration mode and the target value included in each of the configuration information, determining the objects to be migrated corresponding to each of the configuration information includes: If the configuration information is the second configuration information, the objects to be migrated corresponding to the second configuration information are determined from objects in the first database other than the objects to be migrated corresponding to the first configuration information according to the quantity-based migration mode and the number of the objects to be migrated.

5. The method according to claim 4, characterized in that The configuration information includes third configuration information, the migration mode included in the third configuration information is a mode based on percentage migration, and the target value included in the third configuration information is a proportion of objects to be migrated, wherein, according to the migration mode and the target value included in each of the configuration information, determining the objects to be migrated corresponding to each of the configuration information includes: If the configuration information is the third configuration information, then based on the percentage-based migration mode and the proportion of the objects to be migrated, determine the objects to be migrated corresponding to the third configuration information from the objects in the first database except the objects to be migrated corresponding to the first configuration information and the objects to be migrated corresponding to the second configuration information.

6. The method according to claim 5, characterized in that Migrating the business data corresponding to the object to be migrated includes: Migrating the business data corresponding to the object to be migrated corresponding to the first configuration information from the first database to the second database according to the first configuration information, so as to provide a first business service for the object to be migrated corresponding to the first configuration information according to the second business system; In the case where the migration is detected to be successful, determining whether the first business service provided by the second business system is abnormal, and obtaining a first determination result; If the first judgment result indicates that there is no abnormality in the first business service, migrating the business data corresponding to the object to be migrated corresponding to the second configuration information from the first database to the second database according to the second configuration information, so as to provide a second business service for the object to be migrated corresponding to the second configuration information according to the second business system; In the case where the migration is detected to be successful, determining whether the second business service provided by the second business system is abnormal, and obtaining a second determination result; If the second judgment result indicates that there is no abnormality in the second business service, then based on the third configuration information, the business data corresponding to the object to be migrated corresponding to the third configuration information is migrated from the first database to the second database, so as to provide a third business service for the object to be migrated corresponding to the third configuration information based on the second business system.

7. The method according to claim 1, characterized in that After performing data migration on the business data corresponding to the object to be migrated, the method further includes: Performing data consistency verification on the first business system and the second business system to obtain a verification result; If the verification result indicates that the verification is passed, it is determined that the data migration is completed.

8. A data migration device, characterized in that: include: An acquisition unit, used to acquire multiple configuration information, wherein each configuration information corresponds to a different dimension, and the configuration information is used to control the progress of data migration; A first determining unit, configured to determine an object to be migrated corresponding to each piece of configuration information, and to obtain business data corresponding to the object to be migrated; The first processing unit is used to perform data migration on the business data corresponding to the object to be migrated, so as to migrate the business data corresponding to the object to be migrated from the first database to the second database, wherein the version of the first business system corresponding to the first database is lower than the version of the second business system corresponding to the second database.

9. A computer program product, characterized in that The invention comprises a computer program, which implements the data migration method described in any one of claims 1 to 7 when being executed by a processor.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the data migration method described in any one of claims 1 to 7 when running.

11. An electronic device, characterized in that: The electronic device includes one or more processors; A memory for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the data migration method described in any one of claims 1 to 7 when run.