Data migration method, device, equipment and computer program product

By generating and executing a list of tasks to be migrated, one-time migration of dynamic data is achieved, solving the problem of dynamic data migration in the existing technology without stopping user services, and ensuring data accuracy and service continuity.

CN119629232APending Publication Date: 2025-03-14CHINA MERCHANTS BANK
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411694521.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Existing data migration solutions cannot achieve one-time migration of dynamic data without stopping user services.

Method used

By receiving data migration requests, traverse preset dynamic data, generate a list of tasks to be migrated, including the set of tasks to be migrated and the set of tasks not to be migrated, and based on these task lists, migrate the target migration data set from the source server to the target server.

Benefits of technology

It realizes one-time migration of dynamic data, avoids multiple data operations, ensures data accuracy, and does not need to stop user services throughout the process, ensuring service continuity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629232A_ABST
    Figure CN119629232A_ABST
Patent Text Reader

Abstract

The invention discloses a data migration method, device and equipment and a computer program product, and relates to the technical field of data migration, and the method comprises the following steps: receiving a data migration request; according to the data migration request, preset dynamic data are traversed, a target migration data set is obtained, a to-be-migrated task list is generated, and the to-be-migrated task list comprises a to-be-migrated task set and a non-migrated task set; and migrating the target migration data set from the source server to the target server according to the to-be-migrated task list, and generating a data migration result. In the dynamic data migration process, cross-server migration is only needed to be carried out on the dynamic data according to the state of the task, the data only needs to be migrated once, multiple operations on the data are avoided, user services do not need to be stopped in the whole process, and service continuity is guaranteed. Therefore, the problem that in an existing scheme, one-time migration of dynamic data cannot be achieved under the condition that user services are not stopped is solved, the convenience of data migration is improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data migration, and in particular to a data migration method, device, equipment and computer program product. Background Art

[0002] With the transformation of enterprise cloud architecture and the rapid development of business, there is a need to migrate business data. Many business data are dynamic data, such as bank card balances, user limits, etc., which will change with user behavior.

[0003] Currently, several migration solutions are commonly used for dynamic data migration, such as stopping service, double writing of data, and migration retry. However, these solutions have problems such as stopping service, complex judgment logic embedded in the migration process, or multiple migrations. It is impossible to achieve a one-time migration of dynamic data without stopping user services.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present application is to provide a data migration method, device, equipment and computer program product, aiming to solve the technical problem that the existing data migration solutions cannot achieve one-time migration of dynamic data without stopping user services.

[0006] To achieve the above objectives, the present application proposes a data migration method, which includes:

[0007] Receive data migration requests;

[0008] According to the data migration request, traverse preset dynamic data, obtain a target migration data set and generate a task list to be migrated, wherein the task list to be migrated includes a task set to be migrated and a task set not to be migrated;

[0009] According to the to-be-migrated task list, the target migration data set is migrated from the source server to the target server, and a data migration result is generated.

[0010] In one embodiment, the dynamic data includes a plurality of dynamic business data, the target migration data set includes a data set to be migrated and a data set not to be migrated, and the step of traversing preset dynamic data according to the data migration request, obtaining the target migration data set and generating a task list to be migrated includes:

[0011] According to the data migration request, traverse the dynamic data, and generate an initial set of tasks to be migrated based on a preset list of initial tasks to be migrated;

[0012] When it is detected that a user calls any of the dynamic service data, the dynamic service data is used as non-migrated data, and a corresponding first non-migrated task is generated according to the non-migrated data;

[0013] Obtaining the non-migrated data set according to the non-migrated data, and obtaining the non-migrated task set according to the first non-migrated task corresponding to the non-migrated data;

[0014] The data set to be migrated is generated according to the non-migrated data set and the dynamic data, and the task set to be migrated is generated according to the non-migrated task set, the initial task set to be migrated and the data set to be migrated, wherein the data set to be migrated includes several copies of data to be migrated, and each copy of the data to be migrated corresponds to a first task to be migrated in the data set to be migrated.

[0015] In one embodiment, the step of migrating the target migration data set from the source server to the target server according to the list of tasks to be migrated and generating a data migration result includes:

[0016] Migrating the data set to be migrated from the source server to the target server according to the task set to be migrated, and generating a first data migration result;

[0017] Migrating the non-migrated data set from the source server to the target server according to the non-migrated task set, and generating a second data migration result;

[0018] The data migration result is obtained according to the first data migration result and the second data migration result.

[0019] In one embodiment, the step of migrating the data set to be migrated from the source server to the target server according to the task set to be migrated and generating a first data migration result includes:

[0020] S1: Select any data to be migrated in the data set to be migrated as the first target migration data;

[0021] S2: Execute a first task to be migrated corresponding to the first target migration data, migrate the first target migration data from the source server to the target server, and update the task to be migrated from a state to be migrated to a state in progress, thereby obtaining a first task in progress;

[0022] S3: when it is detected that the migration of the first target migration data is completed, updating the first migrating task from a migrating state to a migration successful state, and obtaining a first migration successful task;

[0023] Steps S1 to S3 are repeatedly executed until the data set to be migrated is traversed and the first data migration result is obtained.

[0024] In one embodiment, after generating the task set to be migrated according to the data set to be migrated, the method further includes:

[0025] When it is detected that a user calls any data to be migrated in the data set to be migrated, the first task to be migrated corresponding to the data to be migrated is updated from a state to be migrated to a state not to be migrated, thereby obtaining a second task not to be migrated;

[0026] The step of executing the first task to be migrated corresponding to the first target migration data, migrating the first target migration data from the source server to the target server, and updating the task to be migrated from a state to be migrated to a state in progress, after obtaining the first task in progress, further includes:

[0027] When it is detected that the user calls the first target migration data, the first migrating task is updated from the migrating state to the non-migrating state to obtain a third non-migrating task.

[0028] In one embodiment, the step of migrating the non-migrated data set from the source server to the target server according to the non-migrated task set to generate a second data migration result includes:

[0029] S4: selecting any non-migrated data in the to-be-migrated data set as second target migration data;

[0030] S5: when it is detected that the user has completed calling the second target migration data, the corresponding non-migrated task is updated from a non-migrated state to a to-be-migrated state, thereby obtaining a second to-be-migrated task;

[0031] S6: Execute the second task to be migrated, migrate the second target migration data from the source server to the target server, and update the task to be migrated from a state to be migrated to a state in progress, thereby obtaining a second task in progress;

[0032] S7: when it is detected that the migration of the second target migration data is completed, updating the second migrating task from a migrating state to a migration successful state, and obtaining a second migration successful task;

[0033] Steps S4 to S7 are repeatedly executed until the non-migrated data set is traversed to obtain the second data migration result.

[0034] In one embodiment, when it is detected that the user completes calling the second target migration data, the corresponding non-migration task is updated from the non-migration state to the to-be-migrated state, and after the step of obtaining the second to-be-migration task, the step further includes:

[0035] When it is detected that the user calls the second target migration data, the second task to be migrated is updated from a state to be migrated to a state not to be migrated, so as to obtain a fourth task not to be migrated;

[0036] After the step of executing the second task to be migrated, migrating the second target migration data from the source server to the target server, and updating the task to be migrated from a state to be migrated to a state in progress, and obtaining the second task in progress, the method further includes:

[0037] When it is detected that the user calls the second target migration data, the second migrating task is updated from the migrating state to the non-migrating state to obtain a fifth non-migrating task.

[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a data migration device, the data migration device comprising:

[0039] A request receiving module, used for receiving a data migration request;

[0040] A task generation module, configured to traverse preset dynamic data according to the data migration request, obtain a target migration data set and generate a list of tasks to be migrated, wherein the list of tasks to be migrated includes a set of tasks to be migrated and a set of tasks not to be migrated;

[0041] The data migration module is used to migrate the target migration data set from the source server to the target server according to the task list to be migrated, and generate a data migration result.

[0042] In addition, to achieve the above objectives, the present application also proposes a data migration device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data migration method described above.

[0043] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the data migration method described above are implemented.

[0044] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the data migration method described above are implemented.

[0045] The present application provides a data migration method. During the dynamic data migration process, it is only necessary to migrate the dynamic data across servers according to the status of the task. The data only needs to be migrated once, avoiding multiple operations on the data, ensuring the correctness of the data, and there is no need to stop user services throughout the process, thus ensuring service continuity. Thus, the technical problem that the existing data migration solution cannot achieve one-time migration of dynamic data without stopping user services is solved, the convenience of data migration is improved, and the user experience is enhanced. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0048] Figure 1 A flowchart of the first embodiment of the data migration method of this application is provided;

[0049] Figure 2 A flowchart of the second embodiment of the data migration method of this application is provided;

[0050] Figure 3 A schematic diagram of the overall architecture of the data migration method provided in Embodiment 1 or 2 of the present application;

[0051] Figure 4 A schematic diagram of the migration state flow of the data migration method provided in Embodiment 1 or 2 of the present application;

[0052] Figure 5 A schematic diagram of a real-time decision engine decision analysis flow chart of the data migration method provided in Embodiment 1 or 2 of the present application;

[0053] Figure 6 This is a schematic diagram of the module structure of the data migration device according to an embodiment of the present application;

[0054] Figure 7 A schematic diagram of the device structure of the hardware operating environment involved in the data migration method in the embodiment of the present application.

[0055] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0056] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0057] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0058] The main solutions of the embodiments of this application are:

[0059] Receive data migration requests;

[0060] According to the data migration request, traverse preset dynamic data, obtain a target migration data set and generate a task list to be migrated, wherein the task list to be migrated includes a task set to be migrated and a task set not to be migrated;

[0061] According to the to-be-migrated task list, the target migration data set is migrated from the source server to the target server, and a data migration result is generated.

[0062] In the existing technology, the following migration solutions are usually used for dynamic data migration:

[0063] (1) Service suspension solution: First, stop the service, then perform static data migration, and then resume the service after the migration is completed. The problem with this solution is that before the data migration is completed and the service is resumed, the user cannot be provided with services, which may cause inconvenience and loss to the user, and thus affect the company's reputation.

[0064] (2) Data dual writing solution: First, enable data dual writing (i.e. persist the data on both the source server and the target server), and then perform data migration. During data migration, the data may have been persisted to the target server during the dual writing phase. Therefore, the order of data needs to be determined during the data migration phase to ensure the data correctness of the target server. This solution embeds complex data accuracy judgment logic in the data migration process, which may cause data inconsistency between the target server and the source server.

[0065] (3) Migration retry solution: First migrate the data, then check for inconsistent data, and finally migrate the inconsistent data again. This solution requires multiple or even endless migrations and is only suitable for businesses with low user behavior frequency.

[0066] This application provides a solution. During the dynamic data migration process, dynamic data only needs to be migrated across servers according to the status of the task. The data only needs to be migrated once, avoiding multiple operations on the data, ensuring the correctness of the data, and there is no need to stop user services throughout the process, ensuring service continuity. Therefore, the technical problem that the existing data migration solution cannot achieve one-time migration of dynamic data without stopping user services is solved, the convenience of data migration is improved, and the user experience is enhanced.

[0067] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a data migration system, etc. The following takes the data migration system as an example to illustrate this embodiment and the following embodiments.

[0068] Based on this, the present application embodiment provides a data migration method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the data migration method of the present application.

[0069] In this embodiment, the data migration method includes steps S10 to S30:

[0070] Step S10, receiving a data migration request;

[0071] It should be noted that a data migration request is a command issued by a user or a system, indicating that a data migration operation is required. It serves as a trigger for the migration process and ensures that the system knows when to start the migration.

[0072] Step S20, according to the data migration request, traverse preset dynamic data, obtain a target migration data set and generate a task list to be migrated, the task list to be migrated includes a task set to be migrated and a task set not to be migrated;

[0073] The data migration system traverses preset dynamic data according to the data migration request, identifies and classifies the data to be migrated, obtains the target migration data set and generates a list of tasks to be migrated.

[0074] It should be noted that dynamic data refers to data that changes in real time in the source server, including new data and updated data; the target migration data set is a set of data that is confirmed to be migrated; and the list of tasks to be migrated includes a set of tasks to be migrated and a set of tasks not to be migrated.

[0075] In a feasible implementation manner, the dynamic data includes a plurality of dynamic business data, the target migration data set includes a data set to be migrated and a data set not to be migrated, and step S20 may include steps S201 to S204:

[0076] Step S201, according to the data migration request, traverse the dynamic data, and generate an initial set of tasks to be migrated based on a preset list of initial tasks to be migrated;

[0077] Step S202, when it is detected that a user calls any of the dynamic service data, the dynamic service data is used as non-migrated data, and a corresponding first non-migrated task is generated according to the non-migrated data;

[0078] Step S203, obtaining the non-migrated data set according to the non-migrated data, and obtaining the non-migrated task set according to the first non-migrated task corresponding to the non-migrated data;

[0079] Step S204, generating the data set to be migrated according to the non-migrated data set and the dynamic data, and generating the task set to be migrated according to the non-migrated task set, the initial task set to be migrated and the data set to be migrated, wherein the data set to be migrated includes several copies of data to be migrated, each copy of the data to be migrated corresponds to a first task to be migrated in the data set to be migrated.

[0080] The data migration system traverses the dynamic data according to the data migration request, and generates an initial set of tasks to be migrated based on a preset list of initial tasks to be migrated; when it is detected that a user calls any dynamic business data, the dynamic business data is used as non-migrated data, and a corresponding first non-migrated task is generated according to the non-migrated data; a non-migrated data set is obtained according to the non-migrated data, and a non-migrated task set is obtained according to the first non-migrated task corresponding to the non-migrated data, each non-migrated data will correspond to a first non-migrated task, and the status of these data and the reason for non-migrating are recorded for subsequent review or user decision; a data set to be migrated is generated according to the non-migrated data set and the dynamic data, and the task set to be migrated is described according to the non-migrated task set, the initial set of tasks to be migrated and the data set to be migrated, the data set to be migrated includes several sets of data to be migrated, each set of data to be migrated corresponds to a first task to be migrated in the data set to be migrated, so as to ensure that the task can be clearly mapped to the specific data for subsequent migration operations.

[0081] In this implementation, by dynamically judging the user's call for data, it can ensure that the relevant data is not migrated when the user is active, thereby reducing the interference of migration on the user. By clearly distinguishing between data to be migrated and data not to be migrated, it can give priority to important data, reduce migration time, and improve overall migration efficiency. The clear task set generation and management mechanism reduces data migration failures caused by human errors or misoperations, and improves the success rate of data migration. Dynamic identification and assignment of tasks can ensure that the system remains stable during the migration process, avoiding system crashes or performance degradation caused by data migration. As a result, not only the efficiency of data migration and user experience are optimized, but also the stability of the system and resource utilization are improved.

[0082] Step S30: Migrate the target migration data set from the source server to the target server according to the task list to be migrated, and generate a data migration result.

[0083] The data migration system processes each migration task one by one according to the task order in the task list to be migrated, migrates the target migration data set from the source server to the target server using an appropriate transmission protocol (such as FTP, HTTP, SSH, etc.), and generates data migration results.

[0084] In a feasible implementation, step S30 may include steps S301 to S303:

[0085] Step S301, migrating the data set to be migrated from the source server to the target server according to the task set to be migrated, and generating a first data migration result;

[0086] Step S302, migrating the non-migrated data set from the source server to the target server according to the non-migrated task set, and generating a second data migration result;

[0087] Step S303: Obtain the data migration result according to the first data migration result and the second data migration result.

[0088] The data migration system migrates the data set to be migrated from the source server to the target server according to the task set to be migrated, and generates a first data migration result. Then, according to the task set not to be migrated, the data set not to be migrated is migrated from the source server to the target server, and generates a second data migration result. Finally, the data migration result is obtained according to the first data migration result and the second data migration result.

[0089] In this implementation, the data to be migrated and the data not to be migrated are processed separately, and important data can be processed first, which significantly improves the overall efficiency of migration and reduces unnecessary migration work. During the migration process, the user's access to the data not to be migrated is not affected, which improves the user experience and avoids the degradation of system performance due to data migration. By clearly distinguishing and processing the data sets to be migrated and those not to be migrated, the risk of data migration errors caused by confusion or misoperation is reduced, and the accuracy of the migration results is ensured. After the migration results are generated separately, data verification and comparison can be conveniently performed to ensure the consistency of the data on the target server with the source server, which is convenient for subsequent data maintenance and management. As a result, not only the efficiency and accuracy of data migration are improved, but also the use of system resources is optimized, the impact on users is reduced, and the common technical defects in traditional data migration such as data loss, low migration efficiency and poor user experience are solved, providing reliable protection for enterprises when performing data migration.

[0090] This embodiment provides a data migration method. During the dynamic data migration process, dynamic data only needs to be migrated across servers according to the status of the task. The data only needs to be migrated once, avoiding multiple operations on the data, ensuring the correctness of the data, and there is no need to stop user services throughout the process, ensuring service continuity. Therefore, the technical problem that the existing data migration solution cannot achieve one-time migration of dynamic data without stopping user services is solved, the convenience of data migration is improved, and the user experience is enhanced.

[0091] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 2 , step S301 also includes steps S3011 to S3014:

[0092] Step S3011, selecting any data to be migrated in the data set to be migrated as the first target migration data;

[0093] Step S3012, executing a first task to be migrated corresponding to the first target migration data, migrating the first target migration data from the source server to the target server, and updating the task to be migrated from a state to be migrated to a state in progress, thereby obtaining a first task in progress;

[0094] Step S3013: when it is detected that the migration of the first target migration data is completed, the first migrating task is updated from the migrating state to the migration successful state, and a first migration successful task is obtained;

[0095] Step S3014, repeating steps S3011-S3013 until the data set to be migrated is traversed to obtain the first data migration result.

[0096] The data migration system selects any data to be migrated in the data set to be migrated as the first target migration data, executes the first task to be migrated corresponding to the first target migration data, migrates the first target migration data from the source server to the target server, and updates the task to be migrated from the state to be migrated to the migrating state to obtain the first migrating task; when it is detected that the migration of the first target migration data is completed, the first migrating task is updated from the migrating state to the migration success state to obtain the first migration success task; finally, steps S3011-S3013 are repeated until the data set to be migrated is traversed and the first data migration result is obtained.

[0097] In a feasible implementation manner, after step S202, step S401 may also be included:

[0098] Step S401, when it is detected that a user calls any data to be migrated in the data set to be migrated, the first task to be migrated corresponding to the data to be migrated is updated from a state to be migrated to a state not to be migrated, thereby obtaining a second task not to be migrated;

[0099] After step S3012, step S402 may also be included:

[0100] Step S402: when it is detected that the user calls the first target migration data, the first migrating task is updated from the migrating state to the non-migrating state to obtain a third non-migrating task.

[0101] When it is detected that a user calls any data to be migrated in the data set to be migrated, the data migration system updates the first task to be migrated corresponding to the data to be migrated from the state to be migrated to the state not to be migrated, and obtains a second task not to be migrated. In addition, when it is detected that a user calls the first target migration data, the system updates the first migrating task from the state to be migrated to the state not to be migrated, and obtains a third task not to be migrated.

[0102] In this embodiment, when the user calls the data to be migrated or the target migration data, the migration plan can be adjusted in real time. The system can automatically identify these calls and update the status of the relevant tasks to non-migration accordingly, providing a high degree of flexibility. During the migration process, if some data or targets no longer need to be migrated, timely updating to the non-migration status can effectively avoid the waste of system resources and improve the overall resource utilization efficiency. When the user needs to change the use status of the data during the migration process, by updating the task to non-migration, the inconsistency problem caused by the use of data during the migration process can be avoided, ensuring the consistency and reliability of the data. After clearly marking the tasks that are not to be migrated, the subsequent task scheduling and management becomes simpler, and the system can easily filter out the migration tasks that need to be executed, thereby improving the efficiency of task scheduling. As a result, the system can achieve more flexible and user-friendly data migration management, enhance the ability to respond to user needs, reduce resource waste and data inconsistency risks, and further improve the overall efficiency and reliability of the migration process.

[0103] In another feasible implementation, step S302 may include steps S3021 to S3025:

[0104] Step S3021, selecting any non-migrated data in the to-be-migrated data set as second target migration data;

[0105] Step S3022, when it is detected that the user has completed calling the second target migration data, the corresponding non-migrated task is updated from the non-migrated state to the to-be-migrated state, and a second to-be-migrated task is obtained;

[0106] Step S3023, executing the second task to be migrated, migrating the second target migration data from the source server to the target server, and updating the task to be migrated from a state to be migrated to a state in progress, thereby obtaining a second task in progress;

[0107] Step S3024: when it is detected that the migration of the second target migration data is completed, the second migrating task is updated from the migrating state to the migration successful state, and a second migration successful task is obtained;

[0108] Step S3025, repeating steps S3021-S30214 until the non-migrated data set is traversed to obtain the second data migration result.

[0109] The data migration system selects any non-migrated data in the to-be-migrated data set as the second target migration data; when it is detected that the user has completed calling the second target migration data, the corresponding non-migrated task is updated from the non-migrated state to the to-be-migrated state, and the second to-be-migrated task is obtained, the second to-be-migrated task is executed, the second target migration data is migrated from the source server to the target server, and the to-be-migrated task is updated from the to-be-migrated state to the migrating state, and the second migrating task is obtained; when it is detected that the migration of the second target migration data is completed, the second migrating task is updated from the migrating state to the migration success state, and the second migration success task is obtained, and finally steps S3021-S30214 are repeated until the non-migrated data set is traversed and the second data migration result is obtained.

[0110] In this embodiment, during the data migration process, the user may need to change the data set to be migrated. The system can quickly respond to these changes by updating the task status in real time, avoiding migration errors caused by changes in demand. By dynamically managing the data that is not to be migrated, the system can prevent conflicts caused by changes in data status during the migration process, ensure the smoothness of the migration process, and allow users to selectively migrate specific data, reducing the processing of data that no longer needs to be migrated, thereby improving overall efficiency and reducing system burden. By repeatedly executing steps S3021 to S3025, the system can systematically traverse all non-migrated data to ensure that each data set can be effectively processed, thereby achieving comprehensive data migration goals. Through refined task management, the system can maintain data consistency and integrity during the data migration process, reducing the risk of data loss and errors. As a result, the system not only achieves flexible and efficient data migration management, but also enhances user participation, improves resource utilization and the reliability of data management, and thus provides a more robust solution in a complex data migration environment.

[0111] In another feasible implementation, step S3022 may include step S403:

[0112] Step S403: when it is detected that the user calls the second target migration data, the second task to be migrated is updated from the state to be migrated to the state not to be migrated, and a fourth task not to be migrated is obtained;

[0113] After step S3024, step S404 may also be included:

[0114] Step S404: when it is detected that the user calls the second target migration data, the second migrating task is updated from the migrating state to the non-migrating state, to obtain a fifth non-migrating task.

[0115] When it is detected that the user calls the second target migration data, the data migration system updates the second task to be migrated from the to-be-migrated state to the non-migrated state, and obtains the fourth non-migrated task. In addition, when it is detected that the user calls the second target migration data, the system updates the second migrating task from the migrating state to the non-migrated state, and obtains the fifth non-migrated task.

[0116] In this implementation, by timely updating the task status, the system can effectively reduce the data conflicts that may occur during the data migration process. Dynamically adjusting the task status helps to ensure the smoothness of the migration process, avoid unnecessary migration operations, save time and resources, and ensure that the status of the migration task is always consistent with the user's needs on the basis of dynamic task management, maintaining the consistency and integrity of the data. As a result, the data migration system achieves higher flexibility and control, allowing users to efficiently manage data migration in complex environments, significantly improving the practicality and reliability of the system.

[0117] In this embodiment, the target data to be migrated can be verified one by one after each migration to ensure that the migrated data is complete and consistent, reduce data loss or damage that may be caused by batch migration, and if a problem occurs when migrating a certain data, only the migration of the single data can be retried without restarting the entire migration process, which significantly improves the recovery capability of the system. By migrating in batches, it is possible to avoid excessive load on the system during peak hours, thereby maintaining the stability and performance of the system and ensuring that user operations are not affected. The gradual migration can also be adjusted according to the current use of system resources, reasonably arrange migration tasks, optimize resource utilization, and reduce interference with other businesses. Feedback can be provided after each step is completed. If it is found that a certain part of the migration is inefficient or has problems, the strategy can be adjusted in time to improve the overall migration efficiency. As a result, the system can achieve efficient and reliable data migration, improve the controllability and flexibility of the migration process, and solve technical problems in many aspects such as data integrity, system load and fault recovery, providing a solid foundation for data migration and ensuring the smooth completion of the migration work.

[0118] For example, to help understand the implementation process of the data migration method obtained by combining the first embodiment, the second embodiment and the third embodiment, please refer to Figure 3 , Figure 4 and Figure 5 , Figure 3 This is a schematic diagram of the overall architecture of the data migration method provided in Embodiment 1 or 2 of the present application. Figure 4 A schematic diagram of the migration state flow of the data migration method provided in Embodiment 1 or 2 of the present application, Figure 5 A schematic diagram of a real-time decision engine decision analysis flow chart of the data migration method provided in Embodiment 1 or 2 of the present application, specifically:

[0119] Dynamic data changes with user behavior. The probability that users are operating the data when it is being migrated is very small, so most of the data is the same before and after the migration. Only a small part of the data is being operated by users during the migration process. You only need to identify this data and not migrate it for the time being. Then migrate the non-migrated data again later until all migration is completed.

[0120] The overall architecture is as follows Figure 3 As shown, it can be divided into four modules from the functional point of view: migration requirement module, business layer module, real-time decision engine, and migration execution module.

[0121] This embodiment is based on the migration task of dynamic data one by one. The task has four states: pending migration state, migrating state, not migrating state, and successful migration state. The state flow is as follows: Figure 4 shown.

[0122] (1) Migration requirements module.

[0123] The responsibility of the migration requirement module is to traverse all dynamic data to be migrated, generate tasks to be migrated one by one, and form a complete set of initial tasks to be migrated.

[0124] (2) Business layer module.

[0125] When data changes, the business layer only needs to call the real-time decision engine to analyze whether the changed data needs to be persisted to the target server; if the result returned by the real-time decision engine is that it needs to be persisted to the target server, the business layer will persist the changed data to the target server after completing the data change; if the result returned by the real-time decision engine is that it does not need to be persisted to the target server, the business layer does not need to take additional steps after the data is changed.

[0126] The business layer only needs to determine whether to persist the changed data to the target server based on the analysis results of the real-time decision engine, which neither affects the business process nor ensures the correctness of the target server data.

[0127] (3) Real-time decision engine.

[0128] The responsibility of the real-time decision engine is to make decisions based on the status of task execution and update the status of task execution.

[0129] After the real-time decision engine receives the decision request from the business layer, its decision process is as follows: Figure 5 As shown:

[0130] The task is in the pending migration state: updated to the non-migration state, and the decision result is that the changed data does not need to be persisted to the target server.

[0131] The task is in the migrating state: Update to the non-migrating state, and the decision result is that the changed data does not need to be persisted to the target server.

[0132] The task is in the non-migration state: the state remains unchanged, and the decision result is that the changed data does not need to be persisted to the target server.

[0133] The task is in the successful migration state: the state remains unchanged, and the decision result is that the changed data needs to be persisted to the target server.

[0134] Task does not exist: No additional processing is required, and the decision result is that the changed data does not need to be persisted to the target server.

[0135] (4) Migration execution module.

[0136] Migration execution: Scan the tasks in the pending migration state, update them to migrating, then read the data for migration, and update the migration state of the task after the migration is executed. If the migration state is still migrating, it means that the user has not performed any operation during the migration, and then it will be updated to the successful migration state; otherwise, the user has performed any operation during the migration, and the real-time decision engine has updated it to the non-migration state.

[0137] Migration verification: Check whether there are any tasks that are not to be migrated in the task list. If there are any, update them to the pending migration status and wait for migration to be executed.

[0138] Data verification: After the migration is completed, all the migrated data must be verified, and the data on the target server and the source server must be consistent.

[0139] Compared with the prior art, the data migration method described in this embodiment has the following advantages:

[0140] (1) Dynamic data migration does not require stopping user services, ensuring service continuity and improving user experience.

[0141] (2) During dynamic data migration, data only needs to be migrated across servers based on the migration status, which does not involve complex judgment logic and does not change the business process.

[0142] (3) Multiple changes during dynamic data migration only require migration once, avoiding multiple operations on the data and ensuring data correctness.

[0143] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the data migration method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0144] This application also provides a data migration device, please refer to Figure 6 , the data migration device comprises:

[0145] A request receiving module 10, used for receiving a data migration request;

[0146] The task generation module 20 is used to traverse the preset dynamic data according to the data migration request, obtain the target migration data set and generate a list of tasks to be migrated, wherein the list of tasks to be migrated includes a set of tasks to be migrated and a set of tasks not to be migrated;

[0147] The data migration module 30 is used to migrate the target migration data set from the source server to the target server according to the task list to be migrated, and generate a data migration result.

[0148] Optionally, the dynamic data includes a plurality of dynamic business data, the target migration data set includes a data set to be migrated and a data set not to be migrated, and the task generation module 20 is further used for:

[0149] According to the data migration request, traverse the dynamic data, and generate an initial set of tasks to be migrated based on a preset list of initial tasks to be migrated;

[0150] When it is detected that a user calls any of the dynamic service data, the dynamic service data is used as non-migrated data, and a corresponding first non-migrated task is generated according to the non-migrated data;

[0151] Obtaining the non-migrated data set according to the non-migrated data, and obtaining the non-migrated task set according to the first non-migrated task corresponding to the non-migrated data;

[0152] The data set to be migrated is generated according to the non-migrated data set and the dynamic data, and the task set to be migrated is generated according to the non-migrated task set, the initial task set to be migrated and the data set to be migrated, wherein the data set to be migrated includes several copies of data to be migrated, and each copy of the data to be migrated corresponds to a first task to be migrated in the data set to be migrated.

[0153] Optionally, the target migration data set includes a data set to be migrated and a data set not to be migrated, and the data migration module 30 is further used for:

[0154] Migrating the data set to be migrated from the source server to the target server according to the task set to be migrated, and generating a first data migration result;

[0155] Migrating the non-migrated data set from the source server to the target server according to the non-migrated task set, and generating a second data migration result;

[0156] The data migration result is obtained according to the first data migration result and the second data migration result.

[0157] Optionally, the data migration module 30 is further used for:

[0158] S1: Select any data to be migrated in the data set to be migrated as the first target migration data;

[0159] S2: Execute a first task to be migrated corresponding to the first target migration data, migrate the first target migration data from the source server to the target server, and update the task to be migrated from a state to be migrated to a state in progress, thereby obtaining a first task in progress;

[0160] S3: when it is detected that the migration of the first target migration data is completed, updating the first migrating task from a migrating state to a migration successful state, and obtaining a first migration successful task;

[0161] Steps S1 to S3 are repeatedly executed until the data set to be migrated is traversed and the first data migration result is obtained.

[0162] Optionally, the task generation module 20 is further used to:

[0163] When it is detected that a user calls any data to be migrated in the data set to be migrated, the first task to be migrated corresponding to the data to be migrated is updated from a state to be migrated to a state not to be migrated, thereby obtaining a second task not to be migrated;

[0164] The data migration module 30 is also used for:

[0165] When it is detected that the user calls the first target migration data, the first migrating task is updated from the migrating state to the non-migrating state to obtain a third non-migrating task.

[0166] Optionally, the data migration module 30 is further used for:

[0167] S4: selecting any non-migrated data in the to-be-migrated data set as second target migration data;

[0168] S5: when it is detected that the user has completed calling the second target migration data, the corresponding non-migrated task is updated from a non-migrated state to a to-be-migrated state, thereby obtaining a second to-be-migrated task;

[0169] S6: Execute the second task to be migrated, migrate the second target migration data from the source server to the target server, and update the task to be migrated from a state to be migrated to a state in progress, thereby obtaining a second task in progress;

[0170] S7: when it is detected that the migration of the second target migration data is completed, updating the second migrating task from a migrating state to a migration successful state, and obtaining a second migration successful task;

[0171] Steps S4 to S7 are repeatedly executed until the non-migrated data set is traversed to obtain the second data migration result.

[0172] Optionally, the data migration module 30 is further used for:

[0173] When it is detected that the user calls the second target migration data, the second task to be migrated is updated from a state to be migrated to a state not to be migrated, so as to obtain a fourth task not to be migrated;

[0174] The data migration module 30 is also used for:

[0175] When it is detected that the user calls the second target migration data, the second migrating task is updated from the migrating state to the non-migrating state to obtain a fifth non-migrating task.

[0176] The data migration device provided by the present application adopts the data migration method in the above embodiment, which can solve the technical problem that the existing data migration solution cannot realize the one-time migration of dynamic data without stopping user services. Compared with the prior art, the beneficial effects of the data migration device provided by the present application are the same as the beneficial effects of the data migration method provided by the above embodiment, and the other technical features in the data migration device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0177] The present application provides a data migration device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data migration method in the above-mentioned embodiment one.

[0178] Reference below Figure 7 , which shows a schematic diagram of the structure of a data migration device suitable for implementing an embodiment of the present application. The data migration device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The data migration device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0179] like Figure 7As shown, the data migration device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the data migration device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the data migration device to communicate with other devices wirelessly or by wire to exchange data. Although the data migration device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0180] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0181] The data migration device provided by the present application adopts the data migration method in the above embodiment, which can solve the technical problem that the existing data migration solution cannot realize the one-time migration of dynamic data without stopping user services. Compared with the prior art, the beneficial effects of the data migration device provided by the present application are the same as the beneficial effects of the data migration method provided by the above embodiment, and the other technical features in the data migration device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0182] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0183] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0184] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the data migration method in the above-mentioned embodiment.

[0185] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0186] The computer-readable storage medium may be included in the data migration device; or may exist independently without being assembled into the data migration device.

[0187] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the data migration device, the data migration device:

[0188] Receive data migration requests;

[0189] According to the data migration request, traverse preset dynamic data, obtain a target migration data set and generate a task list to be migrated, wherein the task list to be migrated includes a task set to be migrated and a task set not to be migrated;

[0190] According to the to-be-migrated task list, the target migration data set is migrated from the source server to the target server, and a data migration result is generated.

[0191] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0192] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0193] The modules involved in the embodiments of the present application may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.

[0194] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned data migration method, and can solve the technical problem that the existing data migration solution cannot realize the one-time migration of dynamic data without stopping user services. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the data migration method provided by the above-mentioned embodiment, and will not be repeated here.

[0195] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned data migration method when executed by a processor.

[0196] The computer program product provided by the present application can solve the technical problem that the existing data migration solution cannot realize the one-time migration of dynamic data without stopping user services. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the data migration method provided by the above embodiment, which will not be described in detail here.

[0197] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A data migration method, characterized in that: The method comprises: Receive data migration requests; According to the data migration request, traverse preset dynamic data, obtain a target migration data set and generate a task list to be migrated, wherein the task list to be migrated includes a task set to be migrated and a task set not to be migrated; According to the to-be-migrated task list, the target migration data set is migrated from the source server to the target server, and a data migration result is generated.

2. The method according to claim 1, characterized in that The dynamic data includes a plurality of dynamic business data, the target migration data set includes a data set to be migrated and a data set not to be migrated, and the step of traversing preset dynamic data according to the data migration request, obtaining the target migration data set and generating a task list to be migrated includes: According to the data migration request, traverse the dynamic data, and generate an initial set of tasks to be migrated based on a preset list of initial tasks to be migrated; When it is detected that a user calls any of the dynamic service data, the dynamic service data is used as non-migrated data, and a corresponding first non-migrated task is generated according to the non-migrated data; Obtaining the non-migrated data set according to the non-migrated data, and obtaining the non-migrated task set according to the first non-migrated task corresponding to the non-migrated data; The data set to be migrated is generated according to the non-migrated data set and the dynamic data, and the task set to be migrated is generated according to the non-migrated task set, the initial task set to be migrated and the data set to be migrated, wherein the data set to be migrated includes several copies of data to be migrated, and each copy of the data to be migrated corresponds to a first task to be migrated in the data set to be migrated.

3. The method according to claim 1, characterized in that The target migration data set includes a data set to be migrated and a data set not to be migrated. The step of migrating the target migration data set from the source server to the target server according to the task list to be migrated and generating a data migration result includes: Migrating the data set to be migrated from the source server to the target server according to the task set to be migrated, and generating a first data migration result; Migrating the non-migrated data set from the source server to the target server according to the non-migrated task set, and generating a second data migration result; The data migration result is obtained according to the first data migration result and the second data migration result.

4. The method according to claim 3, characterized in that The step of migrating the data set to be migrated from the source server to the target server according to the task set to be migrated and generating a first data migration result comprises: S1: Select any data to be migrated in the data set to be migrated as the first target migration data; S2: Execute a first task to be migrated corresponding to the first target migration data, migrate the first target migration data from the source server to the target server, and update the task to be migrated from a state to be migrated to a state in progress, thereby obtaining a first task in progress; S3: when it is detected that the migration of the first target migration data is completed, updating the first migrating task from a migrating state to a migration successful state, and obtaining a first migration successful task; Steps S1 to S3 are repeatedly executed until the data set to be migrated is traversed and the first data migration result is obtained.

5. The method according to claim 4, characterized in that After generating the task set to be migrated according to the data set to be migrated, the method further includes: When it is detected that a user calls any data to be migrated in the data set to be migrated, the first task to be migrated corresponding to the data to be migrated is updated from a state to be migrated to a state not to be migrated, thereby obtaining a second task not to be migrated; The step of executing the first task to be migrated corresponding to the first target migration data, migrating the first target migration data from the source server to the target server, and updating the task to be migrated from a state to be migrated to a state in progress, after obtaining the first task in progress, further includes: When it is detected that the user calls the first target migration data, the first migrating task is updated from the migrating state to the non-migrating state to obtain a third non-migrating task.

6. The method according to claim 3, characterized in that The step of migrating the non-migrated data set from the source server to the target server according to the non-migrated task set to generate a second data migration result comprises: S4: selecting any non-migrated data in the to-be-migrated data set as second target migration data; S5: when it is detected that the user has completed calling the second target migration data, the corresponding non-migrated task is updated from a non-migrated state to a to-be-migrated state, thereby obtaining a second to-be-migrated task; S6: Execute the second task to be migrated, migrate the second target migration data from the source server to the target server, and update the task to be migrated from a state to be migrated to a state in progress, thereby obtaining a second task in progress; S7: when it is detected that the migration of the second target migration data is completed, updating the second migrating task from a migrating state to a migration successful state, and obtaining a second migration successful task; Steps S4 to S7 are repeatedly executed until the non-migrated data set is traversed to obtain the second data migration result.

7. The method according to claim 6, characterized in that After the step of updating the corresponding non-migrated task from a non-migrated state to a to-be-migrated state when detecting that the user has completed calling the second target migration data, and obtaining the second to-be-migrated task, the method further includes: When it is detected that the user calls the second target migration data, the second task to be migrated is updated from a state to be migrated to a state not to be migrated, so as to obtain a fourth task not to be migrated; After the step of executing the second task to be migrated, migrating the second target migration data from the source server to the target server, and updating the task to be migrated from a state to be migrated to a state in progress, and obtaining the second task in progress, the method further includes: When it is detected that the user calls the second target migration data, the second migrating task is updated from the migrating state to the non-migrating state to obtain a fifth non-migrating task.

8. A data migration device, characterized in that: The device comprises: A request receiving module, used for receiving a data migration request; A task generation module, configured to traverse preset dynamic data according to the data migration request, obtain a target migration data set and generate a list of tasks to be migrated, wherein the list of tasks to be migrated includes a set of tasks to be migrated and a set of tasks not to be migrated; The data migration module is used to migrate the target migration data set from the source server to the target server according to the task list to be migrated, and generate a data migration result.

9. A data migration device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data migration method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the data migration method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Multi-level storage construction and online migration method based on directory units

    CN112540954A

  • Data migration method, device and equipment and readable storage medium

    CN114968920A

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

    CN115168318A

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

    CN117453650A

  • Data migration method and device, equipment and storage medium

    CN117851386A