CN102185706B - Method for generating IEEE1394 (Institute of Electrical and Electronics Engineers 1394) network topological graph - Google Patents
Method for generating IEEE1394 (Institute of Electrical and Electronics Engineers 1394) network topological graph Download PDFInfo
- Publication number
- CN102185706B CN102185706B CN 201110092697 CN201110092697A CN102185706B CN 102185706 B CN102185706 B CN 102185706B CN 201110092697 CN201110092697 CN 201110092697 CN 201110092697 A CN201110092697 A CN 201110092697A CN 102185706 B CN102185706 B CN 102185706B
- Authority
- CN
- China
- Prior art keywords
- node
- connection relationship
- nodes
- port
- physical
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 230000003068 static effect Effects 0.000 claims abstract description 40
- 238000010586 diagram Methods 0.000 claims abstract description 24
- 230000001174 ascending effect Effects 0.000 claims abstract description 13
- 238000009826 distribution Methods 0.000 abstract description 4
- 230000006870 function Effects 0.000 description 2
- 230000015556 catabolic process Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000009827 uniform distribution Methods 0.000 description 1
Images
Landscapes
- Small-Scale Networks (AREA)
Abstract
本发明公开了一种IEEE1394网络拓扑图的生成方法,包括:获取网络中各个节点物理标识和端口状态信息,按照物理标识的升序,根据节点的端口状态信息依次判断各个节点的连接关系;获取各个节点的静态唯一标识;根据各个节点的连接关系和静态唯一标识,生成节点间连接关系的数据结构并保存;根据节点间连接关系的数据结构生成网络拓扑图。由于能够自动生成网络拓扑图,使得管理员能够根据拓扑图对网络连接情况有直观的认识,从而能方便掌握网络中各节点的连接状态和相对位置。另外,由于根据节点的连接关系自动生成拓扑图,当节点之间的连接状态改变时,也能够实时更新拓扑图,使管理员能够及时获得最新的网络分布信息。
The invention discloses a method for generating an IEEE1394 network topology map, comprising: obtaining the physical identification and port status information of each node in the network, judging the connection relationship of each node in turn according to the port status information of the nodes in the ascending order of the physical identification; obtaining each Static unique identification of nodes; according to the connection relationship and static unique identification of each node, generate and save the data structure of the connection relationship between nodes; generate a network topology diagram according to the data structure of the connection relationship between nodes. Since the network topology map can be automatically generated, the administrator can have an intuitive understanding of the network connection situation according to the topology map, so that it is convenient to grasp the connection status and relative position of each node in the network. In addition, because the topology map is automatically generated according to the connection relationship of nodes, when the connection status between nodes changes, the topology map can also be updated in real time, so that administrators can obtain the latest network distribution information in time.
Description
技术领域 technical field
本发明涉及网络通信技术领域,尤其涉及一种IEEE1394网络拓扑图的生成方法。The invention relates to the technical field of network communication, in particular to a method for generating an IEEE1394 network topology diagram.
背景技术 Background technique
通过分析网络拓扑图,管理员可以了解IEE E1394网络中各个节点的连接状态和相对位置。并在有节点发生故障时,通过拓扑图的显示实现错误定位,进而对网络布局进行调整。By analyzing the network topology map, the administrator can understand the connection status and relative position of each node in the IEEE E1394 network. And when a node fails, the error location is realized through the display of the topology map, and then the network layout is adjusted.
但现有技术中,还没有自动生成IEEE1394网络拓扑图的实现方案。如果没有网络拓扑图,则无法直观了解网络中节点的连接状态及错误信息,需要通过读取节点信息获取所需的信息,这样抢占了业务信息的带宽资源,影响网络性能。如果由管理员手动绘制拓扑图,不仅增加了人力成本,且无法保证根据网络结构变化实时更新拓扑图。However, in the prior art, there is no implementation scheme for automatically generating IEEE1394 network topology diagrams. If there is no network topology map, it is impossible to intuitively understand the connection status and error information of nodes in the network. It is necessary to obtain the required information by reading node information, which preempts the bandwidth resources of business information and affects network performance. If the administrator draws the topology map manually, it not only increases the labor cost, but also cannot ensure that the topology map is updated in real time according to the change of the network structure.
发明内容 Contents of the invention
本发明的目的是提供一种IEEE1394网络拓扑图的生成方法,从而避免网络性能下降。The purpose of the present invention is to provide a method for generating IEEE1394 network topology graph, so as to avoid network performance degradation.
本发明的目的是通过以下技术方案实现的:The purpose of the present invention is achieved through the following technical solutions:
一种IEEE1394网络拓扑图的生成方法,包括:A method for generating an IEEE1394 network topology diagram, comprising:
获取IEEE1394网络中各个节点物理标识和端口状态信息,并按照物理标识的升序,根据节点的端口状态信息依次判断各个节点的连接关系;Obtain the physical identification and port status information of each node in the IEEE1394 network, and judge the connection relationship of each node according to the port status information of the node in ascending order of the physical identification;
获取各个节点的静态唯一标识;Obtain the static unique identifier of each node;
根据所述各个节点的连接关系和所述各个节点的静态唯一标识,生成节点间连接关系的数据结构并保存;According to the connection relationship of each node and the static unique identifier of each node, generate and save the data structure of the connection relationship between nodes;
根据所述节点间连接关系的数据结构生成网络拓扑图。A network topology diagram is generated according to the data structure of the connection relationship among the nodes.
由上述本发明提供的技术方案可以看出,本发明实施例提供的一种IEEE1394网络拓扑图的生成方法,由于能够自动生成网络拓扑图,使得管理员能够根据拓扑图对网络连接情况有直观的认识,从而能方便掌握网络中各节点的连接状态和相对位置,并在节点发生故障时,快速准确定位错误。另外,由于根据节点的连接关系自动生成拓扑图,当节点之间的连接状态改变时,也能够实时更新拓扑图,使管理员能够及时获得最新的网络分布信息。It can be seen from the above-mentioned technical solution provided by the present invention that the method for generating an IEEE1394 network topology diagram provided by the embodiment of the present invention can automatically generate a network topology diagram, so that the administrator can have an intuitive understanding of the network connection situation according to the topology diagram. Therefore, it is easy to grasp the connection status and relative position of each node in the network, and when a node fails, it can quickly and accurately locate the error. In addition, because the topology map is automatically generated according to the connection relationship of nodes, when the connection status between nodes changes, the topology map can also be updated in real time, so that administrators can obtain the latest network distribution information in time.
附图说明 Description of drawings
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings on the premise of not paying creative efforts.
图1为本发明实施例提供的方法流程图;Fig. 1 is the flow chart of the method provided by the embodiment of the present invention;
图2为本发明实施例提供的确定节点连接关系的方法流程图;FIG. 2 is a flowchart of a method for determining node connection relationships provided by an embodiment of the present invention;
图3为本发明应用实施例提供的初始拓扑示意图;FIG. 3 is a schematic diagram of an initial topology provided by an application embodiment of the present invention;
图4为本发明应用实施例提供的未连接四号节点的拓扑示意图;FIG. 4 is a schematic topology diagram of an unconnected No. 4 node provided by an application embodiment of the present invention;
图5为本发明应用实施例提供的重新接入四号节点的拓扑示意图。FIG. 5 is a schematic topology diagram of reconnecting to node No. 4 provided by an application embodiment of the present invention.
具体实施方式 Detailed ways
下面结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明的保护范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
下面将结合附图对本发明实施例作进一步地详细描述。Embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings.
本发明实施例一种IEEE1394网络拓扑图的生成方法,该方法实现方式如图1所示,具体包括如下操作:An embodiment of the present invention generates a method for an IEEE1394 network topology map. The implementation of the method is as shown in Figure 1, and specifically includes the following operations:
S101、获取IEEE1394网络中各个节点的物理标识和端口状态信息,并按照物理标识的升序,根据节点的端口状态信息依次判断各个节点的连接关系;S101. Obtain the physical identification and port status information of each node in the IEEE1394 network, and determine the connection relationship of each node in sequence according to the port status information of the node in ascending order of the physical identification;
其中,节点的物理标识和端口状态信息可以从各个节点的自标识包中获取,节点的端口状态包括:子端口、父端口、没有连接的端口、没有实现的端口,端口状态信息可以但不仅限于用布尔函数值表示。Among them, the physical identification and port status information of the node can be obtained from the self-identification package of each node. The port status of the node includes: child port, parent port, unconnected port, and unrealized port. The port status information can be but not limited to Represented by a Boolean function value.
S102、获取各个节点的静态唯一标识;S102. Obtain the static unique identifier of each node;
其中,节点的节点的静态唯一标识用来将该节点与其他节点区分开来,节点的静态唯一标识可以是GUID(Globally Unique Identifier,全球唯一标识符),也可以是其他能够标识节点的编号或编码。Among them, the static unique identifier of the node is used to distinguish the node from other nodes. The static unique identifier of the node can be a GUID (Globally Unique Identifier, globally unique identifier), or other numbers that can identify the node or coding.
S103、根据所述各个节点的连接关系和所述各个节点的静态唯一标识,生成节点间连接关系的数据结构;S103. According to the connection relationship of each node and the static unique identifier of each node, generate a data structure of the connection relationship between nodes;
其中,节点间连接关系的数据结构用来描述父节点与子节点之间的连接关系(即端口对应关系)。该连接关系的数据结构可以按照父-子节点的形式保存,相应的,保存的连接关系的数据结构中包括:节点的静态唯一标识、该节点各个端口指向的节点的静态唯一标识。Wherein, the data structure of the connection relationship between nodes is used to describe the connection relationship between the parent node and the child node (ie, port correspondence). The data structure of the connection relationship can be saved in the form of parent-child nodes. Correspondingly, the saved data structure of the connection relationship includes: the static unique identifier of the node, and the static unique identifier of the node pointed to by each port of the node.
S104、根据所述节点间连接关系的数据结构生成网络拓扑图。S104. Generate a network topology diagram according to the data structure of the connection relationship between the nodes.
上述处理过程可以由总线管理器执行,总线管理器是指安装有上述处理功能软件的设备,既可以是网络中的某个节点,也可以是网络中专用的控制设备。The above processing process can be executed by the bus manager, and the bus manager refers to the device installed with the above processing function software, which can be a certain node in the network or a dedicated control device in the network.
本发明实施例提供的方法,由于能够自动推导出网络中各个节点之间的连接关系,进而根据连接关系自动生成网络拓扑图,使得管理员能够根据拓扑图对网络连接情况有直观的认识,从而能方便掌握网络中各节点的连接状态和相对位置,并在节点发生故障时,快速准确定位错误。另外,由于根据节点的连接关系自动生成拓扑图,当节点之间的连接状态改变时,也能够实时更新拓扑图,使管理员能够及时获得最新的网络分布信息。The method provided by the embodiment of the present invention can automatically deduce the connection relationship between each node in the network, and then automatically generate a network topology diagram according to the connection relationship, so that the administrator can have an intuitive understanding of the network connection situation according to the topology diagram, thereby It can easily grasp the connection status and relative position of each node in the network, and quickly and accurately locate the error when a node fails. In addition, because the topology map is automatically generated according to the connection relationship of nodes, when the connection status between nodes changes, the topology map can also be updated in real time, so that administrators can obtain the latest network distribution information in time.
上述处理过程中的步骤S101的具体实现方式如图2所示,包括如下操作:The specific implementation of step S101 in the above processing process is shown in Figure 2, including the following operations:
S201、获取物理标识最小节点的物理标识和端口状态信息,将该物理标识最小的节点作为当前节点执行S202;S201. Obtain the physical identifier and port status information of the node with the smallest physical identifier, and use the node with the smallest physical identifier as the current node to execute S202;
可选的,在获取当前节点的物理标识和端口状态信息后,还缓存当前节点的物理标识和端口状态信息。Optionally, after obtaining the physical identifier and port status information of the current node, the physical identifier and port status information of the current node are also cached.
S202、根据当前节点的端口状态信息,判断当前节点是否有子端口,如果没有子端口,执行S203;如果有子端口,执行S204;S202. According to the port status information of the current node, determine whether the current node has a sub-port, if there is no sub-port, execute S203; if there is a sub-port, execute S204;
根据IEEE1394网络中物理标识的分配规则可知,物理标识最小的节点为叶子节点,叶子节点没有子端口。According to the distribution rules of physical identifiers in the IEEE1394 network, the node with the smallest physical identifier is a leaf node, and the leaf node has no sub-ports.
S203、在预先指定的匹配数据区中保存当前节点的物理标识,并按照物理标识升序获取下一个节点的物理标识和端口状态信息,将该下一个节点作为当前节点返回S202;S203. Save the physical identifier of the current node in the pre-designated matching data area, and obtain the physical identifier and port status information of the next node in ascending order of the physical identifier, and return the next node to S202 as the current node;
可选的,在保存当前节点的物理标识的同时,还可以保存当前节点的端口状态信息;Optionally, while saving the physical identifier of the current node, the port status information of the current node can also be saved;
其中,具体可以在匹配数据区以栈的形式保存当前节点的物理标识,即将当前节点入栈。Specifically, the physical identifier of the current node may be saved in the form of a stack in the matching data area, that is, the current node may be pushed into the stack.
S204、从上述匹配数据区保存的节点中读取一个匹配数据区中当前物理标识最大的节点(称为匹配节点),执行S205;S204. Read a node (called a matching node) with the largest current physical identifier in the matching data area from the nodes saved in the matching data area, and execute S205;
其中,如果匹配数据区中仅保存节点的物理标识,则进而根据物理标识获取匹配节点的端口状态信息,可以从缓存中获取,也可以从总线中读取匹配节点的自标识包获取。如果以栈的形式保存节点,则从栈中压出一个节点。Wherein, if only the physical identification of the node is stored in the matching data area, then the port state information of the matching node can be obtained according to the physical identification, which can be obtained from the cache, or can be obtained by reading the self-identification packet of the matching node from the bus. If the node is saved in the form of a stack, a node is pushed from the stack.
S205、得到当前节点与S204中匹配节点的连接关系,执行S206;S205. Obtain the connection relationship between the current node and the matching node in S204, and execute S206;
其中,根据IEEE1394网络中拓扑生成原理可知,当前节点的未匹配子端口中编号最大的子端口与匹配节点的父端口连接,因此,上述当前节点与S204中匹配节点的连接关系具体是指:当前节点中未匹配且编号最大的子端口与该匹配节点的父端口之间的连接关系。Among them, according to the principle of topology generation in the IEEE1394 network, the subport with the largest number among the unmatched subports of the current node is connected to the parent port of the matching node. Therefore, the above-mentioned connection relationship between the current node and the matching node in S204 specifically refers to: the current The connection relationship between the unmatched and highest-numbered child port in the node and the parent port of the matched node.
S206、判断当前节点是否还有未匹配(未匹配指没有确定连接关系)的子端口,如果有,返回执行S204,否则,执行S207;S206, judging whether the current node still has unmatched sub-ports (unmatched refers to no determined connection relationship), if there is, return to execute S204, otherwise, execute S207;
S207、判断当前节点是否有父端口,如果有,则执行S208,如果没有,则表明该节点是根节点,流程结束,完成获取各个节点的连接关系;S207. Determine whether the current node has a parent port. If so, execute S208. If not, it indicates that the node is the root node. The process ends, and the connection relationship of each node is obtained;
S208、在上述预先指定的匹配数据区中保存当前节点的物理标识,并按照物理标识升序获取下一个节点的物理标识和端口状态信息,将该下一个节点作为当前节点返回S202。S208. Store the physical identifier of the current node in the pre-specified matching data area, and acquire the physical identifier and port status information of the next node in ascending order of physical identifiers, and return the next node to S202 as the current node.
通过图2所示的处理过程,即可获知当前总线配置下各个节点之间的连接关系。Through the process shown in FIG. 2 , the connection relationship between the nodes under the current bus configuration can be known.
针对上述处理过程中的步骤S102的具体实现方式,说明如下:For the specific implementation of step S102 in the above process, the description is as follows:
本发明实施例中,可以但不仅限于通过以下两种方式获取节点的静态唯一标识。In the embodiment of the present invention, the static unique identifier of the node can be obtained, but not limited to, in the following two ways.
一种方式是在每次绘制拓扑图的过程中,均从节点的ROM(Read-Only Memory,只读存储器)中读取节点的静态唯一标识。One way is to read the static unique identifier of the node from the ROM (Read-Only Memory, read-only memory) of the node in the process of drawing the topology map each time.
另一种方式是,在确定了节点各个子端口的连接关系后,判断本地是否有保存的节点间连接关系的数据结构历史信息,如果有,则将本次获取的连接关系与保存的连接关系的数据结构中的连接关系比较,获得节点的静态唯一标识;如果没有,则从节点的ROM中获取静态唯一标识。在IEEE1394网络中,当给某个节点加电、断电,或者向总线加入或者移出一个节点时,网络需要复位并重新配置。发生重置时,各节点返回初始状态,且当前的拓扑信息被清除。本发明实施例提供的方法,在初次进行总线配置后,通过读取各个节点的ROM获取各个节点的GUID。如果采用编号或者编码作为节点的静态唯一标识,在读取节点的GUID后,可以为该节点分配唯一的编码或编号。当总线重置后,总线管理器可以通过本地保存的连接关系的数据结构历史信息获取相应节点的标识信息。如果总线重置后,有新的节点加入总线,则总线管理器从新的节点ROM中读取GUID,还可以为该节点进行编码或编号。可见,当总线重置后,由于可以在本地获取保存的节点静态唯一标识,不需要频繁读取各节点的ROM,因此减少了对总线带宽的占用。Another way is, after determining the connection relationship of each sub-port of the node, judge whether there is locally saved data structure history information of the connection relationship between nodes, and if so, compare the connection relationship obtained this time with the connection relationship saved The connection relationship in the data structure of the node is compared to obtain the static unique identifier of the node; if not, the static unique identifier is obtained from the ROM of the node. In an IEEE1394 network, when a node is powered on or off, or a node is added to or removed from the bus, the network needs to be reset and reconfigured. When a reset occurs, each node returns to its initial state, and the current topology information is cleared. In the method provided by the embodiment of the present invention, after the initial bus configuration, the GUID of each node is obtained by reading the ROM of each node. If the number or code is used as the static unique identifier of the node, after reading the GUID of the node, a unique code or number can be assigned to the node. After the bus is reset, the bus manager can obtain the identification information of the corresponding node through the historical information of the data structure of the connection relationship saved locally. If after the bus is reset, a new node joins the bus, the bus manager reads the GUID from the ROM of the new node, and can also encode or number the node. It can be seen that after the bus is reset, since the saved static unique identifier of the node can be obtained locally, the ROM of each node does not need to be frequently read, thus reducing the bus bandwidth occupation.
针对上述处理过程中步骤S104的具体实现方式,说明如下:For the specific implementation of step S104 in the above process, the description is as follows:
总线管理器根据得到的节点间连接关系的数据结构绘制拓扑图,具体可通过现有的绘图技术实现。作为举例而非限定:The bus manager draws the topology diagram according to the obtained data structure of the connection relationship between the nodes, which can be specifically realized through the existing drawing technology. By way of example and not limitation:
一种生成拓扑图的方式为:One way to generate a topology map is:
总线配置完成后,根据物理层上电的节点注册信息获取网络中的节点个数N;After the bus configuration is completed, obtain the number N of nodes in the network according to the node registration information powered on at the physical layer;
显示画面中均匀显示出代表N个节点的图形,其中,可以调用预先生成的用来表示节点的图形,也可以在显示画面上绘制节点的图形,N个节点可以呈矩形均匀分布,也可以呈圆形或其它几何图形均匀分布;The graphics representing N nodes are evenly displayed on the display screen. Among them, the pre-generated graphics used to represent the nodes can be called, or the graphics of the nodes can be drawn on the display screen. The N nodes can be evenly distributed in a rectangular shape, or can be Uniform distribution of circles or other geometric figures;
例如,在显示画面中的左上角按照顺时针,以节点物理标识的升序或降序,均匀分布各节点;或者,在显示画面中的右下角按照逆时针,以节点物理标识的升序或降序,均匀分布各节点。其具体实现方式可通过现有算法实现。For example, in the upper left corner of the display screen, the nodes are evenly distributed in the ascending or descending order of the physical IDs of the nodes clockwise; or, in the lower right corner of the display screen, the nodes are evenly distributed in the ascending or descending order of the physical IDs of the nodes distribute the nodes. Its specific implementation method can be realized through existing algorithms.
当通过上述处理过程获知节点间的拓扑结构后,调用预先生成的表示连接关系的线段,显示节点间的连接关系;并在相应的节点图形上标识出端口号、节点的标识信息及节点的物理标识。After the topological structure between the nodes is known through the above process, the pre-generated line segment representing the connection relationship is called to display the connection relationship between the nodes; and the port number, node identification information and node physical information are marked on the corresponding node graph. logo.
如果在显示画面中以矩形均匀分布,绘制N个节点的图形,其具体实现方式可以但不仅限于是:If the graphics of N nodes are evenly distributed in rectangles on the display screen, the specific implementation methods can be but not limited to:
设节点个数为N,每个节点图形的长为a、高为h;Let the number of nodes be N, the length of each node graph be a, and the height be h;
那么,当N为偶数时,节点的物理标识i≤N/2时,NODEi的横坐标Xnodei=2(i+1)a/(N+1),纵坐标为Ynodei=2h/6;节点的物理标识i>N/2,NODEi的横坐标Xnodei=2(i+1)a/(N+1),纵坐标为Ynodei=5h/6;Then, when N is an even number and the physical identity of the node i≤N/2, the abscissa of NODEi is X node i=2(i+1)a/(N+1), and the ordinate is Y nodei =2h/6 ;The physical identifier of the node i>N/2, the abscissa of NODEi X nodei =2(i+1)a/(N+1), the ordinate is Y nodei =5h/6;
当N为奇数时,节点的物理标识i≤N+1/2时,NODEi的横坐标Xnodei=2(i+1)a/(N+2),纵坐标为Ynodei=2h/6;当节点的物理标识i>N+1/2,NODEi的横坐标Xnodei=2(i+1)a/(N+2),纵坐标为Ynodei=5h/6。When N is an odd number, when the physical identity of the node i≤N+1/2, the abscissa of NODEi X nodei =2(i+1)a/(N+2), and the ordinate is Y nodei =2h/6; When the physical identity of the node i>N+1/2, the abscissa of NODEi is X nodei =2(i+1)a/(N+2), and the ordinate is Y nodei =5h/6.
其中,坐标原点位于显示画面的左上角,具体位置可以根据实际情况设定。Wherein, the coordinate origin is located at the upper left corner of the display screen, and the specific position can be set according to the actual situation.
为了便于用户调用各个节点的信息,方便查看各个节点的状态,本发明实施例提供的方法还包括如下操作:In order to facilitate the user to call the information of each node and view the status of each node, the method provided by the embodiment of the present invention also includes the following operations:
分别获取所述各个节点的静态唯一标识与物理标识和端口状态信息之间的对应关系,并将所述对应关系以节点的数据结构的形式保存。The correspondence between the static unique identifiers of the nodes, the physical identifiers, and the port status information is obtained respectively, and the correspondence is stored in the form of a data structure of the nodes.
其中,节点的数据结构中的物理标识和端口状态信息可以但不仅限于在上述步骤S201中获取,节点的数据结构中的静态唯一标识可以但不仅限于在上述步骤S102中获取。Wherein, the physical identifier and port status information in the node data structure can be obtained in the above step S201, but the static unique identifier in the node data structure can be obtained in the above step S102, but not limited to.
这样,用户就可以通过调用保存的节点的数据结构,查看各个节点的状态及端口信息。减少了从总线中读取自标识包的次数,从而降低了对总线带宽的占用。另外,由于在总线重置前后,节点的静态唯一标识不变,但节点的物理标识及端口状态信息可能会改变,由于节点的数据结构体现了节点的静态唯一标识与物理标识和端口状态信息的对应关系,因此,在总线重置后,用户能够方便查看各个节点在总线重置前后物理标识、端口状态信息等连接关系的变化。In this way, the user can view the status and port information of each node by calling the saved node data structure. The number of times to read self-identification packets from the bus is reduced, thereby reducing the occupation of bus bandwidth. In addition, since before and after the bus reset, the static unique identifier of the node remains unchanged, but the physical identifier and port status information of the node may change. Therefore, after the bus is reset, the user can easily view the changes in the connection relationship of each node, such as physical identification and port status information, before and after the bus reset.
下面将结合具体的应用场景,对本发明实施例提供的方法进行详细描述。The method provided by the embodiment of the present invention will be described in detail below in combination with specific application scenarios.
在一个IEEE1394局域网中,有6台计算机(节点)连接到总线。每个计算机有三个端口。当总线配置完成后,即可应用本发明实施例提供的方法绘制网络拓扑图。其中,6个节点的静态唯一标识用编号表示,分别为一号~六号,且五号节点为总线管理器。则本应用实施例的具体实现方式包括如下操作:In an IEEE1394 LAN, there are 6 computers (nodes) connected to the bus. Each computer has three ports. After the bus configuration is completed, the method provided by the embodiment of the present invention can be used to draw the network topology diagram. Among them, the static unique identifiers of the six nodes are represented by numbers, which are No. 1 to No. 6 respectively, and the No. 5 node is the bus manager. Then the specific implementation of this application embodiment includes the following operations:
S301、总线管理器通过获取各个节点上报的注册信息,获得网络中的节点个数N(6个);S301. The bus manager acquires the number N (6) of nodes in the network by acquiring the registration information reported by each node;
S302、总线管理器显示画面中显示6个节点,作为举例而非限定,这六个节点以两行三列的排列方式呈矩形均匀分布在显示画面中;S302. The display screen of the bus manager displays 6 nodes. As an example and not limitation, the six nodes are evenly distributed in the display screen in a rectangular arrangement of two rows and three columns;
其中,总线管理器可以在显示画面中实时绘制节点,也可以通过调用表示节点的图形在显示画面中显示各个节点。Wherein, the bus manager can draw nodes in the display screen in real time, and can also display each node in the display screen by invoking graphics representing nodes.
S303、总线管理器获取物理标识最小节点的物理标识和端口状态信息,将该物理标识最小的节点作为当前节点执行S304;S303. The bus manager acquires the physical identifier and port status information of the node with the smallest physical identifier, and uses the node with the smallest physical identifier as the current node to execute S304;
S304、总线管理器根据当前节点的端口状态信息,判断当前节点是否有子端口,如果没有子端口,执行S305;如果有子端口,执行S306;S304, the bus manager judges whether the current node has a subport according to the port status information of the current node, if there is no subport, execute S305; if there is a subport, execute S306;
S305、总线管理器在预先指定的匹配数据区中将当前节点的物理标识入栈保存,并按照物理标识升序获取下一个节点的物理标识和端口状态信息,将该下一个节点作为当前节点返回S304;S305. The bus manager stores the physical identification of the current node in the pre-designated matching data area, and obtains the physical identification and port status information of the next node in ascending order according to the physical identification, and returns the next node as the current node to S304 ;
S306、总线管理器从上述栈中压出一个节点(称为匹配节点),执行S307;S306, the bus manager pushes out a node (called a matching node) from the stack, and executes S307;
S307、总线管理器获取当前节点未匹配的子端口中最大编号子端口,确定该最大编号子端口与上述匹配节点的父端口之间的连接关系,执行S308;S307. The bus manager obtains the subport with the highest number among the unmatched subports of the current node, determines the connection relationship between the subport with the highest number and the parent port of the matching node, and executes S308;
S308、总线管理器判断当前节点是否还有未匹配的子端口,如果有,返回执行S306,否则,执行S309;S308, the bus manager judges whether the current node has unmatched sub-ports, if so, returns to execute S306, otherwise, executes S309;
S309、总线管理器判断当前节点是否有父端口,如果有,则执行S310,如果没有,则表明该节点是根节点,执行S311;S309, the bus manager judges whether the current node has a parent port, if yes, executes S310, if not, then indicates that the node is a root node, executes S311;
S310、总线管理器在上述栈中压入当前节点,并按照物理标识升序获取下一个节点的物理标识和端口状态信息,将该下一个节点作为当前节点返回S304;S310. The bus manager pushes the current node into the stack, and obtains the physical identifier and port status information of the next node in ascending order according to the physical identifier, and returns the next node as the current node to S304;
S311、总线管理器判断本地是否有保存的节点间连接关系的数据结构历史信息,如果是,执行S312,否则,执行S313;S311. The bus manager judges whether there is historical data structure information of the connection relationship between nodes saved locally, if yes, execute S312, otherwise, execute S313;
S312、总线管理器将各个节点的连接关系与保存的连接关系数据结构中的连接关系进行比较,获取各个节点的静态唯一标识,执行S314;S312. The bus manager compares the connection relationship of each node with the connection relationship in the saved connection relationship data structure, obtains the static unique identifier of each node, and executes S314;
其中,在通过将本次生成的连接关系与保存的连接关系进行比较来获取节点的静态唯一标识过程中,可以从根节点开始按照物理标识的降序依次对各节点进行判断。则根节点的标识信息需要从ROM中读取。进而判断node5(根节点)的子端口在总线重置前后是否都有连接,如果是,则保存的连接关系数据结构中该子端口指向的节点的静态唯一标识即是本次确定的连接关系中该子端口指向的节点静态唯一标识(其依据是在IEEE1394网络中,发生总线重置的情况通常是节点加电、断电、有节点加入或退出,因此,如果总线重置前后某个节点与原子节点的物理连接关系不变);按照物理标识的降序依次通过该方式确定各个节点的静态唯一标识,如果通过判断无法确定某个节点的标识信息,则通过读取ROM信息获取。Wherein, in the process of obtaining the static unique identifier of the node by comparing the connection relationship generated this time with the saved connection relationship, each node can be judged in descending order of the physical identifier starting from the root node. Then the identification information of the root node needs to be read from the ROM. Then judge whether the subport of node5 (root node) is connected before and after the bus reset, if yes, the static unique identifier of the node pointed to by the subport in the saved connection relationship data structure is the connection relationship determined this time. The node pointed to by this sub-port is statically uniquely identified (the basis is that in IEEE1394 networks, when a bus reset occurs, the node is usually powered on, powered off, or a node joins or exits. Therefore, if a node before and after the bus reset is connected to The physical connection relationship of the atomic nodes remains unchanged); according to the descending order of the physical identification, the static unique identification of each node is determined in this way, if the identification information of a certain node cannot be determined through judgment, it is obtained by reading the ROM information.
S313、总线管理器从节点的ROM中读取静态唯一标识,执行S314;S313. The bus manager reads the static unique identifier from the ROM of the node, and executes S314;
S314、总线管理器根据上述获取的节点的物理标识、节点的端口状态信息及节点的静态唯一标识,生成并保存各个节点的数据结构,执行S315,该数据结构中包括节点的编号、节点的物理标识和节点的端口状态信息,作为举例而非限定,该数据结构的格式如表1所示S314, the bus manager generates and saves the data structure of each node according to the physical identification of the node obtained above, the port status information of the node and the static unique identification of the node, and executes S315. The port status information of the identifier and the node is used as an example without limitation, and the format of the data structure is shown in Table 1
表1Table 1
相应的,各节点的数据结构分别为:Correspondingly, the data structures of each node are:
其中,端口状态11表示该端口为子端口,端口状态10表示该端口为父端口,端口状态01表示该端口未连接。Wherein, the port status 11 indicates that the port is a sub-port, the port status 10 indicates that the port is a parent port, and the
S315、总线管理器根据上述各个节点的连接关系和标识信息,生成节点间连接关系的数据结构并保存,执行S316,节点间连接关系的数据结构如表2所示:S315, the bus manager generates and saves the data structure of the connection relationship between nodes according to the connection relationship and identification information of the above-mentioned various nodes, executes S316, and the data structure of the connection relationship between nodes is as shown in Table 2:
表2Table 2
S316、总线管理器根据表2显示的拓扑结构,在显示画面上绘制拓扑图,该拓扑图如图4所示。S316. The bus manager draws a topology diagram on the display screen according to the topology structure shown in Table 2, as shown in FIG. 4 .
当将四号节点断开与网络的连接,IEEE1394总线重新配置。总线重置完成后,可以按照上述的流程再次绘制拓扑图,其拓扑图如图4所示,相应的各个节点的数据结构如表3所示:When the fourth node is disconnected from the network, the IEEE1394 bus is reconfigured. After the bus reset is completed, the topology diagram can be drawn again according to the above process. The topology diagram is shown in Figure 4, and the data structure of each corresponding node is shown in Table 3:
表3table 3
相应的节点间连接关系的数据结构如表4所示:The data structure of the connection relationship between the corresponding nodes is shown in Table 4:
表4Table 4
当将四号节点再次接入总线后,IEEE1394总线重新配置。总线重置完成后,可以按照上述的流程再次绘制拓扑图,其拓扑图如图5所示,相应的各个节点的数据结构如表5所示:When the fourth node is connected to the bus again, the IEEE1394 bus is reconfigured. After the bus reset is completed, the topology diagram can be drawn again according to the above process. The topology diagram is shown in Figure 5, and the data structure of each corresponding node is shown in Table 5:
表5table 5
相应的节点间连接关系的数据结构如表6所示:The data structure of the corresponding connection relationship between nodes is shown in Table 6:
表6Table 6
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求书的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of changes or modifications within the technical scope disclosed in the present invention. Replacement should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201110092697 CN102185706B (en) | 2011-04-13 | 2011-04-13 | Method for generating IEEE1394 (Institute of Electrical and Electronics Engineers 1394) network topological graph |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201110092697 CN102185706B (en) | 2011-04-13 | 2011-04-13 | Method for generating IEEE1394 (Institute of Electrical and Electronics Engineers 1394) network topological graph |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102185706A CN102185706A (en) | 2011-09-14 |
CN102185706B true CN102185706B (en) | 2013-10-16 |
Family
ID=44571779
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201110092697 Expired - Fee Related CN102185706B (en) | 2011-04-13 | 2011-04-13 | Method for generating IEEE1394 (Institute of Electrical and Electronics Engineers 1394) network topological graph |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102185706B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103036692B (en) * | 2011-09-29 | 2016-12-07 | 中国移动通信集团江苏有限公司 | The method and device of network topology is generated for IT supporting network |
CN103176993B (en) * | 2011-12-21 | 2016-08-24 | 北京神州绿盟信息安全科技股份有限公司 | A kind of content presenting device and method |
CN102929684A (en) * | 2012-09-08 | 2013-02-13 | 佳都新太科技股份有限公司 | Implementation method for topology drawing of virtual machines |
CN104158747B (en) | 2013-05-14 | 2019-09-24 | 中兴通讯股份有限公司 | Method for discovering network topology and system |
CN104935482B (en) * | 2015-06-26 | 2018-08-24 | 曙光信息产业(北京)有限公司 | Distributed monitoring system and method |
CN108965139A (en) * | 2018-08-14 | 2018-12-07 | 烽火通信科技股份有限公司 | A kind of topological vectorgraph charting method and system of routing device |
CN110784362B (en) * | 2019-11-04 | 2021-06-22 | 中国南方电网有限责任公司超高压输电公司昆明局 | Method for precisely managing control protection system bus in direct current converter station |
CN112666926B (en) * | 2020-12-23 | 2024-03-26 | 深圳市道通科技股份有限公司 | Automobile bus topological graph generation method and device and computing equipment |
CN114205281B (en) * | 2021-11-30 | 2023-08-08 | 科大国创云网科技有限公司 | Metadata-driven end-to-end network topology dynamic generation system and method |
CN114615066A (en) * | 2022-03-17 | 2022-06-10 | 浙江网商银行股份有限公司 | Target path determination method and device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1747404A (en) * | 2005-10-14 | 2006-03-15 | 杭州华为三康技术有限公司 | Network topological graph updation and management |
CN102006193A (en) * | 2010-11-29 | 2011-04-06 | 深圳市新格林耐特通信技术有限公司 | Automatic layout method for network topology in SNMP (simple network management protocol) network management system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7526541B2 (en) * | 2003-07-29 | 2009-04-28 | Enterasys Networks, Inc. | System and method for dynamic network policy management |
-
2011
- 2011-04-13 CN CN 201110092697 patent/CN102185706B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1747404A (en) * | 2005-10-14 | 2006-03-15 | 杭州华为三康技术有限公司 | Network topological graph updation and management |
CN102006193A (en) * | 2010-11-29 | 2011-04-06 | 深圳市新格林耐特通信技术有限公司 | Automatic layout method for network topology in SNMP (simple network management protocol) network management system |
Also Published As
Publication number | Publication date |
---|---|
CN102185706A (en) | 2011-09-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102185706B (en) | Method for generating IEEE1394 (Institute of Electrical and Electronics Engineers 1394) network topological graph | |
CN107104824B (en) | Network topology determination method and device | |
CN111193605B (en) | Fault positioning method and device and storage medium | |
JP4653164B2 (en) | Network map generation method | |
CN110505152B (en) | Route filtering method and device and electronic equipment | |
CN112311571A (en) | Network topology generation method and device, electronic equipment and non-transient storage medium | |
CN105959430A (en) | Switcher MAC address aging method | |
CN105791073B (en) | A method and device for service deployment in a virtualized network | |
WO2021190503A1 (en) | Method and apparatus for generating network topology | |
US20140156820A1 (en) | Configuration information selection based on extracted information | |
CN103647754B (en) | The method for drafting and device of topological diagram in cloud computing | |
CN108399244B (en) | Graphical configuration management system and method for nuclear power plant risk monitoring technology | |
CN105591805A (en) | Method and device for modification of service chain configuration | |
CN113312560B (en) | Group detection method and device and electronic equipment | |
CN105429144A (en) | Information processing method and information processing device for emergency repairing of distribution network | |
CN105072660A (en) | A routing method for fire-fighting-oriented wireless sensor-actuator network | |
CN110851186A (en) | Network equipment restarting method and device, electronic equipment and readable storage medium | |
CN108768735B (en) | Bipartite graph sampling method and device for test bed topological structure | |
CN108521376A (en) | Flow Table Design Method Based on Attribute Similarity in Software Defined Networking | |
CN111885614B (en) | CORS base station networking method, device and storage medium | |
CN111600749B (en) | Method and system for managing multiple servers and computer storage medium | |
CN116016338A (en) | Data accurate transmission method and device based on multi-network port equipment and computer equipment | |
CN104994137B (en) | A kind of method of network readezvous point agency | |
CN110022219B (en) | A network cluster detection method, system, electronic device and storage medium | |
CN110958165B (en) | Network interface establishing and managing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20131016 Termination date: 20140413 |