Switching processing method and equipment of virtual machine and storage medium
By receiving and processing business data traffic during virtual machine switching and copying running data using the synchronization engine, seamless switching of virtual machines is achieved, solving the problem of low business continuity in virtual machine switching and improving switching efficiency and reliability.
Patent Information
- Application Number
- CN202510437752.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-25
AI Technical Summary
In the prior art, it is necessary to suspend the reception of service data traffic during virtual machines switching, resulting in the problem of low business continuity.
The service data traffic transmitted by the receiving network interface is sent to the target virtual machine for processing, and the synchronization engine is used to obtain the operating data of the target virtual machine and copy it to the virtual machine to be switched to generate a switching permission signal to achieve seamless switching of service data traffic.
It ensures the continuity of business traffic processing, avoids business interruptions during virtual machine switching, and improves switching efficiency and reliability.
Smart Images

Figure CN120378295A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of virtualization technology, and particularly to a method, device, and storage medium for switching processing of virtual machines. Background Art
[0002] Business data traffic refers to the data traffic generated during the operation of an enterprise, mainly used for communication, networking, and related data value-added services. Due to the complexity of this business data traffic, it usually requires the corresponding virtual machines of the server to process it. Therefore, according to different business processing requirements, the switching or handover between virtual machines is particularly important.
[0003] In the related art, when it is necessary to switch a virtual machine, it is necessary to pause receiving business data traffic. After manually configuring and switching the virtual machine to be switched, resume receiving and processing business data traffic. However, in the related art, the method of stopping receiving business data traffic and manually configuring and switching the virtual machine to be switched is likely to cause the problem of low business continuity. Summary of the Invention
[0004] This application provides a method, device, and storage medium for switching processing of virtual machines to at least solve the problem in the related art that the method of stopping receiving business data traffic and manually configuring and switching the virtual machine to be switched is likely to cause the problem of low business continuity.
[0005] This application provides a method for switching processing of virtual machines, including:
[0006] Receiving business data traffic transmitted by a network interface;
[0007] Sending the business data traffic to the initialized target virtual machine so that the target virtual machine processes the business data traffic;
[0008] Initializing the virtual machine to be switched according to a pre-generated driver loading notification;
[0009] After the virtual machine to be switched is initialized, sending a switching prompt to the synchronization engine so that the synchronization engine obtains the running data of the target virtual machine according to the switching prompt, copies the running data to the virtual machine to be switched, and generates a switching permission signal;
[0010] Receiving the switching permission signal sent by the synchronization engine;
[0011] According to the switching permission signal, sending the business data traffic to the virtual machine to be switched so that the virtual machine to be switched processes the business data traffic.
[0012] This application also provides a method for switching processing of virtual machines, including:
[0013] After the virtual machine to be switched is initialized, receive the switching prompt sent by the redirection layer. The virtual machine to be switched is initialized by the redirection layer according to the pre-generated driver loading notification;
[0014] Obtain the running data of the initialized target virtual machine according to the switching prompt;
[0015] Copy the running data to the virtual machine to be switched and generate a switching permission signal;
[0016] Send the switching permission signal to the redirection layer, so that the redirection layer sends the service data traffic to the virtual machine to be switched according to the switching permission signal, so that the virtual machine to be switched processes the service data traffic. The service data traffic is obtained by the redirection layer through the network interface. Before the service data traffic is sent to the virtual machine to be switched, the service data traffic is processed by the target virtual machine.
[0017] This application also provides a method for switching and processing virtual machines, including:
[0018] The redirection layer receives the service data traffic transmitted by the network interface and sends the service data traffic to the initialized target virtual machine;
[0019] The target virtual machine processes the service data traffic;
[0020] The redirection layer initializes the virtual machine to be switched according to the pre-generated driver loading notification. After the virtual machine to be switched is initialized, send a switching prompt to the synchronization engine;
[0021] The synchronization engine obtains the running data of the target virtual machine, copies the running data to the virtual machine to be switched, generates a switching permission signal, and sends the switching permission signal to the redirection layer;
[0022] The redirection layer sends the service data traffic to the virtual machine to be switched according to the switching permission signal;
[0023] The virtual machine to be switched processes the service data traffic.
[0024] This application also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any of the above virtual machine switching and processing methods when executing the computer program.
[0025] This application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above virtual machine switching and processing methods are implemented.
[0026] The switching processing method, device, and storage medium for virtual machines provided by the embodiments of the present application receive the service data traffic transmitted through the network interface; send the service data traffic to the initialized target virtual machine so that the target virtual machine processes the service data traffic; complete the initialization of the virtual machine to be switched according to the pre-generated driver loading notification; after the virtual machine to be switched is initialized, send a switching prompt to the synchronization engine so that the synchronization engine obtains the running data of the target virtual machine according to the switching prompt, copies the running data to the virtual machine to be switched, and generates a switching permission signal; receive the switching permission signal sent by the synchronization engine; according to the switching permission signal, send the service data traffic to the virtual machine to be switched so that the virtual machine to be switched processes the service data traffic, without pausing the reception and processing of the service data traffic to manually configure and switch the virtual machine to be switched, and can automatically switch the corresponding virtual machine, thus ensuring the continuity of service traffic processing. Description of the Drawings
[0027] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0028] Figure 1 It is a schematic diagram of the application scenario of the virtual machine switching processing method provided by the embodiments of the present application;
[0029] Figure 2 It is a flowchart of the virtual machine switching processing method provided by the embodiments of the present application Figure 1 ;
[0030] Figure 3 It is a flowchart of the virtual machine switching processing method provided by the embodiments of the present application Figure 2 ;
[0031] Figure 4 It is a flowchart of the virtual machine switching processing method provided by the embodiments of the present application Figure 3 ;
[0032] Figure 5 It is a flowchart of the virtual machine switching processing method provided by the embodiments of the present application Figure 4 ;
[0033] Figure 6 It is a schematic diagram of the structure of the virtual machine switching processing device provided by the embodiments of the present application Figure 1 ;
[0034] Figure 7 It is a schematic diagram of the structure of the virtual machine switching processing device provided by the embodiments of the present application Figure 2 ;
[0035] Figure 8 Structural schematic diagram of the virtual machine switching processing device provided by the embodiment of the present application Figure 3 ;
[0036] Figure 9 Hardware structure schematic diagram of the electronic device provided by the embodiment of the present application. Specific embodiments
[0037] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0038] It should be noted that in the description of the present application, the terms "including", "comprising" or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0039] Business data traffic refers to the data traffic generated during the operation of an enterprise, which is mainly used for communication, networks, and related data value-added services. Due to the complexity of this business data traffic, it is usually necessary for the virtual machines corresponding to the servers to process it. Therefore, according to different business processing requirements, the switching or switching between virtual machines is particularly important. In the related art, when it is necessary to switch virtual machines, it is necessary to pause receiving business data traffic. After manually configuring and switching the virtual machine to be switched, the business data traffic is received and processed again. However, in the related art, the processing method of stopping receiving business data traffic and manually configuring and switching the virtual machine to be switched is likely to cause the problem of low business continuity.
[0040] To solve the above technical problems, the embodiments of the present application propose the following technical concept: The inventor considers the business data traffic transmitted by the network interface, processes the business data traffic through the target virtual machine, uses the synchronization engine to obtain the running data of the target virtual machine, copies the running data to the virtual machine to be switched, and generates a switching permission signal. According to the switching permission signal, the business data traffic is sent to the virtual machine to be switched for processing, without pausing the reception and processing of the business data traffic, and manually configuring and switching the virtual machine to be switched, thus ensuring the continuity of business traffic processing.
[0041] To enable those skilled in the art of the present technology to better understand the solution of this application, the following further elaborates on this application in combination with the accompanying drawings and specific implementation manners.
[0042] In combination with the specific application environment architecture or specific hardware architecture on which the execution of the switching processing method of the virtual machine depends, the specific application environment architecture or specific hardware architecture is described herein. Refer to Figure 1 , Figure 1 which is a schematic diagram of the application scenario of the switching processing method of the virtual machine.
[0043] As Figure 1 shown, the electronic device in this scenario includes: server 10 and client 20.
[0044] Server 10 can be an independent server or a cluster composed of multiple servers.
[0045] Among them, server 10 at least includes: a network interface, a target virtual machine, a virtual machine to be switched, a redirection layer, and a synchronization engine.
[0046] Client 20 can be a display terminal or other user terminals.
[0047] Server 10 receives the service data traffic transmitted by the network interface; sends the service data traffic to the initialized target virtual machine so that the target virtual machine processes the service data traffic; according to the instruction of client 20, completes the initialization of the virtual machine to be switched according to the pre-generated driver loading notification; after the initialization of the virtual machine to be switched, sends a switching prompt to the synchronization engine so that the synchronization engine obtains the running data of the target virtual machine according to the switching prompt, copies the running data to the virtual machine to be switched, and generates a switching permission signal; receives the switching permission signal sent by the synchronization engine; according to the switching permission signal, sends the service data traffic to the virtual machine to be switched so that the virtual machine to be switched processes the service data traffic.
[0048] Figure 2 is a flow schematic of the switching processing method of the virtual machine provided by the embodiment of this application Figure 1 ,As Figure 2 shown, the embodiment of this application provides a switching processing method of a virtual machine, and the method is described in detail as follows:
[0049] S201: Receive the service data traffic transmitted by the network interface.
[0050] In this embodiment, the service data traffic is I / O traffic. I / O traffic refers to the amount of data flowing in the server system during input / output operations. I / O is the abbreviation of input / output, representing the process of data transmission between different locations in a computer. Specifically, I / O traffic involves the process of data being read from an external device into memory or being output from memory to an external device.
[0051] S202: Send the service data traffic to the initialized target virtual machine so that the target virtual machine processes the service data traffic.
[0052] In this embodiment, the initialization process of the target virtual machine specifically includes steps a to f:
[0053] Step a: Receive a driver loading notification sent by a preset first driver.
[0054] Step b: Retrieve the first version number of the first driver in a preset symbol table according to the driver loading notification.
[0055] Specifically, retrieve the first version number of the first driver in the preset symbol table according to the driver loading notification and the function naming rule.
[0056] Among them, the function naming rule is a prefix with a version number.
[0057] Step c: Perform version configuration on the first driver according to the first version number to complete the preliminary configuration of the first driver.
[0058] Step d: Perform first interface function configuration on the first driver to complete the configuration of the first driver.
[0059] Step e: Write the first driver into a preset routing table to obtain an initial routing table.
[0060] Step f: After obtaining the initial routing table, bind the first driver to the target virtual machine to complete the initialization of the target virtual machine, where the target virtual machine is created by an adapter through a preset virtualization technology.
[0061] In this embodiment, the adapter can be a host bus adapter or other adapters.
[0062] In this embodiment, the preset virtualization technology can be the SR-IOV technology or other virtualization technologies.
[0063] Among them, the SR-IOV technology is a hardware-accelerated virtualization technology that allows multiple virtual machines to access physical devices simultaneously, thereby improving the performance and reliability of virtual machines.
[0064] Specifically, the service data traffic is sent to the first driver through the initial routing table and the first interface function, so that the first driver performs format conversion on the service data traffic to obtain the converted service data traffic, and the converted service data traffic is sent to the target virtual machine.
[0065] S203: Initialize the virtual machine to be switched according to the pre-generated driver loading notification.
[0066] In this embodiment, the generation process of the driver loading notification includes steps g to j:
[0067] Step g: The adapter creates the virtual machine to be switched according to the preset virtualization technology.
[0068] Step h: The client sends a switching instruction and the corresponding switching data packet to the control platform.
[0069] In this embodiment, the client can be a user space management interface or other display interfaces.
[0070] Step i: The control platform registers the switching data packet as the second driver according to the switching instruction.
[0071] In this embodiment, the control platform can be a kernel state control platform or other control platforms.
[0072] Step j: The second driver sends a driver loading notification to the redirection layer.
[0073] In this embodiment, the redirection layer can be a dynamic request redirection layer or other redirection layers.
[0074] Specifically, step S203 specifically includes:
[0075] S2031: Retrieve the second version number of the second driver in the preset symbol table according to the driver loading notification.
[0076] S2032: Perform version configuration on the second driver according to the second version number to complete the preliminary configuration of the second driver.
[0077] S2033: Perform second interface function configuration on the second driver to complete the configuration of the second driver.
[0078] S2034: Write the second driver into the initial routing table to obtain a dual routing table.
[0079] In this embodiment, the dual-driver parallelism of the first driver and the second driver can also be achieved through the dual routing table.
[0080] In addition, by virtualizing the configuration space of the high-speed interconnect bus device, the first driver and the second driver respectively access independent memory-mapped input / output regions, achieving logical segmentation of hardware resources, and the first driver and the second driver can access the hardware resources simultaneously.
[0081] S2035: After obtaining the dual routing table, bind the second driver to the virtual machine to be switched, and complete the initialization of the virtual machine to be switched, where the virtual machine to be switched is created by the adapter through a preset virtualization technology.
[0082] S204: After the initialization of the virtual machine to be switched, send a switching prompt to the synchronization engine, so that the synchronization engine obtains the running data of the target virtual machine according to the switching prompt, copies the running data to the virtual machine to be switched, and generates a switching permission signal.
[0083] In this embodiment, the synchronization engine can be a state synchronization engine or other synchronization engines.
[0084] Specifically, the running data is copied to the virtual machine to be switched through the zero-copy transfer technology.
[0085] S205: Receive the switching permission signal sent by the synchronization engine.
[0086] S206: According to the switching permission signal, send the service data traffic to the virtual machine to be switched, so that the virtual machine to be switched processes the service data traffic.
[0087] Specifically, sending the service data traffic to the virtual machine to be switched in step S206 is specifically: according to the switching permission signal, send the service data traffic to the second driver through the dual routing table and the second interface function, so that the second driver performs format conversion on the service data traffic to obtain the converted service data traffic, and send the converted service data traffic to the virtual machine to be switched.
[0088] In addition, it is also necessary to control the queue load status of the virtual machine to be switched.
[0089] In addition, a secure offloading protection can also be set. The secure offloading protection is used to provide a driver rollback mechanism, and automatically switches back to the first driver when the second driver is abnormal.
[0090] In addition, the above-mentioned target virtual machine and the virtual machine to be switched are simultaneously allocated independent memory-mapped input / output spaces and interrupt vectors to prevent hardware resource conflicts.
[0091] In summary, the virtual machine switching processing method provided in this embodiment receives the service data traffic transmitted by the network interface, sends the service data traffic to the initialized target virtual machine so that the target virtual machine processes the service data traffic, initializes the virtual machine to be switched according to the pre-generated driver loading notification, and after the virtual machine to be switched is initialized, sends a switching prompt to the synchronization engine so that the synchronization engine obtains the running data of the target virtual machine according to the switching prompt, copies the running data to the virtual machine to be switched, and generates a switching permission signal. It receives the switching permission signal sent by the synchronization engine and, according to the switching permission signal, sends the service data traffic to the virtual machine to be switched so that the virtual machine to be switched processes the service data traffic. There is no need to pause receiving and processing the service data traffic to manually configure and switch the virtual machine to be switched, and the corresponding virtual machine can be automatically switched, ensuring the continuity of service traffic processing.
[0092] In addition, the virtual machine switching processing method provided in this embodiment realizes business unawareness during the driver upgrade process through the cooperation of hardware virtualization and the kernel state, ensuring the high availability of the key storage system.
[0093] In addition, the loose coupling design of each module in the virtual machine switching processing method provided in this embodiment supports flexible expansion and can adapt to various host bus adapter device types.
[0094] In addition, the virtual machine switching processing method provided in this embodiment sets up a secure uninstall protection, which is used to provide a driver rollback mechanism. When the second driver is abnormal, it automatically switches back to the first driver, increasing the reliability of virtual machine switching.
[0095] Figure 3 It is a flow schematic of the virtual machine switching processing method provided in the embodiment of the present application. Figure 2 In the embodiment of the present application, on the basis of the embodiment provided, a detailed description is given of the specific implementation method of the subsequent process of virtual machine switching processing after step S206. As Figure 2 shown, the method includes: Figure 3 shown, the method includes:
[0096] S301: Receive the service data traffic transmitted by the network interface.
[0097] In this embodiment, the discussion on the service data traffic has been described in detail in step S201 and will not be elaborated here.
[0098] S302: Send the service data traffic to the initialized target virtual machine so that the target virtual machine processes the service data traffic.
[0099] In this embodiment, the discussion on the initialization process of the target virtual machine has been described in detail in step S202, and will not be elaborated here.
[0100] S303: Complete the initialization of the virtual machine to be switched according to the pre-generated driver loading notification.
[0101] In this embodiment, the discussion on the generation of the driver loading notification has been described in detail in step S203, and will not be elaborated here.
[0102] S304: After the initialization of the virtual machine to be switched, send a switching prompt to the synchronization engine, so that the synchronization engine obtains the running data of the target virtual machine according to the switching prompt, copies the running data to the virtual machine to be switched, and generates a switching permission signal.
[0103] In this embodiment, the discussion on the synchronization engine has been described in detail in step S204, and will not be elaborated here.
[0104] S305: Receive the switching permission signal sent by the synchronization engine.
[0105] S306: According to the switching permission signal, send the service data traffic to the virtual machine to be switched, so that the virtual machine to be switched processes the service data traffic.
[0106] In this embodiment, the discussion on sending the service data traffic to the virtual machine to be switched has been described in detail in step S206, and will not be elaborated here.
[0107] S307: Receive the inventory processing request sent by the target virtual machine, where the inventory processing request is sent by the virtual machine to be switched to the target virtual machine, and the inventory processing request is generated after the virtual machine to be switched interrupts the service data traffic processing process after a preset time.
[0108] S308: According to the inventory processing request, send the inventory service data traffic to the target virtual machine, so that the target virtual machine processes the inventory service data traffic. The inventory service data traffic is obtained by storing the unprocessed service data traffic according to the temporary storage service data traffic notification, and the temporary storage service data traffic notification is sent by the synchronization engine.
[0109] In this embodiment, the sending of the temporary storage service data traffic notification and the generation of the inventory service data traffic are performed after sending the switching prompt to the redirection layer in step S304.
[0110] S309: Receive the uninstallation notification sent by the user terminal, where the uninstallation notification is generated after the user terminal queries that the inventory service data traffic processing is completed.
[0111] S310: Uninstall the first interface function according to the uninstall notification, and generate an unbinding notification.
[0112] S311: Send an unbinding notification to the first driver so that the first driver unbinds from the target virtual machine according to the unbinding notification, generates a binding unbinding prompt, sends the binding unbinding prompt to the user end so that the user end uninstalls the first driver according to the binding unbinding prompt, obtains the first running status data of the target virtual machine, obtains the second running status data of the virtual machine to be switched, generates a virtual machine switching report according to the first running status data and the second running status data, and outputs the virtual machine switching report.
[0113] In this embodiment, the virtual machine switching report at least includes switching time consumption, performance fluctuation analysis and abnormal event log.
[0114] In summary, the virtual machine switching processing method provided in the present embodiment receives an inventory processing request sent by the target virtual machine, sends the inventory business data traffic to the target virtual machine according to the inventory processing request, so that the target virtual machine processes the inventory business data traffic, receives an uninstallation notification sent by the user end, uninstalls the first interface function according to the uninstallation notification, generates an unbinding notification, sends the unbinding notification to the first driver, so that the first driver unbinds from the target virtual machine according to the unbinding notification, generates a binding unbinding prompt, sends the binding unbinding prompt to the user end, so that the user end uninstalls the first driver according to the binding unbinding prompt, generates a virtual machine switching report using the first operating status data of the target virtual machine and the second operating status data of the virtual machine to be switched, and outputs the virtual machine switching report, so that the user can more intuitively understand the operation of the target virtual machine and the virtual machine to be switched, thereby improving the user experience.
[0115] In addition, the virtual machine switching processing method provided in this embodiment saves the operating resources of the device by binding the first driver to the target virtual machine and uninstalling the first driver.
[0116] Figure 4 A schematic diagram of a virtual machine switching process provided in an embodiment of the present application Figure 3 ,like Figure 4 As shown, the embodiment of the present application provides another virtual machine switching processing method, and the method is described in detail as follows:
[0117] S401: After the virtual machine to be switched is initialized, a switching prompt sent by the redirection layer is received. The initialization of the virtual machine to be switched is completed by the redirection layer according to the pre-generated driver loading notification.
[0118] S402: Acquire the operation data of the initialized target virtual machine according to the switching prompt.
[0119] In this embodiment, the running data at least includes register mirror data, system memory, and interrupt migration information; the register mirror data includes one or more pieces of mirror data; the system memory data is a corresponding data list, and the data list includes one or more pieces of table data; the interrupt migration information at least includes interrupt status data, and the interrupt status data contains an interrupt vector. Accordingly, step S502 is specifically: obtaining the register mirror data, system memory data, and interrupt migration information of the target virtual machine according to the switching prompt.
[0120] S403: Copy the running data to the virtual machine to be switched, and generate a switching permission signal.
[0121] Specifically, step S403 specifically includes:
[0122] S4031: Copy one or more pieces of mirror data in the register mirror data to the virtual machine to be switched.
[0123] In this embodiment, the mirror data is control register data, queue pointer, hardware address, and other mirror data.
[0124] S4032: Copy one or more pieces of table data in the data list corresponding to the system memory data to the virtual machine to be switched.
[0125] In this embodiment, the data list can be a Scatter-Gather list or other lists.
[0126] Among them, the Scatter-Gather list is a data structure used to describe a data buffer. It is mainly used in the memory address space to identify the data of the source buffer or the target buffer.
[0127] S4033: Disable the interrupt enable of the virtual machine to be switched, and copy the interrupt status data in the interrupt migration information to the virtual machine to be switched, where the interrupt status data is used to indicate redirecting the interrupt vector to the virtual machine to be switched.
[0128] In this embodiment, the interrupt migration information includes an interrupt vector and the CPU affinity policy of the interrupt processing thread.
[0129] In this embodiment, the interrupt vector can be an MSI-X interrupt vector table or other vectors.
[0130] Among them, the MSI-X interrupt vector is the unique identifier for the high-speed interconnect bus device to trigger a specific interrupt event through the MSI-X interrupt mechanism. Each vector corresponds to an independent interrupt service program entry address, which is used to process different hardware events.
[0131] In addition, the interrupt status data is also used to submit the interrupt vector to the second driver for processing.
[0132] S404: Send the handover permission signal to the redirection layer so that the redirection layer sends the service data traffic to the virtual machine to be handed over according to the handover permission signal, so that the virtual machine to be handed over processes the service data traffic, where the service data traffic is obtained by the redirection layer through the network interface, and before the service data traffic is sent to the virtual machine to be handed over, the service data traffic is processed by the target virtual machine.
[0133] In summary, the virtual machine handover processing method provided in this embodiment receives a handover prompt sent by the redirection layer after the virtual machine to be handed over is initialized; obtains the running data of the initialized target virtual machine according to the handover prompt; copies the running data to the virtual machine to be handed over and generates a handover permission signal; sends the handover permission signal to the redirection layer so that the redirection layer sends the service data traffic to the virtual machine to be handed over according to the handover permission signal, so that the virtual machine to be handed over processes the service data traffic, and before the service data traffic is sent to the virtual machine to be handed over, the service data traffic is processed by the target virtual machine. There is no need to pause receiving and processing the service data traffic to manually configure and switch the virtual machine to be handed over, and the corresponding virtual machine can be automatically switched, ensuring the continuity of service traffic processing.
[0134] In addition, the virtual machine handover processing method provided in this embodiment can improve the subsequent virtual machine handover efficiency by obtaining the running data of the target virtual machine and copying the running data to the virtual machine to be handed over.
[0135] Figure 5 It is a schematic flow of the virtual machine handover processing method provided in the embodiment of the present application Figure 4 , such as Figure 5 shown, the embodiment of the present application provides another virtual machine handover processing method, and the method is described in detail as follows:
[0136] S501: The redirection layer receives the service data traffic transmitted by the network interface and sends the service data traffic to the initialized target virtual machine.
[0137] S502: The target virtual machine processes the service data traffic.
[0138] S503: The redirection layer initializes the virtual machine to be handed over according to the pre-generated driver loading notification, and after the virtual machine to be handed over is initialized, sends a handover prompt to the synchronization engine.
[0139] S504: The synchronization engine obtains the running data of the target virtual machine, copies the running data to the virtual machine to be handed over, generates a handover permission signal, and sends the handover permission signal to the redirection layer.
[0140] S505: Redirection layer, which sends the service data traffic to the virtual machine to be switched according to the handover permission signal.
[0141] S506: The virtual machine to be switched processes the service data traffic.
[0142] In summary, the virtual machine handover processing method provided in this embodiment receives the service data traffic transmitted by the network interface through the redirection layer and sends the service data traffic to the initialized target virtual machine; the target virtual machine processes the service data traffic; the redirection layer completes the initialization of the virtual machine to be switched according to the pre-generated driver loading notification, and after the initialization of the virtual machine to be switched, sends a handover prompt to the synchronization engine; the synchronization engine obtains the running data of the target virtual machine, copies the running data to the virtual machine to be switched, generates a handover permission signal, and sends the handover permission signal to the redirection layer; the redirection layer sends the service data traffic to the virtual machine to be switched according to the handover permission signal; the virtual machine to be switched processes the service data traffic, without the need to pause receiving and processing the service data traffic to manually configure and switch the virtual machine to be switched, and can automatically switch the corresponding virtual machine, thus ensuring the continuity of service traffic processing.
[0143] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0144] It should be noted that the redirection layer, the first driver, and the second driver can be divided into the data plane; the high-speed interconnect bus device virtualization agent, the target virtual machine, and the virtual machine to be switched can be divided into the hardware abstraction layer.
[0145] Figure 6 The structural schematic of the virtual machine handover processing device provided in the embodiment of the present application Figure 1 . As Figure 6 shown, the embodiment of the present application also provides a virtual machine handover processing device, including a first receiving module 601, a first sending module 602, an initialization module 603, a second sending module 604, a second receiving module 605, and a third sending module 606.
[0146] The first receiving module 601 is used to receive the service data traffic transmitted by the network interface;
[0147] The first sending module 602 is used to send the service data traffic to the initialized target virtual machine so that the target virtual machine processes the service data traffic;
[0148] An initialization module 603, configured to complete the initialization of the virtual machine to be switched according to a pre-generated driver loading notification;
[0149] A second sending module 604, configured to send a switching prompt to a synchronization engine after the initialization of the virtual machine to be switched, so that the synchronization engine obtains the running data of the target virtual machine according to the switching prompt, copies the running data to the virtual machine to be switched, and generates a switching permission signal;
[0150] A second receiving module 605, configured to receive the switching permission signal sent by the synchronization engine;
[0151] A third sending module 606, configured to send service data traffic to the virtual machine to be switched according to the switching permission signal, so that the virtual machine to be switched processes the service data traffic.
[0152] In a possible implementation manner, the apparatus further includes:
[0153] A third receiving module, configured to receive a driver loading notification sent by a preset first driver;
[0154] A retrieval module, configured to retrieve a first version number of the first driver in a preset symbol table according to the driver loading notification;
[0155] A first configuration module, configured to perform version configuration on the first driver according to the first version number to complete the preliminary configuration of the first driver;
[0156] A second configuration module, configured to perform first interface function configuration on the first driver to complete the configuration of the first driver;
[0157] A writing module, configured to write the first driver into a preset routing table to obtain an initial routing table;
[0158] A binding module, configured to bind the first driver to a target virtual machine after obtaining the initial routing table to complete the initialization of the target virtual machine, where the target virtual machine is created by an adapter through a preset virtualization technology.
[0159] In a possible implementation manner, the initialization module 603 specifically includes:
[0160] A retrieval unit, configured to retrieve a second version number of a second driver in a preset symbol table according to the driver loading notification;
[0161] A first configuration unit, configured to perform version configuration on the second driver according to the second version number to complete the preliminary configuration of the second driver;
[0162] A second configuration unit, configured to perform second interface function configuration on the second driver to complete the configuration of the second driver;
[0163] A writing unit, configured to write a second driver into an initial routing table to obtain a dual routing table;
[0164] A binding unit, configured to bind the second driver to a virtual machine to be switched after obtaining the dual routing table, and complete the initialization of the virtual machine to be switched, where the virtual machine to be switched is created by an adapter through a preset virtualization technology.
[0165] In a possible implementation, the first sending module 602 is specifically configured to: send service data traffic to a first driver through the initial routing table and a first interface function, so that the first driver performs format conversion on the service data traffic to obtain the converted service data traffic, and send the converted service data traffic to a target virtual machine.
[0166] In a possible implementation, the apparatus further includes:
[0167] A fourth receiving module, configured to receive a stock processing request sent by the target virtual machine, where the stock processing request is sent by the virtual machine to be switched to the target virtual machine, and the stock processing request is generated after the virtual machine to be switched interrupts a service data traffic processing process at a preset time;
[0168] A fourth sending module, configured to send stock service data traffic to the target virtual machine according to the stock processing request, so that the target virtual machine processes the stock service data traffic, where the stock service data traffic is obtained by storing unprocessed service data traffic according to a temporary storage service data traffic notification, and the temporary storage service data traffic notification is sent by a synchronization engine;
[0169] A fifth receiving module, configured to receive an uninstallation notification sent by a user terminal, where the uninstallation notification is generated after the user terminal queries that the stock service data traffic processing is completed;
[0170] An uninstallation module, configured to uninstall the first interface function according to the uninstallation notification and generate an unbinding notification;
[0171] A fifth sending module, configured to send the unbinding notification to the first driver, so that the first driver releases the binding with the target virtual machine according to the unbinding notification, generates a binding release prompt, and sends the binding release prompt to the user terminal, so that the user terminal uninstalls the first driver according to the binding release prompt, obtains first running state data of the target virtual machine, obtains second running state data of the virtual machine to be switched, generates a virtual machine switching report according to the first running state data and the second running state data, and outputs the virtual machine switching report.
[0172] For the description of the features in the embodiments corresponding to the virtual machine switching processing apparatus, reference may be made to the relevant descriptions in the embodiments corresponding to the virtual machine switching processing method, which will not be elaborated here one by one.
[0173] Figure 7Structural schematic of the virtual machine switching processing device provided by the embodiment of the present application Figure 2 As Figure 7 shown, the embodiment of the present application also provides a virtual machine switching processing device, including a receiving module 701, an obtaining module 702, a copying module 703, and a sending module 704.
[0174] The receiving module 701 is configured to receive a switching prompt sent by the redirection layer after the virtual machine to be switched is initialized, and the virtual machine to be switched is initialized by the redirection layer according to a pre-generated driver loading notification;
[0175] The obtaining module 702 is configured to obtain the running data of the initialized target virtual machine according to the switching prompt;
[0176] The copying module 703 is configured to copy the running data to the virtual machine to be switched and generate a switching permission signal;
[0177] The sending module 704 is configured to send the switching permission signal to the redirection layer, so that the redirection layer sends the service data traffic to the virtual machine to be switched according to the switching permission signal, so that the virtual machine to be switched processes the service data traffic, where the service data traffic is obtained by the redirection layer through the network interface, and before the service data traffic is sent to the virtual machine to be switched, the service data traffic is processed by the target virtual machine.
[0178] In a possible implementation manner, the running data at least includes register mirror data, system memory, and interrupt migration information; the register mirror data includes one or more pieces of mirror data; the system memory data is a corresponding data list, and the data list includes one or more pieces of table data; the interrupt migration information at least includes interrupt status data, and the interrupt status data includes an interrupt vector; accordingly, the obtaining module 702 is specifically configured to:
[0179] Obtain the register mirror data, system memory data, and interrupt migration information of the target virtual machine according to the switching prompt;
[0180] Accordingly, the copying module 703 specifically includes:
[0181] The first copying unit is configured to copy one or more pieces of mirror data in the register mirror data to the virtual machine to be switched;
[0182] The second copying unit is configured to copy one or more pieces of table data in the data list corresponding to the system memory data to the virtual machine to be switched;
[0183] The third copying unit is configured to disable the interrupt enable of the virtual machine to be switched and copy the interrupt status data in the interrupt migration information to the virtual machine to be switched, where the interrupt status data is used to indicate redirecting the interrupt vector to the virtual machine to be switched.
[0184] For the description of the features in the corresponding embodiment of the virtual machine switching processing device, reference can be made to the relevant description in the corresponding embodiment of the virtual machine switching processing method, which will not be elaborated here one by one.
[0185] Figure 8 The structure diagram of the virtual machine switching processing device provided by the embodiment of the present application Figure 3 As Figure 8 shown, the embodiment of the present application also provides a virtual machine switching processing device, including a first sending module 801, a first processing module 802, an initialization module 803, a replication module 804, a second sending module 805, and a second processing module 806.
[0186] The first sending module 801 is used for the redirection layer to receive the service data traffic transmitted by the network interface and send the service data traffic to the initialized target virtual machine;
[0187] The first processing module 802 is used for the target virtual machine to process the service data traffic;
[0188] The initialization module 803 is used for the redirection layer to complete the initialization of the virtual machine to be switched according to the pre-generated driver loading notification, and after the initialization of the virtual machine to be switched, send a switching prompt to the synchronization engine;
[0189] The replication module 804 is used for the synchronization engine to obtain the running data of the target virtual machine, copy the running data to the virtual machine to be switched, and generate a switching permission signal, and send the switching permission signal to the redirection layer;
[0190] The second sending module 805 is used for the redirection layer to send the service data traffic to the virtual machine to be switched according to the switching permission signal;
[0191] The second processing module 806 is used for the virtual machine to be switched to process the service data traffic.
[0192] For the description of the features in the corresponding embodiment of the virtual machine switching processing device, reference can be made to the relevant description in the corresponding embodiment of the virtual machine switching processing method, which will not be elaborated here one by one.
[0193] Figure 9 The structure diagram of the electronic device provided by the present application. As Figure 9 shown, the electronic device provided in this embodiment includes: at least one processor 901 and a memory 902. Optionally, the electronic device further includes a communication component 903. Among them, the processor 901, the memory 902, and the communication component 903 are connected by a bus.
[0194] In the specific implementation process, at least one processor 901 executes the computer-executable instructions stored in the memory 902, so that at least one processor 901 executes the above-described embodiment of the virtual machine switching processing method.
[0195] For the specific implementation process of the processor 901, reference can be made to the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here in this embodiment.
[0196] In the above embodiment, it should be understood that the processor may be a central processing unit (Central Processing Unit, abbreviated as: CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, abbreviated as: DSP), application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as: ASIC), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the application can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0197] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0198] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0199] The embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored, and the computer program is set to execute the steps in any of the above-described embodiments of the virtual machine switching processing method when running.
[0200] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media that can store computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), mobile hard disks, magnetic disks, or optical discs.
[0201] An embodiment of the present application also provides a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above embodiments of the virtual machine switching processing method.
[0202] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above embodiments of the virtual machine switching processing method.
[0203] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0204] The above has introduced in detail a virtual machine switching processing method, device, and storage medium provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art of this technology, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A method for switching processing of a virtual machine, characterized in that Including: Receiving the service data traffic transmitted by the network interface; Sending the service data traffic to the initialized target virtual machine so that the target virtual machine processes the service data traffic; Completing the initialization of the virtual machine to be switched according to the pre-generated driver loading notification; After the initialization of the virtual machine to be switched, sending a switching prompt to the synchronization engine so that the synchronization engine obtains the running data of the target virtual machine according to the switching prompt, copies the running data to the virtual machine to be switched, and generates a switching permission signal; Receiving the switching permission signal sent by the synchronization engine; According to the switching permission signal, sending the service data traffic to the virtual machine to be switched so that the virtual machine to be switched processes the service data traffic.
2. The method for switching and processing a virtual machine according to claim 1, wherein The initialization process of the target virtual machine includes: Receiving the driver loading notification sent by the preset first driver; Retrieving the first version number of the first driver in the preset symbol table according to the driver loading notification; Performing version configuration on the first driver according to the first version number to complete the preliminary configuration of the first driver; Performing first interface function configuration on the first driver to complete the configuration of the first driver; Writing the first driver into the preset routing table to obtain an initial routing table; After obtaining the initial routing table, binding the first driver to the target virtual machine to complete the initialization of the target virtual machine, where the target virtual machine is created by the adapter through the preset virtualization technology.
3. The method for switching and processing a virtual machine according to claim 1, characterized in that, The completing the initialization of the virtual machine to be switched according to the pre-generated driver loading notification includes: Retrieving the second version number of the second driver in the preset symbol table according to the driver loading notification; Performing version configuration on the second driver according to the second version number to complete the preliminary configuration of the second driver; Performing second interface function configuration on the second driver to complete the configuration of the second driver; Writing the second driver into the initial routing table to obtain a dual routing table; After obtaining the dual routing table, binding the second driver to the virtual machine to be switched to complete the initialization of the virtual machine to be switched, where the virtual machine to be switched is created by the adapter through the preset virtualization technology.
4. The method for switching processing of a virtual machine according to claim 1, wherein The sending the service data traffic to the initialized target virtual machine includes: Sending the service data traffic to the first driver through the initial routing table and the first interface function so that the first driver performs format conversion on the service data traffic to obtain the converted service data traffic, and sending the converted service data traffic to the target virtual machine.
5. The method for switching and processing a virtual machine according to claim 1, wherein After the according to the switching permission signal, sending the service data traffic to the virtual machine to be switched so that the virtual machine to be switched processes the service data traffic, further including: Receiving the inventory processing request sent by the target virtual machine, where the inventory processing request is sent by the virtual machine to be switched to the target virtual machine, and the inventory processing request is generated by the virtual machine to be switched interrupting the service data traffic processing process after a preset time. Sending the stock business data traffic to the target virtual machine according to the stock processing request, so that the target virtual machine processes the stock business data traffic, wherein the stock business data traffic is obtained by storing the unprocessed business data traffic according to the temporary business data traffic notification, and the temporary business data traffic notification is sent by the synchronization engine; Receiving an uninstallation notification sent by a user terminal, wherein the uninstallation notification is generated after the user terminal queries the existing service data flow and completes the processing; Uninstalling the first interface function according to the uninstallation notification, and generating an unbinding notification; The unbinding notification is sent to the first driver so that the first driver unbinds from the target virtual machine according to the unbinding notification, generates a binding unbinding prompt, sends the binding unbinding prompt to the user end so that the user end uninstalls the first driver according to the binding unbinding prompt, obtains the first running status data of the target virtual machine, obtains the second running status data of the virtual machine to be switched, generates a virtual machine switching report according to the first running status data and the second running status data, and outputs the virtual machine switching report.
6. A method for switching processing of a virtual machine, characterized in that include: After the virtual machine to be switched is initialized, a switching prompt sent by the redirection layer is received, wherein the initialization of the virtual machine to be switched is completed by the redirection layer according to the pre-generated driver loading notification; Acquire the operation data of the initialized target virtual machine according to the switching prompt; Copying the running data to the virtual machine to be switched, and generating a switching permission signal; The switching permission signal is sent to the redirection layer, so that the redirection layer sends the business data traffic to the virtual machine to be switched according to the switching permission signal, so that the virtual machine to be switched processes the business data traffic, wherein the business data traffic is obtained by the redirection layer through the network interface, and before the business data traffic is sent to the virtual machine to be switched, the business data traffic is processed by the target virtual machine.
7. The method for switching processing of a virtual machine according to claim 6, wherein The operation data at least includes register mirror data, system memory and interrupt migration information; the register mirror data includes one or more mirror data; the system memory data is a corresponding data list, and the data list includes one or more table data; the interrupt migration information at least includes interrupt status data, and the interrupt status data includes an interrupt vector; Correspondingly, obtaining the operating data of the target virtual machine according to the switching prompt includes: Acquire the register image data, system memory data and interrupt migration information of the target virtual machine according to the switching prompt; Accordingly, copying the running data to the virtual machine to be switched includes: Copying one or more pieces of mirror data in the register mirror data to the virtual machine to be switched; Copying one or more table data in the data list corresponding to the system memory data to the virtual machine to be switched; Disable the interrupt enable of the virtual machine to be switched, and copy the interrupt status data in the interrupt migration information to the virtual machine to be switched, wherein the interrupt status data is used to indicate redirecting the interrupt vector to the virtual machine to be switched.
8. A method for switching processing of a virtual machine, characterized in that, include: A redirect layer that receives the service data traffic transmitted by a network interface and sends the service data traffic to a target virtual machine after initialization; The target virtual machine processes the service data traffic; The redirect layer completes the initialization of the virtual machine to be switched according to a pre-generated driver loading notification, and after the initialization of the virtual machine to be switched, sends a switching prompt to the synchronization engine; The synchronization engine obtains the running data of the target virtual machine, copies the running data to the virtual machine to be switched, generates a switching permission signal, and sends the switching permission signal to the redirect layer; The redirect layer sends the service data traffic to the virtual machine to be switched according to the switching permission signal; The virtual machine to be switched processes the service data traffic.
9. An electronic device, characterized in that, Including: A memory for storing computer programs; A processor, when executing the computer program, implements the virtual machine switching processing method according to any one of claims 1 to 5, or the virtual machine switching processing method according to claim 6 or 7.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program, when executed by a processor, implements the virtual machine switching processing method according to any one of claims 1 to 5, or the virtual machine switching processing method according to claim 6 or 7.