[go: up one dir, main page]

CN115866619A - A network topology construction method, device, equipment and storage medium - Google Patents

A network topology construction method, device, equipment and storage medium Download PDF

Info

Publication number
CN115866619A
CN115866619A CN202111123184.7A CN202111123184A CN115866619A CN 115866619 A CN115866619 A CN 115866619A CN 202111123184 A CN202111123184 A CN 202111123184A CN 115866619 A CN115866619 A CN 115866619A
Authority
CN
China
Prior art keywords
terminal
networking
gateway
mac address
parent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111123184.7A
Other languages
Chinese (zh)
Inventor
寇春花
尹�均
曾豪杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202111123184.7A priority Critical patent/CN115866619A/en
Publication of CN115866619A publication Critical patent/CN115866619A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses a method, a device, equipment and a storage medium for constructing a network topology, wherein the method comprises the following steps: acquiring the mac address of the gateway; determining a lower-hanging terminal having a parent-child relationship with the gateway based on the mac address of the gateway; when the lower hanging terminal is determined to be the networking terminal, the lower hanging terminal having a parent-child relationship with the networking terminal is determined based on the mac address of the networking terminal; and constructing a network topology of the gateway by utilizing the parent-child relationship between the gateway and the lower-hanging terminal thereof and the parent-child relationship between the networking terminal and the lower-hanging terminal thereof. Therefore, the parent-child relationship between the down-hanging terminal and the down-hanging terminal is obtained layer by layer through the mac addresses of the gateway and the networking terminal until the down-hanging terminal is not the networking terminal, namely the down-hanging terminal cannot be continuously connected with the down-hanging terminal, and the obtaining is stopped, so that the constructed network topology comprises all devices under the gateway, and the integrity of the network topology structure is improved.

Description

一种网络拓扑构建方法、装置、设备及存储介质A network topology construction method, device, equipment and storage medium

技术领域Technical Field

本发明涉及通讯技术领域,尤其涉及一种网络拓扑构建方法、装置、设备及存储介质。The present invention relates to the field of communication technology, and in particular to a network topology construction method, device, equipment and storage medium.

背景技术Background Art

网络拓扑是指由网络节点设备和通讯介质构成的网络结构。现有的网络拓扑结构中的节点设备一般到网关或者组网终端,但是现有网络中的还存在着许多其他设备,如手机、电脑、智能家居等智能终端,使用现有网络拓扑方法会出现拓扑结构缺失的问题。Network topology refers to the network structure composed of network node devices and communication media. The node devices in the existing network topology are generally gateways or networking terminals, but there are many other devices in the existing network, such as mobile phones, computers, smart homes and other smart terminals. Using the existing network topology method will result in the problem of missing topology structure.

发明内容Summary of the invention

为解决上述技术问题,本申请实施例期望提供一种网络拓扑构建方法、装置、设备及存储介质。In order to solve the above technical problems, the embodiments of the present application hope to provide a network topology construction method, device, equipment and storage medium.

本申请的技术方案是这样实现的:The technical solution of this application is implemented as follows:

第一方面,提供了一种网络拓扑构建方法,方法包括:获取网关的mac地址;基于所述网关的mac地址,确定与所述网关具备父子关系的下挂终端;确定所述下挂终端为组网终端时,基于所述组网终端的mac地址,确定与所述组网终端具备父子关系的下挂终端;利用所述网关与其下挂终端的父子关系,和所述组网终端与其下挂终端的父子关系,构建所述网关的网络拓扑。In a first aspect, a network topology construction method is provided, the method comprising: obtaining a MAC address of a gateway; determining a downstream terminal having a parent-child relationship with the gateway based on the MAC address of the gateway; when determining that the downstream terminal is a networking terminal, determining a downstream terminal having a parent-child relationship with the networking terminal based on the MAC address of the networking terminal; and constructing a network topology of the gateway using the parent-child relationship between the gateway and its downstream terminals, and the parent-child relationship between the networking terminal and its downstream terminals.

上述方案中,所述方法还包括:获取第i层下挂终端的mac地址;基于所述第i层下挂终端的mac地址,查询终端信息库获取所述第i层下挂终端的设备信息;其中,所述终端信息库中包括mac地址与设备信息的映射关系;基于所述设备信息判断所述第i层下挂终端是否为组网终端;所述第i层下挂终端为组网终端,基于第i层组网终端的mac地址,确定与所述第i层组网终端具备父子关系的第i+1层下挂终端;所述第i层下挂终端为非组网终端停止查询。In the above scheme, the method also includes: obtaining the mac address of the i-th layer downstream terminal; based on the mac address of the i-th layer downstream terminal, querying the terminal information database to obtain the device information of the i-th layer downstream terminal; wherein the terminal information database includes a mapping relationship between the mac address and the device information; based on the device information, judging whether the i-th layer downstream terminal is a networking terminal; if the i-th layer downstream terminal is a networking terminal, based on the mac address of the i-th layer networking terminal, determining the i+1-th layer downstream terminal that has a parent-child relationship with the i-th layer networking terminal; if the i-th layer downstream terminal is a non-networking terminal, stop querying.

上述方案中,所述设备信息包括设备类型;所述设备类型用于指示所述下挂终端为组网终端或者非组网终端。In the above solution, the device information includes a device type; the device type is used to indicate whether the downstream terminal is a networking terminal or a non-networking terminal.

上述方案中,所述方法还包括:根据所述下挂终端的mac地址,查询终端信息库,确定所述下挂终端的设备信息;将所述下挂终端的mac地址和设备信息添加到所述网络拓扑中。In the above scheme, the method also includes: querying a terminal information database according to the MAC address of the downstream terminal to determine the device information of the downstream terminal; and adding the MAC address and device information of the downstream terminal to the network topology.

上述方案中,所述方法还包括:所述下挂终端入网注册时,获取所述下挂终端的注册信息;其中,所述下挂终端的注册信息包括:mac地址和设备信息;基于所述下挂终端的注册信息建立所述终端信息库。In the above scheme, the method also includes: when the downstream terminal registers to join the network, obtaining the registration information of the downstream terminal; wherein the registration information of the downstream terminal includes: mac address and device information; and establishing the terminal information library based on the registration information of the downstream terminal.

上述方案中,所述方法还包括:确定所述终端信息库不存在所述下挂终端的设备信息;通过网络爬虫从互联网中爬取所述下挂终端的设备信息,或,分析所述网关的报文得到所述下挂终端的设备信息;将所述下挂终端的设备信息存储至所述终端信息库。In the above scheme, the method also includes: determining that the device information of the downstream terminal does not exist in the terminal information database; crawling the device information of the downstream terminal from the Internet through a web crawler, or analyzing the message of the gateway to obtain the device information of the downstream terminal; storing the device information of the downstream terminal in the terminal information database.

上述方案中,所述基于所述网关的mac地址,确定与所述网关具备父子关系的下挂终端,包括:基于所述网关的mac地址,确定与所述网关的Andlink组网插件之间的长连接;通过所述长连接向所述Andlink组网插件发送第一查询请求;接收所述Andlink组网插件发送的第一查询响应;其中,所述第一查询响应包括指示与所述网关具备父子关系的下挂终端的标识信息;解析所述第一查询响应,确定所述网关的下挂终端。In the above scheme, determining the downstream terminal having a parent-child relationship with the gateway based on the mac address of the gateway includes: determining the long connection between the gateway and the Andlink networking plug-in of the gateway based on the mac address of the gateway; sending a first query request to the Andlink networking plug-in through the long connection; receiving a first query response sent by the Andlink networking plug-in; wherein the first query response includes identification information indicating the downstream terminal having a parent-child relationship with the gateway; parsing the first query response to determine the downstream terminal of the gateway.

上述方案中,所述基于所述组网终端的mac地址,确定与所述组网终端具备父子关系的下挂终端,包括:基于所述组网终端的mac地址,向所述组网终端发送第二查询请求;接收所述组网终端发送的第二查询响应;其中,所述第二查询响应包括指示与所述组网终端具备父子关系的下挂终端的标识信息;解析所述第二查询响应,确定所述组网终端的下挂终端。In the above scheme, determining the downstream terminal having a parent-child relationship with the networking terminal based on the MAC address of the networking terminal includes: sending a second query request to the networking terminal based on the MAC address of the networking terminal; receiving a second query response sent by the networking terminal; wherein the second query response includes identification information indicating the downstream terminal having a parent-child relationship with the networking terminal; and parsing the second query response to determine the downstream terminal of the networking terminal.

上述方案中,所述基于所述组网终端的mac地址,向所述组网终端发送第二查询请求,包括:基于所述组网终端的mac地址,向所述网关的Andlink组网插件发送第二查询请求,以使所述Andlink组网插件转发所述第二查询请求至向所述组网终端;所述接收所述组网终端发送的第二查询响应,包括:接收所述Andlink组网插件转发的所述组网终端的所述第二查询响应。In the above scheme, sending a second query request to the networking terminal based on the mac address of the networking terminal includes: sending a second query request to the Andlink networking plug-in of the gateway based on the mac address of the networking terminal, so that the Andlink networking plug-in forwards the second query request to the networking terminal; receiving the second query response sent by the networking terminal includes: receiving the second query response of the networking terminal forwarded by the Andlink networking plug-in.

第二方面,提供了一种网络拓扑构建装置,其特征在于,所述装置包括:In a second aspect, a network topology construction device is provided, characterized in that the device comprises:

获取模块,用于获取网关的mac地址;Acquisition module, used to obtain the MAC address of the gateway;

处理模块,还用于基于所述网关的mac地址,确定与所述网关具备父子关系的下挂终端;The processing module is further used to determine the downstream terminal having a parent-child relationship with the gateway based on the MAC address of the gateway;

处理模块,还用于确定所述下挂终端为组网终端时,基于所述组网终端的mac地址,确定与所述组网终端具备父子关系的下挂终端;The processing module is further configured to determine, when determining that the downstream terminal is a networking terminal, a downstream terminal having a parent-child relationship with the networking terminal based on a MAC address of the networking terminal;

处理模块,还用于利用所述网关与其下挂终端的父子关系,和所述组网终端与其下挂终端的父子关系,构建所述网关的网络拓扑。The processing module is also used to construct the network topology of the gateway by using the parent-child relationship between the gateway and its downstream terminals, and the parent-child relationship between the networking terminal and its downstream terminals.

第三方面,提供了一种网络拓扑构建设备,所述设备包括:处理器和配置为存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器配置为运行所述计算机程序时,执行前述任一项所述方法的步骤。According to a third aspect, a network topology construction device is provided, the device comprising: a processor and a memory configured to store a computer program that can be run on the processor, wherein the processor is configured to execute the steps of any of the aforementioned methods when running the computer program.

第四方面,提供了一种计算机存储介质,其上存储有计算机程序,其中,该计算机程序被处理器执行时实现前述方法的步骤。In a fourth aspect, a computer storage medium is provided, on which a computer program is stored, wherein the computer program implements the steps of the aforementioned method when executed by a processor.

本申请公开了一种网络拓扑构建方法,该方法通过在确定下挂终端存在组网终端时,获取与该组网终端具有父子关系下一层组网终端,使得在构建网络拓扑时,可以获取到网关下的所有下挂终端,避免下挂终端的遗漏,提高网络拓扑结构的完整性。The present application discloses a network topology construction method. When determining that a networking terminal exists in a downstream terminal, the method obtains a next-layer networking terminal having a parent-child relationship with the networking terminal, so that when constructing the network topology, all downstream terminals under the gateway can be obtained, thereby avoiding omission of downstream terminals and improving the integrity of the network topology structure.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请实施例中网络拓扑构建方法的第一流程示意图;FIG1 is a schematic diagram of a first process of a method for constructing a network topology according to an embodiment of the present application;

图2为本申请实施例中网络拓扑构建方法的第二流程示意图,FIG2 is a schematic diagram of a second process of the network topology construction method in an embodiment of the present application,

图3为本申请实施例中的一种网络拓扑图;FIG3 is a network topology diagram according to an embodiment of the present application;

图4为本申请实施例中的信息交互结构图;FIG4 is a diagram of an information interaction structure in an embodiment of the present application;

图5为本申请实施例中管理平台、Andlink组网插件、下挂终端之间信息交互的流程示意图;5 is a schematic diagram of the flow of information interaction between the management platform, the Andlink networking plug-in, and the hanging terminal in an embodiment of the present application;

图6为本申请实施例中网络拓扑构建方法的第三流程示意图;FIG6 is a schematic diagram of a third process of the network topology construction method in an embodiment of the present application;

图7为本申请实施例中网络拓扑构建装置的组成结构示意图;FIG7 is a schematic diagram of the composition structure of a network topology construction device in an embodiment of the present application;

图8为本申请实施例中网络拓扑构建设备的组成结构示意图。FIG8 is a schematic diagram of the composition structure of a network topology construction device in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

为解决现有网络拓扑结构缺失问题,本申请提出一种网络拓扑构建方法,图1为本申请实施例中网络拓扑构建方法的第一流程示意图,如图1所示,网络拓扑构建方法具体可以包括:In order to solve the problem of missing existing network topology structure, the present application proposes a network topology construction method. FIG1 is a first flow chart of the network topology construction method in an embodiment of the present application. As shown in FIG1 , the network topology construction method may specifically include:

步骤101:获取网关的mac地址;Step 101: Get the MAC address of the gateway;

这里,当需要构建某一网关的网络拓扑时,便获取该网关的mac地址。这里,网关的mac地址用于确定与该网关之间的连接,进而基于该连接实现与网关的信息交互,获取网关下终端的连接关系及设备信息。示例性的,管理平台中存储了网关的mac地址,当要构建某一家庭网关的网络拓扑时,从管理平台的数据库中获取到该家庭网关的mac地址;当要构建某一办公室网关的网络拓扑时,从管理平台的数据库中获取到该办公室网关的mac地址。Here, when it is necessary to build a network topology of a certain gateway, the MAC address of the gateway is obtained. Here, the MAC address of the gateway is used to determine the connection with the gateway, and then based on the connection, information interaction with the gateway is realized to obtain the connection relationship and device information of the terminal under the gateway. Exemplarily, the MAC address of the gateway is stored in the management platform. When the network topology of a certain home gateway is to be built, the MAC address of the home gateway is obtained from the database of the management platform; when the network topology of a certain office gateway is to be built, the MAC address of the office gateway is obtained from the database of the management platform.

步骤102:基于所述网关的mac地址,确定与所述网关具备父子关系的下挂终端;Step 102: Based on the MAC address of the gateway, determine the downstream terminal that has a parent-child relationship with the gateway;

这里,与网关具备父子关系的下挂终端为该网关下直接下挂的下挂终端。所述父子关系中,网关为父,下挂终端为子。Here, the down-hook terminal having a parent-child relationship with the gateway is a down-hook terminal directly hung under the gateway. In the parent-child relationship, the gateway is the parent and the down-hook terminal is the child.

示例性的,基于网关的mac地址,确定与所述网关具备父子关系的下挂终端包括:基于网关的mac地址确定与网关之间的连接;基于该连接与网关进行信息交互,确定与所述网关具备父子关系的下挂终端。Exemplarily, based on the MAC address of the gateway, determining the downstream terminal having a parent-child relationship with the gateway includes: determining the connection between the gateway and the gateway based on the MAC address of the gateway; and exchanging information with the gateway based on the connection to determine the downstream terminal having a parent-child relationship with the gateway.

示例性的,在一些实施例中,基于所述网关的mac地址,确定与所述网关具备父子关系的下挂终端,包括:基于所述网关的mac地址,确定与所述网关的Andlink组网插件之间的长连接;通过所述长连接向所述Andlink组网插件发送第一查询请求;接收所述Andlink组网插件发送的第一查询响应;其中,所述第一查询响应包括指示与所述网关具备父子关系的下挂终端的标识信息;解析所述第一查询响应,确定所述网关的下挂终端。Exemplarily, in some embodiments, based on the mac address of the gateway, determining the downstream terminal that has a parent-child relationship with the gateway includes: based on the mac address of the gateway, determining the long connection between the gateway and the Andlink networking plug-in of the gateway; sending a first query request to the Andlink networking plug-in through the long connection; receiving a first query response sent by the Andlink networking plug-in; wherein the first query response includes identification information indicating the downstream terminal that has a parent-child relationship with the gateway; parsing the first query response to determine the downstream terminal of the gateway.

步骤103:确定所述下挂终端为组网终端时,基于所述组网终端的mac地址,确定与所述组网终端具备父子关系的下挂终端;Step 103: When it is determined that the downstream terminal is a networking terminal, based on the MAC address of the networking terminal, determine a downstream terminal having a parent-child relationship with the networking terminal;

示例性的,下挂终端包括组网终端和非组网终端。其中,组网终端的下面可以继续连接其他组网终端或智能终端,可以为路由器等设备。非组网终端为手机、电脑、智能家居等智能终端,其下面不能继续连接其他组网终端或非组网终端。Exemplarily, the downstream terminals include networking terminals and non-networking terminals. Among them, the networking terminals can continue to connect to other networking terminals or smart terminals, which can be devices such as routers. Non-networking terminals are smart terminals such as mobile phones, computers, smart homes, etc., and cannot continue to connect to other networking terminals or non-networking terminals.

确定下挂终端为组网终端时,表明该下挂终端下面还可能连接了下一层下挂终端,需要继续向下获取。When it is determined that the downstream terminal is a networking terminal, it indicates that the downstream terminal may be connected to a lower-layer downstream terminal, and it is necessary to continue to obtain downward information.

在一些实施例中,该方法还包括:获取下挂终端的mac地址;基于所述下挂终端的mac地址查询终端信息库,获取所述下挂终端的设备信息;基于所述设备信息判断所述下挂终端是否为组网终端。In some embodiments, the method further includes: obtaining the MAC address of the downstream terminal; querying a terminal information database based on the MAC address of the downstream terminal to obtain device information of the downstream terminal; and determining whether the downstream terminal is a networking terminal based on the device information.

示例性的,图2为本申请实施例中网络拓扑构建方法的第二流程示意图,如图2所示,网络拓扑构建还包括:Exemplarily, FIG2 is a schematic diagram of a second process of the network topology construction method in an embodiment of the present application. As shown in FIG2, the network topology construction further includes:

步骤201:获取第i层下挂终端的mac地址;Step 201: Obtain the MAC address of the terminal connected to the i-th layer;

步骤202:基于所述第i层下挂终端的mac地址,查询终端信息库获取所述第i层下挂终端的设备信息;Step 202: Based on the MAC address of the terminal connected to the i-th layer, query the terminal information database to obtain the device information of the terminal connected to the i-th layer;

其中,所述终端信息库中包括mac地址与设备信息的映射关系;Wherein, the terminal information library includes a mapping relationship between mac address and device information;

步骤203:基于所述设备信息判断第i层下挂终端是否为组网终端;如果是,执行步骤204;如果否,执行步骤205;Step 203: judging whether the terminal under the i-th layer is a networking terminal based on the device information; if yes, executing step 204; if no, executing step 205;

步骤204:所述第i层下挂终端为组网终端,基于第i层组网终端的mac地址,确定与所述第i层组网终端具备父子关系的第i+1层下挂终端;Step 204: the i-th layer downstream terminal is a networking terminal, and based on the MAC address of the i-th layer networking terminal, an i+1-th layer downstream terminal having a parent-child relationship with the i-th layer networking terminal is determined;

具体的,确定第i+1层下挂终端之后,将第i+1层下挂终端作为第i层下挂终端,返回执行步骤202。Specifically, after the i+1th layer of downstream terminals is determined, the i+1th layer of downstream terminals is used as the i-th layer of downstream terminals, and the process returns to step 202 .

步骤205:所述第i层下挂终端为非组网终端停止查询。Step 205: The i-th layer connected terminal is a non-networked terminal and the query is stopped.

示例性的,在一些实施例中,下挂终端的设备信息包括设备类型;所述设备类型用于指示所述下挂终端为组网终端或者非组网终端。Exemplarily, in some embodiments, the device information of the downstream terminal includes a device type; the device type is used to indicate whether the downstream terminal is a networking terminal or a non-networking terminal.

这里,终端信息库中存储了下挂终端的mac地址与其对应的设备信息;根据下挂终端的mac地址便可获取到下挂终端的设备信息。这里,第i层下挂终端为非组网终端停止查询,表明第i层下挂终端下面不会再连接下挂终端,即第i层下挂终端为最底层下挂终端。Here, the terminal information database stores the MAC addresses of the downstream terminals and their corresponding device information; the device information of the downstream terminals can be obtained according to the MAC addresses of the downstream terminals. Here, the query is stopped because the i-th layer downstream terminal is a non-networking terminal, indicating that there will be no more downstream terminals connected to the i-th layer downstream terminal, that is, the i-th layer downstream terminal is the lowest layer downstream terminal.

通过在确定第i层下挂终端为组网终端时,继续获取该组网终端下的下一层组网终端,直至第i层下挂终端为非组网终端时,即最后一层下挂终端不会继续连接下挂终端,停止向下获取,使得在构建网络拓扑时,可以获取到网关下的所有下挂终端,避免下挂终端的遗漏,提高网络拓扑结构完整性。When determining that the i-th layer of downstream terminals is a networking terminal, the next layer of networking terminals under the networking terminal is continuously obtained until the i-th layer of downstream terminals is a non-networking terminal, that is, the last layer of downstream terminals will not continue to connect to the downstream terminals and the downward acquisition is stopped. In this way, when constructing the network topology, all downstream terminals under the gateway can be obtained, avoiding the omission of downstream terminals and improving the integrity of the network topology structure.

步骤104:利用所述网关与其下挂终端的父子关系,和所述组网终端与其下挂终端的父子关系,构建所述网关的网络拓扑。Step 104: construct the network topology of the gateway by using the parent-child relationship between the gateway and its subordinate terminals, and the parent-child relationship between the networking terminal and its subordinate terminals.

示例性的,图3为本申请实施例中的一种网络拓扑图,展示了一个构建好的网络拓扑。图3中,300为网关,310-313为第1层下挂终端,其中,310和313为组网终端;320-326为第2层下挂终端,第2层下挂终端中不存在组网终端。For example, FIG3 is a network topology diagram in an embodiment of the present application, showing a constructed network topology. In FIG3, 300 is a gateway, 310-313 are first-layer down-hook terminals, where 310 and 313 are networking terminals; 320-326 are second-layer down-hook terminals, and there is no networking terminal in the second-layer down-hook terminals.

这里,步骤101至步骤104及步骤201至步骤205的执行主体可以为网络拓扑构建设备的处理器。示例性的,所述网络拓扑构建设备可应用于管理平台,实现管理平台与网关的信息交互。Here, the execution subject of steps 101 to 104 and steps 201 to 205 may be a processor of a network topology construction device. Exemplarily, the network topology construction device may be applied to a management platform to implement information interaction between the management platform and a gateway.

本申请的技术方案,通过在确定下挂终端存在组网终端时,获取与该组网终端具有父子关系下一层组网终端,使得在构建网络拓扑时,可以获取到网关下的所有下挂终端,避免下挂终端的遗漏,提高网络拓扑结构的完整性。The technical solution of the present application, when determining that a networking terminal exists in a downstream terminal, obtains a next-layer networking terminal having a parent-child relationship with the networking terminal, so that when constructing a network topology, all downstream terminals under the gateway can be obtained, thereby avoiding omission of downstream terminals and improving the integrity of the network topology structure.

在上述实施例的基础上,对步骤102确定与所述网关具备父子关系的下挂终端的方法,和步骤103确定与组网终端具备父子关系的下挂终端的方法进行进一步的举例说明。Based on the above embodiment, the method of determining the downstream terminal having a parent-child relationship with the gateway in step 102 and the method of determining the downstream terminal having a parent-child relationship with the networking terminal in step 103 are further illustrated.

示例性的,在一些实施例中,基于所述网关的mac地址,确定与所述网关具备父子关系的下挂终端,包括:基于所述网关的mac地址,确定与所述网关的Andlink组网插件之间的长连接;通过所述长连接向所述Andlink组网插件发送第一查询请求;接收所述Andlink组网插件发送的第一查询响应;其中,所述第一查询响应包括指示与所述网关具备父子关系的下挂终端的标识信息;解析所述第一查询响应,确定所述网关的下挂终端。Exemplarily, in some embodiments, based on the mac address of the gateway, determining the downstream terminal that has a parent-child relationship with the gateway includes: based on the mac address of the gateway, determining the long connection between the gateway and the Andlink networking plug-in of the gateway; sending a first query request to the Andlink networking plug-in through the long connection; receiving a first query response sent by the Andlink networking plug-in; wherein the first query response includes identification information indicating the downstream terminal that has a parent-child relationship with the gateway; parsing the first query response to determine the downstream terminal of the gateway.

这里,长连接用于实现管理平台与Andlink组网插件之间的信息交互。第一查询请求,用于查询与网关存在父子关系的下挂终端。示例性的,该标识信息包括:mac地址、名称。Here, the long connection is used to realize the information interaction between the management platform and the Andlink networking plug-in. The first query request is used to query the downstream terminals that have a parent-child relationship with the gateway. Exemplarily, the identification information includes: mac address, name.

示例性的,在一些实施例中,基于所述组网终端的mac地址,确定与所述组网终端具备父子关系的下挂终端,包括:基于所述组网终端的mac地址,向所述组网终端发送第二查询请求;接收所述组网终端发送的第二查询响应;其中,所述第二查询响应包括指示与所述组网终端具备父子关系的下挂终端的标识信息;解析所述第二查询响应,确定所述组网终端的下挂终端。Exemplarily, in some embodiments, based on the MAC address of the networking terminal, determining the downstream terminal that has a parent-child relationship with the networking terminal includes: sending a second query request to the networking terminal based on the MAC address of the networking terminal; receiving a second query response sent by the networking terminal; wherein the second query response includes identification information indicating the downstream terminal that has a parent-child relationship with the networking terminal; parsing the second query response to determine the downstream terminal of the networking terminal.

这里,第二查询请求用于查询与所述组网终端存在父子关系的下挂终端。示例性的,该标识信息包括:mac地址、名称。Here, the second query request is used to query the downstream terminal that has a parent-child relationship with the networking terminal. Exemplarily, the identification information includes: mac address and name.

示例性的,在一些实施中,所述第二查询响应还包括:所述组网终端的运行参数。运行参数可以为组网终端的当前的协商接收速率、当前的协商发送速率、上行的实时接收速率、上行的实时发送速率等信息。所述方法还包括:将所述组网终端的运行参数展示在所述网络拓扑中。Exemplarily, in some implementations, the second query response further includes: operating parameters of the networking terminal. The operating parameters may be information such as the current negotiated receiving rate, the current negotiated sending rate, the uplink real-time receiving rate, the uplink real-time sending rate, etc. of the networking terminal. The method further includes: displaying the operating parameters of the networking terminal in the network topology.

示例性的,在一些实施例中,查询网关和组网终端的下挂终端可以由管理平台网关的Andlink组网插件,组网终端,智能终端之间的信息交互结构实现。该信息交互结构中,Andlink组网插件,组网终端,智能终端之间的信息交互可以基于Andlink协议实现。这里,智能终端相当于与本申请中的非组网终端。Exemplarily, in some embodiments, the query gateway and the lower-hanging terminal of the networking terminal can be implemented by the Andlink networking plug-in of the management platform gateway, the networking terminal, and the information interaction structure between the intelligent terminal. In the information interaction structure, the information interaction between the Andlink networking plug-in, the networking terminal, and the intelligent terminal can be implemented based on the Andlink protocol. Here, the intelligent terminal is equivalent to the non-networking terminal in this application.

示例性的,图4为本申请实施例中的信息交互结构图。如图4所示,管理平台与Andlink组网插件之间可以直接进行信息交互;Andlink组网插件与组网终端和智能终端之间可以进行信息交互;组网终端可以与其下挂的下一层智能终端进行信息交互。这里,管理平台可以用于查询/控制组网终端和智能终端,还可以存储全网的终端信息。网关的Andlink组网插件为网关中遵循Andlink协议的插件,可以用于向上接入管理平台,向下维护管理智能组网终端,中转管理平台与组网终端、智能终端之间的消息、数据。组网终端主要为路由器等,负责增大网络的覆盖范围和信号强度。智能终端内嵌Andlink sdk,在终端接入时,可以发送终端的设备信息。Exemplarily, FIG4 is an information interaction structure diagram in an embodiment of the present application. As shown in FIG4 , information can be directly exchanged between the management platform and the Andlink networking plug-in; information can be exchanged between the Andlink networking plug-in and the networking terminal and the smart terminal; the networking terminal can exchange information with the next-layer smart terminal hanging below it. Here, the management platform can be used to query/control the networking terminals and smart terminals, and can also store terminal information of the entire network. The Andlink networking plug-in of the gateway is a plug-in that complies with the Andlink protocol in the gateway. It can be used to access the management platform upward, maintain and manage the smart networking terminals downward, and transfer messages and data between the management platform and the networking terminals and smart terminals. The networking terminals are mainly routers, etc., which are responsible for increasing the coverage and signal strength of the network. The smart terminal is embedded with the Andlink sdk, and the device information of the terminal can be sent when the terminal is accessed.

示例性的,在一些实施例中,基于所述组网终端的mac地址,向所述组网终端发送第二查询请求,包括:基于所述组网终端的mac地址,向所述网关的Andlink组网插件发送第二查询请求,以使所述Andlink组网插件转发所述第二查询请求至向所述组网终端;所述接收所述组网终端发送的第二查询响应,包括:接收所述Andlink组网插件转发的所述组网终端的所述第二查询响应。Exemplarily, in some embodiments, sending a second query request to the networking terminal based on the mac address of the networking terminal includes: sending a second query request to the Andlink networking plug-in of the gateway based on the mac address of the networking terminal, so that the Andlink networking plug-in forwards the second query request to the networking terminal; receiving the second query response sent by the networking terminal includes: receiving the second query response of the networking terminal forwarded by the Andlink networking plug-in.

通过基于管理平台与网关Andlink组网插件之间的长连接,发送查询下挂终端请求,并接收网关Andlink组网插件发送或转发的查询响应,可以实时下挂终端进行实时查询,提高查询效率,还可以为拓扑结构上的应用提供基础,比如显示家庭网络告警的波及范围,可以对各个厂商的智能家居设备进行统一管理入口,进行启动、停止、查询等操作。Through the long connection between the management platform and the gateway Andlink networking plug-in, the query request is sent to the downstream terminal, and the query response sent or forwarded by the gateway Andlink networking plug-in is received. The terminal can be connected in real time for real-time query to improve the query efficiency. It can also provide a basis for applications on the topology structure, such as displaying the scope of home network alarms, and a unified management entrance can be used for smart home devices of various manufacturers to start, stop, query and other operations.

为了进一步说明如何基于图4中的信息交互结构,确定网关和组网终端的下挂终端,本申请进行如下举例说明。In order to further illustrate how to determine the downstream terminals of the gateway and the networking terminal based on the information interaction structure in Figure 4, the present application provides the following examples.

示例性的,图5为本申请实施例中管理平台、Andlink组网插件、下挂终端之间信息交互的流程示意图。Exemplarily, FIG5 is a flowchart of information interaction among the management platform, the Andlink networking plug-in, and the downstream terminal in an embodiment of the present application.

如图5所示,该信息交互主要包括以下内容:As shown in Figure 5, the information interaction mainly includes the following contents:

501:Andlink组网插件获取网关的mac地址信息,向管理平台进行注册认证,并建立tcp长连接,心跳保活;501: The Andlink networking plug-in obtains the MAC address information of the gateway, registers and authenticates with the management platform, and establishes a TCP long connection and a heartbeat to keep it alive;

502:组网终端/智能终端首次接入到网关上时,终端将设备信息及参数通过广播发送给Andlink组网插件,进行注册;502: When the networking terminal/intelligent terminal is connected to the gateway for the first time, the terminal sends the device information and parameters to the Andlink networking plug-in through broadcasting for registration;

503:Andlink组网插件返回注册响应,并向管理平台上报设备信息及参数进行终端注册;503: The Andlink networking plug-in returns a registration response and reports device information and parameters to the management platform for terminal registration;

504:管理平台记录相应信息并入库,并向Andlink组网插件返回终端注册响应。504: The management platform records the corresponding information and stores it in the database, and returns a terminal registration response to the Andlink networking plug-in.

505:终端向Andlink组网插件通过广播周期性地上报心跳;505: The terminal periodically reports the heartbeat to the Andlink networking plug-in through broadcasting;

506:管理平台向Andlink组网插件发起查询控制请求;506: The management platform initiates a query control request to the Andlink networking plug-in;

507:Andlink组网插件收到查询控制请求命令后,进行判断,如果是查询网关本身的相关信息,则直接返回;如果是查询其下挂的终端的请求,则转发给对应的终端。507: After receiving the query control request command, the Andlink networking plug-in makes a judgment. If it is a query for the relevant information of the gateway itself, it returns directly; if it is a request to query the terminal connected to it, it is forwarded to the corresponding terminal.

508:终端对查询控制操作进行响应,并返回查询控制响应;508: The terminal responds to the query control operation and returns a query control response;

509:Andlink组网插件将终端返回的查询控制响应转发给管理平台。509: The Andlink networking plug-in forwards the query control response returned by the terminal to the management platform.

其中,组网终端/智能终端同网关Andlink组网插件之间的请求响应的内容,同网关Andlink组网插件与管理平台之间的请求响应的内容类似。示例性的,当网关为家庭网关时,注册及查询请求及查询响应的内容如下。The content of the request and response between the networking terminal/intelligent terminal and the gateway Andlink networking plug-in is similar to the content of the request and response between the gateway Andlink networking plug-in and the management platform. Exemplarily, when the gateway is a home gateway, the content of the registration and query request and query response is as follows.

示例性的,组网终端的注册请求内容如下:Exemplarily, the registration request content of the networking terminal is as follows:

Url:coap://GWIP:5683/device/inform/bootUrl:coap://GWIP:5683/device/inform/boot

表1Table 1

Figure BDA0003277923550000091
Figure BDA0003277923550000091

Figure BDA0003277923550000101
Figure BDA0003277923550000101

示例性的,组网终端的注册响应内容如下:Exemplarily, the registration response content of the networking terminal is as follows:

表2Table 2

Figure BDA0003277923550000102
Figure BDA0003277923550000102

Figure BDA0003277923550000111
Figure BDA0003277923550000111

示例性的,智能终端的注册请求的内容如下:Exemplarily, the content of the registration request of the intelligent terminal is as follows:

Url:coap://gwip/device/inform/bootstrapUrl:coap://gwip/device/inform/bootstrap

表3Table 3

Figure BDA0003277923550000112
Figure BDA0003277923550000112

Figure BDA0003277923550000121
Figure BDA0003277923550000121

示例性的,智能终端的注册响应的内容如下:Exemplarily, the content of the registration response of the intelligent terminal is as follows:

表4Table 4

Figure BDA0003277923550000122
Figure BDA0003277923550000122

示例性的,第二查询请求的内容如下:Exemplarily, the content of the second query request is as follows:

Url:coap://APIP:5683/apdevice/query/STAInfo表5Url:coap://APIP:5683/apdevice/query/STAInfoTable 5

Figure BDA0003277923550000123
Figure BDA0003277923550000123

示例性的,第二查询响应的内容如下:Exemplarily, the content of the second query response is as follows:

表6Table 6

Figure BDA0003277923550000131
Figure BDA0003277923550000131

Figure BDA0003277923550000141
Figure BDA0003277923550000141

通过将拓扑结构的节点延伸到智能终端层,使得拓扑结构更加完整;通过基于管理平台与网关Andlink组网插件之间的长连接,发送查询下挂终端请求,并控制Andlink组网插件直接返回或者转发给组网终端,将其查询的结果返回给管理平台,可以实时下挂终端进行实时查询,提高查询效率;还可以为拓扑结构上的应用提供基础,比如显示网络告警的波及范围,可以对各个厂商的智能设备进行统一管理入口,进行启动、停止、查询等操作。By extending the nodes of the topology structure to the intelligent terminal layer, the topology structure is made more complete; by sending a query request to the downstream terminal based on the long connection between the management platform and the gateway Andlink networking plug-in, and controlling the Andlink networking plug-in to directly return or forward to the networking terminal, and returning the query result to the management platform, the terminal can be queried in real time to improve the query efficiency; it can also provide a basis for applications on the topology structure, such as displaying the scope of network alarms, and a unified management entrance for smart devices of various manufacturers to start, stop, query and other operations.

为了能更加体现本申请的目的,在本申请上实施例的基础上,进行进一步的举例说明,图6为本申请实施例中网络拓扑构建方法的第三流程示意图。如图6所示,网络拓扑构建方法具体包括:In order to better reflect the purpose of this application, further examples are given based on the above embodiments of this application. FIG6 is a schematic diagram of the third process of the network topology construction method in the embodiment of this application. As shown in FIG6, the network topology construction method specifically includes:

步骤601:获取网关的mac地址;Step 601: Get the MAC address of the gateway;

这里,当需要构建某一网关的网络拓扑时,便获取该网关的mac地址。示例性的,管理平台中存储了网关的mac地址,当要构建某一家庭网关的网络拓扑时,从管理平台的数据库中获取到该家庭网关的mac地址;当要构建某一办公室网关的网络拓扑时,从管理平台的数据库中获取到该办公室网关的mac地址。Here, when a network topology of a certain gateway needs to be built, the MAC address of the gateway is obtained. For example, the MAC address of the gateway is stored in the management platform. When a network topology of a certain home gateway is to be built, the MAC address of the home gateway is obtained from the database of the management platform; when a network topology of a certain office gateway is to be built, the MAC address of the office gateway is obtained from the database of the management platform.

步骤602:基于所述网关的mac地址,确定与所述网关具备父子关系的下挂终端;Step 602: Based on the MAC address of the gateway, determine the downstream terminal that has a parent-child relationship with the gateway;

这里,与网关具备父子关系的下挂终端为该网关下直接下挂的下挂终端。所述父子关系中,网关为父,下挂终端为子。Here, the down-hook terminal having a parent-child relationship with the gateway is a down-hook terminal directly hung under the gateway. In the parent-child relationship, the gateway is the parent and the down-hook terminal is the child.

步骤603:确定所述下挂终端为组网终端时,基于所述组网终端的mac地址,确定与所述组网终端具备父子关系的下挂终端;Step 603: When it is determined that the downstream terminal is a networking terminal, based on the MAC address of the networking terminal, determine the downstream terminal that has a parent-child relationship with the networking terminal;

步骤604:利用所述网关与其下挂终端的父子关系,和所述组网终端与其下挂终端的父子关系,构建所述网关的网络拓扑;Step 604: constructing a network topology of the gateway by using the parent-child relationship between the gateway and its subordinate terminals, and the parent-child relationship between the networking terminal and its subordinate terminals;

步骤605:根据所述下挂终端的mac地址,查询终端信息库,确定所述下挂终端的设备信息;Step 605: query the terminal information database according to the MAC address of the downstream terminal to determine the device information of the downstream terminal;

示例性的,设备信息包括:示例性的,下挂终端的设备信息包括:设备类型、设备厂商,设备标识等。Exemplarily, the device information includes: Exemplarily, the device information of the downstream terminal includes: device type, device manufacturer, device identification, etc.

通过获取下挂终端的设备信息,并将其展示在网络拓扑中,可以使得网络拓扑扑的信息更加丰富,还可以为智能终端的数据挖掘提供了信息基础。By obtaining the device information of the downstream terminals and displaying it in the network topology, the information of the network topology can be enriched and an information basis can be provided for data mining of smart terminals.

示例性的,在一些实施例中,所述方法还包括构建终端信息库。示例性的,构建终端信息库包括:所述下挂终端入网注册时,获取所述下挂终端的注册信息;其中,所述下挂终端的注册信息包括:mac地址和设备信息;基于所述下挂终端的注册信息建立所述终端信息库。Exemplarily, in some embodiments, the method further includes building a terminal information database. Exemplarily, building a terminal information database includes: when the downstream terminal registers to access the network, obtaining the registration information of the downstream terminal; wherein the registration information of the downstream terminal includes: MAC address and device information; and establishing the terminal information database based on the registration information of the downstream terminal.

示例性的,示例性的,在一些实施例中,所述方法还包括:确定所述终端信息库不存在所述下挂终端的设备信息;通过网络爬虫从互联网中爬取所述下挂终端的设备信息,或,分析所述网关的报文得到所述下挂终端的设备信息;将所述下挂终端的设备信息存储至所述终端信息库。Exemplarily, exemplary, in some embodiments, the method further includes: determining that the device information of the downstream terminal does not exist in the terminal information database; crawling the device information of the downstream terminal from the Internet by a web crawler, or analyzing the message of the gateway to obtain the device information of the downstream terminal; storing the device information of the downstream terminal in the terminal information database.

这里,网关与下挂终端之间可以进行信息交互,网关的报文中可能会存在下挂终端的设备信息。Here, information can be exchanged between the gateway and the downstream terminal, and the gateway message may contain device information of the downstream terminal.

示例性的,在一些实施例中,下挂终端的注册信息包括:智能终端的mac地址,cmei码和设备类型,组网终端的mac地址,设备类型,设备厂商和设备型号。示例性的,所述方法还包括:基于智能终端的cmei码识别出智能终端的设备厂商和设备型号。Exemplarily, in some embodiments, the registration information of the connected terminal includes: the MAC address, CMEI code and device type of the smart terminal, the MAC address, device type, device manufacturer and device model of the networking terminal. Exemplarily, the method also includes: identifying the device manufacturer and device model of the smart terminal based on the CMEI code of the smart terminal.

步骤606:将所述下挂终端的mac地址和设备信息添加到所述网络拓扑中。Step 606: Add the MAC address and device information of the downstream terminal to the network topology.

这里,步骤601至步骤606的执行主体可以为网络拓扑构建设备的处理器。示例性的,所述网络拓扑构建设备可应用于管理平台,实现管理平台与网关的信息交互。Here, the execution subject of step 601 to step 606 may be a processor of the network topology construction device. Exemplarily, the network topology construction device may be applied to a management platform to implement information interaction between the management platform and a gateway.

本申请的技术方案,通过获取下挂终端的设备信息,并将其展示在网络拓扑中,可以使得网络拓扑扑的信息更加丰富,还可以为智能终端的数据挖掘提供了信息基础;通过在确定下挂终端存在组网终端时,获取与该组网终端具有父子关系下一层组网终端,使得在构建网络拓扑时,可以获取到网关下的所有下挂终端,避免下挂终端的遗漏,提高网络拓扑结构的完整性。The technical solution of the present application can enrich the information of the network topology by obtaining the device information of the downstream terminals and displaying it in the network topology, and can also provide an information basis for data mining of smart terminals; when it is determined that there is a networking terminal in the downstream terminal, the next layer of networking terminals with a parent-child relationship with the networking terminal are obtained, so that when constructing the network topology, all the downstream terminals under the gateway can be obtained, avoiding the omission of the downstream terminals and improving the integrity of the network topology structure.

为实现本申请实施例的方法,本申请实施例还提供了一种网络拓扑构建装置70,如图7所示,该装置包括:In order to implement the method of the embodiment of the present application, the embodiment of the present application further provides a network topology construction device 70, as shown in FIG7 , the device includes:

获取模块701,用于获取网关的mac地址;The acquisition module 701 is used to obtain the MAC address of the gateway;

处理模块702,还用于基于所述网关的mac地址,确定与所述网关具备父子关系的下挂终端;The processing module 702 is further used to determine the downstream terminal having a parent-child relationship with the gateway based on the MAC address of the gateway;

处理模块702,还用于确定所述下挂终端为组网终端时,基于所述组网终端的mac地址,确定与所述组网终端具备父子关系的下挂终端;The processing module 702 is further configured to determine, when determining that the downstream terminal is a networking terminal, a downstream terminal having a parent-child relationship with the networking terminal based on a MAC address of the networking terminal;

处理模块702,还用于利用所述网关与其下挂终端的父子关系,和所述组网终端与其下挂终端的父子关系,构建所述网关的网络拓扑。The processing module 702 is further configured to construct a network topology of the gateway by using the parent-child relationship between the gateway and its subordinate terminals, and the parent-child relationship between the networking terminal and its subordinate terminals.

本申请的技术方案,通过在确定下挂终端存在组网终端时,获取与该组网终端具有父子关系下一层组网终端,使得在构建网络拓扑时,可以获取到网关下的所有下挂终端,避免下挂终端的遗漏,提高网络拓扑结构的完整性。The technical solution of the present application, when determining that a networking terminal exists in a downstream terminal, obtains a next-layer networking terminal having a parent-child relationship with the networking terminal, so that when constructing a network topology, all downstream terminals under the gateway can be obtained, thereby avoiding omission of downstream terminals and improving the integrity of the network topology structure.

在一些实施例中,处理模块702,还用于获取第i层下挂终端的mac地址;基于所述第i层下挂终端的mac地址,查询终端信息库获取所述第i层下挂终端的设备信息;其中,所述终端信息库中包括mac地址与设备信息的映射关系;基于所述设备信息判断所述第i层下挂终端是否为组网终端;所述第i层下挂终端为组网终端,基于第i层组网终端的mac地址,确定与所述第i层组网终端具备父子关系的第i+1层下挂终端;所述第i层下挂终端为非组网终端停止查询。In some embodiments, the processing module 702 is also used to obtain the mac address of the i-th layer downstream terminal; based on the mac address of the i-th layer downstream terminal, query the terminal information database to obtain the device information of the i-th layer downstream terminal; wherein the terminal information database includes a mapping relationship between the mac address and the device information; based on the device information, determine whether the i-th layer downstream terminal is a networking terminal; if the i-th layer downstream terminal is a networking terminal, based on the mac address of the i-th layer networking terminal, determine the i+1-th layer downstream terminal that has a parent-child relationship with the i-th layer networking terminal; if the i-th layer downstream terminal is a non-networking terminal, stop querying.

在一些实施例中,所述设备信息包括设备类型;所述设备类型用于指示所述下挂终端为组网终端或者非组网终端。In some embodiments, the device information includes a device type; the device type is used to indicate whether the downstream terminal is a networking terminal or a non-networking terminal.

在一些实施例中,处理模块702,还用于根据所述下挂终端的mac地址,查询终端信息库,确定所述下挂终端的设备信息;将所述下挂终端的mac地址和设备信息添加到所述网络拓扑中。In some embodiments, the processing module 702 is further used to query the terminal information database according to the MAC address of the downstream terminal to determine the device information of the downstream terminal; and add the MAC address and device information of the downstream terminal to the network topology.

在一些实施例中,处理模块702,还用于所述下挂终端入网注册时,获取所述下挂终端的注册信息;其中,所述下挂终端的注册信息包括:mac地址和设备信息;基于所述下挂终端的注册信息建立所述终端信息库。In some embodiments, the processing module 702 is also used to obtain the registration information of the downstream terminal when the downstream terminal registers to access the network; wherein the registration information of the downstream terminal includes: mac address and device information; and establish the terminal information database based on the registration information of the downstream terminal.

在一些实施例中,处理模块702,还用于确定所述终端信息库不存在所述下挂终端的设备信息;通过网络爬虫从互联网中爬取所述下挂终端的设备信息,或,分析所述网关的报文得到所述下挂终端的设备信息;将所述下挂终端的设备信息存储至所述终端信息库。In some embodiments, the processing module 702 is also used to determine that the device information of the downstream terminal does not exist in the terminal information library; crawl the device information of the downstream terminal from the Internet through a web crawler, or analyze the message of the gateway to obtain the device information of the downstream terminal; and store the device information of the downstream terminal in the terminal information library.

在一些实施例中,处理模块702,用于基于所述网关的mac地址,确定与所述网关的Andlink组网插件之间的长连接;通过所述长连接向所述Andlink组网插件发送第一查询请求;接收所述Andlink组网插件发送的第一查询响应;其中,所述第一查询响应包括指示与所述网关具备父子关系的下挂终端的标识信息;解析所述第一查询响应,确定所述网关的下挂终端。In some embodiments, the processing module 702 is used to determine the long connection between the gateway and the Andlink networking plug-in of the gateway based on the mac address of the gateway; send a first query request to the Andlink networking plug-in through the long connection; receive a first query response sent by the Andlink networking plug-in; wherein the first query response includes identification information indicating a downstream terminal that has a parent-child relationship with the gateway; parse the first query response to determine the downstream terminal of the gateway.

在一些实施例中,处理模块702,用于基于所述组网终端的mac地址,向所述组网终端发送第二查询请求;接收所述组网终端发送的第二查询响应;其中,所述第二查询响应包括指示与所述组网终端具备父子关系的下挂终端的标识信息;解析所述第二查询响应,确定所述组网终端的下挂终端。In some embodiments, the processing module 702 is used to send a second query request to the networking terminal based on the MAC address of the networking terminal; receive a second query response sent by the networking terminal; wherein the second query response includes identification information indicating a downstream terminal that has a parent-child relationship with the networking terminal; and parse the second query response to determine the downstream terminal of the networking terminal.

在一些实施例中,处理模块702,用于基于所述组网终端的mac地址,向所述网关的Andlink组网插件发送第二查询请求,以使所述Andlink组网插件转发所述第二查询请求至向所述组网终端;所述接收所述组网终端发送的第二查询响应,包括:接收所述Andlink组网插件转发的所述组网终端的所述第二查询响应。In some embodiments, the processing module 702 is used to send a second query request to the Andlink networking plug-in of the gateway based on the mac address of the networking terminal, so that the Andlink networking plug-in forwards the second query request to the networking terminal; the receiving of the second query response sent by the networking terminal includes: receiving the second query response of the networking terminal forwarded by the Andlink networking plug-in.

基于上述网络拓扑构建中各单元的硬件实现,本申请实施例还提供了一种网络拓扑构建设备80,如图8所示,该网络拓扑构建设备包括:处理器801和配置为存储能够在处理器上运行的计算机程序的存储器802;其中,处理器801配置为运行计算机程序时,执行前述实施例中的方法步骤。Based on the hardware implementation of each unit in the above-mentioned network topology construction, an embodiment of the present application also provides a network topology construction device 80, as shown in Figure 8, the network topology construction device includes: a processor 801 and a memory 802 configured to store a computer program that can be run on the processor; wherein the processor 801 is configured to execute the method steps in the above-mentioned embodiment when running the computer program.

当然,实际应用时,如图8所示,该网络拓扑构建设备中的各个组件通过总线系统803耦合在一起。可理解,总线系统803用于实现这些组件之间的连接通讯。总线系统803除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图8中将各种总线都标为总线系统803。Of course, in actual application, as shown in FIG8 , each component in the network topology construction device is coupled together through a bus system 803. It is understandable that the bus system 803 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 803 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus system 803 in FIG8 .

在实际应用中,上述处理器可以为特定用途集成电路(ASIC,ApplicationSpecific Integrated Circuit)、数字信号处理装置(DSPD,Digital Signal ProcessingDevice)、可编程逻辑装置(PLD,Programmable Logic Device)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的设备,用于实现上述处理器功能的电子器件还可以为其它,本申请实施例不作具体限定。In practical applications, the processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a controller, a microcontroller, and a microprocessor. It is understandable that for different devices, the electronic device used to implement the functions of the processor may also be other, and the embodiments of the present application do not specifically limit this.

上述存储器可以是易失性存储器(volatile memory),例如随机存取存储器(RAM,Random-Access Memory);或者非易失性存储器(non-volatile memory),例如只读存储器(ROM,Read-Only Memory),快闪存储器(flash memory),硬盘(HDD,Hard Disk Drive)或固态硬盘(SSD,Solid-State Drive);或者上述种类的存储器的组合,并向处理器提供指令和数据。The above-mentioned memory can be a volatile memory (volatile memory), such as a random access memory (RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor.

在示例性实施例中,本申请实施例还提供了一种计算机可读存储介质,例如包括计算机程序的存储器,计算机程序可由网络拓扑构建设备的处理器执行,以完成前述方法的步骤。In an exemplary embodiment, the embodiment of the present application further provides a computer-readable storage medium, such as a memory including a computer program, and the computer program can be executed by a processor of a network topology construction device to complete the steps of the aforementioned method.

应当理解,在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。本申请中表述“具有”、“可以具有”、“包括”和“包含”、或者“可以包括”和“可以包含”在本文中可以用于指示存在对应的特征(例如,诸如数值、功能、操作或组件等元素),但不排除附加特征的存在。It should be understood that the terms used in the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "said" and "the" used in the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and/or" used in this article refers to and includes any or all possible combinations of one or more associated listed items. The expressions "having", "may have", "include" and "include", or "may include" and "may include" in this application can be used to indicate the presence of corresponding features (e.g., elements such as numerical values, functions, operations or components), but do not exclude the presence of additional features.

应当理解,尽管在本申请可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开,不必用于描述特定的顺序或先后次序。例如,在不脱离本发明范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other and are not necessarily used to describe a specific order or sequence. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.

本申请实施例所记载的技术方案之间,在不冲突的情况下,可以任意组合。The technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.

在本申请所提供的几个实施例中,应该理解到,所揭露的方法、装置和设备,可以通过其它的方式实现。以上所描述的实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通讯连接可以是通过一些接口,设备或单元的间接耦合或通讯连接,可以是电性的、机械的或其它形式的。In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices and equipment can be implemented in other ways. The embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

另外,在本申请各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.

Claims (12)

1. A method for constructing a network topology, the method comprising:
acquiring a mac address of a gateway;
determining a down-hanging terminal having a parent-child relationship with the gateway based on the mac address of the gateway;
when the lower hanging terminal is determined to be a networking terminal, determining the lower hanging terminal having a parent-child relationship with the networking terminal based on the mac address of the networking terminal;
and constructing the network topology of the gateway by utilizing the parent-child relationship between the gateway and the terminal hung below the gateway and the parent-child relationship between the networking terminal and the terminal hung below the networking terminal.
2. The method of claim 1, further comprising:
acquiring a mac address of an ith layer of lower-hanging terminals;
inquiring a terminal information base to acquire the equipment information of the ith layer of the down-hanging terminal based on the mac address of the ith layer of the down-hanging terminal; the terminal information base comprises a mapping relation between a mac address and equipment information;
judging whether the i-th layer down-hanging terminal is a networking terminal or not based on the equipment information;
the ith layer of the lower hanging terminal is a networking terminal, and an (i + 1) th layer of lower hanging terminal having a parent-child relationship with the ith layer of the networking terminal is determined based on the mac address of the ith layer of the networking terminal;
and the i-th layer down-hanging terminal stops querying for the non-networking terminal.
3. The method of claim 2, wherein the device information comprises a device type;
the device type is used for indicating that the lower hanging terminal is a networking terminal or a non-networking terminal.
4. The method of claim 1, further comprising:
inquiring a terminal information base according to the mac address of the lower hanging terminal, and determining the equipment information of the lower hanging terminal;
and adding the mac address and the equipment information of the down-hanging terminal into the network topology.
5. The method according to claim 2 or 4, characterized in that the method further comprises:
when the off-hook terminal is registered in a network, acquiring registration information of the off-hook terminal; wherein, the registration information of the down-hanging terminal comprises: mac address and device information;
and establishing the terminal information base based on the registration information of the off-hook terminal.
6. The method of claim 2, further comprising:
determining that the terminal information base does not have the equipment information of the down-hanging terminal;
crawling the equipment information of the off-hook terminal from the Internet through a web crawler, or analyzing a message of the gateway to obtain the equipment information of the off-hook terminal;
and storing the equipment information of the down-hanging terminal to the terminal information base.
7. The method according to claim 1, wherein the determining, based on the mac address of the gateway, a drop terminal having a parent-child relationship with the gateway comprises:
determining a long connection between the Andlink networking plug-in of the gateway based on the mac address of the gateway;
sending a first query request to the Andlink networking plug-in through the long connection;
receiving a first query response sent by the Andlink networking plug-in; the first query response comprises identification information indicating a down-hanging terminal having a parent-child relationship with the gateway;
and analyzing the first query response and determining the down-hanging terminal of the gateway.
8. The method according to claim 1, wherein the determining, based on the mac address of the networking terminal, the down-hanging terminal having a parent-child relationship with the networking terminal comprises:
sending a second query request to the networking terminal based on the mac address of the networking terminal;
receiving a second query response sent by the networking terminal; the second query response comprises identification information indicating a down-hanging terminal having a parent-child relationship with the networking terminal;
and analyzing the second query response and determining the down-hanging terminal of the networking terminal.
9. The method according to claim 8, wherein the sending a second query request to the networking terminal based on the mac address of the networking terminal comprises:
sending a second query request to an Andlink networking plug-in of the gateway based on the mac address of the networking terminal, so that the Andlink networking plug-in forwards the second query request to the networking terminal;
the receiving of the second query response sent by the networking terminal includes: and receiving the second query response of the networking terminal forwarded by the Andlink networking plug-in.
10. An apparatus for network topology construction, the apparatus comprising:
the acquisition module is used for acquiring the mac address of the gateway;
the processing module is used for determining a lower-hanging terminal having a parent-child relationship with the gateway based on the mac address of the gateway;
the processing module is further configured to determine, when the drop terminal is determined to be a networking terminal, a drop terminal having a parent-child relationship with the networking terminal based on the mac address of the networking terminal;
the processing module is further configured to construct a network topology of the gateway by using a parent-child relationship between the gateway and the terminal hung below the gateway and a parent-child relationship between the networking terminal and the terminal hung below the networking terminal.
11. A network topology construction device, characterized in that the device comprises: a processor and a memory configured to store a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of the method of any one of claims 1-9 when executing the computer program.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 9.
CN202111123184.7A 2021-09-24 2021-09-24 A network topology construction method, device, equipment and storage medium Pending CN115866619A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111123184.7A CN115866619A (en) 2021-09-24 2021-09-24 A network topology construction method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111123184.7A CN115866619A (en) 2021-09-24 2021-09-24 A network topology construction method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115866619A true CN115866619A (en) 2023-03-28

Family

ID=85653168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111123184.7A Pending CN115866619A (en) 2021-09-24 2021-09-24 A network topology construction method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115866619A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116827801A (en) * 2023-08-25 2023-09-29 武汉吧哒科技股份有限公司 Network topology construction method, device, computer equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020154606A1 (en) * 2001-02-19 2002-10-24 Duncan Robert James Network management apparatus and method for determining the topology of a network
US7366113B1 (en) * 2002-12-27 2008-04-29 At & T Corp. Adaptive topology discovery in communication networks
CN106464565A (en) * 2014-06-02 2017-02-22 雅马哈株式会社 Relay device, program, and display control method
CN112019367A (en) * 2019-05-31 2020-12-01 浙江宇视科技有限公司 Network topology generation method, device, device and storage medium
CN112039693A (en) * 2020-08-17 2020-12-04 烽火通信科技股份有限公司 System and method for managing home networking network topology

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020154606A1 (en) * 2001-02-19 2002-10-24 Duncan Robert James Network management apparatus and method for determining the topology of a network
US7366113B1 (en) * 2002-12-27 2008-04-29 At & T Corp. Adaptive topology discovery in communication networks
CN106464565A (en) * 2014-06-02 2017-02-22 雅马哈株式会社 Relay device, program, and display control method
CN112019367A (en) * 2019-05-31 2020-12-01 浙江宇视科技有限公司 Network topology generation method, device, device and storage medium
CN112039693A (en) * 2020-08-17 2020-12-04 烽火通信科技股份有限公司 System and method for managing home networking network topology

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116827801A (en) * 2023-08-25 2023-09-29 武汉吧哒科技股份有限公司 Network topology construction method, device, computer equipment and readable storage medium
CN116827801B (en) * 2023-08-25 2023-12-15 武汉吧哒科技股份有限公司 Network topology construction method, device, computer equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN103312573B (en) A kind of domestic network system equipment finds and recognition methods
CN107948339B (en) A network addressing method, device and device
WO2014056344A1 (en) Method and device for monitoring
WO2019128273A1 (en) Method, device and system for determining connection relation of network devices
CN115866619A (en) A network topology construction method, device, equipment and storage medium
CN111786832B (en) A method and device for interconnecting an attack-defense platform with a variety of industrial control scenarios
CN116032674B (en) Information processing method, device, gateway equipment, control system and storage medium
CN104539576B (en) Communication means and system based on IPv6 networks
CN105493465B (en) Method, device and non-transitory medium of XMPP-based UPnP device architecture for cloud computing in network environment
CN107534598A (en) Method, device and system for media service agency
CN105827423A (en) Data acquisition method and data acquisition device
CN112468367A (en) Data acquisition and interaction method, system, equipment and medium
CN113838463A (en) Information transmission method, device, electronic device and storage medium
CN118740535A (en) Smart home information interaction method, system, electronic device and storage medium
CN111781848A (en) Server connection method, device and system based on intelligent household equipment
CN114048017B (en) Internet of things equipment cooperative linkage method and device
TW201006191A (en) UPnP/DLNA device support apparatus, system, and method
CN116962116A (en) Network linkage methods, devices, equipment and storage media
Zhenhua Design and implementation of intelligent gateway for smart home
CN116418646A (en) Method, apparatus, device and computer readable storage medium for transmitting data
CN102571861B (en) Remote access method, server and network system
CN114401429A (en) Remote screen projection method and electronic equipment
CN119109976B (en) FTTR-based downlink equipment control method and device, equipment and medium
CN105634810A (en) Method, system and accessing device for accessing universal plug-and-play device
CN116506296B (en) Equipment data management method based on network access address identification and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination