Network management method and device, electronic equipment and storage medium
By obtaining and generating network configuration files in an industrial environment, the automatic switching of the main and backup network segment addresses is solved, and the problems of high redundant network design cost and complex configuration are improved, and network reliability and communication efficiency in the LAN are improved. .
Patent Information
- Application Number
- CN202411240153.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, redundant network design is high and the configuration is complex, making it difficult to effectively ensure the high reliability of the network in an industrial environment.
By obtaining network segment configuration parameters, generating network configuration files, and automatically switching between main and backup network segment addresses between nodes in the LAN, avoiding nodes from querying remote DNS servers, and achieving rapid failure conversion and network communication recovery.
It reduces the cost of redundant network design, simplifies the configuration process, improves the network reliability between nodes in the LAN, avoids production stagnation and equipment failure caused by network interruption, and meets the high-timedness needs of the industrial environment.
Smart Images

Figure CN119135525A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a network management method, device, electronic device and storage medium. Background Art
[0002] In industrial environments, high network reliability is the primary requirement. Production equipment and control systems rely on network communications for coordination and control, and any network interruption may lead to production stagnation, equipment failure, or even safety accidents.
[0003] Normally, industrial data needs to be transmitted in real time, especially in automated production lines and process control, where timeliness is very important. Common redundant network solutions usually provide network reliability assurance through network switches that support professional redundant protocols such as Parallel Redundancy Protocol (PRP), Industrial Automation Network Redundancy Protocol (DLR), Ethernet-based zero-delay and zero-frame-loss network protocol (High-availability Seamless Redundancy, HSR), and Medium Redundancy Protocol (MRP). However, all of the above solutions require special hardware support, high cost, and complex configuration and operation, requiring engineers to master related network protocols and network configuration and other professional skills. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a network management method, device, electronic device and storage medium to solve the problems in the prior art of high cost and complex configuration of redundant network design.
[0005] In a first aspect of an embodiment of the present application, a network management method is provided, the method comprising: obtaining a network segment configuration parameter, the network segment configuration parameter including a primary network segment network address and a backup network segment network address corresponding to each node in a local area network; generating a network configuration file according to the network segment configuration parameter, and sending the network configuration file to each node in the local area network, so that the nodes included in the local area network perform network communication according to the primary network segment network address corresponding to each node in the network configuration file; performing fault detection on the primary network segment network address in the network configuration file, and if the fault detection result indicates that a network fault occurs in the primary network segment network address, adjusting the backup network segment network address corresponding to the primary network segment network address of the network fault in the network configuration file to a new primary network segment network address, so that the nodes in the local area network perform network communication according to the adjusted network configuration file.
[0006] According to a second aspect of an embodiment of the present application, a network management device is provided, which includes: an acquisition module for acquiring network segment configuration parameters, wherein the network segment configuration parameters include a primary network segment network address and a backup network segment network address corresponding to each node in a local area network; a generation module for generating a network configuration file according to the network segment configuration parameters, and sending the network configuration file to each node in the local area network, so that the nodes included in the local area network perform network communication according to the primary network segment network address corresponding to each node in the network configuration file; a management module for performing fault detection on the primary network segment network address in the network configuration file, and if the fault detection result indicates that a network fault occurs in the primary network segment network address, adjusting the backup network segment network address corresponding to the primary network segment network address of the network fault in the network configuration file to a new primary network segment network address, so that the nodes in the local area network perform network communication according to the adjusted network configuration file.
[0007] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0008] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0009] Compared with the prior art, the embodiments of the present application have the following beneficial effects: in the embodiments of the present application, the network segment configuration parameters input by the user are obtained, and the network segment configuration parameters include the primary network segment network address and the backup network segment network address corresponding to each node in the local area network; a network configuration file is generated according to the network segment configuration parameters, and the network configuration file is sent to each node in the local area network, so that the nodes included in the local area network perform network communication according to the primary network segment network address corresponding to each node in the network configuration file, so that the nodes in the local area network can directly obtain the primary network segment address and the backup network segment address corresponding to the nodes in the local area network based on the locally stored network configuration file, thereby avoiding the need for the nodes in the local area network to query the remote DNS server to obtain the primary network segment address and the backup network segment address corresponding to the nodes in the local area network, resulting in too high a speed in obtaining the primary network segment address and the backup network segment address. The method solves the problem of slowness; a fault detection is performed on the main network segment network address in the network configuration file. If the fault detection result indicates that a network fault occurs in the main network segment network address, the backup network segment network address corresponding to the main network segment network address of the network fault in the network configuration file is adjusted to a new main network segment network address, so that the nodes in the local area network can perform network communication according to the adjusted network configuration file. When a fault occurs in the main network segment network address corresponding to the node, the above method can quickly modify the backup network segment network address to a new main network segment network address, so that the nodes in the local area network can perform network communication normally according to the new main network segment network address, thereby improving the reliability of the network between the nodes in the local area network, and there is no need to add other equipment. The redundant network design cost is low and the configuration is simple, thereby avoiding the problems of high redundant network design cost and complex configuration in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0011] Figure 1 It is a flowchart of a network management method provided by an embodiment of the present application;
[0012] Figure 2 This is a basic schematic diagram of a node connected to network segments A and B provided in an embodiment of the present application;
[0013] Figure 3 It is a flowchart of another network management method provided by an embodiment of the present application;
[0014] Figure 4 It is a flowchart of another network management method provided in an embodiment of the present application;
[0015] Figure 5 It is a flowchart of another network management method provided by an embodiment of the present application;
[0016] Figure 6 This is a basic schematic diagram of switching a network segment network address provided in an embodiment of the present application;
[0017] Figure 7 It is a flowchart of another optional network management method provided in an embodiment of the present application;
[0018] Figure 8 It is a basic schematic diagram of performing fault detection on a primary network segment network address in a network configuration file provided by an embodiment of the present application;
[0019] Fig. 9 This is a basic schematic diagram of an optional network segment network address switching provided in an embodiment of the present application;
[0020] Fig.10 This is a basic schematic diagram of a node performing fault detection on a primary network segment network address in a network configuration file provided by an embodiment of the present application;
[0021] Fig.11 This is a basic flow chart of another optional network management method provided in an embodiment of the present application;
[0022] Fig.12 It is a basic schematic diagram of a visual interactive interface provided by an embodiment of the present application;
[0023] Fig.13 This is a basic flow chart of another optional network management method provided by an embodiment of the present application;
[0024] Fig.14 This is a basic schematic diagram of a node binding a network configuration file through an independent container provided by an embodiment of the present application;
[0025] Fig.15 This is a basic schematic diagram of network communication between local area network nodes provided in an embodiment of the present application;
[0026] Fig.16 This is a basic schematic diagram of another optional network management method provided in an embodiment of the present application;
[0027] Fig.17 It is a structural diagram of a network management device provided in an embodiment of the present application;
[0028] Fig.18 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0030] A network management method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0031] Figure 1 A network management method provided by an embodiment of the present application is as follows: Figure 1 As shown, the method includes:
[0032] S101, obtaining a network segment configuration parameter, where the network segment configuration parameter includes a primary network segment network address and a backup network segment network address corresponding to each node in the local area network;
[0033] S102, generating a network configuration file according to the network segment configuration parameters, and sending the network configuration file to each node in the local area network, so that the nodes included in the local area network perform network communication according to the main network segment network address corresponding to each node in the network configuration file;
[0034] S103, performing fault detection on the main network segment network address in the network configuration file. If the fault detection result indicates that a network fault occurs in the main network segment network address, adjusting the backup network segment network address corresponding to the main network segment network address of the network fault in the network configuration file to a new main network segment network address, so that the nodes in the local area network perform network communication according to the adjusted network configuration file.
[0035] It can be understood that the above-mentioned network management method provided in this example is applied to a network management system, which is arranged in a local area network, and a plurality of nodes are arranged in the local area network, and the node can be one of a PC, a workstation, and a server, and the above-mentioned node can be a physical machine or a virtual machine; it can be understood that at least one node in the local area network can be connected to the switch devices of two network segments; illustratively, data interaction is carried out through Ethernet in the local area network, and at least one node in the local area network is provided with two Ethernet card devices, so that the node can be connected to the switch devices of the two network segments.
[0036] This example will obtain the network segment configuration parameters, which include the primary network segment address and backup network segment address corresponding to each node in the local area network; wherein the above network segment address includes the network segment name, IP address, network segment ID, etc.; for example, Figure 2As shown, a workstation, a data server and an application server are arranged in the local area network, and two Ethernet card devices are arranged on the workstation, the data server and the application server, and a network segment A and a network segment B are arranged in the local area network (the network segment A is used as the main network segment and the network segment B is used as the backup network segment later), the network segment A includes "128.0.0.1 / 24", and the network segment B includes "129.0.0.1 / 24", wherein the network segment address corresponding to the network segment A is allocated to the workstation, for example, the network segment address corresponding to the allocated network segment A is "128.0.0.10"; similarly, the network segment address corresponding to the network segment B is allocated to the workstation, for example, the network segment address corresponding to the allocated network segment B is "129.0.0.10", so that the workstation can be connected to the network segment A through the network segment address of the above-mentioned network segment A, and the workstation can be connected to the network segment B through the network segment address of the network segment B, and the data server and the application server are the same, which will not be repeated here.
[0037] It is understandable that the network segment configuration parameters may also include setting information corresponding to each node, and the setting information includes: network segment name and network segment ID; taking the workstation as an example, other setting information may be "network segment name: workstation, network segment ID: workstation".
[0038] After obtaining the network segment configuration parameters, in order to further improve the speed at which each node in the LAN obtains the corresponding primary network segment address and backup network segment address, this example needs to generate a network configuration file based on the above network segment configuration parameters and send the network configuration file to each node in the LAN. After receiving the network configuration file, each node can directly obtain the primary network segment address and backup network segment address corresponding to the node in the LAN based on the locally stored network configuration file, avoiding the problem that the nodes in the LAN need to query the remote DNS server to obtain the primary network segment address and backup network segment address corresponding to the nodes in the LAN, resulting in the problem of slow speed in obtaining the primary network segment address and backup network segment address.
[0039] Exemplarily, taking the communication of a local area network via Ethernet as an example, this example will generate a hosts file (the hosts file is a network configuration file) based on the network segment configuration parameters. The hosts file is a plain text file, and the plain text file is sent to each node in the local area network, so that each node in the local area network can directly parse the plain text file when communication is needed, obtain the main network segment address corresponding to other nodes in the local area network, and communicate with other nodes in the local area network based on the main network segment address.
[0040] It can be understood that the network configuration file is sent to each node in the local area network. The specific implementation method is to distribute the generated network configuration file to each node in the local area network through a secure and reliable transmission protocol (such as SSH, SCP).
[0041] In some examples, after the nodes included in the local area network perform network communication according to the main network segment network address corresponding to each node in the network configuration file, this example will further perform fault detection on the main network segment network address in the network configuration file. If the fault detection result indicates that a network failure has occurred in the main network segment network address, the node cannot connect to the main network segment through the main network segment network address, resulting in the node being unable to perform network communication with other nodes in the local area network through the main network segment network address. At this time, the backup network segment network address corresponding to the main network segment network address of the network failure in the network configuration file is automatically adjusted to the new main network segment network address, so that the nodes in the local area network perform network communication according to the adjusted network configuration file.
[0042] Exemplarily, the network address of network segment A corresponding to the workstation is the main network address, and the network address of network segment B is the backup network address. During fault detection of the main network address in the network configuration file, if a network fault is detected in the network address of network segment A, the network address of network segment B is adjusted to the main network address, and the network address of network segment A is adjusted to the backup network address, thereby enabling the workstation to communicate with other nodes in the local area network based on the network address of network segment B.
[0043] According to the technical solution provided in the embodiment of the present application, the network segment configuration parameters input by the user are obtained, and the network segment configuration parameters include the primary network segment network address and the backup network segment network address corresponding to each node in the local area network; a network configuration file is generated according to the network segment configuration parameters, and the network configuration file is sent to each node in the local area network, so that the nodes included in the local area network perform network communication according to the primary network segment network address corresponding to each node in the network configuration file, so that the nodes in the local area network can directly obtain the primary network segment address and the backup network segment address corresponding to the node in the local area network based on the locally stored network configuration file, avoiding the problem that the nodes in the local area network need to query the remote DNS server to obtain the primary network segment address and the backup network segment address corresponding to the node in the local area network, resulting in the problem that the speed of obtaining the primary network segment address and the backup network segment address is too slow; for the network The primary network segment network address in the network configuration file is used for fault detection. If the fault detection result indicates that a network fault occurs in the primary network segment network address, the backup network segment network address corresponding to the primary network segment network address of the network fault in the network configuration file is adjusted to a new primary network segment network address, so that the nodes in the local area network can perform network communication according to the adjusted network configuration file. When a primary network segment network address corresponding to a node fails, the above method can quickly modify the backup network segment network address to a new primary network segment network address, so that the nodes in the local area network can perform network communication normally according to the new primary network segment network address, thereby improving the reliability of the network between nodes in the local area network, and there is no need to add other equipment. The redundant network design cost is low and the configuration is simple, thereby avoiding the problems of high redundant network design cost and complex configuration in related technologies.
[0044] In some embodiments, Figure 3 As shown, a network configuration file is generated based on the network segment configuration parameters, including:
[0045] S301, obtaining an initial network configuration file, and determining a target configuration address in the initial network configuration file;
[0046] S302, constructing a primary network mapping relationship corresponding to the node according to the primary network segment network address corresponding to the node in the network segment configuration parameters, and constructing a backup network mapping relationship corresponding to the node according to the backup network segment network address corresponding to the node in the network segment configuration parameters;
[0047] S303, obtain the node name corresponding to the node, add the node name to the corresponding primary network mapping relationship and backup network mapping relationship respectively, and add the primary network mapping relationship and backup network mapping relationship after adding the node name to the target configuration address in sequence to obtain a network configuration file.
[0048] It can be understood that the initial network configuration file includes the settings for the network set by the user or other applications. In order to avoid the information of the network segment configuration parameters from affecting the settings for the network set by the user or other applications in the initial network configuration file after the information of the network segment configuration parameters is added to the initial network configuration file, this example determines the target configuration address in the initial network configuration file, and the target configuration address is used to place the information generated according to the network segment configuration parameters.
[0049] Exemplarily, in order to mark the target configuration address, a location identifier may be used to identify the target configuration address, and the location identifier may be in the form of a comment.
[0050] After determining the target configuration address, this example further constructs a main network mapping relationship corresponding to the node according to the main network segment network address corresponding to the node in the network segment configuration parameters, so that the main network mapping relationship includes the above-mentioned main network segment network address, and constructs a backup network mapping relationship corresponding to the node according to the backup network segment network address corresponding to the node in the network segment configuration parameters, so that the backup network segment network address includes the above-mentioned backup network segment network address; exemplarily, taking the node as a workstation, and the network segment configuration parameters corresponding to the workstation include "segment name: workstation, segment ID: workstation, main network segment network address: 128.0.0.10, backup network segment network address: 129.0.0.10" as an example, the main network mapping relationship corresponding to the workstation is "128.0.0.10workstation", and the backup network mapping relationship is "129.0.0.10workstation".
[0051] To further simplify network configuration and management and improve network convenience and consistency, in this example, the node name corresponding to the node will also be added to the primary network mapping relationship and the secondary network mapping relationship corresponding to the node. Then each network mapping relationship (the network mapping relationship includes: the primary network mapping relationship and the secondary network mapping relationship) consists of <IP address><node name>[alias 1][alias 2], so that the primary network mapping relationship and the secondary network mapping relationship after adding the host name can support automatic name resolution and service discovery within the local area network. By using the mDNS protocol, the device can automatically discover and resolve the node name without manually configuring the DNS server, achieving the effect of simplifying network configuration and management and improving network convenience and consistency.
[0052] Exemplarily, taking the primary network mapping relationship corresponding to the above workstation as "128.0.0.10 workstation" and the secondary network mapping relationship as "129.0.0.10 workstation" as an example, in this example, the node name with the suffix of.local is added to the above primary network mapping relationship and secondary network mapping relationship. The primary network mapping relationship after adding the node name is "128.0.0.10 workstation.local workstation", and the secondary network mapping relationship after adding the node name is "129.0.0.10 workstation.local workstation".
[0053] In some examples, in this example, the primary network mapping relationship and the secondary network mapping relationship after adding the node are added to the target configuration address in sequence to obtain a network configuration file. Among them, the above primary network mapping relationship is in the front and the secondary network mapping relationship is in the back, so that when nodes in the local area network communicate later, they will first try to resolve and use the network address of the primary network segment of the node name and the corresponding alias that is matched first (the network address can be called the IP address later), that is, first match the primary network mapping relationship and use the IP address of the primary network segment to communicate with the corresponding node through the network. Only when the IP address of the primary network segment is unavailable will the IP address of the secondary network segment be used.
[0054] Exemplarily, taking the comments #<<<dual-net-config-begin and #>>>dual-net-config-end as an example, the above target configuration address is marked through the position identifier in the form of the above comments. Then the primary network mapping relationship and the secondary network mapping relationship after adding the node name of the workstation, the data server, and the application server are added to the above target configuration address to generate a network configuration file. The information contained in the target configuration address in the network configuration file is as follows: ......
[0056] 127.0.0.1localhost
[0057] 192.168.10.3k8s-server.local k8s-server
[0058] 39.156.66.10baidu.com baidu
[0059] #<< <dual-net-config-begin
[0060] 128.0.0.10workstation.local workstation
[0061] 129.0.0.10workstation.local workstation
[0062] 128.0.0.20dataserver.local dataserver
[0063] 129.0.0.20dataserver.localdataserver
[0064] 128.0.0.30appserver.localappserver
[0065] 129.0.0.30appserver.localappserver
[0066] #>>>dual-net-config-end
[0067] .......
[0068] According to the technical solution provided in the embodiment of the present application, an initial network configuration file is obtained, and a target configuration address is determined in the initial network configuration file; a main network mapping relationship corresponding to the node is constructed according to the main network segment network address corresponding to the node in the network segment configuration parameters, and a backup network mapping relationship corresponding to the node is constructed according to the backup network segment network address corresponding to the node in the network segment configuration parameters; a node name corresponding to the node is obtained, and the node name is added to the corresponding main network mapping relationship and backup network mapping relationship respectively, and the main network mapping relationship and backup network mapping relationship after the node is added are added to the target configuration address in sequence to obtain a network configuration file, wherein the above-mentioned addition of the node name to the network mapping relationship achieves the effect of simplifying network configuration and management and improving the convenience and consistency of the network, and the above-mentioned network mapping relationship is added to the target configuration address, so that the network mapping relationship will not affect other information contained in the network configuration file.
[0069] In some embodiments, Figure 4 As shown, the main network segment network address in the network configuration file is detected for faults, including:
[0070] S401, obtaining a detection period corresponding to the primary network segment network address, and obtaining a preset network detection method;
[0071] S402: Perform fault detection on each main network segment network address in the network configuration file periodically through a network detection method according to a detection period.
[0072] It can be understood that in order to avoid the problems of excessive system load and excessive consumption of system resources caused by real-time fault detection of the main network segment network address, this method needs to set a detection period, which is used to balance shortening the fault discovery time and reducing the system load. The value range of the detection period is between 1 second and 10 seconds. Preferably, the detection period is 3 seconds.
[0073] This example also needs to obtain a preset network detection method, which includes but is not limited to a ping command or a traceroute command. After determining the detection period and the network detection method, this example will periodically monitor the faults of each main network segment network address in the network configuration file through the detection method according to the detection period.
[0074] Exemplarily, taking the detection period of 4 seconds as an example, and the network detection method of the ping command as an example, every 4 seconds, the method will use the ping command to perform fault detection on each main network disconnection network address in the network configuration file.
[0075] According to the technical solution provided in the embodiment of the present application, the detection period corresponding to the main network segment network address is obtained, and the preset network detection method is obtained; according to the detection period, each main network segment network address in the network configuration file is periodically monitored for faults through the network detection method. The above method shortens the time for discovering network faults and avoids the problems of excessive system load and excessive consumption of system resources caused by real-time fault detection of the main network segment network address.
[0076] In some embodiments, Figure 5 As shown, the backup network segment network address corresponding to the primary network segment network address of the network failure in the network configuration file is adjusted to the new primary network segment network address, including:
[0077] S501, obtaining the primary network segment network address of the network failure and the backup network segment network address corresponding to the primary network segment network address of the network failure in the network configuration file;
[0078] S502: Adjust the network address of the primary network segment of the network failure to a new network address of the backup network segment, and adjust the network address of the backup network segment corresponding to the network address of the primary network segment of the network failure to the new network address of the primary network segment.
[0079] Specifically, this example will obtain the primary network segment network address of the network failure and the backup network segment network address corresponding to the primary network segment network address of the network failure in the network configuration file. For example, the following information is included in the network configuration file:
[0080] #<< <dual-net-config-begin
[0081] 128.0.0.10workstation.local workstation
[0082] 129.0.0.10workstation.local workstation
[0083] 128.0.0.20dataserver.localdataserver
[0084] 129.0.0.20dataserver.local dataserver
[0085] 128.0.0.30appserver.localappserver
[0086] 129.0.0.30appserver.localappserver
[0087] #>>>dual-net-config-end.
[0088] When a fault is detected in the primary network segment network address "128.0.0.10", this example obtains the primary network segment network address "128.0.0.10" and the backup network segment network address "129.0.0.10".
[0089] After obtaining the above-mentioned main network segment network address and backup network segment network address, this example will also adjust the main network segment network address of the network failure to a new backup network segment network address, so that the main network mapping relationship corresponding to the main network segment network address of the network failure is adjusted to the new backup network mapping relationship, and adjust the backup network segment network address corresponding to the main network segment network address of the network failure to the new main network segment network address, so that the backup network mapping relationship corresponding to the backup network address corresponding to the main network segment network address of the network failure is adjusted to the new main network mapping relationship, so that when a set of network equipment fails (the network equipment corresponding to the main network segment network address), the node can automatically switch to another set of network equipment (the network equipment corresponding to the backup network segment network address), that is, the backup network segment network address can also ensure the smooth network access of the nodes in the local area network.
[0090] For example, taking the case where the primary network segment network address "128.0.0.10" is faulty, this example adjusts the primary network mapping relationship "128.0.0.10workstation.local workstation" corresponding to the primary network segment network address "128.0.0.10" to a new backup network mapping relationship, and adjusts the backup network mapping relationship "129.0.0.10workstation.local workstation" corresponding to the backup network segment network address "129.0.0.10" to a new primary network mapping relationship, such as Figure 6 and change the order of "128.0.0.10workstation.local workstation" and "129.0.0.10workstation.local workstation" as shown above.
[0091] According to the technical solution provided in the embodiment of the present application, the main network segment network address of the network failure and the backup network segment network address corresponding to the main network segment network address of the network failure are obtained in the network configuration file; the main network segment network address of the network failure is adjusted to a new backup network segment network address, and the backup network segment network address corresponding to the main network segment network address of the network failure is adjusted to a new main network segment network address, so that when a set of network equipment fails (the network equipment corresponding to the main network segment network address), the node can automatically switch to another set of network equipment (the network equipment corresponding to the backup network segment network address), that is, the smooth network access of the nodes in the local area network can also be guaranteed through the backup network segment network address.
[0092] In some examples, such as Figure 7 As shown, the backup network segment network address corresponding to the primary network segment network address of the network failure in the network configuration file is adjusted to the new primary network segment network address, including:
[0093] S701, obtaining the number of primary network segment network addresses of network failures in the network configuration file, and comparing the number of primary network segment network addresses of network failures with a preset failure threshold;
[0094] S702. If the number of primary network segment network addresses of the network failure exceeds a preset failure threshold, each backup network segment network address in the network configuration file is adjusted to a new primary network segment network address, and each primary network segment network address in the network configuration file is adjusted to a new backup network segment network address.
[0095] It can be understood that when multiple main network segment network addresses fail in the network configuration file (failures include but are not limited to inaccessibility of the main network segment network addresses), it means that the current main network segment has failed and cannot bear the network communication of the nodes in the local area network. It is necessary to switch the main network segment network addresses of all nodes to new backup network segment network addresses, and switch all backup network segment network addresses to new main network segment network addresses.
[0096] Based on the above principle, this example obtains the number of primary network segment network addresses of network failure in the network configuration file, and compares the number of primary network segment network addresses of network failure with the preset failure threshold; if the number of primary network segment network addresses of network failure exceeds the preset failure threshold, each backup network segment network address in the network configuration file is adjusted to a new primary network segment network address, and each primary network segment network address in the network configuration file is adjusted to a new backup network segment network address.
[0097] For example, taking the above fault threshold of 3 as an example, Figure 8 As shown, this example will perform fault detection on the main network segment network address in the network configuration file. The specific inspection method is to scan the main network segment network addresses of the nodes one by one. When there are 3 main network segment network addresses that cannot be connected, all the main network segment network addresses in the network configuration file (hosts file) are adjusted to new backup network segment network addresses, so that the main network mapping relationship corresponding to all the main network segment network addresses of the network failure is adjusted to the new backup network mapping relationship, and the backup network segment network addresses corresponding to all the main network segment network addresses of the network failure are adjusted to the new main network segment network address, so that the backup network mapping relationship corresponding to the backup network segment network addresses of all the main network segment network addresses of the network failure is adjusted to the new main network mapping relationship, such as Fig. 9 As shown, when a set of network equipment fails (the network equipment corresponding to the main network segment network address), the node can automatically switch to another set of network equipment (the network equipment corresponding to the backup network segment network address), that is, the backup network segment network address can also ensure smooth network access between nodes in the local area network.
[0098] It can be understood that in the process of performing fault detection on the main network segment network address in the network configuration file, in order to improve the fault detection speed of the main network segment network address, fault detection can be performed on some of the main network segment network addresses. For example, N main network segment network addresses in the network configuration file are detected to determine whether a network fault occurs in the main network segment. It can be understood that in the process of performing fault detection on the main network segment network address in the network configuration file through the ping command, in order to reduce the execution time of the ping command to meet the real-time requirements of the industrial automation scenario, the timeout period is set to 500 milliseconds to improve the response speed.
[0099] It is understandable that if Fig.10 As shown, each node (including but not limited to application servers and data servers) can perform fault detection on the main network segment network address in the network configuration file, and dynamically adjust the network configuration file when a fault occurs (that is, adjust the backup network segment network address corresponding to the main network segment network address of the network fault in the network configuration file to the new main network segment network address).
[0100] According to the technical solution provided in the embodiment of the present application, the number of main network segment network addresses of the network failure in the network configuration file is obtained, and the number of main network segment network addresses of the network failure is compared with a preset failure threshold; if the number of main network segment network addresses of the network failure exceeds the preset failure threshold, each backup network segment network address in the network configuration file is adjusted to a new main network segment network address, and each main network segment network address in the network configuration file is adjusted to a new backup network segment network address, so that when a set of network devices fails (the network device corresponding to the main network segment network address), the node can automatically switch to another set of network devices (the network device corresponding to the backup network segment network address), that is, the network access of the nodes in the local area network can also be guaranteed through the backup network segment network address.
[0101] In some examples, such as Fig.11 As shown, obtain the network segment configuration parameters, including:
[0102] S1101. Provide a visual interactive interface, where the visual interactive interface is used to display each node in the local area network;
[0103] S1102. Receive, via a visual interactive interface, network segment configuration parameters input by a user for a node in a local area network.
[0104] Specifically, in order to simplify network configuration and management, this example also provides a visual interactive interface that can display the system topology of nodes in the local area network.
[0105] This example receives the network segment configuration parameters input by the user for the nodes in the local area network through the above-mentioned visual interactive interface. Specifically, the user can intuitively configure the main network segment network address and the backup network segment network address corresponding to each node through the above-mentioned visual interactive interface, so that the system can obtain the above-mentioned network segment configuration parameters.
[0106] For example, taking the example of nodes in a local area network communicating via Ethernet, Fig.12 It can be seen intuitively that each node has two Ethernet card devices, which are connected to the switch devices of network segment A and network segment B respectively through independent network cables. Fig.12 As shown, the user can input the specific information of each network segment through the visual interactive interface, so that the user can configure the network segment address of each node under different network segments through the above-mentioned visual interactive interface, and the visual interactive interface supports batch import and export of configuration data to facilitate large-scale deployment and management.
[0107] It can be understood that the above visual interactive interface manages all node information in the local area network in a unified manner, and generates a server node configuration information file (server_nodes.json) in JSON format according to the entered information; illustratively, as shown below:
[0108]
[0109]
[0110] Through a unified visual interactive interface, the configuration process of the network segment configuration parameters of each node is greatly simplified, the complexity and error rate of manual configuration are reduced, and the efficiency of network management is improved.
[0111] It is understandable that the network segment configuration parameters may also be automatically acquired through the DHCP service.
[0112] According to the technical solution provided in the embodiment of the present application, a visual interactive interface is provided, which is used to display each node in the local area network; the network segment configuration parameters input by the user for the nodes in the local area network are received through the visual interactive interface, and the user can input the network segment configuration parameters through the above-mentioned visual interactive interface, wherein the unified visual interactive interface greatly simplifies the configuration process of the network segment configuration parameters of each node, reduces the complexity and error rate of manual configuration, and improves the efficiency of network management.
[0113] In some examples, such as Fig.13 As shown, the network configuration file is sent to each node in the local area network, including:
[0114] S1301, control each node to define an independent container;
[0115] S1302: Send the network configuration file to each node in the local area network, so that each node binds the received network configuration file to an independent container set in the node after receiving the network configuration file.
[0116] It can be understood that this example will control each node to define an independent container, and then send the network configuration file to each node in the local area network. When the independent container is started, it will automatically bind the received network configuration file to the independent container environment in a read-only manner. Therefore, when a network problem occurs and the node's network configuration file is adjusted, the container environment can also recognize the change in the order of network requests, and thus adaptively adjust to a normal network.
[0117] like Fig.14 As shown, the network configuration file is bound to the node through an independent container. With this mechanism, the independent container applications running on the nodes in the local area network can also achieve high network availability between independent container applications through the dual-network redundancy design.
[0118] After the above steps, a dual-network redundant environment based on the node name (node name.local) has been built. Applications between different nodes can establish connections and achieve smooth communication through the "node name.local" address. Fig.15 As shown. It can be understood that between the application and the gateway and the service, the system's curl command is usually used to check the health status of the service to realize the self-discovery function of the service. In order to cooperate with the present method, the network configuration file is adjusted to adapt to the handling of network failures. It is necessary to adjust the timeout parameter of the curl command from the default 30 seconds to 1 second to prevent too much time from being spent on waiting for the command timeout processing when the network fails, thereby improving the efficiency of network health judgment. In addition, for a single network environment, the configuration file only contains the network segment address of the main network segment, then only a network configuration file containing the main network segment will be generated for each node. Since the application software uses the host name to establish a network connection, whether it is a single network or a dual network environment, it is consistent from the application level. Therefore, this method can adapt to single and dual network environments.
[0119] In order to better understand the present method, this embodiment provides a more specific example for illustration. Fig.16As shown, this example first provides a visual interactive interface, which is the main entrance for users to interact with the system, allowing users to easily configure and manage the network. The visual interactive interface can intuitively display the topology of the entire network, including the main network segment, backup network segment, node name and main network segment network address, etc. It supports drag-and-drop operations, which is convenient for users to adjust and configure the network structure; this example also provides configuration generation and distribution services, which are responsible for converting the network segment configuration parameters configured by the user in the visual interactive interface into network configuration files that can be recognized by the system, and distribute them to each node in the local area network; set up a node resident service, which runs on each server node and is responsible for monitoring the network status, updating the system configuration file, and adjusting the network order of the main and backup network segments when necessary.
[0120] It can be understood that the above method does not rely on special hardware, but realizes dual-network redundancy based on standard Ethernet technology, thus reducing cost and complexity. It uses a visual interactive interface to manage the entire system and network, automatically generates and distributes network configuration files, and simplifies network configuration and maintenance. It also ensures high availability and rapid response of the network through optimized health checks and dynamic network link adjustments. It supports the adaptive capabilities of single-network and dual-network environments without modifying the upper-layer applications. It also supports containerized environments to ensure that container applications can also enjoy the protection of dual-network redundancy.
[0121] It can be understood that this method realizes seamless switching when a network path fails by dynamically adjusting the primary network segment address and the backup network segment address of the node. In this way, when a network segment path fails, the system will automatically use the backup network segment path to ensure the continuous availability of the network connection. This mechanism utilizes the infrastructure of the operating system without the need for additional software or hardware support, can ensure the continuous operation of key services, and improves the high availability and reliability of the system. Compared with complex hardware redundancy equipment or high availability software solutions, the implementation method of this patent is simple and easy to understand, and does not require manual intervention, which improves maintenance efficiency and configuration accuracy; in addition, traditional dual-network redundancy solutions usually require special hardware equipment, and these equipment and software are usually expensive. This patent solution can achieve dual-network redundancy using existing ordinary hardware, significantly reducing the initial investment cost. The system achieves high availability without adding additional hardware, can more effectively utilize the existing network infrastructure, and improves resource utilization. Moreover, due to the simplicity of the solution, the maintenance cost is also greatly reduced. There is no need for specialized technicians to perform complex network equipment configuration and management, which reduces human resource costs; finally, this method solution lowers the threshold of high availability technology, and uses ordinary hardware and simple configuration to enable users to enjoy high reliability network services. It has promoted the popularization of high-availability technology and improved the information level of the entire society. At the same time, it reduces the dependence on dedicated hardware, helps reduce the generation of electronic waste, and is in line with the concept of green IT and sustainable development. By extending the service life of existing equipment, it reduces the generation and treatment costs of electronic waste, which has positive significance for environmental protection.
[0122] According to the technical solution provided by the embodiment of the present application, each node is controlled to define an independent container; the network configuration file is sent to each node in the local area network, so that each node binds the received network configuration file to the independent container set in the node after receiving the network configuration file. When the independent container is started, the received network configuration file is automatically bound to the independent container environment in a read-only manner. Therefore, when a network problem occurs and causes the node's network configuration file to be adjusted, the container environment can also recognize the change in the order of network requests, and thus adaptively adjust to a normal network.
[0123] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0124] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0125] This embodiment also provides a network management device, such as Fig.17 As shown, the device comprises:
[0126] The acquisition module 1701 is used to acquire the network segment configuration parameters, which include the primary network segment network address and the backup network segment network address corresponding to each node in the local area network;
[0127] The generating module 1702 is used to generate a network configuration file according to the network segment configuration parameters, and send the network configuration file to each node in the local area network, so that the nodes included in the local area network perform network communication according to the main network segment network address corresponding to each node in the network configuration file;
[0128] Management module 1703 is used to perform fault detection on the main network segment network address in the network configuration file. If the fault detection result indicates that a network fault occurs in the main network segment network address, the backup network segment network address corresponding to the main network segment network address of the network fault in the network configuration file is adjusted to a new main network segment network address, so that the nodes in the local area network can perform network communication according to the adjusted network configuration file.
[0129] In some examples, generation module 1702 is also used to obtain an initial network configuration file, determine the target configuration address in the initial network configuration file; construct a main network mapping relationship corresponding to the node according to the main network segment network address corresponding to the node in the network segment configuration parameters, and construct a backup network mapping relationship corresponding to the node according to the backup network segment network address corresponding to the node in the network segment configuration parameters; obtain the node name corresponding to the node, add the node name to the corresponding main network mapping relationship and backup network mapping relationship respectively, and add the main network mapping relationship and backup network mapping relationship after adding the node to the target configuration address in order to obtain the network configuration file.
[0130] In some examples, the management module 1703 is also used to obtain the detection period corresponding to the main network segment network address and obtain a preset network detection method; and periodically perform fault monitoring on each main network segment network address in the network configuration file through the network detection method according to the detection period.
[0131] In some examples, the management module 1703 is also used to obtain the main network segment network address of the network failure in the network configuration file and the backup network segment network address corresponding to the main network segment network address of the network failure; adjust the main network segment network address of the network failure to a new backup network segment network address, and adjust the backup network segment network address corresponding to the main network segment network address of the network failure to the new main network segment network address.
[0132] In some examples, the management module 1703 is also used to obtain the number of main network segment network addresses of the network failure in the network configuration file, and compare the number of main network segment network addresses of the network failure with a preset failure threshold; if the number of main network segment network addresses of the network failure exceeds the preset failure threshold, each backup network segment network address in the network configuration file is adjusted to a new main network segment network address, and each main network segment network address in the network configuration file is adjusted to a new backup network segment network address.
[0133] In some examples, the acquisition module 1701 is used to provide a visual interactive interface, which is used to display each node in the local area network; and receive network segment configuration parameters input by the user for the nodes in the local area network through the visual interactive interface.
[0134] In some examples, the generation module 1702 is also used to control each node to define an independent container; send the network configuration file to each node in the local area network, so that after each node receives the network configuration file, it binds the received network configuration file to the independent container set in the node.
[0135] According to the technical solution provided by the embodiment of the present application, the network management device provided by the embodiment obtains the network segment configuration parameters input by the user, and the network segment configuration parameters include the primary network segment network address and the backup network segment network address corresponding to each node in the local area network; generates a network configuration file according to the network segment configuration parameters, and sends the network configuration file to each node in the local area network, so that the nodes included in the local area network perform network communication according to the primary network segment network address corresponding to each node in the network configuration file, so that the nodes in the local area network can directly obtain the primary network segment address and the backup network segment address corresponding to the node in the local area network based on the locally stored network configuration file, avoiding the need for the nodes in the local area network to query the remote DNS server to obtain the primary network segment address and the backup network segment address corresponding to the node in the local area network, resulting in too high a speed in obtaining the primary network segment address and the backup network segment address. The method solves the problem of slowness; a fault detection is performed on the main network segment network address in the network configuration file. If the fault detection result indicates that a network fault occurs in the main network segment network address, the backup network segment network address corresponding to the main network segment network address of the network fault in the network configuration file is adjusted to a new main network segment network address, so that the nodes in the local area network can perform network communication according to the adjusted network configuration file. When a fault occurs in the main network segment network address corresponding to the node, the above method can quickly modify the backup network segment network address to a new main network segment network address, so that the nodes in the local area network can perform network communication normally according to the new main network segment network address, thereby improving the reliability of the network between the nodes in the local area network, and there is no need to add other equipment. The redundant network design cost is low and the configuration is simple, thereby avoiding the problems of high redundant network design cost and complex configuration in related technologies.
[0136] Fig.18Schematic diagram of an electronic device 18 provided in an embodiment of the present application. Fig.18 As shown, the electronic device 18 of this embodiment includes: a processor 1801, a memory 1802, and a computer program 1803 stored in the memory 1802 and executable on the processor 1801. When the processor 1801 executes the computer program 1803, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 1801 executes the computer program 1803, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0137] The electronic device 18 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 18 may include, but is not limited to, a processor 1801 and a memory 1802. Those skilled in the art will appreciate that Fig.18 The electronic device 18 is merely an example and does not limit the electronic device 18 , and may include more or fewer components than those shown in the figure, or different components.
[0138] Processor 1801 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0139] The memory 1802 may be an internal storage unit of the electronic device 18, for example, a hard disk or memory of the electronic device 18. The memory 1802 may also be an external storage device of the electronic device 18, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (FlashCard), etc. equipped on the electronic device 18. The memory 1802 may also include both an internal storage unit of the electronic device 18 and an external storage device. The memory 1802 is used to store computer programs and other programs and data required by the electronic device.
[0140] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0141] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of regional requirements and patent practice. For example, in some areas, according to regional requirements and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0142] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A network management method, characterized in that: The method comprises: Obtaining network segment configuration parameters, wherein the network segment configuration parameters include a primary network segment network address and a backup network segment network address corresponding to each node in the local area network; Generate a network configuration file according to the network segment configuration parameters, and send the network configuration file to each node in the local area network, so that the nodes included in the local area network perform network communication according to the main network segment network address corresponding to each node in the network configuration file; A fault detection is performed on the main network segment network address in the network configuration file. If the fault detection result indicates that a network fault occurs in the main network segment network address, the backup network segment network address corresponding to the main network segment network address of the network fault in the network configuration file is adjusted to a new main network segment network address, so that the nodes in the local area network perform network communication according to the adjusted network configuration file.
2. The method according to claim 1, characterized in that Generate a network configuration file according to the network segment configuration parameters, including: Obtaining an initial network configuration file, and determining a target configuration address in the initial network configuration file; Constructing a primary network mapping relationship corresponding to the node according to the primary network segment network address corresponding to the node in the network segment configuration parameters, and constructing a backup network mapping relationship corresponding to the node according to the backup network segment network address corresponding to the node in the network segment configuration parameters; Obtain the node name corresponding to the node, add the node name to the corresponding primary network mapping relationship and the backup network mapping relationship respectively, and add the primary network mapping relationship and the backup network mapping relationship after adding the node name to the target configuration address in sequence to obtain the network configuration file.
3. The method according to claim 1, characterized in that Performing fault detection on the primary network segment network address in the network configuration file includes: Obtain the detection period corresponding to the network address of the main network segment and obtain the preset network detection method; According to the detection period, the network detection method is used to periodically perform fault detection on each main network segment network address in the network configuration file.
4. The method according to claim 3, characterized in that The backup network segment network address corresponding to the primary network segment network address of the network failure in the network configuration file is adjusted to a new primary network segment network address, including: Obtain the primary network segment network address of the network failure of the network configuration file and the backup network segment network address corresponding to the primary network segment network address of the network failure; The network address of the primary network segment of the network failure is adjusted to the new network address of the backup network segment, and the network address of the backup network segment corresponding to the network address of the primary network segment of the network failure is adjusted to the new network address of the primary network segment.
5. The method according to claim 3, characterized in that: The backup network segment network address corresponding to the primary network segment network address of the network failure in the network configuration file is adjusted to a new primary network segment network address, including: Obtaining the number of primary network segment network addresses of the network failure of the network configuration file, and comparing the number of primary network segment network addresses of the network failure with a preset failure threshold; If the number of primary network segment network addresses of the network failure exceeds the preset failure threshold, each backup network segment network address in the network configuration file is adjusted to a new primary network segment network address, and each primary network segment network address in the network configuration file is adjusted to a new backup network segment network address.
6. The method according to claim 1, characterized in that Get network segment configuration parameters, including: Providing a visual interactive interface, wherein the visual interactive interface is used to display each node in the local area network; The network segment configuration parameters input by the user for the nodes in the local area network are received through the visual interactive interface.
7. The method according to claim 1, characterized in that Sending the network configuration file to each node in the local area network includes: Control each node to define an independent container; The network configuration file is sent to each node in the local area network, so that after receiving the network configuration file, each node binds the received network configuration file to the independent container set in the node.
8. A network management device, characterized in that: The device comprises: An acquisition module is used to acquire network segment configuration parameters, wherein the network segment configuration parameters include a primary network segment network address and a backup network segment network address corresponding to each node in the local area network; A generating module, configured to generate a network configuration file according to the network segment configuration parameters, and send the network configuration file to each node in the local area network, so that the nodes included in the local area network perform network communication according to the main network segment network address corresponding to each node in the network configuration file; The management module is used to perform fault detection on the main network segment network address in the network configuration file. If the fault detection result indicates that a network fault occurs in the main network segment network address, the backup network segment network address corresponding to the main network segment network address of the network fault in the network configuration file is adjusted to a new main network segment network address, so that the nodes in the local area network perform network communication according to the adjusted network configuration file.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Extended network management method and system
CN120090927A
