Virtual machine migration method and device, electronic equipment, storage medium and program product

By transmitting the data to be migrated by virtual machines in parallel and updating dynamic data blocks in real time, the problem of long downtime of virtual machine migration in the existing technology is solved, and faster, reliable and real-time virtual machine migration is achieved.

CN119668785APending Publication Date: 2025-03-21INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411879472.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The existing virtual machine migration method requires interruption of the operation of the virtual machine, resulting in a long downtime and unable to meet the applications and services with high real-time requirements.

Method used

Faster, reliable and real-time virtual machine migration is achieved by transmitting the data to be migrated to the target physical machine in parallel and updating the dynamic data blocks in real time during the migration process.

Benefits of technology

It significantly reduces the total time required for virtual machine migration, reduces the downtime of virtual machine, improves the efficiency and reliability of migration, adapts to different network conditions and data volumes, and provides more flexible migration strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668785A_ABST
    Figure CN119668785A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a virtual machine migration method and device, electronic equipment, a storage medium and a program product, which are applied to the technical field of cloud computing, and the specific method comprises the following steps: partitioning to-be-migrated data of a virtual machine running on an original physical machine to obtain a plurality of data blocks; transmitting the plurality of data blocks to a target physical machine in parallel; detecting the data blocks of which the indexes are the same as those of the data blocks on the target physical machine but the content check codes are different from those of the data blocks on the target physical machine from the original physical machine to obtain dynamic data blocks; and updating the corresponding data block in the target physical machine based on the dynamic data block. The to-be-migrated data blocks of the virtual machine are transmitted in parallel, so that the total time required by migration of the virtual machine can be reduced, the downtime of the virtual machine is reduced, and the method is more suitable for applications and services with higher real-time requirements; by comparing the indexes and the content check codes of the data blocks on the original physical machine and the target physical machine, the dynamically changing data blocks can be accurately identified, the consistency of migrated data is ensured, and the migration success rate is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of cloud computing technology, and in particular to a virtual machine migration method, device, electronic device, storage medium and program product. Background Art

[0002] In the field of cloud computing, virtual machine migration is a key technology that is widely used in scenarios such as load balancing, fault migration, and system maintenance. Virtual machine migration is the process of migrating a running virtual machine from one physical host to another. The current virtual machine migration method requires interrupting the running process of the virtual machine and migrating the virtual machine data during the interruption. Since a large amount of data needs to be migrated, the virtual machine downtime is long, which cannot meet the needs of applications and services with high real-time requirements. Summary of the invention

[0003] The embodiments of the present invention provide a virtual machine migration method, device, electronic device, storage medium and program product, which provide a faster, more reliable and more real-time virtual machine migration solution by parallel transmission of data to be migrated and dynamic data block updates, meeting the demand for virtual machine migration technology in a modern cloud computing environment.

[0004] In a first aspect, an embodiment of the present invention provides a virtual machine migration method, comprising:

[0005] Divide the data to be migrated of the virtual machine running on the original physical machine into blocks to obtain multiple data blocks;

[0006] Transfer multiple data blocks to the target physical machine in parallel;

[0007] Detecting a data block whose index is the same as the index of a data block on the target physical machine but whose content check code is different from that of a data block on the target physical machine from the original physical machine, and obtaining a dynamic data block;

[0008] The corresponding data block in the target physical machine is updated based on the dynamic data block.

[0009] In a second aspect, an embodiment of the present invention provides a virtual machine migration device, comprising:

[0010] A block division module is used to divide the to-be-migrated data of the virtual machine running on the original physical machine into blocks to obtain multiple data blocks;

[0011] A transmission module, used for transmitting multiple data blocks to a target physical machine in parallel;

[0012] A detection module is used to detect a data block whose index is the same as that of a data block on a target physical machine but whose content check code is different from that of a data block on an original physical machine, and obtain a dynamic data block;

[0013] The update module is used to update the corresponding data block in the target physical machine based on the dynamic data block.

[0014] In a third aspect, an electronic device provided by an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, a virtual machine migration method as in any embodiment of the present invention is implemented.

[0015] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, a virtual machine migration method as described in any embodiment of the present invention is implemented.

[0016] In a fifth aspect, a computer program product provided by an embodiment of the present invention includes a computer program, and when the computer program is executed by a processor, the computer program implements the virtual machine migration method as described in any embodiment of the present invention.

[0017] In the embodiment of the present invention, the data to be migrated of the virtual machine is divided into blocks and the data blocks are transmitted in parallel, which can significantly reduce the total time required for the virtual machine migration, thereby reducing the downtime of the virtual machine. Since the downtime is reduced, this method is more suitable for applications and services with high real-time requirements; the data to be migrated is divided into blocks and transmitted in parallel, which can more efficiently utilize the network bandwidth and improve the data transmission speed, and the parallel transmission can better utilize the multi-core processor and multi-threading technology to improve the resource utilization of the physical machine; by comparing the index and content check code of the data block on the original physical machine and the target physical machine, the dynamically changing data block can be accurately identified, that is, after the data to be migrated is divided into blocks and transmitted to the target physical machine, the dynamically changing data is transmitted incrementally, which can reduce the data transmission volume and ensure the consistency of the data before and after the migration. By updating the dynamic data blocks, it can be ensured that the data on the target physical machine is the latest, thereby improving the reliability of the system and improving the migration success rate; the entire migration method can more easily adapt to different network conditions and data volumes, and provide a more flexible migration strategy; due to the real-time update of data during the migration process, if a failure occurs during the migration process, the service can be restored more quickly. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 It is a flow chart of a virtual machine migration method provided by an embodiment of the present invention;

[0020] Figure 2is another flowchart of the virtual machine migration method provided by an embodiment of the present invention;

[0021] Figure 3 is an example diagram of a virtual machine migration method provided by an embodiment of the present invention;

[0022] Figure 4 It is a structural schematic diagram of a virtual machine migration device provided by an embodiment of the present invention;

[0023] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] Figure 1 It is a flowchart of the virtual machine migration method provided by an embodiment of the present invention. The virtual machine migration method provided by an embodiment of the present invention can be applied to scenarios where a virtual machine needs to be migrated from one physical machine to another due to load balancing, physical machine failure, etc. The virtual machine migration method can be executed by a virtual machine migration device provided by an embodiment of the present invention, and the device can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated into an electronic device, and the electronic device can be a computer, server, or other device for controlling virtual machine migration. The following embodiment is described by taking the example of integrating a virtual machine migration device into an electronic device. Figure 1 The virtual machine migration method of this embodiment may include the following steps:

[0027] Step 110 , dividing the data to be migrated of the virtual machine running on the original physical machine into blocks to obtain a plurality of data blocks.

[0028] A virtual machine is a virtual server that runs on a physical server and has complete hardware system functions based on software simulation. A physical machine refers to an actual hardware server. In contrast to a virtual machine, it runs independently without relying on other computer systems. One or more virtual machines can run on a physical machine. The original physical machine is the physical machine where the virtual machine is currently located. The data to be migrated of a virtual machine refers to the data set that needs to be transferred when migrating a virtual machine from one environment to another. This data is essential for the normal operation of the virtual machine and may include operating systems, applications, configuration files, user data, storage data, virtual machine configuration files, etc. Operating system refers to the operating system installed on the virtual machine, including system files and configurations. Applications refer to the software and applications installed on the virtual machine, as well as their configurations and settings. User data refers to files created or stored by users on the virtual machine, such as documents, pictures, videos, etc. Storage data refers to data on a virtual hard disk, including the file system and all files stored on the virtual hard disk. A virtual machine configuration file is a file that defines the hardware configuration of the virtual machine, such as the number of virtual processors, memory size, disk configuration, etc. Chunking is a technology that divides large data sets into smaller data blocks and distributes them to different nodes for storage or processing.

[0029] Specifically, virtual machine migration can be performed when the original physical machine fails or load balancing is required. The data to be migrated can be divided into a series of data blocks of the same or different sizes, and the size of each data block can be between 1KB and 64KB. For example, the data to be migrated can be divided into blocks according to the size of the memory management unit of the original physical machine operating system, and the data to be migrated can be divided into a series of data blocks of 4KB in size. In order to facilitate migration, organization and verification of data, an index can be set for each data block to identify the location information of the data block, and different data blocks have different indexes.

[0030] Step 120: Transmit multiple data blocks to the target physical machine in parallel.

[0031] The target physical machine is the destination of the data block transmission, which is the physical server or computer that receives the data block, that is, the physical machine to which the virtual machine is to be migrated. Multiple data transmission channels can be pre-configured between the original physical machine and the target physical machine. Parallel transmission refers to the simultaneous transmission of data in groups on multiple parallel transmission channels.

[0032] Specifically, a low-load period can be selected as a migration window, a transmission channel with relatively good current performance can be selected from multiple data transmission channels, the virtual machine can be suspended within the migration window, and multiple data blocks can be transmitted in parallel to the target physical machine using the selected transmission channel. Transmitting the data to be migrated in blocks in parallel utilizes the concept of parallelism, which can greatly increase the speed of data transmission, reduce the overall transmission time, improve data transmission efficiency, and reduce virtual machine downtime.

[0033] Step 130: Detect data blocks from the original physical machine whose index is the same as the index of the data block on the target physical machine but whose content check codes are different, and obtain dynamic data blocks.

[0034] An index can identify the location information of a data block, and can be a location label or location code of a data block. A content checksum is a value used to detect whether the content of a data block is the same or has changed. Common checksum algorithms include cyclic redundancy check (CRC), different versions of message digest algorithms (MD), and secure hash algorithms (SHA). Dynamic data blocks refer to data blocks whose content is updated or changed during the migration process, that is, data blocks with the same index on the source physical machine and the target physical machine but different content checksums. These data blocks need to be specially marked and processed to ensure data consistency and integrity.

[0035] Different data blocks contain different data. Some data are relatively stable and change less frequently. They will not change during the migration process. These data blocks are called static data blocks. Examples of static data blocks are core library files and configuration files. Since static data blocks do not change frequently, they can be transmitted first in the early stages of migration to reduce the subsequent transmission burden. And since the content of static data blocks remains basically unchanged during the migration process, they can be migrated all at once without frequent updates. The content of dynamic data blocks will change frequently during the migration process. In order to maintain data consistency, dynamic data blocks can be gradually transmitted through incremental updates, that is, after the first transmission, only the changed parts are transmitted each time, rather than the entire data block. Examples of dynamic data blocks are database caches and application running data (such as stacks, memory pools, etc.).

[0036] During the virtual machine migration process, the content checksums of data blocks at the same index position on the source physical machine and the target physical machine can be compared. If data blocks with the same index but different content checksums are found, it means that the content of these data blocks has changed during the migration process, for example, the content of these data blocks has been updated or modified on the original physical machine. These changed data blocks are called dynamic data blocks.

[0037] Static data blocks can be migrated all at once, and dynamic data blocks can be migrated incrementally. This distinction can effectively reduce unnecessary data transmission, improve migration efficiency, reduce network bandwidth usage, and reduce downtime during the migration process.

[0038] Step 140: Update the corresponding data block in the target physical machine based on the dynamic data block.

[0039] The corresponding data block is a data block in the target physical machine whose index is the same as the index of the dynamic data block. The dynamic data block can be transmitted as a whole to the target physical machine so that the target physical machine finds the data block whose index is the same as the index of the dynamic data block, obtains the target data block, and replaces the target data block with the dynamic data block. It is also possible to find a data block in the target physical machine whose index is the same as the index of the dynamic data block, obtain the target data block, find the difference data between the dynamic data block and the target data block, and transmit the difference data to the target physical machine so that the target physical machine updates the target data block based on the difference data.

[0040] Based on the dynamic data blocks, the corresponding data blocks in the target physical machine are updated, that is, incremental synchronous updates are adopted for the dynamic data blocks, which reduces the data transmission volume, optimizes the efficiency of virtual machine migration, reduces bandwidth usage, and ensures the stability and performance of the virtual machine after migration.

[0041] In this embodiment, the data to be migrated of the virtual machine is divided into blocks and the data blocks are transmitted in parallel, which can significantly reduce the total time required for virtual machine migration, thereby reducing the downtime of the virtual machine. Since the downtime is reduced, this method is more suitable for applications and services with high real-time requirements; the data to be migrated is divided into blocks and transmitted in parallel, which can more efficiently utilize network bandwidth and improve data transmission speed, and parallel transmission can better utilize multi-core processors and multi-threading technology to improve resource utilization of physical machines; by comparing the index and content check code of the data blocks on the original physical machine and the target physical machine, the dynamically changing data blocks can be accurately identified, that is, after the data to be migrated is divided into blocks and transmitted to the target physical machine, the dynamically changing data is transmitted incrementally, which can reduce the data transmission volume and ensure data consistency during the migration process. By updating the dynamic data blocks, it can be ensured that the data on the target physical machine is the latest, thereby improving the reliability of the system and the success rate of migration; the entire migration method can more easily adapt to different network conditions and data volumes, and provide a more flexible migration strategy; due to the real-time update of data during the migration process, if a failure occurs during the migration process, the service can be restored more quickly.

[0042] Combine the following Figure 2 and Figure 3 , further illustrating the virtual machine migration method provided in an embodiment of the present invention. Figure 2is another flow chart of the virtual machine migration method provided by an embodiment of the present invention, Figure 3 It is an example diagram of a virtual machine migration method provided by an embodiment of the present invention. Figure 3 In the example shown, the virtual machine on the original physical machine is to be migrated to the target physical machine. The specific migration process can be as follows Figure 2 As shown, this may include:

[0043] Step 201 : obtaining the historical running resource requirements and real-time running resource requirements of the virtual machine on the original physical machine.

[0044] Running resources are the resources needed to support the normal operation of the virtual machine, which can include various hardware and software resources. For example: processor resources, cache resources, storage resources, network resources, etc. Historical running resource requirements are the resources that the virtual machine needed to run normally on the original physical machine in the past, and real-time running resource requirements are the resources that the virtual machine currently needs to run normally on the original physical machine.

[0045] Specifically, you can use virtual machine management tools, command line tools, automated monitoring scripts, system built-in monitoring interfaces, etc. to view and obtain the historical and real-time operating resource requirements of the virtual machine on the original physical machine.

[0046] Step 202 : predicting the virtual machine's operating resource demand for the target physical machine based on the historical operating resource demand and the real-time operating resource demand to obtain the predicted operating resource demand.

[0047] Historical and real-time operating resource requirements can be used to apply statistical analysis methods (such as linear regression, time series analysis, etc.) to identify trends and patterns in the use of operating resources, thereby predicting the future demand for operating resources by virtual machines. Resource demand prediction models can also be built to predict the future resource requirements of virtual machines using historical and real-time operating resource requirements, virtual machine workload characteristics, etc. Predicting the operating resource requirements of virtual machines can ensure the rational allocation and efficient use of resources, thereby improving the overall performance and stability of the virtualization environment.

[0048] Step 203: configure operating resources for the virtual machine on the target physical machine based on the predicted operating resource demand.

[0049] That is, based on the prediction results of the future resource requirements of the virtual machine, the required operating resources are pre-allocated and configured for the virtual machine on the target physical machine to ensure that the allocated resources can meet the performance requirements of the virtual machine and avoid resource waste. During the operation of the virtual machine, the resource allocation to the virtual machine is dynamically adjusted based on the actual resource usage and further prediction data.

[0050] Step 204 , divide the data to be migrated of the virtual machine running on the original physical machine into blocks to obtain a plurality of data blocks.

[0051] Virtual machine migration can be performed when the original physical machine fails or load balancing is required between physical machines. The data to be migrated of the virtual machine can be divided into a series of data blocks of the same or different sizes, and the size of each data block can be between 1KB and 64KB.

[0052] Step 205: Select at least two data transmission channels from the multiple data transmission channels according to the status information of each data transmission channel.

[0053] The status information refers to the current status of the data transmission channel, including but not limited to the channel availability, bandwidth utilization, error rate, delay and other parameters. According to the data transmission requirements and the status information of each channel, at least two suitable data transmission channels can be selected for data transmission. The selection criteria may include more remaining bandwidth, higher stability, lower delay and other channels. Selecting at least two data transmission channels can improve the efficiency and reliability of data transmission and ensure that data can be quickly and securely transmitted from the original physical machine to the target physical machine.

[0054] Step 206: Use at least two data transmission channels to transmit the multiple data blocks in parallel to the target physical machine.

[0055] Since the number of machines to be migrated is relatively large, you can select a period of time with lower overall load as the migration window, suspend the virtual machine within the migration window, and use the selected transmission channel to transmit multiple data blocks in parallel to the target physical machine to reduce the overall transmission time and reduce the virtual machine downtime.

[0056] In addition, at least two data transmission channels are used to transmit multiple data blocks in parallel. If a problem occurs in one channel, other channels can still continue to transmit data, which can reduce the risk of single point failure. By distributing data blocks among multiple channels, the load of each channel can be balanced to avoid overloading of some channels and affecting the transmission speed.

[0057] Step 207: Pair the data blocks on the original physical machine with the data blocks on the target physical machine, and each pair of data blocks has the same index.

[0058] Pairing means matching data blocks from two sources (i.e., the original physical machine and the target physical machine) according to certain rules (such as indexes) to ensure that corresponding data blocks can be correctly associated. One of the two data blocks in a pair of data blocks is located on the original physical machine and the other is located on the target physical machine. Data blocks with the same index are considered to be corresponding data blocks. This correspondence is the basis for ensuring data consistency and integrity.

[0059] During the data migration process, data blocks with the same index on two physical machines are paired according to the index of the data block to provide support for the subsequent incremental migration of dynamic data. In addition, by pairing data blocks with the same index, it is also possible to ensure that the data remains consistent during the migration or synchronization process to avoid data loss or duplication; through index pairing, data blocks that need to be migrated or synchronized can be quickly located and processed to improve the efficiency of data migration or synchronization; after the data migration or synchronization is completed, if you need to roll back or restore the data, index pairing can easily find the corresponding data block for operation.

[0060] Step 208: Calculate the weak check code and the strong check code for each pair of data blocks.

[0061] Weak checksum is a relatively simple and fast checksum method. Due to its simplicity, the collision probability of weak checksum is relatively high, that is, different data blocks may produce the same checksum. Strong checksum is a more complex and comprehensive checksum method, usually using more complex algorithms. The collision probability of strong checksum is much lower than that of weak checksum.

[0062] Step 209 , selecting data block pairs with different weak check codes from each pair of data blocks, and selecting data block pairs with the same weak check code but different strong check codes from each pair of data blocks, to obtain candidate data block pairs.

[0063] Data block pairs with different weak check codes refer to those data blocks that have the same index on the original physical machine and the target physical machine, but their weak check codes are different. The difference in weak check codes indicates that the data has changed during the transmission process. Data block pairs with the same weak check codes but different strong check codes refer to those data blocks that have the same index on the original physical machine and the target physical machine, their weak check codes are the same, but their strong check codes are different. This means that although the data block pairs have passed the initial fast check, differences are found under more stringent checks. Candidate data block pairs refer to those data block pairs that have been selected for further processing or transmission, including data block pairs with different weak check codes and data block pairs with the same weak check codes but different strong check codes.

[0064] By comparing weak check codes, data block pairs whose content has changed during transmission can be quickly screened out; by further comparing the strong check codes of data block pairs with the same weak check codes, a more in-depth inspection of the data can be performed to detect more subtle differences, helping to ensure data integrity and consistency.

[0065] Step 210: determine the data block belonging to the original physical machine in the candidate data block pair as a dynamic data block.

[0066] There may be one or more candidate data block pairs, and each pair of candidate data blocks may determine a dynamic data block.

[0067] Step 211: Update the corresponding data block in the target physical machine based on the dynamic data block.

[0068] The dynamic data block can be transferred as a whole to the target physical machine, so that the target physical machine finds the data block with the same index as the dynamic data block, obtains the target data block, and replaces the target data block with the dynamic data block. For example, if the index of the dynamic data block is i, the dynamic data block i can be transferred as a whole to the target physical machine, and the target physical machine can replace the data block i on it with the dynamic data block i as a whole.

[0069] Alternatively, a data block having the same index as the dynamic data block may be found from the target physical machine to obtain the target data block, and the difference data between the dynamic data block and the target data block may be found, and the difference data may be transmitted to the target physical machine so that the target physical machine updates the target data block based on the difference data. For example, if the difference data between the dynamic data block and the target data block is X, then X may be transmitted to the target physical machine, and the target physical machine may update the corresponding data in the target data block to X.

[0070] During the virtual machine migration process, if a network interruption or other failure occurs, resulting in the interruption of the virtual machine migration, the current migration progress can be saved according to the index, and after the fault is eliminated, the migration can be continued with reference to the current migration progress to ensure the continuity and stability of the migration task.

[0071] Furthermore, after the initial migration is completed, the data blocks on the original physical machine and the target physical machine can be checked according to the index to find out the missed data blocks, duplicate data blocks or multiple migrated data blocks. Missed data blocks are data blocks that exist in the original physical machine but not in the target physical machine. Missed data blocks can be retransmitted to the target physical machine. Duplicate data blocks are data blocks with duplicate content on the target physical machine. Duplicate data blocks can be deleted on the target physical machine. Multiple migrated data blocks are data blocks that do not exist in the original physical machine but exist in the target physical machine. Multiple migrated data blocks can be deleted in the target physical machine. Through further verification, the consistency of virtual machine data before and after migration can be ensured, thereby improving the success rate of virtual machine migration.

[0072] In this embodiment, the data to be migrated of the virtual machine is divided into blocks and the data blocks are transmitted in parallel, which can significantly reduce the total time required for virtual machine migration, thereby reducing the downtime of the virtual machine. Since the downtime is reduced, this method is more suitable for applications and services with high real-time requirements; the data to be migrated is divided into blocks and transmitted in parallel, which can more efficiently utilize network bandwidth and improve data transmission speed, and parallel transmission can better utilize multi-core processors and multi-threading technology to improve resource utilization of physical machines; by comparing the index and content check code of the data blocks on the original physical machine and the target physical machine, the dynamically changing data blocks can be accurately identified, that is, after the data to be migrated is divided into blocks and transmitted to the target physical machine, the dynamically changing data is transmitted incrementally, which can reduce the amount of data transmission and ensure data consistency during the migration process. By updating the dynamic data blocks, it can be ensured that the data on the target physical machine is the latest, thereby improving the reliability of the system and the success rate of migration; the entire migration method can more easily adapt to different network conditions and data volumes, and provide a more flexible migration strategy; due to the real-time update of data during the migration process, if a failure occurs during the migration process, the service can be restored more quickly.

[0073] Figure 4 is a schematic diagram of a structure of a virtual machine migration device provided in an embodiment of the present invention, and the device is suitable for executing a virtual machine migration method provided in an embodiment of the present invention, such as Figure 4 As shown, the device may specifically include:

[0074] The block division module 401 is used to divide the to-be-migrated data of the virtual machine running on the original physical machine into blocks to obtain multiple data blocks;

[0075] The transmission module 402 is used to transmit multiple data blocks to the target physical machine in parallel;

[0076] The detection module 403 is used to detect data blocks whose index is the same as the index of the data block on the target physical machine but whose content check codes are different from each other, from the original physical machine, to obtain dynamic data blocks;

[0077] The updating module 404 is used to update the corresponding data block in the target physical machine based on the dynamic data block.

[0078] In one embodiment, the detection module 403 detects a data block whose index is the same as the index of a data block on the target physical machine but whose content check code is different from that of a data block on the target physical machine, and obtains a dynamic data block, including:

[0079] Pair the data blocks on the original physical machine with the data blocks on the target physical machine, so that each pair of data blocks has the same index;

[0080] Calculate the weak check code and strong check code for each pair of data blocks. The collision probability of the strong check code is lower than that of the weak check code.

[0081] Selecting data block pairs with different weak check codes from each pair of data blocks, and selecting data block pairs with the same weak check code but different strong check codes from each pair of data blocks to obtain candidate data block pairs;

[0082] The data block belonging to the original physical machine in the candidate data block pair is determined as a dynamic data block.

[0083] In one embodiment, the updating module 404 updates the corresponding data block in the target physical machine based on the dynamic data block, including:

[0084] The dynamic data block is transmitted to the target physical machine, so that the target physical machine finds the data block whose index is the same as the index of the dynamic data block, obtains the target data block, and replaces the target data block with the dynamic data block.

[0085] In one embodiment, the updating module 404 updates the corresponding data block in the target physical machine based on the dynamic data block, including:

[0086] Find a data block whose index is the same as the index of the dynamic data block from the target physical machine, and obtain the target data block;

[0087] Find the difference data between the dynamic data block and the target data block;

[0088] The differential data is transmitted to the target physical machine, so that the target physical machine updates the target data block based on the differential data.

[0089] In one embodiment, the device further includes a configuration module, and the configuration module is used to:

[0090] Obtain the historical and real-time operating resource requirements of the virtual machine on the original physical machine;

[0091] Predicting the virtual machine's operating resource demand for the target physical machine based on the historical operating resource demand and the real-time operating resource demand to obtain the predicted operating resource demand;

[0092] Based on the predicted operating resource requirements, operating resources are configured for the virtual machine on the target physical machine.

[0093] In one embodiment, a plurality of data transmission channels are provided between the original physical machine and the target physical machine, and the transmission module 402 transmits a plurality of data blocks to the target physical machine in parallel, including:

[0094] selecting at least two data transmission channels from a plurality of data transmission channels according to status information of each data transmission channel;

[0095] At least two data transmission channels are used to transmit the multiple data blocks in parallel to the target physical machine.

[0096] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0097] The device of the embodiment of the present invention divides the data to be migrated of the virtual machine into blocks and transmits the data blocks in parallel, which can significantly reduce the total time required for virtual machine migration, thereby reducing the downtime of the virtual machine. Since the downtime is reduced, this method is more suitable for applications and services with high real-time requirements; dividing the data to be migrated into blocks and transmitting them in parallel can more efficiently utilize network bandwidth and improve data transmission speed, and parallel transmission can better utilize multi-core processors and multi-threading technology to improve resource utilization of physical machines; by comparing the index and content check code of the data blocks on the original physical machine and the target physical machine, dynamically changing data blocks can be accurately identified, that is, after the data to be migrated is divided into blocks and transmitted to the target physical machine, the dynamically changing data is transmitted incrementally, which can reduce the amount of data transmission and ensure data consistency during the migration process. By updating the dynamic data blocks, it can be ensured that the data on the target physical machine is the latest, thereby improving the reliability of the system and improving the success rate of migration; the entire migration method can more easily adapt to different network conditions and data volumes, and provide a more flexible migration strategy; due to the real-time update of data during the migration process, if a failure occurs during the migration process, the service can be restored more quickly.

[0098] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of an electronic device suitable for implementing an embodiment of the present invention. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0099] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the computer system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0100] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0101] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0102] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

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

[0104] The modules and / or units involved in the embodiments of the present invention may be implemented in software or hardware. The modules and / or units described may also be arranged in a processor, for example, it may be described as follows: a processor includes a block module, a transmission module, a detection module, and an update module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.

[0105] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0106] The data to be migrated of the virtual machine running on the original physical machine is divided into blocks to obtain multiple data blocks; the multiple data blocks are transmitted to the target physical machine in parallel; the data blocks whose index is the same as the index of the data block on the target physical machine but whose content check code is different are detected from the original physical machine to obtain dynamic data blocks; and the corresponding data blocks in the target physical machine are updated based on the dynamic data blocks.

[0107] The technical solution of the embodiment of the present invention divides the data to be migrated of the virtual machine into blocks and transmits the data blocks in parallel, which can significantly reduce the total time required for virtual machine migration, thereby reducing the downtime of the virtual machine. Since the downtime is reduced, this method is more suitable for applications and services with high real-time requirements; dividing the data to be migrated into blocks and transmitting them in parallel can more efficiently utilize network bandwidth and improve data transmission speed, and parallel transmission can better utilize multi-core processors and multi-threading technology to improve resource utilization of physical machines; by comparing the index and content check code of the data blocks on the original physical machine and the target physical machine, dynamically changing data blocks can be accurately identified, that is, after the data to be migrated is divided into blocks and transmitted to the target physical machine, the dynamically changing data is transmitted incrementally, which can reduce the data transmission volume and ensure data consistency during the migration process. By updating the dynamic data blocks, it can be ensured that the data on the target physical machine is the latest, thereby improving the reliability of the system and improving the migration success rate; the entire migration method can more easily adapt to different network conditions and data volumes, and provide a more flexible migration strategy; due to the real-time update of data during the migration process, if a failure occurs during the migration process, the service can be restored more quickly.

[0108] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the virtual machine migration method provided in any embodiment of the present application.

[0109] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0110] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0111] It should be noted that the collection, use, storage, sharing and transfer of user personal information involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations, and the user needs to be informed and the user's consent or authorization is obtained. When applicable, the user's personal information is de-identified and / or anonymized and / or encrypted. In addition, the corresponding operation entrance is provided for the user to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.

[0112] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A virtual machine migration method, characterized in that: include: Divide the data to be migrated of the virtual machine running on the original physical machine into blocks to obtain multiple data blocks; Transfer multiple data blocks to the target physical machine in parallel; Detecting a data block whose index is the same as the index of a data block on the target physical machine but whose content check code is different from that of a data block on the target physical machine from the original physical machine, and obtaining a dynamic data block; The corresponding data block in the target physical machine is updated based on the dynamic data block.

2. The virtual machine migration method according to claim 1, characterized in that: Detect data blocks whose index is the same as the index of the data block on the target physical machine but whose content check codes are different from each other from the original physical machine to obtain dynamic data blocks, including: Pair the data blocks on the original physical machine with the data blocks on the target physical machine, so that each pair of data blocks has the same index; Calculate the weak check code and strong check code for each pair of data blocks. The collision probability of the strong check code is lower than that of the weak check code. Selecting data block pairs with different weak check codes from each pair of data blocks, and selecting data block pairs with the same weak check code but different strong check codes from each pair of data blocks to obtain candidate data block pairs; The data block belonging to the original physical machine in the candidate data block pair is determined as a dynamic data block.

3. The virtual machine migration method according to claim 2, characterized in that: Update the corresponding data block in the target physical machine based on the dynamic data block, including: The dynamic data block is transmitted to the target physical machine, so that the target physical machine finds the data block whose index is the same as the index of the dynamic data block, obtains the target data block, and replaces the target data block with the dynamic data block.

4. The virtual machine migration method according to claim 2, characterized in that: Update the corresponding data block in the target physical machine based on the dynamic data block, including: Find a data block whose index is the same as the index of the dynamic data block from the target physical machine, and obtain the target data block; Find the difference data between the dynamic data block and the target data block; The differential data is transmitted to the target physical machine, so that the target physical machine updates the target data block based on the differential data.

5. The virtual machine migration method according to claim 1, characterized in that: Before transferring multiple data blocks to the target physical machine in parallel, it also includes: Obtain the historical and real-time operating resource requirements of the virtual machine on the original physical machine; Predicting the virtual machine's operating resource demand for the target physical machine based on the historical operating resource demand and the real-time operating resource demand to obtain the predicted operating resource demand; Based on the predicted operating resource requirements, operating resources are configured for the virtual machine on the target physical machine.

6. The virtual machine migration method according to any one of claims 1 to 5, characterized in that: There are multiple data transmission channels between the original physical machine and the target physical machine, which transmit multiple data blocks to the target physical machine in parallel, including: selecting at least two data transmission channels from a plurality of data transmission channels according to status information of each data transmission channel; At least two data transmission channels are used to transmit the multiple data blocks in parallel to the target physical machine.

7. A virtual machine migration device, characterized in that: include: A block division module is used to divide the to-be-migrated data of the virtual machine running on the original physical machine into blocks to obtain multiple data blocks; A transmission module, used for transmitting multiple data blocks to a target physical machine in parallel; A detection module is used to detect a data block whose index is the same as that of a data block on a target physical machine but whose content check code is different from that of a data block on an original physical machine, and obtain a dynamic data block; The update module is used to update the corresponding data block in the target physical machine based on the dynamic data block.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the virtual machine migration method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the virtual machine migration method according to any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the virtual machine migration method according to any one of claims 1 to 6.