Connection establishment method and apparatus, electronic device, and storage medium

By dividing global connection resources into oversubscribed and non-oversubscribed resource pools and allocating connection resources according to virtual network interface card type, the problem of virtual machines preempting connection resources is solved, and the connection establishment success rate and resource utilization efficiency are improved.

CN115269112BActive Publication Date: 2025-12-19BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210730356.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-24
Publication Date
2025-12-19
Estimated Expiration
2042-06-24

AI Technical Summary

Technical Problem

In cloud computing scenarios, the connection resources of virtual machines may be occupied by one or more virtual machines, preventing other virtual machines from establishing connections and causing business interruptions.

Method used

Global connection resources are divided into at least two resource pools: an oversubscribed resource pool and a non-oversubscribed resource pool. Connection resources are allocated from the corresponding resource pool according to the type of virtual network interface card (NIC), and the number of virtual connections that each NIC can establish is limited to ensure the isolation and reasonable allocation of connection resources.

Benefits of technology

It improves the overall success rate of connection establishment, avoids the problem of virtual machines preempting global connection resources, and supports different scenarios such as overselling, non-overselling, and sharing, maximizing the utilization of host machine resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269112B_ABST
    Figure CN115269112B_ABST
Patent Text Reader

Abstract

The disclosure provides a connection establishment method and device, electronic equipment and storage medium, relates to the field of artificial intelligence such as cloud computing and cloud network, and can be applied to intelligent cloud and local computing cluster scenarios. The method can include: obtaining a connection establishment request from a virtual network card; determining the type of the virtual network card; allocating connection resources for the virtual network card from a resource pool corresponding to the type, wherein the global connection resources are divided into at least two resource pools; and completing the establishment of the requested connection based on the allocated connection resources. By applying the scheme, the overall success rate of connection establishment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the field of artificial intelligence, in particular to a connection establishment method and device, electronic equipment and storage medium in the field of cloud computing and cloud network. BACKGROUND

[0002] Connection is the basic data channel of network communication, and almost all network-related business scenarios need to establish connection to transmit business data.

[0003] In cloud computing and other scenarios, multiple virtual machines can be created on a host machine, and the communication of the virtual machines depends on the connection established with external nodes. The virtual switch on the host machine can undertake the maintenance work of the external connection of each virtual machine, including connection establishment. SUMMARY

[0004] The present disclosure provides a connection establishment method, device, electronic equipment and storage medium.

[0005] A connection establishment method comprises:

[0006] obtaining a connection establishment request from a virtual network card;

[0007] determining the type of the virtual network card;

[0008] allocating connection resources for the virtual network card from a resource pool corresponding to the type, wherein the global connection resources are divided into at least two resource pools;

[0009] establishing the requested connection based on the allocated connection resources.

[0010] A connection establishment device comprises an obtaining module, a determining module, an allocating module and an establishing module.

[0011] The obtaining module is configured to obtain a connection establishment request from a virtual network card;

[0012] The determining module is configured to determine the type of the virtual network card;

[0013] The allocating module is configured to allocate connection resources for the virtual network card from a resource pool corresponding to the type, wherein the global connection resources are divided into at least two resource pools;

[0014] The establishing module is configured to establish the requested connection based on the allocated connection resources.

[0015] An electronic equipment comprises:

[0016] at least one processor; and

[0017] a memory connected with the at least one processor in communication; wherein,

[0018] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as described above.

[0019] A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method as described above.

[0020] A computer program product comprising computer programs / instructions which, when executed by a processor, implement the method as described above.

[0021] It should be understood that the contents described in this part are not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0022] The accompanying drawings are used to better understand the present scheme, and do not constitute a limitation on the present disclosure. Among them:

[0023] Figure 1 a flowchart of the connection establishment method embodiment of the present disclosure;

[0024] Figure 2 a connection resource allocation manner schematic diagram of the present disclosure;

[0025] Figure 3 for Figure 2 a connection resource usage situation schematic diagram of the virtual machine 3 and the virtual machine 4 shown;

[0026] Figure 4 a component structure schematic diagram of the connection establishment device embodiment 400 of the present disclosure;

[0027] Figure 5 A schematic block diagram of an electronic device 500 that can be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0028] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to help in understanding, and should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, in order to be clear and concise, descriptions of well-known functions and structures are omitted in the following description.

[0029] In addition, it should be understood that the term "and / or" herein is merely an association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after it.

[0030] Figure 1 The flowchart of the connection establishment method embodiment of the present disclosure is shown in FIG. 1. Figure 1 The specific implementation is as follows.

[0031] In step 101, a connection establishment request from a virtual network card is obtained.

[0032] In step 102, the type of the virtual network card is determined.

[0033] In step 103, connection resources are allocated to the virtual network card from a resource pool corresponding to the type, wherein the global connection resources are divided into at least two resource pools.

[0034] In step 104, the establishment of the requested connection is completed based on the allocated connection resources.

[0035] In the conventional manner, for a virtual machine on a host machine, any number of connections can be established, i.e., a connection attack can be initiated, thereby causing one or more virtual machines to occupy a large number or even all of the global connection resources (also referred to as whole-machine connection resources, i.e., all available connection resources), and further causing other virtual machines to be unable to normally establish connections, resulting in service interruption, etc.

[0036] With the above method embodiment, for a virtual network card that initiates a connection establishment request, connection resources can be allocated to it from a corresponding resource pool according to the type of the virtual network card, thereby achieving isolation of connection resources and avoiding the above problems as much as possible, and further improving the overall success rate of connection establishment, etc.

[0037] The connection established in the present disclosure refers to a virtual connection, which is the same as an ordinary connection, i.e., a data path between two ports established with an Internet Control Message Protocol (ICMP) or a Transmission Control Protocol (TCP) five-tuple as a key. In the present disclosure, connection resources can be limited, i.e., the number of virtual connections that can be established by each virtual network card can be limited. Each virtual machine can correspond to one or more virtual network cards.

[0038] In actual applications, Figure 1The execution subject of the illustrated embodiment can be a virtual switch on a certain host computer, and the virtual network card initiating the connection establishment request can be a virtual network card corresponding to any virtual machine on the host computer.

[0039] After obtaining the connection establishment request issued by any virtual network card, the type of the virtual network card can be determined first, and then connection resources can be allocated to the virtual network card from the resource pool corresponding to the type, wherein the global connection resources are divided into at least two resource pools, and then the establishment of the requested connection can be completed based on the allocated connection resources.

[0040] In one embodiment of the present disclosure, the type of the virtual network card can include a super sale type, and accordingly, allocating connection resources to the virtual network card from the resource pool corresponding to the type can include performing the following first processing: in response to determining that the number of connections established for the virtual network card is less than the maximum quota of the virtual network card, and there is available connection resource in the super sale resource pool corresponding to the super sale type, allocating connection resources to the virtual network card from the available connection resources, wherein the sum of the maximum quotas of each virtual network card belonging to the super sale type is greater than the number of connection resources in the super sale resource pool, and each connection can correspond to a connection resource respectively.

[0041] Preferably, the global connection resources can be divided into two resource pools, namely a super sale resource pool and a non-super sale resource pool, corresponding to the scenario of connection surge and the scenario of fixed connection guarantee respectively, and the number of connection resources in each resource pool can be determined according to actual needs.

[0042] The type of each virtual network card can be pre-set respectively, and at the same time, the maximum quota and the minimum quota of each virtual network card of the super sale type can also be pre-set respectively.

[0043] Accordingly, in one embodiment of the present disclosure, before performing the first processing, in response to determining that the number of connections established for the virtual network card is less than the minimum quota of the virtual network card, connection resources can be allocated to the virtual network card from a reserved resource sub-pool in the super sale resource pool, and the super sale resource pool is composed of the reserved resource sub-pool and a competitive resource sub-pool, the number of connection resources in the reserved resource sub-pool is equal to the sum of the minimum quotas of each virtual network card belonging to the super sale type, and the number of connection resources in the competitive resource sub-pool is equal to the number of connection resources in the super sale resource pool minus the number of connection resources in the reserved resource sub-pool.

[0044] Accordingly, in one embodiment of the present disclosure, there being available connection resources in the super sale resource pool can include there being remaining connection resources in the competitive resource sub-pool, and allocating connection resources to the virtual network card from the available connection resources can include allocating connection resources to the virtual network card from the remaining connection resources.

[0045] That is, the virtual network cards of each oversell type have their own minimum quota and maximum quota, and the minimum quotas of any two virtual network cards can be the same or different, and similarly, the maximum quotas can be the same or different.

[0046] The oversell resource pool can be further divided into a reserved resource sub-pool and a competitive resource sub-pool, where the number of connection resources in the reserved resource sub-pool is equal to the sum of the minimum quotas of the virtual network cards belonging to the oversell type, and the number of connection resources in the competitive resource sub-pool is equal to the number of connection resources in the oversell resource pool minus the number of connection resources in the reserved resource sub-pool.

[0047] By setting the reserved resource sub-pool, the minimum quota of the virtual network card can be guaranteed, that is, at least allowing it to establish a minimum quota number of connections, thereby ensuring the normal operation of its basic business, etc.

[0048] When the number of connections established by the virtual network card is greater than the minimum quota, it will participate in competition to compete for connection resources in the competitive resource sub-pool, and by setting the maximum quota, it can avoid a single virtual network card occupying too many connection resources, thereby affecting the connection establishment of other virtual network cards.

[0049] In addition, the sum of the maximum quotas of the virtual network cards of each oversell type is greater than the number of connection resources in the oversell resource pool, thereby achieving the purpose of oversell, so that the connection surge of the virtual network card can be coped with.

[0050] In an embodiment of the present disclosure, the type of the virtual network card can also include a non-oversell type, and accordingly, the step of allocating connection resources to the virtual network card from the resource pool corresponding to the type can include: in response to determining that there is remaining connection resource in the resource sub-pool corresponding to the virtual network card in the non-oversell resource pool corresponding to the non-oversell type, allocating connection resources to the virtual network card from the remaining connection resources; the non-oversell resource pool is composed of M resource sub-pools, and the value of M is equal to the number of virtual network cards belonging to the non-oversell type, and each resource sub-pool corresponds to a virtual network card.

[0051] For example, if the value of M is 2, then the non-oversell resource pool can be divided into 2 resource sub-pools, and each resource sub-pool corresponds to a virtual network card of the non-oversell type. In this way, for any virtual network card of the non-oversell type, when a connection needs to be established, it can be directly determined whether there is remaining connection resource in the resource sub-pool corresponding to it, and if so, it can be allocated connection resources from the remaining connection resources.

[0052] That is, the connection resources in each resource sub-pool are exclusive connection resources for the corresponding virtual network card, thereby ensuring the normal establishment of the connection of the corresponding virtual network card.

[0053] In one embodiment of the present disclosure, the virtual network card initiating the connection establishment request can include: a unique virtual network card corresponding to any virtual machine, and a master network card in N virtual network cards corresponding to any virtual machine, N being a positive integer greater than one, and the virtual network cards other than the master network card in the N virtual network cards being slave network cards, which can share the connection resources of the master network card.

[0054] Generally, one virtual machine corresponds to one virtual network card, but in the scenario of a flexible network card, one virtual machine can correspond to multiple virtual network cards, and accordingly, one of the virtual network cards can be configured as a master network card and the other virtual network cards can be configured as slave network cards, which can share the connection resources of the master network card, that is, multiple virtual network cards can share the same connection resources.

[0055] Through the above processing, the scheme of the present disclosure is applicable to various scenarios, that is, it has universal applicability.

[0056] In combination with the above introduction, Figure 2 a connection resource allocation mode of the present disclosure is shown.

[0057] As Figure 2 shown, it is assumed that the number of global connection resources is 100, which is divided into two parts, one part corresponds to the oversold resource pool, and it is assumed that the number of connection resources included therein is 20, and the other part corresponds to the non-oversold resource pool, and the number of connection resources included therein is 80.

[0058] As Figure 2 shown, it is assumed that the types of the virtual network cards corresponding to virtual machine 1 and virtual machine 2 are oversold types, and the minimum quotas are 1 and 15, respectively, and the maximum quotas are 15 and 15, respectively, 15+15>20, and accordingly, the number of connection resources in the reserved resource sub-pool in the oversold resource pool can be 2, and the number of connection resources in the competitive resource sub-pool can be 18.

[0059] In addition, taking virtual machine 1 as an example, it is assumed that the virtual network card corresponding thereto is virtual network card 1, if a connection establishment request from virtual network card 1 is obtained, then it can be first determined that the type of virtual network card 1 is an oversold type, and then it can be determined whether the number of connections established for virtual network card 1 is less than the minimum quota 1, if yes, then connection resources can be allocated to virtual network card 1 from the reserved resource sub-pool, otherwise, it can be further determined whether the following conditions are met: the number of connections established for virtual network card 1 is less than the maximum quota 15 of virtual network card 1, and there are remaining connection resources in the competitive resource sub-pool, if yes, then connection resources can be allocated to virtual network card 1 from the remaining connection resources in the competitive resource sub-pool, otherwise, a connection establishment failure information can be returned to virtual network card 1.

[0060] In actual application, when the virtual network card 1 fails to be established, the subsequent processing is not limited, for example, the virtual network card 1 can be directly ended, or the virtual network card 1 can be processed as a non-over-sold type.

[0061] As shown in Figure 2 , it is assumed that the types of the virtual network cards corresponding to the virtual machine 3 and the virtual machine 4 are non-over-sold types, wherein the number of connection resources in the resource sub-pool corresponding to the virtual machine 3 is 30, the number of connection resources in the resource sub-pool corresponding to the virtual machine 4 is 80, and 30+50=80.

[0062] Taking the virtual machine 3 as an example, it is assumed that the virtual network card corresponding to the virtual machine 3 is the virtual network card 3, if the connection establishment request from the virtual network card 3 is obtained, it can be determined that the type of the virtual network card 3 is a non-over-sold type, and then it can be determined whether there is a remaining connection resource in the resource sub-pool corresponding to the virtual network card 3, if yes, the connection resource can be allocated to the virtual network card 3 from the remaining connection resource, otherwise, the establishment failure information can be returned to the virtual network card 3.

[0063] In addition, as shown in Figure 2 , it is assumed that the virtual machine 4 corresponds to two virtual network cards, one of which is a master network card and the other is a slave network card, and the slave network card and the master network card can share the connection resources.

[0064] Figure 3 The connection resource usage situation diagram of the virtual machine 3 and the virtual machine 4 is shown in Figure 2 . As shown in Figure 3 , the two virtual machines correspond to respective resource sub-pools, and use the connection resources in the respective resource sub-pools to establish connections, and are isolated from each other and do not interfere with each other.

[0065] It should be noted that, for the foregoing method embodiments, in order to simply describe, it is expressed as a series of action combinations, but those skilled in the art should know that the present disclosure is not limited by the action sequence described, because according to the present disclosure, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

[0066] In addition, the specific values of each parameter involved in the above introduction, such as the size of each resource pool, the size of each resource sub-pool, the maximum quota and the minimum quota, etc. can be determined according to actual needs.

[0067] In summary, the scheme described in the method embodiments of the present disclosure can realize isolation of connection resources, thereby avoiding the problem of one or several virtual network cards occupying most or even all global connection resources as much as possible, and further improving the overall success rate of connection establishment. Moreover, the scheme supports different scenarios such as overselling, non-overselling, and sharing, has wide applicability, and can maximize the use of host resources.

[0068] The above is an introduction to the method embodiments. The scheme described in the present disclosure will be further described through device embodiments.

[0069] Figure 4 A schematic diagram of the constituent structure of the connection establishment device embodiment 400 of the present disclosure is shown in FIG. 4. As shown in FIG. 4, the device includes an acquisition module 401, a determination module 402, an allocation module 403, and an establishment module 404. Figure 4

[0070] The acquisition module 401 is configured to acquire a connection establishment request from a virtual network card.

[0071] The determination module 402 is configured to determine the type of the virtual network card.

[0072] The allocation module 403 is configured to allocate connection resources for the virtual network card from a resource pool corresponding to the type, wherein the global connection resources are divided into at least two resource pools.

[0073] The establishment module 404 is configured to complete the establishment of the requested connection based on the allocated connection resources.

[0074] The scheme described in the above device embodiments can allocate connection resources for a virtual network card that initiates a connection establishment request from a corresponding resource pool according to the type of the virtual network card, thereby realizing isolation of connection resources and further improving the overall success rate of connection establishment.

[0075] In one embodiment of the present disclosure, the type of the virtual network card can include an overselling type. Correspondingly, the allocation module 403 allocating connection resources for the virtual network card from a resource pool corresponding to the type can include performing the following first processing: in response to determining that the number of connections established for the virtual network card is less than the maximum quota of the virtual network card, and there is available connection resource in an overselling resource pool corresponding to the overselling type, allocating connection resources for the virtual network card from the available connection resources, wherein the sum of the maximum quotas of each virtual network card belonging to the overselling type is greater than the number of connection resources in the overselling resource pool, and each connection can correspond to one connection resource.

[0076] ​Preferably, the global connection resources can be divided into two resource pools, i.e., a super sale resource pool and a non-super sale resource pool, corresponding to the connection surge scenario and the fixed connection guarantee scenario respectively, and the number of connection resources in each resource pool can be determined according to actual needs.

[0077] The types of the virtual network cards can be pre-configured respectively, and the maximum quota and the minimum quota of each virtual network card of the super sale type can also be pre-configured respectively.

[0078] Correspondingly, in one embodiment of the present disclosure, the allocation module 403 can allocate connection resources for the virtual network card from the reserved resource sub-pool in the super sale resource pool in response to determining that the number of connections established for the virtual network card is less than the minimum quota of the virtual network card before performing the first processing, the super sale resource pool is composed of the reserved resource sub-pool and the competitive resource sub-pool, the number of connection resources in the reserved resource sub-pool is equal to the sum of the minimum quotas of the virtual network cards of the super sale type, and the number of connection resources in the competitive resource sub-pool is equal to the number of connection resources in the super sale resource pool minus the number of connection resources in the reserved resource sub-pool.

[0079] Correspondingly, in one embodiment of the present disclosure, the existence of available connection resources in the super sale resource pool can include the existence of remaining connection resources in the competitive resource sub-pool, and the allocation of connection resources for the virtual network card from the available connection resources can include the allocation of connection resources for the virtual network card from the remaining connection resources.

[0080] That is, the virtual network cards of each super sale type have their own minimum quota and maximum quota respectively, and the minimum quotas of any two virtual network cards can be the same or different, and the maximum quotas of any two virtual network cards can also be the same or different.

[0081] The super sale resource pool can be further divided into a reserved resource sub-pool and a competitive resource sub-pool, wherein the number of connection resources in the reserved resource sub-pool is equal to the sum of the minimum quotas of the virtual network cards of the super sale type, and the number of connection resources in the competitive resource sub-pool is equal to the number of connection resources in the super sale resource pool minus the number of connection resources in the reserved resource sub-pool. When the number of connections established for the virtual network card is greater than the minimum quota, the virtual network card will participate in the competition to compete for the connection resources in the competitive resource sub-pool.

[0082] In one embodiment of the present disclosure, the type of the virtual network card can also include a non-super sale type, and correspondingly, the allocation of connection resources for the virtual network card from the resource pool corresponding to the type by the allocation module 403 can include the allocation of connection resources for the virtual network card from the remaining connection resources in response to determining that there are remaining connection resources in the resource sub-pool corresponding to the virtual network card in the non-super sale resource pool corresponding to the non-super sale type, and the non-super sale resource pool is composed of M resource sub-pools, the value of M is equal to the number of virtual network cards of the non-super sale type, and each resource sub-pool corresponds to one virtual network card.

[0083] For example, if M is 2, then the non-overbooking resource pool can be divided into two resource sub-pools, each of which corresponds to a non-overbooking type of virtual network card. In this way, for any non-overbooking type of virtual network card, when a connection needs to be established, it can be directly determined whether there is a remaining connection resource in the corresponding resource sub-pool. If so, the connection resource can be allocated from the remaining connection resource.

[0084] In an embodiment of the present disclosure, the virtual network card initiating the connection establishment request can include a unique virtual network card corresponding to any virtual machine, and a master network card in N virtual network cards corresponding to any virtual machine, N being a positive integer greater than one. The virtual network cards other than the master network card in the N virtual network cards are slave network cards, which can share the connection resources of the master network card.

[0085] Generally, one virtual machine corresponds to one virtual network card, but in the scenario of elastic network cards, one virtual machine can correspond to multiple virtual network cards. Correspondingly, one of the virtual network cards can be configured as a master network card, and the other virtual network cards can be configured as slave network cards, which can share the connection resources of the master network card, i.e., multiple virtual network cards can share the same connection resources.

[0086] Figure 4 The specific working process of the device embodiment can refer to the related description in the foregoing method embodiment, which will not be described here.

[0087] In summary, the scheme described in the device embodiment of the present disclosure can isolate the connection resources, thereby avoiding the problem of one or several virtual network cards occupying most or even all global connection resources as much as possible, and further improving the overall success rate of connection establishment. Moreover, it supports different scenarios such as overbooking, non-overbooking and sharing, has wide applicability, and can maximize the use of host resources, etc.

[0088] The scheme described in the present disclosure can be applied to the field of artificial intelligence, especially to the fields of cloud computing and cloud network, and can be applied in intelligent cloud and local computing cluster scenarios. Artificial intelligence is a discipline that studies making computers simulate some thinking processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.) of humans. It has both hardware-level technology and software-level technology. Artificial intelligence hardware technology generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing, etc. Artificial intelligence software technology mainly includes computer vision technology, speech recognition technology, natural language processing technology, and machine learning / deep learning, big data processing technology, knowledge graph technology, etc.

[0089] In the technical solutions of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information comply with relevant laws and regulations and do not violate public order and good customs.

[0090] According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0091] Figure 5 A schematic block diagram of an electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, servers, blades, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present disclosure described and / or claimed in this document.

[0092] As shown in Figure 5 The device 500 includes a computing unit 501 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 502 or a computer program loaded into a random access memory (RAM) 503 from a storage unit 508. Various programs and data required for the operation of the device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0093] Various components in the device 500 are connected to the I / O interface 505, including an input unit 506 such as a keyboard, a mouse, etc., an output unit 507 such as various types of displays, speakers, etc., a storage unit 508 such as a magnetic disk, an optical disk, etc., and a communication unit 509 such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0094] The computing unit 501 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 performs various methods and processes described above, such as the methods described in the present disclosure. For example, in some embodiments, the methods described in the present disclosure can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded onto the RAM 503 and executed by the computing unit 501, one or more steps of the methods described in the present disclosure can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform the methods described in the present disclosure by any other appropriate means, such as by means of firmware.

[0095] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0096] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces a means for implementing the functions / acts specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0097] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0098] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0099] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0100] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0101] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps described in the present disclosure can be performed in parallel, in series, or in a different order, as long as the desired results of the technology disclosed in the present disclosure are achieved, which is not limited herein.

[0102] The specific implementation described above does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A connection establishment method, comprising: Obtain a connection establishment request from a virtual network interface card (NIC), wherein the type of the virtual NIC includes: oversubscription type; Determine the type of the virtual network interface card; Allocating connection resources to the virtual network interface card (NIC) from the resource pool corresponding to the type includes: performing the following first process: in response to determining that the number of connections established for the virtual NIC is less than the maximum quota of the virtual NIC, and that there are available connection resources in the oversubscribed resource pool corresponding to the oversubscribed type, allocating connection resources to the virtual NIC from the available connection resources, wherein the sum of the maximum quotas of each virtual NIC belonging to the oversubscribed type is greater than the number of connection resources in the oversubscribed resource pool, and each connection corresponds to one set of connection resources; wherein, the global connection resources are divided into at least two resource pools; The requested connection is established based on the allocated connection resources.

2. The method according to claim 1, further comprising: Before performing the first process, in response to determining that the number of connections established for the virtual network interface card is less than the minimum quota of the virtual network interface card, connection resources are allocated to the virtual network interface card from the reserved resource sub-pool in the oversold resource pool; The oversubscribed resource pool consists of the reserved resource sub-pool and the contention resource sub-pool. The number of connection resources in the reserved resource sub-pool is equal to the sum of the minimum quotas of each virtual network interface card belonging to the oversubscribed type. The number of connection resources in the contention resource sub-pool is equal to the number of connection resources in the oversubscribed resource pool minus the number of connection resources in the reserved resource sub-pool.

3. The method according to claim 2, wherein, The availability of available connection resources in the oversold resource pool includes: the existence of remaining connection resources in the competing resource sub-pool; Allocating connection resources to the virtual network interface card from the available connection resources includes: allocating connection resources to the virtual network interface card from the remaining connection resources.

4. The method according to claim 1, wherein, The types of virtual network interface cards also include: non-oversold type; The method further includes: in response to determining that there are remaining connection resources in the resource sub-pool corresponding to the virtual network card in the non-oversubscribed resource pool corresponding to the non-oversubscribed type, allocating connection resources to the virtual network card from the remaining connection resources; The non-oversubscribed resource pool consists of M resource sub-pools, where M is equal to the number of virtual network interface cards (NICs) belonging to the non-oversubscribed type, and each resource sub-pool corresponds to one virtual NIC.

5. The method according to any one of claims 1 to 4, wherein, The virtual network interface card that initiates the connection establishment request includes: a unique virtual network interface card corresponding to any virtual machine, and the primary network interface card among the N virtual network interfaces corresponding to any virtual machine, where N is a positive integer greater than one; Of the N virtual network interface cards (NICs), all virtual NICs other than the master NIC are slave NICs, and the slave NICs share the connection resources of the master NIC.

6. A connection establishment device, comprising: Acquire modules, determine modules, allocate modules, and create modules; The acquisition module is used to acquire connection establishment requests from virtual network interface cards (NICs), and the types of virtual NICs include: oversubscription type; The determining module is used to determine the type of the virtual network interface card; The allocation module is configured to allocate connection resources to the virtual network interface card (NIC) from the resource pool corresponding to the type, including: performing the following first process: in response to determining that the number of connections established for the virtual NIC is less than the maximum quota of the virtual NIC, and that there are available connection resources in the oversubscribed resource pool corresponding to the oversubscribed type, allocating connection resources to the virtual NIC from the available connection resources, wherein the sum of the maximum quotas of each virtual NIC belonging to the oversubscribed type is greater than the number of connection resources in the oversubscribed resource pool, and each connection corresponds to one set of connection resources; wherein, the global connection resources are divided into at least two resource pools; The establishment module is used to establish the requested connection based on the allocated connection resources.

7. The apparatus according to claim 6, wherein, The allocation module is further configured to, before performing the first process, allocate connection resources to the virtual network card from the reserved resource sub-pool in the oversold resource pool in response to determining that the number of connections established for the virtual network card is less than the minimum quota of the virtual network card; The oversubscribed resource pool consists of the reserved resource sub-pool and the contention resource sub-pool. The number of connection resources in the reserved resource sub-pool is equal to the sum of the minimum quotas of each virtual network interface card belonging to the oversubscribed type. The number of connection resources in the contention resource sub-pool is equal to the number of connection resources in the oversubscribed resource pool minus the number of connection resources in the reserved resource sub-pool.

8. The apparatus according to claim 7, wherein, The availability of available connection resources in the oversold resource pool includes: the existence of remaining connection resources in the competing resource sub-pool; The allocation module allocates connection resources to the virtual network card from the remaining connection resources.

9. The apparatus according to claim 6, wherein, The types of virtual network interface cards also include: non-oversold type; The allocation module is further configured to, in response to determining that there are remaining connection resources in the resource sub-pool corresponding to the virtual network card in the non-oversubscribed resource pool corresponding to the non-oversubscribed type, allocate connection resources to the virtual network card from the remaining connection resources; The non-oversubscribed resource pool consists of M resource sub-pools, where M is equal to the number of virtual network interface cards (NICs) belonging to the non-oversubscribed type, and each resource sub-pool corresponds to one virtual NIC.

10. The apparatus according to any one of claims 6 to 9, wherein, The virtual network interface card that initiates the connection establishment request includes: a unique virtual network interface card corresponding to any virtual machine, and the primary network interface card among the N virtual network interfaces corresponding to any virtual machine, where N is a positive integer greater than one; Of the N virtual network interface cards (NICs), all virtual NICs other than the master NIC are slave NICs, and the slave NICs share the connection resources of the master NIC.

11. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.

12. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-5.

13. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Method and device for establishing network connection in computer device

    CN110933135A