Data migration method and device and computing equipment

By obtaining the snapshot depth and speed fitting relationship of the virtual machine and dynamically adjusting the migration speed and duration, the problem of low migration efficiency in virtual machine migration is solved, achieving more efficient data migration and reducing business interruptions.

CN120631497APending Publication Date: 2025-09-12XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510559099.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

In the prior art, during the virtual machine migration process, a fixed data volume threshold is used to determine whether to shut down the machine, resulting in low migration efficiency.

Method used

By obtaining the snapshot depth and speed fitting relationship corresponding to the snapshot data of the source virtual machine, the migration speed and duration are determined. Based on the actual situation, it is decided whether to shut down the source virtual machine and migrate the snapshot data to the target virtual machine to improve migration efficiency.

Benefits of technology

The accuracy of determining whether the source virtual machine meets the shutdown conditions is improved, the impact of business interruption on users is reduced, the snapshot data migration time is ensured to be within an acceptable range, and the migration efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120631497A_ABST
    Figure CN120631497A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data migration method and device and computing equipment. The method comprises the following steps: a first computing device obtains a snapshot depth corresponding to snapshot data of a source virtual machine, and obtains a speed fitting relationship; according to a snapshot depth and speed fitting relation, determining a migration speed; determining migration duration corresponding to the snapshot data according to the migration speed; and when it is determined that the source virtual machine meets a closing condition according to the migration duration, closing the source virtual machine, and migrating the snapshot data from a second computing device where the source virtual machine is located to a third computing device where the target virtual machine is located. Through the method provided by the embodiment of the invention, the migration efficiency 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 computing devices, and in particular to a data migration method, apparatus, and computing device. Background Art

[0002] Currently, there are various ways to migrate virtual machines, including warm migration.

[0003] In related technologies, during a warm migration of a virtual machine, a second computing device can perform a snapshot operation on the source virtual machine to obtain snapshot data. During the migration of the snapshot data to a third computing device, if the total amount of data to be migrated is less than a data total threshold, the second computing device can control the source virtual machine to shut down. The second computing device can transmit incremental data (data generated by the source virtual machine between the time of the last snapshot operation and the time the source virtual machine was shut down) to the third computing device. After receiving the incremental data, the third computing device can start the target virtual machine created by the second computing device.

[0004] However, in the related art, during the data migration process, a fixed data volume threshold needs to be used to determine whether to shut down, which leads to the problem of low migration efficiency in the method in the related art. Summary of the Invention

[0005] The embodiments of the present application provide a data migration method, apparatus, and computing device, which improve migration efficiency.

[0006] In a first aspect, an embodiment of the present application provides a data migration method, applied to a first computing device, the method comprising:

[0007] Obtain the snapshot depth corresponding to the snapshot data of the source virtual machine and obtain the speed fitting relationship;

[0008] The migration speed is determined based on the relationship between snapshot depth and speed fitting;

[0009] Determine the migration duration for the snapshot data based on the migration speed.

[0010] If it is determined that the source virtual machine meets the shutdown condition based on the migration duration, the source virtual machine is shut down, and the snapshot data is migrated from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0011] In this solution, the first computing device can obtain the snapshot depth corresponding to the snapshot data of the source virtual machine and obtain the speed fitting relationship. The first computing device can determine the migration speed based on the snapshot depth and speed fitting relationship, and then determine the migration duration corresponding to the snapshot data based on the migration speed. The first computing device can shut down the source virtual machine when it is determined that the source virtual machine meets the shutdown condition based on the migration duration, and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located. Compared with the related art, which directly compares the total amount of data to be migrated with a fixed data total amount threshold to determine whether the source virtual machine meets the shutdown condition, the embodiment of the present application can determine the migration duration that matches the actual situation of the snapshot data, and determine whether the source virtual machine meets the shutdown condition based on the migration duration, thereby improving the accuracy of determining whether the source virtual machine meets the shutdown condition, so that the actual migration duration of the snapshot data is within an acceptable range, improving migration efficiency, and reducing the impact of business interruption (business interruption caused by shutting down the source virtual machine) on users.

[0012] In one implementation, determining the migration speed based on a snapshot depth and speed fitting relationship includes:

[0013] Determining the empirical migration speed corresponding to the snapshot data according to a first speed fitting relationship in the snapshot depth and speed fitting relationship; the first speed fitting relationship is used to indicate the relationship between the snapshot depth and the empirical migration speed;

[0014] Get the current migration time;

[0015] Determining a predicted instantaneous migration speed corresponding to the snapshot data according to a second speed fitting relationship in the current migration time and speed fitting relationship; the second speed fitting relationship is used to indicate a relationship between the migration time and the instantaneous migration speed;

[0016] The migration speed is determined based on the empirical migration speed and the predicted instantaneous migration speed.

[0017] In this solution, the first computing device can determine the empirical migration speed corresponding to the snapshot data based on the relationship between the snapshot depth and the first speed fit. The first computing device can also determine the predicted instantaneous migration speed corresponding to the snapshot data based on the relationship between the current migration moment and the second speed fit. The first computing device can determine the migration speed based on the empirical migration speed and the predicted instantaneous migration speed. This approach improves the accuracy of determining the migration speed, thereby improving the accuracy of determining the migration duration corresponding to the snapshot data, and thereby improving the accuracy of determining whether the source virtual machine meets the shutdown condition based on the migration duration, thereby improving data migration efficiency.

[0018] In one implementation, determining the migration speed based on the empirical migration speed and the predicted instantaneous migration speed includes:

[0019] Obtaining a first weight coefficient and a second weight coefficient stored in the first computing device;

[0020] The migration speed is determined according to the empirical migration speed, the first weight coefficient, the predicted instantaneous migration speed, and the second weight coefficient.

[0021] In this solution, the first computing device can obtain the first weight coefficient and the second weight coefficient stored in the first computing device and determine the migration speed based on the empirical migration speed, the first weight coefficient, the predicted instantaneous migration speed, and the second weight coefficient. By incorporating the first and second weight coefficients into the calculation process, the accuracy of the migration speed is improved.

[0022] In one implementation, before obtaining the snapshot data of the source virtual machine, the method further includes:

[0023] Get the actual migration speed corresponding to historical snapshot data;

[0024] Get the historical experience migration speed corresponding to the historical snapshot data;

[0025] Obtain the historical predicted instantaneous migration speed corresponding to the historical snapshot data;

[0026] A first weight coefficient and a second weight coefficient are determined and stored according to the actual migration speed, the historical experience migration speed, and the historical predicted instantaneous migration speed.

[0027] In this solution, after migrating historical snapshot data from the second computing device where the source virtual machine resides to the third computing device where the target virtual machine resides, the first computing device can determine a first weight coefficient and a second weight coefficient based on the actual migration speed corresponding to the historical snapshot data, the historically experienced migration speed corresponding to the historical snapshot data, and the historically predicted instantaneous migration speed corresponding to the historical snapshot data. By continuously correcting the first and second weight coefficients based on the actual migration status of the historical snapshot data, the accuracy of the migration speed is improved.

[0028] In one implementation, before obtaining the snapshot data of the source virtual machine, the method further includes:

[0029] Obtain multiple historical sampling data corresponding to the historical snapshot data; the historical sampling data includes the historical migration time and the historical instantaneous migration speed;

[0030] A fitting process is performed on a plurality of historical sampling data to obtain a second speed fitting relationship.

[0031] In this solution, the migration speed of snapshot data is correlated with the migration speed of historical snapshot data. Therefore, after migrating the historical snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located, the first computing device can perform fitting processing on multiple historical sampling data corresponding to the historical snapshot data (including historical migration moments and historical instantaneous migration speeds) to obtain a second speed fitting relationship. This allows the first computing device to predict the instantaneous migration speed corresponding to the current moment based on the current migration moment and the second speed fitting relationship when acquiring snapshot data. In other words, the predicted instantaneous migration speed corresponding to the current migration moment is obtained. This improves the accuracy of determining the predicted instantaneous migration speed.

[0032] In one implementation, determining the migration duration corresponding to the snapshot data based on the migration speed includes:

[0033] Get the total amount of data corresponding to the snapshot data;

[0034] Determine the migration duration based on the total amount of data and migration speed.

[0035] In this solution, the first computing device can determine the migration duration based on the total amount of data corresponding to the snapshot data and the migration speed corresponding to the snapshot data.

[0036] In one implementation, when it is determined that the source virtual machine meets the shutdown condition based on the migration duration, shutting down the source virtual machine and migrating snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located include:

[0037] Determine whether the migration duration is less than the migration duration threshold;

[0038] If the migration duration is less than the migration duration threshold, determining that the source virtual machine meets the shutdown condition;

[0039] The source virtual machine is shut down, and the snapshot data is migrated from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0040] In this solution, the first computing device can determine that the source virtual machine meets the shutdown condition when the migration duration corresponding to the snapshot data is less than the migration duration threshold. The first computing device can shut down the source virtual machine when the source virtual machine meets the shutdown condition, and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located. Through the above method, the accuracy of whether the source virtual machine meets the shutdown condition is improved. In addition, through the above method, the actual migration duration of the snapshot data can be made within the range acceptable to the user, reducing the impact of business interruption (business interruption caused by shutting down the source virtual machine) on the user.

[0041] In one implementation, before determining the migration speed based on the snapshot depth and speed fitting relationship, the method further includes:

[0042] Verify that the snapshot depth is less than or equal to the snapshot depth threshold.

[0043] In this solution, since the read and write performance of the source virtual machine will drop significantly as the snapshot depth increases, new snapshot data cannot be generated indefinitely. When the snapshot depth is less than or equal to the snapshot depth threshold, it means that the read and write performance of the source virtual machine is still within an acceptable range. The first computing device can determine the migration speed and then the migration duration based on the relationship between the snapshot depth and the speed fitting. When the migration duration is less than the migration duration threshold, it is determined that the source virtual machine meets the shutdown conditions, shuts down the source virtual machine, and migrates the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located. In this way, the efficiency of data migration can be improved.

[0044] In one implementation, the method further includes:

[0045] When the snapshot depth is greater than the snapshot depth threshold, a reminder message is generated; the reminder message is used to remind the user to select a target processing method; the target processing method is a processing method of canceling the migration, or the target processing method is a processing method of shutting down the source virtual machine and migrating the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0046] In this solution, if the snapshot depth exceeds a threshold, the first computing device can generate a reminder message to prompt the user to select a target processing method. The target processing method can be to cancel the migration, or to shut down the source virtual machine and migrate the snapshot data from the second computing device where the source virtual machine resides to the third computing device where the target virtual machine resides. This allows the data migration process to be controlled by the user.

[0047] In a second aspect, an embodiment of the present application provides a data migration apparatus, applied to a first computing device, the data migration apparatus comprising:

[0048] A processing module, configured to obtain a snapshot depth corresponding to the snapshot data of the source virtual machine and obtain a speed fitting relationship;

[0049] The processing module is further used to determine the migration speed based on the snapshot depth and speed fitting relationship;

[0050] The processing module is further used to determine the migration duration corresponding to the snapshot data according to the migration speed;

[0051] The control module is used to shut down the source virtual machine when it is determined that the source virtual machine meets the shutdown condition based on the migration duration, and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0052] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0053] In one implementation, the processing module is specifically configured to:

[0054] Determining the empirical migration speed corresponding to the snapshot data according to a first speed fitting relationship in the snapshot depth and speed fitting relationship; the first speed fitting relationship is used to indicate the relationship between the snapshot depth and the empirical migration speed;

[0055] Get the current migration time;

[0056] Determining a predicted instantaneous migration speed corresponding to the snapshot data according to a second speed fitting relationship in the current migration time and speed fitting relationship; the second speed fitting relationship is used to indicate a relationship between the migration time and the instantaneous migration speed;

[0057] The migration speed is determined based on the empirical migration speed and the predicted instantaneous migration speed.

[0058] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0059] In one implementation, the processing module is specifically configured to:

[0060] Obtaining a first weight coefficient and a second weight coefficient stored in the first computing device;

[0061] The migration speed is determined according to the empirical migration speed, the first weight coefficient, the predicted instantaneous migration speed, and the second weight coefficient.

[0062] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0063] In one implementation, the processing module is further configured to:

[0064] Get the actual migration speed corresponding to historical snapshot data;

[0065] Get the historical experience migration speed corresponding to the historical snapshot data;

[0066] Obtain the historical predicted instantaneous migration speed corresponding to the historical snapshot data;

[0067] A first weight coefficient and a second weight coefficient are determined and stored according to the actual migration speed, the historical experience migration speed, and the historical predicted instantaneous migration speed.

[0068] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0069] In one implementation, the processing module is further configured to:

[0070] Obtain multiple historical sampling data corresponding to the historical snapshot data; the historical sampling data includes the historical migration time and the historical instantaneous migration speed;

[0071] A fitting process is performed on a plurality of historical sampling data to obtain a second speed fitting relationship.

[0072] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0073] In one implementation, the processing module is specifically configured to:

[0074] Get the total amount of data corresponding to the snapshot data;

[0075] Determine the migration duration based on the total amount of data and migration speed.

[0076] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0077] In one implementation, the control module is specifically configured to:

[0078] Determine whether the migration duration is less than the migration duration threshold;

[0079] If the migration duration is less than the migration duration threshold, determining that the source virtual machine meets the shutdown condition;

[0080] The source virtual machine is shut down, and the snapshot data is migrated from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0081] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0082] In one implementation, before determining the migration speed based on the snapshot depth and speed fitting relationship, the control module is further configured to:

[0083] Verify that the snapshot depth is less than or equal to the snapshot depth threshold.

[0084] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0085] In one implementation, the control module is further configured to:

[0086] When the snapshot depth is greater than the snapshot depth threshold, a reminder message is generated; the reminder message is used to remind the user to select a target processing method; the target processing method is a processing method of canceling the migration, or the target processing method is a processing method of shutting down the source virtual machine and migrating the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0087] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0088] In a third aspect, an embodiment of the present application provides a computing device, the computing device including a memory and a processor;

[0089] The memory is coupled to the processor;

[0090] Memory is used to store computer instructions;

[0091] The processor is configured to execute computer instructions to enable the computing device to implement the method of the first aspect.

[0092] The computing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principles and beneficial effects are similar and will not be repeated here.

[0093] In a fourth aspect, an embodiment of the present application provides a data migration system, comprising a first computing device, a second computing device, and a third computing device; wherein the second computing device runs a source virtual machine, and the third computing device runs a target virtual machine; and the first computing device is configured to:

[0094] Obtain the snapshot depth corresponding to the snapshot data of the source virtual machine and obtain the speed fitting relationship;

[0095] The migration speed is determined based on the relationship between snapshot depth and speed fitting;

[0096] Determine the migration duration for the snapshot data based on the migration speed.

[0097] When it is determined that the source virtual machine meets the shutdown condition based on the migration duration, the source virtual machine is shut down, and the snapshot data is migrated from the second computing device to the third computing device.

[0098] The first computing device in the data migration system provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0099] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method of the first aspect.

[0100] When the computer-executable instructions in the computer-readable storage medium provided in the embodiment of the present application are executed by the processor, the technical solution shown in the above method embodiment can be implemented. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0101] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which is used to implement the method of the first aspect when executed by a processor.

[0102] When the computer program in the computer program product provided in the embodiment of the present application is executed by a processor, the technical solution shown in the above method embodiment can be implemented. Its implementation principles and beneficial effects are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0103] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0104] Figure 1 A schematic diagram of a data migration method according to an embodiment of the present invention;

[0105] Figure 2a A flowchart of a first embodiment of a data migration method provided in an embodiment of the present application;

[0106] Figure 2b A schematic diagram of historical snapshot data and snapshot data provided in an embodiment of the present application;

[0107] Figure 3a A flowchart of a second embodiment of a data migration method provided in an embodiment of the present application;

[0108] Figure 3b A schematic diagram of the speed of obtaining snapshot data provided by an embodiment of the present application;

[0109] Figure 4 A flowchart of a third embodiment of a data migration method provided in an embodiment of the present application;

[0110] Figure 5 A flowchart of a fourth embodiment of a data migration method provided in an embodiment of the present application;

[0111] Figure 6a A flowchart of a fourth embodiment of a data migration method provided in an embodiment of the present application;

[0112] Figure 6b A schematic diagram of a data migration scenario provided in an embodiment of the present application;

[0113] Figure 7 A schematic diagram of the structure of a data migration device provided in an embodiment of the present application;

[0114] Figure 8 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0115] To make the purpose, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments made by ordinary technicians in this field based on the inspiration of these embodiments fall within the scope of protection of this application.

[0116] The terms "first," "second," "third," "fourth," etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential sequence. It should be understood that the numbers used in this way are interchangeable where appropriate so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or apparatus.

[0117] Glossary:

[0118] A virtual machine is a complete computer system emulated through software, with full hardware system functionality, running in a completely isolated environment. Any tasks that can be performed on a physical computing device can also be performed on a virtual machine. When creating a virtual machine on a computing device, a portion of the computing device's hard drive and memory capacity is used as the virtual machine's hard drive and memory capacity. Each virtual machine has its own independent hard drive and operating system, and can be operated just like a physical computing device.

[0119] Virtual Machine Management Platform: Used to create and manage virtual machines. Additionally, the virtual machine management platform supports virtual machine snapshots and live migration, allowing the state of a virtual machine to be saved, restored, or migrated between different computing devices (physical hosts).

[0120] Warm migration: The second computing device can perform a snapshot operation on the source virtual machine to obtain snapshot data (including multiple dirty memory pages (or dirty disk blocks) data). In the process of migrating the snapshot data to the third computing device, if the source virtual machine meets the shutdown conditions, the second computing device can control the source virtual machine to shut down. The second computing device can transmit incremental data (data generated by the source virtual machine between the time of the last snapshot operation and the time when the source virtual machine is shut down) to the third computing device, and the third computing device can start the target virtual machine created by the third computing device after receiving the incremental data. Warm migration performs well in scenarios where a short virtual machine shutdown is acceptable, and can reduce the duration of business interruption to a certain extent.

[0121] An embodiment of the present application provides a data migration method in which a first computing device can determine a migration speed, and thus a migration duration, based on a snapshot depth and speed fitting relationship corresponding to the snapshot data. If the first computing device determines, based on the migration duration, that the source virtual machine meets shutdown conditions, it can shut down the source virtual machine and migrate the snapshot data from a second computing device, where the source virtual machine resides, to a third computing device, where the target virtual machine resides. This improves migration efficiency.

[0122] The data migration method of the embodiment of the present application is described in detail below.

[0123] Figure 1 A schematic diagram of a data migration method provided in an embodiment of the present application. Figure 1 As shown, the scenario includes a data migration system 10 and a terminal device 20 .

[0124] The data migration system 10 includes a first computing device 101, a second computing device 102, and a third computing device 103. The first computing device 101 is communicatively connected to the second computing device 102, the third computing device 103, and the terminal device 20 respectively.

[0125] The first computing device 101 runs a migration component, which includes a World Wide Web (web) service and a computing component, which includes a transmitter and a controller.

[0126] The source virtual machine management platform and the source virtual machine run on the second computing device 102 .

[0127] The target virtual machine management platform is run on the third computing device 103. In addition, after the target virtual machine management platform creates the target virtual machine, the target virtual machine can also be run on the third computing device 103 ( Figure 1 not shown).

[0128] It should be noted that, in one implementation, the first computing device 101 and the second computing device 102 may be integrated into one computing device. In other words, the migration component, the source virtual machine management platform, and the source virtual machine run on the same computing device.

[0129] In one implementation, the first computing device 101 and the third computing device 103 may be integrated into one computing device. In other words, the migration component and the target virtual machine management platform run on the same computing device.

[0130] In one implementation, the first computing device 101 may be an independent computing device.

[0131] It should be noted that the first computing device 101 may be a server. Architecturally, the server may be a rack server, a high-density server, a tower server, or a whole-cabinet server. Functionally, the server may be a general-purpose server or an artificial intelligence (AI) server. For example, the AI ​​server may be a graphics processing unit (GPU) server.

[0132] The second computing device 102 and the third computing device 103 may be servers.

[0133] It should also be noted that the terminal device 20 can be, but is not limited to, a laptop computer, a desktop computer, etc. Exemplary embodiments of the terminal device involved in the embodiments of the present application include, but are not limited to, terminal devices equipped with iOS, Android, Windows, Harmony OS, or other operating systems. The embodiments of the present application do not specifically limit the type of terminal device.

[0134] exist Figure 1 In the scenario shown:

[0135] The first computing device 101 may obtain the snapshot depth corresponding to the snapshot data of the source virtual machine and obtain the speed fitting relationship.

[0136] The first computing device 101 may determine the migration speed according to a fitting relationship between the snapshot depth and the speed.

[0137] The first computing device 101 may determine the migration duration corresponding to the snapshot data according to the migration speed.

[0138] The first computing device 101 may shut down the source virtual machine if it determines, based on the migration duration, that the source virtual machine meets the shutdown conditions, and migrate the snapshot data from the second computing device 102 where the source virtual machine is located to the third computing device 103 where the target virtual machine is located.

[0139] It should be noted that Figure 1 This is a schematic diagram of the scenario provided by the embodiment of the present application. The embodiment of the present application is not correct. Figure 1 The actual form of the various devices included in the Figure 1 The interaction mode between devices is limited and can be set according to actual needs in the application of the solution.

[0140] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0141] Figure 2a This is a flow chart of a data migration method embodiment 1 provided in the present application. Figure 2a , the method specifically comprises the following steps:

[0142] S201: Obtaining a snapshot depth corresponding to snapshot data of a source virtual machine, and obtaining a speed fitting relationship.

[0143] The source virtual machine runs on the second computing device.

[0144] The first computing device may control the second computing device to generate snapshot data of the source virtual machine.

[0145] In one implementation:

[0146] After controlling the second computing device to migrate the historical snapshot data to the third computing device, the first computing device may determine whether the source virtual machine meets the data generation condition. In one implementation, the first computing device may start a timer and obtain a time duration after controlling the second computing device to generate the historical snapshot data. The first computing device may determine that the source virtual machine meets the data generation condition when the time duration reaches a preset time duration.

[0147] When the source virtual machine meets the data generation condition, the first computing device may control the second computing device to generate snapshot data of the source virtual machine.

[0148] In one implementation, the historical snapshot data may be full snapshot data. It should be noted that the full snapshot data is a complete historical state image of the source virtual machine, including all data required for the operation of the source virtual machine.

[0149] The following describes a process in which the first computing device generates full snapshot data.

[0150] In one implementation,

[0151] The first computing device may obtain a migration request sent by the terminal device. In one implementation, the migration request may include a migration duration threshold.

[0152] The first computing device may control the second computing device to generate full snapshot data of the source virtual machine in response to the migration request.

[0153] In this embodiment, after the second computing device generates snapshot data of the source virtual machine, the first computing device may obtain the snapshot depth corresponding to the snapshot data.

[0154] It should be noted that snapshot depth indicates the dependency level of a snapshot data relative to the full snapshot data, reflecting the order in which the snapshot data was generated and the cumulative path of the modified content. In other words, the snapshot depth is the number of layers of the snapshot data in the entire snapshot chain (the number of dependent preceding snapshot data).

[0155] For example, Figure 2b A schematic diagram of historical snapshot data and snapshot data provided in an embodiment of the present application. Figure 2b As shown, the second computing device generates historical snapshot data 0 (full snapshot data), historical snapshot data 1, historical snapshot data 2, historical snapshot data 3, and snapshot data in sequence.

[0156] It should be noted that historical snapshot data 0 (full snapshot data) is a complete historical state image of the source virtual machine, and the snapshot depth of historical snapshot data 0 (full snapshot data) is 0; historical snapshot data 1 records the modified content relative to full snapshot data 0, and the snapshot depth of historical snapshot data 1 is 1; historical snapshot data 2 records the modified content relative to historical snapshot data 1, and the snapshot depth of historical snapshot data 2 is 2; historical snapshot data 3 records the modified content relative to historical snapshot data 2, and the snapshot depth of historical snapshot data 3 is 3; snapshot data records the modified content relative to historical snapshot data 3, and the snapshot depth of snapshot data is 4.

[0157] In one possible implementation, the first computing device may further obtain a speed fitting relationship. In one implementation, the speed fitting relationship may be stored in a storage component (such as a memory or a hard disk) of the first computing device in the form of a table. The first computing device may obtain the speed fitting relationship stored in the storage component.

[0158] It should be noted that, in one implementation, the velocity fitting relationship includes a first velocity fitting relationship and a second velocity fitting relationship. The first velocity fitting relationship indicates the relationship between the snapshot depth and the empirical migration velocity, while the second velocity fitting relationship indicates the relationship between the migration time and the instantaneous migration velocity.

[0159] In one implementation, the speed fitting relationship is used to indicate the relationship between the migration speed and the snapshot depth.

[0160] S202: Determine the migration speed according to the snapshot depth and speed fitting relationship.

[0161] In this embodiment, the first computing device may determine the migration speed corresponding to the snapshot data according to a fitting relationship between the snapshot depth and the speed.

[0162] In one implementation:

[0163] The velocity fitting relationship includes a first velocity fitting relationship and a second velocity fitting relationship. The first velocity fitting relationship is used to indicate the relationship between the snapshot depth and the empirical migration velocity; the second velocity fitting relationship is used to indicate the relationship between the migration moment and the instantaneous migration velocity.

[0164] The first computing device may determine the empirical migration speed corresponding to the snapshot data based on a first speed fitting relationship in the snapshot depth and speed fitting relationship, wherein the first speed fitting relationship is used to indicate the relationship between the snapshot depth and the empirical migration speed.

[0165] The first computing device may obtain a current migration time.

[0166] The first computing device may determine the predicted instantaneous migration speed corresponding to the snapshot data based on a second speed fitting relationship in the current migration time and speed fitting relationship, wherein the second speed fitting relationship is used to indicate the relationship between the migration time and the instantaneous migration speed.

[0167] The first computing device may determine the migration speed according to the empirical migration speed and the predicted instantaneous migration speed.

[0168] In one implementation:

[0169] The velocity fitting relationship is used to indicate the relationship between migration velocity and snapshot depth.

[0170] The first computing device may determine the migration speed according to the snapshot depth and the speed fitting relationship.

[0171] S203: Determine the migration duration corresponding to the snapshot data according to the migration speed.

[0172] In this embodiment, the first computing device may obtain the total amount of data corresponding to the snapshot data and determine the migration duration based on the total amount of data and the migration speed.

[0173] For example, the first computing device may determine the migration duration based on the following formula:

[0174]

[0175] Among them, T is the migration time, M N is the total amount of data, V N is the migration speed.

[0176] S204: When it is determined that the source virtual machine meets the shutdown condition based on the migration duration, the source virtual machine is shut down, and the snapshot data is migrated from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0177] In this embodiment, the first computing device may determine whether the virtual machine meets the shutdown condition based on the migration duration.

[0178] The following describes a process in which the first computing device determines whether the virtual machine meets the shutdown condition based on the migration duration.

[0179] In one implementation,

[0180] The first computing device may determine whether the migration duration is less than a migration duration threshold.

[0181] If the migration duration is less than the migration duration threshold, the first computing device may determine that the source virtual machine meets the shutdown condition. If the source virtual machine meets the shutdown condition, the first computing device may shut down the source virtual machine and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0182] If the migration duration is greater than or equal to the migration duration threshold, the first computing device may determine that the source virtual machine does not meet the shutdown condition. If the source virtual machine does not meet the shutdown condition, the first computing device may migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0183] In addition, in one implementation, when the speed fitting relationship includes a second speed fitting relationship, when the source virtual machine does not meet the shutdown condition, during the process of the first computing device migrating the snapshot data from the second computing device to the third computing device, the first computing device can obtain multiple sampling data corresponding to the snapshot data, and perform fitting processing based on the multiple sampling data to obtain a new second speed fitting relationship.

[0184] In addition, when the source virtual machine does not meet the shutdown conditions, the first computing device can also obtain new snapshot data of the source virtual machine. After obtaining the new snapshot data, the first computing device can obtain a new snapshot depth (corresponding to the new snapshot data) and a speed fitting relationship. The first computing device can determine the new migration speed based on the new snapshot depth and the speed fitting relationship, and determine the new migration duration (corresponding to the new snapshot data) based on the new migration speed. When the first computing device determines that the source virtual machine meets the shutdown conditions based on the new migration duration, it can shut down the source virtual machine and migrate the new snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located. In addition, it should be noted that when the speed fitting relationship includes a second speed fitting relationship, the first computing device obtains the new snapshot data and the new speed fitting relationship when obtaining the new snapshot depth and the speed fitting relationship. The new speed fitting relationship includes a new second speed fitting relationship.

[0185] Beneficial effects of this embodiment: In this embodiment, the first computing device can obtain the snapshot depth and speed fitting relationship corresponding to the snapshot data. The first computing device can determine the migration speed corresponding to the snapshot data based on the snapshot depth and speed fitting relationship, and then determine the migration duration corresponding to the snapshot data. The first computing device can shut down the source virtual machine when it is determined that the source virtual machine meets the shutdown conditions based on the migration duration, and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device. Compared with the related art, which directly compares the total amount of data to be migrated with a fixed data total amount threshold to determine whether to shut down, the embodiment of the present application can determine the migration duration that matches the actual situation of the snapshot data, and determine whether the source virtual machine meets the shutdown conditions based on the migration duration, thereby improving the accuracy of determining whether the source virtual machine meets the shutdown conditions, so that the actual migration duration of the snapshot data is within an acceptable range, improving the migration efficiency, and reducing the impact of business interruption (business interruption caused by shutting down the source virtual machine) on users.

[0186] Figure 3a This is a flow chart of a second embodiment of a data migration method provided in this application. Figure 3a , the method specifically comprises the following steps:

[0187] S301: Obtaining a snapshot depth corresponding to snapshot data of a source virtual machine, and obtaining a speed fitting relationship.

[0188] In this embodiment, the first computing device may obtain the snapshot depth corresponding to the snapshot data of the source virtual machine. For example, the snapshot depth may be 3.

[0189] The first computing device stores the speed fitting relationship. The first computing device can obtain the speed fitting relationship stored in the first computing device.

[0190] The velocity fitting relationship includes a first velocity fitting relationship and a second velocity fitting relationship. The first velocity fitting relationship indicates the relationship between the snapshot depth and the empirical migration velocity, while the second velocity fitting relationship indicates the relationship between the migration moment and the instantaneous migration velocity.

[0191] S302: Determine an empirical migration speed corresponding to the snapshot data according to a first speed fitting relationship in the snapshot depth and speed fitting relationship.

[0192] First, the process of the second computing device acquiring snapshot data is described.

[0193] The source virtual machine runs on the second computing device.

[0194] The second computing device needs to query the historical snapshot data stored in the hard disk layer by layer to determine the historical state image of the source virtual machine.

[0195] The second computing device needs to obtain the current state image of the source virtual machine, and obtain snapshot data based on the current state image and the historical state image.

[0196] Based on the above content, it can be seen that the greater the snapshot depth, the more layers of historical snapshot data need to be queried, and accordingly, the slower the speed of obtaining snapshot data. For example, Figure 3b This is a schematic diagram of the speed of obtaining snapshot data provided by an embodiment of the present application. Figure 3b As shown, the greater the snapshot depth, the slower the speed of obtaining snapshot data.

[0197] The empirical migration speed of snapshot data is affected by the speed at which the snapshot data is acquired and the speed at which it is transmitted. Because the speed at which snapshot data is acquired is much slower than the speed at which data is transmitted, assuming external factors (such as the network environment and the computing performance of the source VM's computing device) are eliminated, the speed at which snapshot data is acquired can be used as the empirical migration speed.

[0198] The greater the snapshot depth, the slower the snapshot data acquisition speed. Correspondingly, the greater the snapshot depth, the slower the empirical migration speed of the snapshot data. The empirical migration speed of snapshot data and snapshot depth exhibit a linear relationship—the first speed fitting relationship.

[0199] For example, the first speed fitting relationship may be:

[0200] V 1,N =k×N+b1

[0201] Among them, k and b1 are constants, V 1,N is the empirical migration speed, N is the snapshot depth. It should be noted that k is a negative value.

[0202] By testing multiple hard disks in advance, a first speed fitting relationship can be obtained.

[0203] The first computing device may store a first speed fitting relationship.

[0204] After acquiring the snapshot depth, the first computing device may determine the empirical migration speed corresponding to the snapshot data according to the snapshot depth and a first speed fitting relationship stored in the first computing device.

[0205] S303: Obtain the current migration time.

[0206] In this embodiment, the first computing device can obtain the current migration time. In one implementation, the time axis of the migration process can be based on the creation time of the full snapshot data as the origin (t=0), and the current migration time can be an offset relative to the origin.

[0207] S304: Determine a predicted instantaneous migration speed corresponding to the snapshot data according to the current migration moment and a second speed fitting relationship in the speed fitting relationship.

[0208] In this embodiment, the first computing device may pre-build and store a second speed fitting relationship, wherein the second speed fitting relationship is used to indicate the relationship between the migration moment and the instantaneous migration speed.

[0209] The first computing device may determine a predicted instantaneous migration speed corresponding to the snapshot data according to a fitting relationship between the current migration moment and the second speed.

[0210] The following describes a process in which the first computing device pre-constructs the second speed fitting relationship.

[0211] In one implementation,

[0212] The first computing device can obtain multiple historical sampled data corresponding to the historical snapshot data. The historical sampled data includes historical migration moments and historical instantaneous migration speeds. It should be noted that during the process of migrating the historical snapshot data from the second computing device to the third computing device, the first computing device can collect multiple historical sampled data corresponding to the historical snapshot data.

[0213] The first computing device may perform fitting processing on the plurality of historical sampling data to obtain a second speed fitting relationship.

[0214] For example, the second speed fitting relationship may be:

[0215] V 2,N =m N ×t+b2

[0216] Among them, m N and b2 are constants, V 2,N is the instantaneous migration speed, and t is the migration time.

[0217] S305: Determine the migration speed based on the empirical migration speed and the predicted instantaneous migration speed.

[0218] In this embodiment, the first computing device may determine the migration speed based on the empirical migration speed and the predicted instantaneous migration speed.

[0219] In one implementation,

[0220] The first computing device may obtain a first weight coefficient and a second weight coefficient corresponding to the snapshot depth. It should be noted that the first weight coefficient and the second weight coefficient are predetermined and stored by the first computing device.

[0221] The first computing device may determine the migration speed according to the empirical migration speed, the first weight coefficient, the predicted instantaneous migration speed, and the second weight coefficient.

[0222] For example, the first computing device may determine the migration speed based on the following formula:

[0223] V N =w1×V 1,N +w2×V 2,N

[0224] Among them, V N is the migration speed; w1 is the first weight coefficient; V 1,N is the experience migration speed, w2 is the second weight coefficient, V 2,N To predict the instantaneous migration speed.

[0225] The following describes a process in which the first computing device predetermines and stores the first weight coefficient and the second weight coefficient.

[0226] In one implementation,

[0227] The first computing device may obtain an actual migration speed corresponding to the historical snapshot data.

[0228] The first computing device may obtain a historical experience migration speed corresponding to the historical snapshot data.

[0229] The first computing device may obtain a historical predicted instantaneous migration speed corresponding to the historical snapshot data.

[0230] The first computing device may determine and store a first weight coefficient and a second weight coefficient according to an actual migration speed, a historically experienced migration speed, and a historically predicted instantaneous migration speed.

[0231] Exemplarily, the first computing device may determine the first weight coefficient and the second weight coefficient based on the following formula:

[0232] V N-1 =w1×V 1,N-1 +w2×V 2,N-1

[0233] w1+w2=1

[0234] Among them, V N-1 is the actual migration speed corresponding to the historical snapshot data; w1 is the first weight coefficient; V 1,N-1 is the historical experience migration speed corresponding to the historical snapshot data, w2 is the second weight coefficient, V 2,N-1 Predict instantaneous migration speed for history.

[0235] S306: Determine the migration duration corresponding to the snapshot data according to the migration speed.

[0236] In this embodiment, the first computing device may determine the migration duration corresponding to the snapshot data according to the migration speed.

[0237] The specific implementation process is the same as S203 and will not be repeated here.

[0238] S307: When it is determined that the source virtual machine meets the shutdown condition based on the migration duration, the source virtual machine is shut down, and the snapshot data is migrated from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0239] In this embodiment, the first computing device may determine whether the source virtual machine meets the shutdown condition based on the migration duration.

[0240] When the source virtual machine meets the shutdown condition, the first computing device may shut down the source virtual machine and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0241] Furthermore, it should be noted that, in one implementation, if the source virtual machine does not meet the shutdown conditions, the first computing device may migrate the snapshot data from the second computing device to the third computing device. Furthermore, the first computing device may also obtain new snapshot data of the source virtual machine to initiate a new data migration process. It should be noted that the new snapshot data is generated by the first computing device controlling the second computing device.

[0242] In addition, it should be noted that, in one implementation, the first computing device may obtain the actual migration speed corresponding to the snapshot data. The first computing device may obtain the empirical migration speed corresponding to the snapshot data. The first computing device may obtain the predicted instantaneous migration speed corresponding to the snapshot data. The first computing device may determine and store a new first weight coefficient and a new second weight coefficient based on the actual migration speed corresponding to the snapshot data, the empirical migration speed corresponding to the snapshot data, and the predicted instantaneous migration speed corresponding to the snapshot data.

[0243] Beneficial effects of this embodiment: In this embodiment, the first computing device can obtain the snapshot depth and speed fitting relationship (including the first speed fitting relationship and the second speed fitting relationship) corresponding to the snapshot data. The first computing device can determine the empirical migration speed corresponding to the snapshot data based on the snapshot depth and the first speed fitting relationship. The first computing device can obtain the current migration moment and determine the predicted instantaneous migration speed corresponding to the snapshot data based on the current migration moment and the second speed fitting relationship. The first computing device can determine the migration speed based on the empirical migration speed and the predicted instantaneous migration speed, and determine the migration duration corresponding to the snapshot data based on the migration speed. The first computing device can shut down the source virtual machine if it is determined based on the migration duration that the source virtual machine meets the shutdown conditions, and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located. Compared with the related art, which directly determines whether to shut down based on a fixed data total amount threshold, the method of the embodiment of the present application can determine the empirical migration speed and the predicted instantaneous migration speed based on the snapshot depth of the snapshot data and the speed fitting relationship, and then determine the migration speed. Through the above method, the accuracy of determining the migration speed is improved, thereby improving the accuracy of determining the migration duration, and thus improving the accuracy of determining whether the source virtual machine meets the shutdown condition based on the migration duration.

[0244] Figure 4 This is a flow chart of a third embodiment of a data migration method provided in this application. Figure 4 , the method specifically comprises the following steps:

[0245] S401: Obtaining a snapshot depth corresponding to snapshot data of a source virtual machine, and obtaining a speed fitting relationship.

[0246] In this embodiment, the first computing device may obtain the snapshot depth corresponding to the snapshot data of the source virtual machine.

[0247] The first computing device stores the speed fitting relationship. The first computing device can obtain the speed fitting relationship stored in the first computing device.

[0248] The velocity fitting relationship is used to indicate the relationship between migration velocity and snapshot depth.

[0249] In one implementation, the speed fitting relationship may be:

[0250] V N =k×N+b1

[0251] Where k and b1 are constants, N is the snapshot depth, V N is the migration speed. It should be noted that k is a negative value. It should also be noted that k and b1 are obtained by pre-testing multiple hard drives.

[0252] S402: Determine whether the snapshot depth is less than or equal to a snapshot depth threshold.

[0253] In this embodiment, after obtaining the snapshot depth, the first computing device may determine whether the snapshot depth is less than or equal to a snapshot depth threshold.

[0254] If the snapshot depth is less than or equal to the snapshot depth threshold, the first computing device may execute S403;

[0255] When the snapshot depth is greater than the snapshot depth threshold, the first computing device may generate reminder information.

[0256] The reminder message is used to prompt the user to select a target processing method. In one implementation, the target processing method is to cancel the migration. Alternatively, the target processing method is to shut down the source virtual machine and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0257] The first computing device may obtain the target processing method selected by the user. It should be noted that, in one implementation, the first computing device may send a reminder message to the terminal device, and the terminal device may display the reminder message. The terminal device may obtain the target processing method selected by the user and send the target processing method to the first computing device.

[0258] When the target processing mode is a processing mode of canceling migration, the first computing device controls the second computing device to cancel the migration process of the source virtual machine according to the target processing mode.

[0259] When the target processing method is to shut down the source virtual machine and migrate the snapshot data from the second computing device to the third computing device, the first computing device can shut down the source virtual machine (control the second computing device to shut down the source virtual machine) and migrate the snapshot data from the second computing device to the third computing device.

[0260] S403: Determine the migration speed according to the snapshot depth and speed fitting relationship.

[0261] In this embodiment, the first computing device may determine the migration speed according to a fitting relationship between the snapshot depth and the speed.

[0262] S404: Determine the migration duration corresponding to the snapshot data according to the migration speed.

[0263] In this embodiment, the first computing device may determine the migration duration corresponding to the snapshot data according to the migration speed.

[0264] The specific implementation process is the same as S203 and will not be repeated here.

[0265] S405: When it is determined that the source virtual machine meets the shutdown condition based on the migration duration, the source virtual machine is shut down, and the snapshot data is migrated from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0266] In this embodiment, the first computing device may determine whether the source virtual machine meets the shutdown condition based on the migration duration.

[0267] When the source virtual machine meets the shutdown condition, the first computing device may shut down the source virtual machine and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0268] When the source virtual machine does not meet the shutdown condition, the first computing device may migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0269] Beneficial effects of this embodiment: In this embodiment, the first computing device can obtain the snapshot depth corresponding to the snapshot data of the source virtual machine and obtain a speed fitting relationship (indicating the relationship between the snapshot depth and the migration speed). The first computing device can determine the migration speed based on the snapshot depth and speed fitting relationship. The first computing device can determine the migration duration corresponding to the snapshot data based on the migration speed. The first computing device can shut down the source virtual machine when it determines that the source virtual machine meets the shutdown condition based on the migration duration, and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located. Compared with the related art, which directly determines whether to shut down based on a fixed data total amount threshold, the method of the embodiment of the present application can determine the migration speed based on the snapshot depth and speed fitting relationship of the snapshot data. Through the above method, the accuracy of determining the migration speed is improved, and then the accuracy of determining the migration duration is improved, thereby improving the accuracy of determining whether the source virtual machine meets the shutdown condition based on the migration duration. In addition, since the speed at which the second computing device generates snapshot data gradually decreases as the snapshot depth increases, new snapshot data cannot be generated indefinitely. If the snapshot depth is less than or equal to the snapshot depth threshold, the source virtual machine's read and write performance remains within an acceptable range. The first computing device can then further determine whether the source virtual machine meets the shutdown conditions based on the migration duration. This approach further avoids the problem of excessive migration duration caused by the unlimited generation of new snapshot data, improving data migration efficiency and, consequently, virtual machine migration efficiency.

[0270] Figure 5 This is a flow chart of a fourth embodiment of a data migration method provided in the present application. Figure 5 , the method specifically comprises the following steps:

[0271] S501: Obtaining a snapshot depth corresponding to snapshot data of a source virtual machine, and obtaining a speed fitting relationship.

[0272] In this embodiment, the first computing device may obtain the snapshot depth corresponding to the snapshot data of the source virtual machine and obtain the speed fitting relationship.

[0273] The specific implementation process is the same as S201 and will not be repeated here.

[0274] S502: Determine whether the snapshot depth is less than or equal to a snapshot depth threshold.

[0275] In this embodiment, after obtaining the snapshot depth, the first computing device may determine whether the snapshot depth is less than or equal to a snapshot depth threshold.

[0276] If the snapshot depth is less than or equal to the snapshot depth threshold, the first computing device may execute S503;

[0277] When the snapshot depth is greater than the snapshot depth threshold, the first computing device may generate reminder information.

[0278] The reminder message is used to prompt the user to select a target processing method. In one implementation, the target processing method is to cancel the migration. Alternatively, the target processing method is to shut down the source virtual machine and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0279] S503: Determine the migration speed according to the snapshot depth and speed fitting relationship.

[0280] In this embodiment, the first computing device may determine the migration duration corresponding to the snapshot data according to a fitting relationship between the snapshot depth and the speed.

[0281] The specific implementation process is the same as S202 and will not be repeated here.

[0282] S504: Determine the migration duration corresponding to the snapshot data according to the migration speed.

[0283] In this embodiment, the first computing device may determine the migration duration corresponding to the snapshot data according to the migration speed.

[0284] The specific implementation process is the same as S203 and will not be repeated here.

[0285] S505: Determine whether the migration duration is less than a migration duration threshold.

[0286] In this embodiment, after obtaining the migration duration corresponding to the snapshot data, the first computing device may determine whether the migration duration is less than a migration duration threshold. In one implementation, the migration request includes the migration duration threshold, and the migration request is sent by the terminal device. In one implementation, the migration duration threshold is a preset migration duration threshold.

[0287] If yes, execute S506;

[0288] If not, execute S508.

[0289] S506: Determine whether the source virtual machine meets the shutdown condition.

[0290] In this embodiment, when the migration duration is less than the migration duration threshold, the first computing device may determine that the source virtual machine meets the shutdown condition.

[0291] S507: Shut down the source virtual machine, and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0292] In this embodiment, when the source virtual machine meets the shutdown condition, the first computing device can control the second computing device to shut down the source virtual machine. The first computing device can also migrate the snapshot data from the second computing device to the third computing device.

[0293] In addition, after the snapshot data is migrated to the third computing device, the first computing device can control the third computing device to start a target virtual machine, wherein the target virtual machine is pre-created by the third computing device.

[0294] S508: Determine that the source virtual machine does not meet the shutdown condition.

[0295] In this embodiment, when the migration duration is greater than or equal to the migration duration threshold, the first computing device may determine that the source virtual machine does not meet the shutdown condition.

[0296] S509: Migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0297] In this embodiment, when the source virtual machine does not meet the shutdown condition, the first computing device may migrate the snapshot data from the second computing device to the third computing device.

[0298] In addition, the first computing device may also control the second computing device to generate new snapshot data corresponding to the source virtual machine.

[0299] Beneficial Effects of This Embodiment: In this embodiment, after obtaining the migration duration, the first computing device can determine whether the source virtual machine meets the shutdown condition based on the migration duration and the migration duration threshold. If the source virtual machine meets the shutdown condition, the source virtual machine is shut down and the snapshot data is migrated from the second computing device where the source virtual machine resides to the third computing device where the target virtual machine resides. This improves data migration efficiency, thereby improving virtual machine migration efficiency.

[0300] A migration component may be run on the first computing device, the migration component including a web service and a computing component, wherein the computing component includes a controller and a transmitter. A source virtual machine management platform and a source virtual machine may be run on the second computing device. A target virtual machine management platform may be run on the third computing device.

[0301] The data migration process is described below from the perspective of the migration component through the fifth method embodiment.

[0302] Figure 6a This is a flow chart of a fifth embodiment of a data migration method provided in an embodiment of the present application. Figure 6a , the method specifically comprises the following steps:

[0303] S601: The Web service obtains a migration request submitted by a user.

[0304] In this embodiment, the Web service can obtain the migration request submitted by the user through the terminal device.

[0305] The migration request may include a migration duration threshold. In other words, the migration duration threshold may be a user-set duration threshold. It is understood that the migration duration threshold is the user-acceptable shutdown duration of the source virtual machine. In other words, the user-acceptable duration of the virtual machine's suspension of external services.

[0306] In one implementation, the migration request may further include an identifier of the source virtual machine.

[0307] S602: The computing component obtains the migration request sent by the web service.

[0308] In this embodiment, the computing component may obtain the migration request sent by the web service.

[0309] S603: The computing component sends a first generation request to the source virtual machine management platform in response to the migration request.

[0310] In this embodiment, the controller in the computing component can send a first generation request to the source virtual machine management platform in response to the migration request. The first generation request is used by the source virtual machine management platform to generate full snapshot data corresponding to the source virtual machine. In one implementation, the first generation request can also include an identifier of the source virtual machine.

[0311] S604: The source virtual machine management platform generates full snapshot data of the source virtual machine in response to the first generation request.

[0312] In this embodiment, the source virtual machine management platform can generate full snapshot data of the source virtual machine in response to the first generation request. In one implementation, the source virtual machine management platform can respond to the first generation request, determine the source virtual machine from multiple virtual machines managed by the source virtual machine management platform based on the identifier of the source virtual machine, and generate full snapshot data of the source virtual machine.

[0313] S605: The computing component migrates the full snapshot data from the source virtual machine management platform to the target virtual machine management platform.

[0314] In this embodiment, the transmitter in the computing component can migrate the full snapshot data from the source virtual machine management platform to the target virtual machine management platform.

[0315] S606: The computing component sends a second generation request to the source virtual machine management platform.

[0316] In this embodiment, the controller in the computing component may send a second generation request to the source virtual machine management platform, wherein the second generation request is used for the source virtual machine management platform to generate snapshot data of the source virtual machine.

[0317] S607: The source virtual machine management platform generates snapshot data of the source virtual machine in response to the second generation request.

[0318] In this embodiment, the source virtual machine management platform generates snapshot data of the source virtual machine in response to the second generation request.

[0319] It should be noted that the snapshot data is incremental data, which is data generated by the source virtual machine between the time when the full snapshot data is generated and the time when the snapshot data is generated.

[0320] S608: The computing component obtains the snapshot depth corresponding to the snapshot data of the source virtual machine, and obtains a speed fitting relationship.

[0321] In this embodiment, the controller in the computing component can obtain the snapshot depth corresponding to the snapshot data of the source virtual machine and obtain the speed fitting relationship.

[0322] The speed fitting relationship includes a first speed fitting relationship and a second speed fitting relationship.

[0323] The first velocity fitting relationship is used to indicate the relationship between snapshot depth and empirical migration velocity.

[0324] The second velocity fitting relationship is used to indicate the relationship between the migration moment and the instantaneous migration velocity.

[0325] It should be noted that the second speed fitting relationship is obtained by fitting the multiple historical sampling data after the controller obtains the multiple historical sampling data corresponding to the historical snapshot data; the historical sampling data includes the historical migration time and the historical instantaneous migration speed.

[0326] It should also be noted that the historical sampling data is collected by the controller when the transmitter migrates the historical snapshot data from the source virtual machine management platform to the target virtual machine management platform.

[0327] S609: The computing component determines that the snapshot depth is less than or equal to the snapshot depth threshold.

[0328] In this embodiment, the controller in the computing component may determine whether the snapshot depth is less than or equal to a snapshot depth threshold.

[0329] When the snapshot depth is less than or equal to the snapshot depth threshold, the controller in the computing component may execute S610 .

[0330] Additionally, if the snapshot depth exceeds a snapshot depth threshold, the controller in the computing component may generate a reminder message. The reminder message prompts the user to select a target processing method. In one implementation, the target processing method is to cancel the migration. Alternatively, the target processing method is to shut down the source virtual machine and migrate the snapshot data from the second computing device to the third computing device.

[0331] S610: The computing component determines the migration speed according to the snapshot depth and speed fitting relationship.

[0332] In this embodiment, the controller in the computing component can determine the migration speed corresponding to the snapshot data according to the snapshot depth and speed fitting relationship.

[0333] S611: The computing component determines the migration duration corresponding to the snapshot data according to the migration speed.

[0334] In this embodiment, the controller in the computing component can determine the migration duration corresponding to the snapshot data according to the migration speed.

[0335] S612: The calculation component determines whether the migration duration is less than a migration duration threshold.

[0336] In this embodiment, the controller in the computing component may determine whether the migration duration is less than a migration duration threshold.

[0337] If yes, execute S613;

[0338] If not, execute S615.

[0339] S613: The computing component determines that the source virtual machine meets the shutdown condition.

[0340] In this embodiment, when the migration duration is less than the migration duration threshold, the controller in the computing component may determine that the source virtual machine meets the shutdown condition.

[0341] S614: The computing component shuts down the source virtual machine and migrates the snapshot data from the source virtual machine management platform to the target virtual machine management platform.

[0342] In this embodiment, Figure 6b A schematic diagram of a data migration scenario provided in an embodiment of the present application. Figure 6b As shown, when the source virtual machine meets the shutdown conditions, the controller of the computing component can shut down the source virtual machine (control the source virtual machine management platform to shut down the source virtual machine).

[0343] The transporter of the computing component can also migrate snapshot data generated by the source virtual machine management platform from the source virtual machine management platform to the target virtual machine management platform. In other words, the transporter can send the snapshot data sent by the source virtual machine management platform to the target virtual machine management platform.

[0344] In addition, it should be noted that after migrating the snapshot data to the target virtual machine management platform, the controller of the computing component can control the target virtual machine management platform to run the target virtual machine, wherein the target virtual machine is created by the computing component controlling the target virtual machine management platform.

[0345] S615: The computing component determines that the source virtual machine does not meet the shutdown condition.

[0346] In this embodiment, when the migration duration is greater than or equal to the migration duration threshold, the controller in the computing component may determine that the source virtual machine does not meet the shutdown condition.

[0347] S616: The computing component migrates the snapshot data from the source virtual machine management platform to the target virtual machine management platform.

[0348] In this embodiment, when the source virtual machine does not meet the shutdown condition, the transmitter in the computing component can migrate the snapshot data from the source virtual machine management platform to the target virtual machine management platform.

[0349] In addition, it should be noted that if the source virtual machine does not meet the shutdown conditions, the controller in the computing component may also send a third generation request to the source virtual machine management platform. The third generation request is used for the source virtual machine management platform to generate new snapshot data corresponding to the source virtual machine. The source virtual machine management platform may generate new snapshot data corresponding to the source virtual machine in response to the third generation request.

[0350] The beneficial effects of this embodiment are as follows: the computing component can measure the migration duration corresponding to the snapshot data based on the migration duration threshold configured by the user (the shutdown duration of the source virtual machine acceptable to the user, in other words, the duration during which the virtual machine stops providing services to the outside world, which is acceptable to the user). When the migration duration corresponding to the snapshot data is less than the migration duration threshold, the computing component can determine that the source virtual machine meets the shutdown conditions. The computing component can shut down the source virtual machine and migrate the snapshot data from the source virtual machine management platform to the target virtual machine management platform. In the above manner, the source virtual machine can be shut down (the source virtual machine management platform can be controlled to shut down the source virtual machine) within the duration during which the virtual machine stops providing services to the outside world, which is acceptable to the user, and the snapshot data can be migrated from the source virtual machine management platform to the target virtual machine management platform, thereby improving the efficiency of data migration and reducing the impact of the data migration process on the business.

[0351] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

[0352] Figure 7 The data migration device is applied to a first computing device. Figure 7 As shown, the data migration device 70 includes a processing module 71 and a control module 72.

[0353] Processing module 71, used to obtain the snapshot depth corresponding to the snapshot data of the source virtual machine and obtain the speed fitting relationship;

[0354] The processing module 71 is further configured to determine the migration speed based on the snapshot depth and speed fitting relationship;

[0355] The processing module 71 is further configured to determine the migration duration corresponding to the snapshot data according to the migration speed;

[0356] The control module 72 is configured to shut down the source virtual machine and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located when it is determined that the source virtual machine meets the shutdown condition based on the migration duration.

[0357] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0358] In one implementation, the processing module 71 is specifically configured to:

[0359] Determining the empirical migration speed corresponding to the snapshot data according to a first speed fitting relationship in the snapshot depth and speed fitting relationship; the first speed fitting relationship is used to indicate the relationship between the snapshot depth and the empirical migration speed;

[0360] Get the current migration time;

[0361] Determining a predicted instantaneous migration speed corresponding to the snapshot data according to a second speed fitting relationship in the current migration time and speed fitting relationship; the second speed fitting relationship is used to indicate a relationship between the migration time and the instantaneous migration speed;

[0362] The migration speed is determined based on the empirical migration speed and the predicted instantaneous migration speed.

[0363] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0364] In one implementation, the processing module 71 is specifically configured to:

[0365] Obtaining a first weight coefficient and a second weight coefficient stored in the first computing device;

[0366] The migration speed is determined based on the empirical migration speed, the first weight coefficient, the predicted instantaneous migration speed, and the second weight coefficient.

[0367] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0368] In one implementation, the processing module 71 is further configured to:

[0369] Get the actual migration speed corresponding to historical snapshot data;

[0370] Get the historical experience migration speed corresponding to the historical snapshot data;

[0371] Obtain the historical predicted instantaneous migration speed corresponding to the historical snapshot data;

[0372] A first weight coefficient and a second weight coefficient are determined and stored according to the actual migration speed, the historical experience migration speed, and the historical predicted instantaneous migration speed.

[0373] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0374] In one implementation, the processing module 71 is further configured to:

[0375] Obtain multiple historical sampling data corresponding to the historical snapshot data; the historical sampling data includes the historical migration time and the historical instantaneous migration speed;

[0376] A fitting process is performed on a plurality of historical sampling data to obtain a second speed fitting relationship.

[0377] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0378] In one implementation, the processing module 71 is specifically configured to:

[0379] Get the total amount of data corresponding to the snapshot data;

[0380] Determine the migration duration based on the total amount of data and migration speed.

[0381] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0382] In one implementation, the control module 72 is specifically configured to:

[0383] Determine whether the migration duration is less than the migration duration threshold;

[0384] If the migration duration is less than the migration duration threshold, determining that the source virtual machine meets the shutdown condition;

[0385] The source virtual machine is shut down, and the snapshot data is migrated from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0386] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0387] In one implementation, before determining the migration speed based on the snapshot depth and speed fitting relationship, the control module 72 is further configured to:

[0388] Verify that the snapshot depth is less than or equal to the snapshot depth threshold.

[0389] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0390] In one implementation, the control module 72 is further configured to:

[0391] When the snapshot depth is greater than the snapshot depth threshold, a reminder message is generated; the reminder message is used to remind the user to select a target processing method; the target processing method is a processing method of canceling the migration, or the target processing method is a processing method of shutting down the source virtual machine and migrating the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

[0392] The data migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0393] Figure 8 This is a schematic diagram of the structure of a computing device provided in an embodiment of the present application. Figure 8 As shown, the computing device 80 includes: a processor 81 and a memory 82; wherein the processor 81 is coupled to the memory 82, and the memory 82 is used to store computer instructions; the processor 81 is used to execute computer instructions to enable the computing device 80 to execute the technical solution in the aforementioned method embodiment.

[0394] Optionally, the memory 82 may be independent or integrated with the processor 81. Optionally, when the memory 82 is a device independent of the processor 81, the computing device 80 may further include a bus 83 for connecting the above devices.

[0395] The processor is used to execute the technical solution in the aforementioned method embodiment, and its implementation principle and technical effects are similar and will not be repeated here.

[0396] An embodiment of the present application provides a data migration system, including a first computing device, a second computing device, and a third computing device; wherein the second computing device runs a source virtual machine, and the third computing device runs a target virtual machine; and the first computing device is configured to:

[0397] Obtain the snapshot depth corresponding to the snapshot data of the source virtual machine and obtain the speed fitting relationship;

[0398] The migration speed is determined based on the relationship between snapshot depth and speed fitting;

[0399] Determine the migration duration for the snapshot data based on the migration speed.

[0400] When it is determined that the source virtual machine meets the shutdown condition based on the migration duration, the source virtual machine is shut down, and the snapshot data is migrated from the second computing device to the third computing device.

[0401] The first computing device in the data migration system provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0402] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the technical solution provided by the aforementioned method embodiment.

[0403] An embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the technical solution provided by the aforementioned method embodiment.

[0404] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as volatile memory and non-volatile memory.

[0405] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A data migration method, characterized in that: Applied to a first computing device, the method includes: Obtain the snapshot depth corresponding to the snapshot data of the source virtual machine and obtain the speed fitting relationship; determining a migration speed according to a fitting relationship between the snapshot depth and the speed; Determining a migration duration corresponding to the snapshot data according to the migration speed; If it is determined that the source virtual machine meets the shutdown condition based on the migration duration, the source virtual machine is shut down, and the snapshot data is migrated from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

2. The method according to claim 1, characterized in that The determining the migration speed according to the snapshot depth and the speed fitting relationship includes: determining an empirical migration speed corresponding to the snapshot data according to a first speed fitting relationship among the snapshot depth and the speed fitting relationship, wherein the first speed fitting relationship is used to indicate a relationship between the snapshot depth and the empirical migration speed; Get the current migration time; determining a predicted instantaneous migration speed corresponding to the snapshot data according to the current migration time and a second speed fitting relationship in the speed fitting relationship, wherein the second speed fitting relationship is used to indicate a relationship between the migration time and the instantaneous migration speed; The migration speed is determined according to the empirical migration speed and the predicted instantaneous migration speed.

3. The method according to claim 2, characterized in that The determining the migration speed according to the empirical migration speed and the predicted instantaneous migration speed includes: Obtaining a first weight coefficient and a second weight coefficient stored in the first computing device; The migration speed is determined according to the empirical migration speed, the first weight coefficient, the predicted instantaneous migration speed, and the second weight coefficient.

4. The method according to claim 3, characterized in that Before obtaining the snapshot data of the source virtual machine, the method further includes: Get the actual migration speed corresponding to historical snapshot data; Obtaining the historical experience migration speed corresponding to the historical snapshot data; Obtaining the historical predicted instantaneous migration speed corresponding to the historical snapshot data; The first weight coefficient and the second weight coefficient are determined and stored according to the actual migration speed, the historical experience migration speed, and the historical predicted instantaneous migration speed.

5. The method according to any one of claims 2 to 4, characterized in that: Before obtaining the snapshot data of the source virtual machine, the method further includes: Acquire multiple historical sampling data corresponding to the historical snapshot data; the historical sampling data includes historical migration time and historical instantaneous migration speed; Fitting processing is performed on the plurality of historical sampling data to obtain the second speed fitting relationship.

6. The method according to any one of claims 1 to 5, characterized in that The determining, according to the migration speed, the migration duration corresponding to the snapshot data includes: Obtaining the total amount of data corresponding to the snapshot data; The migration duration is determined according to the total amount of data and the migration speed.

7. The method according to claims 1-6, characterized in that The method of shutting down the source virtual machine and migrating the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located, when it is determined based on the migration duration that the source virtual machine meets the shutdown condition, includes: Determining whether the migration duration is less than a migration duration threshold; If the migration duration is less than the migration duration threshold, determining that the source virtual machine meets the shutdown condition; The source virtual machine is shut down, and the snapshot data is migrated from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located.

8. The method according to claim 7, characterized in that Before determining the migration speed according to the snapshot depth and the speed fitting relationship, the method further includes: It is determined that the snapshot depth is less than or equal to the snapshot depth threshold.

9. A data migration device, characterized in that: include: A processing module, configured to obtain a snapshot depth corresponding to the snapshot data of the source virtual machine and obtain a speed fitting relationship; The processing module is further configured to determine a migration speed based on the snapshot depth and the speed fitting relationship; The processing module is further configured to determine a migration duration corresponding to the snapshot data according to the migration speed; The control module is used to shut down the source virtual machine and migrate the snapshot data from the second computing device where the source virtual machine is located to the third computing device where the target virtual machine is located when it is determined that the source virtual machine meets the shutdown condition based on the migration duration.

10. A computing device, characterized in that The computing device includes a memory and a processor; The memory is coupled to the processor; The memory is used to store computer instructions; The processor is configured to execute the computer instructions so as to enable the computing device to implement the method according to any one of claims 1 to 8.