Network connection method and device, electronic equipment, storage medium and program product
By integrating wireless bandwidth networks in Kubernetes environments, establishing target tunnels between target containers and wireless bandwidth networks, solving the problem of inefficiency in network communication caused by the increase in the number of containers, achieving more efficient data transmission and lower latency.
Patent Information
- Application Number
- CN202411921698.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-03-07
AI Technical Summary
In Kubernetes environment, as the number of containers increases, it may occupy a large amount of system resources, resulting in a decrease in routing search and rule matching efficiency and low network communication efficiency.
By integrating the wireless bandwidth network into the container network, network initialization is performed in response to the startup operation of the target container, initial configuration files are generated, network parameters of the wireless bandwidth network are obtained, target tunnels between the target container and the wireless bandwidth network are established, and target containers are connected to the wireless bandwidth network.
It realizes the expansion of container networks as wireless bandwidth networks expand, providing higher data transmission speed and lower latency, and improving network communication efficiency.
Smart Images

Figure CN119584328A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a network connection method, device, electronic device, storage medium and program product. Background Art
[0002] In the intelligent computing center, computing resources, storage resources, and network resources are very abundant but also complex. Kubernetes (hereinafter referred to as K8s) is a container orchestration platform. K8s can be used to efficiently manage large-scale containerized applications, allowing the intelligent computing center to flexibly deploy and schedule various computing tasks, such as artificial intelligence training tasks and data analysis tasks.
[0003] Currently, in the K8s environment, container networks can use network plug-ins to achieve communication and isolation between containers. For example, network plug-ins can include Calico. Calico runs a daemon process on each node of the K8s cluster, assigns an IP address to each node through plug-ins, distributes routing information between nodes to achieve communication between nodes, and implements network policies by adjusting firewall rules and routing in real time according to preset policies.
[0004] In the above situation, as the number of containers increases, a large amount of system resources may be occupied, and the efficiency of route lookup and rule matching may decrease, resulting in low network communication efficiency. Summary of the invention
[0005] The present application provides a network connection method, device, electronic device, storage medium and program product to solve the technical problem of low network communication efficiency.
[0006] In a first aspect, the present application provides a network connection method, comprising:
[0007] In response to a start operation on a target container, network initialization is performed on the target container to generate an initial configuration file;
[0008] Obtain network parameters of wireless bandwidth network;
[0009] Establishing a target tunnel between the target container and the wireless bandwidth network according to the initial configuration file and the network parameters;
[0010] According to the target tunnel, the target container is connected to the wireless bandwidth network.
[0011] In this way, by integrating the wireless bandwidth network into the container network, the container network can be expanded as the wireless bandwidth network expands, and higher data transmission speed and lower latency can be provided than the existing container network to improve the communication efficiency of the network.
[0012] Optionally, the method as described above, establishing a target tunnel between the target container and the wireless bandwidth network according to the initial configuration file and the network parameters, includes:
[0013] Create the initial tunnel;
[0014] Determining a first address of the target container and a second address of the wireless bandwidth network according to the initial configuration file and the network parameters;
[0015] The initial tunnel is configured according to the first address and the second address, and the target tunnel is established.
[0016] In this way, by integrating the wireless bandwidth network in the container network, the container network can be expanded as the wireless bandwidth network expands to improve the communication efficiency of the network.
[0017] Optionally, in the method described above, configuring the initial tunnel according to the first address and the second address to obtain the target tunnel includes:
[0018] Determining an initial tunnel interface in the initial tunnel;
[0019] According to the first address and the second address, configure the initial tunnel interface to obtain a target tunnel interface;
[0020] Configure tunnel parameters corresponding to the target tunnel interface;
[0021] The target tunnel is established according to the target tunnel interface and the tunnel parameters.
[0022] In this way, by integrating the wireless bandwidth network in the container network, the container network can be expanded as the wireless bandwidth network expands to improve the communication efficiency of the network.
[0023] Optionally, the method as described above, in response to the start operation of the target container, performs network initialization on the target container and generates an initial configuration file, including:
[0024] In response to a start operation on a target container, obtaining preset configuration parameters;
[0025] According to the preset configuration parameters, the container parameters of the target container are configured to generate a container network;
[0026] Generate a virtual controller in the container network, and perform network configuration on the virtual controller to obtain a network controller;
[0027] An initial configuration file is generated according to the container network and the network controller.
[0028] In this way, the target container can be initialized and the relevant configuration information can be recorded in the initial configuration file to facilitate subsequent search and modification to improve the communication efficiency of the network.
[0029] Optionally, the method as described above, connecting the target container to the wireless bandwidth network according to the target tunnel, includes:
[0030] Starting the tunnel function in the initial configuration file;
[0031] According to the target tunnel, tunnel information is added to the initial configuration file to obtain a target configuration file, wherein the tunnel information includes a target tunnel interface and tunnel parameters;
[0032] The target configuration file is run to connect the target container to the wireless bandwidth network.
[0033] In this way, by integrating the wireless bandwidth network in the container network, the container network can be expanded as the wireless bandwidth network expands to improve the communication efficiency of the network.
[0034] Optionally, the method as described above, before obtaining the network parameters of the wireless bandwidth network, further includes:
[0035] Run the wireless bandwidth driver to create a wireless bandwidth network;
[0036] Obtaining preset parameters of wireless bandwidth;
[0037] The wireless bandwidth network is initialized according to the preset parameters.
[0038] In this way, the communication efficiency of the network can be improved by integrating the wireless bandwidth network into the container network.
[0039] In a second aspect, the present application provides a network connection device, including:
[0040] A generating module, configured to perform network initialization on the target container and generate an initial configuration file in response to a startup operation on the target container;
[0041] An acquisition module, used to acquire network parameters of a wireless bandwidth network;
[0042] An establishing module, configured to establish a target tunnel between the target container and the wireless bandwidth network according to the initial configuration file and the network parameters;
[0043] A connection module is used to connect the target container to the wireless bandwidth network according to the target tunnel.
[0044] Optionally, in the above-mentioned device, the establishing module is specifically used for:
[0045] Create the initial tunnel;
[0046] Determining a first address of the target container and a second address of the wireless bandwidth network according to the initial configuration file and the network parameters;
[0047] The initial tunnel is configured according to the first address and the second address, and the target tunnel is established.
[0048] Optionally, in the above-mentioned device, the establishing module is specifically used for:
[0049] Determining an initial tunnel interface in the initial tunnel;
[0050] According to the first address and the second address, configure the initial tunnel interface to obtain a target tunnel interface;
[0051] Configure tunnel parameters corresponding to the target tunnel interface;
[0052] The target tunnel is established according to the target tunnel interface and the tunnel parameters.
[0053] Optionally, in the above device, the generating module is specifically used for:
[0054] In response to a start operation on a target container, obtaining preset configuration parameters;
[0055] According to the preset configuration parameters, the container parameters of the target container are configured to generate a container network;
[0056] Generate a virtual controller in the container network, and perform network configuration on the virtual controller to obtain a network controller;
[0057] An initial configuration file is generated according to the container network and the network controller.
[0058] Optionally, in the above device, the connection module is specifically used for:
[0059] Starting the tunnel function in the initial configuration file;
[0060] According to the target tunnel, tunnel information is added to the initial configuration file to obtain a target configuration file, wherein the tunnel information includes a target tunnel interface and tunnel parameters;
[0061] The target configuration file is run to connect the target container to the wireless bandwidth network.
[0062] Optionally, in the above device, the generating module is further used for:
[0063] Run the wireless bandwidth driver to create a wireless bandwidth network;
[0064] Obtaining preset parameters of wireless bandwidth;
[0065] The wireless bandwidth network is initialized according to the preset parameters.
[0066] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0067] The memory stores computer-executable instructions;
[0068] The processor executes the computer-executable instructions stored in the memory to implement the method described in any one of the first aspects.
[0069] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.
[0070] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the method as described in any one of the first aspects when executed by a computer.
[0071] The network connection method, device, electronic device, storage medium and program product provided by the present application initialize the network of the target container in response to the startup operation of the target container, generate an initial configuration file; obtain the network parameters of the wireless bandwidth network; establish a target tunnel between the target container and the wireless bandwidth network according to the initial configuration file and the network parameters; and connect the target container to the wireless bandwidth network according to the target tunnel. In this way, by integrating the wireless bandwidth network in the container network, the container network can be expanded as the wireless bandwidth network expands, and it can provide higher data transmission speed and lower latency than the existing container network to improve the communication efficiency of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0074] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0075] Figure 2 A flowchart of a network connection method provided in an embodiment of the present application;
[0076] Figure 3A flowchart of another network connection method provided in an embodiment of the present application;
[0077] Figure 4 A flowchart of another network connection method provided in an embodiment of the present application;
[0078] Figure 5 A schematic diagram of the structure of a network connection device provided in an embodiment of the present application;
[0079] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0080] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0081] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0082] It should be noted that, although the terms "first", "second", etc. are used to describe various information in the embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. Optionally, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.
[0083] It should be understood that the terms "comprises" and "includes" indicate the presence of the previously mentioned features, steps, operations, but do not exclude the presence, occurrence or addition of one or at least one other feature, step, operation. The terms "and / or" and the like used in this application may be interpreted as inclusive, or mean any one or any combination. Optionally, "A and / or B" means "any of the following: A; B; A and B". In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship.
[0084] In the intelligent computing center, computing resources, storage resources, and network resources are very abundant but also complex. Kubernetes (hereinafter referred to as K8s) is a container orchestration platform. K8s can be used to efficiently manage large-scale containerized applications, allowing the intelligent computing center to flexibly deploy and schedule various computing tasks, such as artificial intelligence training tasks and data analysis tasks.
[0085] Currently, in the K8s environment, container networks can use network plug-ins to achieve communication and isolation between containers. For example, network plug-ins can include Calico. Calico runs a daemon process on each node of the K8s cluster, assigns an IP address to each node through plug-ins, distributes routing information between nodes to achieve communication between nodes, and implements network policies by adjusting firewall rules and routing in real time according to preset policies.
[0086] In the above situation, as the number of containers increases, a large amount of system resources may be occupied, and the efficiency of route lookup and rule matching may decrease, resulting in low network communication efficiency.
[0087] In order to solve the above technical problems, the embodiment of the present application provides a network connection method, which obtains the network parameters of the wireless bandwidth network, establishes a target tunnel between the target container and the wireless bandwidth network according to the initial configuration file and network parameters of the target container, and connects the target container to the wireless bandwidth network according to the target tunnel. In this way, by integrating the wireless bandwidth network in the container network, the container network can be expanded as the wireless bandwidth network expands, and can provide higher data transmission speeds and lower delays than existing container networks to improve the communication efficiency of the network.
[0088] Next, combine Figure 1 , and give examples to illustrate the application scenarios corresponding to the network connection methods.
[0089] Figure 1 This is a schematic diagram of an application scenario provided by the embodiment of this application. Figure 1 , Figure 1 The network architecture of the container cluster may include at least multiple physical machines and a wireless bandwidth network. The multiple physical machines include physical machine A, physical machine B, and physical machine C. Each physical machine includes multiple containers. Multiple containers may communicate with each other through a wireless bandwidth network.
[0090] Wireless bandwidth can be a high-speed, low-latency computer network communication standard. Wireless bandwidth can be used in high-performance computing and data center environments.
[0091] Physical machine A may include container A1 and container A2. Physical machine B may include container B1 and container B2. Physical machine C may include container C1 and container C2.
[0092] Each container has an IP address. For example, the IP address of container A1 is 172.17.8.2 / 32. Other containers are similar to container A1. Please refer to Figure 1 , I will not go into details here.
[0093] Each physical machine can include a tunnel interface ( Figure 1 tunl0 in the example), proxy ( Figure 1 Felix in the code), routers ( Figure 1 BGPSpeaker in the text), wireless bandwidth interface ( Figure 1 ib0 in the figure), Ethernet interface ( Figure 1 eth0 in the example) and the virtual Ethernet interface ( Figure 1 veth in the representation).
[0094] Tunnel interfaces can be used to establish tunnels between physical machines, allowing communication between containers.
[0095] Agents can be used to manage network policies on physical machines and ensure network security between containers.
[0096] In the K8s cluster, you can include a key-value storage system ( Figure 1 The key-value storage system can be used for shared configuration and service discovery. The key-value storage system can communicate with the agent in each physical machine to ensure that the configuration information corresponding to all container nodes in the cluster is synchronized.
[0097] Routers can be used to exchange routing information between physical machines and ensure communication paths between containers.
[0098] The Ethernet interface can be used to connect and communicate between the physical machine and the external network.
[0099] Virtual Ethernet interfaces can be used to establish virtual network connections between containers and physical machines.
[0100] Each physical machine can have one tunnel interface, which can contain multiple tunnels. Figure 1 , the tunnel interface in physical machine A can have two tunnels. One tunnel can connect to 172.17.9.0 / 24 and 172.17.8.2 / 32 at both ends, and the other tunnel can connect to 172.17.10.0 / 24 and 172.17.8.3 / 32 at both ends. Physical machines B and C are similar to physical machine A. Please refer to Figure 1 , I will not go into details here.
[0101] Each physical machine can have a router. For example, each router can be connected to a wireless broadband network with an IP address of 11.0.0.8.
[0102] Each physical machine can run an agent.
[0103] Multiple containers can exist on each physical machine, and multiple containers can be connected to the physical machine through virtual Ethernet interfaces.
[0104] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0105] The technical solution shown in the present application is described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.
[0106] Figure 2 A flowchart of a network connection method provided by an embodiment of the present application. The execution subject of the embodiment of the present application can be a physical machine or a processor set in a physical machine. The processor can be implemented by software or by a combination of software and hardware. Figure 2 , the method comprising:
[0107] S201: In response to a start operation on a target container, network initialization is performed on the target container to generate an initial configuration file.
[0108] The launch operation can be used to create an isolated execution environment.
[0109] Network initialization may include initializing the file system, network configuration, etc. within the target container.
[0110] The initial configuration file can include relevant information such as the container name and network information.
[0111] The initial configuration file can be a file in JSON format.
[0112] A startup instruction for a target container may be received, and a startup operation may be performed on the target container according to the startup instruction. In response to the startup operation on the target container, binary files and network configuration files may be installed in the target container, a file system may be loaded and mounted, and a network may be configured to complete network initialization. After the network is initialized, an initial configuration file may be generated.
[0113] The binary file may be a standard file of the container network interface, and the binary file may be an actual executable program that implements the network function.
[0114] It should be noted that the network of the target container can be initialized and the initial configuration file can be generated according to any feasible implementation method, and the embodiment of the present application is not limited to this.
[0115] Optionally, in response to a startup operation on the target container, the network of the target container can be initialized and an initial configuration file can be generated in the following manner: in response to a startup operation on the target container, preset configuration parameters are obtained; according to the preset configuration parameters, container parameters of the target container are configured to generate a container network; a virtual controller is generated in the container network, and network configuration is performed on the virtual controller to obtain a network controller; and an initial configuration file is generated according to the container network and the network controller.
[0116] The preset configuration parameters may be used for network initialization of the target container.
[0117] The preset configuration parameters can be obtained from storage media such as external configuration files and databases, and are not limited here.
[0118] For example, configuring the container parameters of the target container may be to update configurable parameters such as the container's memory limit and CPU share according to preset configuration parameters, thereby configuring the container's own resource usage and other related properties according to preset requirements.
[0119] To generate a container network, you can first create a preset network and configure the preset network according to the preset configuration parameters to generate a container network.
[0120] A virtual controller can be a preset controller object.
[0121] Network configuration can include setting the name and IP address, configuring network-related properties, etc.
[0122] The configuration parameters of the container network and the network controller and other related configuration parameters can be stored in the target file to generate an initial configuration file, which is convenient for subsequent viewing and use and as a basis for other related operations.
[0123] S202: Acquire network parameters of the wireless bandwidth network.
[0124] Network parameters may include IP address, signal strength, channel usage, frequency band information, currently used security authentication method, real-time transmission rate of the network, actual connection status, etc.
[0125] The network parameters of the wireless broadband network can be queried through a preset tool to obtain the network parameters of the wireless broadband network.
[0126] Optionally, before obtaining the network parameters of the wireless bandwidth network, the wireless bandwidth network is also created. The wireless bandwidth network can be created in the following manner: running the wireless bandwidth driver to create the wireless bandwidth network; obtaining preset parameters of the wireless bandwidth; and initializing the wireless bandwidth network according to the preset parameters.
[0127] When the wireless bandwidth driver is run, the wireless bandwidth driver can initialize and configure hardware such as the wireless network card to put it into working state.
[0128] The wireless bandwidth driver can create an initial wireless bandwidth network according to default settings or network-related parameters previously configured by the user.
[0129] Initializing the wireless bandwidth network may include setting the wireless network name, security authentication method, frequency band selection, channel bandwidth, and maximum number of connected devices, etc., which are not limited here.
[0130] S203: Establish a target tunnel between the target container and the wireless bandwidth network according to the initial configuration file and the network parameters.
[0131] A target tunnel can be a virtual communication path established between different network areas.
[0132] The target tunnel can be used to connect the target container with the wireless bandwidth network to achieve secure and efficient transmission of data between the target container and the wireless bandwidth network environment.
[0133] For example, the target tunnel may be an IP-in-IP tunnel, which may encapsulate a complete IP packet as the payload of another IP packet so that the encapsulated packet can be transmitted in different network paths or network topologies.
[0134] The name, IP address and network mode corresponding to the target container can be obtained according to the initial configuration file, the name and IP address corresponding to the wireless bandwidth network can be obtained according to the network parameters, and the target tunnel between the target container and the wireless bandwidth network can be established according to the name, IP address and network mode corresponding to the target container and the name and IP address corresponding to the wireless bandwidth network.
[0135] It should be noted that the target tunnel between the target container and the wireless bandwidth network may be established according to any feasible implementation manner, and the embodiment of the present application is not limited to this.
[0136] Optionally, a target tunnel between the target container and the wireless bandwidth network may be established in the following manner: creating an initial tunnel; determining a first address of the target container and a second address of the wireless bandwidth network according to an initial configuration file and network parameters; configuring the initial tunnel according to the first address and the second address to establish the target tunnel.
[0137] The first address may be an IP address corresponding to the target container, and the second address may be an IP address corresponding to the wireless bandwidth network.
[0138] S204: Connect the target container to the wireless bandwidth network according to the target tunnel.
[0139] According to the target tunnel, a network testing tool can be used inside the target container to send a test instruction to the device in the wireless bandwidth network. If response information to the test instruction is received from the device in the wireless bandwidth network, the transmission path corresponding to the response information is determined. If the transmission path includes the target tunnel, it is determined to connect the target container to the wireless bandwidth network.
[0140] Optionally, the target container can be connected to the wireless broadband network according to the target tunnel in the following manner: start the tunnel function in the initial configuration file; add tunnel information to the initial configuration file according to the target tunnel to obtain the target configuration file; run the target configuration file to connect the target container to the wireless broadband network.
[0141] Among them, starting the tunnel function can ensure that when reading the configuration file, it can identify the function modules related to the tunnel that need to be enabled, laying the foundation for establishing a connection between the target container and the wireless bandwidth network.
[0142] Tunnel information includes the target tunnel interface and tunnel parameters.
[0143] Tunnel parameters may include interface name, IP address, etc., which are not limited here.
[0144] When running the target configuration file, you can adjust the network interface, set the route, configure access control, etc. according to the configuration instructions in the target configuration file, so that the container can communicate with the wireless bandwidth network using the target tunnel.
[0145] The network connection method provided in this embodiment initializes the network of the target container in response to the start operation of the target container, generates an initial configuration file; obtains the network parameters of the wireless bandwidth network; establishes a target tunnel between the target container and the wireless bandwidth network according to the initial configuration file and the network parameters; and connects the target container to the wireless bandwidth network according to the target tunnel. In this way, by integrating the wireless bandwidth network in the container network, the container network can be expanded as the wireless bandwidth network expands, and can provide higher data transmission speeds and lower delays than existing container networks to improve the communication efficiency of the network.
[0146] Next, combine Figure 3 , the process (S203) of establishing a target tunnel between the target container and the wireless bandwidth network according to the initial configuration file and the network parameters is explained.
[0147] Figure 3 A flowchart of another network connection method provided in an embodiment of the present application. Based on the above embodiment, see Figure 3 , the method comprising:
[0148] S301: Create an initial tunnel.
[0149] You can obtain a preset creation tool to create an initial tunnel.
[0150] S302: Determine a first address of a target container and a second address of a wireless bandwidth network according to an initial configuration file and network parameters.
[0151] The initial configuration file may be parsed to determine a first address of the target container, and the network parameters may be parsed to determine a second address of the wireless bandwidth network.
[0152] S303: Determine an initial tunnel interface in the initial tunnel.
[0153] The initial tunnel interface can be used in subsequent configurations to form the network interface for the complete tunnel connection.
[0154] A configuration file of the initial tunnel may be obtained, and an initial tunnel interface in the initial tunnel may be determined according to the configuration file of the initial tunnel.
[0155] The configuration file of the initial tunnel may be parsed to determine the initial tunnel interface in the initial tunnel.
[0156] It should be noted that the initial tunnel interface in the initial tunnel may be determined according to any feasible implementation method, and the embodiments of the present application do not limit this.
[0157] S304: Configure an initial tunnel interface according to the first address and the second address to obtain a target tunnel interface.
[0158] The initial tunnel interface may include a local endpoint and a remote endpoint.
[0159] The first address can be set to the address corresponding to the local endpoint and the second address can be set to the address corresponding to the remote endpoint through a configuration command, and the target tunnel interface can be determined according to the address corresponding to the local endpoint and the address corresponding to the remote endpoint.
[0160] S305. Configure tunnel parameters corresponding to the target tunnel interface.
[0161] Tunnel parameters may include subnet mask, gateway, routing information, operation mode, etc., which are not limited here.
[0162] The operation mode may include a datagram mode and a connection mode.
[0163] The target driver can be obtained, and tunnel parameters corresponding to the target tunnel interface can be configured according to the target driver.
[0164] The target driver may be a driver corresponding to an IP protocol on a wireless broadband network.
[0165] For example, the target driver may be a driver based on an IP protocol over wireless bandwidth (IP over InfiniBand, iPOIB), which is not limited here.
[0166] S306: Establish a target tunnel according to the target tunnel interface and tunnel parameters.
[0167] The target tunnel interface and tunnel parameters may be updated into the configuration file of the initial tunnel to obtain a first configuration file, and the first configuration file may be run to establish the target tunnel.
[0168] The implementation content of each step in the embodiment of the present application can refer to the description of the corresponding steps or operations in the above method embodiment, and repeated content will not be repeated.
[0169] The network connection method provided in this embodiment creates an initial tunnel; determines the first address of the target container and the second address of the wireless bandwidth network according to the initial configuration file and network parameters; determines the initial tunnel interface in the initial tunnel; configures the initial tunnel interface according to the first address and the second address to obtain the target tunnel interface; configures the tunnel parameters corresponding to the target tunnel interface; and establishes the target tunnel according to the target tunnel interface and the tunnel parameters. In this way, by integrating the wireless bandwidth network in the container network, the container network can be expanded as the wireless bandwidth network expands, and can provide higher data transmission speeds and lower delays than existing container networks to improve the communication efficiency of the network.
[0170] Next, combine Figure 4 , the technical solution shown in this application is explained through specific examples.
[0171] Figure 4 A flowchart of another network connection method provided in an embodiment of the present application. Figure 4 , the method comprising:
[0172] S401: In response to a start operation on a target container, network initialization is performed on the target container to generate an initial configuration file.
[0173] The execution process of S401 can refer to the execution process of S201, which will not be described in detail here.
[0174] S402: Obtain network parameters of the wireless bandwidth network.
[0175] The execution process of S402 can refer to the execution process of S202, which will not be repeated here.
[0176] S403: Create an initial tunnel.
[0177] The execution process of S403 can refer to the execution process of S301, which will not be described in detail here.
[0178] S404: Determine a first address of the target container and a second address of the wireless bandwidth network according to the initial configuration file and the network parameters.
[0179] The execution process of S404 can refer to the execution process of S302, which will not be described in detail here.
[0180] S405: Determine an initial tunnel interface in the initial tunnel.
[0181] The execution process of S405 can refer to the execution process of S303, which will not be described in detail here.
[0182] S406: Configure an initial tunnel interface according to the first address and the second address to obtain a target tunnel interface.
[0183] The execution process of S406 can refer to the execution process of S304, which will not be described in detail here.
[0184] S407: Configure tunnel parameters corresponding to the target tunnel interface.
[0185] The execution process of S407 can refer to the execution process of S305, which will not be described in detail here.
[0186] S408: Establish a target tunnel according to the target tunnel interface and tunnel parameters.
[0187] The execution process of S408 can refer to the execution process of S306, which will not be described in detail here.
[0188] S409: Start the tunnel function in the initial configuration file.
[0189] Among them, starting the tunnel function can ensure that when reading the configuration file, it can identify the function modules related to the tunnel that need to be enabled, laying the foundation for establishing a connection between the target container and the wireless bandwidth network.
[0190] S410. According to the target tunnel, add tunnel information to the initial configuration file to obtain the target configuration file.
[0191] Tunnel information includes the target tunnel interface and tunnel parameters.
[0192] Tunnel parameters may include interface name, IP address, etc., which are not limited here.
[0193] S411. Run the target configuration file to connect the target container to the wireless bandwidth network.
[0194] The execution process of S411 can refer to the execution process of S204, which will not be described in detail here.
[0195] In this way, by integrating the wireless bandwidth network into the container network, the container network can be expanded as the wireless bandwidth network expands, and can provide higher data transmission speed and lower latency than the existing container network to improve the communication efficiency of the network.
[0196] Figure 5 This is a schematic diagram of the structure of a network connection device provided in an embodiment of the present application. Figure 5 The network connection device 500 includes a generation module 501, an acquisition module 502, an establishment module 503 and a connection module 504, wherein:
[0197] A generating module 501 is used to perform network initialization on the target container in response to a startup operation on the target container, and generate an initial configuration file;
[0198] An acquisition module 502 is used to acquire network parameters of a wireless bandwidth network;
[0199] An establishing module 503, configured to establish a target tunnel between the target container and the wireless bandwidth network according to the initial configuration file and the network parameters;
[0200] The connection module 504 is configured to connect the target container to the wireless bandwidth network according to the target tunnel.
[0201] Optionally, in the above-mentioned device, the establishing module 503 is specifically used for:
[0202] Create the initial tunnel;
[0203] Determining a first address of the target container and a second address of the wireless bandwidth network according to the initial configuration file and the network parameters;
[0204] The initial tunnel is configured according to the first address and the second address, and the target tunnel is established.
[0205] Optionally, in the above-mentioned device, the establishing module 503 is specifically used for:
[0206] Determining an initial tunnel interface in the initial tunnel;
[0207] According to the first address and the second address, configure the initial tunnel interface to obtain a target tunnel interface;
[0208] Configure tunnel parameters corresponding to the target tunnel interface;
[0209] The target tunnel is established according to the target tunnel interface and the tunnel parameters.
[0210] Optionally, in the above-mentioned device, the generating module 501 is specifically used for:
[0211] In response to a start operation on a target container, obtaining preset configuration parameters;
[0212] According to the preset configuration parameters, the container parameters of the target container are configured to generate a container network;
[0213] Generate a virtual controller in the container network, and perform network configuration on the virtual controller to obtain a network controller;
[0214] An initial configuration file is generated according to the container network and the network controller.
[0215] Optionally, in the above-mentioned device, the connection module 504 is specifically used for:
[0216] Starting the tunnel function in the initial configuration file;
[0217] According to the target tunnel, tunnel information is added to the initial configuration file to obtain a target configuration file, wherein the tunnel information includes a target tunnel interface and tunnel parameters;
[0218] The target configuration file is run to connect the target container to the wireless bandwidth network.
[0219] Optionally, in the above device, the generating module 501 is further used for:
[0220] Run the wireless bandwidth driver to create a wireless bandwidth network;
[0221] Obtaining preset parameters of wireless bandwidth;
[0222] The wireless bandwidth network is initialized according to the preset parameters.
[0223] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 , the electronic device 600 may include: a memory 601 , a processor 602 , and a transceiver 603 .
[0224] The memory 601 is used to store program instructions;
[0225] The processor 602 is used to execute the program instructions stored in the memory, so as to enable the electronic device 600 to execute the above method.
[0226] The transceiver 603 may include: a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, a transmitter, a transmission port, a transmission interface, or the like, and the receiver may also be referred to as a receiver, a reception port, a reception interface, or the like. Exemplarily, the memory 601, the processor 602, and the transceiver 603 are interconnected via a bus 604.
[0227] The present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the above method can be implemented.
[0228] The embodiment of the present application also provides a computer program product, which can be executed by a processor. When the computer program product is executed, the above method can be implemented.
[0229] The network connection device, electronic device, computer-readable storage medium and computer program product of the embodiments of the present application can execute the technical solutions shown in the above-mentioned network connection method embodiments. Their implementation principles and beneficial effects are similar and will not be repeated here.
[0230] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0231] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0232] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0233] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0234] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0235] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0236] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0237] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0238] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A network connection method, characterized in that: The method comprises: In response to a start operation on a target container, network initialization is performed on the target container to generate an initial configuration file; Obtain network parameters of wireless bandwidth network; Establishing a target tunnel between the target container and the wireless bandwidth network according to the initial configuration file and the network parameters; According to the target tunnel, the target container is connected to the wireless bandwidth network.
2. The method according to claim 1, characterized in that Establishing a target tunnel between the target container and the wireless bandwidth network according to the initial configuration file and the network parameters includes: Create the initial tunnel; Determining a first address of the target container and a second address of the wireless bandwidth network according to the initial configuration file and the network parameters; The initial tunnel is configured according to the first address and the second address, and the target tunnel is established.
3. The method according to claim 2, characterized in that Configuring the initial tunnel according to the first address and the second address to obtain the target tunnel includes: Determining an initial tunnel interface in the initial tunnel; According to the first address and the second address, configure the initial tunnel interface to obtain a target tunnel interface; Configure tunnel parameters corresponding to the target tunnel interface; The target tunnel is established according to the target tunnel interface and the tunnel parameters.
4. The method according to any one of claims 1 to 3, characterized in that: In response to a start operation on a target container, network initialization is performed on the target container to generate an initial configuration file, including: In response to a start operation on a target container, obtaining preset configuration parameters; According to the preset configuration parameters, the container parameters of the target container are configured to generate a container network; Generate a virtual controller in the container network, and perform network configuration on the virtual controller to obtain a network controller; An initial configuration file is generated according to the container network and the network controller.
5. The method according to any one of claims 1 to 4, characterized in that: According to the target tunnel, connecting the target container to the wireless bandwidth network includes: Starting the tunnel function in the initial configuration file; According to the target tunnel, tunnel information is added to the initial configuration file to obtain a target configuration file, wherein the tunnel information includes a target tunnel interface and tunnel parameters; The target configuration file is run to connect the target container to the wireless bandwidth network.
6. The method according to any one of claims 1 to 5, characterized in that: Before obtaining the network parameters of the wireless bandwidth network, it also includes: Run the wireless bandwidth driver to create a wireless bandwidth network; Obtaining preset parameters of wireless bandwidth; The wireless bandwidth network is initialized according to the preset parameters.
7. A network connection device, characterized in that: The device comprises: A generating module, configured to perform network initialization on the target container and generate an initial configuration file in response to a startup operation on the target container; An acquisition module, used to acquire network parameters of a wireless bandwidth network; An establishing module, configured to establish a target tunnel between the target container and the wireless bandwidth network according to the initial configuration file and the network parameters; A connection module is used to connect the target container to the wireless bandwidth network according to the target tunnel.
8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.