Network switching method and device of virtual machine, computer equipment and storage medium

By implementing network status monitoring and automatic switching functions in virtual machines, the problem of virtual machine network link failure in cloud computing networks is solved, and network reliability and high availability are improved.

CN119520242AActive Publication Date: 2025-02-25CHINA TELECOM CLOUD TECH CO LTD

Patent Information

Application Number
CN202411705926.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-02-25
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

In cloud computing networks, the network link of the virtual machine is prone to failure due to hardware failure or software failure, resulting in unreliability of the virtual machine and affecting the high availability of the virtual machine.

Method used

By implementing network status monitoring and automatic switching functions in the virtual machine, the communication link status of the main network is monitored. If an abnormality is found, switch to the backup network. The backup network communicates with the physical switch through the user mode provided by the fast emulator, avoiding relying on virtualized network components.

Benefits of technology

It improves the network reliability of the virtual machine, so that the virtual machine can still handle services normally when the main network communication link fails, thereby improving the high availability of the virtual machine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520242A_ABST
    Figure CN119520242A_ABST
Patent Text Reader

Abstract

The invention relates to a network switching method and device of a virtual machine, computer equipment and a storage medium. The method comprises the following steps: monitoring the network state of a main network under the condition that a virtual machine uses the main network to carry out network communication; a communication link of the main network comprises a virtual switch in communication connection with the virtual machine, a network service component in communication connection with the virtual switch and a physical switch in communication connection with the network service component; switching the communication network of the virtual machine to a standby network when monitoring that the main network is in the abnormal network communication state; the standby network is in communication connection with the physical switch through a user mode provided by the fast simulator; and the fast simulator is used for simulating and generating the virtual machine. By adopting the method, the network reliability of the virtual machine can be improved, and the high availability of the virtual machine is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing network technology, and in particular to a network switching method, apparatus, computer equipment, storage medium and computer program product for a virtual machine. Background Art

[0002] With the rapid development of cloud computing technology, virtualization technology has shown great advantages in resource utilization, management and allocation. As an open source cloud computing platform, Openstack has become one of the preferred solutions for building private and public clouds.

[0003] Currently, for most cloud terminals based on the Openstack architecture, network traffic within the virtual machine relies on the virtual network and can only reach the network exit after going through the Dynamic Host Configuration Protocol (DHCP), routing, and Network Address Translation (NAT) of the network server or network cluster.

[0004] However, in actual application scenarios, if there is a hardware failure of a network node or a software failure of a network component such as a network service component, it is easy to cause the network link within the virtual machine to fail. Therefore, in actual applications, how to improve the network reliability of the virtual machine and thereby improve the high availability of the virtual machine is an urgent problem to be solved. Summary of the invention

[0005] Based on this, it is necessary to provide a network switching method, device, computer equipment, computer-readable storage medium and computer program product for virtual machines that can improve the network reliability of virtual machines and thereby improve the high availability of virtual machines in response to the above technical problems.

[0006] In a first aspect, the present application provides a network switching method for a virtual machine, the method comprising:

[0007] In the case where the virtual machine uses the main network for network communication, the network status of the main network is monitored; the communication link of the main network includes a virtual switch connected to the virtual machine for communication, a network service component connected to the virtual switch for communication, and a physical switch connected to the network service component for communication;

[0008] When it is detected that the main network is in an abnormal network communication state, the communication network of the virtual machine is switched to a backup network; the backup network is connected to the physical switch through a user mode provided by a fast simulator; the fast simulator is used to simulate and generate the virtual machine.

[0009] In some embodiments, the method further comprises:

[0010] In response to a type addition operation for a network capability configuration file, a primary network and a backup network are added to the network capability class;

[0011] In response to the interface creation operation for the primary network and the backup network, creating Ethernet interfaces corresponding to the primary network and the backup network respectively in the Ethernet service;

[0012] In response to a function adding operation for a network management configuration file, adding network request support for the primary network and the backup network in a network management service;

[0013] In response to the scoring operation for the primary network and the backup network, a first score is configured for the primary network in the network management service, and a second score is configured for the backup network type. When the first score is greater than the second score, the virtual machine is controlled to use the primary network for network communication.

[0014] In some embodiments, the method further comprises:

[0015] In response to a parameter adding operation for the fast emulator, a user mode enabling parameter is added to a configuration file of the fast emulator, and a virtual network card corresponding to a standby network is determined;

[0016] In response to the logic addition operation for the user mode, a routing configuration method is added in the user mode, wherein the routing configuration method is used to determine the service network routing table corresponding to the virtual machine from each routing table of the host machine after the virtual machine starts the backup network, and configure the service network routing table as the default routing table of the backup network;

[0017] Performing hardware abstraction processing on the virtual network card at the hardware abstraction layer of Ethernet, and opening a dynamic host configuration protocol client for the virtual network card;

[0018] Based on the Ethernet interface registration file of the standby network, the network management service is called to configure the standby network.

[0019] In some embodiments, the method further comprises:

[0020] When a network communication anomaly is detected in the primary network, counting the consecutive number of network communication anomalies in the primary network;

[0021] If the number of consecutive abnormalities is less than the preset number threshold, a backoff and retry operation is performed on the primary network, and the process returns to the step of performing network status monitoring on the primary network;

[0022] When the number of consecutive anomalies reaches the preset number threshold, it is determined that the primary network is in a network communication abnormality state, the number of consecutive anomalies is set to an initial value and the step of performing network status monitoring on the primary network is returned to be executed.

[0023] In some embodiments, the method further comprises:

[0024] When a dynamic host configuration protocol anomaly or a network connectivity anomaly occurs in the primary network, it is determined that a network communication anomaly occurs in the primary network.

[0025] In some embodiments, switching the communication network of the virtual machine to a backup network includes:

[0026] When the first score is less than the second score, calling a network management service, performing a network evaluation on the communication network used by the virtual machine, and performing a network switching operation based on the evaluation result;

[0027] The default route of the virtual machine is set as the network route of the backup network; the network route of the backup network is configured by the routing configuration method.

[0028] In a second aspect, the present application further provides a network switching device for a virtual machine, the device comprising:

[0029] A network status monitoring module is used to monitor the network status of the main network when the virtual machine uses the main network for network communication; the communication link of the main network includes a virtual switch connected to the virtual machine for communication, a network service component connected to the virtual switch for communication, and a physical switch connected to the network service component for communication;

[0030] A network switching module is used to switch the communication network of the virtual machine to a backup network when it is detected that the main network is in an abnormal network communication state; the backup network is connected to the physical switch through a user service network mode provided by a fast simulator; the fast simulator is used to simulate and generate the virtual machine.

[0031] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0032] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0033] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

[0034] The network switching method, device, computer equipment, storage medium and computer program product of the virtual machine described above detect the network status of the main network when the virtual machine uses the main network for network communication, wherein the communication link of the main network includes a virtual switch connected to the virtual machine for communication, a network service component connected to the virtual switch for communication and a physical switch connected to the network service component for communication. When it is detected that the main network is in an abnormal network communication state, in order to ensure that the network communication of the virtual machine is not affected, the communication network of the virtual machine is switched from the main network to the backup network, wherein, since the backup network is connected to the physical switch for communication through the user service network mode provided by the fast emulator, the dynamic host configuration protocol of the backup network can be directly provided by the fast emulator and no longer relies on the virtualized network component. By configuring a backup network for the network communication of the virtual machine, the network reliability of the virtual machine can be effectively improved, so that the virtual machine can still process business when the communication link of the main network fails, thereby effectively improving the high availability of the virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] FIG1 is a block diagram of a network topology structure of an existing virtual machine accessing the Internet in some embodiments;

[0036] FIG2 is a block diagram of a network topology structure of a virtual machine accessing the Internet in some other embodiments;

[0037] FIG3 is a schematic diagram of a flow chart of a network switching method for a virtual machine in some embodiments;

[0038] FIG4 is a schematic diagram of a flow chart of a network switching method for a virtual machine in some other embodiments;

[0039] FIG5 is a schematic flow chart of a network switching method for a virtual machine in some other embodiments;

[0040] FIG6 is a schematic diagram of a flow chart of a network switching method for a virtual machine in some other embodiments;

[0041] FIG7 is a schematic diagram of a flow chart of a network switching method for a virtual machine in some other embodiments;

[0042] FIG8 is a schematic diagram of the connection relationship between modules in the network management service of the Android system in some embodiments;

[0043] FIG9 is a structural block diagram of a network switching device for a virtual machine in some embodiments;

[0044] FIG. 10 is a diagram of the internal structure of a computer device in some embodiments. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0046] In some embodiments, the network topology structure of the current virtual machine accessing the Internet through the virtual network is shown in Figure 1. The overall network topology structure includes five nodes: Android system 101, physical switch 102, router 103, firewall 104 and Internet 105.

[0047] Among them, the Android system 101 can be integrated on the terminal, connected to the router 103 through the physical switch 102, and reach the Internet 105 through the router 103, the firewall 104, etc.

[0048] The Android system 101 includes a computing node 1011 and a network node 1012. The computing node 1011 refers to a node unit in the Android system 101 for executing various computing tasks and performing data processing. The computing node 1011 includes a virtual machine 10111, a virtual network card 10112, and a first virtual switch 10113. The network node 1012 is a node unit that connects various network components in a virtual network. The network node 1012 includes a second virtual switch 10121 and a network service (Neutron) component 10122. The first virtual switch 10113 in the computing node 1011 communicates with the second virtual switch 10121 in the network node 1012 through the service network networking in the Openstack architecture.

[0049] Among them, virtual machine 10111 is a virtual system generated by simulating the host machine of the Android system based on Quick EMUlator (QEMU). QEMU is an open source virtual machine monitor and emulator that allows users to execute virtual machines on different hardware platforms. It provides dynamic binary translation and hardware emulation functions, allowing users to simulate multiple different hardware architectures and operating systems on a physical host.

[0050] In actual use, in the computing node 1011, the virtual machine traffic of the virtual machine 10111 can flow to the network node 1012 via the virtual network card 10112 and the first virtual switch 10113 for DHCP configuration. The second virtual switch 10121 in the network node 1012 continues to transmit the virtual machine traffic to the physical switch 102 via the network service component 10122. The physical switch 102 then transmits the virtual machine traffic to the Internet 105 through the router 103 connected to it and the firewall 103 connected to the router 103.

[0051] It can be seen from the network topology structure of traditional virtual machine network transmission that the network traffic within the virtual machine depends on the virtual network. It can reach the network exit only after the DHCP, routing, NAT and other operations of the network server or network cluster. In actual application scenarios, this network link is prone to hardware failures of network nodes or software failures of network components such as Neutron, which will cause the network link within the virtual machine to fail.

[0052] Based on this, as shown in FIG2 , an Android system 200 is provided in an embodiment of the present application. The Android system 200 is integrated in a cloud terminal based on the Openstack architecture. The Android system 200 also includes a computing node 1011 and a network node 1012. The difference is that a user mode node 10114 is also provided in the computing node 1011 of the Android system 200. The user mode is a network mode provided by the fast emulator, also known as the Slirp mode, which is used to implement the user mode network stack, allowing the virtual machine 10111 to communicate with an external network without the need for a high-performance network connection. The user mode node 10114 is a key component for implementing the user mode function in the fast emulator. The user mode node 10114 is connected to the physical switch 102 through the service network in the Openstack architecture.

[0053] In the Android software 200 in this embodiment, the virtual machine 10111 can communicate with the external network through the primary network or the backup network.

[0054] The communication link of the main network includes a virtual switch connected to the virtual machine 10111, a network service component 10122 connected to the virtual switch, and a physical switch 102 connected to the network service component 10122. It can be understood that the virtual switch includes a first virtual switch 10113 and a second virtual switch 10121, and the virtual machine 10111 needs to be connected to the first virtual switch 10113 through a virtual network card 10112.

[0055] The communication link of the backup network includes a user mode node 10114 that is communicatively connected to the virtual machine 10111 and a physical switch 102 that is communicatively connected to the user mode node 10114 via a service network.

[0056] In actual use, the Android system 200 can monitor the network status of the main network based on the integrated cloud terminal when the virtual machine 10111 uses the main network for network connection, and when it is detected that the main network is in an abnormal network communication state, the communication network of the virtual machine 10111 is switched to the backup network, wherein the backup network is connected to the physical switch 102 through the user mode provided by the fast emulator.

[0057] The Android system in this embodiment can effectively improve the network reliability of the virtual machine by configuring a backup network for the network communication of the virtual machine, so that the virtual machine can still process business when the communication link of the main network fails, thereby effectively improving the high availability of the virtual machine.

[0058] In some embodiments, as shown in FIG. 3 , a network switching method for a virtual machine is provided, which is described by taking the method applied to the Android system 200 in FIG. 2 as an example, and includes the following steps:

[0059] S302: When the virtual machine uses the primary network for network communication, monitor the network status of the primary network.

[0060] The communication link of the main network includes a virtual switch connected to the virtual machine for communication, a network service component connected to the virtual switch for communication, and a physical switch connected to the network service component for communication.

[0061] Among them, monitoring the network status of the main network is an effective monitoring operation for determining the network communication status of the main network. The Android system can call the network management service to monitor the network communication status of the main network. The network management service effectively monitors the network communication status of the main network by receiving the signal broadcast by the abnormal monitoring module in the Android system, so as to make corresponding processing in time when there is communication abnormality in the main network, thereby improving the network reliability of the virtual machine.

[0062] Specifically, usually, designers will configure the default network type of the Android system so that the default network type of the virtual machine is the primary network. When the virtual machine uses the primary network for network communication, the virtual traffic within the virtual machine depends on the virtual network and needs to pass through the various network virtual components in the network node and complete the DHPC, routing, NAT and other operations of the network server before it can reach the network exit. During operation, it is easy to cause the primary network link in the virtual machine to fail due to hardware failure of the network node or software failure of each network component in the network node, which affects the reliable application of the virtual machine. Therefore, when the virtual machine uses the primary network for network communication, the Android system will monitor the network status of the primary network.

[0063] S304: When it is detected that the primary network is in an abnormal network communication state, the communication network of the virtual machine is switched to a backup network.

[0064] The standby network is connected to the physical switch through a user mode provided by a fast simulator; the fast simulator is used to simulate and generate a virtual machine.

[0065] The abnormal network communication state of the main network refers to a state in which the main network cannot provide network traffic transmission services for the virtual machine, so that the virtual machine cannot communicate with the outside world through the main network. The abnormal network communication state of the main network may be caused by software abnormality and / or hardware abnormality.

[0066] Specifically, when the Android system detects that the main network is in an abnormal network communication state, it means that the virtual machine can no longer use the main network to communicate with the outside world. The Android system can switch the communication network of the virtual machine to the backup network.

[0067] In the network switching method for the virtual machine described above, when the virtual machine uses the main network for network communication, the network status of the main network is detected, wherein the communication link of the main network includes a virtual switch connected to the virtual machine for communication, a network service component connected to the virtual switch for communication, and a physical switch connected to the network service component for communication. When it is detected that the main network is in an abnormal network communication state, in order to ensure that the network communication of the virtual machine is not affected, the communication network of the virtual machine is switched from the main network to the backup network, wherein, since the backup network is connected to the physical switch for communication through the user service network mode provided by the fast emulator, the dynamic host configuration protocol of the backup network can be directly provided by the fast emulator, and no longer relies on the virtualized network component. By configuring a backup network for the network communication of the virtual machine, the network reliability of the virtual machine can be effectively improved, so that the virtual machine can still process business when the communication link of the main network fails, thereby effectively improving the high availability of the virtual machine.

[0068] If the Android system wants to provide two types of network communication methods, primary network and backup network, for the virtual machine, interface configuration must be performed in advance.

[0069] In some embodiments, as shown in FIG4 , the network switching method for a virtual machine further includes the following steps:

[0070] S402: In response to a type adding operation for a network capability configuration file, a primary network and a backup network are added to a network capability class.

[0071] Among them, the type-added operation refers to the operation behavior of adding two new network types in the Android system, which can be triggered by the designer based on the integrated terminal of the Android system.

[0072] The network capability configuration file is file information used to configure the network functions that can be realized in the Android system. By operating the network capability configuration file, new network capability classes of the Android system can be added.

[0073] Among them, the NetworkCapabilities class is an important tool class used in Android development to describe network status and transmission types. It mainly provides information about network properties, such as transmission methods and network capabilities.

[0074] Specifically, the designer can trigger a new operation on the type of network capability configuration file in the Android system based on the integrated terminal of the Android system. In response to the new operation on the type of network capability configuration file, the Android system adds two new types to the network capability class corresponding to the primary network and the backup network respectively.

[0075] S404: In response to the interface creation operation for the primary network and the backup network, create Ethernet interfaces corresponding to the primary network and the backup network respectively in the Ethernet service.

[0076] Among them, the interface creation operation is an operation behavior used to create corresponding Ethernet interfaces for the primary network and the backup network in the Ethernet service, and can be triggered by the designer's integrated terminal based on the Android system.

[0077] Ethernet service refers to a service in which a terminal integrated with the Android system is connected to a local area network through an Ethernet interface. The Ethernet interface refers to a network interface used to connect to the Ethernet, which is an interface for data transmission between network devices and the network.

[0078] Specifically, designers can trigger interface creation operations for the primary network and the backup network based on the integrated terminal of the Android system. In response to the interface creation for the primary network and the backup network, the Android system creates independent network agent (NetworkAgent) and network factory (NetworkFactory) instances for the Ethernet interfaces corresponding to the primary network and the backup network in the Ethernet service, and implements the corresponding registration method. After the hardware abstraction (HAL) layer is initialized, the instances created for the primary network and the backup network are registered in the network management service (ConnectivityService) to create Ethernet interfaces corresponding to the primary network and the backup network in the Ethernet service.

[0079] S406: In response to the function adding operation for the network management configuration file, network request support for the primary network and the backup network is added in the network management service.

[0080] The function addition operation refers to the operation behavior of adding support for network requests for the two network capabilities of primary network and backup network in the Android system, which is used to support the application layer to actively request the primary network or backup network. The function addition operation can also be triggered by the designer's integrated terminal based on the Android system.

[0081] Specifically, designers can trigger new function operations for the network management configuration file based on the integrated terminal of the Android system, and add network request support for the primary network and the backup network in the network management service to support the application layer's ability to actively request the primary network or the backup network.

[0082] S408, in response to the scoring operation for the primary network and the backup network, a first score is configured for the primary network and a second score is configured for the backup network type in the network management service, and when the first score is greater than the second score, the virtual machine is controlled to use the primary network for network communication.

[0083] Among them, the scoring operation is the operation behavior of setting the network score for the main network and the backup network in the network management service. By configuring the network score for the main network and the backup network in the network management service, the network management service can determine the default network to be used when the two networks coexist. The scoring operation can also be triggered by the designer's integrated terminal based on the Android system. It can be understood that the network score can represent the network usage priority of the corresponding network in the virtual machine. For example, the higher the network score, the higher the corresponding network usage priority. The network management service will give priority to the network with a larger network score as the default network of the virtual machine.

[0084] Specifically, designers can trigger scoring operations for the primary network and the backup network based on the integrated terminal of the Android system. In response to the scoring operations for the primary network and the backup network, the Android system configures a first score for the primary network and a second score for the backup network type in the network management service. When the first score is greater than the second score, the Android system will call the network management service to control the virtual machine to use the primary network for network communication.

[0085] In some of the embodiments, a network score of 70 points can be configured for the primary network and a network score of 60 points can be configured for the backup network in the network management service, so as to ensure that when the two networks coexist, the virtual machine preferentially uses the primary network as the default network.

[0086] In the above embodiment, by performing the above network configuration on the Android system, the Android system can support multiple Ethernet cards, and further enable the Android system to simultaneously support the coexistence of the primary network and the backup network, providing a feasible use environment for the virtual machine to use the backup network.

[0087] In addition to configuring support for multiple Ethernet cards on the Android system, in order to enable the virtual machine to use a backup network, in some embodiments, as shown in FIG5 , the network switching method of the virtual machine further includes:

[0088] S502 , in response to a parameter adding operation for the fast emulator, adding a user mode enabling parameter in a configuration file of the fast emulator, and determining a virtual network card corresponding to the standby network.

[0089] Among them, the parameter addition operation is to add the simulation parameters of the fast simulator so that the Android system can enable the user mode operation of the virtual machine. By adding the simulation parameters of the fast simulator, a virtual network card corresponding to the backup network can be generated in the virtual machine, providing a basis for the subsequent configuration of the backup network. It can be understood that the parameter addition operation for the fast simulator can be triggered by the designer based on the integrated terminal of the Android system.

[0090] The configuration file of the fast emulator is a configuration file used to configure the simulation parameters of the fast emulator. The user mode enable parameters are simulation parameters of the fast emulator corresponding to the user mode of the virtual machine. By adding the user mode enable parameters to the configuration file of the fast emulator, a virtual network card corresponding to the backup network can be generated in the virtual machine.

[0091] Specifically, the designer may trigger a parameter adding operation for the fast emulator based on the integrated terminal of the Android system, and the Android system, in response to the parameter adding operation for the fast emulator, adds a user mode enabling parameter in a configuration file of the fast emulator.

[0092] S504: In response to the logic adding operation for the user mode, a routing configuration mode is added in the user mode.

[0093] Among them, the logic addition operation is used to perform logic addition in the user mode of the fast emulator. By performing logic addition in the user mode of the fast emulator, the virtual machine can filter the host's routing table through the routing configuration method when enabling user services to use the backup network, determine the business network routing table corresponding to the virtual machine, and configure the business network routing table as the default routing table of the backup network. The logic addition operation can be triggered by the designer's integrated terminal based on the Android system.

[0094] Among them, the routing configuration method is used to determine the business network routing table corresponding to the virtual machine from each routing table of the host machine after the virtual machine starts the backup network, and configure the business network routing table as the default routing table of the backup network.

[0095] Specifically, designers can trigger logic-added operations for user mode based on the integrated terminal of the Android system. The Android system responds to the logic-added operations for user mode, obtains the routing configuration method, and adds routing configuration rules in the user mode of the fast emulator. After the virtual machine starts the backup network, it can determine the business network routing table corresponding to the virtual machine from the various routing tables of the host machine, and configure the business network routing table as the default routing table of the backup network, which can effectively avoid routing the virtual machine traffic to unexpected networks such as the management network or storage network.

[0096] S506, performing hardware abstraction processing on the virtual network card at the hardware abstraction layer of the Ethernet, and enabling a dynamic host configuration protocol client for the virtual network card.

[0097] Among them, hardware abstraction processing of the virtual network card refers to providing a unified virtual network card interface that is independent of specific hardware for the virtual network card in the operating system or upper-layer applications through the hardware abstraction layer (HAL) technology.

[0098] Specifically, the Android system will perform hardware abstraction processing on the virtual network card in the Ethernet hardware abstraction layer so that the Ethernet hardware abstraction layer initializes the virtual network card interface and enables the Dynamic Host Configuration Protocol (DHCP) client for the virtual network card so that Ethernet can obtain an IP address through the DHCP service provided by the user service and connect to the public network.

[0099] S508, based on the Ethernet interface registration file of the standby network, calling the network management service to configure the standby network.

[0100] Among them, the Ethernet interface registration file is a registration file generated by the Android system when registering an Ethernet interface for the backup network, that is, an instance registration file corresponding to the network agent and network engineering of the backup network in the Ethernet service.

[0101] Specifically, the Ethernet framework service in the Android system can call the network management service to configure the backup network based on the Ethernet interface file of the backup network.

[0102] In the above embodiment, by configuring a backup network in the Android system, the backup network can directly adopt the user service mode provided by the fast emulator, the DHCP service can be directly provided by the fast emulator, and the service area is limited to a single virtual machine. Compared with the IP service provided by the network node, it can significantly reduce the DHCP failure rate such as link failure, service failure, and IP conflict.

[0103] In some embodiments, as shown in FIG6 , the network switching method of the virtual machine further includes:

[0104] S602: When a network communication anomaly is detected in the primary network, count the consecutive number of network communication anomalies that occur in the primary network.

[0105] Among them, the number of consecutive exceptions is the number of exceptions counted when network communication abnormalities are continuously monitored in the main network. Normally, when a network communication abnormality is detected in the main network, the Android system will record the number of consecutive exceptions as 1, and perform a backoff and retry operation on the main network to re-detect the communication abnormality of the main network. If the network communication abnormality is still detected in the main network, the number of consecutive exceptions of the main network is counted as 2, and so on.

[0106] Specifically, when the Android system detects that a network communication anomaly occurs in the main network, the Android system can count the number of consecutive network communication anomalies that occur in the main network.

[0107] S604: If the number of consecutive exceptions is less than the preset number threshold, a backoff and retry operation is performed on the primary network, and the process returns to the step of performing network status monitoring on the primary network.

[0108] Among them, the preset number threshold is a preset judgment threshold parameter used to judge whether the main network is in a network communication abnormal state. In order to avoid misjudgment of network communication abnormality of the main network due to signal detection errors or other factors, the designer can set the preset number threshold in the Android system in advance to eliminate the possibility of errors and accurately judge whether the main network is in a network communication abnormal state. It can be understood that the preset number threshold can be determined by the designer according to actual needs, for example, the preset number threshold can be 5 times.

[0109] Backoff retry operation is a commonly used error handling and retry strategy in network communication and distributed systems. It means that when a retryable error occurs, the request is not re-initiated immediately, but another attempt is made after waiting for a period of time. Moreover, as the number of retries increases, the waiting time will gradually increase according to a certain rule. For example, the Android system can use binary exponential backoff as a backoff strategy for backoff retry.

[0110] Specifically, after counting the number of consecutive network communication anomalies that occur in the main network, the Android system can compare the number of consecutive anomalies with a preset number threshold. If the number of consecutive anomalies exceeds the preset number threshold, it means that it is currently impossible to determine whether a network communication anomaly actually occurs in the main network. The Android system will perform a backoff retry operation on the main network and return to the step of monitoring the network status of the main network.

[0111] In some of the embodiments, if after performing a backoff retry operation on the main network, it is monitored that the network communication of the main network has returned to normal, the Android system can set the number of consecutive exceptions to an initial value and return to the step of monitoring the network status of the main network.

[0112] S606, when the number of consecutive anomalies reaches a preset number threshold, it is determined that the primary network is in a network communication abnormality state, the number of consecutive anomalies is set to an initial value and the step of performing network status monitoring on the primary network is returned to be executed.

[0113] The initial value is a basic value preset by the designer for the number of consecutive exceptions. For example, the initial value of the number of consecutive exceptions may be zero. The operation of setting the number of consecutive exceptions to the initial value may be considered as setting the number of consecutive exceptions to zero.

[0114] Specifically, if the Android system determines that the number of consecutive anomalies of the main network has reached a preset threshold, it means that the main network is currently unable to provide network traffic transmission services for the virtual machine. The Android system can determine that the main network is in an abnormal network communication state and can execute a network switching operation to switch the virtual machine's communication network to a backup network. At the same time, the Android system will set the number of consecutive anomalies to the initial value and return to the step of monitoring the network status of the main network, so that when it is monitored that the main network has resumed normal communication, the virtual machine's communication network can be switched from the backup network back to the main network in a timely manner.

[0115] In the above embodiment, by performing a backoff retry operation on the main network, and counting the number of consecutive network communication abnormalities that occur in the main network, the number of consecutive abnormalities is compared with a preset number threshold to determine whether the main network is actually in a network communication abnormality state. This can effectively improve the accuracy of network status monitoring of the main network and provide an accurate data basis for subsequent network switching.

[0116] Furthermore, in some embodiments, the network switching method of a virtual machine further includes: when a dynamic host configuration protocol anomaly or a network connectivity anomaly occurs in the primary network, determining that a network communication anomaly occurs in the primary network.

[0117] Among them, the Dynamic Host Configuration Protocol exception refers to the type of exception in which the virtual machine cannot correctly obtain the IP address and other related network configuration parameters through DHCP. For example, in the DHCP process initiated by the client, if the discovery (discover) or request (request) times out with no response or is negatively confirmed (Negative Acknowledgment, NACK), it can be counted as a Dynamic Host Configuration Protocol exception, and the number of consecutive exceptions needs to be counted. For another example, the subsequent renewal (renew) or rebinding (rebound) times out with no response or is negatively confirmed, which can also be counted as a Dynamic Host Configuration Protocol exception, and the number of consecutive exceptions needs to be counted. It can be understood that the Dynamic Host Configuration Protocol exception can be determined by the Android system calling the network management service based on the notification that the DHCP client module monitors the main network and broadcasts.

[0118] Among them, network connectivity anomaly refers to the type of anomaly that occurs in the network communication connection of the virtual machine. For example, the domain name server based on http and https can be tested regularly. In the case of DNS resolution anomaly, ICMP anomaly, socket establishment anomaly, socket read and write anomaly, or SSL handshake anomaly, it can be counted as a network connectivity anomaly, and the number of consecutive anomalies needs to be counted. It can be understood that the network connectivity anomaly can be determined by the Android system calling the network management service and the notification broadcast by the network monitor module to monitor the main network.

[0119] Specifically, the network management service of the Android system is provided with a DHCP client module for monitoring abnormalities of the dynamic host configuration protocol of the main network, and a network monitor module for monitoring abnormalities of the network connectivity of the main network. When monitoring abnormalities of the dynamic host configuration protocol or abnormalities of the network connectivity in the main network, the DHCP client module and the monitor module will directly broadcast and notify the statistics module of the network management service. The statistics module will detect network communication abnormalities in the main network and count the consecutive number of abnormalities of network communication abnormalities in the main network.

[0120] In the above embodiment, by performing dynamic host configuration protocol anomaly monitoring and network connectivity anomaly monitoring on the primary network, it is possible to timely determine whether a network communication anomaly occurs in the primary network, thereby improving the accuracy and efficiency of network switching.

[0121] In some embodiments, switching the communication network of the virtual machine to the backup network in S304 includes: when the first score is less than the second score, calling a network management service, performing a network evaluation on the communication network used by the virtual machine, and performing a network switching operation based on the evaluation result. Setting the default route of the virtual machine to the network route of the backup network.

[0122] The network route of the backup network is configured through a routing configuration method.

[0123] Specifically, when the Android system determines that the main network is in an abnormal network communication state, it can reduce the network score of the main network, that is, the first score, so that the first score of the main network is less than the second score of the backup network. For example, the original first score of the main network is 70 points, and the second score of the backup network is 60 points. When the Android system determines that the main network is in an abnormal network communication state, it can reduce the first score to 50 points, and call the network management service to re-evaluate the communication network used by the virtual machine. Since the first score of the main network is less than the second score of the backup network at this time, the network management service will switch the default network of the virtual machine to the backup network, and notify the network daemon (Network Daemon, netd) in the Android system to set the default routing table to the network route of the backup network, so as to achieve the default access of Android upper-layer applications to the Internet through the backup network. It can be understood that the network route of the backup network can be determined from each routing table of the host machine through the routing configuration method, and the network route of the backup network is the service network routing table corresponding to the virtual machine.

[0124] In the above embodiment, by reducing the first score of the primary network and calling the network management service to perform the network switching work, the accuracy and switching efficiency of the virtual machine network switching can be effectively improved.

[0125] In some of the embodiments, when the Android system detects that the communication of the main network is normal, it can increase the first score of the main network, for example, increase the first score of the main network from 50 points back to 70 points, so that the first score of the main network is greater than the second score of the backup network, and call the network management service to re-evaluate the communication network used by the virtual machine. The network management service will switch the default network of the virtual machine to the main network, and notify the network daemon (Network Daemon, netd) in the Android system to set the default routing table to the network route of the main network, so that the Android upper-layer applications can access the Internet through the main network by default.

[0126] The service network in the Openstack architecture is a physical connection between nodes and does not rely on virtualized network components. It has higher stability and reliability and can provide a reliable backup link when problems occur in the virtual network. Based on this, in some embodiments, as shown in FIG7 , a network switching method for a virtual machine is provided, including two parts: network configuration and network switching, which may specifically include the following steps:

[0127] The first step is to configure the Android system so that it can support multiple Ethernet cards. The specific steps include:

[0128] Designers can add two new types to the NetworkCapabilities class to correspond to the primary network and the backup network.

[0129] In the Ethernet service, for the Ethernet interfaces eth0 and eth1 corresponding to the primary network and the backup network, create independent NetworkAgent and NetworkFactory instances, implement the corresponding registration methods, and register them to ConnectivityService after the hal layer is initialized.

[0130] Add network request support for two types of NetworkCapabilities in onnectivityService to support the application layer's ability to actively request the primary network or backup network.

[0131] In ConnectivityService, the default score of the primary network is 70 points, and the default score of the redundant network is 60 points. This ensures that when two networks coexist, the primary network is used as the default network first.

[0132] Then, configure the primary and backup networks on the QEMU side. The primary network configuration can specifically include the following steps:

[0133] Designers enable a tap network card by configuring the QEMU parameters -netdevtap, id=tap0, ifname=tap_w1-devicevirtio-net-pci, netdev=tap0, mac=fa:00:11:22:33:44. A corresponding network card eth0 will be generated in the virtual machine and used as the main network. Openstack manages traffic through the MAC of the network card.

[0134] The Android virtual machine configures android system-feature to enable the Ethernet function. After the Android system starts, the Ethernet hal layer is initialized, and the Ethernet network card eth0 is found, and the DHCP client is enabled on this network card. In this way, Ethernet can access the public network through DHCP and obtain an IP address through the virtual network provided by the Openstack network node.

[0135] The Ethernet framework service uses the main network's NetworkAgent and NetworkFactory to register the corresponding type of network in the system service ConnectivityService, with a default score of 70 points.

[0136] ConnectivityService registers a routing table named 200 eth0 in the Android system, with the default route pointing to the eth0 device and the virtual network gateway. This routing table is the system's first priority routing table.

[0137] Similarly, in order to enable the virtual machine to use the backup network, you also need to configure the backup network on the QEMU side, including the following steps:

[0138] Designers can add the QEMU parameter -netdev user,id=mynet -device virtio-net-pci,netdev=mynet to enable the Slirp network of the virtual machine. A virtual network card will be generated in the virtual machine accordingly, with the device name eth1, which will be used as a backup network.

[0139] Add logic to the Slirp implementation of QEMU. After the virtual machine starts the Slirp network, it filters the host's routing table, finds the route corresponding to the business network network card through specified rules, and sets the default route of Slirp to this route to avoid routing the virtual machine traffic to unexpected networks such as the management network / storage network.

[0140] Similar to the main network process, the Ethernet hal layer will initialize the eth1 interface and enable the DHCP client on this network card. In this way, Ethernet can obtain an IP address through the DHCP service provided by Slirp and connect to the public network. QEMU will forward the virtual machine traffic to the business network card according to the logic added in the Slirp implementation.

[0141] The Ethernet framework service uses the backup network's NetworkAgent and NetworkFactory to register the corresponding type of network in the system service ConnectivityService, and the network score is set to 60. ConnectivityService will register a 201 eth1 routing table, and the default route points to the gateway of eth1 and Slirp network. Since the backup network score is lower than the main score (60<70), the default network of the current Android system is the main network, and the default routing table is 200 eth0.

[0142] After completing the configuration of multiple Ethernets for the Android system and the configuration of the primary and standby networks on the QEMU side, a network switching solution can be implemented based on the configured Android system, which may specifically include the following steps:

[0143] The Android system can add an exception statistics module in ConnectivityService to collect and count the network exception information reported by the DHCPClient module and the NetworkMonitor module, and switch to the backup network when the threshold is reached. The relationship between the modules is shown in Figure 8.

[0144] After encountering an exception, the DHCPClient module and the NetworkMonitor module directly broadcast a notification to the network exception statistics module of ConnectivityService, and back off and try again. The backoff strategy uses binary exponential backoff. The network exception statistics module uses five cumulative times as the threshold. When a notification of a normal network is encountered, the exception count is cleared. When the exception count exceeds the threshold, it checks whether the current default network is the primary network type. If so, the default network is switched to the backup network.

[0145] Among them, DHCPclient counts DHCP exceptions. In the DHCP process initiated by the client, such as discover or request timeout without response or nack, it is counted as an exception count, and the subsequent renewal or rebound timeout or nack is counted as an exception count. NetworkMonitor counts network connectivity exceptions, continuously and regularly tests domain name servers based on http and https. If there are dns resolution exceptions, icmp exceptions, socket establishment or reading and writing exceptions, SSL handshake exceptions, etc., they are all counted as an exception and counted.

[0146] After switching to the redundant network, the DHCPclient process and NetworkMonitor connectivity detection module of the primary network continue to work. When ConnectivityService receives a notification that the primary network is normal, it switches the default network back to the primary network.

[0147] Among them, ConnectivityService switches the default network to the backup network by reducing the score of the primary network to 50 points and triggering ConnectivityService to re-evaluate the network. At this time, the score of the primary network is lower than that of the backup network (50<60). ConnectivityService will switch the default network to the backup network and notify netd to set the default routing table to 201 eth1. At this time, the upper-layer applications of the Android system access the Internet through the backup network by default.

[0148] ConnectivityService can switch the default network to the primary network by increasing the primary network score back to 70 points, triggering ConnectivityService to re-evaluate the network. Since the primary network score is higher, the default network is switched back to the primary network, and the default routing table is set to 200 eth0.

[0149] The network switching method for virtual machines in this embodiment, first, the backup network adopts the Slirp network mode provided by QEMU, the DHCP service is directly provided by QEMU, and the service area is limited to a single virtual machine. Compared with the IP service provided by the network node, it can significantly reduce the DHCP failure rate such as link failure, service failure, IP conflict, etc. Secondly, the backup network relies on the Openstack service network, which is the physical connection between each node and does not rely on the virtualized network components. It has higher stability and reliability, ensuring that the service is not interrupted when the virtual network link fails.

[0150] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0151] Based on the same inventive concept, the embodiment of the present application also provides a network switching device for a virtual machine for implementing the network switching method for a virtual machine involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the network switching device for one or more virtual machines provided below can refer to the limitations of the network switching method for the virtual machine above, and will not be repeated here.

[0152] In some embodiments, as shown in FIG. 9 , a network switching device 900 for a virtual machine is provided, including: a network status monitoring module 901 and a network switching module 902, wherein:

[0153] The network status monitoring module 901 is used to monitor the network status of the main network when the virtual machine uses the main network for network communication; the communication link of the main network includes a virtual switch connected to the virtual machine for communication, a network service component connected to the virtual switch for communication, and a physical switch connected to the network service component for communication;

[0154] The network switching module 902 is used to switch the communication network of the virtual machine to the backup network when it is detected that the main network is in an abnormal network communication state; the backup network is connected to the physical switch through the user service network mode provided by the fast simulator; the fast simulator is used to simulate and generate virtual machines.

[0155] In some embodiments, the network switching device of the virtual machine further includes:

[0156] The type adding module is used to respond to the type adding operation on the network capability configuration file and add the primary network and the backup network in the network capability class.

[0157] The interface creation module is used to create Ethernet interfaces corresponding to the primary network and the backup network in the Ethernet service in response to the interface creation operation for the primary network and the backup network.

[0158] The function adding module is used to respond to the function adding operation for the network management configuration file and add network request support for the primary network and the backup network in the network management service.

[0159] The network scoring module is used to respond to the scoring operations for the main network and the backup network, configure a first score for the main network and a second score for the backup network type in the network management service, and control the virtual machine to use the main network for network communication when the first score is greater than the second score.

[0160] In some embodiments, the network switching device of the virtual machine further includes:

[0161] The parameter addition module is used to respond to the logic addition operation for the user mode and add a routing configuration method in the user mode. The routing configuration method is used to determine the business network routing table corresponding to the virtual machine from the various routing tables of the host machine after the virtual machine starts the backup network, and configure the business network routing table as the default routing table of the backup network.

[0162] The hardware abstraction processing module is used to perform hardware abstraction processing on the virtual network card in the hardware abstraction layer of the Ethernet and to enable the dynamic host configuration protocol client for the virtual network card.

[0163] The backup network configuration module is used to call the network management service to configure the backup network based on the Ethernet interface registration file of the backup network.

[0164] In some embodiments, the network switching device of the virtual machine further includes:

[0165] The continuous abnormality times statistics module is used to count the continuous abnormality times of network communication abnormality occurring in the main network when a network communication abnormality is detected in the main network.

[0166] The backoff and retry module is used to perform a backoff and retry operation on the main network if the number of consecutive abnormalities is less than a preset number threshold, and return to the step of performing network status monitoring on the main network.

[0167] The abnormal state determination module is used to determine that the main network is in a network communication abnormal state when the number of consecutive abnormalities reaches a preset number threshold, set the number of consecutive abnormalities to an initial value and return to execute the step of monitoring the network state of the main network.

[0168] In some embodiments, the network switching device of the virtual machine further includes:

[0169] The communication anomaly determination module is used to determine that a network communication anomaly occurs in the main network when a dynamic host configuration protocol anomaly or a network connectivity anomaly occurs in the main network.

[0170] In some embodiments, the network switching module 902 is used to: when the first score is less than the second score, call the network management service, perform a network evaluation on the communication network used by the virtual machine, and perform a network switching operation based on the evaluation result; set the default route of the virtual machine to the network route of the backup network; the network route of the backup network is configured by means of a routing configuration method.

[0171] Each module in the network switching device of the virtual machine can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0172] In some embodiments, a computer device is provided, which may be a cloud terminal integrated with an Android system, and its internal structure diagram may be shown in FIG10. The computer device includes a processor, a memory, and a network interface connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store relevant data for network switching of a virtual machine. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a network switching method for a virtual machine is implemented.

[0173] Those skilled in the art will understand that the structure shown in FIG. 10 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0174] In some embodiments, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, specific implementation steps of the network switching method for the virtual machine are implemented.

[0175] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the specific implementation steps of the network switching method for the virtual machine are implemented.

[0176] In some embodiments, a computer program product is provided, including a computer program, which, when executed by a processor, implements the specific implementation steps of the network switching method for the virtual machine.

[0177] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. In addition, the acquisition, storage, processing, and transmission of data are in compliance with relevant laws and regulations.

[0178] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0179] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0180] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A network switching method for a virtual machine, characterized in that: The method comprises: In the case where the virtual machine uses the main network for network communication, the network status of the main network is monitored; the communication link of the main network includes a virtual switch connected to the virtual machine for communication, a network service component connected to the virtual switch for communication, and a physical switch connected to the network service component for communication; When it is detected that the main network is in an abnormal network communication state, the communication network of the virtual machine is switched to a backup network; the backup network is connected to the physical switch through a user mode provided by a fast simulator; the fast simulator is used to simulate and generate the virtual machine.

2. The method according to claim 1, characterized in that The method further comprises: In response to a type addition operation for a network capability configuration file, a primary network and a backup network are added to the network capability class; In response to the interface creation operation for the primary network and the backup network, creating Ethernet interfaces corresponding to the primary network and the backup network respectively in the Ethernet service; In response to a function adding operation for a network management configuration file, adding network request support for the primary network and the backup network in a network management service; In response to the scoring operation for the primary network and the backup network, a first score is configured for the primary network in the network management service, and a second score is configured for the backup network type. When the first score is greater than the second score, the virtual machine is controlled to use the primary network for network communication.

3. The method according to claim 2, characterized in that The method further comprises: In response to a parameter adding operation for the fast emulator, a user mode enabling parameter is added to a configuration file of the fast emulator, and a virtual network card corresponding to a standby network is determined; In response to the logic addition operation for the user mode, a routing configuration method is added in the user mode, wherein the routing configuration method is used to determine the service network routing table corresponding to the virtual machine from each routing table of the host machine after the virtual machine starts the backup network, and configure the service network routing table as the default routing table of the backup network; Performing hardware abstraction processing on the virtual network card at the hardware abstraction layer of Ethernet, and opening a dynamic host configuration protocol client for the virtual network card; Based on the Ethernet interface registration file of the standby network, the network management service is called to configure the standby network.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When a network communication anomaly is detected in the primary network, counting the consecutive number of network communication anomalies in the primary network; If the number of consecutive abnormalities is less than the preset number threshold, a backoff and retry operation is performed on the primary network, and the process returns to the step of performing network status monitoring on the primary network; When the number of consecutive anomalies reaches the preset number threshold, it is determined that the primary network is in a network communication abnormality state, the number of consecutive anomalies is set to an initial value and the step of performing network status monitoring on the primary network is returned to be executed.

5. The method according to claim 4, characterized in that The method further comprises: When a dynamic host configuration protocol anomaly or a network connectivity anomaly occurs in the primary network, it is determined that a network communication anomaly occurs in the primary network.

6. The method according to claim 3, characterized in that The step of switching the communication network of the virtual machine to a backup network includes: When the first score is less than the second score, calling a network management service, performing a network evaluation on the communication network used by the virtual machine, and performing a network switching operation based on the evaluation result; The default route of the virtual machine is set as the network route of the backup network; the network route of the backup network is configured by the routing configuration method.

7. A network switching device for a virtual machine, characterized in that: The device comprises: A network status monitoring module is used to monitor the network status of the main network when the virtual machine uses the main network for network communication; the communication link of the main network includes a virtual switch connected to the virtual machine for communication, a network service component connected to the virtual switch for communication, and a physical switch connected to the network service component for communication; A network switching module is used to switch the communication network of the virtual machine to a backup network when it is detected that the main network is in an abnormal network communication state; the backup network is connected to the physical switch through a user service network mode provided by a fast simulator; the fast simulator is used to simulate and generate the virtual machine.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

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

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method for implementing organizational architecture mode of kernel-based virtual machine (KVM)

    CN101968746A

  • High availability for virtual machines

    CN108139925A

  • A service-uninterrupted virtual switch upgrading method and related equipment

    CN109861839A

  • Service-uninterrupted virtual switch upgrading method and related equipment

    CN114826913A

  • Method for fault over the virtual environment

    KR1020150111609A

Cited By

  • Remote intelligent control method and device for energy storage equipment

    CN120281087A