WO2022028149A1 - 一种多物理设备绑定虚拟设备的方法、系统及相关设备 - Google Patents

一种多物理设备绑定虚拟设备的方法、系统及相关设备 Download PDF

Info

Publication number
WO2022028149A1
WO2022028149A1 PCT/CN2021/102751 CN2021102751W WO2022028149A1 WO 2022028149 A1 WO2022028149 A1 WO 2022028149A1 CN 2021102751 W CN2021102751 W CN 2021102751W WO 2022028149 A1 WO2022028149 A1 WO 2022028149A1
Authority
WO
WIPO (PCT)
Prior art keywords
physical device
physical
virtual
sets
standby
Prior art date
Application number
PCT/CN2021/102751
Other languages
English (en)
French (fr)
Inventor
杨学文
蔡志方
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202011308800.1A external-priority patent/CN114064263A/zh
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP21854562.2A priority Critical patent/EP4187384A4/en
Publication of WO2022028149A1 publication Critical patent/WO2022028149A1/zh
Priority to US18/163,483 priority patent/US20230205597A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5033Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering data affinity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5044Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering hardware capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/70Virtual switches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5022Workload threshold
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/28Flow control; Congestion control in relation to timing considerations
    • H04L47/283Flow control; Congestion control in relation to timing considerations in response to processing delays, e.g. caused by jitter or round trip time [RTT]

Definitions

  • the present invention relates to the technical field of cloud computing, and in particular, to a method, system and related equipment for binding multiple physical devices to virtual devices.
  • the network card bonding technology under Linux system can abstract multiple physical network cards within the system. (binding) into a logical network card, which can effectively improve network throughput, realize network redundancy, load balancing and other functions.
  • Embodiments of the present invention disclose a method, system and related devices for binding virtual devices with multiple physical devices, creating multiple physical device sets based on multiple physical devices, and creating virtual devices corresponding to different physical devices for each physical device set devices to support business applications, thereby improving resource utilization and achieving load balancing across multiple physical devices.
  • the present application provides a method for binding multiple physical devices to a virtual device, including: a server creating multiple physical device sets based on multiple physical devices, wherein at least two physical device sets in the multiple physical device sets are The device set includes the same physical device; the server creates one or more virtual devices corresponding to the physical device set for any one of the multiple physical device sets; the server uses the virtual device to receive service application downloads. sent data.
  • the physical devices involved in this application include but are not limited to NICs, GPUs, and NPUs.
  • the server when there are multiple physical devices, the server creates multiple physical device sets based on the multiple physical devices, so as to bind the multiple physical devices, and the same physical device can belong to different physical devices set, and then create a virtual device corresponding to each physical device set, and use the created virtual device to receive data delivered by the upper-layer service application. This ensures that each physical device participates in data processing, effectively improves resource utilization, and achieves load balancing among multiple physical devices.
  • the server provides an input interface, where the input interface is used to prompt the user to input the creation parameters of the physical device set; the server obtains the creation parameters through the input interface , and create multiple physical device sets according to the creation parameters.
  • the input interface includes a configuration interface, an application programming interface API, and an input template.
  • the user can input creation parameters through the configuration interface or API interface provided by the server, so as to create multiple physical device sets according to the creation parameters, so that the multiple physical device sets can perform business processing at the same time, thereby improving the resource utilization.
  • the server creates a first physical device set and a second physical device set based on the first physical device and the second physical device, the first physical device set and The second physical device set respectively includes one master device and at least one backup device, wherein the master device of the first physical device set is the first physical device, and the master device of the second physical device set is all the devices. the second physical device.
  • the server when the server creates a physical device set, it ensures that the master devices of each physical device set are different, thereby ensuring that each physical device can participate in business processing and improving resource utilization.
  • the server creates a first virtual device based on the first physical device set; if the service traffic of the first physical device exceeds a first preset threshold, adjust all The corresponding relationship between the first virtual device and the first physical device set, so that the first virtual device corresponds to the second physical device set.
  • the server can flexibly adjust the corresponding relationship between the virtual device and the physical device set according to the service traffic of each physical device set, and can distribute the service traffic to the physical device set with less service pressure, thereby realizing multiple physical devices. load balancing.
  • the first physical device set includes the first physical device and the second physical device; if the service traffic of the first physical device When the second preset threshold is exceeded, the server adjusts the flow direction of the service traffic, so that the first physical device set delivers the service traffic through the second physical device.
  • the server can adjust the service traffic for the physical devices in the same physical device set, so that when the service traffic exceeds the preset threshold of the main device, the service traffic can be distributed to the standby device for processing, This achieves load balancing within the same physical device set.
  • the server according to the business application and any one of the multiple physical device sets the server according to the business application and any one of the multiple physical device sets
  • the affinity between each standby device in the physical device set sets the priority of each standby device becoming the master device.
  • the server can use the affinity between the business application and each standby device to set priorities, so as to ensure that in the event of a failure of the main device, the standby device with a higher priority can take over the main device and continue to work. Ensure business continuity.
  • the server assigns the priority of each standby device to become the master device according to the connection relationship between the processor corresponding to the service application and each of the standby devices setting; or, the server sets the priority of each standby device to become the main device according to the size of the available resources of the each standby device; The priority of each standby device becoming the master device is set.
  • the server can flexibly set the priority of each standby device according to different constraints, so that when the primary device fails, the standby device that meets the requirements can become the new primary device, thereby ensuring business continuity. and system stability.
  • the virtual device receives test information issued by the service application, where the test information is used to test the virtual devices corresponding to the multiple physical device sets
  • the server determines the processing delay of the virtual devices corresponding to the multiple physical device sets, and selects the virtual device corresponding to the minimum processing delay to receive the data delivered by the service application.
  • the server determines the processing delay of each virtual device to complete the screening of the virtual device, and matches the virtual device with the smallest processing delay to the service application, thereby shortening the service time. processing time and improve business processing efficiency.
  • the server sets the priority of the one or more virtual devices corresponding to any one of the multiple physical device sets , so that the one or more virtual devices corresponding to any one of the multiple physical device sets use resources according to the set priority.
  • the server can set the priority of the virtual device, so as to ensure that the virtual device can use the resources according to the priority and improve the service quality under the condition of limited resources.
  • the present application provides a computing device, including: a creating unit configured to create multiple physical device sets based on multiple physical devices, wherein at least two physical device sets in the multiple physical device sets include: the same physical device; the creating unit is further configured to create one or more virtual devices corresponding to the physical device set for any one of the multiple physical device sets; the processing unit is configured to utilize The virtual device receives data delivered by the service application.
  • the computing device further includes a receiving unit, where the receiving unit is configured to provide an input interface, where the input interface is configured to prompt the user to input the physical device set The creation parameter; the creation unit is further configured to create a plurality of physical device sets according to the creation parameter.
  • the creating unit is specifically configured to: create a first physical device set and a second physical device set based on the first physical device and the second physical device,
  • the first physical device set and the second physical device set respectively include one master device and at least one standby device, wherein the master device of the first physical device set is the first physical device, and the second physical device The master device of the physical device set is the second physical device.
  • the creating unit is further configured to create a first virtual device based on the first physical device set;
  • the processing unit is further configured to create a first virtual device in the first physical device set;
  • the service flow of a physical device exceeds a first preset threshold, the corresponding relationship between the first virtual device and the first physical device set is adjusted so that the first virtual device corresponds to the second physical device set.
  • the first physical device set includes the first physical device and the second physical device
  • the processing unit is further configured to When the service traffic of the first physical device exceeds a second preset threshold, adjust the flow direction of the service traffic, so that the first physical device set delivers the service traffic through the second physical device.
  • the processing unit is further configured to: The affinity between the two sets the priority of each standby device to become the master device.
  • the processing unit is specifically configured to: according to the connection relationship between the processor corresponding to the service application and the respective standby devices Set the priority of the standby device to become the master device; or, set the priority of each standby device to become the master device according to the size of the available resources of the respective standby devices; or, upgrade the master device according to the respective standby devices.
  • the size of the consumed resources sets the priority for each standby device to become the master device.
  • the receiving unit is further configured to receive test information issued by the service application, where the test information is used to test the connection with the multiple physical devices.
  • the processing delay of the virtual device corresponding to the device set; the processing unit is further configured to determine the processing delay of the virtual device corresponding to the multiple physical device sets, and select the virtual device corresponding to the minimum processing delay to receive the data sent by the business application.
  • the processing unit is further configured to perform processing on the one or more physical device sets corresponding to any one of the multiple physical device sets
  • the priority of the virtual device is set, so that the one or more virtual devices corresponding to any one of the multiple physical device sets use resources according to the set priority.
  • the present application provides a computing device, the computing device includes a processor and a memory, the processor and the memory are connected through an internal bus, and instructions are stored in the memory, and the processor calls the The instructions in the memory are used to execute the above-mentioned first aspect and the method provided in combination with any one of the implementation manners of the above-mentioned first aspect.
  • the present application provides a computer storage medium, where a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the above-mentioned first aspect and any combination of the above-mentioned first aspect can be implemented.
  • the present application provides a computer program product, the computer program includes instructions that, when the computer program is executed by a computer, enables the computer to execute the above-mentioned first aspect and any implementation manner in combination with the above-mentioned first aspect provided method.
  • FIG. 1 is a schematic diagram of a scenario in which a multi-physical device binding technology is used to support a service application provided by an embodiment of the present application;
  • FIG. 2 is a schematic diagram of another scenario in which a multi-physical device binding technology is used to support a business application provided by an embodiment of the present application;
  • FIG. 3 is a schematic diagram of a system architecture provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of another system architecture provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a method for binding a virtual device with multiple physical devices according to an embodiment of the present application
  • FIG. 6 is a schematic diagram of a configuration interface provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of setting a priority of a standby device provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a system structure provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of another computing device provided by an embodiment of the present application.
  • a physical device is a device that provides services to an application, including but not limited to a network interface card (NIC) or a network port on a NIC, a graphics processing unit (GPU), or an embedded neural network processor ( neural-network processing unit, NPU), etc.
  • NIC network interface card
  • GPU graphics processing unit
  • NPU embedded neural network processor
  • the physical device set is a set obtained by binding multiple physical devices, which is displayed as the same device to the outside world. For example, the network card binding under the linux system, by modifying the network port driver, makes multiple network cards externally displayed as a single Ethernet.
  • the interface devices have the same IP address.
  • the physical device set is a set obtained by binding multiple physical devices. Therefore, when a physical device or a port on a physical device fails and cannot be used, it can be configured according to the configuration. Strategies continue to improve service through redundant physical devices or ports to improve system performance and reliability.
  • the network card NIC100 provides two physical network ports, namely the Ethernet port ETH110 and the Ethernet port 120. Bind ETH110 and ETH120 to obtain a physical device set, that is, BOND200.
  • the BOND200 is the active and standby mode BOND, When creating BOND200, you can designate ETH110 as the master device, then ETH120 as the backup device, of course, you can also designate ETH120 as the master device, then ETH120 as the backup device.
  • ETH110 is the master device In the normal communication process, the data of all upper-layer business applications will be collected to ETH110 through the virtual network card and BOND200, and finally processed and forwarded by ETH110, that is, the data of all upper-layer business applications will only pass through ETH110, not through ETH110.
  • ETH120 completes the data forwarding process.
  • the BOND mechanism detects that the ETH110 is abnormal and triggers the master-standby switchover.
  • the Linux system uses the link listening parameter to perform Link monitoring, to detect the link connection status of the network port, the value can be set to 100, which means that the system monitors the link connection status every 100 milliseconds.
  • the master device will be switched to ETH120, and the data of all upper-layer business applications will be collected to ETH120 through virtual network card and BOND200, and ETH120 will take over ETH110 to complete data forwarding processing.
  • the network card NIC210 provides the Ethernet port ETH2110
  • the network card NIC220 provides the Ethernet port ETH2210.
  • the NIC210 and the NIC220 can be directly interconnected through a bus or indirectly through the central processing unit (CPU) they are connected to.
  • BOND230 In the process of creating BOND230, you can designate NIC210 as the master device, then NIC220 is the standby device. After the creation is completed, you can use the BOND230 to map to obtain multiple virtual network cards.
  • VNIC2410, VNIC2420 and VNIC2430 After the mapping is completed, the data of all upper-layer business applications can be collected to the NIC210 through any virtual network card obtained by the mapping and BOND230, and the final forwarding processing is completed through the ETH2110 in the NIC210.
  • the BOND mechanism When the NIC210 fails or the external link corresponding to the NIC210 fails, and the data forwarding process cannot be completed, the BOND mechanism will detect the abnormality of the NIC210, thereby triggering the master-standby switchover, switching the NIC220 to the new master device of the BOND230, and all upper-layer business applications The data will be collected to the NIC220 through the virtual network card and BOND230, and the NIC220 will complete the data forwarding process.
  • the present application provides a method for binding a virtual device with multiple physical devices.
  • the method creates a set of multiple physical devices based on multiple physical devices, so that at least two of the sets of physical devices contain the same one physical devices, and then create one or more virtual devices for each physical device set, and use the created virtual devices to support business applications, thereby improving resource utilization and load balancing capabilities of multiple physical devices.
  • FIG. 3 is a schematic diagram of a system architecture provided by an embodiment of the present application.
  • the network card 310 provides two physical network ports, ETH3110 and ETH3120.
  • two physical device sets are created, namely BOND3210 and BOND3220.
  • ETH3110 is the main device of BOND3210
  • ETH3120 is the backup device of BOND3210.
  • equipment ETH3120 is the main equipment of BOND3220
  • ETH3110 is the standby equipment of BOND3220.
  • BOND3210 and BOND3220 After creating BOND3210 and BOND3220, use BOND3210 to map to obtain virtual network cards VNIC3310 and VNIC3320, and use BOND3220 to map to obtain virtual network cards VNIC3330 and VNIC3340.
  • the upper-layer business application can select any virtual network card for data transmission, which can ensure that ETH3110 and ETH3120 can participate in the same time. In the communication process, all traffic passes through, which improves the efficiency of resource utilization and realizes load balancing.
  • FIG. 3 takes a physical device including multiple physical network ports as an example for illustration. For a case where a physical device includes only a single physical network port, the implementation principle is similar to the above. As shown in FIG. 4 , the network card 410 provides ETH4110, and the network card 420 provides ETH4210.
  • the network card 410 and the network card 420 are directly interconnected through the bus or connected through the CPU to which they are connected. Based on the network card 410 and the network card 420, BOND430 and BOND440 are created. , the network card 410 is the main device of BOND430, the network card 420 is the standby device of BOND430; the network card 420 is the main device of BOND440, and the network card 410 is the standby device of BOND440. After that, VNIC4310 and VNIC4320 are created based on BOND430, and VNIC4410 and VNIC4420 are created based on BOND440.
  • Upper-layer business applications can select one of multiple virtual devices (such as VNIC4310 and VNIC4320) for business processing as needed, avoiding multiple business applications using the same virtual device at the same time.
  • the upper-layer business application using the network card 410 uses VNIC4310 and VNIC4320 for data transmission
  • the upper-layer business application using the network card 420 uses VNIC4410 and VNIC4420 for data transmission, so that data can be avoided between the network card 410 and the network card 420.
  • the method for binding multiple physical devices to a virtual device provided by the embodiments of the present application will be described below. As shown in Figure 5, the method includes but is not limited to the following steps:
  • S501 The server creates multiple physical device sets based on multiple physical devices.
  • the server may create a physical device set based on multiple physical devices (such as a multi-network port network card or a single-network port network card, etc.) deployed in the server, and run the code stored in the memory of the kernel CPU to create a physical device set, each physical device set. It includes one master device and at least one backup device, and multiple physical devices are in a master-slave relationship with each other in different physical sets, and the master devices in each physical device set are different.
  • multiple physical devices such as a multi-network port network card or a single-network port network card, etc.
  • the server when the physical devices are network cards (ETH0 and ETH1), when the server creates the network interface configuration file of the physical device set (ie BOND0) in the file directory, set ETH0 as the master device of BOND0 by adding the master device parameter, and increase the network card Support parameters Set ETH1 to support BOND0, that is, ETH1 is the standby device of BOND0; similarly, when creating the network interface configuration file of the physical device set (BOND1) in the file directory, set ETH1 as the main device of BOND1 by adding the main device parameter. Device, increase the network card support parameter, set ETH0 to support BOND1, and ETH0 is the standby device of BOND1.
  • the server restarts the system or restarts the network service.
  • the operating system of the server will one by one. Read the configuration file to establish the binding relationship between ETH0, ETH1 and BOND0, BOND1.
  • the physical device may be a GPU device, an NPU device, a network card device, or a network port in a multi-network port network card device, such as ETH3110 and ETH3120 in the network card 310 shown in FIG. NIC 410 and NIC 420.
  • the server may provide the user with an input interface, where the input interface is used to prompt the user to input the creation parameters of the physical device set, and then obtain the creation parameters input by the user through the input interface, and create a set of physical devices according to the input interface.
  • the parameter creates a collection of multiple physical devices.
  • the input interface may include a configuration interface, an application programming interface (application programming interface, API), an input template, etc., and the user inputs creation parameters based on the configuration interface, API or input template provided by the server so that the server can create parameters according to the The parameter completes the creation of the physical device collection.
  • an application programming interface application programming interface, API
  • an input template etc.
  • the user inputs creation parameters based on the configuration interface, API or input template provided by the server so that the server can create parameters according to the The parameter completes the creation of the physical device collection.
  • the user selects or inputs the name of the physical device, the identifier of the physical device, the working mode of the physical device set (for example, the active/standby mode), the number of physical device sets, Create parameters such as the number of standby devices in each physical device set.
  • the user selects and completes all parameter configurations, click the OK button in the interface, and the server creates the corresponding physical device set according to the creation parameters entered by the user.
  • the server creates a first physical device set and a second physical device set based on the physical devices deployed therein, wherein the A physical device is the master device of the first physical device set and is also the standby device of the second physical device set, such as the ETH3110 in FIG. 3 or the network card 410 in FIG. 4 .
  • the server creates a first physical device set and a second physical device set based on the first physical device and the second physical device, and the master device of the first physical device set is the first physical device, The master device of the second physical device set is the second physical device.
  • the server can create the same number of physical device sets according to the number of physical devices. the main device is different.
  • the server designates different physical devices as the master device of each physical device set, so that each physical device will participate in the communication process, improve resource utilization, and avoid data. Perform cross-device transmission between different physical devices to improve transmission efficiency.
  • the server for any one physical device set in the multiple physical device sets, assigns each standby device to the service application according to the affinity between the service application and each standby device in the physical device set. Set the priority of becoming the master device.
  • the server when creating a physical device set, can specify a master device of the physical device set and a backup device of the physical device set.
  • the backup device takes over the master device and continues to provide services when the master device fails.
  • the server can set the priority of each standby device to become the master device according to the affinity between the service application and each standby device, so that when the original master device fails, the priority The taller standby device has priority to become the new master device.
  • the server may perform priority setting on the standby device according to the connection relationship between the processor corresponding to the business application and the standby device.
  • the priority is set to the first priority
  • the priority of the standby device adjacent to the processor corresponding to the business application is set to the second priority.
  • the standby device of the first priority becomes the new priority first. main device. It can be understood that setting the priority in this way can effectively reduce the link delay when the master device fails.
  • the network card 710 provides ETH7110
  • the network card 720 provides ETH7210
  • the network card 730 provides ETH7310
  • the network card 740 provides ETH7410.
  • the main device of BOND750 is NIC 710
  • the backup devices are NIC 720, NIC 730 and NIC 740
  • the main device of BOND760 is NIC 720
  • the backup device is NIC 740.
  • Each set of physical devices creates corresponding virtual devices (eg VNIC7510, VNIC7610, etc.).
  • the server sets the priority of the standby devices in each physical device set. For example, for BOND750, the network card 720 is directly connected to the network card 710, and the corresponding forwarding overhead is the smallest.
  • the priority is set to the first priority
  • the network card 730 and the network card 710 are indirectly connected through the network card 720
  • the corresponding forwarding overhead is larger than the network card 720
  • the priority of the network card 730 is set to the second priority
  • the network card 740 Connecting to the network card 710 through the network card 720 and the network card 730 has a higher forwarding overhead and a lower priority.
  • BOND750 uses network card 710 to support upper-layer business applications. When network card 710 fails, BOND750 will preferentially select network card 720 to become the new master device to take over the work of network card 710. At this time, BOND750 and BOND760 jointly use network card 720 to Support upper-layer business applications to complete data forwarding processing.
  • the server sets the priority of each standby device according to the size of the available resources of each standby device. For example, the server obtains the bandwidth of the network port in each standby device to connect to the external network, and sets the priority of the standby device with the highest bandwidth to the first Priority, when the master device fails, the standby device with the first priority becomes the new master device first. In this way, it can be ensured that when the main device fails, the new main device has enough bandwidth resources to support upper-layer service applications.
  • the server sets the priority of each standby device according to the upgrade cost of each standby device. For example, the server calculates the resource cost (such as bandwidth resource cost, CPU resource cost, and memory resource cost) corresponding to each standby device becoming the new master device. etc.), the priority of the standby device with the smallest resource overhead is set as the first priority, and when the master device fails, the standby device with the first priority becomes the new master device first. It can be seen that, by setting the priority in this way, it can be ensured that when the master device fails, the newly selected master device consumes the least resources, which can improve the utilization rate of system resources.
  • the resource cost such as bandwidth resource cost, CPU resource cost, and memory resource cost
  • the server may select any one of the above methods to perform priority setting, or may also perform priority setting in combination with the above-mentioned multiple methods, which is not limited in this application.
  • the server assigns weights to the above three methods, which are 40%, 30% and 30% respectively, then calculates the comprehensive score of each standby device, and sets the priority according to the comprehensive score, that is, the CPU corresponding to the business application and the standby device.
  • the connection relationship accounts for 40% of the weight, the size of the available resources of the standby device accounts for 30% of the weight, and the upgrade cost of the standby device accounts for 30% of the weight. Calculate the comprehensive score of each standby device, and set the priority of the standby device with the highest comprehensive score as the first priority.
  • the master device fails, the standby device with the first priority becomes the new master device first.
  • the server creates one or more virtual devices corresponding to the physical device sets for any one of the multiple physical device sets.
  • the server maps one or more virtual devices based on each physical device set for use by upper-layer service applications.
  • the service traffic of all virtual devices is actually forwarded through the master device of the physical device set.
  • the VNIC3310 and VNIC3320 in Figure 3 The service traffic actually completes the forwarding processing through the ETH3110, and the service traffic of the VNIC4310 and VNIC4320 in FIG. 4 actually completes the forwarding processing through the network card 410.
  • the server creates one or more virtual devices matching the service application for any one of the multiple physical device sets, and sends the virtual device to all physical device sets through the virtual device.
  • the business application provides services.
  • the server creates a virtual device that matches the business application based on each physical device set, so that the business application can deliver business traffic through the matching virtual device, so that multiple physical devices can participate in the communication process at the same time, and resources can be improved. utilization, and can achieve load balancing of multiple physical devices.
  • the server sets the priority of the virtual device, so that the virtual device uses resources according to the set priority.
  • the priority of each virtual device can be set, for example, it can be set according to the matching degree between the business application and each virtual device Priority, virtual devices with high priority use resources first, which can ensure that more urgent services are processed first and avoid traffic congestion.
  • S503 The server uses the virtual device to receive the data delivered by the service application.
  • the upper-layer service application delivers service traffic through the created virtual device, for example, using VNIC3310 and VNIC3320 shown in FIG. 3 or VNIC4310 and VNIC4320 shown in FIG.
  • the physical device eg, ETH3110 or network card 410) receives the service traffic delivered by the service application and completes the forwarding process.
  • the server creates a first virtual device based on the first physical device set, and if the service traffic of the first physical device exceeds a first preset threshold, adjusts the relationship between the first virtual device and the The corresponding relationship of the first physical device set, so that the first virtual device corresponds to the second physical device set.
  • the server can dynamically adjust the corresponding relationship between the virtual device and the physical device set according to the state of the master device of the physical device set.
  • the service traffic of the device exceeds the preset threshold, it means that the main device is currently congested and it is not suitable to continue to receive the service traffic delivered by the upper-layer service application.
  • the server can adjust the corresponding relationship between the virtual device and the physical device set to
  • the virtual device corresponds to other physical device sets (for example, the physical device set in which the master device is idle), so that the upper-layer service traffic is forwarded through the master device of the other physical device set, so as to reduce the forwarding pressure of the master device of the physical device set.
  • the first preset threshold may be set according to the actual situation, which is not limited in this application.
  • the main device of BOND430 is the network card 410
  • the upper-layer service application delivers service traffic to the network card 410 through the VNIC4310 and VNIC4320 created based on BOND430.
  • the threshold adjust the corresponding relationship between VNIC4310 and/or VNIC4320 and BOND430 so that VNIC4310 and/or VNIC4320 correspond to BOND440.
  • the forwarding pressure of the network card 410 will be relieved, and the service traffic delivered by the upper-layer service application will pass through the VNIC4310 And/or VNIC 4320 reaches BOND 440 , and finally completes the forwarding process through network card 420 , realizing load balancing between network card 410 and network card 420 .
  • the first physical device set includes a first physical device and a second physical device, and if the service traffic of the first physical device exceeds a second preset threshold, adjust the flow direction of the service traffic , so that the first physical device set delivers the service traffic through the second physical device.
  • the server can dynamically adjust the flow direction of service traffic according to the status of each physical device in the physical device set.
  • the service traffic of the first physical device exceeds the second preset threshold
  • the first physical device The device set adjusts the flow direction of service traffic so that the service traffic flows to the second physical device, thereby reducing the processing pressure of the first physical device and realizing load balancing of multiple physical devices.
  • BOND 430 includes a network card 410 and a network card 420.
  • the flow direction of the service flow is adjusted through BOND 430, so that the service flow flows to the network card 420, thereby The processing pressure of the network card 410 is relieved, and the load balance between the network card 410 and the network card 420 is realized.
  • test information issued by the service application is received, where the test information is used to test the processing of the virtual devices corresponding to the multiple physical device sets delay, determining the processing delay of the virtual devices corresponding to the multiple physical device sets, and selecting the virtual device corresponding to the minimum processing delay to support the service application.
  • a service application needs to rely on a virtual device to complete service delivery, but the performance of each virtual device is different, and the service application needs to determine a virtual device with better performance and complete the final service delivery. Therefore, before delivering actual services, business applications need to perform performance tests on all existing virtual devices. For example, business applications can traverse all virtual devices, send test information to each virtual device, and then use the feedback from the test information. The information determines the processing delay of each virtual device, and then selects the virtual device corresponding to the minimum delay to deliver services.
  • the following takes four single network port devices as an example to further introduce the method for binding multiple physical devices to a virtual device provided by the present application in detail.
  • the network card 810 provides ETH8110
  • the network card 820 provides ETH8210
  • the network card 830 provides ETH8310
  • the network card 840 provides ETH8410. They are interconnected through a bus.
  • the server 800 is based on the above Create a BOND850 with four network cards, and designate the network card 810 as the master device.
  • the network card 820, network card 830, and network card 840 are the standby devices, and the priority of becoming the master device decreases in turn.
  • a VNIC8510 is created for the upper-layer business application. The actual traffic passes through the network card.
  • each physical device is the master device and will participate in the communication process, which improves resource utilization, realizes redundant backup of network port resources across devices, and improves system reliability.
  • Each physical device uses its own The Ethernet port is forwarded, which can avoid data forwarding across devices.
  • the standby device by setting the priority of the standby device to become the master device, it is ensured that in the event of a failure of the master device, the standby device with the highest priority can be selected to become the new master device, thereby reducing the link delay.
  • FIG. 9 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
  • the computing device may be the server in the method embodiment described in FIG. 5, and may execute the multi-physical device binding described in FIG. 5.
  • the server is used as the main body of the method and steps.
  • the computing device 900 includes a creation unit 910 and a processing unit 920 . in,
  • a creating unit 910 configured to create multiple physical device sets based on multiple physical devices, wherein at least two physical device sets in the multiple physical device sets include the same physical device;
  • the creating unit 910 is further configured to create one or more virtual devices corresponding to the physical device set for any one of the multiple physical device sets;
  • the processing unit 920 is configured to use the virtual device to receive the data delivered by the service application.
  • the creating unit 910 is configured to execute the aforementioned steps S501 and S502, and optionally execute the optional methods in the aforementioned steps
  • the processing unit 920 is configured to execute the aforementioned step S503, and optionally execute the aforementioned steps optional method.
  • the above-mentioned two units can communicate with each other through a communication path. It should be understood that each unit included in the computing device 900 may be a software unit, a hardware unit, or a part of a software unit and a part of a hardware unit.
  • the computing device 900 further includes a receiving unit 930, where the receiving unit 930 is configured to provide an input interface; the creating unit 910 is further configured to create a plurality of physical device sets according to the creating parameters.
  • the creating unit 910 is specifically configured to: create a first physical device set and a second physical device set based on a first physical device and a second physical device, the first physical device set and the second physical device set
  • the physical device set includes one master device and at least one backup device, wherein the master device of the first physical device set is the first physical device, and the master device of the second physical device set is the second physical device .
  • the creating unit 910 is further configured to create a first virtual device based on the first physical device set; the processing unit 920 is further configured to create a first virtual device when the service traffic of the first physical device exceeds a first preset When the threshold is set, the corresponding relationship between the first virtual device and the first physical device set is adjusted, so that the first virtual device corresponds to the second physical device set.
  • the first physical device set includes the first physical device and the second physical device
  • the processing unit 920 is further configured to, when the service traffic of the first physical device exceeds a second preset When the threshold is set, the flow direction of the service traffic is adjusted, so that the first physical device set delivers the service traffic through the second physical device.
  • the processing unit 920 is further configured to make each standby device a master device according to the affinity between the service application and each standby device in any one of the multiple physical device sets priority is set.
  • the processing unit 920 is specifically configured to: set the priority of each standby device becoming a master device according to the connection relationship between the processor corresponding to the service application and each standby device; or , setting the priority of each standby device to become the master device according to the size of the available resources of the respective standby devices; or, according to the size of the resources consumed by the upgrade of the respective standby devices to the master device, assigning the respective standby devices to become the master device.
  • the priority of the master device is set.
  • the receiving unit 930 is further configured to receive test information delivered by the service application, where the test information is used to test the processing delay of the virtual devices corresponding to the multiple physical device sets;
  • the processing unit 920 is further configured to determine the processing delay of the virtual devices corresponding to the multiple physical device sets, and select the virtual device corresponding to the minimum processing delay to receive the data delivered by the service application.
  • the processing unit 920 is further configured to set the priority of the one or more virtual devices corresponding to any one of the multiple physical device sets, so that the One or more virtual devices corresponding to any one of the multiple physical device sets use resources according to the set priority.
  • each unit of the computing device may be added, reduced or combined as required.
  • the operations and/or functions of each unit in the computing device are respectively to implement the corresponding flow of the method described in FIG. 5 , and are not repeated here for brevity.
  • FIG. 10 is a schematic structural diagram of another computing device provided by an embodiment of the present application.
  • the computing device 10 includes a processor 11 , a communication interface 12 and a memory 13 , and the processor 11 , the communication interface 12 and the memory 13 are connected to each other through an internal bus 14 .
  • the computing device 10 may be the server in the method embodiment described in FIG. 5 .
  • the functions performed by the server in the method embodiment shown in FIG. 5 are actually performed by the processor 11 of the server.
  • the processor 11 may be composed of one or more general-purpose processors, such as a central processing unit (central processing unit, CPU), or a combination of a CPU and a hardware chip.
  • the above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
  • the above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (generic array logic, GAL) or any combination thereof.
  • the bus 14 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus or the like.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus 14 can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is used in FIG. 10, but it does not mean that there is only one bus or one type of bus.
  • the memory 13 may include volatile memory (volatile memory), such as random access memory (random access memory, RAM); the memory 13 may also include non-volatile memory (non-volatile memory), such as read-only memory (read- only memory, ROM), flash memory (flash memory), hard disk drive (hard disk drive, HDD) or solid-state drive (solid-state drive, SSD); the memory 13 may also include a combination of the above types.
  • volatile memory such as random access memory (random access memory, RAM
  • non-volatile memory such as read-only memory (read- only memory, ROM), flash memory (flash memory), hard disk drive (hard disk drive, HDD) or solid-state drive (solid-state drive, SSD); the memory 13 may also include a combination of the above types.
  • the program code may be used to implement the functional units shown in the computing device 900, or used to implement the method steps in the method embodiment shown in FIG. 5 with the server as the main body of execution.
  • Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored.
  • the program When the program is executed by a processor, it can implement some or all of the steps described in the above method embodiments, and realize the above The function of any one of the functional units described in FIG. 9 .
  • Embodiments of the present application also provide a computer program product, which, when run on a computer or a processor, causes the computer or processor to execute one or more steps in any one of the above methods. If each constituent unit of the above-mentioned device is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in the computer-readable storage medium.
  • the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be implemented in the present application.
  • the implementation of the examples constitutes no limitation.
  • the functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)

Abstract

本申请提供一种多物理设备绑定虚拟设备的方法、系统及相关设备。其中,该方法包括:基于多个物理设备创建多个物理设备集合,其中,所述多个物理设备集合中的至少两个物理设备集合包括同一个物理设备;针对所述多个物理设备集合中的任意一个物理设备集合创建一个或多个与所述物理设备集合对应的虚拟设备;利用所述虚拟设备接收业务应用下发的数据。通过创建多个物理设备集合,且针对每个物理设备集合创建与之对应的虚拟设备以接收业务应用下发的数据,这样可以保证各个物理设备均参与数据处理,有效提高物理设备的资源利用率,实现多物理设备负载均衡。

Description

一种多物理设备绑定虚拟设备的方法、系统及相关设备
本申请要求于2020年08月03日提交中国专利局、申请号为202010769410.8、申请名称为“一种多物理设备绑定虚拟设备的方法及装置”的中国专利申请的优先权,以及要求于2020年11月20日提交中国专利局、申请号为202011308800.1、申请名称为“一种多物理设备绑定虚拟设备的方法、系统及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及云计算技术领域,尤其涉及一种多物理设备绑定虚拟设备的方法、系统及相关设备。
背景技术
目前为了提高资源的利用率和系统性能及可靠性,多物理设备绑定技术变得越来越流行,例如linux系统下的网卡绑定技术(bonding),可以把多个物理网卡在系统内部抽象(绑定)成一个逻辑上的网卡,可以有效提升网络吞吐量、实现网络冗余、负载均衡等功能。
在将多物理设备绑定为一个虚拟设备之后需要配置其工作模式,一般都将其配置为主备模式,在该模式下,多个物理设备中只有一个物理设备为主设备,其它都为备设备,即只有一个物理设备处于激活(active)状态,其它的物理设备只有在当前激活的物理设备发生故障后才会变为激活状态。该模式提供了容错机制,可以提高网络连接的可用性,但同时该模式降低了资源利用率,在有N个物理设备的情况下,其资源利用率仅为1/N,此外也不具备负载均衡能力。
因此,在多物理设备绑定虚拟设备的场景中如何提高资源的利用率,增加多物理设备的负载均衡能力是目前亟待解决的问题。
发明内容
本发明实施例公开了一种多物理设备绑定虚拟设备的方法、系统及相关设备,基于多个物理设备创建多个物理设备集合,并针对每一个物理设备集合创建与不同物理设备对应的虚拟设备以支持业务应用,从而可以提高资源利用率,实现多物理设备负载均衡。
第一方面,本申请提供了一种多物理设备绑定虚拟设备的方法,包括:服务器基于多个物理设备创建多个物理设备集合,其中,所述多个物理设备集合中的至少两个物理设备集合包括同一个物理设备;服务器针对所述多个物理设备集合中的任意一个物理设备集合创建一个或多个与所述物理设备集合对应的虚拟设备;服务器利用所述虚拟设备接收业务应用下发的数据。
可选的,本申请所涉及的物理设备包括但不限于NIC、GPU和NPU。
在本申请提供的方案中,在存在多个物理设备时,服务器基于多个物理设备创建多个物理设备集合,从而对多个物理设备进行绑定,同一个物理设备可以归属于不同的物理设备集合,再针对每一个物理设备集合创建与其对应的虚拟设备,并利用创建的虚拟设备接收上层业务应用下发的数据。这样可以保证各个物理设备均参与数据处理,有效提高了资源利用率,实现了多物理设备之间的负载均衡。
结合第一方面,在第一方面的一种可能的实现方式中,服务器提供输入接口,所述输入接口用于提示用户输入物理设备集合的创建参数;服务器通过所述输入接口获取所述创建参数,并根据所 述创建参数创建多个物理设备集合。
可选的,所述输入接口包括配置界面、应用程序编程接口API和输入模板。
在本申请提供的方案中,用户可以通过服务器提供的配置界面或API接口输入创建参数,从而根据该创建参数创建多个物理设备集合,以使多个物理设备集合可以同时进行业务处理,从而提高资源利用率。
结合第一方面,在第一方面的一种可能的实现方式中,服务器基于第一物理设备和第二物理设备创建第一物理设备集合和第二物理设备集合,所述第一物理设备集合和所述第二物理设备集合分别包括一个主设备和至少一个备设备,其中,所述第一物理设备集合的主设备为所述第一物理设备,所述第二物理设备集合的主设备为所述第二物理设备。
在本申请提供的方案中,服务器在创建物理设备集合时,保证各个物理设备集合的主设备不同,从而确保各个物理设备都能参与业务处理,提高资源利用率。
结合第一方面,在第一方面的一种可能的实现方式中,服务器基于第一物理设备集合创建第一虚拟设备;若所述第一物理设备的业务流量超过第一预设阈值,调整所述第一虚拟设备与所述第一物理设备集合的对应关系,以使所述第一虚拟设备对应所述第二物理设备集合。
在本申请提供的方案中,服务器可以根据各个物理设备集合的业务流量灵活调整虚拟设备和物理设备集合的对应关系,可以将业务流量分流至业务压力较小的物理设备集合,从而实现多物理设备负载均衡。
结合第一方面,在第一方面的一种可能的实现方式中,所述第一物理设备集合包括所述第一物理设备和所述第二物理设备;若所述第一物理设备的业务流量超过第二预设阈值,服务器调整所述业务流量的流向,以使所述第一物理设备集合通过所述第二物理设备下发所述业务流量。
在本申请提供的方案中,服务器可以针对于同一个物理设备集合中的物理设备进行业务流量调整,以使得在业务流量超过主设备的预设阈值时,可以将业务流量分流至备设备处理,从而实现在同一个物理设备集合内负载均衡。
结合第一方面,在第一方面的一种可能的实现方式中,对于所述多个物理设备集合中的任意一个物理设备集合,服务器根据业务应用和所述多个物理设备集合中的任意一个物理设备集合中的各个备设备之间的亲和性对各个备设备成为主设备的优先级进行设置。
在本申请提供的方案中,服务器可以利用业务应用与各个备设备之间的亲和性进行优先级设置,从而保证在主设备故障的情况下,优先级高的备设备接替主设备继续工作,保证业务的连续性。
结合第一方面,在第一方面的一种可能的实现方式中,服务器根据业务应用所对应的处理器与所述各个备设备之间的连接关系对所述各个备设备成为主设备的优先级进行设置;或者,服务器根据所述各个备设备的可用资源大小对所述各个备设备成为主设备的优先级进行设置;或者,服务器根据所述各个备设备升级为主设备所消耗的资源大小对所述各个备设备成为主设备的优先级进行设置。
在本申请提供的方案中,服务器可以根据不同的约束条件灵活设置各个备设备的优先级,以使得在主设备故障时,符合要求的备设备能够成为新的主设备,从而保证业务的连续性和系统的稳定性。
结合第一方面,在第一方面的一种可能的实现方式中,虚拟设备接收所述业务应用下发的测试信息,所述测试信息用于测试与所述多个物理设备集合对应的虚拟设备的处理时延;服务器确定与 所述多个物理设备集合对应的虚拟设备的处理时延,并选择最小处理时延所对应的虚拟设备接收所述业务应用下发的数据。
在本申请提供的方案中,服务器在创建虚拟设备后,通过确定各个虚拟设备的处理时延,从而完成对虚拟设备的筛选,将最小处理时延的虚拟设备与业务应用进行匹配,从而缩短业务处理时间,提高业务处理效率。
结合第一方面,在第一方面的一种可能的实现方式中,服务器对所述一个或多个与所述多个物理设备集合中的任意一个物理设备集合对应的虚拟设备的优先级进行设置,以使所述一个或多个与所述多个物理设备集合中的任意一个物理设备集合对应的虚拟设备按照设置的优先级使用资源。
在本申请提供的方案中,服务器通过对虚拟设备的优先级进行设置,从而可以保证在资源有限的情况下虚拟设备能够按照优先级使用资源,提高服务质量。
第二方面,本申请提供了一种计算设备,包括:创建单元,用于基于多个物理设备创建多个物理设备集合,其中,所述多个物理设备集合中的至少两个物理设备集合包括同一个物理设备;所述创建单元,还用于针对所述多个物理设备集合中的任意一个物理设备集合创建一个或多个与所述物理设备集合对应的虚拟设备;处理单元,用于利用所述虚拟设备接收业务应用下发的数据。
结合第二方面,在第二方面的一种可能的实现方式中,所述计算设备还包括接收单元,所述接收单元,用于提供输入接口,所述输入接口用于提示用户输入物理设备集合的创建参数;所述创建单元,还用于根据所述创建参数创建多个物理设备集合。
结合第二方面,在第二方面的一种可能的实现方式中,所述创建单元,具体用于:基于第一物理设备和第二物理设备创建第一物理设备集合和第二物理设备集合,所述第一物理设备集合和所述第二物理设备集合分别包括一个主设备和至少一个备设备,其中,所述第一物理设备集合的主设备为所述第一物理设备,所述第二物理设备集合的主设备为所述第二物理设备。
结合第二方面,在第二方面的一种可能的实现方式中,所述创建单元,还用于基于第一物理设备集合创建第一虚拟设备;所述处理单元,还用于在所述第一物理设备的业务流量超过第一预设阈值时,调整所述第一虚拟设备与所述第一物理设备集合的对应关系,以使所述第一虚拟设备对应所述第二物理设备集合。
结合第二方面,在第二方面的一种可能的实现方式中,所述第一物理设备集合包括所述第一物理设备和所述第二物理设备,所述处理单元,还用于在所述第一物理设备的业务流量超过第二预设阈值时,调整所述业务流量的流向,以使所述第一物理设备集合通过所述第二物理设备下发所述业务流量。
结合第二方面,在第二方面的一种可能的实现方式中,所述处理单元,还用于根据业务应用和所述多个物理设备集合中的任意一个物理设备集合中的各个备设备之间的亲和性对各个备设备成为主设备的优先级进行设置。
结合第二方面,在第二方面的一种可能的实现方式中,所述处理单元,具体用于:根据业务应用所对应的处理器与所述各个备设备之间的连接关系对所述各个备设备成为主设备的优先级进行设置;或者,根据所述各个备设备的可用资源大小对所述各个备设备成为主设备的优先级进行设置;或者,根据所述各个备设备升级为主设备所消耗的资源大小对所述各个备设备成为主设备的优先级进行设置。
结合第二方面,在第二方面的一种可能的实现方式中,所述接收单元,还用于接收所述业务应用下发的测试信息,所述测试信息用于测试与所述多个物理设备集合对应的虚拟设备的处理时延;所述处理单元,还用于确定与所述多个物理设备集合对应的虚拟设备的处理时延,并选择最小处理时延所对应的虚拟设备接收所述业务应用下发的数据。
结合第二方面,在第二方面的一种可能的实现方式中,所述处理单元,还用于对所述一个或多个与所述多个物理设备集合中的任意一个物理设备集合对应的虚拟设备的优先级进行设置,以使所述一个或多个与所述多个物理设备集合中的任意一个物理设备集合对应的虚拟设备按照设置的优先级使用资源。
第三方面,本申请提供了一种计算设备,所述计算设备包括处理器和存储器,所述处理器和所述存储器通过内部总线相连,所述存储器中存储有指令,所述处理器调用所述存储器中的指令以执行上述第一方面以及结合上述第一方面中的任意一种实现方式所提供的方法。
第四方面,本申请提供了一种计算机存储介质,所述计算机存储介质存储有计算机程序,当所述计算机程序被处理器执行时,可以实现上述第一方面以及结合上述第一方面中的任意一种实现方式所提供的方法。
第五方面,本申请提供了一种计算机程序产品,该计算机程序包括指令,当该计算机程序被计算机执行时,使得计算机可以执行上述第一方面以及结合上述第一方面中的任意一种实现方式所提供的方法。
附图说明
为了更清楚地说明本发明实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种利用多物理设备绑定技术支持业务应用的场景示意图;
图2是本申请实施例提供的另一种利用多物理设备绑定技术支持业务应用的场景示意图;
图3是本申请实施例提供的一种系统架构的示意图;
图4是本申请实施例提供的另一种系统架构的示意图;
图5是本申请实施例提供的一种多物理设备绑定虚拟设备的方法的流程示意图;
图6是本申请实施例提供的一种配置界面的示意图;
图7是本申请实施例提供的一种设置备设备优先级的示意图;
图8是本申请实施例提供的一种系统结构的示意图;
图9是本申请实施例提供的一种计算设备的结构示意图;
图10是本申请实施例提供的又一种计算设备的结构示意图。
具体实施方式
下面结合附图对本申请实施例中的技术方案进行清楚、完整的描述,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。
首先,对本申请中所涉及的部分用语和相关技术进行解释说明,以便于本领域技术人员理解。
物理设备是为应用提供服务的设备,包括但不限于网络接口控制器(network interface card,NIC)或NIC上的网络端口、图形处理器(graphics processing unit,GPU)或嵌入式神经网络处理器(neural-network processing unit,NPU)等。
物理设备集合是将多个物理设备绑定得到的一个集合,其对外显示为同一个设备,例如linux系统下的网卡绑定,通过修改网口驱动使多个网卡对外显示为一个单独的以太网接口设备并具有相同的IP地址,物理设备集合由于是将多个物理设备绑定得到的一个集合,因此在某个物理设备或某个物理设备上的端口出现故障无法使用的时候,可以根据配置策略通过冗余的物理设备或端口继续提高服务,以提高系统性能和可靠性。
在利用多物理设备绑定技术支持业务应用的场景中,需要将多个物理设备绑定得到一个物理设备集合,根据该物理设备集合进行映射得到一个或多个虚拟的物理设备,最后利用虚拟的物理设备支持上层业务应用。如图1所示,网卡NIC100提供了两个物理网口,即以太网口ETH110和以太网口120,将ETH110和ETH120进行绑定得到物理设备集合,即BOND200,该BOND200为主备模式BOND,在创建BOND200时,可以指定ETH110为主设备,那么ETH120则为备设备,当然,也可以指定ETH120为主设备,那么ETH120则为备设备。在得到BOND200之后,利用该BOND200映射得到多个虚拟网卡,例如VNIC310、VNIC320和VNIC330,映射完成之后,上层业务应用可以利用映射得到的任意一个虚拟网卡或直接使用BOND200进行通信,若ETH110为主设备的情况下,那么在正常通信过程中,所有上层业务应用的数据将通过虚拟网卡以及BOND200汇集到ETH110,最终由ETH110进行处理转发,即所有上层业务应用的数据都仅会通过ETH110,不会通过ETH120完成数据转发处理。特别的,当ETH110出现故障或ETH110对应的外部链路出现故障,不能完成数据转发处理时,BOND机制检测到ETH110异常,则将会触发主备切换,例如,Linux系统通过链路侦听参数进行链路监测,检测网口的链路连接状态,其值可以设为100,表示系统每100毫秒监测一次链路连接状态,若检测到ETH110链路连接断开,则表明ETH110异常,那么BOND200的主设备将切换为ETH120,所有上层业务应用的数据将通过虚拟网卡和BOND200汇集到ETH120,由ETH120接替ETH110完成数据转发处理。
可以看出,在图1所示的物理设备包含多物理网口的应用场景中,将多个网口绑定为一个BOND,导致在同一时刻仅有一个物理网口处于工作状态,其它物理网口处于空闲状态,导致资源利用率较低,且没有负载均衡能力。
对于物理设备仅包含单个物理网口的场景也可以利用相似原理将多个物理设备绑定为一个物理设备集合,从而提供容错机制,提高可用性。如图2所示,网卡NIC210提供以太网口ETH2110,网卡NIC220提供以太网口ETH2210,NIC210和NIC220之间可以通过总线直接互连或者通过其所对接的中央处理器(central processing unit,CPU)间接互联,将NIC210和NIC220进行绑定得到物理设备集合BOND230,在创建BOND230过程中,可以指定NIC210为主设备,则NIC220为备设备,在创建完成之后,可以利用该BOND230映射得到多个虚拟网卡,例如VNIC2410、VNIC2420和VNIC2430。映射完成后,所有上层业务应用的数据可以通过映射得到的任意一个虚拟网卡以及 BOND230汇集至NIC210,并通过NIC210中的ETH2110完成最终的转发处理。当NIC210出现故障或NIC210对应的外部链路出现故障,不能完成数据转发处理时,BOND机制将会检测到NIC210异常,从而触发主备切换,将NIC220切换为BOND230新的主设备,所有上层业务应用的数据将通过虚拟网卡及BOND230汇集至NIC220,由NIC220完成数据转发处理。
可以理解,在图2所示的物理设备包含单网口的应用场景中,将多个物理设备绑定为一个BOND,在同一时刻也仅有一个物理设备处于工作状态,其资源利用率较低,各个物理设备之间没有负载均衡能力,此外,由于所有的业务应用的数据都通过同一个物理设备进行转发处理,那么数据可能存在跨设备转发,时延较高,例如在NIC210正常工作状态下,NIC220的数据也需要通过NIC210进行转发处理,增加了传输时延。
为了解决上述问题,本申请提供一种多物理设备绑定虚拟设备的方法,该方法通过基于多个物理设备创建与多个物理设备集合,以使得其中至少两个物理设备集合中都包含同一个物理设备,然后针对每一个物理设备集合创建一个或多个虚拟设备,并利用创建得到的虚拟设备支持业务应用,从而提高资源利用率和多物理设备的负载均衡能力。
本申请实施例的技术方案可以应用于各种物理设备绑定的场景,包括但不限于多网卡设备绑定、多GPU绑定、多NPU绑定等,为了便于理解,本申请以物理设备为网卡设备为例进行具体说明。
图3是本申请实施例提供的一种系统架构的示意图。如图3所示,网卡310提供了ETH3110和ETH3120两个物理网口,基于ETH3110和ETH3120创建了两个物理设备集合,即BOND3210和BOND3220,其中,ETH3110为BOND3210的主设备,ETH3120为BOND3210的备设备;ETH3120为BOND3220的主设备,ETH3110为BOND3220的备设备。在创建得到BOND3210和BOND3220之后,利用BOND3210映射得到虚拟网卡VNIC3310和VNIC3320,利用BOND3220映射得到虚拟网卡VNIC3330和VNIC3340,上层业务应用可以选择任意一个虚拟网卡进行数据传输,这样可以保证ETH3110和ETH3120能够同时参与通信过程,均有流量通过,提高了资源利用效率,实现了负载均衡。当ETH3110出现故障或ETH3110对应的外部链路出现故障,不能完成数据转发处理时,将触发主备切换,那么BOND3210的主设备将切换为ETH3120,所有数据都将通过ETH3120完成转发处理,保证业务数据仍能够正常完成转发处理,保证系统可靠性。可以理解,图3是以一个物理设备包含多个物理网口为例进行说明的,对于一个物理设备仅包含单个物理网口的情况,其实现原理与上述类似。如图4所示,网卡410提供了ETH4110,网卡420提供了ETH4210,网卡410和网卡420之间通过总线直接互联或通过其所对接的CPU相连,基于网卡410和网卡420创建BOND430和BOND440,其中,网卡410为BOND430的主设备,网卡420为BOND430的备设备;网卡420为BOND440的主设备,网卡410为BOND440的备设备。之后,基于BOND430创建VNIC4310和VNIC4320,基于BOND440创建VNIC4410和VNIC4420,上层业务应用可以根据需要从多个虚拟设备(例如VNIC4310和VNIC4320)中选择一个进行业务处理,避免多个业务应用同时使用同一个虚拟设备,从而提高业务处理效率,使用网卡410的上层业务应用使用VNIC4310和VNIC4320进行数据传输,使用网卡420的上层业务应用使用VNIC4410和VNIC4420进行数据传输,这样可以避免数据在网卡410和网卡420之间进行跨设备传输,减少传输时延,提高传输效率。
结合图3和图4所示的系统架构的示意图,下面将描述本申请实施例提供的多物理设备绑定虚 拟设备的方法。如图5所示,该方法包括但不限于以下步骤:
S501:服务器基于多个物理设备创建多个物理设备集合。
具体地,服务器可以基于部署在该服务器中的多个物理设备(例如多网口网卡或单网口网卡等),通过内核CPU运行存储器中所存储的代码创建物理设备集合,每个物理设备集合中包括一个主设备和至少一个备设备,且多个物理设备在不同的物理集合中互为主备关系,每个物理设备集合中的主设备不同。例如,对于物理设备为网卡(ETH0和ETH1)时,服务器在文件目录中创建物理设备集合(即BOND0)的网络接口配置文件时,通过增加主设备参数将ETH0设置为BOND0的主设备,增加网卡支持参数将ETH1设置为支持BOND0,即ETH1为BOND0的备设备;同理,在文件目录中创建物理设备集合(BOND1)的网络接口配置文件时,通过增加主设备参数将ETH1设置为BOND1的主设备,增加网卡支持参数将ETH0设置为支持BOND1,ETH0为BOND1的备设备,在网络接口配置文件创建好之后,服务器通过重启系统或重启网络服务,在网络初始化过程中,服务器的操作系统会逐一读取配置文件,从而建立ETH0、ETH1与BOND0、BOND1的绑定关系。
可选的,物理设备可以是GPU设备、NPU设备、网卡设备或多网口网卡设备中的网口,例如上述图3中所示的网卡310中的ETH3110和ETH3120,或图4中所示的网卡410和网卡420。
在一种可能的实现方式中,服务器可以通过向用户提供输入接口,该输入接口用于提示用户输入物理设备集合的创建参数,然后通过该输入接口获取用户输入的创建参数,并根据所述创建参数创建多个物理设备集合。
可选的,所述输入接口可以包括配置界面、应用程序编程接口(application programming interface,API)和输入模板等,用户基于服务器提供的配置界面、API或输入模板输入创建参数以使得服务器能够根据创建参数完成物理设备集合的创建。
示例性的,如图6所示,用户在服务器提供的配置界面中选择或输入物理设备的名称、物理设备的标识、物理设备集合的工作模式(例如主备模式)、物理设备集合的数量、每个物理设备集合中的备设备数量等创建参数,用户在选择完成所有参数配置之后,点击界面中的确认按钮,服务器即根据用户输入的创建参数创建相对应的物理设备集合。
应理解,在创建物理设备集合的过程中,同一个物理设备可以归属于不同的物理设备集合,例如服务器基于其中部署的物理设备创建了第一物理设备集合和第二物理设备集合,其中,第一物理设备为第一物理设备集合的主设备且同时为第二物理设备集合的备设备,如上述图3中的ETH3110或图4中的网卡410。
在另一种可能的实现方式中,服务器基于第一物理设备和第二物理设备创建第一物理设备集合和第二物理设备集合,所述第一物理设备集合的主设备为第一物理设备,所述第二物理设备集合的主设备为第二物理设备。
具体地,对于物理设备是单网络端口设备时,例如上述图4中所示的网卡410和网卡420,服务器可以根据物理设备的数量创建与之相同数量的物理设备集合,每个物理设备集合中的主设备不同。
容易理解,服务器在创建物理设备集合的过程中,通过指定不同的物理设备作为各个物理设备集合的主设备,这样可以使得各个物理设备都将参与通信过程,提高了资源利用率,且可以避免数据在不同物理设备之间进行跨设备传输,提高传输效率。
在另一种可能的实现方式中,服务器对于所述多个物理设备集合中的任意一个物理设备集合, 根据业务应用和该物理设备集合中的各个备设备之间的亲和性对各个备设备成为主设备的优先级进行设置。
具体地,服务器在创建物理设备集合时可以指定物理设备集合的主设备以及物理设备集合的备设备,备设备是在主设备故障的情况下接替主设备从而继续提供服务。当物理设备集合中存在多个备设备时,服务器可以根据业务应用与各个备设备之间的亲和性对各个备设备成为主设备的优先级进行设置,以使得在原主设备故障时,优先级高的备设备优先成为新的主设备。
可选的,服务器可以根据所述业务应用所对应的处理器与备设备之间的连接关系对备设备进行优先级设置,例如,可以将与业务应用所对应的处理器直连的备设备的优先级设置为第一优先级,将与业务应用所对应的处理器相邻的备设备的优先级设置为第二优先级,在主设备故障时,第一优先级的备设备优先成为新的主设备。可以理解,通过这种方式设置优先级,可以在主设备故障时,有效降低链路时延。
示例性的,如图7所示,网卡710提供了ETH7110、网卡720提供了ETH7210、网卡730提供了ETH7310、网卡740提供了ETH7410,它们之间通过内部总线互连,基于上述四个网卡设备创建了四个物理设备集合,即BOND750、BOND760、BOND770和BOND780,其中,BOND750的主设备为网卡710,备设备为网卡720、网卡730和网卡740;BOND760的主设备为网卡720,备设备为网卡710、网卡730和网卡740;BOND770的主设备为网卡730,备设备为网卡710、网卡720和网卡740;BOND780的主设备为网卡740,备设备为网卡710、网卡720和网卡730,同时基于各个物理设备集合创建了相应的虚拟设备(例如VNIC7510、VNIC7610等)。服务器在创建物理设备集合时,对各个物理设备集合中的备设备的优先级进行设置,例如,对于BOND750来说,网卡720与网卡710直接相连,其对应的转发开销最小,因此将网卡720的优先级设置为第一优先级,网卡730与网卡710之间通过网卡720间接连接,其对应的转发开销相比网卡720较大,因此将网卡730的优先级设置为第二优先级,网卡740与网卡710之间通过网卡720和网卡730连接,其对应的转发开销更大,其对应的优先级别更低。在正常工作时,BOND750利用网卡710支持上层业务应用,当网卡710发生故障时,BOND750将优先选择网卡720成为新的主设备,接替网卡710的工作,此时,BOND750和BOND760共同使用网卡720以支持上层业务应用,完成数据转发处理。
或者,服务器根据各个备设备的可用资源大小对各个备设备进行优先级设置,例如,服务器获取各个备设备中的网口对接外部网络的带宽,将带宽最高的备设备的优先级设置为第一优先级,在主设备故障时,第一优先级的备设备优先成为新的主设备。通过这种方式,可以保证在主设备故障时,新的主设备存在足够的带宽资源支持上层业务应用。
或者,服务器根据各个备设备的升级开销对各个备设备进行优先级设置,例如,服务器计算每个备设备成为新的主设备所对应的资源开销(例如带宽资源开销、CPU资源开销和内存资源开销等),将资源开销最小的备设备的优先级设置为第一优先级,在主设备故障时,第一优先级的备设备优先成为新的主设备。可以看出,通过这种方式设置优先级,可以保证在主设备故障时,所重新选择的新的主设备消耗资源最少,能够提高系统资源利用率。
值得说明的是,服务器可以选择上述任意一种方式进行优先级设置,或者也可以结合上述多种方式进行优先级设置,本申请对此不作限定。例如,服务器针对上述三种方式分配权重,分别为40%,30%和30%,然后计算各个备设备的综合得分,并根据综合得分设置优先级,即业务应用所对应的CPU与备设备的连接关系占40%权重,备设备的可用资源大小占30%权重,备设备的升级开销 占30%权重,计算各个备设备的综合得分,将综合得分最高备设备的优先级设置为第一优先级,在主设备故障时,第一优先级的备设备优先成为新的主设备。
S502:服务器针对所述多个物理设备集合中的任意一个物理设备集合创建一个或多个与所述物理设备集合对应的虚拟设备。
具体地,服务器在创建绑定设备之后,基于每一个物理设备集合,映射得到一个或多个虚拟设备以供上层业务应用使用,例如,上述图3中所示的VNIC3310和VNIC3320和图4中所示的VNIC4310和VNIC4320,应理解,虽然物理设备集合可以映射多个虚拟设备,但所有虚拟设备的业务流量实际均是通过物理设备集合的主设备完成转发处理,例如,图3中VNIC3310和VNIC3320的业务流量均实际通过ETH3110完成转发处理,图4中的VNIC4310和VNIC4320的业务流量均实际通过网卡410完成转发处理。
在另一种可能的实现方式中,服务器针对所述多个物理设备集合中的任意一个物理设备集合创建与所述业务应用相匹配的一个或多个虚拟设备,并通过所述虚拟设备向所述业务应用提供服务。
具体地,服务器基于各个物理设备集合创建与业务应用相匹配的虚拟设备,以使得业务应用可以通过相匹配的虚拟设备下发业务流量,从而可以实现多个物理设备能够同时参与通信过程,提高资源利用率,并可以实现多物理设备的负载均衡。
在另一种可能的实现方式中,服务器对所述虚拟设备的优先级进行设置,以使所述虚拟设备按照设置的优先级使用资源。
具体地,服务器在基于物理设备集合创建虚拟设备时,当创建了多个虚拟设备时,可以对各个虚拟设备的优先级进行设置,例如,可以根据业务应用与各个虚拟设备之间的匹配程度设置优先级,优先级高的虚拟设备优先使用资源,这样可以保证较为紧急的业务优先得到处理,避免流量拥塞。
S503:服务器利用所述虚拟设备接收业务应用下发的数据。
具体地,上层业务应用通过创建得到的虚拟设备下发业务流量,例如利用图3中所示的VNIC3310和VNIC3320或图4中所示的VNIC4310和VNIC4320下发业务流量,从而使得虚拟设备所对应的物理设备(例如ETH3110或网卡410)接收业务应用下发的业务流量并完成转发过程。
在另一种可能的实现方式中,服务器基于第一物理设备集合创建第一虚拟设备,若所述第一物理设备的业务流量超过第一预设阈值,调整所述第一虚拟设备与所述第一物理设备集合的对应关系,以使所述第一虚拟设备对应所述第二物理设备集合。
具体地,服务器在基于物理设备集合创建与物理设备集合相对应的虚拟设备之后,可以根据物理设备集合的主设备的状态,动态调整虚拟设备与物理设备集合的对应关系,当物理设备集合的主设备的业务流量超过预设阈值时,则说明主设备当前已经比较堵塞,不适合继续接收上层业务应用下发的业务流量,此时,服务器可以通过调整虚拟设备与物理设备集合的对应关系,将虚拟设备与其它物理设备集合(例如主设备空闲的物理设备集合)进行对应,从而使得上层业务流量通过其它物理设备集合的主设备完成转发处理,以减轻该物理设备集合的主设备的转发压力,提高整个系统的运行效率。其中,第一预设阈值可以根据实际情况进行设置,本申请对此不作限定。
示例性的,如上述图4所示的应用场景中,BOND430的主设备为网卡410,上层业务应用通过基于BOND430创建的VNIC4310和VNIC4320向网卡410下发业务流量,当网卡410的业务流量超过预设阈值时,调整VNIC4310和/或VNIC4320与BOND430的对应关系,以使得VNIC4310和/或VNIC4320对应BOND440,调整完成之后,网卡410的转发压力将得到缓解,上层业务应用下发的业 务流量将通过VNIC4310和/或VNIC4320到达BOND440,最终通过网卡420完成转发处理,实现了网卡410和网卡420之间的负载均衡。
在另一种可能的实现方式中,第一物理设备集合包括第一物理设备和第二物理设备,若所述第一物理设备的业务流量超过第二预设阈值,调整所述业务流量的流向,以使所述第一物理设备集合通过所述第二物理设备下发所述业务流量。
具体地,服务器在创建物理设备集合之后,可以根据物理设备集合中各个物理设备的状态,动态调整业务流量的流向,当第一物理设备的业务流量超过第二预设阈值,则通过第一物理设备集合调整业务流量流向,以使得业务流量流向第二物理设备,从而减轻第一物理设备的处理压力,实现多物理设备负载均衡。
示例性的,在上述图4所示的场景中,BOND430包括网卡410和网卡420,当网卡410的业务流量超过预设阈值时,通过BOND430调整业务流量流向,以使得业务流量流向网卡420,从而缓解网卡410的处理压力,实现网卡410和网卡420的负载均衡。
在另一种可能的实现方式中,在基于物理设备集合创建虚拟设备之后,接收业务应用下发的测试信息,所述测试信息用于测试与所述多个物理设备集合对应的虚拟设备的处理时延,确定与所述多个物理设备集合对应的虚拟设备的处理时延,并选择最小处理时延所对应的虚拟设备支持所述业务应用。
具体地,业务应用需要依赖虚拟设备才能完成业务下发,但各个虚拟设备的性能存在差异,业务应用需要从中确定一个性能较优的虚拟设备并完成最终的业务下发。因此,业务应用在进行实际业务下发之前,需要对存在的所有虚拟设备进行性能测试,例如,业务应用可以遍历所有虚拟设备,并向每个虚拟设备发送测试信息,然后根据该测试信息的反馈信息确定各个虚拟设备的处理时延,然后选择最小时延对应的虚拟设备下发业务。
下面以四个单网口设备为例,对本申请提供的多物理设备绑定虚拟设备的方法进行进一步详细介绍。
如图8所示,服务器中部署了四个网卡,网卡810提供了ETH8110、网卡820提供了ETH8210、网卡830提供了ETH8310、网卡840提供了ETH8410,它们之间通过总线互连,服务器800基于上述四个网卡创建BOND850,并指定网卡810为主设备,网卡820、网卡830、网卡840为备设备且成为主设备的优先级依次降低,基于BOND850创建VNIC8510供上层业务应用使用,实际流量均通过网卡810;创建BOND860,并指定网卡820为主设备,网卡830、网卡840、网卡810为备设备且成为主设备的优先级依次降低,基于BOND860创建VNIC8610供上层业务应用使用,实际流量均通过网卡820;创建BOND870,并指定网卡830为主设备,网卡840、网卡820、网卡810为备设备且成为主设备的优先级依次降低,基于BOND870创建VNIC8710供上层业务应用使用,实际流量均通过网卡830;创建BOND880,并指定网卡840为主设备,网卡830、网卡820、网卡810为备设备且成为主设备的优先级依次降低,基于BOND880创建VNIC8810供上层业务应用使用,实际流量均通过网卡840。
可以看出,每个物理设备都是主设备,都将参与通信过程,提高了资源利用率,且实现了跨设备的网口资源冗余备份,提高了系统可靠性,每个物理设备使用自身的以太网口进行转发处理,可以避免数据跨设备转发。此外,通过设置备设备成为主设备的优先级,保证在主设备故障的情况下,可以选择优先级最高的备设备成为新的主设备,从而降低链路时延。
需要说明的是,图8所示的多物理设备绑定虚拟设备的方法与图5的原理一致,可以参照图5中的S501至S503步骤中的相关描述,为了简洁,在此不再赘述。
上述详细阐述了本申请实施例的方法,为了便于更好的实施本申请实施例的上述方案,相应地,下面还提供用于配合实施上述方案的相关装置。
参见图9,图9是本申请实施例提供的一种计算设备的结构示意图,该计算设备可以是上述图5所述的方法实施例中的服务器,可以执行图5所述的多物理设备绑定虚拟设备的方法实施例中以服务器为执行主体的方法和步骤。如图9所示,该计算设备900包括创建单元910和处理单元920。其中,
创建单元910,用于基于多个物理设备创建多个物理设备集合,其中,所述多个物理设备集合中的至少两个物理设备集合包括同一个物理设备;
所述创建单元910,还用于针对所述多个物理设备集合中的任意一个物理设备集合创建一个或多个与所述物理设备集合对应的虚拟设备;
处理单元920,用于利用所述虚拟设备接收业务应用下发的数据。
具体地,所述创建单元910用于执行前述步骤S501和步骤S502,且可选的执行前述步骤中可选的方法,所述处理单元920用于执行前述步骤S503,且可选的执行前述步骤中可选的方法。上述两个单元之间互相可以通过通信通路进行数据传输,应理解,计算设备900包括的各单元可以为软件单元、也可以为硬件单元、或部分为软件单元部分为硬件单元。
作为一个实施例,所述计算设备900还包括接收单元930,所述接收单元930,用于提供输入接口;所述创建单元910,还用于根据所述创建参数创建多个物理设备集合。
作为一个实施例,所述创建单元910,具体用于:基于第一物理设备和第二物理设备创建第一物理设备集合和第二物理设备集合,所述第一物理设备集合和所述第二物理设备集合包括一个主设备和至少一个备设备,其中,所述第一物理设备集合的主设备为所述第一物理设备,所述第二物理设备集合的主设备为所述第二物理设备。
作为一个实施例,所述创建单元910,还用于基于第一物理设备集合创建第一虚拟设备;所述处理单元920,还用于在所述第一物理设备的业务流量超过第一预设阈值时,调整所述第一虚拟设备与所述第一物理设备集合的对应关系,以使所述第一虚拟设备对应所述第二物理设备集合。
作为一个实施例,所述第一物理设备集合包括所述第一物理设备和所述第二物理设备,所述处理单元920,还用于在所述第一物理设备的业务流量超过第二预设阈值时,调整所述业务流量的流向,以使所述第一物理设备集合通过所述第二物理设备下发所述业务流量。
作为一个实施例,所述处理单元920,还用于根据业务应用和所述多个物理设备集合中的任意一个物理设备集合中的各个备设备之间的亲和性对各个备设备成为主设备的优先级进行设置。
作为一个实施例,所述处理单元920,具体用于:根据业务应用所对应的处理器与所述各个备设备之间的连接关系对所述各个备设备成为主设备的优先级进行设置;或者,根据所述各个备设备的可用资源大小对所述各个备设备成为主设备的优先级进行设置;或者,根据所述各个备设备升级为主设备所消耗的资源大小对所述各个备设备成为主设备的优先级进行设置。
作为一个实施例,所述接收单元930,还用于接收所述业务应用下发的测试信息,所述测试信息用于测试与所述多个物理设备集合对应的虚拟设备的处理时延;所述处理单元920,还用于确定 与所述多个物理设备集合对应的虚拟设备的处理时延,并选择最小处理时延所对应的虚拟设备接收所述业务应用下发的数据。
作为一个实施例,所述处理单元920,还用于对所述一个或多个与所述多个物理设备集合中的任意一个物理设备集合对应的虚拟设备的优先级进行设置,以使所述一个或多个与所述多个物理设备集合中的任意一个物理设备集合对应的虚拟设备按照设置的优先级使用资源。
应理解,上述计算设备的结构仅仅作为一种示例,不应构成具体限定,可以根据需要对计算设备的各个单元进行增加、减少或合并。此外,计算设备中的各个单元的操作和/或功能分别为了实现上述图5所描述的方法的相应流程,为了简洁,在此不再赘述。
参见图10,图10是本申请实施例提供的又一种计算设备的结构示意图。如图10所示,该计算设备10包括:处理器11、通信接口12以及存储器13,所述处理器11、通信接口12以及存储器13通过内部总线14相互连接。
所述计算设备10可以是图5所述方法实施例中的服务器。图5所述的方法实施例中的服务器所执行的功能实际上是由所述服务器的处理器11来执行。
所述处理器11可以由一个或者多个通用处理器构成,例如中央处理器(central processing unit,CPU),或者CPU和硬件芯片的组合。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC)、可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD)、现场可编程逻辑门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合。
总线14可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线14可以分为地址总线、数据总线、控制总线等。为便于表示,图10中仅用一条粗线表示,但不表示仅有一根总线或一种类型的总线。
存储器13可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM);存储器13也可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM)、快闪存储器(flash memory)、硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD);存储器13还可以包括上述种类的组合。程序代码可以是用来实现计算设备900所示的功能单元,或者用于实现图5所示的方法实施例中以服务器为执行主体的方法步骤。
本申请实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时,可以实现上述方法实施例中记载的任意一种的部分或全部步骤,以及实现上述图9所描述的任意一个功能单元的功能。
本申请实施例还提供了一种计算机程序产品,当其在计算机或处理器上运行时,使得计算机或处理器执行上述任一个方法中的一个或多个步骤。上述所涉及的设备的各组成单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在所述计算机可读取存储介质中。
在上述实施例中,对各个实施例的描述各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。
还应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (20)

  1. 一种多物理设备绑定虚拟设备的方法,其特征在于,包括:
    基于多个物理设备创建多个物理设备集合,其中,所述多个物理设备集合中的至少两个物理设备集合包括同一个物理设备;
    针对所述多个物理设备集合中的任意一个物理设备集合创建一个或多个与所述物理设备集合对应的虚拟设备;
    利用所述虚拟设备接收业务应用下发的数据。
  2. 如权利要求1所述的方法,其特征在于,在基于多个物理设备创建多个物理设备集合之前,所述方法还包括:
    提供输入接口,所述输入接口用于提示用户输入物理设备集合的创建参数;
    通过所述输入接口获取所述创建参数;
    所述基于多个物理设备创建多个物理设备集合,包括:
    根据所述创建参数创建多个物理设备集合。
  3. 如权利要求1或2所述的方法,其特征在于,所述基于所述多个物理设备创建多个物理设备集合包括:
    基于第一物理设备和第二物理设备创建第一物理设备集合和第二物理设备集合,所述第一物理设备集合和所述第二物理设备集合分别包括一个主设备和至少一个备设备,其中,所述第一物理设备集合的主设备为所述第一物理设备,所述第二物理设备集合的主设备为所述第二物理设备。
  4. 如权利要求3所述的方法,其特征在于,针对所述多个物理设备集合中的任意一个物理设备集合创建一个或多个与所述物理设备集合对应的虚拟设备包括:
    基于第一物理设备集合创建第一虚拟设备;
    在创建所述第一虚拟设备之后,所述方法还包括:
    若所述第一物理设备的业务流量超过第一预设阈值,调整所述第一虚拟设备与所述第一物理设备集合的对应关系,以使所述第一虚拟设备对应所述第二物理设备集合。
  5. 如权利要求3所述的方法,其特征在于,所述方法还包括:
    所述第一物理设备集合包括所述第一物理设备和所述第二物理设备;
    若所述第一物理设备的业务流量超过第二预设阈值,调整所述业务流量的流向,以使所述第一物理设备集合通过所述第二物理设备下发所述业务流量。
  6. 如权利要求4或5所述的方法,其特征在于,在基于多个物理设备创建多个物理设备集合之后,所述方法还包括:
    对于所述多个物理设备集合中的任意一个物理设备集合,根据业务应用和所述多个物理设备集合中的任意一个物理设备集合中的各个备设备之间的亲和性对各个备设备成为主设备的优先级进行设置。
  7. 如权利要求6所述的方法,其特征在于,根据业务应用和所述多个物理设备集合中的任意一个物理设备集合中的各个备设备之间的亲和性对备设备成为主设备的优先级进行设置,包括:
    根据业务应用所对应的处理器与所述各个备设备之间的连接关系对所述各个备设备成为主设备的优先级进行设置;或者,
    根据所述各个备设备的可用资源大小对所述各个备设备成为主设备的优先级进行设置;或者,
    根据所述各个备设备升级为主设备所消耗的资源大小对所述各个备设备成为主设备的优先级进行设置。
  8. 如权利要求1-7任一项所述的方法,其特征在于,在利用虚拟设备接收业务应用下发的数据之前,所述方法还包括:
    接收所述业务应用下发的测试信息,所述测试信息用于测试与所述多个物理设备集合对应的虚拟设备的处理时延;
    确定与所述多个物理设备集合对应的虚拟设备的处理时延,并选择最小处理时延所对应的虚拟设备接收所述业务应用下发的数据。
  9. 如权利要求1-8任一项所述的方法,其特征在于,在针对所述多个物理设备集合中的任意一个物理设备集合创建一个或多个与所述物理设备集合对应的虚拟设备之后,所述方法还包括:
    对所述一个或多个与所述多个物理设备集合中的任意一个物理设备集合对应的虚拟设备的优先级进行设置,以使所述一个或多个与所述多个物理设备集合中的任意一个物理设备集合对应的虚拟设备按照设置的优先级使用资源。
  10. 一种计算设备,其特征在于,包括:
    创建单元,用于基于多个物理设备创建多个物理设备集合,其中,所述多个物理设备集合中的至少两个物理设备集合包括同一个物理设备;
    所述创建单元,还用于针对所述多个物理设备集合中的任意一个物理设备集合创建一个或多个与所述物理设备集合对应的虚拟设备;
    处理单元,用于利用所述虚拟设备接收业务应用下发的数据。
  11. 如权利要求10所述的计算设备,其特征在于,所述计算设备还包括接收单元,
    所述接收单元,用于提供输入接口,所述输入接口用于提示用户输入物理设备集合的创建参数;
    所述创建单元,还用于根据所述创建参数创建多个物理设备集合。
  12. 如权利要求10或11所述的计算设备,其特征在于,所述创建单元,具体用于:
    基于第一物理设备和第二物理设备创建第一物理设备集合和第二物理设备集合,所述第一物理设备集合和所述第二物理设备集合分别包括一个主设备和至少一个备设备,其中,所述第一物理设备集合的主设备为所述第一物理设备,所述第二物理设备集合的主设备为所述第二物理设备。
  13. 如权利要求12所述的计算设备,其特征在于,
    所述创建单元,还用于基于第一物理设备集合创建第一虚拟设备;
    所述处理单元,还用于在所述第一物理设备的业务流量超过第一预设阈值时,调整所述第一虚拟设备与所述第一物理设备集合的对应关系,以使所述第一虚拟设备对应所述第二物理设备集合。
  14. 如权利要求12所述的计算设备,其特征在于,所述第一物理设备集合包括所述第一物理设备和所述第二物理设备,
    所述处理单元,还用于在所述第一物理设备的业务流量超过第二预设阈值时,调整所述业务流量的流向,以使所述第一物理设备集合通过所述第二物理设备下发所述业务流量。
  15. 如权利要求10-14任一项所述的计算设备,其特征在于,
    所述处理单元,还用于根据业务应用和所述多个物理设备集合中的任意一个物理设备集合中的各个备设备之间的亲和性对各个备设备成为主设备的优先级进行设置。
  16. 如权利要求15所述的计算设备,其特征在于,所述处理单元,具体用于:
    根据业务应用所对应的处理器与所述各个备设备之间的连接关系对所述各个备设备成为主设备的优先级进行设置;或者,
    根据所述各个备设备的可用资源大小对所述各个备设备成为主设备的优先级进行设置;或者,
    根据所述各个备设备升级为主设备所消耗的资源大小对所述各个备设备成为主设备的优先级进行设置。
  17. 如权利要求9-16任一项所述的计算设备,其特征在于,
    所述接收单元,还用于接收所述业务应用下发的测试信息,所述测试信息用于测试与所述多个物理设备集合对应的虚拟设备的处理时延;
    所述处理单元,还用于确定与所述多个物理设备集合对应的虚拟设备的处理时延,并选择最小处理时延所对应的虚拟设备接收所述业务应用下发的数据。
  18. 如权利要求9-17任一项所述的计算设备,其特征在于,
    所述处理单元,还用于对所述一个或多个与所述多个物理设备集合中的任意一个物理设备集合对应的虚拟设备的优先级进行设置,以使所述一个或多个与所述多个物理设备集合中的任意一个物理设备集合对应的虚拟设备按照设置的优先级使用资源。
  19. 一种计算设备,其特征在于,所述计算设备包括存储器和处理器,所述处理器执行所述存储器中存储的计算机指令,使得所述计算设备执行权利要求1-9任一项所述的方法。
  20. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,当所述计算机程序被处理器执行时实现权利要求1-9任一项所述的方法的功能。
PCT/CN2021/102751 2020-08-03 2021-06-28 一种多物理设备绑定虚拟设备的方法、系统及相关设备 WO2022028149A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21854562.2A EP4187384A4 (en) 2020-08-03 2021-06-28 METHOD AND SYSTEM FOR BINDING MULTIPLE PHYSICAL DEVICES AS A VIRTUAL DEVICE AND ASSOCIATED DEVICE
US18/163,483 US20230205597A1 (en) 2020-08-03 2023-02-02 Method for Bonding Plurality of Physical Devices into Virtual Device, System, and Related Device

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202010769410 2020-08-03
CN202010769410.8 2020-08-03
CN202011308800.1 2020-11-20
CN202011308800.1A CN114064263A (zh) 2020-08-03 2020-11-20 一种多物理设备绑定虚拟设备的方法、系统及相关设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/163,483 Continuation US20230205597A1 (en) 2020-08-03 2023-02-02 Method for Bonding Plurality of Physical Devices into Virtual Device, System, and Related Device

Publications (1)

Publication Number Publication Date
WO2022028149A1 true WO2022028149A1 (zh) 2022-02-10

Family

ID=80116889

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/102751 WO2022028149A1 (zh) 2020-08-03 2021-06-28 一种多物理设备绑定虚拟设备的方法、系统及相关设备

Country Status (3)

Country Link
US (1) US20230205597A1 (zh)
EP (1) EP4187384A4 (zh)
WO (1) WO2022028149A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114584423A (zh) * 2022-03-15 2022-06-03 联想(北京)有限公司 基于虚拟绑定网卡的通信方法及装置
CN115996228A (zh) * 2023-03-22 2023-04-21 睿至科技集团有限公司 一种基于物联网的能源数据的处理方法及其系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102137169A (zh) * 2011-01-30 2011-07-27 华为技术有限公司 一种绑定物理网口的方法、网卡及通信系统
CN103164255A (zh) * 2013-03-04 2013-06-19 华为技术有限公司 虚拟机网络通信实现方法和虚拟机监控器以及物理主机
US20140233370A1 (en) * 2013-02-21 2014-08-21 Oracle International Corporation Method and system for virtual network interface cards (vnics) over aggregation spanning multiple switches
CN109510722A (zh) * 2018-11-16 2019-03-22 郑州云海信息技术有限公司 一种自动配置分布式存储节点网卡绑定的方法及装置
CN111431980A (zh) * 2020-03-17 2020-07-17 星辰天合(北京)数据科技有限公司 分布式存储系统及其路径切换方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7586842B2 (en) * 2006-05-19 2009-09-08 Hewlett-Packard Development Company, L.P. Failover of multicast traffic flows using NIC teaming
US7590886B2 (en) * 2006-11-21 2009-09-15 General Instruments, Corporation Method and apparatus for facilitating device redundancy in a fault-tolerant system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102137169A (zh) * 2011-01-30 2011-07-27 华为技术有限公司 一种绑定物理网口的方法、网卡及通信系统
US20140233370A1 (en) * 2013-02-21 2014-08-21 Oracle International Corporation Method and system for virtual network interface cards (vnics) over aggregation spanning multiple switches
CN103164255A (zh) * 2013-03-04 2013-06-19 华为技术有限公司 虚拟机网络通信实现方法和虚拟机监控器以及物理主机
CN109510722A (zh) * 2018-11-16 2019-03-22 郑州云海信息技术有限公司 一种自动配置分布式存储节点网卡绑定的方法及装置
CN111431980A (zh) * 2020-03-17 2020-07-17 星辰天合(北京)数据科技有限公司 分布式存储系统及其路径切换方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114584423A (zh) * 2022-03-15 2022-06-03 联想(北京)有限公司 基于虚拟绑定网卡的通信方法及装置
CN115996228A (zh) * 2023-03-22 2023-04-21 睿至科技集团有限公司 一种基于物联网的能源数据的处理方法及其系统

Also Published As

Publication number Publication date
EP4187384A1 (en) 2023-05-31
US20230205597A1 (en) 2023-06-29
EP4187384A4 (en) 2023-11-15

Similar Documents

Publication Publication Date Title
CN110312999B (zh) 基于软件配置/策略分发的PCIe盘阵列的动态划分
US10171567B2 (en) Load balancing computer device, system, and method
US20230205597A1 (en) Method for Bonding Plurality of Physical Devices into Virtual Device, System, and Related Device
JP6600373B2 (ja) トラフィックディレクタ環境におけるトラフィックのアクティブ−パッシブルーティングおよび制御のためのシステムおよび方法
US8880935B2 (en) Redundancy and load balancing in remote direct memory access communications
US10387358B2 (en) Multi-PCIe socket NIC OS interface
US10025740B2 (en) Systems and methods for offloading link aggregation to a host bus adapter (HBA) in single root I/O virtualization (SRIOV) mode
CN106557444B (zh) 实现sr-iov网卡的方法和装置、实现动态迁移的方法和装置
WO2016154222A1 (en) Technique for achieving low latency in data center network environments
CN108632155B (zh) 云平台流量调度方法和系统、计算机可读的存储介质
US10243799B2 (en) Method, apparatus and system for virtualizing a policy and charging rules function
EP3618350A1 (en) Protection switching method, device and system
WO2020252724A1 (zh) 日志处理方法、设备及计算机可读存储介质
CN113709220A (zh) 虚拟负载均衡器的高可用实现方法、系统及电子设备
CN111580753B (zh) 存储卷级联系统、批量作业处理系统和电子设备
CN113254205A (zh) 负载均衡系统、方法、装置、电子设备及存储介质
CN117130723A (zh) 分配信息的确定方法、装置、计算机设备和存储介质
CN114064263A (zh) 一种多物理设备绑定虚拟设备的方法、系统及相关设备
CN116204448A (zh) 一种多端口固态硬盘及其控制方法、装置、介质、服务器
CN117978758B (zh) 用于数据处理单元的适配方法、计算机设备及介质
CN117499293B (zh) 路由表维护方法、路径选择方法、设备、系统及存储介质
CN115484212B (zh) VF的QoS调整方法、装置及电子设备
CN117579557A (zh) 基于dpdk和多网卡的网络负载均衡控制方法及装置
US11742998B2 (en) Review and retry for minimum speed port channel
WO2022193885A1 (zh) 一种用户上线的处理方法以及相关装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21854562

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021854562

Country of ref document: EP

Effective date: 20230222

NENP Non-entry into the national phase

Ref country code: DE