Local area network topology structure determination method and device, equipment, medium and product

By setting up a socket server on the gateway to collect and match the address information of intranet devices, the problem of LAN device identification is solved, and accurate identification of LAN network topology and fault location are achieved, supporting end-to-end network management and quality analysis.

CN121125506APending Publication Date: 2025-12-12CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511185606.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing technologies cannot identify LAN devices across third-party routing devices, making it impossible to perform end-to-end network management and network quality correlation analysis.

Method used

By setting up a socket server on the gateway to build a data acquisition server, the address information of each terminal device in the intranet is collected, and precise and fuzzy matching analysis is performed to identify the topology of all terminal devices in the intranet.

Benefits of technology

It enables comprehensive and accurate identification of intranet network elements, generates local area network topology diagrams, evaluates network performance, locates fault points, provides a basis for fault diagnosis, and performs correlation management of intranet network element quality and network quality analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125506A_ABST
    Figure CN121125506A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of transmission and bearer networks, the technical field of security and the technical field of personal family services, and provides a local area network topological structure determination method, device and equipment, a medium and a product. The method comprises the following steps: receiving first address information of each terminal device in an intranet through a data acquisition server; the data acquisition server is built by adopting a socket server (Socket Server) mode; and performing matching analysis on the first address information and second address information of the network element in the intranet to obtain a network topology structure of the local area network. According to the method for determining the network topology structure of the local area network, the topology structure of the network element of the internal network can be comprehensively and accurately identified, the performance of the network is evaluated according to the generated network topology structure diagram of the local area network, the fault point in the network is positioned, a basis for troubleshooting is provided, and association management of the quality of the network element of the internal network and network quality analysis are carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of transmission and bearer network technology, security technology, and personal home service technology, and in particular to a method, apparatus, device, medium, and product for determining the topology of a local area network. Background Technology

[0002] Local area network (LAN) topology collection refers to the process of gathering and analyzing the connections and layouts between devices within a LAN using specific technologies and methods. This information is used to better understand and optimize network performance. Common collection methods include network scanning tools, the Simple Network Management Protocol (SNMP), and network management software. However, existing technologies can only identify single-layer network device information and cannot identify LAN devices across third-party routing devices. The device information that can be identified is simple, which makes it impossible to perform subsequent end-to-end network management and end-to-end network quality correlation analysis. Summary of the Invention

[0003] This application provides a method, apparatus, device, medium, and product for determining the topology of a local area network (LAN). It addresses the shortcomings of existing technologies, such as the inability to identify LAN devices across third-party routing devices, limited device information identification, and the inability to perform subsequent end-to-end network management and end-to-end network quality correlation analysis. The application utilizes a data acquisition server built with a SocketServer to collect address information of each terminal device within the intranet, accurately identifying all terminals within the intranet. It then matches and analyzes the address information of all terminal devices with the address information of network elements, comprehensively and accurately identifying the topology of intranet network elements. Based on the generated LAN topology diagram, it evaluates network performance, locates fault points in the network, provides a basis for troubleshooting, and performs correlation management of intranet network element quality and network quality analysis.

[0004] In a first aspect, embodiments of this application provide a method for determining the topology of a local area network (LAN), applied to a gateway, comprising: The system receives the first address information of each terminal device in the intranet through a data acquisition server; the data acquisition server is built using the Socket Server method. The local area network topology is obtained by matching and analyzing the first address information and the second address information of the network elements in the intranet.

[0005] In one embodiment, the first address information includes the first Media Access Control (MAC) address of the network element to which each terminal device is connected, the second address information of the network element includes the second MAC address of the network element, and the matching analysis includes precise matching analysis; the step of performing matching analysis on the first address information and the second address information of the network elements in the intranet to obtain the local area network topology includes: performing precise matching analysis on each of the first MAC addresses and each of the second MAC addresses to obtain a first matching result; and determining the local area network topology based on the first matching result.

[0006] In one embodiment, determining the local area network topology based on the first matching result includes: if the first matching result is a successful match, determining the target terminal device corresponding to the successfully matched first MAC address and the target network element corresponding to the successfully matched second MAC address; and determining the local area network topology based on the target terminal device and the target network element.

[0007] In one embodiment, the matching analysis further includes fuzzy matching analysis; determining the local area network topology based on the first matching result includes: if the first matching result is a matching failure, performing fuzzy matching analysis on each of the first MAC addresses and each of the second MAC addresses respectively to obtain a second matching result; and determining the local area network topology based on the second matching result.

[0008] In one embodiment, performing fuzzy matching analysis on each of the first MAC addresses and each of the second MAC addresses to obtain a second matching result includes: performing fuzzy matching analysis on each of the first MAC addresses and each of the second MAC addresses based on a first target value in each of the first MAC addresses and a second target value in each of the second MAC addresses to obtain a numerical difference between the first target value and the second target value; the number of bits of the first target value in the first MAC address and the number of bits of the second target value in the second MAC address are the same; if the numerical difference meets a difference threshold, the second matching result is determined to be a successful match; if the numerical difference does not meet the difference threshold, the second matching result is determined to be a failed match.

[0009] In one embodiment, determining the local area network topology based on the second matching result includes: if the second matching result is a successful match, determining the target terminal device corresponding to the successfully matched first MAC address and the target network element corresponding to the successfully matched second MAC address; and determining the local area network topology based on the target terminal device and the target network element.

[0010] In one embodiment, the first address information further includes the first Internet Protocol address (IP address) of each terminal device, and the second address information of the network element further includes the uplink IP address of the networking router; determining the local area network topology based on the second matching result includes: if the second matching result is a matching failure, matching each of the first IP addresses and the uplink IP address to obtain a third matching result; and determining the local area network topology based on the third matching result.

[0011] In one embodiment, determining the local area network topology based on the third matching result includes: if the third matching result is a match failure, determining the local area network topology based on the names of the terminal devices connected to the gateway and the names of the networking router devices; if the third matching result is a match success, determining the local area network topology based on the successfully matched terminal devices and networking router devices.

[0012] In one embodiment, before receiving the first address information of each terminal device in the intranet through the data acquisition server, the method further includes: determining the target intranet domain name of the gateway; receiving DNS request messages sent by each terminal device based on the target intranet domain name; intercepting the DNS request messages based on DNS spoofing functionality; and parsing the DNS request messages to obtain the first address information of each terminal device.

[0013] In one embodiment, after matching and analyzing the first address information and the second address information of the network elements in the intranet to obtain the local area network topology, the method further includes: obtaining network monitoring information of the uplink network elements connected to each of the terminal devices; and uploading the local area network topology and the network monitoring information to the provincial front-end platform.

[0014] In one embodiment, before receiving the first address information of each terminal device in the intranet through the data acquisition server, the method further includes: blocking domain name and port packets sent from the external network to access the data acquisition server.

[0015] Secondly, embodiments of this application provide a local area network topology determination device, comprising: The receiving module is used to receive the first address information of each terminal device in the intranet through the data acquisition server; the data acquisition server is built using the Socket Server method. The matching module is used to perform matching analysis on the first address information and the second address information of the network elements in the intranet to obtain the local area network topology.

[0016] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the program to implement the steps of the local area network topology determination method described in the first or second aspect.

[0017] Fourthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the local area network topology determination method described in the first or second aspect.

[0018] The local area network (LAN) topology determination method, apparatus, device, medium, and product provided in this application embodiment involve a gateway receiving first address information of each terminal device in the intranet through a data acquisition server. The data acquisition server is built using a Socket Server architecture. The first address information is matched and analyzed with the second address information of network elements in the intranet to obtain the LAN topology. Thus, for third-party routing devices, the gateway, through the data acquisition server built using a Socket Server, collects the address information of each terminal device in the intranet, accurately identifies all terminals in the intranet, and matches and analyzes the address information of all terminal devices with the address information of network elements. This allows for a comprehensive and accurate identification of the intranet network element topology. Based on the generated LAN topology diagram, network performance is evaluated, fault points in the network are located, a basis for fault diagnosis is provided, and correlation management and network quality analysis of intranet network elements are performed. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 It is one of the structural diagrams of the local area network topology provided by existing technology.

[0021] Figure 2 This is the second schematic diagram of the network topology of a local area network provided by existing technology.

[0022] Figure 3 This is the third schematic diagram of the network topology of a local area network provided by existing technology.

[0023] Figure 4 This is a flowchart illustrating the method for determining the local area network topology provided in this application.

[0024] Figure 5 This is a schematic diagram of the local area network topology determination system provided in this application.

[0025] Figure 6 This is a flowchart illustrating the matching analysis method provided in this application.

[0026] Figure 7 This is a schematic diagram of the local area network topology determination device provided in this application. Figure 8 This is a schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0028] Currently, local area network topology relationships are generally connected in two ways: the first is a scenario where the set-top box and router are directly connected to the gateway; the second is a scenario where the set-top box is connected to the gateway through a router.

[0029] Figure 1 This is one of the structural diagrams of local area network topology provided by existing technology, such as... Figure 1 As shown, IoT devices such as mobile phones, routers, set-top boxes, smart speakers, and door sensors are directly connected to the gateway.

[0030] Figure 2 This is the second schematic diagram of the local area network topology provided by existing technology, such as... Figure 2 As shown, the mobile phone is directly connected to the gateway, while IoT devices, mobile phones, and set-top boxes are connected to the gateway through a bridging network router.

[0031] Figure 3 This is the third schematic diagram of the local area network topology provided by existing technology, such as... Figure 3 As shown, the mobile phone is directly connected to the gateway, while IoT devices, mobile phones, and set-top boxes are connected to the gateway through a router network.

[0032] While existing home / enterprise broadband network quality management systems have built relatively complete network quality monitoring systems for individual key network elements, they have yet to establish an end-to-end LAN network quality monitoring system. The key challenge currently faced is the inability to construct a complete intranet network element topology map based on existing network management and monitoring data, making it virtually impossible to correlate key network elements. Although cross-platform data analysis using set-top box and gateway data from the asset management platform can correlate some gateways and set-top box devices, difficulties in data integration, insufficient accuracy of data entered into the platform, and unreasonable formatting make it difficult for existing technologies to accurately identify all terminals within the same intranet, nor can they identify the intranet network element topology, thus hindering the correlated management and network quality analysis of intranet network elements.

[0033] Based on the above problems, this application provides a method for determining the topology of a local area network (LAN). The gateway collects the address information of each terminal device in the intranet through a data acquisition server built with a Socket Server, accurately identifies all terminals in the intranet, and matches and analyzes the address information of all terminal devices with the address information of network elements. This enables a comprehensive and accurate identification of the topology of intranet network elements. Based on the generated LAN topology diagram, the network performance is evaluated, fault points in the network are located, and a basis for fault diagnosis is provided. This allows for the correlation management of intranet network element quality and network quality analysis.

[0034] The following is combined with Figures 4-6 This application describes a method for determining the topology of a local area network (LAN). This method is applicable to the LAN topology of any routing device. The subject executing this method can be an electronic device or a LAN topology determination method installed in that electronic device. The LAN topology determination device can be implemented by software, hardware, or a combination of both.

[0035] Figure 4 This is a flowchart illustrating the method for determining the local area network topology provided in this application, as shown below. Figure 4 As shown, the method includes the following: Step 101: Receive the first address information of each terminal device in the intranet through the data acquisition server.

[0036] The data acquisition server is built using the Socket Server method.

[0037] Here, the first address information can be information that has been cleaned and formatted to ensure the accuracy and consistency of the data.

[0038] Here, terminal devices include, but are not limited to, routers, mobile phones, computers, Internet of Things (IoT) devices, and other terminal devices.

[0039] Here, the first address information includes, but is not limited to, the Media Access Control Address (MAC) and the Internet Protocol Address (IP).

[0040] It should be noted that the data acquisition server is a server built on the gateway's soft header using the Socket Server method. The data acquisition server address uses a preset domain name and port, and supports HTTP data interaction. Here, the gateway can be a home bandwidth gateway or an enterprise bandwidth gateway.

[0041] It should be noted that the data acquisition server built using the Socket Server method can be adapted to various low-end IoT devices.

[0042] In another embodiment, before receiving the first address information of each terminal device in the intranet through the data acquisition server, the method further includes: determining the target intranet domain name of the gateway; receiving DNS request messages sent by each terminal device based on the target intranet domain name; intercepting the DNS request messages based on the DNS spoofing function; and parsing the DNS request messages to obtain the first address information of each terminal device.

[0043] Here, the target intranet domain name can be pre-configured.

[0044] Here, the DNS spoofing function is implemented by modifying the gateway firmware driver.

[0045] After the terminal device connects to the gateway, the terminal sends a Domain Name System (DNS) request message to the gateway. The gateway intercepts the DNS request message of the target internal network domain name and obtains the IP address and MAC address corresponding to the target internal network domain name by resolving the DNS request message.

[0046] Optionally, after receiving a DNS request message, the gateway can intercept the DNS request message, prohibiting DNS from sending it to the external network, thereby reducing resource consumption and data volume, and reducing the burden of data transmission.

[0047] For example, the IP address of the intranet interconnection service can be the gateway local management address resolved from the domain name "z0403816.yw", and the intranet interconnection service port number is 50005.

[0048] For example, the target intranet domain name of the home gateway is set to "z0403816.yw". The gateway intercepts DNS request messages for the domain name z0403816.yw, resolves the DNS request messages, and obtains IP addresses, MAC addresses, etc. Specifically, the home gateway intercepts DNS request messages for the domain name z0403816.yw during Layer 2 (data link layer) message processing, that is, it intercepts DNS requests from devices connected to the home gateway when the home gateway is operating in bridge mode. The home gateway also intercepts DNS request messages for the domain name z0403816.yw during Layer 3 (network layer) message processing, that is, it intercepts DNS requests from devices connected to the home gateway when the home gateway is operating in routing mode.

[0049] It should be noted that, for data security reasons, the gateway does not cache DNS response messages.

[0050] In this embodiment of the application, by constructing a server with a fixed domain name, and by employing methods such as restricted domain name access mechanisms, interception mechanisms, and internal network domain name processing, data security is ensured, thus solving the data security problems in the prior art.

[0051] Furthermore, before receiving the first address information of each terminal device in the intranet through the data acquisition server, the method further includes: blocking domain name and port packets sent from the external network to access the data acquisition server.

[0052] It should be noted that by adding firewall rules to the gateway, the domain name and port packets of the access data collection server sent from the external network are blocked. Therefore, the Socket Server is only accessible from the internal network.

[0053] In this embodiment of the application, by blocking specific domain names and port packets on the WAN side, the Socket Server is restricted to intranet access, thereby protecting the transmission security of the system.

[0054] Step 102: Perform matching analysis on the first address information and the second address information of the network elements in the intranet to obtain the local area network topology.

[0055] Optionally, network elements include, but are not limited to, gateways, routing devices, WiFi hotspots, etc. Routing devices can be routing devices developed by the original network service provider or equipment manufacturer, or router devices independently developed, produced and sold by non-original network service providers or equipment manufacturers.

[0056] Here, the matching analysis can be a precise match between the first address information and the second address information; it can be a fuzzy match between the first address information and the second address information; or it can be a precise match between the first address information and the second address information followed by a fuzzy match.

[0057] For example, the first address information includes the first MAC address of the network element to which each terminal device is connected, the second address information of the network element includes the second MAC address of the network element, and the matching analysis includes precise matching analysis; the step of performing matching analysis on the first address information and the second address information of the network elements in the intranet to obtain the local area network topology includes: performing precise matching analysis on each of the first MAC addresses and each of the second MAC addresses to obtain a first matching result; and determining the local area network topology based on the first matching result.

[0058] Here, the network element connected to the terminal device can be either a router or a gateway.

[0059] Here, the second MAC address can be the LAN port MAC of the gateway or router, or it can be the MAC of the WiFi hotspot and the LAN MAC.

[0060] Exact match analysis means that the first MAC address and the second MAC address are exactly the same. Specifically, if the first MAC address and the second MAC address are exactly the same, the first match result is considered successful; if the first MAC address and the second MAC address are not exactly the same, the first match result is considered unsuccessful.

[0061] Here, the local area network topology is obtained by associating terminal devices with MAC addresses that match perfectly with gateways / network routers.

[0062] In this embodiment of the application, by accurately matching the first MAC address and the second MAC address, the accuracy of the matching is improved, and all terminals under the same intranet can be accurately identified, generating a local area network topology structure, thus filling the gap in local area network topology structure identification.

[0063] Furthermore, determining the local area network topology based on the first matching result includes: if the first matching result is a successful match, determining the target terminal device corresponding to the successfully matched first MAC address and the target network element corresponding to the successfully matched second MAC address; and determining the local area network topology based on the target terminal device and the target network element.

[0064] It should be noted that if the first MAC address and the second MAC address match exactly, it means that the target terminal device corresponding to the first MAC address is connected to the target network element (i.e., router or gateway) corresponding to the second MAC address, and the local area network topology is generated according to the connection relationship.

[0065] In this embodiment of the application, a local area network (LAN) topology is generated by connecting the target terminal device and the target network element whose MAC addresses are accurately matched, thus filling the gap in LAN topology identification.

[0066] Furthermore, the matching analysis also includes fuzzy matching analysis; determining the local area network topology based on the first matching result includes: if the first matching result is a matching failure, performing fuzzy matching analysis on each of the first MAC addresses and each of the second MAC addresses to obtain a second matching result; and determining the local area network topology based on the second matching result.

[0067] Optionally, fuzzy matching analysis means that if some values ​​in the first MAC address and the second MAC address are the same or the differences are within the difference threshold range, it indicates that the second matching result is successful.

[0068] Specifically, after a precise matching analysis fails, a fuzzy matching analysis is performed on each first MAC address and each second MAC address to obtain a second matching result. If the second matching result is successful, a local area network topology is generated; if the second matching result fails, matching of terminal devices and network elements continues or the matching process ends.

[0069] If the second matching result is successful, the local area network topology is generated based on the matching result. If the second matching result is unsuccessful, the terminal devices and network elements are re-matched or the process ends.

[0070] In this embodiment, if a precise match fails, a deeper fuzzy match is performed on the MAC address to make the first MAC address and the second MAC address match as successfully as possible. In this way, all terminals under the same intranet can be identified, and a local area network topology can be generated, filling the gap in local area network topology identification.

[0071] Further, the step of performing fuzzy matching analysis on each of the first MAC addresses and each of the second MAC addresses to obtain a second matching result includes: performing fuzzy matching analysis on each of the first MAC addresses and each of the second MAC addresses based on a first target value in each of the first MAC addresses and a second target value in each of the second MAC addresses to obtain the numerical difference between the first target value and the second target value; the number of bits of the first target value in the first MAC address and the number of bits of the second target value in the second MAC address are the same; if the numerical difference meets the difference threshold, the second matching result is determined to be a successful match; if the numerical difference does not meet the difference threshold, the second matching result is determined to be a failed match.

[0072] It should be noted that MAC addresses are within a continuous range, and generally only the last digit of the MAC address changes within 20 digits above or below. Therefore, fuzzy matching analysis can be used for matching.

[0073] Here, the first target value and the second target value can be the fifth or sixth value in the corresponding MAC address.

[0074] It should be noted that the first target value has the same number of bits in the first MAC address and the second target value has the same number of bits in the second MAC address. In other words, if the first target value is the fifth value in the first MAC address, then the second target value is the fifth value in the second MAC address.

[0075] Here, the difference threshold can be any suitable value, such as 19 or 20. Generally, a MAC with a difference threshold within ±20 is considered a complete match.

[0076] In this embodiment of the application, the second matching result is determined by fuzzy matching between the numerical difference and the difference threshold between the target values ​​in the first MAC address and the second MAC address, thereby improving the accuracy of the second matching result and providing an accurate data foundation for generating the local area network topology.

[0077] Furthermore, determining the local area network topology based on the second matching result includes: if the second matching result is a successful match, determining the target terminal device corresponding to the successfully matched first MAC address and the target network element corresponding to the successfully matched second MAC address; and determining the local area network topology based on the target terminal device and the target network element.

[0078] Specifically, if the second matching result is successful, it indicates that the target terminal device is a downstream device of the target network element, and a local area network topology is generated based on the connection relationship.

[0079] Here, the target network element can be either a routing device or a gateway.

[0080] In this embodiment of the application, fuzzy matching is performed by the numerical difference between the target values ​​in the first MAC address and the second MAC address, so that the first MAC address and the second MAC address match as successfully as possible. In this way, all terminals under the same intranet can be identified, and a local area network topology structure can be generated, filling the gap in local area network topology structure identification.

[0081] Furthermore, the first address information also includes the first IP address of each of the terminal devices, and the second address information of the network element also includes the uplink IP address of the networking router; the step of determining the local area network topology based on the second matching result includes: if the second matching result is a matching failure, matching each of the first IP addresses and the uplink IP address to obtain a third matching result; and determining the local area network topology based on the third matching result.

[0082] Here, the first IP address of the terminal device is also called the IP address of the downstream terminal device of the gateway. If the IP address of the terminal device matches the upstream IP address, it means that the terminal device is connected to the network router. The connection relationship between the terminal device and the network router is obtained, and the local area network topology is further generated.

[0083] If the second matching result fails, the terminal device's IP address and the network router's uplink IP address need to be matched. If the third matching result is successful, the local area network topology is generated based on the third matching result. If the third matching result fails, the matching process continues or ends.

[0084] In this embodiment of the application, if the second matching result fails, the terminal device and network element are matched again based on the IP address to identify the connection relationship between the terminal device and the network element as much as possible. In this way, all terminals under the same intranet can be identified, and a local area network topology structure can be generated, filling the gap in local area network topology structure identification.

[0085] Furthermore, determining the local area network topology based on the third matching result includes: if the third matching result is a failure, determining the local area network topology based on the names of the terminal devices connected to the gateway and the names of the networking router devices; if the third matching result is a success, determining the local area network topology based on the successfully matched terminal devices and networking router devices.

[0086] It should be noted that if the name of the terminal device connected to the gateway is the same as the name of the network router, then the terminal device is a router.

[0087] Specifically, if the third matching result fails, the name of the terminal device connected to the gateway is matched with the name of the network router. If the name of the terminal device is the same as the name of the network router, the local area network topology is generated according to the connection relationship between the gateway and the network router.

[0088] If the third matching result is successful, the terminal devices and networking routers that successfully matched the IP addresses generate the local area network topology.

[0089] In this embodiment of the application, if the third matching result fails, the connection relationship of the terminal devices in the intranet is further determined based on the name of the terminal device connected to the gateway and the name of the networking router device, and the local area network topology is identified.

[0090] Furthermore, after matching and analyzing the first address information and the second address information of the network elements in the intranet to obtain the local area network topology, the method further includes: obtaining network monitoring information of the uplink network elements connected to each terminal device; and uploading the local area network topology and the network monitoring information to the provincial front-end platform.

[0091] In this embodiment of the application, after obtaining the local area network (LAN) topology, the LAN topology is uploaded to the provincial front-end platform for unified and precise management of LAN network elements. The network performance is evaluated based on the LAN topology, fault points in the network are located, and a basis for fault diagnosis is provided, laying the foundation for end-to-end monitoring and optimization of LAN network quality.

[0092] In another embodiment of the application, after the gateway probe server establishes a connection with the probe client of the downstream device, it performs token authentication verification. If the authentication fails, data cannot be sent or received, thus avoiding security risks.

[0093] In this embodiment, the gateway collects the address information of each terminal device in the intranet through a data acquisition server built by the Socket Server, accurately identifies all terminals in the intranet, matches and analyzes the address information of all terminal devices with the address information of network elements, and can comprehensively and accurately identify the topology of intranet network elements. Based on the generated local area network topology diagram, the gateway evaluates the network performance, locates fault points in the network, provides a basis for fault diagnosis, and performs correlation management of intranet network element quality and network quality analysis.

[0094] Figure 5 This is a schematic diagram of the local area network topology determination system provided in this application, such as... Figure 5As shown, the LAN topology determination system 500 includes a gateway 501, a router 502, a smart lock 503, a camera 504, a mobile phone 505, a set-top box 506, and a television 507. The gateway contains a data acquisition server, which is built using the SocketServer method. Specifically, the process of determining the LAN topology using the LAN topology determination system includes: the smart lock, router, camera, mobile phone, set-top box, and television upload first address information to the data acquisition server via specific protocols such as SNMP and Internet Control Message Protocol (ICMP). The data acquisition server matches and analyzes the first address information and the second address information to obtain the LAN topology. Here, the first address information can include the following three categories: terminal device name, MAC and IP addresses of the terminal device, MAC and IP address information of the uplink element, network monitoring information, and the name, MAC and IP address information of the downlink device of the router, as well as network monitoring information.

[0095] Figure 6 This is a flowchart illustrating the matching analysis method provided in this application, as shown below. Figure 6 As shown, it includes the following steps: Step 201: Determine whether the first MAC address of the network element to which the terminal device is connected and the second MAC address of the network element are accurately matched. If they are, the process ends; otherwise, proceed to step 202.

[0096] Here, an exact match means that the first MAC address and the second MAC address are exactly the same.

[0097] Step 202: Determine whether the first MAC address of the network element to which the terminal device is connected and the second MAC address of the network element are successfully matched. If successful, the process ends; otherwise, proceed to step 203.

[0098] Here, fuzzy matching means that the first target value in the first MAC address is the same as the second target value in the second MAC address.

[0099] Step 203: Determine whether the first IP address of the terminal device and the uplink IP address of the networking router match successfully. If they match, the process ends; otherwise, proceed to step 204.

[0100] Step 204: Determine whether the name of the terminal device connected to the gateway matches the name of the network router. If successful, end; otherwise, end.

[0101] The method for determining the local area network topology provided in this application has the following advantages: (1) By building a “data collection” server on home broadband (home broadband) and enterprise broadband (enterprise broadband) gateways, it is possible to comprehensively collect the topology relationships and information of various network devices in the local area network, including but not limited to routers, mobile phones, computers, IoT and other terminal devices, which solves the problem that existing technologies cannot accurately identify all terminals under the same intranet; (2) It can collect the operating status, configuration information, connection information and other information of intranet devices, which solves the problem that existing technologies cannot identify the topology of intranet network elements; (3) It also designs multi-level security measures, including restricted domain name access mechanism, intranet domain name processing, etc., to ensure data security and solve the data security problem in existing technologies; (4) Based on the generated intranet network element topology diagram, it evaluates the network performance, locates the fault points in the network, and provides the basis for fault diagnosis, which solves the problem that existing technologies cannot perform intranet network element quality association management and network quality analysis.

[0102] The local area network topology determination device provided in this application is described below. The local area network topology determination device described below and the local area network topology determination method described above can be referred to in correspondence.

[0103] Figure 7 This is a schematic diagram of the local area network topology determination device provided in this application, such as... Figure 7 As shown, the local area network topology determination device includes the following modules: Receiving module 710: Receives the first address information of each terminal device in the intranet through a data acquisition server; the data acquisition server is built using the Socket Server method; The matching module 720 is used to perform matching analysis on the first address information and the second address information of the network elements in the intranet to obtain the local area network topology.

[0104] In one embodiment, the first address information includes the first MAC address of the network element to which each terminal device is connected, the second address information of the network element includes the second MAC address of the network element, and the matching analysis includes precise matching analysis; the matching module 720 is specifically used to: perform precise matching analysis on the first MAC address and each of the second MAC addresses respectively to obtain a first matching result; and determine the local area network topology based on the first matching result.

[0105] In one embodiment, the matching module 720 is specifically used to: determine the target terminal device corresponding to the first MAC address that was successfully matched and the target network element corresponding to the second MAC address that was successfully matched, when the first matching result is a successful match; and determine the local area network topology based on the target terminal device and the target network element.

[0106] In one embodiment, the matching analysis further includes fuzzy matching analysis; the matching module 720 is further specifically used for: performing fuzzy matching analysis on each of the first MAC addresses and each of the second MAC addresses respectively to obtain a second matching result when the first matching result is a matching failure, and determining the local area network topology based on the second matching result.

[0107] In one embodiment, the matching module 720 is further configured to: perform fuzzy matching analysis on each of the first MAC addresses and each of the second MAC addresses based on the first target value in each of the first MAC addresses and the second target value in each of the second MAC addresses, to obtain the numerical difference between the first target value and the second target value; the number of bits of the first target value in the first MAC address and the number of bits of the second target value in the second MAC address are the same; if the numerical difference meets the difference threshold, determine that the second matching result is a successful match; if the numerical difference does not meet the difference threshold, determine that the second matching result is a failed match.

[0108] In one embodiment, the matching module 720 is further configured to: determine the target terminal device corresponding to the first MAC address that was successfully matched and the target network element corresponding to the second MAC address that was successfully matched, when the second matching result is a successful match; and determine the local area network topology based on the target terminal device and the target network element.

[0109] In one embodiment, the first address information further includes the first IP address of each terminal device, and the second address information of the network element further includes the uplink IP address of the networking router; the matching module 720 is further specifically used to: match each of the first IP addresses and the uplink IP address to obtain a third matching result when the second matching result is a matching failure; and determine the local area network topology based on the third matching result.

[0110] In one embodiment, the matching module 720 is further configured to: determine the local area network topology based on the name of the terminal device connected to the gateway and the name of the networking router device when the third matching result is a failure; and determine the local area network topology based on the successfully matched terminal device and the networking router device when the third matching result is a success.

[0111] In one embodiment, before receiving the first address information of each terminal device in the intranet through the data acquisition server, the local area network topology determination device further includes a parsing module, specifically used for: determining the target intranet domain name of the gateway; receiving DNS request messages sent by each terminal device based on the target intranet domain name; intercepting the DNS request messages based on the DNS spoofing function; and parsing the DNS request messages to obtain the first address information of each terminal device.

[0112] In one embodiment, after matching and analyzing the first address information and the second address information of the network elements in the intranet to obtain the local area network topology, the local area network topology determination device further includes a transmission module, specifically used for: acquiring network monitoring information of the uplink network elements connected to each terminal device; and uploading the local area network topology and the network monitoring information to the provincial front-end platform.

[0113] In one embodiment, before receiving the first address information of each terminal device in the intranet through the data acquisition server, the local area network topology determination device further includes a shielding module, specifically used to: shield domain name and port packets sent from the external network to access the data acquisition server.

[0114] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8 As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840. The processor 810, communications interface 820, and memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a method for determining the local area network topology. This method includes: receiving first address information of each terminal device in the intranet through a data acquisition server; the data acquisition server is built using a socket server; and performing matching analysis on the first address information and the second address information of the network elements in the intranet to obtain the local area network topology.

[0115] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0116] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the local area network topology determination method provided by the above methods. The method includes: receiving first address information of each terminal device in the intranet through a data acquisition server; the data acquisition server is built using a socket server; and performing matching analysis on the first address information and the second address information of the network elements in the intranet to obtain the local area network topology.

[0117] In another aspect, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the method for determining the local area network topology provided by the above methods. The method includes: receiving first address information of each terminal device in the intranet through a data acquisition server; the data acquisition server is built using a socket server; and performing matching analysis on the first address information and the second address information of the network elements in the intranet to obtain the local area network topology.

[0118] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0119] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for determining the topology of a local area network (LAN), characterized in that, Applied to gateways, including: The system receives the first address information of each terminal device in the intranet through a data acquisition server; the data acquisition server is built using the Socket Server method. The local area network topology is obtained by matching and analyzing the first address information and the second address information of the network elements in the intranet.

2. The method for determining the topology of a local area network according to claim 1, characterized in that, The first address information includes the first Media Access Control (MAC) address of the network element to which each terminal device is connected; the second address information of the network element includes the second MAC address of the network element; and the matching analysis includes precise matching analysis. The step of matching and analyzing the first address information and the second address information of the network elements in the intranet to obtain the local area network topology includes: Perform precise matching analysis on each of the first MAC addresses and each of the second MAC addresses to obtain the first matching result; Based on the first matching result, the local area network topology is determined.

3. The method for determining the topology of a local area network according to claim 2, characterized in that, Determining the local area network topology based on the first matching result includes: If the first matching result is a successful match, the target terminal device corresponding to the first MAC address that was successfully matched and the target network element corresponding to the second MAC address that was successfully matched are determined. Based on the target terminal device and the target network element, the local area network topology is determined.

4. The method for determining the topology of a local area network according to claim 2, characterized in that, The matching analysis also includes fuzzy matching analysis; Determining the local area network topology based on the first matching result includes: If the first matching result is a failure, perform fuzzy matching analysis on each of the first MAC addresses and each of the second MAC addresses to obtain a second matching result; Based on the second matching result, the local area network topology is determined.

5. The method for determining the local area network topology according to claim 4, characterized in that, The step of performing fuzzy matching analysis on each of the first MAC addresses and each of the second MAC addresses to obtain a second matching result includes: Based on the first target value in each first MAC address and the second target value in each second MAC address, fuzzy matching analysis is performed on each first MAC address and each second MAC address to obtain the numerical difference between the first target value and the second target value; the number of bits of the first target value in the first MAC address and the number of bits of the second target value in the second MAC address are the same; If the numerical difference meets the difference threshold, the second matching result is determined to be a successful match; If the numerical difference does not meet the difference threshold, the second matching result is determined to be a failed match.

6. The method for determining the topology of a local area network according to claim 4, characterized in that, The step of determining the local area network topology based on the second matching result includes: If the second matching result is a successful match, the target terminal device corresponding to the first MAC address that was successfully matched and the target network element corresponding to the second MAC address that was successfully matched are determined. Based on the target terminal device and the target network element, the local area network topology is determined.

7. The method for determining the topology of a local area network according to claim 4, characterized in that, The first address information also includes the first Internet Protocol address (IP address) of each terminal device, and the second address information of the network element also includes the uplink IP address of the networking router; The step of determining the local area network topology based on the second matching result includes: If the second matching result fails, the first IP address and the uplink IP address are matched to obtain the third matching result; Based on the third matching result, the local area network topology is determined.

8. The method for determining the topology of a local area network according to claim 7, characterized in that, The process of determining the local area network topology based on the third matching result includes: If the third matching result is a failure, the local area network topology is determined based on the name of the terminal device connected to the gateway and the name of the networking router device. If the third matching result is a successful match, the local area network topology is determined based on the successfully matched terminal device and the networking router device.

9. The method for determining the topology of a local area network according to claim 1, characterized in that, Before receiving the first address information of each terminal device in the intranet through the data acquisition server, the method further includes: Determine the target intranet domain name of the gateway; Based on the target intranet domain name, receive DNS request messages sent by each terminal device; Based on the DNS spoofing function, the DNS request packets are intercepted; The DNS request message is parsed to obtain the first address information of each terminal device.

10. The method for determining the topology of a local area network according to claim 1, characterized in that, After matching and analyzing the first address information and the second address information of the network elements in the intranet to obtain the local area network topology, the method further includes: Obtain network monitoring information of the network elements connected to each of the terminal devices; The local area network topology and the network monitoring information are uploaded to the provincial front-end platform.

11. The method for determining the topology of a local area network according to claim 1, characterized in that, Before receiving the first address information of each terminal device in the intranet through the data acquisition server, the method further includes: Block domain name and port packets sent from the external network to access the data acquisition server.

12. A device for determining the topology of a local area network (LAN), characterized in that, include: The receiving module is used to receive the first address information of each terminal device in the intranet through the data acquisition server; The data acquisition server is built using the Socket Server method; The matching module is used to perform matching analysis on the first address information and the second address information of the network elements in the intranet to obtain the local area network topology.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the local area network topology determination method as described in any one of claims 1 to 11.

14. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the local area network topology determination method as described in any one of claims 1 to 11.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the local area network topology determination method as described in any one of claims 1 to 11.