Network configuration method and device, electronic equipment and storage medium

CN119866620APending Publication Date: 2025-04-22SIEMENS AG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280099718.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-09-27
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

Existing network configuration methods are highly labor-intensive and time-consuming when configuring communication networks for a large number of applications, are difficult to effectively avoid the risk of network attacks, and are difficult to achieve better data exchange performance and balance.

Method used

Reduce manual intervention by obtaining environmental information for applications, automatically grouping them and determining communication methods based on communication needs, using pre-created memory swap, LAN or WAN configuration templates for network configuration.

Benefits of technology

It realizes automated network configuration for a large number of applications, reduces manual labor intensity and configuration time, improves the accuracy and efficiency of network configuration, and is suitable for communication network configuration of large-scale applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119866620A_ABST
    Figure CN119866620A_ABST
Patent Text Reader

Abstract

The invention provides a network configuration method and device, electronic equipment and a storage medium, and the network configuration method comprises the steps: obtaining environment information of at least two application programs, the environment information being used for indicating hosts where the application programs are located and a communication mode between the hosts; at least two application programs are grouped according to the environment information, at least one program group is obtained, each program group comprises at least two application programs, and different program groups correspond to different inter-program communication modes; the application programs in the same program group communicate through the inter-program communication mode corresponding to the program group; according to a communication demand between the at least two application programs, determining at least one application program pair needing communication; and performing communication network configuration on the two application programs included in the application program pair according to the inter-program communication mode corresponding to the program group including the application program pair. The scheme is suitable for configuring the communication network for a large number of application programs.
Need to check novelty before this filing date? Find Prior Art

Description

Network configuration method, device, electronic device and storage medium Technical Field

[0001] The present application relates to the field of network communication technology, and in particular to a network configuration method, device, electronic device and storage medium. Background Art

[0002] Containers are a mainstream application deployment method. Containers use a sandbox mechanism and have no interfaces between them. That is, applications are isolated from the outside world when running in containers. Data exchange between containers and hosts, or between containers, requires a data distribution service. Therefore, a communication network with data distribution services must be configured for each application running in the container and on the host.

[0003] Currently, network engineers manually configure the communication network for data distribution services for each application.

[0004] However, network configuration is a complex and professional task. Avoiding the risk of network attacks and achieving better data exchange performance and balance when configuring communication networks requires network engineers to spend a lot of time testing and verifying. Therefore, configuring communication networks for a large number of applications requires high manual labor and a long time. Therefore, existing network configuration methods are not suitable for configuring communication networks for a large number of applications.

[0005] Summary of the Invention

[0006] In view of this, the network configuration method, device, electronic device and storage medium provided in this application are suitable for configuring communication networks for a large number of applications.

[0007] According to a first aspect of an embodiment of the present application, a network configuration method is provided, comprising: obtaining environmental information of at least two applications, wherein the environmental information is used to indicate a host where the application is located and a communication method between hosts; grouping the at least two applications according to the environmental information to obtain at least one program grouping, wherein each of the program groups includes at least two applications, different program groups correspond to different inter-program communication methods, and applications in the same program group communicate with each other through the inter-program communication method corresponding to the program group; determining at least one application pair that needs to communicate according to the communication requirements between the at least two applications; and performing a communication network configuration for the two applications included in the application pair according to the inter-program communication method corresponding to the program group including the application pair.

[0008] In one possible implementation, grouping the at least two applications according to the environmental information to obtain at least one program group includes: performing at least one of the following operations according to the environmental information: (i) dividing the applications located on the same host into a program group; and (ii) grouping the applications located on different hosts according to a communication method between the hosts to obtain at least one program group.

[0009] In one possible implementation, the application programs located on different hosts are grouped according to the communication method between the hosts to obtain at least one program group, including: dividing at least two application programs located on different hosts and communicating with each other through the same local area network into one program group; and dividing at least two application programs located on different hosts and communicating with each other through a wide area network into one program group.

[0010] In one possible implementation, the communication network configuration is performed on the two applications included in the application pair according to the inter-program communication mode corresponding to the program group including the application pair, including: if the application pair is included in the first program group, the communication network configuration is performed on the two applications included in the application pair through a pre-created memory exchange configuration template, so that the application pair communicates through memory exchange, wherein the applications in the first program group are located on the same host; if the application pair is included in the second program group, the communication network configuration is performed on the two applications included in the application pair through a pre-created LAN configuration template, so that the application pair communicates through a LAN, wherein the applications in the second program group are located on different hosts that communicate through a LAN; if the application pair is included in the third program group, the communication network configuration is performed on the two applications included in the application pair through a pre-created WAN configuration template, so that the application pair communicates through a WAN, wherein the applications in the third program group are located on different hosts that communicate through a WAN.

[0011] In one possible implementation, the method further includes: if the operating environment of the application is a container, configuring a bridge network for the application so that the application accesses the default network and memory of the host where the application is located through the bridge network.

[0012] In one possible implementation, the method further includes: generating configuration information, wherein the configuration information is used to indicate program grouping information, application pair information, and communication network configuration information; generating a configuration list including the configuration information, and outputting the configuration list.

[0013] According to a second aspect of an embodiment of the present application, a network configuration device is provided, comprising: an acquisition module for acquiring environmental information of at least two applications, wherein the environmental information is used to indicate the host where the application is located and the communication mode between the hosts; a grouping module for grouping the at least two applications according to the environmental information to obtain at least one program grouping, wherein each of the program groups includes at least two applications, different program groups correspond to different communication modes, and the applications in the same program group communicate with each other through the communication mode corresponding to the program group; a pairing module for determining at least one application pair that needs to communicate based on the communication requirements between the at least two applications; and a configuration module for performing communication network configuration for the two applications included in the application pair according to the communication mode corresponding to the program group including the application pair.

[0014] In one possible implementation, the network configuration device also includes: a first generation module for generating configuration information, wherein the configuration information is used to indicate program grouping information, application pair information and communication network configuration information; a second generation module for generating a configuration list including the configuration information and outputting the configuration list.

[0015] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the network configuration method provided in the first aspect above.

[0016] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer instructions are stored. When the computer instructions are executed by a processor, the processor performs operations corresponding to the network configuration method provided in the first aspect above.

[0017] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, which is tangibly stored on a computer-readable medium and includes computer-executable instructions, which, when executed, cause at least one processor to perform a network configuration method as provided in the first aspect or any possible implementation of the first aspect.

[0018] According to the above technical solution, the applications are divided into multiple program groups according to the different environmental information of each application, that is, the different hosts where the applications are located and the communication methods between the hosts. In this way, each program group can correspond to a communication method between programs, and a large number of applications can be divided into a limited number of program groups. The communication method of each application pair is determined according to the communication method between programs in the program group where the application pair is located. There is no need to manually determine the communication method between each application, which reduces the intensity of manual labor. In addition, since the process of configuring the communication network for each application is automatically executed by the system without manual participation, the time spent on configuring the communication network for a large number of applications can be reduced. Therefore, this method is suitable for configuring the communication network for a large number of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] FIG1 is a flow chart of a network configuration method provided in an embodiment of the present application;

[0020] FIG2 is a topological diagram of a network configuration provided in an embodiment of the present application;

[0021] FIG3 is a flow chart of another network configuration method provided in an embodiment of the present application;

[0022] FIG4 is a schematic diagram of a network configuration device provided in an embodiment of the present application;

[0023] FIG5 is a schematic diagram of another network configuration device provided in an embodiment of the present application;

[0024] FIG6 is a schematic diagram of an electronic device provided in an embodiment of the present application.

[0025] List of reference numerals:

[0026] 101: Get environment information for at least two applications

[0027] 102: Group at least two applications according to the environment information to obtain at least one application group

[0028] 103: According to the communication requirements between the applications, determine at least one application pair that needs to communicate.

[0029] 104: Configure the communication network for the application based on the inter-program communication method used by the application to group the programs.

[0030] 105: Generate configuration information

[0031] 106: Generate a configuration list including configuration information and output the configuration list

[0032] 100: Network configuration method 201-204: Application 205: First host

[0033] 206: Second host 207: Cloud 400: Network configuration device

[0034] 401: Acquisition module 402: Grouping module 403: Pairing module

[0035] 404: Configuration module 405: First generation module 406: Second generation module

[0036] 600: Electronic device 602: Processor 604: Communication interface

[0037] 606: Memory 608: Communication bus 610: Program

[0038] N: Memory communication G: WAN communication J: LAN communication DETAILED DESCRIPTION

[0039] As mentioned above, containers are a mainstream application deployment method. Because containers use a sandbox mechanism, there are no interfaces between them. That is, when applications run in containers, they are isolated from the outside world. Data exchange between containers and hosts, or between containers, requires a data distribution service. Therefore, it is necessary to configure a communication network for the data distribution service for applications running in containers and running on hosts. Currently, network engineers manually configure the communication network for the data distribution service of each application. However, network configuration is a complex and professional task. How to avoid the risk of network attacks when configuring the communication network and how to achieve better data exchange performance and balance require network engineers to spend a lot of time testing and verification. Therefore, applying existing network configuration methods to configure communication networks for a large number of applications requires a lot of manual labor and a long time. Therefore, existing network configuration methods are not suitable for configuring communication networks for a large number of applications.

[0040] In an embodiment of the present application, environmental information of each application is obtained, and each application is grouped according to the environmental information to obtain program groups. Then, application pairs are determined according to the communication requirements between the applications, and a network is configured for each application in the application pair according to the inter-program communication method corresponding to the program group in which the application pair is located. It can be seen that the applications are divided into multiple program groups according to different environmental information, that is, the host where the application is located and the communication method between the hosts. Therefore, each program group can be corresponded to an inter-program communication method, and a large number of applications can be divided into a limited number of program groups. The communication method of each application pair is determined according to the inter-program communication method of the program group. There is no need to manually determine the communication method between each application, which reduces the intensity of manual labor. The process of configuring the communication network for each application is automatically executed by the system without manual participation, which can reduce the time spent on configuring the communication network for a large number of applications. Therefore, this method is suitable for configuring the communication network for a large number of applications.

[0041] The network configuration method, device, and electronic device provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0042] Network configuration method

[0043] FIG1 is a flow chart of a network configuration method provided by an embodiment of the present application. As shown in FIG1 , the network configuration method 100 includes the following steps:

[0044] Step 101: Obtain environment information of at least two applications, wherein the environment information is used to indicate the hosts where the applications are located and the communication mode between the hosts.

[0045] The environment information of each application is determined based on the behavior of multiple applications, including interactive behavior, networking behavior, and so on. The environment information is used to indicate the host where the application resides and the communication method between the hosts, including but not limited to host network communication, local area network communication, and so on.

[0046] It should be understood that since multiple applications may come from multiple hosts, the environmental information includes the communication method between different hosts. If multiple applications come from the same host and the host does not need to communicate with other hosts, the environmental information includes the hosts where the multiple applications are located.

[0047] Step 102: Group at least two applications according to the environmental information to obtain at least one program group, wherein each program group includes at least two applications, different program groups correspond to different inter-program communication methods, and applications in the same program group communicate with each other through the inter-program communication method corresponding to the program group.

[0048] The applications are grouped according to their environment information, and multiple applications that communicate with each other through the same communication method are divided into a program group. Different program groups correspond to different communication methods between programs. Depending on the different environment information, that is, the host where the application is located and the communication method between the hosts, the communication method between applications is different. For example: if two applications are on the same host, they communicate through the host; if the two applications are on different hosts, they communicate through the network, and so on.

[0049] Step 103: Determine at least one application pair that needs to communicate based on the communication requirements between at least two applications.

[0050] A plurality of applications that need to communicate are determined, and the plurality of applications that need to communicate are paired with each other to obtain a plurality of application pairs.

[0051] It should be noted that the communication requirements between applications need to be determined manually. The communication requirements are set manually based on the dependencies and data exchange requirements between the applications. For example, if the use of the first application depends on the first application, then the first application and the second application are set to have communication requirements. After the system recognizes the requirement, it determines the first application and the second application as an application pair.

[0052] Step 104: Perform communication network configuration for the two applications included in the application pair according to the inter-program communication mode corresponding to the program group including the application pair.

[0053] According to the different communication methods of the application groups to which each application pair belongs, a communication network is configured for the two applications included in the application pair. The configured network corresponds to the inter-program communication method corresponding to the program group. For example: if the inter-program communication method corresponding to the program group is LAN communication, then a LAN network is configured for the two applications included in the application pair.

[0054] It should be understood that since there may be situations where the same application has communication needs with different applications, an application may be divided into different program groups, and different program groups correspond to different inter-program communication methods. Therefore, the same application may be configured with multiple networks. For example: the first application needs to communicate with the second application on the same host and the third application on a different host. When configuring the network, the first application will configure the same host communication network and the different host communication network.

[0055] In an embodiment of the present application, the applications are divided into multiple program groups based on the different environmental information of each application, that is, the different hosts where the applications are located and the communication methods between the hosts. In this way, each program group can correspond to a communication method between programs, and a large number of applications can be divided into a limited number of program groups. The communication method of each application pair is determined based on the communication method between programs in the program group where the application pair is located. There is no need to manually determine the communication method between each application, which reduces the intensity of manual labor. Moreover, since the process of configuring the communication network for each application is automatically executed by the system without manual participation, the time spent on configuring the communication network for a large number of applications can be reduced. Therefore, this method is suitable for configuring the communication network for a large number of applications.

[0056] In one possible implementation, at least two applications are grouped according to the environment information. When at least one application group is obtained, at least one of the following operations may be performed according to the environment information:

[0057] (i) Divide the applications on the same host into a program group;

[0058] (ii) Grouping application programs located on different hosts according to a communication mode between the hosts to obtain at least one program group.

[0059] Different hosts cannot communicate directly and must communicate over the network. Therefore, data exchange between applications on different hosts depends on the host's communication method. When grouping, applications on the same host are grouped together. Applications within a group communicate through their host. Applications on different hosts are grouped together based on their communication methods. Applications within a group communicate using the communication methods between different hosts.

[0060] In an embodiment of the present application, applications located on the same host are divided into one program group, and applications located on different hosts are divided into multiple program groups according to the communication method between the hosts. In this way, the applications can be accurately divided into corresponding program groups when grouping, avoiding the situation where applications on different hosts are divided into program groups corresponding to applications on the same host due to application grouping errors, causing communication failure between applications. The network configuration of each application is more accurate according to the program grouping, thereby improving the accuracy and efficiency of network configuration of the application.

[0061] In one possible implementation, applications located on different hosts are grouped based on a communication method between the hosts. When obtaining at least one program group, at least two applications located on different hosts that communicate with each other via the same local area network are grouped into one program group. At least two applications located on different hosts that communicate with each other via a wide area network are grouped into one program group.

[0062] In an embodiment of the present application, applications located on different hosts are grouped according to the communication methods between different hosts, so that different communication networks can be configured for applications located on different hosts according to the different communication methods between programs corresponding to the group. The grouping rules are refined, the network configuration of the application is made more accurate, and the efficiency of configuring communication networks for a large number of applications is improved.

[0063] In one possible implementation, when configuring a communication network for two applications included in an application pair according to an inter-program communication method corresponding to a program group including the application pair, if the application pair is included in a first program group, a communication network is configured for the two applications included in the application pair through a pre-created memory exchange configuration template, so that the application pair communicates through memory exchange, wherein the applications in the first program group are located on the same host.

[0064] A memory swap configuration template is created in advance. The memory swap configuration template corresponds to the program grouping divided by applications on the same host. This template can configure the memory swap communication mode for two applications on the same host that need to communicate. That is, when two applications are located on the same host, they do not need to communicate over the network and can exchange data by sharing the host's memory.

[0065] Optionally, if the application is running in a container, add the "--ipc=host" command to the docker run script to connect the container to the host's memory. This allows for memory swap communication between containers running on the same host, or between a container running on the same host and a local application.

[0066] In an embodiment of the present application, when two applications that need to communicate are located on the same host, the communication method between the two applications is configured through a memory exchange configuration template, so that the applications on the same host can communicate through shared host memory, thereby achieving optimal communication performance when communicating between the two applications on the same host, thereby improving the practicality of the network configuration method.

[0067] In one possible implementation, when configuring a communication network for two applications included in an application pair according to an inter-program communication method corresponding to a program group including the application pair, if the application pair is included in a second program group, a communication network is configured for the two applications included in the application pair through a pre-created LAN configuration template, so that the application pair communicates through the LAN, wherein the applications in the second program group are located on different hosts that communicate through the LAN.

[0068] A LAN configuration template is created in advance. The LAN configuration template corresponds to the program grouping of applications located on different hosts and communicating through the same LAN. This template can configure LAN communication for two applications located on different hosts that need to communicate, that is, when the two applications are located on different hosts, data is exchanged through the LAN.

[0069] Specifically, an IPv4 or MACv4 network can be configured for the two applications to optimize network performance and security during communication.

[0070] It should be understood that IPv4L represents a new approach to network virtualization technology. The Linux implementation is lightweight because, rather than using a traditional Linux bridge for isolation, it is associated with Linux Ethernet interfaces or subinterfaces to enforce separation between networks and connectivity to the physical network. IPv4L offers many unique features and provides ample room for further innovation in various models.

[0071] It should also be understood that when an application runs in a container, the macvlan network driver can be used to assign a MAC address to each container's virtual network interface, making it appear to be a physical network interface directly connected to the physical network. In this case, a physical interface can be specified on the container host for configuring macvlan, as well as the macvlan's subnet and gateway.

[0072] In an embodiment of the present application, when two applications that need to communicate are located on different hosts and the communication method between the hosts is LAN communication, the communication method between the two applications is configured through the LAN configuration template, so that the two applications communicate through the LAN, thereby realizing the configuration of communication networks for applications on different hosts. During configuration, the system automatically configures the network of the application according to the pre-set LAN configuration template without manual intervention, so that the network configuration method can be applied to network configuration of a large number of applications.

[0073] In one possible implementation, when configuring a communication network for two applications included in an application pair according to the inter-program communication method corresponding to the program group including the application pair, if the application pair is included in a third program group, then using a pre-created wide area network configuration template, configuring a communication network for the two applications included in the application pair so that the application pair communicates through the wide area network, wherein the applications in the third program group are located on different hosts that communicate through the wide area network.

[0074] A WAN configuration template is created in advance. The WAN configuration template corresponds to the program grouping divided by applications located on different hosts and communicating with each other through the WAN. This template can configure WAN communication for two applications located on different hosts that need to communicate. That is, when the two applications are located on different hosts, data is exchanged through the WAN.

[0075] Specifically, you can configure an Overlay network or a 3rd party plug-in Weave network for applications to communicate between them.

[0076] It should be understood that the Overlay network driver can create a distributed network between multiple hosts. This network is overlaid on the host network, allowing connected hosts to communicate securely.

[0077] It should also be understood that Weave Net can create a virtual network that can connect containers on multiple hosts across hosts. With the help of Weave Net, microservice-based applications can run anywhere, such as on one host, multiple hosts, or even in the cloud and data center.

[0078] Optionally, if an application needs to run in a secure network environment, it can be disconnected from the WAN. For example, a database running on both the LAN and the WAN can be given access to another application running on the same LAN while being disconnected from the WAN to prevent network attacks.

[0079] In an embodiment of the present application, when two applications that need to communicate are located on different hosts and the communication method between the hosts is wide area network communication, the communication method between the two applications is configured through a wide area network configuration template, so that the two applications communicate through the wide area network, thereby realizing the configuration of communication networks for applications on different hosts. During configuration, the system automatically configures the network of the application according to the pre-set wide area network configuration template without manual intervention, so that the network configuration method can be applied to network configuration of a large number of applications.

[0080] For example, FIG2 is a topology diagram of a network configuration provided by an embodiment of the present application. As shown in FIG2 , application 201 and application 203 need to communicate and are both located on a first host 205. Therefore, memory exchange communication N is configured for application 201 and application 203. Application 201 and application 204 need to communicate. Application 201 is located on a first host 205, and application 204 is located on a second host 206. First host 205 and second host 206 are on a local area network. Therefore, local area network communication J is configured for application 201 and application 204. Application 202 and application 204 need to communicate. Application 202 runs in a cloud 207, and application 204 is located on a second host 206. Therefore, wide area network communication G is configured for application 202 and application 204.

[0081] In one possible implementation, if the application's runtime environment is a container, a bridge network is configured for the application so that the application accesses the default network and memory of the host where the application is located through the bridge network.

[0082] Since the application is isolated from the outside world when running in a container, the operating environment of the application is detected. If the operating environment of the application is a container, a bridge network is set up for the container so that the container can be connected to the host through the bridge network.

[0083] It should be understood that the host network is the default network of the host. Applications running directly on the host can use the host network by default without configuration. Applications running in containers can specify the network parameter (--network == host) when starting the container. This operation enables the container to use the host network through bridge networking.

[0084] In an embodiment of the present application, the operating environment of the application is detected. If the application is running in a container, a bridge network is set for the container so that the container can be connected to the host through the bridge network, so that the application running in the container can exchange data with other applications through the host, and thus the network configuration of the application running locally on the host and the application running in the container can be performed with the same configuration rules, thereby reducing the complexity of network configuration and improving the efficiency of network configuration for a large number of applications.

[0085] FIG3 is a flow chart of another network configuration method provided in an embodiment of the present application. As shown in FIG3 , the network configuration method 300 further includes the following steps:

[0086] Step 301: Obtain environment information of at least two applications, wherein the environment information is used to indicate the hosts where the applications are located and the communication mode between the hosts.

[0087] Step 302: Group at least two applications according to the environmental information to obtain at least one program group, wherein each program group includes at least two applications, different program groups correspond to different inter-program communication methods, and applications in the same program group communicate with each other through the inter-program communication method corresponding to the program group.

[0088] Step 303: Determine at least one application pair that needs to communicate based on the communication requirements between at least two applications.

[0089] Step 304: Perform communication network configuration for the two applications included in the application pair according to the inter-program communication mode corresponding to the program group including the application pair.

[0090] It should be noted that the above steps 301 to 304 may refer to steps 101 to 104 in the above embodiment, and will not be described in detail here.

[0091] Step 305: Generate configuration information, where the configuration information is used to indicate program grouping information, application pair information, and communication network configuration information.

[0092] Configuration information including program grouping information of each application program, application pair information, and communication network configuration information of each application program is generated.

[0093] Step 306: Generate a configuration list including configuration information and output the configuration list.

[0094] Outputs configuration information as a configuration manifest.

[0095] In an embodiment of the present application, program grouping information, application pair information, and communication network configuration information are output as a configuration list. This list can help users diagnose faults in the configured network when the network configuration fails or the application cannot use the configured network communication, thereby reducing the knowledge threshold and workload of network diagnosis and improving the practicality of the network configuration method.

[0096] Network configuration device

[0097] FIG4 is a schematic diagram of a network configuration device provided in an embodiment of the present application. As shown in FIG4 , the network configuration device 400 includes:

[0098] The acquisition module 401 is used to acquire environment information of at least two applications, wherein the environment information is used to indicate the hosts where the applications are located and the communication mode between the hosts.

[0099] The grouping module 402 is used to group at least two applications according to environmental information to obtain at least one program group, wherein each program group includes at least two applications, different program groups correspond to different communication methods, and the applications in the same program group communicate with each other through the communication method corresponding to the program group.

[0100] The pairing module 403 is configured to determine at least one application pair that needs to communicate based on the communication requirements between at least two applications.

[0101] The configuration module 404 is configured to perform communication network configuration for the two applications included in the application pair according to the communication mode corresponding to the program group including the application pair.

[0102] In an embodiment of the present application, the acquisition module 401 can be used to execute step 101 in the above method embodiment, the grouping module 402 can be used to execute step 102 in the above method embodiment, the pairing module 403 can be used to execute step 103 in the above method embodiment, and the configuration module 404 can be used to execute step 104 in the above method embodiment.

[0103] In one possible implementation, the grouping module 402 can be used to perform at least one of the following operations based on environmental information: (i) dividing applications located on the same host into a program group; (ii) grouping applications located on different hosts based on a communication method between the hosts to obtain at least one program group.

[0104] In one possible implementation, the grouping module 402 can be used to divide at least two applications located on different hosts and communicating with each other through the same local area network into a program group; and divide at least two applications located on different hosts and communicating with each other through a wide area network into a program group.

[0105] In one possible implementation, the grouping module 402 can be used to, if the application pair is included in the first program grouping, perform a communication network configuration for the two applications included in the application pair through a pre-created memory exchange configuration template, so that the application pair communicates through memory exchange, wherein the applications in the first program grouping are located on the same host; if the application pair is included in the second program grouping, perform a communication network configuration for the two applications included in the application pair through a pre-created LAN configuration template, so that the application pair communicates through the LAN, wherein the applications in the second program grouping are located on different hosts that communicate through the LAN; if the application pair is included in the third program grouping, perform a communication network configuration for the two applications included in the application pair through a pre-created WAN configuration template, so that the application pair communicates through the WAN, wherein the applications in the third program grouping are located on different hosts that communicate through the WAN.

[0106] In one possible implementation, if the application's runtime environment is a container, a bridge network is configured for the application so that the application accesses the default network and memory of the host where the application is located through the bridge network.

[0107] FIG5 is a schematic diagram of another network configuration device provided by an embodiment of the present application. As shown in FIG5 , based on the network configuration device 400 shown in FIG4 , the network configuration device 400 further includes:

[0108] The first generating module 405 is configured to generate configuration information, wherein the configuration information is used to indicate program grouping information, application program pair information, and communication network configuration information.

[0109] The second generating module 406 is configured to generate a configuration list including configuration information and output the configuration list.

[0110] In an embodiment of the present application, the acquisition module 401 can be used to execute step 301 in the above method embodiment, the grouping module 402 can be used to execute step 302 in the above method embodiment, the pairing module 403 can be used to execute step 303 in the above method embodiment, the configuration module 404 can be used to execute step 304 in the above method embodiment, the first generation module 405 can be used to execute step 305 in the above method embodiment, and the second generation module 406 can be used to execute step 306 in the above method embodiment.

[0111] electronic devices

[0112] FIG6 is a schematic diagram of an electronic device provided in an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.

[0113] 6 , an electronic device 600 provided in an embodiment of the present application includes: a processor 602, a communications interface 604, a memory 606, and a communication bus 608. In particular:

[0114] The processor 602 , the communication interface 604 , and the memory 606 communicate with each other via a communication bus 608 .

[0115] The communication interface 604 is used to communicate with other electronic devices or servers.

[0116] The processor 602 is configured to execute the program 610, and specifically may execute the relevant steps in any of the aforementioned network configuration method embodiments.

[0117] Specifically, the program 610 may include program codes, which include computer operation instructions.

[0118] Processor 602 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs, or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0119] The memory 606 is used to store the program 610. The memory 606 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0120] The program 610 may be specifically configured to enable the processor 602 to execute the network configuration method in any of the aforementioned embodiments.

[0121] The specific implementation of each step in program 610 can refer to the corresponding description of the corresponding steps and units in any of the aforementioned network configuration method embodiments, and will not be repeated here. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the devices and modules described above can refer to the corresponding process descriptions in the aforementioned method embodiments, and will not be repeated here.

[0122] Through the electronic device of the embodiment of the present application, the applications are divided into multiple program groups according to the different environmental information of each application, that is, the different hosts where the applications are located and the communication methods between the hosts. In this way, each program group can correspond to a communication method between programs, and a large number of applications can be divided into a limited number of program groups. The communication method of each application pair is determined according to the communication method between programs in the program group where the application pair is located. There is no need to manually determine the communication method between each application, which reduces the intensity of manual labor. Moreover, since the process of configuring the communication network for each application is automatically executed by the system without manual participation, the time spent on configuring the communication network for a large number of applications can be reduced. Therefore, this method is suitable for configuring the communication network for a large number of applications.

[0123] Computer-readable storage medium

[0124] The present application also provides a computer-readable storage medium storing instructions for causing a machine to execute the network configuration method described herein. Specifically, a system or device equipped with a storage medium can be provided, wherein the storage medium stores software program code that implements the functions of any of the above embodiments, and a computer (or CPU or MPU) of the system or device can read and execute the program code stored in the storage medium.

[0125] In this case, the program code read from the storage medium itself can realize the function of any one of the above embodiments, so the program code and the storage medium storing the program code constitute part of this application.

[0126] Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code can be downloaded from a server computer via a communication network.

[0127] In addition, it should be clear that the functions of any of the above embodiments can be achieved not only by executing the program code read by the computer, but also by enabling the operating system operating on the computer to complete part or all of the actual operations based on the instructions of the program code.

[0128] In addition, it can be understood that the program code read from the storage medium is written into a memory provided in an expansion board inserted into the computer or into a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above embodiments.

[0129] Computer program product

[0130] The present application also provides a computer program product tangibly stored on a computer-readable medium and comprising computer-executable instructions. When executed, the computer-executable instructions cause at least one processor to perform the network configuration methods provided in the aforementioned embodiments. It should be understood that each solution in this embodiment has the corresponding technical effects of the aforementioned method embodiments and will not be further elaborated here.

[0131] It should be noted that not all steps and modules in the above processes and system structure diagrams are required, and certain steps or modules can be omitted according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or may be implemented by certain components in multiple independent devices.

[0132] In the above embodiments, the hardware module can be implemented mechanically or electrically. For example, a hardware module can include a permanent dedicated circuit or logic (such as a dedicated processor, FPGA or ASIC) to complete the corresponding operation. The hardware module can also include programmable logic or circuits (such as a general-purpose processor or other programmable processors), which can be temporarily set by software to complete the corresponding operation. The specific implementation method (mechanical method, or dedicated permanent circuit, or temporarily set circuit) can be determined based on cost and time considerations.

[0133] The present application has been presented and described in detail above through the accompanying drawings and preferred embodiments. However, the present application is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present application, and these embodiments are also within the scope of protection of the present application.

Claims

1. A network configuration method (100), comprising: Obtaining environment information of at least two applications, wherein the environment information is used to indicate hosts where the applications are located and communication methods between the hosts; Grouping the at least two applications according to the environment information to obtain at least one program group, wherein each program group includes at least two applications, different program groups correspond to different inter-program communication modes, and applications in the same program group communicate with each other using the inter-program communication mode corresponding to the program group; Determining at least one application pair that needs to communicate based on a communication requirement between the at least two applications; According to the inter-program communication mode corresponding to the program group including the application pair, a communication network configuration is performed on the two application programs included in the application pair.

2. The method according to claim 1, wherein The grouping the at least two application programs according to the environment information to obtain at least one program group includes: Based on the environment information, perform at least one of the following operations: (i) dividing the application programs located on the same host into a program group; (ii) Grouping application programs located on different hosts according to a communication mode between the hosts to obtain at least one program group.

3. The method according to claim 2, wherein: The step of grouping application programs on different hosts according to the communication mode between the hosts to obtain at least one program group includes: At least two applications located on different hosts and communicating with each other through the same local area network are divided into a program group; At least two application programs that are located on different hosts and communicate with each other through a wide area network are divided into a program group.

4. The method according to claim 3, wherein: The configuring a communication network for two applications included in the application pair according to the inter-program communication mode corresponding to the program group including the application pair includes: If the application pair is included in a first program group, performing communication network configuration on two applications included in the application pair using a pre-created memory exchange configuration template, so that the application pair communicates through memory exchange, wherein the applications in the first program group are located on the same host; If the application pair is included in a second program group, performing communication network configuration on the two applications included in the application pair using a pre-created local area network configuration template, so that the application pair communicates via the local area network, wherein the applications in the second program group are located on different hosts communicating via the local area network; If the application pair is included in the third program group, the communication network configuration is performed on the two applications included in the application pair through a pre-created wide area network configuration template, so that the application pair communicates through the wide area network, wherein the applications in the third program group are located on different hosts that communicate through the wide area network.

5. The method according to claim 1, wherein The method further includes: if the operating environment of the application is a container, configuring a bridge network for the application, so that the application accesses the default network and memory of the host where the application is located through the bridge network.

6. The method according to any one of claims 1 to 5, wherein: The method further comprises: generating configuration information, wherein the configuration information is used to indicate program grouping information, application pair information, and communication network configuration information; A configuration list including the configuration information is generated and the configuration list is output.

7. A network configuration device (400), comprising: An acquisition module (401) is used to acquire environment information of at least two applications, wherein the environment information is used to indicate the host where the application is located and the communication mode between the hosts; A grouping module (402) is configured to group the at least two applications according to the environment information to obtain at least one program group, wherein each program group includes at least two applications, different program groups correspond to different communication modes, and applications in the same program group communicate with each other using the communication mode corresponding to the program group; A pairing module (403) is configured to determine at least one application pair that needs to communicate based on the communication requirements between the at least two applications; The configuration module (404) is used to configure the communication network for the two applications included in the application pair according to the communication mode corresponding to the program group including the application pair.

8. The device according to claim 6, wherein The network configuration device (400) further includes: A first generating module (405) is used to generate configuration information, wherein the configuration information is used to indicate program grouping information, application pair information and communication network configuration information; The second generating module (406) is used to generate a configuration list including the configuration information and output the configuration list.

9. An electronic device (600), characterized in that include: A processor (602), a communication interface (604), a memory (606), and a communication bus (608), wherein the processor (602), the memory (606), and the communication interface (604) communicate with each other via the communication bus (608); The memory (606) is used to store at least one executable instruction, and the executable instruction enables the processor (602) to perform an operation corresponding to the network configuration method (100) according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, which, when executed by a processor, enable the processor to perform the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The computer program product is tangibly stored on a computer-readable medium and comprises computer-executable instructions which, when executed, cause at least one processor to perform the method according to any one of claims 1-6.