A method, device, computer equipment and storage medium for determining network topology

By receiving and parsing multiple messages sent by the gateway device, the network topology relationship is determined, which solves the problem of device modification and configuration in the existing technology, achieves the acquisition of device connection relationships without affecting the existing network, and improves the use effect. .

CN115695206BActive Publication Date: 2024-08-23BEIJING HUIERTE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211356190.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-01
Publication Date
2024-08-23
Estimated Expiration
2042-11-01

AI Technical Summary

Technical Problem

The existing method of obtaining the connection relationship between various network devices in the network requires the modification and configuration of the existing devices in the network, and will have an impact on the existing network, and the use effect is poor.

Method used

By receiving messages from multiple target devices sent by the gateway device, including Ethernet messages, ARP/RARP messages, TCP/UDP messages and ICMP messages, the VLanID, MAC address and IP address of the target device are determined and the logical network is divided. , and determine the network topology relationship through ICMP message analysis, monitor traffic data in real time, and avoid configuring and upgrading existing equipment.

Benefits of technology

It achieves the acquisition of the connection relationship between network devices without affecting the existing network, has better use effect, avoids the transformation and configuration of the network, and improves efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695206B
    Figure CN115695206B
Patent Text Reader

Abstract

The present invention discloses a method for determining network topology, wherein a terminal device receives a message of each of a plurality of target devices sent by a gateway device, wherein the message includes an Ethernet message of the target device, an ARP / RARP message of the target device, a TCP / UDP message of the target device, and an ICMP message of the target device, and according to the Ethernet message, a VLAN ID of a first target device and a VLAN ID of a second target device are determined, and according to the ARP / RARP message, a MAC address and an IP address of the first target device, and a MAC address and an IP address of the second target device are determined. According to the ICMP message, the network topology relationship of the plurality of target devices is determined, and there is no need to configure and upgrade the target devices in the existing network, and there is no need for the terminal device to send a request to the target devices in the network. No message is generated in the process, which will affect the existing network, and the use effect is better.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of network topology, and in particular to a method, apparatus, computer equipment and storage medium for determining network topology. Background Art

[0002] The way computers are connected is called "network topology". Network topology refers to the physical layout of various devices interconnected by transmission media, especially the location of computers and how cables pass through them. When designing a network, you should choose the right topology according to your actual situation. Each topology has its own advantages and disadvantages. Topology is an abstract representation method that does not consider the physical properties of objects such as size and shape, but only uses points or lines to describe the actual location and relationship of multiple objects. Topology does not care about the details of things, nor does it care about the proportional relationship between each other, but only represents the relationship between multiple objects within a certain range in the form of a graph. In real life, in order to achieve interconnection between computers and network devices, they must be connected using a certain organizational structure, which is called "topology". Network topology vividly describes the arrangement and configuration of the network, as well as the relationship between each node. In layman's terms, "topology" refers to how these computers and communication devices are connected together.

[0003] At present, to obtain the connection relationship between various network devices in the network, it is generally necessary to actively send requests to discover devices through network protocols. For example, traceroute, ping, etc. This solution requires each device to support and run related network services, and also requires the configuration of firewall-related policies. At the same time, sending related protocol requests may affect the operation of devices in the network. In addition, in industrial production networks, most devices do not provide support for related network services. At the same time, based on security considerations, they use anti-avoidance and self-hiding methods in the network to avoid being discovered. In addition, based on enterprise production requirements, it is not allowed to send ping and other requests to its production equipment.

[0004] Therefore, the existing method of obtaining the connection relationship between various network devices in the network requires the modification and configuration of the existing devices in the network, which will have an impact on the existing network and has a poor use effect. Summary of the invention

[0005] Based on this, in order to solve the above-mentioned technical problems, a method, device, computer equipment and storage medium for determining network topology are provided, which can solve the problem that the existing method of obtaining the connection relationship between various network devices in the network requires the modification and configuration of the existing equipment in the network, and will affect the existing network, resulting in poor use effect.

[0006] In a first aspect, a method for determining a network topology comprises:

[0007] Receiving a message of each of the target devices among the multiple target devices sent by the gateway device, the message including an Ethernet message of the target device, an ARP / RARP message of the target device, a TCP / UDP message of the target device, and an ICMP message of the target device;

[0008] Determine, according to the Ethernet message, a VLanID of the first target device and a VLanID of the second target device;

[0009] Determine the MAC address and IP address of the first target device and the MAC address and IP address of the second target device according to the ARP / RARP message;

[0010] According to the ICMP message, a network topology relationship of the plurality of target devices is determined.

[0011] In the above solution, optionally, before determining the network topology relationship of the plurality of target devices according to the ICMP message, the method further includes:

[0012] According to the TCP / UDP message, the MAC address and IP address of the first target device and the MAC address and IP address of the second target device are determined.

[0013] In the above solution, further optionally, before determining the network topology relationship of the plurality of target devices according to the ICMP message, the method further includes:

[0014] Dividing a plurality of logical networks according to the VLanID of the first target device and the VLanID of the second target device;

[0015] For each of the logical networks, when receiving the ARP / RARP message of the first target device, the MAC address of the first target device and the IP address of the first target device are bound, and the device is determined to be the first target device; at the same time, the MAC address of the second target device and the IP address of the second target device are bound, and the device is determined to be the second target device;

[0016] In the case that no ARP / RARP message of the target device is received, the type of the target device is determined according to the MAC address or IP address of the target device, wherein the target device is the first target device or the second target device.

[0017] In the above solution, further optionally, determining the network topology relationship of the plurality of target devices according to the ICMP message includes:

[0018] The ICMP message is parsed, and when a PING message exists in the ICMP message, it is determined that the first target device and the second target device are different devices, and a network topology relationship between the first target device and the second target device is determined.

[0019] In the above solution, further optionally, determining the network topology relationship of the plurality of target devices according to the ICMP message further includes:

[0020] The ICMP message is parsed, and when a Traceroute message exists in the ICMP message, the Traceroute message is parsed according to a preset protocol to determine whether the first target device and the second target device are the same target device, and when the first target device and the second target device are different devices, a network topology relationship between the first target device and the second target device is determined.

[0021] In the above solution, further optionally, determining the network topology relationship of the plurality of target devices according to the ICMP message further includes:

[0022] The ICMP message is parsed, and when there is no PING message and Traceroute message in the ICMP message, a network topology relationship between the first target device and the second target device is determined according to the IP address of the first target device and the IP address of the second target device.

[0023] In the above solution, further optionally, after determining the network topology relationship of the plurality of target devices according to the ICMP message, the method further includes:

[0024] Acquire actual traffic data between the first target device and the second target device within a preset time interval, and when an actual traffic value corresponding to the actual traffic data is less than a preset traffic value, shut down the third target device; or disconnect the third target device from the network;

[0025] The third target device is the first target device or the second target device.

[0026] In a second aspect, a device for determining a network topology includes:

[0027] Receiving module: used for receiving a message of each of the target devices among the multiple target devices sent by the gateway device, wherein the message includes an Ethernet message of the target device, an ARP / RARP message of the target device, a TCP / UDP message of the target device, and an ICMP message of the target device;

[0028] A first determination module: used to determine the VLanID of the first target device and the VLanID of the second target device according to the Ethernet message;

[0029] A second determination module: used to determine the MAC address and IP address of the first target device, and the MAC address and IP address of the second target device according to the ARP / RARP message;

[0030] The third determination module is used to determine the network topology relationship of the plurality of target devices according to the ICMP message.

[0031] In a third aspect, a computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0032] Receiving a message of each of the target devices among the multiple target devices sent by the gateway device, the message including an Ethernet message of the target device, an ARP / RARP message of the target device, a TCP / UDP message of the target device, and an ICMP message of the target device;

[0033] Determine, according to the Ethernet message, a VLanID of the first target device and a VLanID of the second target device;

[0034] Determine the MAC address and IP address of the first target device and the MAC address and IP address of the second target device according to the ARP / RARP message;

[0035] According to the ICMP message, a network topology relationship of the plurality of target devices is determined.

[0036] In a fourth aspect, a computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the following steps are implemented:

[0037] Receiving a message of each of the target devices among the multiple target devices sent by the gateway device, the message including an Ethernet message of the target device, an ARP / RARP message of the target device, a TCP / UDP message of the target device, and an ICMP message of the target device;

[0038] Determine, according to the Ethernet message, a VLanID of the first target device and a VLanID of the second target device;

[0039] Determine the MAC address and IP address of the first target device and the MAC address and IP address of the second target device according to the ARP / RARP message;

[0040] According to the ICMP message, a network topology relationship of the plurality of target devices is determined.

[0041] The present invention has at least the following beneficial effects:

[0042] The present invention is based on further analysis and research of the existing technical problems, and recognizes that in the existing method of obtaining the connection relationship between each network device in the network, it is necessary to modify and configure the existing devices in the network, and will affect the existing network, resulting in poor use effect. The present invention receives a message from each of the multiple target devices sent by the gateway device through a terminal device, and determines the network topology relationship of the multiple target devices according to the message of each target device. There is no need to configure and upgrade the target devices in the existing network, and there is no need for the terminal device to send a request to the target device in the network. No message is generated in the process, which will affect the existing network, and the use effect is better. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A schematic diagram of a flow chart of a method for determining a network topology provided by an embodiment of the present invention;

[0044] Figure 2 A schematic diagram of an independent deployment framework of a method for determining a network topology provided by an embodiment of the present invention;

[0045] Figure 3 A schematic diagram of a distributed deployment framework of a method for determining a network topology provided by an embodiment of the present invention;

[0046] Figure 4 A schematic diagram of a network topology acquisition result provided by an embodiment of the present invention;

[0047] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0049] The method for determining the network topology provided by the present application, in one embodiment, is as follows: Figure 1 and Figure 2 As shown, a method for determining a network topology is provided, comprising the following steps:

[0050] Receiving a message of each of the target devices among the multiple target devices sent by the gateway device, the message including an Ethernet message of the target device, an ARP / RARP message of the target device, a TCP / UDP message of the target device, and an ICMP message of the target device;

[0051] Before receiving the message of each of the target devices among the multiple target devices sent by the gateway device, all the mirrored messages are sent to the current device through the gateway device, or the gateway device sends all the mirrored messages to a storage device, and obtains the network message data through data import or direct access.

[0052] Determine, according to the Ethernet message, a VLanID of the first target device and a VLanID of the second target device;

[0053] Determine the MAC address and IP address of the first target device and the MAC address and IP address of the second target device according to the ARP / RARP message;

[0054] According to the ICMP message, a network topology relationship of the plurality of target devices is determined.

[0055] in, Figure 2 Schematic diagram of an independent deployment framework of a method for determining a network topology provided by an embodiment of the present invention

[0056] In one embodiment, before determining the network topology relationship of the plurality of target devices according to the ICMP message, the method further includes:

[0057] According to the TCP / UDP message, the MAC address and IP address of the first target device and the MAC address and IP address of the second target device are determined.

[0058] In one embodiment, before determining the network topology relationship of the plurality of target devices according to the ICMP message, the method further includes:

[0059] Dividing a plurality of logical networks according to the VLanID of the first target device and the VLanID of the second target device;

[0060] For each of the logical networks, when receiving the ARP / RARP message of the first target device, the MAC address of the first target device and the IP address of the first target device are bound, and the device is determined to be the first target device; at the same time, the MAC address of the second target device and the IP address of the second target device are bound, and the device is determined to be the second target device;

[0061] In the case that no ARP / RARP message of the target device is received, the type of the target device is determined according to the MAC address or IP address of the target device, wherein the target device is the first target device or the second target device.

[0062] like Figure 3 As shown, an enterprise may divide multiple LANs according to departments or workshops, so each LAN deploys a device running this method, and then converges to a top-level device, which generates complete topology information from the network topologies of multiple LANs. Figure 3 A schematic diagram of a distributed deployment framework of a method for determining a network topology provided by an embodiment of the present invention.

[0063] In one embodiment, determining the network topology relationship of the plurality of target devices according to the ICMP message includes:

[0064] The ICMP message is parsed, and when a PING message exists in the ICMP message, it is determined that the first target device and the second target device are different devices, and a network topology relationship between the first target device and the second target device is determined.

[0065] In one embodiment, determining the network topology relationship of the plurality of target devices according to the ICMP message further includes:

[0066] The ICMP message is parsed, and when a Traceroute message exists in the ICMP message, the Traceroute message is parsed according to a preset protocol to determine whether the first target device and the second target device are the same target device, and when the first target device and the second target device are different devices, a network topology relationship between the first target device and the second target device is determined.

[0067] In one embodiment, determining the network topology relationship of the plurality of target devices according to the ICMP message further includes:

[0068] The ICMP message is parsed, and when there is no PING message and Traceroute message in the ICMP message, a network topology relationship between the first target device and the second target device is determined according to the IP address of the first target device and the IP address of the second target device.

[0069] In one embodiment, after determining the network topology relationship of the plurality of target devices according to the ICMP message, the method further comprises:

[0070] Acquire actual traffic data between the first target device and the second target device within a preset time interval, and when an actual traffic value corresponding to the actual traffic data is less than a preset traffic value, shut down the third target device; or disconnect the third target device from the network;

[0071] The third target device is the first target device or the second target device.

[0072] In this embodiment, the network data of each device in the network can be monitored in real time, or the network data in the network can be obtained from the storage device, without actively sending data, and passively receiving or analyzing existing messages.

[0073] In one embodiment, multiple logical networks are divided according to VLanID, and then each logical network is analyzed. The analysis method and process of each logical network are the same. In a logical network, if there is an ARP / RARP message, the source IP and the source Mac are bound together and determined as one device; the destination IP and the destination Mac are bound together and determined as one device. If there is no ARP / RARP message, the Mac address or IP address is used to determine it as one device.

[0074] If there is a PING message in the parsed ICMP message, the source IP and the destination IP are determined to be two devices and it is determined that the two are connected.

[0075] If there is a Traceroute message in the parsed ICMP message, the message is parsed according to the protocol, and the relationship between the device and the connection is determined.

[0076] For other IP packets, the source IP and destination IP in a packet are determined to be connected. If there is only one source IP_A source MAC_A and destination IP_B destination MAC_B and its reverse packet source IP_B source MAC_B and destination IP_A destination MAC_A, it is determined to be two devices (IP_A and IP_B) and it is determined that the two have a connection relationship. If one IP corresponds to a packet with multiple MAC addresses, it is treated as a forwarding message. For example, source IP_A source MAC_1 and destination IP_B destination MAC_2, source IP_A source MAC_2 and destination IP_B destination MAC_3, source IP_A source MAC_3 and destination IP_B destination MAC_4..., IP_A and IP_B are determined to be two devices, and MAC_2, MAC_3, etc. in the process are marked as forwarding devices, such as routers and other gateway devices. If a MAC address corresponds to a message with multiple IPs, for example, source IP_1 source MAC_A, source IP_2 source MAC_A, source IP_3 source MAC_A... or destination IP_1 destination MAC_A, destination IP_2 destination MAC_A, destination IP_3 destination MAC_A, each IP is determined as a device and MAC_A is determined as a gateway or proxy server.

[0077] In one embodiment, the target device can also be identified by features, based on the TCP / UDP port and message load features, extracting features according to the protocol, identifying applications and performing traffic statistics. Since the industrial network environment is closed, the devices and services that can be connected in the network are known, and the port number changes of known services can also be obtained. The identification technology based on TCP / UDP ports can fully guarantee the coverage and recognition rate of messages. At the same time, due to the closed nature of the industrial network environment and the security requirements of enterprises, some enterprises will customize communication protocols. For this scenario, the device feature identification is improved by configuring the port and application name by the user.

[0078] In one embodiment, the target device can also be monitored for traffic, and traffic can be counted and monitored based on the source and destination addresses. If there is no traffic within a certain period of time, the device is considered to be shut down or disconnected from the network. If real-time packet analysis is obtained, the current system time is directly used. If there is no traffic from a device within a time period, the device is considered to be disconnected from the network.

[0079] like Figure 4As shown, in this embodiment, both real-time analysis and historical data analysis can be performed. According to the information of message statistics, not only the connection relationship between each device in the network can be generated, but also the traffic can be counted, including uplink and downlink, protocol type, such as the uplink and downlink traffic statistics of OPCUA and MODBUS in the figure, asset type, identify and mark the manufacturer information according to the mac address range assigned to each manufacturer by international organizations or mark the asset information according to custom information, connection active status, mark the active status according to the uplink and downlink traffic per unit time, as shown in the figure below, the greater the traffic per unit time, the redder the connection color, and the longer the time without data transmission, the larger the dashed line interval.

[0080] In this embodiment, a message for each of the multiple target devices sent by the gateway device is received by the terminal device, and the network topology relationship of the multiple target devices is determined according to the message of each target device. There is no need to configure and upgrade the target devices in the existing network, and there is no need for the terminal device to send a request to the target device in the network. No message is generated in the process, which will affect the existing network, and the use effect is better.

[0081] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0082] In one embodiment, a device for determining a network topology is provided, comprising the following program modules:

[0083] Receiving module: used for receiving a message of each of the target devices among the multiple target devices sent by the gateway device, wherein the message includes an Ethernet message of the target device, an ARP / RARP message of the target device, a TCP / UDP message of the target device, and an ICMP message of the target device;

[0084] A first determination module: used to determine the VLanID of the first target device and the VLanID of the second target device according to the Ethernet message;

[0085] A second determination module: used to determine the MAC address and IP address of the first target device, and the MAC address and IP address of the second target device according to the ARP / RARP message;

[0086] The third determination module is used to determine the network topology relationship of the plurality of target devices according to the ICMP message.

[0087] For the specific definition of the network topology determination device, please refer to the definition of the network topology determination method above, which will not be repeated here. Each module in the above-mentioned network topology determination device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0088] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for determining a network topology is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0089] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0090] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, which involves all or part of the processes in the above-mentioned embodiment method.

[0091] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which involves all or part of the processes in the above-mentioned embodiment method.

[0092] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0093] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0094] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for determining a network topology, characterized in that: The method comprises: Receiving a message of each of the target devices among the multiple target devices sent by the gateway device, the message including an Ethernet message of the target device, an ARP / RARP message of the target device, a TCP / UDP message of the target device, and an ICMP message of the target device; Determine, according to the Ethernet message, a VLanID of the first target device and a VLanID of the second target device; Determine the MAC address and IP address of the first target device and the MAC address and IP address of the second target device according to the ARP / RARP message; Determine the network topology relationship of the plurality of target devices according to the ICMP message; Before determining the network topology relationship of the plurality of target devices according to the ICMP message, the method further includes: Determine the MAC address and IP address of the first target device and the MAC address and IP address of the second target device according to the TCP / UDP message; Before determining the network topology relationship of the plurality of target devices according to the ICMP message, the method further includes: Dividing a plurality of logical networks according to the VLanID of the first target device and the VLanID of the second target device; For each of the logical networks, when receiving the ARP / RARP message of the first target device, the MAC address of the first target device and the IP address of the first target device are bound, and the device is determined to be the first target device; at the same time, the MAC address of the second target device and the IP address of the second target device are bound, and the device is determined to be the second target device; In the case that no ARP / RARP message of the target device is received, the type of the target device is determined according to the MAC address or IP address of the target device, wherein the target device is the first target device or the second target device.

2. The method according to claim 1, characterized in that Determining the network topology relationship of the plurality of target devices according to the ICMP message includes: The ICMP message is parsed, and when a PING message exists in the ICMP message, it is determined that the first target device and the second target device are different devices, and a network topology relationship between the first target device and the second target device is determined.

3. The method according to claim 1, characterized in that The determining, according to the ICMP message, a network topology relationship of the plurality of target devices further comprises: The ICMP message is parsed, and when a Traceroute message exists in the ICMP message, the Traceroute message is parsed according to a preset protocol to determine whether the first target device and the second target device are the same target device, and when the first target device and the second target device are different devices, a network topology relationship between the first target device and the second target device is determined.

4. The method according to claim 1, characterized in that The determining, according to the ICMP message, a network topology relationship of the plurality of target devices further comprises: The ICMP message is parsed, and when there is no PING message and Traceroute message in the ICMP message, a network topology relationship between the first target device and the second target device is determined according to the IP address of the first target device and the IP address of the second target device.

5. The method according to claim 1, characterized in that After determining the network topology relationship of the plurality of target devices according to the ICMP message, the method further includes: Acquire actual traffic data between the first target device and the second target device within a preset time interval, and when an actual traffic value corresponding to the actual traffic data is less than a preset traffic value, shut down the third target device; or disconnect the third target device from the network; The third target device is the first target device or the second target device.

6. A device for determining a network topology, characterized in that: The device comprises: Receiving module: used for receiving a message of each of the target devices among the multiple target devices sent by the gateway device, wherein the message includes an Ethernet message of the target device, an ARP / RARP message of the target device, a TCP / UDP message of the target device, and an ICMP message of the target device; A first determination module: used to determine the VLanID of the first target device and the VLanID of the second target device according to the Ethernet message; A second determination module: used to determine the MAC address and IP address of the first target device, and the MAC address and IP address of the second target device according to the ARP / RARP message; A third determining module: used to determine the network topology relationship of the plurality of target devices according to the ICMP message; Before determining the network topology relationship of the plurality of target devices according to the ICMP message, the method further includes: Determine the MAC address and IP address of the first target device and the MAC address and IP address of the second target device according to the TCP / UDP message; Before determining the network topology relationship of the plurality of target devices according to the ICMP message, the method further includes: Dividing a plurality of logical networks according to the VLanID of the first target device and the VLanID of the second target device; For each of the logical networks, when receiving the ARP / RARP message of the first target device, the MAC address of the first target device and the IP address of the first target device are bound, and the device is determined to be the first target device; at the same time, the MAC address of the second target device and the IP address of the second target device are bound, and the device is determined to be the second target device; In the case that no ARP / RARP message of the target device is received, the type of the target device is determined according to the MAC address or IP address of the target device, wherein the target device is the first target device or the second target device.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, 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 5 are implemented.