Virtual machine migration method and device and computing equipment

By determining that the USB protocol data is the data between the first computing device and the third computing device during the virtual machine migration process, the problem of interrupting services during the virtual machine migration in the prior art is solved, and business continuity and user are achieved Improvement of experience.

CN119440730APending Publication Date: 2025-02-14HENAN KUNLUN TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411547889.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The prior art cannot realize the migration of virtual machines while keeping the business going normally, especially when migrating from the second computing device to the third computing device, it is necessary to first uninstall the USB device and interrupt the service.

Method used

By acquiring the identification of the third computing device sent by the second computing device, it is determined that the USB protocol data is USB protocol data between the first computing device and the third computing device, so that the migrated target virtual machine on the third computing device can be enabled Based on the data, the USB device connected to the first computing device is accessed.

Benefits of technology

The migration of virtual machines is realized when the business is in normal operation, avoiding the steps of uninstalling the USB device first and then re-mounting it, ensuring business continuity and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440730A_ABST
    Figure CN119440730A_ABST
Patent Text Reader

Abstract

Embodiments of the invention provide a virtual machine migration method and apparatus, and a computing device. The first computing device is connected with a universal serial bus (USB) device. The method comprises the following steps: a first computing device obtains an identifier of a third computing device sent by a second computing device; and the target virtual machine running on the second computing device accesses the USB device connected with the first computing device based on the USB protocol data between the first computing device and the second computing device. And under the condition that the target virtual machine is migrated from the second computing device to the third computing device, the first computing device determines that the USB protocol data is the USB protocol data between the first computing device and the third computing device according to the identifier of the third computing device, the migrated target virtual machine on the third computing device accesses the USB device connected with the first computing device based on the USB protocol data. According to the method provided by the embodiment of the invention, the normal operation of the service can be kept in the migration process of the virtual machine.
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 virtual machine migration method, device and computing device. Background Art

[0002] Universal Serial Bus (USB) cross-node mapping is a technology for sharing USB devices in a virtualized environment. Based on this technology, a USB device plugged into a first computing device can be mapped to a second computing device, so that a virtual machine running on the second computing device can use the USB device to perform business processing.

[0003] However, in the related art, when it is necessary to migrate the virtual machine running on the second computing device to the third computing device, the second computing device needs to first uninstall the USB device and interrupt the service. Then, after the virtual machine is migrated to the third computing device, the third computing device needs to re-communicate and negotiate with the first computing device to mount the USB device and perform service processing. In other words, the method in the related art cannot achieve the migration of the virtual machine while keeping the service running normally.

[0004] Therefore, there is an urgent need for a method that can migrate virtual machines while maintaining normal business operations. Summary of the invention

[0005] The embodiment of the present application provides a method, apparatus and computing device for migrating a virtual machine. The method of the embodiment of the present application can migrate a virtual machine while keeping the business running normally.

[0006] In a first aspect, an embodiment of the present application provides a virtual machine migration method, which is applied to a first computing device, where the first computing device is connected to a universal serial bus (USB) device, and the method includes:

[0007] Obtaining an identifier of a third computing device sent by the second computing device; the target virtual machine running on the second computing device accesses a USB device connected to the first computing device based on USB protocol data between the first computing device and the second computing device;

[0008] When the target virtual machine is migrated from the second computing device to the third computing device, the USB protocol data is determined to be the USB protocol data between the first computing device and the third computing device according to the identification of the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data.

[0009] In this solution, during the migration of the target virtual machine, the target virtual machine running on the second computing device can access the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device, and the first computing device can accurately parse the service request of the target virtual machine in the second computing device based on the USB protocol data between the first computing device and the second computing device. That is to say, during the migration of the target virtual machine, the target virtual machine running on the second computing device can maintain the normal operation of the business. After the target virtual machine migrates to the third computing device, the first computing device can determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device based on the identifier of the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data. That is to say, after the target virtual machine migrates to the third computing device, the first computing device can accurately parse the service request of the target virtual machine in the third computing device based on the USB protocol data between the first computing device and the third computing device. That is to say, after the migration of the target virtual machine is completed, the target virtual machine running on the third computing device can maintain the normal operation of the business. In summary, based on the method of the embodiment of the present application, there is no need to first uninstall the USB device and then re-mount the USB device during the migration process of the target virtual machine, nor is there a need to spend time controlling the first computing device to communicate and negotiate with the third computing device running the target virtual machine. The migrated target virtual machine on the third computing device can access the USB device connected to the first computing device, thereby achieving seamless switching of the USB device (from use by the target virtual machine on the second computing device to use by the target virtual machine on the third computing device), ensuring business continuity, and improving the user experience of the target virtual machine in the process of providing external services.

[0010] In one implementation, determining, according to an identifier of the third computing device, that the USB protocol data is USB protocol data between the first computing device and the third computing device includes:

[0011] Get business request;

[0012] When it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device, the USB protocol data between the first computing device and the second computing device is determined as the USB protocol data between the first computing device and the third computing device.

[0013] In this solution, the first computing device can determine that the computing device corresponding to the service request is the destination device (third computing device) of the virtual machine migration process when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device. The first computing device can determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data, thereby maintaining service continuity.

[0014] In one implementation, the identifier of the third computing device is an Internet Protocol (IP) address of the third computing device.

[0015] In this solution, the identifier of the third computing device may be an Internet Protocol IP address of the third computing device, so that the identifier of the third computing device may accurately reflect the identity of the third computing device.

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

[0017] According to the identifier of the third computing device, a mark of the third computing device is recorded as a hot migration state.

[0018] In this solution, the first computing device can record the mark of the third computing device as a hot migration state according to the identifier of the third computing device, so that the mark of the third computing device can reflect that the third computing device is currently the destination device of the hot migration process.

[0019] In one implementation, when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device, determining the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device includes:

[0020] When it is determined that the identifier of the computing device corresponding to the business request is the same as the identifier of the third computing device, and the third computing device is marked as a hot migration state, the USB protocol data between the first computing device and the second computing device is determined to be the USB protocol data between the first computing device and the third computing device.

[0021] In this solution, through the above method, after a verification is performed once using the identifier of the computing device corresponding to the service request, a second verification is performed using the hot migration state, thereby improving the security of the connection and further improving the security of the data in the USB device.

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

[0023] In response to the migration success information of the target virtual machine, the connection between the first computing device and the second computing device is disconnected.

[0024] In this solution, the first computing device can disconnect the first computing device from the second computing device in response to the target virtual machine's migration success information. Through the above method, after the migration is successful, the USB protocol data corresponds to one computing device, avoiding the situation in which multiple virtual machines on multiple computing devices can use the USB device of the first computing device during the non-migration process, resulting in data errors. In other words, through the above method, the use safety of USB devices can be improved and the consistency of data can be improved.

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

[0026] In response to migration failure information of the target virtual machine, the connection between the first computing device and the second computing device is retained.

[0027] In this solution, the first computing device can keep the connection between the first computing device and the second computing device in response to the migration failure information of the target virtual machine. In this way, after the migration fails, the second computing device can still use the USB device on the first computing device normally, thus maintaining business continuity.

[0028] In a second aspect, an embodiment of the present application provides a method for migrating a virtual machine, the method comprising:

[0029] Get hot migration request;

[0030] sending an identifier of a third computing device to the first computing device according to a hot migration request; the identifier of the third computing device is used for the first computing device to determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device when the target virtual machine is migrated from the second computing device to the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data; wherein the target virtual machine running on the second computing device accesses the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device;

[0031] According to the hot migration request, the target virtual machine is migrated from the second computing device to the third computing device; the target virtual machine includes USB protocol data.

[0032] In this scheme, in the case of obtaining a hot migration request, the identifier of the third computing device can be sent to the first computing device according to the hot migration request, and the target virtual machine can be migrated from the second computing device to the third computing device according to the hot migration request; the target virtual machine includes USB protocol data. Wherein, the identifier of the third computing device is used for the first computing device to determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device when the target virtual machine is migrated from the second computing device to the third computing device, so that the migrated target virtual machine on the third computing device can access the USB device connected to the first computing device based on the USB protocol data. Wherein, the target virtual machine running on the second computing device accesses the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device. In the above manner, during the migration of the target virtual machine, the target virtual machine on the second computing device connected to the first computing device can perform business processing; after the target virtual machine is migrated to the third computing device, the target virtual machine on the third computing device connected to the first computing device can perform business processing, thereby ensuring business continuity.

[0033] In one implementation, obtaining a hot migration request includes:

[0034] Determining a hot migration request according to the fault information corresponding to the second computing device; and / or,

[0035] A hot migration request is determined according to the load of each virtual machine corresponding to the second computing device.

[0036] In this solution, the hot migration request can be triggered by the fault information of the second computing device, or by the load of each virtual machine corresponding to the second computing device. Through the above method, the migration timing of the target virtual machine is improved, and the matching degree with the actual situation of the second computing device is improved.

[0037] In one implementation, determining a hot migration request according to fault information corresponding to the second computing device includes:

[0038] When the fault information indicates that the second computing device has a fault, obtaining a service level corresponding to each virtual machine;

[0039] Determine the hot migration request based on the service level corresponding to each virtual machine.

[0040] In this solution, when the fault information indicates that the second computing device has a fault, the service level corresponding to each virtual machine can be obtained, and then the hot migration request can be determined according to the service level corresponding to each virtual machine. In this way, it can be ensured that the virtual machines with higher service levels are preferentially migrated to the third computing device, thereby improving the business continuity of the virtual machines with higher service levels.

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

[0042] When the target virtual machine is migrated from the second computing device to the third computing device, a service request is sent to the first computing device; the service request is used for the first computing device to determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device.

[0043] In this scheme, when the target virtual machine is migrated from the second computing device to the third computing device, a service request can be sent to the first computing device, so that the first computing device can determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device.

[0044] In a third aspect, an embodiment of the present application provides a virtual machine migration device, which is applied to a first computing device, the first computing device is connected to a universal serial bus USB device, and the device includes:

[0045] An acquisition module is used to acquire an identification of a third computing device sent by the second computing device; a target virtual machine running on the second computing device accesses a USB device connected to the first computing device based on USB protocol data between the first computing device and the second computing device;

[0046] The processing module is used to determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device according to the identifier of the third computing device when the target virtual machine is migrated from the second computing device to the third computing device, so that the migrated target virtual machine on the third computing device can access the USB device connected to the first computing device based on the USB protocol data.

[0047] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

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

[0049] Get business request;

[0050] When it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device, the USB protocol data between the first computing device and the second computing device is determined as the USB protocol data between the first computing device and the third computing device.

[0051] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0052] In one implementation, the identifier of the third computing device is an Internet Protocol (IP) address of the third computing device.

[0053] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

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

[0055] According to the identifier of the third computing device, the mark of the third computing device is recorded as a hot migration state.

[0056] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

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

[0058] When it is determined that the identifier of the computing device corresponding to the business request is the same as the identifier of the third computing device, and the third computing device is marked as a hot migration state, the USB protocol data between the first computing device and the second computing device is determined to be the USB protocol data between the first computing device and the third computing device.

[0059] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0060] In one implementation, the communication module is further configured to:

[0061] In response to the migration success information of the target virtual machine, the connection between the first computing device and the second computing device is disconnected.

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

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

[0064] In response to migration failure information of the target virtual machine, the connection between the first computing device and the second computing device is retained.

[0065] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0066] In a fourth aspect, an embodiment of the present application provides a virtual machine migration device, the device comprising:

[0067] An acquisition module is used to obtain a hot migration request;

[0068] A first sending module is used to send an identifier of a third computing device to the first computing device according to a hot migration request; the identifier of the third computing device is used for the first computing device to determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device when the target virtual machine is migrated from the second computing device to the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data; wherein the target virtual machine running on the second computing device accesses the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device;

[0069] The processing module is used to migrate the target virtual machine from the second computing device to the third computing device according to the hot migration request; the target virtual machine includes USB protocol data.

[0070] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0071] In one implementation, the acquisition module is specifically used to:

[0072] Determining a hot migration request according to the fault information corresponding to the second computing device; and / or,

[0073] A hot migration request is determined according to the load of each virtual machine corresponding to the second computing device.

[0074] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0075] In one implementation, the acquisition module is specifically used to:

[0076] When the fault information indicates that the second computing device has a fault, obtaining a service level corresponding to each virtual machine;

[0077] Determine the hot migration request based on the service level corresponding to each virtual machine.

[0078] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0079] In one implementation, the apparatus further includes:

[0080] The second sending module is used to send a service request to the first computing device when the target virtual machine is migrated from the second computing device to the third computing device; the service request is used for the first computing device to determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device.

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

[0082] In one implementation,

[0083] The acquisition module, the first sending module, and the processing module are applied to the second computing device;

[0084] The second sending module is applied to the third computing device.

[0085] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

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

[0087] The memory is coupled to the processor;

[0088] Memory is used to store computer instructions;

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

[0090] The computing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

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

[0092] The memory is coupled to the processor;

[0093] Memory is used to store computer instructions;

[0094] The processor is used to execute computer instructions to enable the computing device to implement the method of the second aspect.

[0095] The computing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0096] In a seventh aspect, an embodiment of the present application provides a computing system, the computing system comprising a first computing device, a second computing device, and a third computing device;

[0097] The first computing device is used to execute the method of the first aspect;

[0098] The second computing device and the third computing device are used to execute the method of the second aspect.

[0099] The computing system provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0100] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-readable storage medium is stored computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the method of the first aspect or the second aspect.

[0101] 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. The implementation principle and beneficial effects are similar and will not be repeated here.

[0102] In a ninth 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 or the second aspect when executed by a processor.

[0103] 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. The implementation principle and beneficial effects are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0104] 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.

[0105] Figure 1A schematic diagram of a scenario of a virtual machine migration method provided in an embodiment of the present application;

[0106] Figure 2a A flowchart of a first embodiment of a method for migrating a virtual machine provided in an embodiment of the present application;

[0107] Figure 2b A schematic diagram of a scenario of communication and negotiation between a first computing device and a second computing device provided in an embodiment of the present application;

[0108] Figure 2c A schematic diagram of a virtual machine migration scenario provided in an embodiment of the present application;

[0109] Figure 3 A flowchart of a second embodiment of a method for migrating a virtual machine provided in an embodiment of the present application;

[0110] Figure 4 A flowchart of a fourth embodiment of a method for migrating a virtual machine provided in an embodiment of the present application;

[0111] Figure 5 A flowchart of a fifth embodiment of a method for migrating a virtual machine provided in an embodiment of the present application;

[0112] Figure 6 A schematic diagram of the structure of a virtual machine migration device provided in an embodiment of the present application;

[0113] Figure 7 A schematic diagram of the structure of another virtual machine 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;

[0115] Fig. 9 A schematic diagram of the structure of another computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0116] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution 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 under the enlightenment of the embodiments belong to the scope of protection of the present application.

[0117] 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 sequence. It should be understood that the data used in this way can be 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" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device 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 devices.

[0118] Glossary:

[0119] Virtual machine: refers to a complete computer system that is simulated by software and has complete hardware system functions and runs in a completely isolated environment. Any work that can be done in a physical computing device can be done in a virtual machine. When creating a virtual machine in a computing device, part of the hard disk and memory capacity of the computing device needs to be used as the hard disk and memory capacity of the virtual machine. Each virtual machine has an independent hard disk and operating system, and can be operated like a computing device.

[0120] Qemu (Quick EMUlator): is an open source virtualization and emulation software used to create and manage virtual machines. In addition, qemu supports virtual machine snapshots and live migration functions, so that the state of the virtual machine can be saved, restored, or migrated between different computing devices (physical hosts).

[0121] Usbredir: usbredir is a protocol and tool set for Universal Serial Bus (USB) device redirection, used to share USB devices in a virtualized environment.

[0122] Hot migration: also known as dynamic migration or real-time migration. It migrates a virtual machine from a source computing device to a target computing device without affecting the normal business process of the virtual machine. During the hot migration process, the virtual machine will have a short overlap period between the source computing device and the target computing device. During this overlap period, the memory information and state of the virtual machine will be copied to the target computing device. When the copy is completed, the operation of the virtual machine will be switched to the target computing device. At this time, the virtual machine on the source computing device will be stopped and resources will be released.

[0123] An embodiment of the present application provides a method for migrating a virtual machine. The first computing device can determine the USB protocol data between the first computing device and the third computing device without communicating and negotiating with the third computing device, so that the migrated target virtual machine on the third computing device can access the USB device connected to the first computing device based on the USB protocol data, thereby maintaining normal business during the virtual machine migration process.

[0124] The following is a detailed description of the virtual machine migration method of the embodiment of the present application.

[0125] Figure 1 A scenario diagram of a virtual machine migration method provided in an embodiment of the present application. Figure 1 As shown, the scenario includes a computing system and a USB device 40. The computing system includes a first computing device 10, a second computing device 20, and a third computing device 30.

[0126] The first computing device 10 is connected to the USB device 40. The first computing device 10 is connected to the second computing device 20.

[0127] The target virtual machine runs on the second computing device 20 .

[0128] It should be noted that the first computing device 10 can be a terminal device or a server. When the first computing device 10 is a terminal device, the terminal device can be but is not limited to a laptop computer, a desktop computer, etc. Exemplary embodiments of terminal devices involved in the embodiments of the present application include but are not limited to terminal devices equipped with iOS, Android, Windows, HarmonyOS or other operating systems. The embodiments of the present application do not specifically limit the type of terminal device. When the first computing device 10 is a server, from an architectural point of view, the server can be a rack server, a high-density server, a tower server or a whole cabinet server; from a functional point of view, the server can be a general-purpose server or an artificial intelligence server (AI (artificial intelligence) server), etc. For example, the artificial intelligence server can be an image processing server (GPU (graphics processing unit) server).

[0129] The second computing device 20 and the third computing device 30 may be terminal devices or servers.

[0130] The USB device 40 is an external device connected to the computing device through a Universal Serial Bus (USB) interface. The USB device 40 may be a keyboard, a mouse, a storage device, and the like.

[0131] exist Figure 1 In the scenario shown:

[0132] The second computing device 20 may obtain a hot migration request.

[0133] The second computing device 20 may send the identifier of the third computing device 30 to the first computing device 10 according to the hot migration request. In addition, the second computing device 20 may also migrate the target virtual machine from the second computing device 20 to the third computing device 30 according to the hot migration request.

[0134] The first computing device 10 may obtain the identifier of the third computing device 30 sent by the second computing device 20. The target virtual machine running on the second computing device 20 accesses the USB device 40 connected to the first computing device 10 based on the USB protocol data between the first computing device 10 and the second computing device 20.

[0135] When the target virtual machine is migrated from the second computing device 20 to the third computing device 30, the first computing device 10 can determine, based on the identification of the third computing device 30, that the USB protocol data is the USB protocol data between the first computing device 10 and the third computing device 30, so that the migrated target virtual machine on the third computing device 30 can access the USB device 40 connected to the first computing device 10 based on the USB protocol data.

[0136] 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 Figure 1 The actual form of the various devices included in the Figure 1 The interaction mode between devices is limited, and in the application of the solution, it can be set according to actual needs.

[0137] 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.

[0138] Figure 2a A flowchart of a first embodiment of a method for migrating a virtual machine provided in an embodiment of the present application. Figure 2a , the method specifically comprises the following steps:

[0139] S201: The second computing device obtains a hot migration request.

[0140] In this embodiment, the second computing device may obtain a hot migration request.

[0141] The hot migration request is used to request to migrate the target virtual machine in the second computing device to the third computing device.

[0142] In one implementation:

[0143] The cloud platform (or management tool) is run on the second computing device. The second computing device can obtain the hot migration request input by the administrator through the cloud platform (or management tool). In one implementation, the hot migration request may include an identifier of the target virtual machine.

[0144] In one implementation:

[0145] The second computing device may determine a hot migration request according to the fault information corresponding to the second computing device.

[0146] In one implementation, multiple virtual machines are run on the second computing device, and each virtual machine corresponds to a service level. Exemplarily, the higher the service level, the more important the service. The second computing device can obtain the service level of each virtual machine when the fault information indicates that the second computing device has a fault. The second computing device can determine the hot migration request based on the service level corresponding to each virtual machine. It can be understood that in one implementation, the second computing device can determine a virtual machine with a service level greater than a preset level as a target virtual machine. In one implementation, the second computing device can determine the virtual machine with the highest service level among multiple virtual machines as the target virtual machine.

[0147] In one implementation:

[0148] The second computing device may run multiple virtual machines. The second computing device may determine a hot migration request according to the load of each virtual machine corresponding to the second computing device.

[0149] In one implementation, the second computing device may determine the total load according to the load of each virtual machine. The computing device may determine the target virtual machine from the multiple virtual machines according to the load of each virtual machine when it is determined that the total load is greater than the preset total load. It is understandable that in one implementation, the target virtual machine may be the virtual machine with the largest load among the multiple virtual machines.

[0150] It should be noted that the load refers to the number of services being processed by the virtual machine. The higher the load of the virtual machine, the more services the virtual machine is carrying.

[0151] S202: The second computing device sends an identifier of the third computing device to the first computing device according to the hot migration request.

[0152] In this embodiment, after obtaining the hot migration request, the second computing device may send the identifier of the third computing device to the first computing device according to the hot migration request.

[0153] That is, the first computing device may obtain the identification of the third computing device sent by the second computing device.

[0154] In one implementation, the identifier of the third computing device may be an Internet Protocol (IP) address of the third computing device. In one implementation, the identifier of the third computing device may be a serial number of the third computing device. The identifier of the third computing device may also be other information that may reflect the identity of the third computing device, which is not limited in the embodiments of the present application.

[0155] Next, a process in which the second computing device sends the identifier of the third computing device to the first computing device according to the hot migration request is described.

[0156] In one implementation, the hot migration request may include an identifier of the third computing device. The second computing device may send the identifier of the third computing device to the first computing device according to the identifier of the third computing device in the hot migration request.

[0157] In one implementation, the second computing device may store the identification of the third computing device. In response to receiving the hot migration request, the second computing device may send the identification of the third computing device to the first computing device.

[0158] It should be noted that the first computing device can store USB protocol data between the first computing device and the second computing device. The second computing device can store USB protocol data between the first computing device and the second computing device. The target virtual machine running on the second computing device accesses the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device.

[0159] For example, when the target virtual machine running on the second computing device performs a write process on the USB device, the service request sent by the second computing device to the first computing device may be a write request. The first computing device may perform a write process on the USB device based on the write request. For another example, when the target virtual machine running on the second computing device performs a read process on the USB device, the service request sent by the second computing device to the first computing device may be a read request. The first computing device may perform a read process on the USB device based on the read request and feed back the read result to the second computing device.

[0160] It should also be noted that the USB protocol data between the first computing device and the second computing device is obtained through communication and negotiation between the first computing device and the second computing device.

[0161] Figure 2bA schematic diagram of a scenario in which a first computing device and a second computing device communicate and negotiate with each other is provided in an embodiment of the present application. Figure 2b As shown:

[0162] The usbredir server runs on the first computing device 10 .

[0163] The second computing device 20 runs qemu 1 and the target virtual machine.

[0164] Next, combine Figure 2b , a process of communication negotiation between the usbredir server running on the first computing device and the qemu 1 running on the second computing device is described.

[0165] The qemu 1 running on the second computing device may send a connection request to the usbredir server running on the first computing device.

[0166] After receiving the connection request, the usbredir server running on the first computing device accepts the connection and establishes a communication channel. The qemu 1 running on the second computing device and the usbredir server running on the first computing device exchange initial handshake messages to confirm the validity of the connection and the basic capabilities of both parties.

[0167] The qemu 1 running on the second computing device can communicate and negotiate with the usbredir server running on the first computing device to obtain USB protocol data. It should be noted that the usbredir server running on the first computing device and the qemu 1 running on the second computing device can save USB protocol data. It should also be noted that the USB protocol data includes but is not limited to USB version, transmission type (such as control transmission, bulk transmission, interrupt transmission, or synchronous transmission, etc.), maximum data packet size, etc.

[0168] After detecting the USB device connected to the first computing device, the usbredir server running on the first computing device can send the descriptor information of the USB device to the qemu 1 running on the second computing device. The descriptor information may include a device descriptor, a configuration descriptor, an interface descriptor, and / or an endpoint descriptor. The qemu 1 running on the second computing device can create a virtual USB device in the virtual machine according to the descriptor information of the USB device, so that the virtual machine can identify and use the virtual USB device, thereby allowing the virtual machine to use the USB device connected to the first computing device.

[0169] S203: The second computing device migrates the target virtual machine from the second computing device to the third computing device according to the hot migration request.

[0170] In this embodiment, the second computing device may also migrate the target virtual machine to the third computing device according to the hot migration request.

[0171] It should be noted that the process of the second computing device migrating the target virtual machine to the third computing device includes the process of the second computing device sending USB protocol data to the third computing device. In other words, the target virtual machine may include USB protocol data. It should also be noted that the USB protocol data is obtained by the second computing device and the first computing device through communication and negotiation.

[0172] It should also be noted that the second computing device may execute S202 first and then execute S203, or may execute S202 during the process of executing S203, and this embodiment of the present application is not limited to this.

[0173] Figure 2c A schematic diagram of a virtual machine migration scenario provided in an embodiment of the present application. Figure 2c As shown:

[0174] The usbredir server runs on the first computing device 10 .

[0175] The second computing device 20 runs qemu 1 and the target virtual machine.

[0176] Qemu 2 runs on the third computing device 30 .

[0177] Next, combine Figure 2c , a process of migrating a target virtual machine from a second computing device to a third computing device is described.

[0178] The second computing device runs qemu 1 and sends data corresponding to the target virtual machine to the third computing device. The data corresponding to the target virtual machine may include data in the memory and the state of the central processing unit. It can be understood that the data corresponding to the target virtual machine may include USB protocol data. In other words, the target virtual machine migrated to the third computing device may include USB protocol data. In one implementation, when the second computing device and the third computing device do not adopt shared storage technology and share storage data, the data corresponding to the target virtual machine may also include data in the hard disk. It should be noted that the process in which the second computing device runs qemu 1 and sends data corresponding to the target virtual machine to the third computing device occurs during the process in which the second computing device runs the target virtual machine.

[0179] The third computing device runs qemu 2 to obtain data corresponding to the target virtual machine sent by the first computing device, wherein the data corresponding to the target virtual machine includes USB protocol data, in other words, the target virtual machine migrated to the third computing device may include USB protocol data.

[0180] The third computing device runs qemu 2 and can create a new virtual machine on the third computing device when receiving data corresponding to the target virtual machine.

[0181] The third computing device runs qemu 2 and can start the new virtual machine after receiving all the data corresponding to the target virtual machine. It should be noted that the new virtual machine can be regarded as the target virtual machine relocated to the third computing device.

[0182] After the new virtual machine is started, the second computing device runs qemu 1, which can control the target virtual machine on the second computing device to stop running and delete the target virtual machine on the second computing device.

[0183] S204: When the target virtual machine is migrated from the second computing device to the third computing device, the first computing device determines, based on an identifier of the third computing device, that the USB protocol data is USB protocol data between the first computing device and the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data.

[0184] In this embodiment, when the target virtual machine is migrated from the second computing device to the third computing device, that is, when the migration of the target virtual machine is successful, the first computing device can determine, based on the identification of the third computing device, that the USB protocol data is USB protocol data between the first computing device and the third computing device.

[0185] In one implementation:

[0186] The first computing device may obtain the service request. In one implementation, when the target virtual machine is running on the third computing device, the service request may be sent by the third computing device (the target virtual machine on the third computing device).

[0187] The first computing device may determine whether the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device.

[0188] If so, the first computing device may directly determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device.

[0189] If not, then end.

[0190] In addition, when the first computing device determines the USB protocol data between the first computing device and the third computing device, the migrated target virtual machine on the third computing device can access the USB device connected to the first computing device based on the USB protocol data.

[0191] That is to say, when the first computing device stores USB protocol data between the first computing device and the third computing device, and the third computing device stores USB protocol data between the first computing device and the third computing device, the migrated target virtual machine on the third computing device can access the USB device connected to the first computing device based on the USB protocol data.

[0192] It should also be noted that the USB protocol data between the first computing device and the third computing device stored in the first computing device is determined by the first computing device based on the USB protocol data between the first computing device and the second computing device. The USB protocol data between the first computing device and the third computing device stored in the third computing device is included in the target virtual machine migrated from the second computing device to the third computing device.

[0193] It should be noted that, when the first computing device is connected to multiple USB devices, the USB protocol data between the first computing device and the third computing device includes USB protocol data corresponding to the multiple USB devices. For each USB protocol data corresponding to the USB device, the migrated target virtual machine on the third computing device can access the USB device based on the USB protocol data corresponding to the USB device.

[0194] Additionally, in one implementation:

[0195] When the target virtual machine is migrated successfully, the first computing device may obtain migration success information of the target virtual machine.

[0196] In one implementation, the second computing device may send the target virtual machine migration success information to the first computing device when it is identified that the target virtual machine has been successfully migrated. It should be noted that in one implementation, the second computing device may determine whether the target virtual machine has been successfully migrated by checking the log. The second computing device may also determine whether the target virtual machine has been successfully migrated by other means, which is not limited in the embodiments of the present application.

[0197] In one implementation, the third computing device may send the target virtual machine migration success information to the first computing device when it is identified that the target virtual machine has been successfully migrated. It should be noted that in one implementation, the third computing device may determine whether the target virtual machine has been successfully migrated by checking the log. The third computing device may also determine whether the target virtual machine has been successfully migrated by other means, which is not limited in the embodiments of the present application.

[0198] In one implementation, the first computing device may determine that the computing device sending the service request is the third computing device when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device. The first computing device may determine that the target virtual machine is migrated to the third computing device. The first computing device may generate migration success information of the target virtual machine.

[0199] In one implementation, the first computing device may determine that the computing device sending the service request is the third computing device when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device and the third computing device is marked as being in a hot migration state. The first computing device may determine that the target virtual machine is migrated to the third computing device. The first computing device may obtain migration success information of the target virtual machine.

[0200] The first computing device may disconnect the first computing device from the second computing device in response to the migration success information. It should be noted that disconnecting the first computing device from the second computing device means that the target virtual machine on the second computing device cannot access the USB device connected to the first computing device.

[0201] In one implementation, the first computing device may disconnect the first computing device from the second computing device by terminating a thread corresponding to the second computing device, wherein the thread corresponding to the second computing device is a thread used to maintain the connection between the first computing device and the second computing device.

[0202] Through the above method, after the migration is successful, the first computing device is disconnected from the second computing device, and the first computing device is connected to the third computing device, so as to avoid the situation that multiple virtual machines on multiple computing devices can use the USB device of the first computing device during the non-migration process, resulting in data errors. In other words, through the above method, the use safety of USB devices can be improved and the consistency of data can be improved.

[0203] In addition, it should be noted that in one implementation:

[0204] When the migration of the target virtual machine fails, the first computing device may obtain migration failure information of the target virtual machine.

[0205] In one implementation, the second computing device may send migration failure information of the target virtual machine to the first computing device when it is identified that the migration of the target virtual machine has failed. It should be noted that in one implementation, the second computing device may determine whether the migration of the target virtual machine has failed by checking the log.

[0206] In one implementation, the third computing device may send migration failure information of the target virtual machine to the first computing device when it is identified that the migration of the target virtual machine has failed. It should be noted that in one implementation, the third computing device may determine whether the migration of the target virtual machine has failed by checking the log.

[0207] In one implementation, the first computing device may start timing after obtaining the identifier of the third computing device sent by the second computing device, and after the timing reaches a preset duration, determine whether a service request is received, and the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device. If not, it is determined that the migration of the target virtual machine has failed, and the first computing device may obtain migration failure information of the target virtual machine.

[0208] In one implementation, the first computing device may start timing after obtaining the identifier of the third computing device sent by the second computing device, and after the timing reaches a preset duration, determine whether a service request is received, and the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device, and the identifier corresponding to the third computing device is a hot migration identifier. If not, it is determined that the migration of the target virtual machine has failed, and the first computing device may obtain migration failure information of the target virtual machine.

[0209] The first computing device may retain the connection between the first computing device and the second computing device in response to the migration failure information of the target virtual machine. It should be noted that retaining the connection between the first computing device and the second computing device means that the target virtual machine running on the second computing device can continue to access the USB device connected to the first computing device.

[0210] Through the above method, in the event of a migration failure, the target virtual machine is still running on the second computing device to provide business capabilities to the outside world, thereby ensuring business continuity.

[0211] In addition, it should be noted that in one implementation:

[0212] The first computing device may delete the mark of the third computing device in response to the migration end information of the target virtual machine. The migration end information may be migration success information, migration failure information, or other information, which is not limited in the embodiment of the present application.

[0213] Beneficial effects of this embodiment: In this embodiment, the second computing device can obtain a hot migration request. The second computing device sends the identification of the third computing device to the first computing device according to the hot migration request. The second computing device can also migrate the target virtual machine from the second computing device to the third computing device according to the hot migration request. In the case where the target virtual machine is migrated from the second computing device to the third computing device, the first computing device can determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device according to the identification of the third computing device. In the above manner, during the migration of the target virtual machine, the target virtual machine running on the second computing device can access the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device, and the first computing device can accurately parse the service request of the target virtual machine in the second computing device based on the USB protocol data between the first computing device and the second computing device. That is to say, during the migration of the target virtual machine, the target virtual machine running on the second computing device can maintain the normal operation of the business. In the case where the first computing device can determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device according to the identification of the third computing device, after the target virtual machine is migrated to the third computing device, the migrated target virtual machine on the third computing device can access the USB device connected to the first computing device based on the USB protocol data between the first computing device and the third computing device, and the first computing device can accurately parse the service request of the target virtual machine in the third computing device according to the USB protocol data between the first computing device and the third computing device. That is to say, after the migration of the target virtual machine is completed, the target virtual machine running on the third computing device can maintain the normal operation of the service. In summary, based on the method of the embodiment of the present application, there is no need to uninstall the USB device first and then re-mount the USB device during the migration process of the target virtual machine, and there is no need to spend time controlling the first computing device to communicate and negotiate with the third computing device running the target virtual machine, so that the migrated target virtual machine on the third computing device can access the USB device connected to the first computing device, thereby realizing seamless switching of the USB device (from being used by the target virtual machine on the second computing device to being used by the target virtual machine on the third computing device), ensuring service continuity, and improving the user experience of the target virtual machine in the process of providing services to the outside.

[0214] Next, through method embodiment 2, based on method embodiment 1, a process of the first computing device determining the USB protocol data between the first computing device and the third computing device is further described.

[0215] Figure 3 A flow chart of a second embodiment of a virtual machine migration method provided in an embodiment of the present application. Figure 3, the method specifically comprises the following steps:

[0216] S301: The second computing device obtains a hot migration request.

[0217] In this embodiment, the second computing device may obtain a hot migration request.

[0218] The hot migration request is used to request to migrate the target virtual machine in the second computing device to the third computing device.

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

[0220] S302: The second computing device sends an identifier of the third computing device to the first computing device according to the hot migration request.

[0221] In this embodiment, the second computing device may send the identifier of the third computing device to the first computing device according to the hot migration request. In one implementation, the identifier of the third computing device may be the IP address of the third computing device.

[0222] In one implementation, the second computing device may send migration information to the first computing device according to the hot migration request, wherein the migration information includes an identification and a verification code of the third computing device.

[0223] In one implementation, the second computing device may encrypt the identifier of the third computing device according to the hot migration request to obtain the encrypted identifier of the third computing device. The second computing device may send the encrypted identifier of the third computing device to the first computing device.

[0224] S303: The first computing device records the mark of the third computing device as a hot migration state according to the identifier of the third computing device.

[0225] In this embodiment, the first computing device can record the mark of the third computing device as hot migration state according to the identifier of the third computing device. The mark of the third computing device as hot migration state can reflect that the third computing device is the destination device of the target virtual machine in the migration process.

[0226] In one implementation, after obtaining the migration information, the first computing device may verify the verification code, and after determining that the verification code is verified successfully, record the mark of the third computing device as a hot migration state according to the identifier of the third computing device in the migration information.

[0227] In one implementation, after obtaining the encrypted identifier of the third computing device, the first computing device may decode the encrypted identifier of the third computing device to obtain the identifier of the third computing device. The first computing device may record the mark of the third computing device as a hot migration state according to the identifier of the third computing device.

[0228] S304: The second computing device migrates the target virtual machine from the second computing device to the third computing device according to the hot migration request.

[0229] In this embodiment, the second computing device can migrate the target virtual machine to the third computing device according to the hot migration request, wherein the target virtual machine includes USB protocol data.

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

[0231] It should also be noted that the second computing device may execute S302 and S303 first and then execute S304, or may execute S302 and S303 during the execution of S304, and this embodiment of the present application is not limited to this.

[0232] S305: When the target virtual machine is migrated from the second computing device to the third computing device, the first computing device obtains a service request.

[0233] In this embodiment, when the target virtual machine is migrated from the second computing device to the third computing device, the first computing device may obtain a service request, wherein the service request is a service request corresponding to the third computing device, and the service request is sent by the target virtual machine running on the third computing device.

[0234] S306: When the first computing device determines that the identifier of the computing device corresponding to the business request is the same as the identifier of the third computing device, and the third computing device is marked as a hot migration state, the USB protocol data between the first computing device and the second computing device is determined as the USB protocol data between the first computing device and the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data.

[0235] In this embodiment, the first computing device may determine whether the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device, and the third computing device is marked as being in a hot migration state.

[0236] If not, then end.

[0237] If so, the first computing device may determine that the service request is a service request sent by a third computing device that runs the target virtual machine.

[0238] The first computing device may determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data.

[0239] In one implementation, the USB protocol data between the first computing device and the second computing device is stored in a storage device (such as a memory or a hard disk) of the first computing device. The first computing device may obtain the USB protocol data stored in the storage device when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device, and the mark of the third computing device is in a hot migration state, and determine the USB protocol data as the USB protocol data between the first computing device and the third computing device.

[0240] Beneficial effects of this embodiment: In this embodiment, the second computing device can obtain a hot migration request. The second computing device sends the identifier of the third computing device to the first computing device according to the hot migration request. The first computing device can record the mark of the third computing device as a hot migration state according to the identifier of the third computing device. The second computing device can also migrate the target virtual machine to the third computing device according to the hot migration request. In the case where the target virtual machine is migrated from the second computing device to the third computing device, the first computing device can obtain a service request, and in the case of determining that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device, and the mark of the third computing device is in the hot migration state, the USB protocol data between the first computing device and the second computing device is determined as the USB protocol data between the first computing device and the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data. In the above manner, after a verification is performed using the identifier of the computing device corresponding to the service request, a second verification is performed using the hot migration state, thereby improving the security of the communication connection, and thereby improving the security of the data in the USB device.

[0241] Next, the migration process of the virtual machine is described from the perspectives of qemu 1, qemu 2, and usbredir server through method embodiment 3.

[0242] In this embodiment, qemu 1 is run on the second computing device, and qemu 2 is run on the third computing device.

[0243] qemu 1 includes three hot migration callback functions, namely migration start function, migration success function, and migration failure function. qemu 2 includes three hot migration callback functions, namely migration start function, migration success function, and migration failure function.

[0244] The following describes the virtual machine migration process from the perspective of qemu 1 and qemu 2.

[0245] In one implementation:

[0246] The migration start function of qemu 1 can send the identifier of the third computing device to the usbredir server running on the first computing device according to the hot migration request after obtaining the hot migration request. It should be noted that the usbredir server running on the first computing device is connected to qemu 1 running on the second computing device through the USB protocol data between the first computing device and the second computing device.

[0247] The migration start function of qemu 1 can migrate the target virtual machine to the third computing device according to the hot migration request.

[0248] When the target virtual machine is migrated from the second computing device to the third computing device, the usbredir server running on the first computing device can obtain the service request. It should be noted that the service request can be sent by qemu 2 running on the third computing device for the target virtual machine running on the third computing device.

[0249] The usbredir server running on the first computing device can determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device.

[0250] The usbredir server running on the first computing device can establish a connection with the qemu 2 running on the third computing device through the USB protocol data between the first computing device and the third computing device.

[0251] The usbredir server running on the first computing device can obtain the migration success information. In one implementation, the migration success function of qemu 1 can send the migration success information of the target virtual machine to the usbredir server running on the first computing device when the migration success of the target virtual machine is identified. In one implementation, the migration success function of qemu 2 can send the migration success information of the target virtual machine to the usbredir server running on the first computing device when the migration success of the target virtual machine is identified.

[0252] The usbredir server running on the first computing device disconnects the usbredir server running on the first computing device from qemu 1 running on the second computing device in response to the migration success information of the target virtual machine. In addition, in one implementation, the usbredir server running on the first computing device may delete the mark (hot migration state) of the third computing device in response to the migration end information of the target virtual machine. In one implementation, the migration end information may be migration success information.

[0253] In addition, it should be noted that, in one implementation, the usbredirserver running on the first computing device can obtain the migration failure information of the target virtual machine. In one implementation, the migration failure function of qemu 1 can send the migration failure information of the target virtual machine to the usbredir server running on the first computing device when the migration failure of the target virtual machine is identified. In one implementation, the migration failure function of qemu 2 can send the migration failure information of the target virtual machine to the usbredir server running on the first computing device when the migration failure of the target virtual machine is identified.

[0254] The usbredir server running on the first computing device responds to the migration failure information of the target virtual machine and retains the connection between the usbredir server running on the first computing device and the qemu 1 running on the second computing device. In addition, in one implementation, the usbredir server running on the first computing device responds to the migration end information of the target virtual machine and can delete the mark (hot migration state) of the third computing device. In one implementation, the migration end information can be migration failure information.

[0255] Beneficial effects of this embodiment: by adding a hot migration callback function in qemu 1 of the second computing device and qemu 2 of the third computing device, after the target virtual machine is migrated, based on the identifier of the third computing device, the USB protocol data between the first computing device and the second computing device can be determined as the USB protocol data between the first computing device and the third computing device, thereby automatically restoring the target virtual machine on the third computing device's ability to access the USB device on the first computing device, thereby achieving business continuity.

[0256] Next, the migration process of the virtual machine is described from the perspective of the first computing device through method embodiment 4.

[0257] Figure 4 This is a flow chart of a fourth embodiment of a virtual machine migration method provided in an embodiment of the present application. Figure 4 , the method specifically comprises the following steps:

[0258] S401: The first computing device obtains an identifier of a third computing device sent by the second computing device.

[0259] In this embodiment, the first computing device may obtain the identification of the third computing device sent by the second computing device.

[0260] In one implementation, the identifier of the third computing device may be an IP address of the third computing device.

[0261] In one implementation, after acquiring the identifier of the third computing device, the first computing device may record the mark of the third computing device as the hot migration state according to the identifier of the third computing device.

[0262] It should be noted that the target virtual machine running on the second computing device can access the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device.

[0263] S402: When the target virtual machine is migrated from the second computing device to the third computing device, the first computing device determines, based on an identifier of the third computing device, that the USB protocol data is USB protocol data between the first computing device and the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data.

[0264] In this embodiment, the first computing device can determine, based on the identification of the third computing device, that the USB protocol data is the USB protocol data between the first computing device and the third computing device when the target virtual machine is migrated from the second computing device to the third computing device, that is, when the migration of the target virtual machine is successful, so that the migrated target virtual machine on the third computing device can access the USB device connected to the first computing device based on the USB protocol data.

[0265] In one implementation:

[0266] The first computing device may obtain the service request when the target virtual machine is migrated from the second computing device to the third computing device.

[0267] The first computing device may determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device.

[0268] In one implementation, the first computing device may determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device when it is determined that the identifier of the computing device corresponding to the business request is the same as the identifier of the third computing device and the third computing device is marked as a hot migration state.

[0269] In addition, in one implementation, the first computing device may disconnect the first computing device from the second computing device in response to the migration success information of the target virtual machine.

[0270] In addition, it should be noted that, in one implementation, the first computing device may retain the connection between the first computing device and the second computing device in response to the migration failure information of the target virtual machine.

[0271] In one implementation, the first computing device may delete the mark of the third computing device in response to the migration completion information of the target virtual machine.

[0272] Beneficial effects of this embodiment: During the migration of the target virtual machine, the target virtual machine running on the second computing device accesses the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device, and the first computing device can accurately parse the service request of the target virtual machine in the second computing device based on the USB protocol data between the first computing device and the second computing device. That is, during the migration of the target virtual machine, the target virtual machine running on the second computing device can maintain the normal operation of the business. After the target virtual machine migrates to the third computing device, the first computing device can determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device according to the identifier of the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data. That is, after the target virtual machine migrates to the third computing device, the first computing device can accurately parse the service request of the target virtual machine in the third computing device according to the USB protocol data between the first computing device and the third computing device. That is, after the migration of the target virtual machine is completed, the target virtual machine running on the third computing device can maintain the normal operation of the business. In summary, based on the method of the embodiment of the present application, there is no need to first uninstall the USB device and then re-mount the USB device during the migration process of the target virtual machine, nor is there a need to spend time controlling the first computing device to communicate and negotiate with the third computing device running the target virtual machine. The migrated target virtual machine on the third computing device can access the USB device connected to the first computing device, thereby achieving seamless switching of the USB device (from use by the target virtual machine on the second computing device to use by the target virtual machine on the third computing device), ensuring business continuity, and improving the user experience of the target virtual machine in the process of providing external services.

[0273] Figure 5 A flowchart of a fifth embodiment of a virtual machine migration method provided in an embodiment of the present application. Figure 5 , the method specifically comprises the following steps:

[0274] S501: Obtain a hot migration request.

[0275] In this embodiment, in one implementation, in a scenario where the target virtual machine needs to be migrated from the second computing device to the third computing device, the second computing device is the source device of the target virtual machine. The second computing device may obtain a hot migration request.

[0276] In one implementation,

[0277] The second computing device may determine a hot migration request according to the fault information corresponding to the second computing device.

[0278] In one implementation, when the fault information indicates that the second computing device has a fault, the second computing device may obtain a service level corresponding to each virtual machine, and determine a hot migration request according to the service level corresponding to each virtual machine.

[0279] In one implementation,

[0280] The second computing device may determine the hot migration request according to the load of each virtual machine corresponding to the second computing device.

[0281] S502: Sending an identifier of a third computing device to the first computing device according to the hot migration request.

[0282] In this embodiment, in one implementation, when the target virtual machine needs to be migrated from the second computing device to the third computing device, the second computing device may send an identifier of the third computing device to the first computing device according to a hot migration request.

[0283] The identifier of the third computing device is used for the first computing device to determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device when the target virtual machine is migrated from the second computing device to the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data. The target virtual machine running on the second computing device accesses the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device.

[0284] S503: Migrate the target virtual machine from the second computing device to the third computing device according to the hot migration request.

[0285] In this embodiment, in one implementation, in a scenario where the target virtual machine needs to be migrated from the second computing device to the third computing device, the second computing device can migrate the target virtual machine from the second computing device to the third computing device according to the hot migration request. The target virtual machine includes USB protocol data.

[0286] In addition, in one implementation, in a scenario where the target virtual machine needs to be migrated from the second computing device to the third computing device, the third computing device is the destination device of the target virtual machine. The third computing device can send a service request to the first computing device. The service request is used for the first computing device to determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device when the first computing device determines that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device.

[0287] Beneficial effects of this embodiment: in the case of obtaining a hot migration request, the identifier of the third computing device can be sent to the first computing device according to the hot migration request, and the target virtual machine can be migrated from the second computing device to the third computing device according to the hot migration request; the target virtual machine includes USB protocol data. Wherein, the identifier of the third computing device is used for the first computing device to determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device when the target virtual machine is migrated from the second computing device to the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data; wherein, the target virtual machine running on the second computing device accesses the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device. In the above manner, during the migration of the target virtual machine, the target virtual machine running on the second computing device can access the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device; after the target virtual machine is migrated to the third computing device, the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data, thereby ensuring business continuity.

[0288] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0289] Figure 6 A schematic diagram of a virtual machine migration apparatus provided in an embodiment of the present application is shown in FIG. The virtual machine migration apparatus 60 is applied to a first computing device, and the first computing device is connected to a universal serial bus (USB) device.

[0290] like Figure 6 As shown, the virtual machine migration device 60 includes: an acquisition module 61 and a processing module 62. Among them,

[0291] The acquisition module 61 is used to acquire the identifier of the third computing device sent by the second computing device; the target virtual machine running on the second computing device accesses the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device;

[0292] The processing module 62 is used to determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device according to the identification of the third computing device when the target virtual machine is migrated from the second computing device to the third computing device, so that the migrated target virtual machine on the third computing device can access the USB device connected to the first computing device based on the USB protocol data.

[0293] The migration device of the virtual machine provided in the embodiment of the present application can execute the technical solution in which the execution subject is the first computing device in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

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

[0295] Get business request;

[0296] When it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device, the USB protocol data between the first computing device and the second computing device is determined as the USB protocol data between the first computing device and the third computing device.

[0297] The migration device of the virtual machine provided in the embodiment of the present application can execute the technical solution in which the execution subject is the first computing device in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0298] In one implementation, the identifier of the third computing device is an Internet Protocol (IP) address of the third computing device.

[0299] The migration device of the virtual machine provided in the embodiment of the present application can execute the technical solution in which the execution subject is the first computing device in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

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

[0301] According to the identifier of the third computing device, a mark of the third computing device is recorded as a hot migration state.

[0302] The migration device of the virtual machine provided in the embodiment of the present application can execute the technical solution in which the execution subject is the first computing device in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

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

[0304] When it is determined that the identifier of the computing device corresponding to the business request is the same as the identifier of the third computing device, and the third computing device is marked as a hot migration state, the USB protocol data between the first computing device and the second computing device is determined to be the USB protocol data between the first computing device and the third computing device.

[0305] The migration device of the virtual machine provided in the embodiment of the present application can execute the technical solution in which the execution subject is the first computing device in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0306] In one implementation, the communication module 63 is further configured to:

[0307] In response to the migration success information of the target virtual machine, the connection between the first computing device and the second computing device is disconnected.

[0308] The migration device of the virtual machine provided in the embodiment of the present application can execute the technical solution in which the execution subject is the first computing device in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0309] In one implementation, the communication module 63 is further configured to:

[0310] In response to migration failure information of the target virtual machine, the connection between the first computing device and the second computing device is retained.

[0311] The migration device of the virtual machine provided in the embodiment of the present application can execute the technical solution in which the execution subject is the first computing device in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0312] Figure 7 A schematic diagram of the structure of another virtual machine migration device provided in an embodiment of the present application.

[0313] like Figure 7 As shown, the virtual machine migration device 70 includes: an acquisition module 71, a first sending module 72, a processing module 73, and a second sending module 74.

[0314] An acquisition module 71 is used to acquire a hot migration request;

[0315] The first sending module 72 is used to send the identifier of the third computing device to the first computing device according to the hot migration request; the identifier of the third computing device is used for the first computing device to determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device when the target virtual machine is migrated from the second computing device to the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data; wherein the target virtual machine running on the second computing device accesses the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device;

[0316] The processing module 73 is used to migrate the target virtual machine from the second computing device to the third computing device according to the hot migration request; the target virtual machine includes USB protocol data.

[0317] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0318] In one implementation, the acquisition module 71 is specifically configured to:

[0319] Determining a hot migration request according to the fault information corresponding to the second computing device; and / or,

[0320] A hot migration request is determined according to the load of each virtual machine corresponding to the second computing device.

[0321] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0322] In one implementation, the acquisition module 71 is specifically configured to:

[0323] When the fault information indicates that the second computing device has a fault, obtaining a service level corresponding to each virtual machine;

[0324] Determine the hot migration request based on the service level corresponding to each virtual machine.

[0325] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0326] In one implementation, the apparatus further includes:

[0327] The second sending module 74 is used to send a service request to the first computing device when the target virtual machine is migrated from the second computing device to the third computing device; the service request is used for the first computing device to determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device.

[0328] The virtual machine migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0329] In one implementation,

[0330] The acquisition module 71, the first sending module 72, and the processing module 73 are applied to the second computing device;

[0331] The second sending module 74 is applied to the third computing device.

[0332] The acquisition module, the first sending module, and the processing module in the migration device of the virtual machine provided in the embodiment of the present application can execute the technical solution in which the execution subject is the second computing device in the above method embodiment. The second sending module in the migration device of the virtual machine provided in the embodiment of the present application can execute the technical solution in which the execution subject is the third computing device in the above method embodiment. The implementation principles and beneficial effects are similar and will not be repeated here.

[0333] Figure 8 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 of the first computing device in the aforementioned method embodiment.

[0334] 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 first computing device 80 may further include: a bus 83 for connecting the above devices.

[0335] The processor is used to execute the technical solution of the first computing device in the aforementioned method embodiment, and its implementation principle and technical effect are similar and will not be repeated here.

[0336] Fig. 9 A schematic diagram of the structure of another computing device provided in an embodiment of the present application. Fig. 9 As shown, the computing device 90 includes: a processor 91 and a memory 92; wherein the processor 91 is coupled to the memory 92, and the memory 92 is used to store computer instructions; the processor 91 is used to execute computer instructions to enable the computing device 90 to execute the technical solution in the aforementioned method embodiment.

[0337] Optionally, the memory 92 may be independent or integrated with the processor 91. Optionally, when the memory 92 is a device independent of the processor 91, the computing device 90 may further include: a bus 93 for connecting the above devices.

[0338] The processor is used to execute the technical solutions of the first computing device and the second computing device in the aforementioned method embodiment, and its implementation principle and technical effect are similar and will not be repeated here.

[0339] The computing device 90 may be a first computing device or a second computing device.

[0340] The embodiment of the present application also provides a computing system, the computing system comprising a first computing device, a second computing device, and a third computing device;

[0341] The first computing device is used to execute the technical solution of the first computing device in the aforementioned method embodiment;

[0342] The second computing device is used to execute the technical solution of the second computing device in the aforementioned method embodiment;

[0343] The third computing device is used to execute the technical solution of the third computing device in the aforementioned method embodiment.

[0344] 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.

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

[0346] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: volatile memory, non-volatile memory and other media that can store program codes.

[0347] 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 it. 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 method for migrating a virtual machine, characterized in that: Applied to a first computing device, the first computing device is connected to a universal serial bus (USB) device, the method comprises: Obtaining an identifier of a third computing device sent by the second computing device; a target virtual machine running on the second computing device accesses a USB device connected to the first computing device based on USB protocol data between the first computing device and the second computing device; In the case where the target virtual machine is migrated from the second computing device to the third computing device, the USB protocol data is determined to be USB protocol data between the first computing device and the third computing device according to an identifier of the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data.

2. The method according to claim 1, characterized in that The step of determining, according to the identifier of the third computing device, that the USB protocol data is USB protocol data between the first computing device and the third computing device includes: Get business request; When it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device, the USB protocol data between the first computing device and the second computing device is determined as the USB protocol data between the first computing device and the third computing device.

3. The method according to claim 2, characterized in that The identifier of the third computing device is an Internet Protocol IP address of the third computing device.

4. The method according to claim 2, characterized in that: The method further comprises: According to the identifier of the third computing device, a mark of the third computing device is recorded as a hot migration state.

5. The method according to claim 4, characterized in that The step of determining, when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device, that the USB protocol data between the first computing device and the second computing device is the USB protocol data between the first computing device and the third computing device, comprises: When it is determined that the identifier of the computing device corresponding to the business request is the same as the identifier of the third computing device, and the mark of the third computing device is the hot migration state, the USB protocol data between the first computing device and the second computing device is determined to be the USB protocol data between the first computing device and the third computing device.

6. The method according to any one of claims 1 to 5, characterized in that: Also includes: In response to the migration success information of the target virtual machine, the connection between the first computing device and the second computing device is disconnected.

7. The method according to any one of claims 1 to 5, characterized in that: Also includes: In response to the migration failure information of the target virtual machine, the connection between the first computing device and the second computing device is retained.

8. A method for migrating a virtual machine, characterized in that: The method comprises: Get hot migration request; sending an identifier of a third computing device to the first computing device according to the hot migration request; the identifier of the third computing device is used for the first computing device to determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device when the target virtual machine is migrated from the second computing device to the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data; wherein the target virtual machine running on the second computing device accesses the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device; According to the hot migration request, the target virtual machine is migrated from the second computing device to the third computing device; the target virtual machine includes the USB protocol data.

9. The method according to claim 8, characterized in that The method further comprises: When the target virtual machine is migrated from the second computing device to the third computing device, a service request is sent to the first computing device; the service request is used for the first computing device to determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device.

10. A virtual machine migration device, characterized in that: Applied to a first computing device, the first computing device is connected to a universal serial bus (USB) device, and the apparatus comprises: An acquisition module is used to acquire an identification of a third computing device sent by a second computing device; a target virtual machine running on the second computing device accesses a USB device connected to the first computing device based on USB protocol data between the first computing device and the second computing device; a processing module for determining, when the target virtual machine is migrated from the second computing device to the third computing device, that the USB protocol data is USB protocol data between the first computing device and the third computing device according to an identifier of the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data.

11. A virtual machine migration device, characterized in that: The device comprises: An acquisition module is used to obtain a hot migration request; a first sending module, configured to send an identifier of a third computing device to the first computing device according to the hot migration request; the identifier of the third computing device is used for the first computing device to determine that the USB protocol data is the USB protocol data between the first computing device and the third computing device when the target virtual machine is migrated from the second computing device to the third computing device, so that the migrated target virtual machine on the third computing device accesses the USB device connected to the first computing device based on the USB protocol data; wherein the target virtual machine running on the second computing device accesses the USB device connected to the first computing device based on the USB protocol data between the first computing device and the second computing device; A processing module is used to migrate the target virtual machine from the second computing device to the third computing device according to the hot migration request; the target virtual machine includes the USB protocol data.

12. The device according to claim 11, characterized in that The device also includes: The second sending module is used to send a service request to the first computing device when the target virtual machine is migrated from the second computing device to the third computing device; the service request is used for the first computing device to determine the USB protocol data between the first computing device and the second computing device as the USB protocol data between the first computing device and the third computing device when it is determined that the identifier of the computing device corresponding to the service request is the same as the identifier of the third computing device.

13. The device according to claim 12, characterized in that The acquisition module, the first sending module, and the processing module are applied to the second computing device; The second sending module is applied to the third computing device.

14. 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 that the computing device implements the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Virtual machine migration method and apparatus, and computing device

    WO2026091875A1