A network access control method, device, equipment and storage medium

By obtaining the resource creation information and network access information of virtual machines or containers in the data center, allocating network card resources and opening up data links, the problem of network management differences in virtualization and containerized environments is solved, and virtual machines and containers are realized. Unified network management improves management efficiency and user experience.

CN115426259BActive Publication Date: 2024-10-29LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202211041951.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-29
Publication Date
2024-10-29
Estimated Expiration
2042-08-29

AI Technical Summary

Technical Problem

In the data center, in an environment where virtualization and containerization coexist, due to the huge differences between virtual machines and containers at the network level, it is difficult to achieve unified management, resulting in low management efficiency of the computing plane.

Method used

Obtain the resource creation information and network access information of the virtual machine or container through the user interface, create target resources and allocate network card resources, open data links, realize unified network management of virtual machines and containers, and ensure natural interoperability between the two without performance loss.

Benefits of technology

It realizes unified and flexible network management operations for virtual machines and containers, improves user experience and network management efficiency, and breaks the limitations of traditional container network configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115426259B_ABST
    Figure CN115426259B_ABST
Patent Text Reader

Abstract

The present application discloses a network access control method, apparatus, device and storage medium, which are applied to a virtualization and cloud-native hybrid deployment environment, including: obtaining resource creation information and network access information of a target resource through an interface of a user interface; wherein the target resource is a virtual machine or a container; creating the target resource according to the resource creation information, and determining the target network to which the target resource is to be connected according to the network access information; allocating network card resources to the target resource on the target network, and adding the network card resources to a bridge to open up a data link. It can be seen that the present application provides unified and flexible network management operations for virtual machines and containers. The consistency of virtual machine and container operations enables the two to communicate naturally without performance loss, thereby improving user experience and network management efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing technology, and in particular to a network access control method, device, equipment and storage medium. Background Art

[0002] In the era of cloud computing, new technologies emerge in an endless stream. With the advancement of containerization, more and more data centers have deployed and applied container technology, and more and more businesses have been transformed into containers. The advancement of containerization is also showing an increasingly fast pace, and virtualization technology has occupied a dominant position in data centers in the process of continuous development. Although the proportion of virtualization in data centers has been continuously reduced due to the continuous erosion of containerization, its position in data centers cannot be ignored due to its early development, maturity, and large base. At the same time, due to certain defects in container technology, traditional businesses may retain some businesses and still run in a virtualized form when they are transformed into containers. This situation has led to the coexistence of virtualization and containerization in more and more data centers. The coexistence of containers and virtualization in data centers is the current situation and will not change significantly for a long time. And whether it is the transformation of traditional virtualization vendors to containers or the expansion of virtualization capabilities by cloud native platforms represented by kubernetes, a unified management and operation and maintenance platform is required.

[0003] Traditional virtualization vendors are constantly transforming to containerization, providing container capabilities by expanding the functions of traditional virtualization systems and managing virtual machines and containers in a unified manner on the traditional virtualization operation plane; the cloud native community is also expanding the functions of the Kubernetes platform through open source projects such as kube-virt to provide virtualization capabilities and manage containers and virtual machines in a unified manner on the Kubernetes operation plane. However, in data centers where containers and virtualization coexist, more attention is paid to the unified management of the computing plane, while it is difficult to achieve unified management at the network level due to the huge differences between virtual machines and containers.

[0004] Therefore, the above technical problems need to be solved by those skilled in the art urgently. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a network access control method, device, equipment and storage medium, which are applied to virtualization and cloud native hybrid deployment environments, provide unified and flexible network management operations for virtual machines and containers, and make the virtual machines and containers operate consistently so that the two can communicate naturally without performance loss, thereby improving user experience and network management efficiency. The specific scheme is as follows:

[0006] A first aspect of the present application provides a network access control method, which is applied to a virtualization and cloud-native hybrid deployment environment, including:

[0007] Obtaining resource creation information and network access information of a target resource through an interface of a user interface; wherein the target resource is a virtual machine or a container;

[0008] Creating the target resource according to the resource creation information, and determining the target network to be accessed by the target resource according to the network access information;

[0009] Allocate network card resources for the target resources on the target network, and add the network card resources to the bridge to open up the data link.

[0010] Optionally, the network access information is network selection information that meets the needs of the first user and is obtained through an interface of the user interface;

[0011] Correspondingly, determining the target network to be accessed by the target resource according to the network access information includes:

[0012] The target network to which the target resource is to be connected is selected from a preset database according to the network selection information.

[0013] Optionally, before selecting the target network to be accessed by the target resource from a preset database according to the network selection information, the method further includes:

[0014] Acquiring different network configuration information through the interface of the user interface;

[0015] Different networks are obtained by creating corresponding networks according to different network configuration information, and the different networks are stored in the preset database.

[0016] Optionally, the network access information is network configuration information that meets the needs of the second user and is obtained through an interface of the user interface;

[0017] Correspondingly, determining the target network to be accessed by the target resource according to the network access information includes:

[0018] A corresponding network is created according to the network configuration information to obtain the target network to which the target resource is to be connected.

[0019] Optionally, allocating network card resources to the target resource in the target network includes:

[0020] The network card information of the target resource is determined on the target network, and a target network card is created according to the network card information; wherein the network card resource includes the network card information and the target network card.

[0021] Optionally, before determining the network card information of the target resource on the target network, the method further includes:

[0022] Determining whether the network access information includes a specified static IP address;

[0023] If yes, then generate the corresponding network card information according to the specified static IP address and the randomly generated MAC address;

[0024] If not, apply for a new IP address for the target resource, and generate the corresponding network card information according to the new IP address and the randomly generated MAC address.

[0025] Optionally, if the network access information includes the designated static IP address, the method further includes:

[0026] Verifying the legitimacy of the specified static IP address;

[0027] If the verification passes, the step of generating the corresponding network card information according to the specified static IP address and the randomly generated MAC address is executed;

[0028] If the verification fails, the illegal error information will be reported.

[0029] Optionally, adding the network card resource to the bridge to open up the data link includes:

[0030] The target network card is inserted into the virtual switch bridge of the data plane, and a flow table is issued to open up the data plane.

[0031] A second aspect of the present application provides a network access control device, which is applied to a virtualization and cloud-native hybrid deployment environment, including:

[0032] A user interface, used to input resource creation information and network access information of a target resource through its own interface;

[0033] A control module, configured to obtain the resource creation information and the network access information of the target resource through an interface of the user interface; wherein the target resource is a virtual machine or a container;

[0034] The control module is further used to create the target resource according to the resource creation information, determine the target network that the target resource is about to access according to the network access information, and allocate network card resources to the target resource on the target network;

[0035] The network management module is used to add the network card resources to the bridge to open up the data link.

[0036] Optionally, the control module is further configured to obtain network selection information that meets the needs of the first user through an interface of the user interface, and select the target network to which the target resource is about to access from a preset database according to the network selection information.

[0037] Optionally, the control module is further used to obtain different network configuration information through the interface of the user interface, and to create corresponding networks according to different network configuration information to obtain different networks, and to store the different networks in the preset database.

[0038] Optionally, the control module is further used to obtain network configuration information that meets the needs of the second user through an interface of the user interface, and create a corresponding network according to the network configuration information to obtain the target network to which the target resource is about to access.

[0039] Optionally, the control module is used to determine the network card information of the target resource on the target network;

[0040] The network management module is used to create a target network card according to the network card information; wherein the network card resources include the network card information and the target network card.

[0041] Optionally, the control module is also used to determine whether the network access information contains a specified static IP address; if so, generating the corresponding network card information based on the specified static IP address and the randomly generated MAC address; if not, applying for a new IP address for the target resource, and generating the corresponding network card information based on the new IP address and the randomly generated MAC address.

[0042] Optionally, the control module is also used to verify the legitimacy of the specified static IP address; if the verification passes, the step of generating the corresponding network card information according to the specified static IP address and the randomly generated MAC address is executed; if the verification fails, the illegal error information is reported.

[0043] Optionally, the network management module is further used to insert the target network card into the virtual switch bridge of the data plane, and send down a flow table to open up the data plane.

[0044] A third aspect of the present application provides an electronic device, comprising a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the aforementioned network access control method.

[0045] A fourth aspect of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the aforementioned network access control method is implemented.

[0046] In this application, the resource creation information and network access information of the target resource are first obtained through the interface of the user interface; wherein the target resource is a virtual machine or a container; then the target resource is created according to the resource creation information, and the target network to which the target resource is about to access is determined according to the network access information; finally, a network card resource is allocated to the target resource on the target network, and the network card resource is added to the bridge to open up the data link. It can be seen that, regardless of whether it is a virtual machine or a container, this application obtains relevant resource creation information and network access information through the interface of the user interface, providing unified and flexible network management operations for virtual machines and containers. On this basis, a virtual machine or a container is created based on the above information and the network to which the virtual machine or container is to access is determined, and then network card resources are allocated and the data link is opened. The consistent operation of virtual machines and containers enables the two to communicate naturally without performance loss, thereby improving user experience and network management efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0048] Figure 1 A flow chart of a network access control method provided by this application;

[0049] Figure 2 A schematic diagram of a specific network access control method provided by this application;

[0050] Figure 3 A specific flow chart of a network access control method provided by this application;

[0051] Figure 4 A specific flow chart of a network access control method provided by this application;

[0052] Figure 5 A specific flow chart of a network access control method provided by this application;

[0053] Figure 6 A schematic diagram of the structure of a network access control device provided by this application;

[0054] Figure 7A structural diagram of a network access control electronic device provided in this application. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0056] In the prior art, the coexistence of data center containers and virtualization is the general trend of the future. Whether it is the transformation of traditional virtualization vendors to containerization or the expansion of virtualization capabilities by cloud native platforms represented by Kubernetes, a unified management and operation and maintenance platform is required. However, in current data centers where data center containers and virtualization coexist, more attention is paid to the unified management of the computing plane. However, due to the huge differences between virtual machines and containers at the network level, it is difficult to achieve unified management. In response to the above technical defects, the present application provides a network access control solution that provides unified and flexible network management operations for virtual machines and containers. The consistency of virtual machine and container operations makes the two naturally interoperable without performance loss, thereby improving user experience and network management efficiency.

[0057] Figure 1 A flow chart of a network access control method provided by an embodiment of the present application. Figure 1 As shown, the network access control method is applied to a virtualization and cloud native hybrid deployment environment, including:

[0058] S11: Obtain resource creation information and network access information of a target resource through an interface of a user interface; wherein the target resource is a virtual machine or a container.

[0059] In this embodiment, the virtualization and cloud native hybrid deployment environment refers to an environment where data center containers and virtualization coexist. First, the resource creation information and network access information of the target resource are obtained through the interface of the user interface, and the interface of the user interface is also the user interface (UI interface). In the virtualization and cloud native hybrid deployment environment, the target resource can be a virtual machine or a container.

[0060] In this embodiment, the user can input the resource creation information in the user interface (UI interface) according to the creation requirements, and the interface of the user interface, that is, the user interface, transmits the information to the management backend. At the same time, the user also needs to input the network access information in the user interface, and similarly, the interface of the user interface, that is, the user interface, transmits the information to the management backend. There are two types of network access information, one is the information for selecting a network that has been created in advance, and the other is the information for instantly creating the required network. Please refer to the following embodiment for details.

[0061] S12: Create the target resource according to the resource creation information, and determine the target network to which the target resource is to access according to the network access information.

[0062] In this embodiment, after obtaining the resource creation information and the network access information, on the one hand, the target resource is created according to the resource creation information, and on the other hand, the target network to which the target resource is to be connected is determined according to the network access information. That is, the required virtual machine or container is first created using the resource creation information, and then the target network to which the virtual machine or container is to be connected is determined using the network access information. It is not limited by the underlying virtual machines and containers.

[0063] S13: Allocate network card resources to the target resources on the target network, and add the network card resources to the bridge to open up the data link.

[0064] In this embodiment, after the target resource is created according to the resource creation information and the target network to which the target resource is to be connected is determined according to the network access information, a network card resource is further allocated to the target resource on the target network, and the network card resource is added to the bridge to open up the data link. The information corresponding to the network card resource includes an IP address, a MAC address, etc. After the data link is opened, the virtual machine or the container can use the new network.

[0065] It can be seen that the embodiment of the present application first obtains the resource creation information and network access information of the target resource through the interface of the user interface; wherein the target resource is a virtual machine or a container; then the target resource is created according to the resource creation information, and the target network to which the target resource is about to access is determined according to the network access information; finally, a network card resource is allocated to the target resource on the target network, and the network card resource is added to the bridge to open up the data link. In the embodiment of the present application, whether it is a virtual machine or a container, relevant resource creation information and network access information are obtained through the interface of the user interface, providing unified and flexible network management operations for virtual machines and containers. On this basis, a virtual machine or a container is created according to the above information and the network to which the virtual machine or container is to access is determined, and then network card resources are allocated and the data link is opened. The consistent operation of the virtual machine and the container enables the two to communicate naturally without performance loss, thereby improving user experience and network management efficiency.

[0066] Figure 2 A specific flow chart of a network access control method provided in an embodiment of the present application. Figure 2 As shown, the network access control method is applied to a virtualization and cloud native hybrid deployment environment, including:

[0067] S21: Acquire different network configuration information through an interface of the user interface.

[0068] S22: Creating corresponding networks according to different network configuration information to obtain different networks, and storing the different networks in a preset database.

[0069] S23: Obtain resource creation information of a target resource through an interface of a user interface; wherein the target resource is a virtual machine or a container.

[0070] S24: Acquire network selection information that meets the needs of the first user through the interface of the user interface.

[0071] S25: Create the target resource according to the resource creation information, and select the target network to be accessed by the target resource from a preset database according to the network selection information.

[0072] In this embodiment, the network access information is information for selecting a network that has been pre-created. In this case, the user needs to create multiple different networks in the user interface in order to select the corresponding network when creating a virtual machine or container. Specifically, different network configuration information is first obtained through the interface of the user interface. Then, corresponding networks are created according to different network configuration information to obtain different networks, and different networks are stored in a preset database. Users can use the UI interface to quickly and conveniently create a new network for a virtual machine or container. When creating a new container, they can conveniently select the network that the user has created through the UI, breaking the traditional container network that requires pre-configuration and cannot change the container network. At the same time, it can bring second and third layer network isolation to the container.

[0073] On this basis, the resource creation information of the target resource is obtained through the interface of the user interface, and the network selection information that meets the needs of the first user is obtained through the interface of the user interface. Then, the target resource is created according to the resource creation information, and the target network to which the target resource is about to be connected is selected from the preset database according to the network selection information. In this embodiment, when the user creates a new network in the UI interface, the network creation is completed and the created network is stored in the preset database; when the user creates a virtual machine or container in the UI interface, the created network is selected as the access network as needed.

[0074] S26: Allocate network card resources to the target resources on the target network, and add the network card resources to the bridge to open up the data link.

[0075] In this embodiment, regarding the specific process of the above step S26, reference may be made to the corresponding contents disclosed in the previous embodiments, which will not be repeated here.

[0076] It can be seen that the embodiment of the present application first obtains different network configuration information through the interface of the user interface, and then creates corresponding networks according to the different network configuration information to obtain different networks, and stores the different networks in a preset database. On this basis, the resource creation information of the target resource is obtained through the interface of the user interface; wherein the target resource is a virtual machine or a container. At the same time, the network selection information that meets the needs of the first user is obtained through the interface of the user interface. The target resource is created according to the resource creation information, and the target network to which the target resource is about to access is selected from the preset database according to the network selection information. In the embodiment of the present application, when a user creates a new network in the UI interface, the network creation is completed and the created network is stored in the preset database; when a user creates a virtual machine or a container in the UI interface, the created network is selected as the access network as needed, thereby improving network management efficiency.

[0077] Figure 3A specific flow chart of a network access control method provided in an embodiment of the present application. Figure 3 As shown, the network access control method is applied to a virtualization and cloud native hybrid deployment environment, including:

[0078] S31: Obtain resource creation information of a target resource through an interface of a user interface; wherein the target resource is a virtual machine or a container.

[0079] S32: Acquire network configuration information that meets the needs of the second user through the interface of the user interface.

[0080] S33: Create the target resource according to the resource creation information.

[0081] S34: Creating a corresponding network according to the network configuration information, and obtaining the target network to which the target resource is to be connected.

[0082] The network access information is the information for selecting a network that has been pre-created. In this case, the user can create a new network even through the UI interface. Specifically, the resource creation information of the target resource is first obtained through the interface of the user interface, and then the network configuration information that meets the needs of the second user is obtained through the interface of the user interface. Then, the target resource is created according to the resource creation information, and at the same time, a corresponding network is created according to the network configuration information to obtain the target network to which the target resource is about to access. Users can create networks in the UI interface as needed. Users can create multiple Layer 2 networks at any time according to the plan, and can also create multiple Layer 3 networks under the same Layer 2 network. The creation of the network can be flexibly adjusted, and the container does not need to be reconfigured to use the new network, and is not restricted by the underlying virtual machines and containers.

[0083] S35: Allocate network card resources to the target resources on the target network, and add the network card resources to the bridge to open up the data link.

[0084] In this embodiment, regarding the specific process of the above step S35, reference may be made to the corresponding content disclosed in the above embodiments, and no further details will be given here.

[0085] It can be seen that the embodiment of the present application first obtains the resource creation information of the target resource through the interface of the user interface, and then obtains the network configuration information that meets the needs of the second user through the interface of the user interface. Then, the target resource is created according to the resource creation information, and the corresponding network is created according to the network configuration information, so as to obtain the target network to which the target resource is about to be connected. Finally, network card resources are allocated to the target resource on the target network, and the network card resources are added to the bridge to open up the data link. Users can create multiple Layer 2 networks at any time according to the plan, and can also create multiple Layer 3 networks under the same Layer 2 network. The creation of the network can be flexibly adjusted, and the container does not need to be reconfigured to use the new network, and is not restricted by the underlying virtual machines and containers.

[0086] Figure 4 A specific flow chart of a network access control method provided in an embodiment of the present application. Figure 4 As shown, the network access control method is applied to a virtualization and cloud native hybrid deployment environment, including:

[0087] S41: Obtain resource creation information and network access information of a target resource through an interface of a user interface; wherein the target resource is a virtual machine or a container.

[0088] S42: Create the target resource according to the resource creation information, and determine the target network to which the target resource is to access according to the network access information.

[0089] In this embodiment, for the specific process of the above step S41 and step S42, reference may be made to the corresponding content disclosed in the above embodiment, and no further details will be given here.

[0090] S43: Determine the network card information of the target resource on the target network, and create a target network card according to the network card information; wherein the network card resource includes the network card information and the target network card.

[0091] In this embodiment, the network card resources include the network card information and the target network card. The process of allocating network card resources also includes two aspects: first, determining the network card information of the target resource on the target network, and then creating the target network card according to the network card information. The specific steps are as follows: Figure 5 ):

[0092] S431: Determine whether the network access information includes a designated static IP address.

[0093] S432: If a designated static IP address is included, the legality of the designated static IP address is verified.

[0094] S433: If the verification passes, the corresponding network card information is generated according to the specified static IP address and the randomly generated MAC address.

[0095] S434: If the verification fails, the illegal error information is reported.

[0096] In this embodiment, when creating a container, the user can specify a new network for it, or specify a static IP address, which is included in the user input information. For containers or virtual machines using static IP addresses, the IP address remains unchanged throughout the life cycle. Therefore, when pre-applying for a new network card for a virtual machine or container, it is necessary to first determine whether the network access information contains a specified static IP address.

[0097] In this embodiment, if a specified static IP address is included, that is, the user specifies a static IP address for it, the legality of the specified static IP address is further verified. If the verification is passed, the corresponding network card information is generated according to the specified static IP address and the randomly generated MAC address. If the verification fails, the illegal error information is reported. If the static IP address is correct, the static IP pre-allocated network card is used. If the static IP address is illegal, an error message is returned.

[0098] S435: If the specified static IP address is not included, apply for a new IP address for the target resource, and generate the corresponding network card information according to the new IP address and the randomly generated MAC address.

[0099] In this embodiment, if a static IP address is not specified, a new IP address is applied for the target resource, and the corresponding network card information is generated according to the new IP address and the randomly generated MAC address. That is, the IP address and MAC address are automatically applied for the virtual machine or container, and after the pre-application is completed, the result is stored in the database, such as in the preset database, so as to create a target network card according to the network card information.

[0100] S44: inserting the target network card into the virtual switch bridge of the data plane, and issuing a flow table to open up the data plane.

[0101] In this embodiment, the target network card is inserted into the virtual switch bridge of the data plane, and a flow table is issued to open the data plane. The container network card is added to the OVS bridge to complete the addition of the network card. At the same time, the flow table will be issued for the network card on OVS to open the data link. The data plane is a universal OVS that provides data exchange for the network card.

[0102] It can be seen that when allocating network card resources, the embodiment of the present application first determines the network card information of the target resource on the target network, and then creates the target network card according to the network card information. Specifically, it is necessary to determine whether the network access information contains a specified static IP address. If it contains a specified static IP address, the legality of the specified static IP address is verified. If the verification passes, the corresponding network card information is generated according to the specified static IP address and the randomly generated MAC address. If the verification fails, the illegal error information is reported. If the specified static IP address is not included, a new IP address is applied for the target resource, and the corresponding network card information is generated according to the new IP address and the randomly generated MAC address. Finally, the target network card is inserted into the virtual switch bridge of the data plane, and the flow table is issued to open the data plane. In this embodiment, the user can specify a new network for the container when creating it, or specify a static IP address. For containers or virtual machines using static IP addresses, the IP address remains unchanged throughout the life cycle, breaking through the limitations of traditional container use.

[0103] See also Figure 6 As shown, the embodiment of the present application also discloses a network access control device, which is applied to a virtualization and cloud native hybrid deployment environment, including:

[0104] A user interface 11, used to input resource creation information and network access information of a target resource through its own interface;

[0105] A control module 12, configured to obtain the resource creation information and the network access information of the target resource through an interface of the user interface; wherein the target resource is a virtual machine or a container;

[0106] The control module 12 is further configured to create the target resource according to the resource creation information, determine the target network to be accessed by the target resource according to the network access information, and allocate network card resources to the target resource on the target network;

[0107] The network management module 13 is used to add the network card resources to the bridge to open up the data link.

[0108] It can be seen that the user interface of the embodiment of the present application is used to input the resource creation information and network access information of the target resource through its own interface; the control module is used to obtain the resource creation information and the network access information of the target resource through the interface of the user interface; wherein the target resource is a virtual machine or a container; the control module is also used to create the target resource according to the resource creation information, and determine the target network that the target resource is about to access according to the network access information, and allocate network card resources for the target resource on the target network; the network management module is used to add the network card resources to the bridge to open the data link. It can be seen that, whether it is a virtual machine or a container, the present application obtains relevant resource creation information and network access information through the interface of the user interface, and provides unified and flexible network management operations for virtual machines and containers. On this basis, a virtual machine or a container is created according to the above information and the network to be accessed by the virtual machine or container is determined, and then the network card resources are allocated and the data link is opened. The consistent operation of the virtual machine and the container makes the two naturally interoperable without performance loss, improving user experience and network management efficiency.

[0109] In some specific embodiments, the control module 12 is further configured to obtain network selection information that meets the needs of the first user through an interface of the user interface, and select the target network to which the target resource is about to access from a preset database according to the network selection information.

[0110] In some specific embodiments, the control module 12 is further used to obtain different network configuration information through the interface of the user interface, and to create corresponding networks according to different network configuration information to obtain different networks, and store different networks in the preset database.

[0111] In some specific embodiments, the control module 12 is further used to obtain network configuration information that meets the needs of the second user through the interface of the user interface, and create a corresponding network according to the network configuration information to obtain the target network to which the target resource is about to access.

[0112] In some specific embodiments, the control module 12 is further configured to determine the network card information of the target resource on the target network;

[0113] Correspondingly, the network management module 13 is further used to create a target network card according to the network card information; wherein the network card resources include the network card information and the target network card.

[0114] In some specific embodiments, the control module 12 is also used to determine whether the network access information contains a specified static IP address; if so, generating the corresponding network card information based on the specified static IP address and the randomly generated MAC address; if not, applying for a new IP address for the target resource, and generating the corresponding network card information based on the new IP address and the randomly generated MAC address.

[0115] In some specific embodiments, the control module 12 is also used to verify the legitimacy of the specified static IP address; if the verification passes, the step of generating the corresponding network card information according to the specified static IP address and the randomly generated MAC address is executed; if the verification fails, the illegal error information is reported.

[0116] In some specific embodiments, the network management module 13 is further used to insert the target network card into the virtual switch bridge of the data plane, and send down a flow table to open up the data plane.

[0117] In the above embodiment, the network access control device mainly includes a UI interface, a control module, a network management module, a data plane and a database.

[0118] The UI interface is responsible for providing users with a unified management portal. Through the UI interface, users can create and allocate new networks for virtual machines and containers at any time. They can also specify static IPs for virtual machines or containers. After specifying static IPs, the IP addresses of virtual machines or containers remain unchanged throughout their life cycle.

[0119] The control module is responsible for completing the user configuration and is the central module of the entire system. The control module interacts with the UI interface and the network management module at the same time. According to the operation of the UI interface, the control module creates a new network or adds or deletes a network card for a virtual machine or container, and returns the execution result to the UI interface for display to the user. When the control module receives the instruction to add or delete a virtual machine network card, it will pre-allocate network card resources for the virtual machine / container. If the user sets a static IP address for the virtual machine or container in the interface, the control module will use this static IP address to pre-allocate the network card after verifying that the static IP address is legal. If the user does not specify a static IP address, the control module will pre-allocate a new IP address for it. Finally, the control module stores the relevant information in the database and transmits the add and delete instructions to the network management module. Wait for the execution result of the network management module. After obtaining the execution result of the network management module, the control module will report the execution result to the UI interface for display.

[0120] The network management module creates a network interface for the container and assigns an IP address according to the instructions issued by the control module. It is also responsible for connecting the container network port to the data plane or deleting it from the data plane. After completing the configuration of the container network card, it will issue a flow table to open the data link. Finally, the container network card is added to the OVS bridge, the network card is added, and the task execution result is returned to the control module.

[0121] The data plane uses the general and high-performance OVS to provide network access functions for virtual machines and containers.

[0122] The database is responsible for saving configuration data. Through the close cooperation of various modules, it provides users with a unified and flexible virtualization and cloud-native data center network management method.

[0123] Furthermore, an embodiment of the present application also provides an electronic device. Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0124] Figure 7 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the network access control method disclosed in any of the above embodiments.

[0125] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0126] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0127] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the network access control method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. The data 223 can include resource creation information and network access information collected by the electronic device 20.

[0128] Furthermore, an embodiment of the present application also discloses a storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the network access control method disclosed in any of the aforementioned embodiments are implemented.

[0129] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0130] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0131] The network access control method, device, equipment and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A network access control method, It is characterized in that Applicable to virtualization and cloud-native hybrid deployment environments, including: Obtaining resource creation information and network access information of a target resource through an interface of a user interface; wherein the target resource is a virtual machine or a container; Creating the target resource according to the resource creation information, and determining the target network to be accessed by the target resource according to the network access information; Allocating a network card resource to the target resource on the target network, and adding the network card resource to a network bridge to open a data link; Wherein, the network access information is network selection information that meets the needs of the first user and is obtained through an interface of the user interface; Correspondingly, determining the target network to be accessed by the target resource according to the network access information includes: Selecting the target network to be accessed by the target resource from a preset database according to the network selection information; Before selecting the target network to be accessed by the target resource from the preset database according to the network selection information, the method further includes: acquiring different network configuration information through the interface of the user interface; creating corresponding networks according to different network configuration information to obtain different networks, and storing the different networks in the preset database; The network access information is network configuration information that meets the needs of the second user and is obtained through an interface of the user interface; Correspondingly, determining the target network to which the target resource is about to access according to the network access information includes: creating a corresponding network according to the network configuration information to obtain the target network to which the target resource is about to access; The allocating network card resources to the target resource on the target network includes: determining the network card information of the target resource on the target network, and creating a target network card according to the network card information; wherein the network card resources include the network card information and the target network card; Before determining the network card information of the target resource on the target network, the method further includes: determining whether the network access information includes a specified static IP address; if so, generating corresponding network card information according to the specified static IP address and the randomly generated MAC address; if not, applying for a new IP address for the target resource, and generating corresponding network card information according to the new IP address and the randomly generated MAC address; Adding the network card resource to the bridge to open up the data link includes: inserting the target network card into the virtual switch bridge of the data plane, and issuing a flow table to open up the data plane; The step of inserting the target network card into the virtual switch bridge of the data plane and issuing a flow table to open up the data plane includes: adding the container network card to the OVS bridge of the general OVS, and issuing a flow table on the OVS to open up the general OVS.

2. The network access control method according to claim 1, It is characterized in that If the network access information includes the specified static IP address, it also includes: Verifying the legitimacy of the specified static IP address; If the verification passes, the step of generating the corresponding network card information according to the specified static IP address and the randomly generated MAC address is executed; If the verification fails, the illegal error information will be reported.

3. A network access control device, It is characterized in that Applicable to virtualization and cloud-native hybrid deployment environments, including: A user interface, used to input resource creation information and network access information of a target resource through its own interface; A control module, configured to obtain the resource creation information and the network access information of the target resource through an interface of the user interface; wherein the target resource is a virtual machine or a container; The control module is further used to create the target resource according to the resource creation information, determine the target network that the target resource is about to access according to the network access information, and allocate network card resources to the target resource on the target network; A network management module, used for adding the network card resources to the bridge to open up the data link; The control module is further configured to obtain network selection information that meets the needs of the first user through an interface of the user interface, and select the target network to be accessed by the target resource from a preset database according to the network selection information; The control module is further used to obtain different network configuration information through the interface of the user interface, and to create corresponding networks according to different network configuration information to obtain different networks, and store different networks in the preset database; The control module is further configured to obtain network configuration information that meets the needs of the second user through the interface of the user interface, and to create a corresponding network according to the network configuration information to obtain the target network to which the target resource is about to access; The control module is used to determine the network card information of the target resource on the target network; The network management module is used to create a target network card according to the network card information; wherein the network card resources include the network card information and the target network card; The control module is further used to determine whether the network access information contains a specified static IP address; if so, generate the corresponding network card information according to the specified static IP address and the randomly generated MAC address; if not, apply for a new IP address for the target resource, and generate the corresponding network card information according to the new IP address and the randomly generated MAC address; The network management module is further used to insert the target network card into the virtual switch bridge of the data plane, and issue a flow table to open up the data plane; The network management module is also used to add the container network card to the OVS bridge of the general OVS, and send flow tables up and down on the OVS to connect the general OVS.

4. The network access control device according to claim 3, It is characterized in that The control module is further used to verify the legitimacy of the specified static IP address; if the verification is passed, the step of generating the corresponding network card information according to the specified static IP address and the randomly generated MAC address is executed; If the verification fails, the illegal error information will be reported.

5. An electronic device, It is characterized in that The electronic device comprises a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the network access control method according to any one of claims 1 to 2.

6. A computer-readable storage medium, It is characterized in that Used to store computer executable instructions, which, when loaded and executed by a processor, implement the network access control method according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • Network processing method and system, and network control center

    CN103607430A

  • Resource payment method

    CN103703724A

  • Virtual network management method and system for fixed nested framework of virtual machine and container

    CN108418705A

  • Container configuration method and computing node

    CN109587281A

  • Unified resource scheduling coordinator, method for creating virtual machine and / or container thereof and unified resource scheduling system

    CN109885377A