Equipment topological relation construction method, storage medium and equipment

By constructing a topology data structure with the main gateway as the root node in the FTTR network, inserting interval hop counts and role identifiers, and monitoring device discovery packets and multicast data packets, the problem of topology information loss caused by the dependence of FTTR network topology construction on the stability of the management channel is solved, and accurate and complete topology relationship construction is achieved.

CN121509859APending Publication Date: 2026-02-10CHINA MOBILE COMM GRP TERMINAL +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511857333.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

FTTR network topology construction relies on the stability of the management channel, which can lead to the loss of topology information, poor topology discovery integrity, and an inability to achieve accurate network topology construction.

Method used

By inserting hop count and role identifier into the topology data structure with the main gateway device as the root node, listening to device discovery messages broadcast by the slave gateway device and multicast data messages from wireless terminals, the topology relationship between the main gateway, slave gateways, and wireless terminals is constructed, and the topology information is integrated to achieve automatic topology construction without additional configuration.

Benefits of technology

It improves the accuracy and completeness of topology discovery and construction, ensures the integrity and reliability of wireless terminal topology information, and realizes the automatic construction of the entire network topology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121509859A_ABST
    Figure CN121509859A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an equipment topological relation construction method, a storage medium and equipment, and the method comprises the steps: constructing a topological data structure which takes main gateway equipment as a root node, and enabling the interval hop count and the role identifier of the main gateway equipment to serve as self-defined information elements to be inserted into a wireless management frame, therefore, the wireless terminal can obtain the topological information of the access gateway equipment of the wireless terminal; monitoring an equipment discovery message broadcasted by the slave gateway equipment and a multicast data message issued by the wireless terminal, respectively extracting and determining first topological information corresponding to the slave gateway and second topological information corresponding to the wireless terminal from the equipment discovery message and the multicast data message, and integrating the two types of topological information; therefore, the topological relation among the master gateway device, the slave gateway device and the wireless terminal is constructed in the topological data structure, the automatic construction of the whole network topology is realized only based on the autonomous monitoring of the master gateway device without depending on additional configuration, and the accuracy and integrity of topological relation discovery and construction are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of communication technology, and in particular relates to a method for constructing device topology relationships, a storage medium, and a device. Background Technology

[0002] In a Fiber to the Room (FTTR) network, there is typically one master gateway and multiple slave gateways. These gateway devices are connected via fiber optic cables to form a star or chain topology, providing seamless Wi-Fi throughout the house. Fi Coverage. To achieve effective operation and maintenance of the FTTR network, constructing an accurate and complete network topology is crucial. The network topology not only reflects the connections between the main gateway, slave gateways, and various terminals, but also forms the basis for fault location and security policy implementation.

[0003] Currently, FTTR topology construction relies on device management protocols and pre-configured information. Specifically, the gateway reports topology information, such as device identifiers, to the master gateway via a management channel. The master gateway then synchronizes this information to the management platform via a remote management protocol. The management platform then generates a master-slave two-level topology based on this information. However, this topology construction method suffers from poor topology discovery integrity and depends on the stability of the management channel. If the management channel malfunctions, topology information can be lost. Summary of the Invention

[0004] This application provides a method, storage medium, and device for constructing device topology relationships, which can improve the integrity of topology discovery and the stability of topology construction.

[0005] In a first aspect, embodiments of this application provide a method for constructing device topology relationships, applied to a main gateway device, the method comprising: Construct a topology data structure with the main gateway device as the root node; The preset hop interval of the main gateway device and the role identifier of the main gateway device as the main gateway are inserted as custom information elements into the wireless management frame sent by the main gateway device. The wireless management frame is used to transmit the topology information of the access gateway device to the wireless terminal. Listen for device discovery messages broadcast from the gateway device and multicast data messages published by the wireless terminal through a preset multicast address; Based on the uplink device identifier and the device identifier of the slave gateway device carried in the device discovery message, the first topology information is determined. The second topology information is determined based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop count of the access gateway device carried in the multicast data packet; Based on the first topology information and the second topology information, a topology relationship between the master gateway device, the slave gateway device, and the wireless terminal is constructed in the topology data structure.

[0006] In one feasible implementation, after constructing the topological relationship between the master gateway device, the slave gateway device, and the wireless terminal in the topology data structure based on the first topology information and the second topology information, the method further includes: For each device node in the main gateway device, the slave gateway device and the wireless terminal included in the topology data structure, set an attribute field. The attribute field includes a status field, a reporting time field and a time-to-live field. The reporting time field is used to record the reporting time of the latest message sent by the device node. Monitor the communication time difference between the reporting time and the current time for each of the device nodes; For each device node, if the communication time difference of the device node is greater than the lifetime recorded in the lifetime field of the device node, the device status of the device node in the status field is updated to offline status, or the device node is deleted from the topology data structure.

[0007] In one feasible implementation, the service type of the multicast data packets is a specified service type; monitoring device discovery messages broadcast from the gateway device and multicast data packets published by the wireless terminal through a preset multicast address includes: On the wired network port, listen for the device discovery message broadcast from the gateway device; On a preset multicast address, listen to the data packets published by the wireless terminal, and filter out multicast data packets of a specified service type from the listened data packets.

[0008] Secondly, embodiments of this application provide a method for constructing device topology relationships, applied to a gateway device, the method comprising: Based on the device discovery message of the uplink gateway device and the radio management frame of the neighboring gateway device, the hop interval between the uplink gateway device and the main gateway device is obtained. The radio management frame includes the hop interval and role identifier of its corresponding gateway device. The number of hop intervals between the slave gateway device and the master gateway device is determined based on the number of hop intervals between the uplink gateway device and the master gateway device. Based on the device identifier of the slave gateway device and the role identifier of the slave gateway device as a slave gateway, the device discovery message of the slave gateway device is constructed and broadcast, so that the master gateway device can parse the first topology information of the slave gateway device and the master gateway device from the device discovery message; The hop interval between the slave gateway device and the master gateway device, the role identifier of the slave gateway device, the device identifier of the slave gateway device, and the device identifier of the uplink gateway device are inserted as custom information elements into the radio management frame sent by the slave gateway device, so that the wireless terminal can parse the topology information of its access gateway device from the radio management frame.

[0009] In one feasible implementation, determining the hop interval between the slave gateway device and the master gateway device based on the hop interval between the uplink gateway device and the master gateway device includes: When the uplink gateway device is the main gateway device, the preset hop interval of the main gateway device is incremented by one and used as the hop interval of the slave gateway device from the main gateway device; When the uplink gateway device is the slave gateway device, the interval hop count between the slave gateway device and the master gateway device is incremented by one and used as the interval hop count between the slave gateway device and the master gateway device.

[0010] In one feasible implementation, the service type of the multicast data packets of the wireless terminal is a specified service type, and the method further includes: After the wireless terminal establishes a wireless connection with the access gateway device, the device listens for data packets published by the wireless terminal through a preset multicast address. If no multicast data packets of the specified service type are detected within a preset time window, the multicast data packets of the wireless terminal are constructed based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop interval between the access gateway device and the main gateway device. A proxy identifier is added to the multicast data packets constructed by the access gateway device to obtain proxy data packets; The proxy data packets are published using a preset multicast address.

[0011] Thirdly, embodiments of this application provide a method for constructing device topology relationships, applied to a wireless terminal, the method comprising: The gateway device that establishes a wireless connection with the wireless terminal is designated as the access gateway device. Based on the wireless connection, the wireless management frame of the access gateway device is parsed, and the wireless management frame carries at least the hop interval between the access gateway device and the main gateway device; Multicast data packets are constructed based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop interval between the access gateway device and the main gateway device. The multicast data packets are published via a preset multicast address, so that the main gateway device can obtain the second topology information of the wireless terminal and the access gateway device by listening to the multicast data packets.

[0012] In one feasible implementation, the method further includes: When the wireless terminal roams, the access gateway device that establishes a wireless connection with the wireless terminal after roaming triggers the transmission of a multicast data packet. When the wireless terminal establishes a wireless connection, the multicast data packet is sent once by the access gateway device that has established a wireless connection with the wireless terminal. If the wireless connection between the wireless terminal and the access gateway device remains unchanged, the multicast data packets are periodically published according to each publication period in the preset publication period sequence, wherein each publication period in the publication period sequence is arranged in ascending order.

[0013] Fourthly, embodiments of this application provide a device for constructing device topology relationships, the device comprising: The topology initialization module is used to construct a topology data structure with the main gateway device as the root node; The main gateway wireless module is used to insert the preset interval hop count of the main gateway device and the role identifier of the main gateway device as the main gateway as custom information elements into the wireless management frame sent by the main gateway device. The wireless management frame is used to transmit the topology information of the access gateway device to the wireless terminal. The main gateway monitoring module is used to monitor device discovery messages broadcast from the gateway device and multicast data messages published by the wireless terminal through a preset multicast address; The first topology module is used to determine first topology information based on the uplink device identifier and the device identifier of the slave gateway device carried in the device discovery message. The second topology module is used to determine second topology information based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop count of the access gateway device carried in the multicast data packet; The topology construction module is used to construct the topology relationship between the master gateway device, the slave gateway device and the wireless terminal in the topology data structure based on the first topology information and the second topology information.

[0014] Fourthly, embodiments of this application provide a device for constructing device topology relationships, the device comprising: The information acquisition module is used to obtain the hop interval between the uplink gateway device and the main gateway device based on the device discovery message of the uplink gateway device and the radio management frame of the neighboring gateway device. The radio management frame includes the hop interval and role identifier of its corresponding gateway device. The interval hop count module is used to determine the interval hop count between the slave gateway device and the master gateway device based on the interval hop count between the uplink gateway device and the master gateway device; The topology discovery module is used to construct the device discovery message of the slave gateway device based on the device identifier of the slave gateway device and the role identifier of the slave gateway device as a slave gateway, and broadcast the device discovery message so that the master gateway device can parse the first topology information of the slave gateway device and the master gateway device from the device discovery message; The wireless module of the gateway is used to insert the hop interval between the slave gateway device and the master gateway device, the role identifier of the slave gateway device as a slave gateway, the device identifier of the slave gateway device, and the device identifier of the uplink gateway device as custom information elements into the wireless management frame sent by the slave gateway device, so that the wireless terminal can parse the topology information of its access gateway device from the wireless management frame.

[0015] Fifthly, embodiments of this application provide a device for constructing device topology relationships, the device comprising: The access gateway module is used to establish a wireless connection with the wireless terminal as an access gateway device. A wireless topology parsing module is used to parse the wireless management frame of the access gateway device based on the wireless connection. The wireless management frame carries at least the hop count between the access gateway device and the main gateway device. A wireless topology construction module is used to construct multicast data packets based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop interval between the access gateway device and the main gateway device. The wireless topology reporting module is used to publish the multicast data packets through a preset multicast address, so that the main gateway device can obtain the second topology information of the wireless terminal and the access gateway device by listening to the multicast data packets.

[0016] Sixthly, embodiments of this application provide a device topology construction device, the device including: a processor, and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement any of the above-described device topology construction methods.

[0017] In a seventh aspect, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement any of the above-described device topology construction methods.

[0018] Eighthly, this application provides a computer program product in which instructions, when executed by the processor of an electronic device, cause the electronic device to execute any of the above-described device topology construction methods.

[0019] This application discloses a device topology relationship construction method, storage medium, and device. It constructs a topology data structure with a main gateway device as the root node, inserts the main gateway device's hop count and role identifier as custom information elements into wireless management frames, enabling wireless terminals to obtain the topology information of their access gateway devices. It listens to device discovery messages broadcast from the gateway devices and multicast data messages published by the wireless terminals, extracts and determines the first topology information corresponding to the gateway and the second topology information corresponding to the wireless terminals, integrates the two types of topology information, and then constructs the topology relationship between the main gateway device, the gateway devices, and the wireless terminals in the topology data structure. This achieves automatic construction of the entire network topology without relying on additional configuration, solely based on the autonomous listening of the main gateway device, thus improving the accuracy and completeness of topology relationship discovery and construction.

[0020] Furthermore, by publishing multicast data packets of wireless terminals through a gateway proxy, this application can ensure the integrity of wireless terminal topology information, thereby improving the reliability and real-time performance of topology discovery and construction. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart illustrating a method for constructing device topology relationships according to an embodiment of this application; Figure 2 This is a schematic diagram of the process for the main gateway device to maintain the topology relationship in real time, as provided in the embodiments of this application. Figure 3This is a schematic diagram of the timing topology construction process between the master gateway device, the slave gateway device, and the wireless terminal provided in the embodiments of this application; Figure 4 This is a schematic diagram of a device topology construction apparatus provided in an embodiment of this application; Figure 5 This is a schematic diagram of a device topology construction apparatus provided in an embodiment of this application; Figure 6 This is a schematic diagram of a device topology construction apparatus provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a device topology construction device provided in an embodiment of this application. Detailed Implementation

[0023] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0024] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0025] In a Fiber to the Room (FTTR) network, there is typically one master gateway and multiple slave gateways. These gateway devices are connected via fiber optic cables to form a star or chain topology, providing seamless Wi-Fi throughout the house. Fi Coverage. To achieve effective operation and maintenance of the FTTR network, constructing an accurate and complete network topology is crucial. The network topology not only reflects the connections between the main gateway, slave gateways, and various terminals, but also forms the basis for fault location and security policy implementation.

[0026] Currently, FTTR topology construction relies on device management protocols and pre-configured information. Specifically, the gateway reports device identifiers and other information to the master gateway via a management channel. The master gateway then synchronizes this information to the management platform via a remote management protocol. The management platform then generates a master-slave two-level topology based on this information. However, this topology construction method suffers from poor topology discovery integrity and depends on the stability of the management channel. If the management channel malfunctions, topology information can be lost.

[0027] To address the problems in the prior art, embodiments of this application provide a method, apparatus, device, and computer storage medium for constructing device topology relationships.

[0028] In practical applications, the execution subject of the device topology relationship construction method in this application embodiment can be a terminal device, such as a desktop computer or laptop computer, or a remote device similar to a server. Of course, the execution subject in this application embodiment can also be a software form, such as a client or software program installed on a terminal device. The specific type of execution subject corresponding to the technical solution provided in this application embodiment is not strictly limited here, and can be flexibly selected according to the actual application scenario and actual needs.

[0029] The following describes specific embodiments of a device topology construction method, storage medium, and device provided in this application. First, a device topology construction method is introduced.

[0030] Figure 1 This illustration shows a flowchart of a device topology construction method according to an embodiment of this application. Figure 1 As shown, this method is used to realize topology discovery and topology construction among a master gateway device, multiple slave gateway devices, and multiple wireless terminals. It is divided into a topology initialization phase, a wired topology discovery phase, a wireless topology discovery phase, and a master gateway topology construction phase, including steps S100 to S113: First, the topology initialization phase includes step S100.

[0031] S100: The main gateway device constructs a topology data structure with itself as the root node.

[0032] In one or more embodiments of this application, after the main gateway device completes power-on initialization, it can create and initialize a topology data structure for storing network topology relationships.

[0033] It should be noted that this application does not limit the specific results of the topology data structure or the specific information of the nodes in the topology data structure. These can be set according to actual needs; for example, the topology data structure can be a topology tree or a topology graph. Node information may include the device's unique device identifier (such as serial number SN, pre-configured UUID, or management MAC address), role identifier, and connection type (wireless connection, wired connection) between links with other gateway devices. The master gateway device dynamically adds child nodes (slave gateways) and leaf nodes (wireless terminals) to the topology data structure and updates the connection edge attributes between nodes to reflect the topology relationship of the entire FTTR network connection status in real time. To avoid the loss of topology information due to device restarts, the master gateway device can periodically persist snapshots of the topology data structure to non-volatile memory (such as flash). After the master gateway device restarts, the previously stored topology data structure can be loaded from this non-volatile memory, shortening the topology convergence time after network recovery.

[0034] Furthermore, this application does not limit the specific methods of network initialization and role self-identification. Depending on actual needs, wired gateway devices can use a link layer discovery protocol to carry the type-length-value (TLV) of the role identifier to clarify the physical wired connection relationship and device role between gateway devices in the FTTR network. That is, in one or more embodiments of this application, after power-on initialization, the master gateway device and slave gateway device determine their own role identifiers through pre-configuration or automatic negotiation mechanisms. When an uplink activation (connected to the operator's network) on the optical port (Passive Optical Network, PON) is detected, the user determines its role identifier as the master gateway; when an Ethernet uplink activation is detected, the user determines its role identifier as the slave gateway. The automatic negotiation mechanism refers to the process where, when a gateway device cannot determine its own role identifier, it first sends a device discovery message with an unknown role identifier during topology discovery. Then, when it receives a device discovery message from the master gateway device on its uplink port, it changes its own role identifier from unknown to slave gateway and begins broadcasting device discovery messages with the slave gateway role identifier. In this embodiment, the application does not limit the specific type of device discovery message, and can select according to the needs of the actual networking scenario, such as using the Link Layer Discovery Protocol (LLDP) to send device discovery messages (LLDPDU); or other discovery protocols such as the Cisco Discovery Protocol.

[0035] Secondly, the wired topology discovery phase includes steps S101 to S105.

[0036] S101: The main gateway device inserts the preset interval hop count and its role identifier as the main gateway as custom information elements into the wireless management frame it sends. The wireless management frame is used to transmit the topology information of the access gateway device to the wireless terminal.

[0037] Specifically, the primary gateway device inserts a preset hop interval and its primary gateway role identifier as custom information elements into its transmitted radio management frames. These frames can be used to transmit topology information of neighboring gateway devices to other gateway devices and to transmit topology information of the gateway devices it accesses to wireless terminals. Similarly, the secondary gateway device can insert its own hop interval from the primary gateway device and its secondary gateway role identifier as custom information elements into its transmitted radio management frames.

[0038] It should be noted that the wireless management frame includes a beacon frame and a probe response frame. This application does not restrict the insertion position of custom information elements; they can be set according to actual needs. For example, they can be placed at the end of the beacon frame, second to last in the Vendor Specific IE list, for convenient packet capture filtering. That is, placing it at the second to last position in the IE list within the beacon frame facilitates packet capture filtering during network diagnostics, such as wlan.ta == AP_MAC && wlan_mgt.tag.number == 22; Afterwards, the gateway device broadcasts the wireless management frame at a fixed period (e.g., every 100 milliseconds).

[0039] S102: The gateway device obtains the hop interval between the uplink gateway device and the main gateway device based on the device discovery message of the uplink gateway device and the radio management frame of the neighboring gateway device.

[0040] S103: The slave gateway device determines the number of hops between the slave gateway device and the master gateway device based on the number of hops between the uplink gateway device and the master gateway device.

[0041] In one or more embodiments of this application, a gateway device can receive device discovery messages sent by an uplink gateway device. If its uplink connection is to the primary gateway, the device identifier and role identifier of the primary gateway device can be parsed from the messages. By scanning wireless signals, the radio management frames broadcast by its neighboring gateway devices can be captured, and the role identifier and hop interval of the neighboring gateway devices can be parsed from these frames. Then, by combining the role identifier of its uplink gateway device with that of the primary gateway device, the hop interval between its uplink gateway device and the primary gateway device can be determined.

[0042] It should be noted that the hop count is used to characterize the hierarchical distance between the target device and the main gateway device. The hop count is incremented by one for each level of gateway device traversed, starting from the main gateway device. Since the main gateway device is the root node of the FTTR topology data structure, its own hop count can be set to zero. Therefore, the hop count of a slave gateway device directly cascaded with the main gateway device is 1, the hop count of the next-level gateway device cascaded with the slave gateway device is 2, and so on. In one or more embodiments of this application, after the slave gateway device starts up, it receives a device discovery message through its wired uplink port. If the device discovery message reveals that its uplink gateway device is the main gateway (e.g., Role=0x01), then the preset hop count of the main gateway device (e.g., zero) is incremented by one to become the hop count between the slave gateway device and the main gateway device. If its uplink gateway device is a slave gateway device, then the hop count of the slave gateway device is incremented by one to become the hop count between the slave gateway device and the main gateway device.

[0043] S104: The gateway device constructs its device discovery message based on the uplink device identifier and its device identifier of the uplink gateway device, and broadcasts it.

[0044] It should be noted that this application does not limit the construction method of the device discovery message, and can be set according to actual needs. In one or more embodiments of this application, the gateway device can construct a custom LLDP TLV (Specific TLV, Type 127) based on its own role identifier, and encapsulate this custom LLDP TLV with other standard LLDP TLVs (such as Chassis ID, Port ID) into an LLDP Data Unit (LLDPDU). This LLDPDU is periodically broadcast on all active Ethernet ports through periodic broadcasting (the period can be set according to actual needs, and random jitter can be added to prevent synchronization). When an LLDPDU sent by another gateway device is received, the role identifier and device identifier of its neighboring gateway device can be obtained by parsing the custom LLDP TLV in the LLDPDU.

[0045] The structure of a custom LLDP TLV is as follows: Type: 127 (Organizationally Specific); Length: Variable length, e.g., 9 bytes; Organizationally Unique Identifier (OUI): 3 bytes, the vendor's IEEE registered OUI, e.g., 0x001A2B; Organizationally Defined Subtype: 1 byte, used to distinguish different custom TLVs within the vendor, e.g., 0x01 represents FTTR topology information; Tlv_ver: Indicates the TLV version number, currently 0x01. When older devices receive a new version TLV that cannot be resolved, they can choose to ignore the TLV instead of reporting an error, occupying 1 byte; FTTR Role Identifier: 1 byte, defines the device role, e.g., 0x00 represents an unknown role, 0x01 represents a Master Gateway, and 0x02 represents a Slave Gateway; Device UUID: 4 bytes, the device's unique identifier, which can be the last 4 bytes of the MAC address or other unique IDs, used to uniquely identify a node in the topology.

[0046] For example, a device discovery message might look like this: TLV Header (Type=127, Length=9) + OUI (0x001A2B) + Subtype (0x01) + Role (0x02) + UUID (0x12345678). This message indicates a vendor device with an OUI of 0x001A2B, a gateway type, and a UUID of 0x12345678.

[0047] S105: The slave gateway device inserts its distance from the master gateway device, its role identifier as a slave gateway, its device identifier, and the uplink device identifier as custom information elements into the radio management frame it sends.

[0048] In one or more embodiments of this application, gateway devices establish neighbor relationships by broadcasting device discovery messages. Each gateway device can encapsulate its role identifier, device identifier, and other topology information into a device discovery message and achieve topology discovery through broadcasting.

[0049] Gateway devices can construct custom vendor specific information elements (VMIs) based on their own role identifiers and hop count intervals. These VMIs include an element ID, length, organization unique identifier (OUI), vendor specific OUI type, FTTR role, hop count interval, uplink device identifier (such as the upstream BSSID hash), and cyclic redundancy check (CRC).

[0050] It should be noted that this application does not limit the specific content of custom information elements, which can be set according to actual needs. The meaning of each parameter in the above custom information elements is explained below: the element ID is fixed at 221, indicating that this IE is a vendor-defined type; the length is the total number of bytes in the subsequent value field, and the size is variable, such as 7 bytes or longer, but not exceeding 255 bytes; the organization unique identifier occupies 3 bytes, filled with the unique identifier registered by the device manufacturer with IEEE, such as 0x001A2B, which must be consistent with the OUI used in the LLDP custom TLV to indicate common origin; the vendor-defined OUI type occupies 1 byte, used to distinguish different custom IEs within the manufacturer, such as defining 0x02 as the FTTR topology information IE; the FTTR role occupies 1 byte, encoding the device role, such as 0x01 representing the master gateway and 0x02 representing the slave gateway; the hop interval count occupies 1 byte, indicating the hop interval between this device and the master gateway; the upstream BSSID hash occupies 3 bytes, storing the hash value of the BSSID of the uplink AP on this device (the last 3 bytes of its BSSID can be taken). This field is used by wireless terminals or neighboring devices to quickly verify the authenticity of the link relationship; Cyclic Redundancy Check (CRC) occupies 1 byte and covers all bytes from the OUI field to the Parent BSSID Hash field to calculate the check value. It is used by the receiver to verify the integrity of the IE during wireless transmission and prevent data corruption due to channel interference.

[0051] The wireless topology discovery phase then includes steps S106 to S109.

[0052] S106: The wireless terminal will establish a wireless connection with the gateway device, which will serve as its access gateway device.

[0053] S107: The wireless terminal, based on the wireless connection, parses the wireless management frame of the access gateway device, wherein the wireless management frame carries at least the hop count between the access gateway device and the main gateway device.

[0054] S108: The wireless terminal constructs a multicast data packet based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop interval between the access gateway device and the main gateway device.

[0055] S109: The wireless terminal publishes the multicast data packet through a preset multicast address.

[0056] In one or more embodiments of this application, after a wireless terminal (such as a mobile phone or PC) connects to a wireless access point (AP) (the wireless signal of a master gateway device or a slave gateway device), the wireless terminal can obtain the topology information of the access gateway device with which it has established a wireless connection by parsing the wireless management frame of the access gateway device. After obtaining the topology information of the access gateway device, the wireless terminal can actively declare its topology information to the network via multicast service, including the access gateway device it is connected to and the hop count of its access gateway device.

[0057] It should be noted that this application does not limit the specific type of multicast data packets. They can be configured according to actual needs, such as Multicast Domain Name System (mDNS) packets, which encapsulate topology information such as the wireless terminal's device identifier, the access gateway device's device identifier, and the hop count of the access gateway device into the TXT record field of the mDNS packet; or other protocol packets such as Simple Service Discovery Protocol can be used to carry topology information. Since the mDNS protocol does not rely on a pre-configured DNS server, the wireless terminal can upload its topology information within the local area network via a preset multicast address (such as IPv4's 224.0.0.251) without manual configuration of IP address mapping or server parameters. This characteristic allows the wireless terminal to autonomously encapsulate and report topology information after accessing the gateway without additional configuration. The process of reporting topology information by the wireless terminal via the mDNS protocol is as follows: First, the wireless terminal can build an mDNS service declaration locally as a service identifier for reporting topology information. This involves setting the service type of multicast data packets to a specified service type, which can be configured according to actual needs, such as _fttr-client._tcp.local.

[0058] Secondly, the TXT record embeds topology information such as the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop count of the access gateway device. This topology information exists in the form of key-value pairs. This application does not restrict the data format and writing rules of the TXT record; they can be set according to actual needs. For example, UTF-8 encoding can be used, and characters such as = and \0 are not allowed in the key-value pairs, and the length of a single value cannot exceed 63 bytes.

[0059] Finally, the wireless terminal can publish the constructed mDNS message in the local network based on the preset multicast address. This application does not limit the specific address of the preset multicast address; it can be set according to actual needs, such as address 224.0.0.251 and port 5353.

[0060] The structure of a multicast data packet is as follows: mDNS service name: _fttr-client._tcp.local (service name can be customized).

[0061] TXT Record Design: This is a key carrier for transmitting information.

[0062] dev_type=smartphone: Declares the device type.

[0063] role=client: Declares the role as a client.

[0064] hop=1: Declares the number of hop intervals, which is obtained from the AP's Beacon frames.

[0065] parent_bssid=AA:BB:CC:DD:EE:FF: Declares the BSSID of the access gateway device.

[0066] The band (2.4G / 5G / 6G) specifies the wireless resources used, providing a basis for subsequent frequency band guidance and load balancing.

[0067] ipv4=192.168.1.101: Report your own IP address.

[0068] ipv6=...: Used to increase the reporting capability of IPv6 addresses, making the topology information more complete.

[0069] cap=11k / 11v: It can report the Wi-Fi protocol capabilities it supports, such as 802.11k / v / r, to help the main gateway device (or EasyMesh Controller) perform more efficient roaming management.

[0070] For example, the TXT record in the multicast data packet is "dev_type=smartphone", "role=client", "hop=1", "parent_bssid=AA:BB:...", "ipv4=192.168.1.101", "ipv6=fe80::...", "band=5G", "cap=11k,11v".

[0071] In this embodiment, this application does not limit the specific method by which the wireless terminal reports topology information. It can be set according to actual needs, such as running a lightweight background service or APP on the wireless terminal, or it can be implemented by a gateway device.

[0072] Finally, the main gateway topology construction phase includes steps S110 to S113.

[0073] S110: The main gateway device listens for device discovery messages broadcast by the secondary gateway device and multicast data messages published by the wireless terminal through a preset multicast address.

[0074] In one or more embodiments of this application, the main gateway device can listen for device discovery messages broadcast from the gateway device on a wired network port; and listen for data packets published by wireless terminals on a preset multicast address, filtering out multicast data packets of a specified service type from the listened data packets. Furthermore, the main gateway device can also listen for wireless management frames from other gateway devices to obtain their topology information.

[0075] Following the previous example, the main gateway device, as the core controller of the FTTR network, initializes and creates a topology data structure with the main gateway device as the root node (Root, Hop=0) in step S100. Then, it starts the LLDP service, listens for LLDPDUs on the wired port, starts the mDNS listener, captures all mDNS multicast packets in the local area network, and when it receives a service declaration of type _fttr-client._tcp.local, it parses the multicast packet corresponding to the service declaration as a multicast data packet. It also listens for radio management frames of protocols such as 802.11k / v / r to obtain topology information such as neighbor AP reports from clients to improve the topology relationship.

[0076] S111: The master gateway device determines the first topology information based on the uplink device identifier and the device identifier of the slave gateway device carried in the device discovery message.

[0077] S112: The main gateway device determines the second topology information based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop count of the access gateway device carried in the multicast data packet.

[0078] S113: The main gateway device constructs the topology relationship between the main gateway device, the slave gateway device, and the wireless terminal in the topology data structure based on the first topology information and the second topology information.

[0079] In one or more embodiments of this application, when the master gateway device receives a device discovery message from a slave gateway device, it can parse the message, determine first topology information, create a slave gateway node based on the first topology information, link it to the root node of the master gateway, and mark it as a wired connection. When it receives a multicast data packet from a wireless terminal, it parses the packet to determine second topology information such as the wireless terminal's access gateway device and hop count. Based on this second topology information, it queries or creates a slave gateway node, attaches the wireless terminal as a leaf node to the slave gateway node, and records its wireless terminal IP address, device identifier, and other node information, marking it as a wireless connection.

[0080] In the aforementioned method for constructing device topology relationships, this application sets up a network-side configuration where the gateway device embeds its role identifier and hop interval in the wireless management frame. This allows wireless terminals to obtain the topology information of the gateway device they are accessing. Furthermore, by combining this information with their own device identifier, they construct multicast data packets and make multicast declarations, enabling wireless terminals to autonomously report their topology information. The master gateway device can integrate the device discovery packets from the gateway devices and the multicast data packets from the wireless terminals, improving the completeness of the gateway device topology construction.

[0081] Furthermore, to avoid network bandwidth consumption and device performance degradation caused by multicast message flooding, and to ensure the real-time and accurate reporting of topology information by wireless terminals, in one or more embodiments of this application, a wireless terminal may trigger the transmission of a multicast data packet when roaming, based on the access gateway device that establishes a wireless connection with the wireless terminal after roaming; when a wireless connection is established, a multicast data packet may be triggered to be transmitted based on the access gateway device that establishes a wireless connection with the wireless terminal; and when the wireless connection with the access gateway device remains unchanged, multicast data packets may be periodically transmitted according to each transmission period in a preset transmission period sequence, wherein the transmission periods in the transmission period sequence are arranged in ascending order.

[0082] For example, when a wireless terminal establishes a wireless connection with a gateway device for the first time, a multicast data packet is immediately sent to establish the topology of the wireless terminal in real time within the topology data structure. Subsequently, if the device identifier (such as IP, BSSID) of the gateway device does not change in the multicast data packets sent by the wireless terminal, an exponential backoff suppression mechanism can be triggered. This mechanism backs off according to the publication cycle sequence (such as 1s, 2s, 3s, etc.) until the end of the publication cycle sequence (such as 300s) is reached to prevent multicast flooding.

[0083] To avoid interruptions in topology information reporting due to wireless terminal anomalies (such as terminal silence, packet loss, protocol incompatibility, etc.) and to ensure the integrity of the topology information obtained by the main gateway device, in one or more embodiments of this application, the slave gateway device can listen to data packets published by the wireless terminal through a preset multicast address after the wireless terminal establishes a wireless connection with the access gateway device; if no multicast data packets of a specified service type are listened to within a preset time window, the slave gateway device can construct a multicast data packet for the wireless terminal based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop interval between the access gateway device and the main gateway device; a proxy identifier is added to the multicast data packet constructed by the access gateway device to obtain a proxy data packet; and the proxy data packet is published through the preset multicast address.

[0084] For example, after the HCP server sends a DHCP ACK message, the AP (access gateway device) starts setting up a listening window (e.g., 5 seconds) for the client. If no compliant mDNS packet from the client's MAC address is detected within this listening window, the proxy publishing mechanism is triggered, and the AP publishes the mDNS on behalf of the client, adding a proxy identifier of proxy=1 to the TXT file.

[0085] To ensure the accuracy of the topology data structure and avoid delays or redundancy in topology information due to device node offlineness, link interruptions, or other reasons, and to ensure consistency between the topology relationship and the actual FTTR network state, in one or more embodiments of this application, attribute fields can be set for each device node in the topology data structure, and the packet reporting status can be monitored in real time to ensure the real-time performance of the topology data structure, as detailed below: First, the main gateway device can set attribute fields for each device node in the topology data structure, including the main gateway device, the slave gateway device, and the wireless terminal. These attribute fields include a status field, a reporting time field, and a time-to-live field. The reporting time field is used to record the reporting time of the latest message sent by the device node.

[0086] Secondly, the main gateway device can monitor the communication time difference between the reporting time of each device node and the current time.

[0087] Finally, for each device node, if the communication time difference of that device node is greater than the lifetime recorded in the lifetime field of that device node, the main gateway device can update the device status of that device node in the status field to offline status, or delete that device node in the topology data structure.

[0088] For example, add attribute fields (such as online, offline, conflict, loop_risk, orphaned) and a reporting time field (last_seen) to each node in the topology tree (whether it's a gateway or a client), and set a Time-to-Live (TTL) for each node. Each time topology information is received from the corresponding device, its TTL is refreshed, i.e., the TTL timer is reset. The main gateway device periodically checks the TTL of all device nodes, marking expired nodes as offline or removing them from the topology data structure, thus achieving dynamic updates to the topology.

[0089] It should be noted that this application does not limit the specific length of the lifetime; it can be set according to actual needs. For example, it can be set to 300s for wired connected device nodes and 120s for wireless connected device nodes. Each reset will overwrite the latest TTL. Conflict refers to a conflict state. The main gateway device can maintain a port-neighbor table. If multiple LLDPDUs with different role identifiers are received on the same port within a preset time (e.g., 30s), a conflict state is marked in the topology data structure, and the node information is updated based on the latest reporting time.

[0090] Furthermore, the primary gateway uses Depth-First Search (DFS) to traverse the topology data structure. If a back edge is found where both ends are identified as slave gateways, it is marked as a loop (Loop-Risk) and reported. Once the DFS algorithm detects a loop and marks it as a Loop-Risk, in addition to reporting an alarm, the primary gateway can implement more proactive management strategies. For example, using similar logic to Spanning Tree Protocol (STP / RSTP), it can logically block the suboptimal port causing the loop, or notify relevant slave gateway devices to close specific ports via network management protocols, thereby automatically eliminating the loop risk and improving network self-healing capabilities.

[0091] Figure 2 This is a schematic diagram illustrating the process of real-time maintenance of topology relationships by the main gateway device according to an embodiment of this application, as shown below. Figure 2 As shown, the process of constructing and maintaining the device topology includes steps S201 to S206, as follows: S201: Monitor data from different sources.

[0092] S202: Has reported data been received? If yes, proceed to S203; if no, proceed to 214.

[0093] S203: Determine whether the reported data is a device discovery message; if yes, proceed to S204; if no, proceed to 208.

[0094] S204: The parsing device discovers the first topology information corresponding to the message.

[0095] S205: Determine whether the slave gateway device corresponding to the first topology information is a known slave gateway; if yes, execute S206; if no, execute S207.

[0096] S206: Update the attribute fields from the gateway device and execute S214.

[0097] S207: Create a gateway node and execute S214.

[0098] S208: Determine whether the reported data is a data packet for a preset multicast address; if yes, execute S209; if no, execute 214.

[0099] S209: Determine whether the service type of the reported data is the specified data type; if yes, execute S210; if no, execute 214.

[0100] S210: Extract the second topology information of the wireless terminal from the reported data.

[0101] S211: Determine whether the wireless terminal corresponding to the second topology information is a known terminal; if yes, execute S212; if no, execute S213.

[0102] S212: Update the attribute fields of the wireless terminal.

[0103] S213: Create a terminal node and connect it to its corresponding access gateway device.

[0104] S214: Periodically check the attribute fields of each device node in the topology data structure.

[0105] S215: Determine if there are any device nodes whose communication time difference between the reported time and the current time is greater than their corresponding lifetime; if yes, execute 216; if no, continue monitoring multi-source data.

[0106] S216: Mark the timed-out device node as offline.

[0107] Figure 3 This is a schematic diagram illustrating the timing topology construction process between the master gateway device, slave gateway device, and wireless terminal provided in an embodiment of this application. Figure 3 As shown, the time-series topology construction process is divided into four stages: startup and wired topology discovery, wireless environment information broadcasting, terminal connection and information reporting, and data fusion and topology construction, as detailed below: S301: Execution Startup and Wired Topology Discovery Phase In one or more embodiments of this application, the slave gateway sends an LLDP frame (Role=Slave, UUID=SG_ID) to the master gateway, where Slave is the role identifier of the slave gateway and SG_ID is the device identifier of the slave gateway; the master gateway sends an LLDP frame (Role=Master, UUID=MG_ID) to the slave gateway, where Master is the role identifier of the master gateway and MG_ID is the device identifier of the master gateway. That is, the gateway devices achieve wired topology discovery through a link layer discovery protocol.

[0108] In this embodiment, if the gateway device recognizes that it is directly connected to the main gateway device during the wired topology discovery phase, then it can be determined that its hop count is 1.

[0109] S302: Perform the wireless environment information broadcasting phase.

[0110] In one or more embodiments of this application, a gateway device cyclically broadcasts a wireless management frame at a preset period. For example, it cyclically broadcasts a Beacon Frame (with custom IE: Role=Slave, Hop=1) with a period of Every 100ms. This Beacon frame is a beacon frame of the wireless management frame, and the topology information is contextualized by inserting a custom information element (custom IE) including role identifier and hop interval into the beacon frame.

[0111] S303: Execute the terminal connection and information reporting phase.

[0112] In one or more embodiments of this application, the wireless client sends an Association Request to the slave gateway device, and the slave gateway replies with an Association Response; the wireless client also sends an mDNS Announce (Service: fttr-client, TXT: Hop=1, parent_bssid=SG_BSSID) to the master gateway device. That is, after parsing the Beacon frame, the wireless client can proactively report topology information via mDNS broadcast, specifying the service type as fttr-client, the hop count of its corresponding access gateway device as hop=1, and the device identifier of the access gateway device as SG_BSSID. The Association Request / Response represents the association request / response of the wireless signal, completing the wireless connection between the wireless client and the slave gateway device.

[0113] S303: Perform the data fusion and topology construction phase.

[0114] In one or more embodiments of this application, the main gateway device can listen to device discovery messages and multicast data messages, and combine these two types of protocol messages to achieve data fusion and topology construction. That is, the main gateway executes Parse LLDP & mDNSData to obtain the topology data structure as Update Topology Tree (MG -> SG -> WC).

[0115] Based on the aforementioned device topology relationship construction method, this application also provides a specific embodiment of a device topology relationship construction apparatus, in which the apparatus is used to execute the gateway topology relationship construction method on the main gateway device side.

[0116] like Figure 4 As shown, Figure 4 This is a schematic diagram of a device topology construction apparatus provided in an embodiment of this application. The apparatus includes a topology initialization module 401, a main gateway wireless module 402, a main gateway monitoring module 403, a first topology module 404, a second topology module 405, and a topology construction module 406.

[0117] The topology initialization module 401 is used to construct a topology data structure with the main gateway device as the root node; The main gateway wireless module 402 is used to insert the preset interval hop count of the main gateway device and the role identifier of the main gateway device as the main gateway as custom information elements into the wireless management frame sent by the main gateway device. The wireless management frame is used to transmit the topology information of the access gateway device to the wireless terminal. The main gateway monitoring module 403 is used to monitor device discovery messages broadcast from the gateway device and multicast data messages published by the wireless terminal through a preset multicast address; The first topology module 404 is used to determine first topology information based on the uplink device identifier corresponding to the slave gateway device and the device identifier of the slave gateway device carried in the device discovery message; The second topology module 405 is used to determine second topology information based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the interval hop count of the access gateway device carried in the multicast data packet; The topology construction module 406 is used to construct the topology relationship between the master gateway device, the slave gateway device and the wireless terminal in the topology data structure based on the first topology information and the second topology information.

[0118] In one feasible implementation, the topology construction module is specifically used to set attribute fields for each device node in the main gateway device, the slave gateway device, and the wireless terminal included in the topology data structure. The attribute fields include a status field, a reporting time field, and a lifetime field. The reporting time field is used to record the reporting time of the latest message sent by the device node. The module monitors the communication time difference between the reporting time of each device node and the current time. For each device node, if the communication time difference of the device node is greater than the lifetime recorded in the lifetime field of the device node, the module updates the device status of the device node in the status field to offline status, or deletes the device node from the topology data structure.

[0119] In one feasible implementation, the main gateway monitoring module is specifically used to, when the service type of the multicast data packet is a specified service type, monitor the device discovery message broadcast by the gateway device on the wired network port; and monitor the data packets published by the wireless terminal on a preset multicast address, and filter out multicast data packets of the specified service type from the monitored data packets.

[0120] Based on the aforementioned device topology relationship construction method, this application also provides a specific embodiment of a device topology relationship construction apparatus, in which the apparatus is used to execute the gateway topology relationship construction method from the gateway device side.

[0121] like Figure 5 As shown, Figure 5 This is a schematic diagram of a device topology construction apparatus provided in an embodiment of this application. The apparatus includes an information acquisition module 501, an interval hop count module 502, a topology discovery module 503, and a gateway wireless module 504.

[0122] Information acquisition module 501 is used to obtain the hop interval between the uplink gateway device and the main gateway device based on the device discovery message of the uplink gateway device and the radio management frame of the neighboring gateway device. The radio management frame includes the hop interval and role identifier of its corresponding gateway device. The interval hop count module 502 is used to determine the interval hop count between the slave gateway device and the master gateway device based on the interval hop count between the uplink gateway device and the master gateway device; The topology discovery module 503 is used to construct the device discovery message of the slave gateway device based on the device identifier of the slave gateway device and the role identifier of the slave gateway device as a slave gateway, and broadcast the device discovery message so that the master gateway device can parse the first topology information of the slave gateway device and the master gateway device from the device discovery message; The wireless module 504 is used to insert the hop interval between the slave gateway device and the master gateway device, the role identifier of the slave gateway device as a slave gateway, the device identifier of the slave gateway device, and the device identifier of the uplink gateway device as custom information elements into the wireless management frame sent by the slave gateway device, so that the wireless terminal can parse the topology information of its access gateway device from the wireless management frame.

[0123] In one feasible implementation, the interval hop count module is specifically used to, when the uplink gateway device is the master gateway device, add one to the preset interval hop count of the master gateway device and use it as the interval hop count of the slave gateway device from the master gateway device; and when the uplink gateway device is the slave gateway device, add one to the interval hop count of the slave gateway device from the master gateway device and use it as the interval hop count of the slave gateway device from the master gateway device.

[0124] In one feasible implementation, the device further includes a proxy module, which is specifically used to: after the wireless terminal establishes a wireless connection with the access gateway device, listen for data packets published by the wireless terminal through a preset multicast address; if no multicast data packets of the specified service type are listened for within a preset time window, construct a multicast data packet for the wireless terminal based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop interval between the access gateway device and the main gateway device; add a proxy identifier to the multicast data packet constructed by the access gateway device to obtain a proxy data packet; and publish the proxy data packet through the preset multicast address.

[0125] Based on the aforementioned device topology relationship construction method, this application also provides a specific embodiment of a device topology relationship construction apparatus, in which the apparatus is used to execute the gateway topology relationship construction method on the wireless terminal side.

[0126] like Figure 6 As shown, Figure 6 This is a schematic diagram of a device topology construction apparatus provided in an embodiment of this application. The apparatus includes an access gateway module 601, a wireless topology parsing module 602, a wireless topology construction module 603, and a wireless topology reporting module 604.

[0127] Access gateway module 601 is used to use a gateway device that establishes a wireless connection with the wireless terminal as an access gateway device. The wireless topology parsing module 602 is used to parse the wireless management frame of the access gateway device based on the wireless connection, wherein the wireless management frame carries at least the hop count between the access gateway device and the main gateway device; The wireless topology construction module 603 is used to construct multicast data packets based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop interval between the access gateway device and the main gateway device. The wireless topology reporting module 604 is used to publish the multicast data packets through a preset multicast address, so that the main gateway device can obtain the second topology information of the wireless terminal and the access gateway device by listening to the multicast data packets.

[0128] In one feasible implementation, the information acquisition module is specifically used to: when the wireless terminal roams, trigger the transmission of a multicast data packet based on the access gateway device that establishes a wireless connection with the wireless terminal after roaming; when the wireless terminal establishes a wireless connection, trigger the transmission of a multicast data packet based on the access gateway device that establishes a wireless connection with the wireless terminal; and when the wireless connection between the wireless terminal and the access gateway device remains unchanged, periodically publish the multicast data packet according to each publication period in a preset publication period sequence, wherein the publication periods in the publication period sequence are arranged in ascending order.

[0129] Figure 7 A schematic diagram of the hardware structure of a device topology construction device provided in an embodiment of this application is shown.

[0130] A device topology construction device may include a processor 701 and a memory 702 storing computer program instructions.

[0131] Specifically, the processor 701 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0132] Memory 702 may include mass storage for data or instructions. For example, and not limitingly, memory 702 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one embodiment, memory 702 may include removable or non-removable (or fixed) media, or memory 702 may be non-volatile solid-state memory. Memory 702 may be internal or external to the integrated gateway disaster recovery device.

[0133] In one instance, memory 702 may be read-only memory (ROM). In one instance, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.

[0134] Memory 702 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the device topology construction method according to one aspect of this application.

[0135] The processor 701 reads and executes computer program instructions stored in the memory 702 to achieve... Figure 1 The device topology construction method in the illustrated embodiment.

[0136] In one example, a device topology building device may further include a communication interface 703 and a bus 704. Wherein, as Figure 7 As shown, the processor 701, memory 702, and communication interface 703 are connected through bus 704 and complete communication with each other.

[0137] The communication interface 703 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0138] Bus 704 includes hardware, software, or both, that couples device topology components together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 704 may include one or more buses. While specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.

[0139] Furthermore, in conjunction with the device topology construction method in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the device topology construction methods in the above embodiments.

[0140] This application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the device topology construction methods described in the above embodiments.

[0141] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0142] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0143] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0144] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0145] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for constructing device topology relationships, characterized in that, Applied to a main gateway device, the method includes: Construct a topology data structure with the main gateway device as the root node; The preset hop interval of the main gateway device and the role identifier of the main gateway device as the main gateway are inserted as custom information elements into the wireless management frame sent by the main gateway device. The wireless management frame is used to transmit the topology information of the access gateway device to the wireless terminal. Listen for device discovery messages broadcast from the gateway device and multicast data messages published by the wireless terminal through a preset multicast address; Based on the uplink device identifier and the device identifier of the slave gateway device carried in the device discovery message, the first topology information is determined. The second topology information is determined based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop count of the access gateway device carried in the multicast data packet; Based on the first topology information and the second topology information, a topology relationship between the master gateway device, the slave gateway device, and the wireless terminal is constructed in the topology data structure.

2. The method according to claim 1, characterized in that, After constructing the topological relationship between the master gateway device, the slave gateway device, and the wireless terminal in the topological data structure based on the first topological information and the second topological information, the method further includes: For each device node in the main gateway device, the slave gateway device and the wireless terminal included in the topology data structure, set an attribute field. The attribute field includes a status field, a reporting time field and a time-to-live field. The reporting time field is used to record the reporting time of the latest message sent by the device node. Monitor the communication time difference between the reporting time and the current time for each of the device nodes; For each device node, if the communication time difference of the device node is greater than the lifetime recorded in the lifetime field of the device node, the device status of the device node in the status field is updated to offline status, or the device node is deleted from the topology data structure.

3. The method according to claim 1, characterized in that, The service type of the multicast data packet is a specified service type; Listening to device discovery messages broadcast from the gateway device and multicast data packets published by the wireless terminal through a preset multicast address, including: On the wired network port, listen for the device discovery message broadcast from the gateway device; On a preset multicast address, listen to the data packets published by the wireless terminal, and filter out multicast data packets of a specified service type from the listened data packets.

4. A method for constructing device topology relationships, characterized in that, Applied to a gateway device, the method includes: Based on the device discovery message of the uplink gateway device and the radio management frame of the neighboring gateway device, the hop interval between the uplink gateway device and the main gateway device is obtained. The radio management frame includes the hop interval and role identifier of its corresponding gateway device. The number of hop intervals between the slave gateway device and the master gateway device is determined based on the number of hop intervals between the uplink gateway device and the master gateway device. Based on the device identifier of the slave gateway device and the role identifier of the slave gateway device as a slave gateway, the device discovery message of the slave gateway device is constructed and broadcast, so that the master gateway device can parse the first topology information of the slave gateway device and the master gateway device from the device discovery message; The hop interval between the slave gateway device and the master gateway device, the role identifier of the slave gateway device, the device identifier of the slave gateway device, and the device identifier of the uplink gateway device are inserted as custom information elements into the radio management frame sent by the slave gateway device, so that the wireless terminal can parse the topology information of its access gateway device from the radio management frame.

5. The method according to claim 4, characterized in that, Determining the hop interval between the slave gateway device and the master gateway device based on the hop interval between the uplink gateway device and the master gateway device includes: When the uplink gateway device is the main gateway device, the preset hop interval of the main gateway device is incremented by one and used as the hop interval of the slave gateway device from the main gateway device; When the uplink gateway device is the slave gateway device, the interval hop count between the slave gateway device and the master gateway device is incremented by one and used as the interval hop count between the slave gateway device and the master gateway device.

6. The method according to claim 4, characterized in that, The service type of the multicast data packets of the wireless terminal is a specified service type, and the method further includes: After the wireless terminal establishes a wireless connection with the access gateway device, the device listens for data packets published by the wireless terminal through a preset multicast address. If no multicast data packets of the specified service type are detected within a preset time window, the multicast data packets of the wireless terminal are constructed based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop interval between the access gateway device and the main gateway device. A proxy identifier is added to the multicast data packets constructed by the access gateway device to obtain proxy data packets; The proxy data packets are published using a preset multicast address.

7. A method for constructing device topology relationships, characterized in that, Applied to a wireless terminal, the method includes: The gateway device that establishes a wireless connection with the wireless terminal is designated as the access gateway device. Based on the wireless connection, the wireless management frame of the access gateway device is parsed, and the wireless management frame carries at least the hop interval between the access gateway device and the main gateway device; Multicast data packets are constructed based on the device identifier of the wireless terminal, the device identifier of the access gateway device, and the hop interval between the access gateway device and the main gateway device. The multicast data packets are published via a preset multicast address, so that the main gateway device can obtain the second topology information of the wireless terminal and the access gateway device by listening to the multicast data packets.

8. The method according to claim 7, characterized in that, The method further includes: When the wireless terminal roams, the access gateway device that establishes a wireless connection with the wireless terminal after roaming triggers the transmission of a multicast data packet. When the wireless terminal establishes a wireless connection, the multicast data packet is sent once by the access gateway device that has established a wireless connection with the wireless terminal. If the wireless connection between the wireless terminal and the access gateway device remains unchanged, the multicast data packets are periodically published according to each publication period in the preset publication period sequence, wherein each publication period in the publication period sequence is arranged in ascending order.

9. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the device topology construction method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the device topology construction method as described in any one of claims 1-8.