Data migration method and device, server, storage medium and program product
During the data migration process, by determining adjacent snapshot data based on the identification information of the snapshot data and migrating incremental data, the problem of failure to process snapshot data in traditional technology is solved, and the complete migration of stored data and the recovery of the target server data is realized.
Patent Information
- Application Number
- CN202311770303.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2025-06-24
AI Technical Summary
Traditional data migration technology fails to effectively process snapshot data in storage devices, resulting in a lack of integrity during data migration and the inability to ensure the complete recovery of data in the target server.
By determining the second snapshot data based on the identification information of the first snapshot data, and calculating the incremental data between the first snapshot data and the second snapshot data, the incremental data is migrated to the storage space of the target server, thereby ensuring that the target server can accurately determine the second snapshot data.
The complete migration of stored data containing snapshots is achieved, ensuring the integrity and recoverability of data in the target server, avoiding the problem of data corruption and inability to recover, and reducing the amount of data migration and improving migration efficiency.
Smart Images

Figure CN120196263A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technology, and in particular, to a data migration method, apparatus, server, storage medium, and program product. Background Art
[0002] Generally, as a means of data disaster recovery, the stored data in a storage device can be migrated to other storage devices.
[0003] In traditional technologies, when migrating the stored data in a storage device, the source data in the storage device is migrated to other storage devices. However, the storage device usually stores snapshot data corresponding to the source data, and in traditional technologies, the snapshot data of the source data is not migrated during data migration. Summary of the Invention
[0004] Based on this, it is necessary to provide a data migration method, apparatus, server, storage medium, and program product that can migrate storage data including snapshots for the above technical problems.
[0005] In a first aspect, this application provides a data migration method. The method includes:
[0006] Determine second snapshot data according to the identification information of the first snapshot data; wherein, the first snapshot data is snapshot data adjacent to the second snapshot data in a first storage space, and the migration time of the first snapshot data is earlier than the migration time of the second snapshot data;
[0007] Determine first incremental data between the first snapshot data and the second snapshot data;
[0008] Migrate the first incremental data to a second storage space of a target server, so that the target server determines the second snapshot data based on the first incremental data.
[0009] In one embodiment, the identification information includes a generation time; the determining the second snapshot data according to the identification information of the first snapshot data includes:
[0010] Determine the second snapshot data according to the generation time of the first snapshot data.
[0011] In one embodiment, the determining the second snapshot data according to the generation time of the first snapshot data includes:
[0012] According to the generation time of the first snapshot data, determine the snapshot data adjacent to the generation time of the first snapshot data in the first storage space as the second snapshot data.
[0013] In one embodiment, determining the second snapshot data according to the generation time of the first snapshot data includes:
[0014] Determining the name of the target snapshot data adjacent to the generation time of the first snapshot data according to the generation time of the first snapshot data and a preset snapshot list; the snapshot list includes the correspondence between the names of multiple snapshot data and the generation times of multiple snapshot data;
[0015] Determining the second snapshot data according to the name of the target snapshot data.
[0016] In one embodiment, the method further includes:
[0017] Migrating the first snapshot data to the second storage space.
[0018] In one embodiment, the method further includes:
[0019] Obtaining second incremental data between the first snapshot data and an empty snapshot data;
[0020] Migrating the second incremental data to the second storage space so that the target server determines the first snapshot data based on the second incremental data.
[0021] In one embodiment, before determining the second snapshot data according to the identification information of the first snapshot data, the method further includes:
[0022] Determining whether the newly written storage data in the first storage space is a data migration with snapshot data;
[0023] If so, performing the step of determining the second snapshot data according to the identification information of the first snapshot data;
[0024] If not, migrating the newly written storage data to the second storage space.
[0025] In a second aspect, the present application further provides a data migration device. The device includes:
[0026] A first determination module, configured to determine a second snapshot data according to the identification information of a first snapshot data; wherein, the first snapshot data is a snapshot data adjacent to the second snapshot data in a first storage space, and the migration time of the first snapshot data is earlier than the migration time of the second snapshot data;
[0027] A second determination module, configured to determine first incremental data between the first snapshot data and the second snapshot data;
[0028] The first migration module is used to migrate the first incremental data to the second storage space of the target server, so that the target server determines the second snapshot data based on the first incremental data.
[0029] In a third aspect, the present application further provides a server. The server includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the method described in the first aspect above are implemented.
[0030] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0031] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0032] For the above data migration method, device, server, storage medium, and program product, according to the identification information of the first snapshot data whose migration time is earlier than the second snapshot data, the second snapshot data adjacent to the first snapshot data can be determined. Since the first snapshot data and the second snapshot data are adjacent, the first incremental data between the first snapshot data and the second snapshot data can be accurately determined, and the first incremental data is migrated to the second storage space of the target server, so that the storage data including snapshots can be migrated, and further the target server can accurately determine the second snapshot data based on the first incremental data, avoiding the problem that the data in the target server is damaged and cannot be recovered; in addition, since the incremental data is migrated in the embodiments of the present application, compared with migrating snapshot data, the amount of data to be migrated can be reduced, thereby improving the migration efficiency of migrating the storage data including snapshots. Description of the Drawings
[0033] Figure 1 It is an application environment diagram of the data migration method in an embodiment;
[0034] Figure 2 It is a flowchart of the data migration method in an embodiment;
[0035] Figure 3 It is a flowchart of the data migration method in another embodiment;
[0036] Figure 4 It is a flowchart of the data migration method in another embodiment;
[0037] Figure 5Schematic flowchart of the data migration method in another embodiment;
[0038] Figure 6 Structural block diagram of the data migration device in one embodiment;
[0039] Figure 7 Structural block diagram of the data migration device in another embodiment;
[0040] Figure 8 Internal structure diagram of the server in one embodiment. Detailed implementation manners
[0041] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
[0042] The data migration method provided by the embodiments of the present application can be applied to an application environment as shown in Figure 1 In the figure. Among them, the first server 102 communicates with the second server 104 through a network. The first data storage system can store the data that the first server 102 needs to process, and the second data storage system can store the data that the second server 104 needs to process. The first data storage system can be integrated on the first server 102, or can be placed on the cloud or other network servers. The second data storage system can be integrated on the second server 102, or can be placed on the cloud or other network servers. The first server 102 can send the determined incremental data to the second server 104 through the network. The first server 102 and the second server 104 can be servers in different server clusters.
[0043] In one embodiment, as shown in Figure 2 In the figure, a data migration method is provided. Taking the first server in Figure 1 as an example, the method includes the following steps:
[0044] S201. Determine the second snapshot data according to the identification information of the first snapshot data; wherein, the first snapshot data is the snapshot data adjacent to the second snapshot data in the first storage space, and the migration time of the first snapshot data is earlier than the migration time of the second snapshot data.
[0045] It should be noted that during the data storage process, snapshot technology can be used to back up the source data and create snapshot data corresponding to the source data, so that in the case of source data corruption, the source data can be restored to the state at the time of snapshot creation, reducing the impact of data corruption. Generally, the method to implement snapshots can be copy-on-write for the first time, also known as write-copy, that is, when writing data to a certain storage location in the storage device for the first time, first read the original data at that storage location and write it to another storage location, and then write the data to the storage device, while generating a snapshot list to record the logical addresses and times of changes in the original data.
[0046] It can be understood that for the same storage location, if new data is written to this storage location multiple times, a corresponding snapshot data will be generated for each write process. Thus, during the data migration process, the new data and all the snapshot data corresponding to this storage location can be migrated to the new storage location simultaneously. Optionally, the new data can be data obtained by modifying the original data, or the new data can also be completely different from the original data. In this embodiment, in order to reduce the amount of migrated data, the differential data between the snapshot data can also be migrated.
[0047] It can be understood that in order to reduce the granularity of the obtained differential data, the differential data can be determined based on two adjacent snapshot data and migrated. In this embodiment, two adjacent snapshot data can be determined according to the identification information of the snapshot data, where the identification information can include information such as the name, migration time, and migration status of the snapshot data. In this embodiment, the storage space including the snapshot data to be migrated can be referred to as the first storage space.
[0048] Optionally, in this embodiment, the snapshot data with the earliest migration time can be determined as the first snapshot data. According to the migration time in the identification information of the first snapshot, search in the first storage space for the snapshot data that is adjacent to the first snapshot data and has a migration time later than the migration time of the first snapshot data, so as to determine this snapshot data as the second snapshot data; or, the snapshot data that has been migrated or is being migrated can also be determined as the first snapshot data. According to the migration status in the identification information of the first snapshot, search in the first storage space for the snapshot data that is adjacent to the first snapshot data and has a migration status of not migrated, so as to determine this snapshot data as the second snapshot data.
[0049] As an optional implementation manner, if all the snapshot data in the first storage space are not migrated, the empty data can be determined as the first snapshot data, and the snapshot data with the earliest migration time can be determined as the second snapshot data.
[0050] S202, determine the first incremental data between the first snapshot data and the second snapshot data.
[0051] Among them, the first incremental data refers to the differential data between the first snapshot data and the second snapshot data. Optionally, the first incremental data can represent the data increased by the second snapshot data compared with the first snapshot data; or, the first incremental data can also represent the data decreased by the second snapshot data compared with the first snapshot data. It should be noted that the identification information of each first incremental data is the identification information of the first snapshot data.
[0052] It can be understood that if the second snapshot data is the snapshot data with the latest generation time in the first storage space, the data difference between the current stored data in the first storage space and the second snapshot data can be used as the last first incremental data.
[0053] In this embodiment, a preset text comparison algorithm can be used to determine the differential data between the first snapshot data and the second snapshot data, and the differential data is determined as the first incremental data.
[0054] S203. Migrate the first incremental data to the second storage space of the target server, so that the target server determines the second snapshot data based on the first incremental data.
[0055] Among them, the second storage space of the target server refers to the storage space to which the first incremental data and the current stored data in the first storage space are migrated. The target server can determine the differential data between the first snapshot data and the second snapshot data based on the first incremental data. Optionally, the target server in this embodiment can be the above-mentioned first server, or it can also be Figure 1 the second server shown in. It can be understood that if the target server is the above-mentioned first server, the second storage space in the target server is different from the storage space storing the first snapshot data and the second snapshot data, and they are two different storage spaces.
[0056] It can be understood that if the first storage space contains two snapshot data, namely the first snapshot data and the second snapshot data, in the case where the current stored data in the second storage space is damaged, it can be restored to the second snapshot data according to the first incremental data. If the first storage space contains three snapshot data, during the migration of the snapshot data, new first snapshot data and new second snapshot data can be repeatedly determined, so that the third snapshot data with the latest migration time is determined as the second snapshot data. Then, in the case where the current stored data in the second storage space is damaged, it can be restored to the second snapshot data according to the first incremental data, that is, restored to the third snapshot data according to the first incremental data.
[0057] In this embodiment, when a communication connection is established with the target server, the first snapshot data can be pre-transmitted to the second storage space through the network, and the first incremental data and the current stored data in the first storage space can be transmitted to the second storage space, so that in the case where the current stored data in the second storage space is damaged, data recovery can be performed based on multiple first incremental data. Exemplarily, if there are 3 snapshot data A, B, and C in the first storage space, and there are 2 corresponding first incremental data B1 and C1, where B1 is the incremental data between snapshot data B and snapshot data A, and C1 is the incremental data between snapshot data C and snapshot data B, then when the target server receives 2 first incremental data and the current stored data, if the current stored data is damaged, snapshot data B can be recovered based on the pre-received first snapshot data and incremental data B1, and then snapshot data C can be recovered based on snapshot data B and incremental data C1, so that the data can be recovered to the data saved in the previous operation in the case where the current stored data is damaged.
[0058] As an alternative implementation, after migrating the first incremental data to the second storage space of the target server, the target server can establish a snapshot list representing the correspondence between the first incremental data and the generation time in the second storage space according to the generation time and name in the identification information of the received first incremental data, so as to store the identification information of the first incremental data.
[0059] It should be noted that in the embodiments of the present application, the snapshot data is used as a breakpoint, and the first incremental data between adjacent first snapshot data and second snapshot data is migrated. After each first incremental data migration is completed, the next first incremental data is determined and migrated according to the sequential migration until all the snapshot data to be migrated is processed. Therefore, as another alternative implementation, during the migration process, if the data migration in the first storage space is actively paused, or if the server where the first storage space is located or the target server where the second storage space is located fails, resulting in the interruption of the data migration, it will not affect the snapshot data that has been migrated. When the data migration resumes, the data migration can start again from the snapshot data where the interruption occurred. Exemplarily, if there are 5 snapshot data in the first storage space, and the first incremental data corresponding to the first 3 snapshot data has been migrated to the second storage space, if the migration is interrupted, the migration can continue from the fourth snapshot data.
[0060] In the above data migration method, according to the identification information of the first snapshot data whose migration time is earlier than the second snapshot data, the second snapshot data adjacent to the first snapshot data can be determined. Since the first snapshot data and the second snapshot data are adjacent, the first incremental data between the first snapshot data and the second snapshot data can be accurately determined, and the first incremental data is migrated to the second storage space of the target server, so that the storage data including snapshots can be migrated, and further the target server can accurately determine the second snapshot data according to the first incremental data, avoiding the problem that data in the target server is damaged and data recovery cannot be performed; in addition, since the incremental data is migrated in the embodiments of the present application, compared with migrating snapshot data, the amount of data to be migrated can be reduced, thereby improving the migration efficiency of migrating storage data including snapshots.
[0061] In the scenario of determining the second snapshot data according to the identification information of the first snapshot data above, if the identification information includes the generation time, the second snapshot data can be determined according to the generation time of the first snapshot data. In one embodiment, the identification information includes the generation time, and the above S201 includes: determining the second snapshot data according to the generation time of the first snapshot data.
[0062] Wherein, the generation time of the snapshot data refers to the time when the original data in a certain storage location in the first storage space is copied to other storage locations when new data is written to the storage location, that is, the generation time of the snapshot data corresponding to the above original data, and the generation time of each snapshot data corresponding to the same storage location is unique.
[0063] In this embodiment, the snapshot data with the earliest generation time can be determined as the first snapshot data, and thus according to the generation time of the first snapshot data, the snapshot data adjacent to the generation time of the first snapshot data can be determined as the second snapshot data. Exemplarily, if the generation time of snapshot data A is 9:00, the generation time of snapshot data B is 9:10, and the generation time of snapshot data C is 9:20, then snapshot data A can be determined as the first snapshot data and snapshot data B can be determined as the second snapshot data; or, snapshot data B can be determined as the first snapshot data and snapshot data C can be determined as the second snapshot data.
[0064] In this embodiment, since the generation time of the snapshot data can be quickly obtained, the second snapshot data adjacent to the first snapshot data can be quickly determined according to the generation time of the first snapshot data, and further the efficiency of determining the first incremental data between the first snapshot data and the second snapshot data can be improved.
[0065] In the scenario of determining the second snapshot data based on the generation time of the first snapshot data as described above, the second snapshot data adjacent to the generation time of the first snapshot data can be determined from the storage space, or the second snapshot data adjacent to the generation time of the first snapshot data can also be determined from a preset snapshot list. The following is a detailed introduction to these two determination methods:
[0066] The first method: In one embodiment, "determining the second snapshot data according to the generation time of the first snapshot data" includes: determining, according to the generation time of the first snapshot data, the snapshot data adjacent to the generation time of the first snapshot data in the first storage space as the second snapshot data.
[0067] It should be noted that in the storage space, according to the generation time of each snapshot data, each snapshot data can be sequentially stored in the storage units of the storage space, so that the storage addresses of the snapshot data with adjacent generation times are consecutive storage addresses. For example, snapshot data A, snapshot data B, and snapshot data C are three snapshot data with adjacent generation times. If the size of each snapshot data is 1 byte, the storage addresses of snapshot data A, snapshot data B, and snapshot data C can be 0030H, 0031H, and 0032H.
[0068] In this embodiment, according to the generation time of the first snapshot data, the first storage address of the first snapshot data in the first storage space can be determined, so as to determine the second storage address for storing the second snapshot data according to the first storage address and the size of the first snapshot data, and then determine the snapshot data in the storage unit corresponding to the second storage address as the second snapshot data. Exemplarily, the same number of storage units can be allocated for each snapshot data. If 8 storage units are allocated for each snapshot data and the storage address of the first snapshot data is 0030H - 0037H, then the corresponding snapshot data in 0038H - 0045H can be determined as the second snapshot data.
[0069] In this embodiment, according to the generation time of the first snapshot data, the snapshot data adjacent to the generation time of the first snapshot data in the first storage space can be determined as the second snapshot data. Since the generation time of each snapshot data is unique, the second snapshot data can be quickly and accurately determined according to the generation time.
[0070] The second method: In another embodiment, in the scenario of determining the second snapshot data according to the generation time of the first snapshot data as described above, the second snapshot data adjacent to the generation time of the first snapshot data can also be determined from a preset snapshot list. In one embodiment, as Figure 3 shown, "determining the second snapshot data according to the generation time of the first snapshot data" includes:
[0071] S301. Determine the name of the target snapshot data adjacent to the generation time of the first snapshot data according to the generation time of the first snapshot data and a preset snapshot list. The snapshot list includes the correspondence between the names of multiple snapshot data and the generation times of multiple snapshot data.
[0072] Among them, the preset snapshot list is a list established according to the generation time of each snapshot data during the generation process of the snapshot data. In the snapshot list, each snapshot data can be arranged in the order of generation time. Optionally, the snapshot list can also include the name of each snapshot data, and each snapshot data can also be arranged according to the name.
[0073] Optionally, in this embodiment, if the snapshot list is arranged in the order of generation time, the target snapshot data adjacent to the first snapshot data and with a generation time greater than the generation time of the first snapshot data can be found from the preset snapshot list according to the generation time of the first snapshot data, so as to determine the name of the target snapshot data; or, if the snapshot list is arranged by name, the target snapshot data with the smallest time difference from the generation time of the first snapshot data and greater than the generation time of the first snapshot data can be found from the preset snapshot list according to the generation time of the first snapshot data, so as to determine the name of the target snapshot data.
[0074] S302. Determine the second snapshot data according to the name of the target snapshot data.
[0075] It should be noted that in the first storage space, the name of each snapshot data is unique. In this embodiment, the storage unit storing the target snapshot data can be found from the first storage space according to the name of the target snapshot data, and the snapshot data in the found storage unit is determined as the second snapshot data.
[0076] In this embodiment, since the snapshot list includes the correspondence between the names of multiple snapshot data and the generation times of multiple snapshot data, the name of the target snapshot data adjacent to the generation time of the first snapshot data can be quickly determined according to the generation time of the first snapshot data and the preset snapshot list. Since the generation time and name of each snapshot data are in one-to-one correspondence, the second snapshot data can be quickly and accurately determined according to the name of the target snapshot data, improving the efficiency and accuracy of determining the second snapshot data.
[0077] In the above scenario where the target server determines the second snapshot data based on the first incremental data, the target server needs to determine the second snapshot data according to the first snapshot data and the first incremental data. The following will elaborate on two implementation methods for the target server to obtain the first snapshot data.
[0078] First: In one embodiment, the first snapshot data can be migrated to a second storage space.
[0079] It can be understood that if the first snapshot data is the snapshot data with the earliest generation time in the snapshot list, then during the migration of the snapshot data, the first snapshot data can be migrated to the second storage space, so that the target server can perform data recovery according to the received first snapshot data and first incremental data in the case that the current stored data in the second storage space is damaged.
[0080] In this embodiment, by migrating the first snapshot data to the second storage space, the target server can quickly determine the second snapshot data according to the first snapshot data and the migrated first incremental data in the case that the stored data in the second storage space is damaged, thereby enabling data recovery.
[0081] Second: In another embodiment, as Figure 4 shown, the difference data between the first snapshot data and the empty snapshot data can also be used as incremental data and migrated to the second storage space of the target server, thereby determining the first snapshot data, so that the target server can determine the second snapshot data according to the first snapshot data and the first incremental data:
[0082] S401, Obtain the second incremental data between the first snapshot data and the empty snapshot data.
[0083] It can be understood that if the first snapshot data is the snapshot data with the earliest generation time in the first storage space, the difference data between the first snapshot data and the empty snapshot data can be determined as the second incremental data. In this embodiment, a preset text comparison algorithm can be used to determine the data difference between the first snapshot data and the empty snapshot data to obtain the second incremental data.
[0084] S402, Migrate the second incremental data to the second storage space so that the target server determines the first snapshot data based on the second incremental data.
[0085] In this embodiment, the second incremental data can be migrated to the second storage space through the network, so that the target server can determine the second incremental data as the first snapshot data.
[0086] In this embodiment, by obtaining the second incremental data between the first snapshot data and the empty snapshot data, the second incremental data can be migrated to the second storage space. Since the first snapshot data can be determined more accurately through the second incremental data, the target server can accurately determine the first snapshot data based on the second incremental data, and then can accurately determine the second snapshot data according to the first snapshot data and the first incremental data.
[0087] Exemplarily, if there are three snapshot data A, B, and C in the first storage space, and there are corresponding three first incremental data A1, B1, and C1. Among them, A1 is the incremental data between snapshot data A and the empty snapshot data, B1 is the incremental data between snapshot data B and snapshot data A, and C1 is the incremental data between snapshot data C and snapshot data B. Then, when the target server receives the three first incremental data and the current stored data, if the current stored data is damaged, it can restore snapshot data B based on incremental data A1 and incremental data B1, and then restore snapshot data C based on snapshot data B and incremental data C1. Thus, it can restore the data to the data saved in the previous operation when the current stored data is damaged.
[0088] Before the scenario of determining the second snapshot data according to the identification information of the first snapshot data as described above, it can be determined in advance whether data migration with snapshot data is performed in the first storage space. In one embodiment, as Figure 5 shown, the above method further includes:
[0089] S501, determine whether the newly written stored data in the first storage space is data migration with snapshot data.
[0090] Among them, the newly written stored data can be the data written into the first storage space during the data migration process, or the data written into the first storage space before the data migration starts. It should be noted that it can be determined whether to migrate the data in the storage space with snapshot data according to different user requirements.
[0091] In this embodiment, the migration requirement of the user can be received through a user instruction, and it is determined whether the newly written stored data in the first storage space is data migration with snapshot data according to the migration requirement. Optionally, if the migration requirement indicates that data migration with snapshot data needs to be performed, it is determined that the newly written stored data in the first storage space is data migration with snapshot data; or, if the migration requirement indicates that data migration with snapshot data does not need to be performed, it is determined that the newly written stored data in the first storage space is not data migration with snapshot data.
[0092] As an optional implementation manner, the migration requirement of the user may further include identification information for migrating some snapshot data. Then, the identification information of the snapshot data to be migrated in the first storage space can be determined according to the migration requirement. The identification information may include the generation time or name of the snapshot data. Optionally, the snapshot data to be migrated can be determined according to the generation time, or the snapshot data to be migrated can also be determined according to the name, so as to migrate the snapshot data to be migrated.
[0093] S502, if it is, then execute the step of determining the second snapshot data according to the identification information of the first snapshot data.
[0094] In this embodiment, if it is determined that the stored data newly written in the first storage space is a data migration with snapshot data, then according to the migration time in the identification information of the first snapshot data, snapshot data that is adjacent to the first snapshot data and has a migration time later than the migration time of the first snapshot data can be searched for in the first storage space, so as to determine this snapshot data as the second snapshot data.
[0095] It should be noted that if there are more than two snapshot data in the first storage space, the step of determining the second snapshot data according to the identification information of the first snapshot data needs to be repeatedly executed until all the first incremental data corresponding to the snapshot data are migrated to the second storage space of the target server.
[0096] S503, if not, then migrate the newly written stored data to the second storage space.
[0097] In this embodiment, if it is determined that the stored data newly written in the first storage space is not a data migration with snapshot data, then the current stored data in the first storage space can be migrated to the second storage space, that is, the newly written stored data is migrated to the second storage space.
[0098] In this embodiment, by determining whether the stored data newly written in the first storage space is a data migration with snapshot data, the second snapshot data can be determined according to the identification information of the first snapshot data in the case of a data migration with snapshot data, and the newly written stored data can be migrated to the second storage space in the case of a data migration that is not snapshot data, which can meet the different data migration needs of users and improve the applicability of this data migration method.
[0099] For the convenience of understanding by those skilled in the art, the data migration method provided by this application is introduced in detail below. This method may include:
[0100] S1, determine whether the stored data newly written in the first storage space is a data migration with snapshot data.
[0101] S2, if so, then determine the name of the target snapshot data adjacent to the generation time of the first snapshot data according to the generation time of the first snapshot data and a preset snapshot list; the snapshot list includes the corresponding relationships between the names of multiple snapshot data and the generation times of multiple snapshot data.
[0102] S3, determine the second snapshot data according to the name of the target snapshot data, where the migration time of the first snapshot data is earlier than the migration time of the second snapshot data.
[0103] S4, obtain the second incremental data between the first snapshot data and the empty snapshot data.
[0104] S5. Migrate the second incremental data to the second storage space so that the target server determines the first snapshot data based on the second incremental data.
[0105] S6. Determine the first incremental data between the first snapshot data and the second snapshot data.
[0106] S7. Migrate the first incremental data to the second storage space of the target server so that the target server determines the second snapshot data based on the first incremental data.
[0107] S8. If not, migrate the newly written storage data to the second storage space.
[0108] It should be noted that for the descriptions in S1 - S8 above, reference can be made to the relevant descriptions in the above embodiments, and the effects are similar. Therefore, they will not be elaborated in this embodiment.
[0109] It should be understood that although each step in the flowcharts involved in the above embodiments is shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0110] Based on the same inventive concept, an embodiment of the present application also provides a data migration device for implementing the data migration method involved above. The implementation solutions provided by this device to solve problems are similar to the implementation solutions recorded in the above method. Therefore, the specific limitations in one or more embodiments of the data migration device provided below can refer to the limitations on the data migration method in the above text, and will not be elaborated here.
[0111] In one embodiment, as Figure 6 shown, a data migration device is provided, including: a first determination module 11, a second determination module 12, and a first migration module 13, where:
[0112] The first determination module 11 is configured to determine the second snapshot data according to the identification information of the first snapshot data; where the first snapshot data is the snapshot data adjacent to the second snapshot data in the first storage space, and the migration time of the first snapshot data is earlier than the migration time of the second snapshot data.
[0113] The second determination module 12 is configured to determine the first incremental data between the first snapshot data and the second snapshot data.
[0114] The first migration module 13 is configured to migrate the first incremental data to the second storage space of the target server, so that the target server determines the second snapshot data based on the first incremental data.
[0115] The data migration device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0116] In one embodiment, as Figure 7 shown, the above-mentioned first determination module 11 includes: a determination unit 111, where:
[0117] The determination unit 111 is configured to determine the second snapshot data according to the generation time of the first snapshot data.
[0118] The data migration device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0119] In one embodiment, please continue to refer to Figure 7 , the above-mentioned determination unit 111 is specifically configured to: according to the generation time of the first snapshot data, determine the snapshot data adjacent to the generation time of the first snapshot data in the first storage space as the second snapshot data.
[0120] The data migration device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0121] In one embodiment, please continue to refer to Figure 7 , the above-mentioned determination unit 111 is further specifically configured to: according to the generation time of the first snapshot data and a preset snapshot list, determine the name of the target snapshot data adjacent to the generation time of the first snapshot data; the snapshot list includes the corresponding relationships between the names of multiple snapshot data and the generation times of multiple snapshot data; according to the name of the target snapshot data, determine the second snapshot data.
[0122] The data migration device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0123] In one embodiment, please continue to refer to Figure 7 , the above-mentioned device further includes: a second migration module 14, where:
[0124] The second migration module 14 is configured to migrate the first snapshot data to the second storage space.
[0125] The data migration device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0126] In one embodiment, please continue to refer to Figure 7 , the above device further includes: an acquisition module 15 and a third migration module 16, where:
[0127] The acquisition module 15 is used to acquire the second incremental data between the first snapshot data and the empty snapshot data.
[0128] The third migration module 16 is used to migrate the second incremental data to the second storage space, so that the target server determines the first snapshot data based on the second incremental data.
[0129] The data migration device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0130] In one embodiment, please continue to refer to Figure 7 , the above device further includes: a third determination module 17, a fourth determination module 18 and a fourth migration module 19, where:
[0131] The third determination module 17 is used to determine whether the newly written storage data in the first storage space is data migration with snapshot data;
[0132] The fourth determination module 18 is used to, if the newly written storage data in the first storage space is storage data with snapshot data, execute the step of determining the second snapshot data according to the identification information of the first snapshot data;
[0133] The fourth migration module 19 is used to, if the newly written storage data in the first storage space is not storage data with snapshot data, migrate the newly written storage data to the second storage space.
[0134] The data migration device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0135] Each module in the above data migration device can be implemented in whole or in part by software, hardware and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above respective modules.
[0136] In one embodiment, a server is provided, and its internal structure diagram can be as Figure 8As shown in the figure. The server includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the server is used to provide computing and control capabilities. The memory of the server includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the server is used to store source data, snapshot data, and incremental data. The input / output interface of the server is used to exchange information between the processor and external devices. The communication interface of the server is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a data migration method.
[0137] Those skilled in the art can understand that Figure 8 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0138] In one embodiment, a server is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0139] Determine the second snapshot data according to the identification information of the first snapshot data; wherein, the first snapshot data is the snapshot data adjacent to the second snapshot data in the first storage space, and the migration time of the first snapshot data is earlier than the migration time of the second snapshot data;
[0140] Determine the first incremental data between the first snapshot data and the second snapshot data;
[0141] Migrate the first incremental data to the second storage space of the target server, so that the target server determines the second snapshot data based on the first incremental data.
[0142] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0143] Determine the second snapshot data according to the generation time of the first snapshot data.
[0144] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0145] Determine the snapshot data adjacent to the generation time of the first snapshot data in the first storage space according to the generation time of the first snapshot data.
[0146] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0147] Determine the name of the target snapshot data adjacent to the generation time of the first snapshot data according to the generation time of the first snapshot data and a preset snapshot list; the snapshot list includes the correspondence between the names of multiple snapshot data and the generation times of multiple snapshot data;
[0148] Determine the second snapshot data according to the name of the target snapshot data.
[0149] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0150] Migrate the first snapshot data to the second storage space.
[0151] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0152] Obtain the second incremental data between the first snapshot data and the empty snapshot data;
[0153] Migrate the second incremental data to the second storage space so that the target server determines the first snapshot data based on the second incremental data.
[0154] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0155] Determine whether the newly written storage data in the first storage space is a data migration with snapshot data;
[0156] If so, execute the step of determining the second snapshot data according to the identification information of the first snapshot data;
[0157] If not, migrate the newly written storage data to the second storage space.
[0158] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0159] Determine the second snapshot data according to the identification information of the first snapshot data; wherein, the first snapshot data is the snapshot data adjacent to the second snapshot data in the first storage space, and the migration time of the first snapshot data is earlier than the migration time of the second snapshot data;
[0160] Determine the first incremental data between the first snapshot data and the second snapshot data;
[0161] Migrate the first incremental data to the second storage space of the target server, so that the target server determines the second snapshot data based on the first incremental data.
[0162] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0163] Determine the second snapshot data according to the generation time of the first snapshot data.
[0164] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0165] According to the generation time of the first snapshot data, determine the snapshot data adjacent to the generation time of the first snapshot data in the first storage space as the second snapshot data.
[0166] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0167] According to the generation time of the first snapshot data and a preset snapshot list, determine the name of the target snapshot data adjacent to the generation time of the first snapshot data; the snapshot list includes the correspondence between the names of multiple snapshot data and the generation times of multiple snapshot data;
[0168] Determine the second snapshot data according to the name of the target snapshot data.
[0169] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0170] Migrate the first snapshot data to the second storage space.
[0171] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0172] Obtain the second incremental data between the first snapshot data and the empty snapshot data;
[0173] Migrate the second incremental data to the second storage space, so that the target server determines the first snapshot data based on the second incremental data.
[0174] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0175] Determine whether the newly written storage data in the first storage space is a data migration with snapshot data;
[0176] If so, execute the step of determining the second snapshot data according to the identification information of the first snapshot data;
[0177] If not, migrate the newly written storage data to the second storage space.
[0178] In one embodiment, a computer program product is provided, including a computer program which, when executed by a processor, implements the following steps:
[0179] Determine second snapshot data according to the identification information of first snapshot data; wherein, the first snapshot data is the snapshot data adjacent to the second snapshot data in the first storage space, and the migration time of the first snapshot data is earlier than the migration time of the second snapshot data;
[0180] Determine first incremental data between the first snapshot data and the second snapshot data;
[0181] Migrate the first incremental data to a second storage space of a target server, so that the target server determines the second snapshot data based on the first incremental data.
[0182] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0183] Determine second snapshot data according to the generation time of the first snapshot data.
[0184] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0185] Determine, as the second snapshot data, the snapshot data adjacent to the first snapshot data in the first storage space according to the generation time of the first snapshot data.
[0186] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0187] Determine the name of target snapshot data adjacent to the generation time of the first snapshot data according to the generation time of the first snapshot data and a preset snapshot list; the snapshot list includes the corresponding relationships between the names of multiple snapshot data and the generation times of multiple snapshot data;
[0188] Determine second snapshot data according to the name of the target snapshot data.
[0189] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0190] Migrate the first snapshot data to the second storage space.
[0191] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0192] Obtain second incremental data between the first snapshot data and an empty snapshot data;
[0193] Migrate the second incremental data to the second storage space so that the target server determines the first snapshot data based on the second incremental data.
[0194] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0195] Determine whether the newly written storage data in the first storage space is data migration with snapshot data;
[0196] If so, execute the step of determining the second snapshot data according to the identification information of the first snapshot data;
[0197] If not, migrate the newly written storage data to the second storage space.
[0198] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties.
[0199] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memories can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0200] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0201] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A data migration method, characterized in that, The method includes: Determining second snapshot data according to the identification information of first snapshot data; wherein, the first snapshot data is the snapshot data adjacent to the second snapshot data in a first storage space, and the migration time of the first snapshot data is earlier than the migration time of the second snapshot data; Determining first incremental data between the first snapshot data and the second snapshot data; Migrating the first incremental data to a second storage space of a target server, so that the target server determines the second snapshot data based on the first incremental data.
2. The method according to claim 1, wherein The identification information includes a generation time; the determining the second snapshot data according to the identification information of the first snapshot data includes: Determining the second snapshot data according to the generation time of the first snapshot data.
3. The method according to claim 2, wherein The determining the second snapshot data according to the generation time of the first snapshot data includes: Determining, according to the generation time of the first snapshot data, the snapshot data adjacent to the generation time of the first snapshot data in the first storage space as the second snapshot data.
4. The method according to claim 2, characterized in that, The determining the second snapshot data according to the generation time of the first snapshot data includes: Determining the name of target snapshot data adjacent to the generation time of the first snapshot data according to the generation time of the first snapshot data and a preset snapshot list; the snapshot list includes the corresponding relationships between the names of multiple snapshot data and the generation times of the multiple snapshot data; Determining the second snapshot data according to the name of the target snapshot data.
5. The method according to any one of claims 1 to 3, characterized in that The method further includes: Migrating the first snapshot data to the second storage space.
6. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Obtaining second incremental data between the first snapshot data and an empty snapshot data; Migrating the second incremental data to the second storage space, so that the target server determines the first snapshot data based on the second incremental data.
7. The method according to claim 1, wherein Before the determining the second snapshot data according to the identification information of the first snapshot data, the method further includes: Determining whether the newly written storage data in the first storage space is a data migration with snapshot data; If so, performing the step of determining the second snapshot data according to the identification information of the first snapshot data; If not, migrating the newly written storage data to the second storage space.
8. A data migration device, characterized in that, The device includes: A first determination module, configured to determine second snapshot data according to the identification information of first snapshot data; wherein, the first snapshot data is the snapshot data adjacent to the second snapshot data in a first storage space, and the migration time of the first snapshot data is earlier than the migration time of the second snapshot data; A second determination module, configured to determine first incremental data between the first snapshot data and the second snapshot data; A first migration module, configured to migrate the first incremental data to a second storage space of a target server, so that the target server determines the second snapshot data based on the first incremental data.
9. A server, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.