CN111669286B - Topological graph tree layout generating method in network management system - Google Patents

Topological graph tree layout generating method in network management system Download PDF

Info

Publication number
CN111669286B
CN111669286B CN202010402416.1A CN202010402416A CN111669286B CN 111669286 B CN111669286 B CN 111669286B CN 202010402416 A CN202010402416 A CN 202010402416A CN 111669286 B CN111669286 B CN 111669286B
Authority
CN
China
Prior art keywords
node
layer
child
parent
node object
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.)
Active
Application number
CN202010402416.1A
Other languages
Chinese (zh)
Other versions
CN111669286A (en
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.)
3onedata Co ltd
Original Assignee
3onedata 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 3onedata Co ltd filed Critical 3onedata Co ltd
Priority to CN202010402416.1A priority Critical patent/CN111669286B/en
Publication of CN111669286A publication Critical patent/CN111669286A/en
Application granted granted Critical
Publication of CN111669286B publication Critical patent/CN111669286B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0213Standardised network management protocols, e.g. simple network management protocol [SNMP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/22Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks comprising specially adapted graphical user interfaces [GUI]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention is a topological graph tree layout generating method in a network management system, which firstly defines a topological data format returned to a front end by an application server, wherein the topological data format comprises a node object, a link relation and topological data, the node object comprises a node coordinate, the application server constructs the topological data, the relative position of each device can be calculated when the topological data is constructed, and the topology can be displayed only according to the relative position when the topology is displayed. When constructing topological data, acquiring device data and a link relation between devices, associating the devices to form a parent-child hierarchy through the link relation between the devices, sequencing the devices of each layer in the parent-child hierarchy, sequencing the devices in each sub-layer in sequence according to the sequence of the devices in the parent layer according to the link relation, determining the relative position of each device in a tree structure, and generating a topological graph tree layout structure of the devices.

Description

Topological graph tree layout generating method in network management system
Technical Field
The invention belongs to the technical field of network communication, and particularly relates to a topological graph tree layout generation method in a network management system.
Background
Nowadays, networks are more and more closely related to life and work of people, but along with popularization of the networks, the scale of the networks is gradually increased, the number of network devices is increased in a graded manner, and a network administrator is difficult to timely monitor the states of all the devices, discover and repair faults.
The topological graph shows the structural relationship of the network in a graphic mode, and the structure of the topological graph mainly comprises a star structure, a ring structure, a bus structure, a distributed structure, a tree structure, a mesh structure, a honeycomb structure and the like. In a network management system, a topology map is used to display a hierarchy and a link relationship between device management objects. Generally, a network management system generally includes a relational database system (RDBMS), an application server (AppServer), and a front-end interface (HTML 5). The topological graph is a core function module in a front-end interface (HTML 5) of the network management system.
The network manager needs to display the topology map, as shown in fig. 1, and generally includes 3 steps:
1. the front end requests the topology data from the application server;
2. the application server inquires data from the database, processes the data into content and format required by the front end and returns the content and format to the front end;
3. the front end converts the data into a topological image display.
For example, in chinese patent with patent number "CN103501249B" and name "a network management client topology management system and method", a network management client topology management system and method are disclosed, the topology management system includes a topology tree generation module for generating an added sub-topology tree when a master device is added to a network, adding the added sub-topology tree to a global topology tree, and generating a new global topology tree; the topology tree initialization module is used for acquiring user login information, receiving master equipment identity authentication information and slave equipment identity authentication information corresponding to the user login information returned by the server side according to the user login information, and reading a generated global topology tree; the topology tree display module is used for displaying a network topology graph and communication states of the master equipment and the slave equipment under the network topology graph in real time; the topology tree updating module is used for updating the network topology map in real time.
In the above patent, a description of displaying a network topology graph in real time by a topology tree display module is disclosed, but how to display the topology graph, and effects and purposes to be achieved are not further described, for the front end, it is relatively easy to construct the device data into topology primitives and construct the link relationship between devices into topology links by using the Canvas technology of HTML 5. However, the link relationship between network devices can only be clearly shown at which position on the screen each primitive should be placed, and for the prior art, it is quite difficult for the front end to show the layout if the server only passes the device data and the connection relationship to the front end. The placement position of each device is often difficult to determine, and only random display is available, and the devices cannot be positioned and sorted.
Disclosure of Invention
In order to solve the above problems, a primary object of the present invention is to provide a method for generating a topology tree layout in a network management system, where the method defines a format of topology data of a device node returned by an application server, determines a relative position of each device in a topology, and displays the relative position on a client interface, so as to facilitate understanding of position information and link relationships between devices.
Another objective of the present invention is to provide a method for generating a topology tree layout in a network management system, where the method displays the relative positions of devices in a topology, so that the child devices in each layer sequentially sequence the devices in each layer according to the parent devices, thereby facilitating the connection of the devices in the topology and avoiding the occurrence of line crossing.
Another object of the present invention is to provide a method for generating a topology tree layout in a network management system, which processes device information and constructs and displays topology data on the basis of acquiring basic device information and link relationships between devices (the link relationships include information of a local device, a local port, an opposite device, an opposite port, etc.) through SNMP.
In order to achieve the above object, the technical solution of the present invention is as follows.
A topological graph tree layout generating method in a network management system is characterized in that the method firstly defines the format of topological data returned to a front end by an application server, the topological data comprises a node object set and a link relation set, the node object set comprises node objects with node coordinates, when the application server constructs the topological data, the relative position of each device can be calculated when the topological data is constructed, and only the display is carried out according to the relative position when the topology is displayed.
When constructing topological data, acquiring device data and a link relation between devices, associating the devices to form a parent-child hierarchy through the link relation between the devices, sequencing the devices of each layer in the parent-child hierarchy, sequencing the devices in each sub-layer in sequence according to the sequence of the devices in the parent layer according to the link relation, determining the relative position of each device in a tree structure, and generating a topological graph tree layout structure of the devices. Determining parent-child layers among the devices through the connection relation among the devices to form a tree structure of child node devices corresponding to the root node device, sequencing each layer of devices in each layer according to the parent-child layers and the tree structure, sequencing the devices of each sub-layer according to the link relation of the parent-child layer devices to form a sub-layer device set of one section in each sub-layer, sequencing each section of sub-layer device corresponding to one parent layer device according to the sequence of the parent layer devices, sequentially determining the sequencing of each layer of devices, forming a topological graph tree layout structure of the sequencing result, displaying the topological graph tree layout structure in a front-end interface, conveniently knowing and controlling the installation position and the connection relation of each device, and simultaneously, between the sequenced devices, avoiding the phenomenon of line crossing between the parent layer devices and the sub-layer devices when the connection is established, and sequentially comparing the connection.
Further, the specific steps of associating the devices to form a parent-child hierarchy are as follows:
s1: defining a node object of the equipment, wherein the node object comprises a node ID, a node IP, an equipment ID, a node row coordinate, a node column coordinate, a father node ID and a child node object set;
s2: determining a father node ID and a child node object set of a node object corresponding to each device according to the link relation between the devices, wherein the father node ID of a root node object is null, and the node ID of the node object is the father node ID of the child node of the node object;
s3: and after the parent-child hierarchy is determined, the number of the node objects on each layer is more than one, and each node object corresponds to more than one child node object.
In this way, the link relationship between the nodes corresponding to each device is determined according to the link relationship between the devices, and the parent node ID and the child node set in each node object are determined according to the link relationship between the nodes, so that the parent-child hierarchy of each node device is determined.
Further, the node objects corresponding to each layer of equipment are sorted in the following specific manner:
s21: determining a root node object, wherein the root node object is a node object with the minimum node IP value;
s22: determining more than one child node object of the root node object according to the root node object and the parent-child hierarchy among the nodes, and sequencing the child node objects;
s22: traversing the sequenced child node objects, taking the child node objects as parent node objects according to parent-child hierarchies, and acquiring the child node object of each parent node object;
s23: sequencing more than one child node object of each parent node object into a corresponding sub-layer of the parent layer in sequence according to the parent-child layer and the sequence of the parent node objects in the parent layer;
s24: repeating the steps S22-S23 for each sequenced child node object, and sequentially sequencing the child node objects of each child node object until all child node objects are completely sequenced;
s25: after all child node objects are subjected to traversal sequencing, sequencing of each layer of node objects is contained in the parent-child layer.
In the above step, according to the parent-child hierarchy, the root node object is determined, the child node object is determined by the root node object, the child node object of each child node object is determined by the child node object, and each child node object is ordered according to the parent node object, so that the ordering of each layer of node objects in each layer is realized.
Further, the specific steps of determining the relative position of each device in the tree structure are as follows:
s31: aiming at each node object after sequencing, sequentially storing each node object in a node object set from a root node object to a child node object according to a parent-child hierarchy and from left to right of each layer of node object;
s32: temporarily creating a key value pair set in a memory, wherein the key value pair set comprises a key value pair of each layer of a parent-child layer, the key value of the key value pair corresponds to the layer number of the layer, namely the node row mark value of the node object of the layer, and the value corresponds to the maximum width of the layer, and the maximum width refers to the number of the node objects of the layer;
s33: defining the node row coordinate of the root node object as 1, and the node row coordinate of the node object of the child layer as the node row coordinate value of the node object of the parent layer plus 1; when each layer of key value pair < key, value > is created, the key value is determined by the node row coordinates of the layer of node object, and the value is assigned to null;
s34: traversing the node object set, acquiring a value of the key value pair from a layer corresponding to each node object according to the node row coordinate of each node object, and if the value is null, assigning the value to be 1; if the value is not null, adding 1 to the value; updating the value of the key value pair, and assigning the value of the key value pair to the node column coordinates of the node object;
s35: and after traversing the node object set, determining the key value pair of each layer, and obtaining the node row coordinate and the node column coordinate of each node object.
In the above step, the row mark and the column mark of each node are determined by establishing a temporary key value pair set, specifically, the node row coordinate of each node object is determined by the number of layers of the parent-child layer where the node object is located, starting from the root node object, and if the number of layers of the child node object is added with 1, the node row coordinate of the node object of the layer where the child node is located is correspondingly added with 1; the node column coordinates are determined by the sequence of the node objects in the layer, along with the traversal of the node objects, the increment of the value of the key value pair in the layer is realized (sequentially adding 1), and the value is sequentially assigned to the node column coordinates of the node objects, so that the node objects in the layer sequentially have corresponding node column coordinates. And in the traversing process, the node row coordinates and the node column coordinates of each node object are determined in sequence.
Further, the method for generating the topological graph tree layout structure of the device specifically comprises the following steps:
s41: constructing a link relation set, wherein the link relation set comprises a set of link relations among all devices;
s42: constructing a topological data set, wherein the topological data set comprises a node object set, a link relation set, a maximum depth and a maximum width, and the maximum depth refers to the depth of a tree structure, namely the number of layers of a parent-child layer formed by each node object; the maximum width refers to the number of node objects contained in the layer with the most node objects;
s43: the background server returns the topological data set to the front-end interface; the front-end interface creates a primitive according to the node object set in the topological data set, creates a connection line according to the link relation set, establishes node object intervals according to the maximum depth and the maximum width, displays the node objects in each interval according to the node row coordinates and the node column coordinates of the node objects, and completes the generation of the topological graph tree-shaped layout.
Further, the node object further includes a node type, a device ID, a node name, and a node status.
Further, the link relationship includes a home node ID, a home port number, an opposite port number, and the link relationship indicates a link in which the home device points to the opposite device. A link between node objects refers to a connection where the local node points to the correspondent node, i.e., the parent node points to the child node.
In the method, the topology data format is as follows:
the node object format is:
Figure BDA0002489999240000061
the link relationship format is:
Figure BDA0002489999240000062
the topology data format is:
Figure BDA0002489999240000071
further, in the method, the step of calculating the topology data according to the topology data format comprises: step 1, creating a node object set topo, sequentially placing node objects into devices arrays according to the sequence from small to small of IP addresses, inquiring link data from a database, and placing the link relation of equipment into lldps arrays;
step 2, taking out a first device d from the devices array, and deleting d from the devices, wherein the device d is a device with the minimum IP address;
step 3, finding out all links related to the device d from the lldps array, putting the links into the temp _ lldps array, and deleting the links from the lldps array;
step 4, creating a node object n for d, and placing the node object n into a topo.
Step 5, traversing the temp _ lldp array, creating an object n1 of an opposite end device d1 of the device d aiming at each link data L, and deleting d1 from devices; assuming n1.Parentnodeid = n.nodeid, n1 is added to n.children and topo.nodes;
step 6, creating a link object according to the link data L, and putting the link object into a topo.
And 7, after the traversal of the temp _ lldp array is completed, the n.children comprises all the node objects related to n.
Step 8, when n1.Children is not empty, taking n1 as n, and performing recursive call processing on the stage flow until n.children is completely processed;
traversing topo. Nodes arrays, determining the node row coordinates of each node object according to the row of each node object, and realizing assignment of the node column coordinates of the node objects in the layer through establishment of corresponding key value pairs in each layer, wherein the node column coordinates of the node objects represent the position sequence of the node objects in the layer;
step 10, determining the maximum depth of a tree structure according to the number of layers of parent-child layers of nodes, determining the maximum width of the tree structure according to the number of node objects in each layer, encapsulating the maximum depth and the maximum width in topology data topo, and transmitting the topology data topo to a front end by a background server;
and 11, receiving topo data by the front end, creating a graphic element according to the nodes data, and creating a connecting line according to the links data. Since the topo object contains the maximum depth and the maximum width of the tree, the front end can split the topology display area into columns of maximum depth and rows of "table" of maximum width according to the maximum depth and the maximum width. Because each node has its own node row coordinate x and node column coordinate y, which correspond to the corresponding table, the front end can conveniently distinguish the positions of all the graphic elements and display the graphic elements to the user in a tree topology diagram mode.
The invention defines the topology data format of the server returning to the client, each device is associated according to the link relation to realize the determination of the parent-child hierarchy among the devices, the determination of the relative position of each device is realized by determining the installation sequence of each layer of the device, namely, the sequence of the layer in which each device is positioned and each layer is determined, each device is displayed in the client interface according to the form of the relative position, the installation position of each device and the link relation among the devices are conveniently and clearly known, and the display of the relative position of the device is convenient to realize the connection among the devices according to the link relation.
Drawings
FIG. 1 is a flow chart of the basic steps shown in the topology of the present invention.
Fig. 2 is a flow chart of the present invention.
FIG. 3 is a flow chart of the present invention for establishing a parent-child hierarchy between a root node and its children.
FIG. 4 is a flow chart of the present invention for child nodes to establish a parent-child hierarchy with their child nodes.
FIG. 5 is a flow chart of the present invention for determining the node coordinates of each level of node objects.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1-4, in order to implement the method for generating a topology tree layout in a network management system according to the present invention, the method first defines a format of topology data returned to a front end by an application server, where the topology data includes a node object set and a link relation set, the node object set includes a node object having node coordinates, and when the application server constructs the topology data, the application server can calculate a relative position of each device, and when displaying the topology, only needs to display according to the relative position.
Before topology display, a network management system must already discover network devices and acquire basic information of the devices and link relationships between the devices through SNMP (the link relationships include information of a home device, a home port, an opposite device, an opposite port, and the like). These device data and link data are already saved in the database. How to discover the network devices and their link relationships is achieved by the prior art, and is not described in detail herein.
Specifically, when constructing topology data, the method acquires device data and a link relationship between devices, associates the devices to form a parent-child hierarchy through the link relationship between the devices, sorts the devices of each layer in the parent-child hierarchy, sequentially sorts the devices in each sub-layer according to the sequence of the devices in the parent layer according to the link relationship, determines the relative position of each device in a tree structure, and generates a topology tree layout structure of the devices. Determining parent-child layers among the devices through the connection relation among the devices to form a tree structure of child node devices corresponding to the root node device, sequencing each layer of devices in each layer according to the parent-child layers and the tree structure, sequencing the devices of each sub-layer according to the link relation of the parent-child layer devices to form at least one section of sub-layer device set in each sub-layer, sequencing each section of sub-layer device corresponding to one parent layer device according to the sequence of the parent layer devices, sequentially determining the sequencing of each layer of devices, forming a topological graph tree layout structure according to the sequencing result, displaying the topological graph tree layout structure in a front-end interface, conveniently knowing and controlling the installation position and the connection relation of each device, and simultaneously, between the sequenced devices, avoiding the phenomenon of line crossing when the parent layer devices and the sub-layer devices establish connection, and sequentially comparing the connection.
Further, the specific steps of associating the devices to form a parent-child hierarchy are as follows:
s1: defining a node object of the equipment, wherein the node object comprises a node ID, a node IP, an equipment ID, a node row coordinate, a node column coordinate, a father node ID and a child node object set;
s2: determining a father node ID and a child node object set of a node object corresponding to each device according to the link relation between the devices, wherein the father node ID of a root node object is null, and the node ID of the node object is the father node ID of the child node of the node object;
s3: and after the parent-child hierarchy is determined, the number of the node objects on each layer is more than one, and each node object corresponds to more than one child node object.
Therefore, the link relation between the nodes corresponding to the devices is determined according to the link relation between the devices, and the parent node ID and the child node set in each node object are determined according to the link relation between the nodes, so that the parent-child hierarchy of each node device is determined.
Further, the node objects corresponding to each layer of equipment are sorted in the following specific manner:
s21: determining a root node object, wherein the root node object is a node object with the minimum node IP value;
s22: determining more than one child node object of the root node object according to the root node object and the parent-child hierarchy among the nodes, and sequencing the child node objects;
s22: traversing the sequenced child node objects, taking the child node objects as parent node objects according to parent-child hierarchies, and acquiring the child node object of each parent node object;
s23: sequencing more than one child node object of each parent node object into a corresponding sub-layer of the parent layer in sequence according to the parent-child layer and the sequence of the parent node objects in the parent layer;
s24: repeating the steps S22-S23 for each sequenced child node object, and sequentially sequencing the child node objects of each child node object until all child node objects are completely sequenced;
s25: after all child node objects are subjected to traversal sequencing, sequencing of each layer of node objects is contained in the parent-child layer.
In the above step, according to the parent-child hierarchy, the root node object is determined, the child node object is determined by the root node object, the child node object of each child node object is determined by the child node object, and each child node object is ordered according to the parent node object, so that the ordering of each layer of node objects in each layer is realized.
Further, the specific steps of determining the relative position of each device in the tree structure are as follows:
s31: aiming at each node object after sequencing, sequentially storing each node object in a node object set from a root node object to a child node object according to a parent-child hierarchy and from left to right of each layer of node object;
s32: temporarily creating a key value pair set in a memory, wherein the key value pair set comprises a key value pair of each layer of a parent-child layer, the key value of the key value pair corresponds to the layer number of the layer, namely the node row mark value of the node object of the layer, and the value corresponds to the maximum width of the layer, and the maximum width refers to the number of the node objects of the layer;
s33: defining the node row coordinate of the root node object as 1, and the node row coordinate of the node object of the child layer as the node row coordinate value of the node object of the parent layer plus 1; when the key value pair < key, value > of each layer is created, the key value is determined by the node row coordinate of the node object of the layer, and the value is assigned to null;
s34: traversing the node object set, acquiring a value of the key value pair from a layer corresponding to each node object according to the node row coordinate of each node object, and assigning the value to be 1 if the value is null; if the value is not null, adding 1 to the value; updating the value of the key-value pair, and assigning the value of the key-value pair to the node column coordinates of the node object;
s35: after traversing the node object set, determining the key value pair of each layer, and obtaining the node row coordinate and the node column coordinate of each node object.
In the above step, the row mark and the column mark of each node are determined by establishing a temporary key value pair set, specifically, the node row coordinate of each node object is determined by the number of layers of the parent-child layer where the node object is located, starting from the root node object, and if the number of layers of the child node object is added with 1, the node row coordinate of the node object of the layer where the child node is located is correspondingly added with 1; the node column coordinates are determined by the sequence of the node objects in the layer, along with the traversal of the node objects, the increment of the value of the key value pair in the layer is realized (sequentially adding 1), and the value is sequentially assigned to the node column coordinates of the node objects, so that the node objects in the layer sequentially have corresponding node column coordinates. And in the traversing process, the node row coordinates and the node column coordinates of each node object are determined in sequence.
Further, the method for generating the topological graph tree layout structure of the device specifically comprises the following steps:
s41: constructing a link relation set, wherein the link relation set comprises a set of link relations among all devices;
s42: constructing a topological data set, wherein the topological data set comprises a node object set, a link relation set, a maximum depth and a maximum width, and the maximum depth refers to the depth of a tree structure, namely the number of layers of a parent-child layer formed by each node object; the maximum width refers to the number of node objects contained in the layer with the most node objects;
s43: the background server returns the topological data set to the front-end interface; the front-end interface creates a primitive according to the node object set in the topological data set, creates a connection line according to the link relation set, establishes node object intervals according to the maximum depth and the maximum width, displays the node objects in each interval according to the node row coordinates and the node column coordinates of the node objects, and completes the generation of the topological graph tree-shaped layout.
Further, the node object further includes a node type, a device ID, a node name, and a node status.
Further, the link relationship includes a home node ID, a home port number, an opposite node ID, and an opposite port number, and the link relationship indicates a link in which the home device points to the opposite device. A link between node objects refers to a connection where the local node points to the correspondent node, i.e., the parent node points to the child node.
In this embodiment, the node object format is:
Figure BDA0002489999240000121
the link relationship format is:
Figure BDA0002489999240000122
Figure BDA0002489999240000131
the topology data format is:
Figure BDA0002489999240000132
the specific implementation mode is as follows: step 1, as described with reference to fig. 2, a node object set topo is created, node objects are sequentially placed into devices arrays from small to large according to the order of IP addresses, link data is inquired from a database, and the link relation of equipment is placed into lldps arrays; this is the first stage. All node objects are placed into the devices array, and all link data are placed into the lldps array respectively, so that traversal of the arrays is facilitated, and sequencing of the node objects is further achieved.
Step 2, taking out a first device d from the devices array, and deleting d from the devices, wherein the device d is the device with the minimum IP address, namely the device is equivalent to a root node device;
step 3, finding out all links related to the device d from the lldps array (no matter whether the local device is d or the opposite device is d, the links are related), putting the links into the temp _ lldps array, and deleting the links from the lldps array;
step 4, creating a node object n for d, and placing the node object n into a topo.
Step 5, traversing the temp _ lldp array, creating an object n1 of the opposite end device d1 of the device d aiming at each link data L, and deleting d1 from the devices; assuming n1.Parentnodeid = n.nodeid, n1 is added to n.children and topo.nodes;
step 6, creating a link object according to the link data L, and putting the link object into a topo.
Step 7, after the traversal of the temp _ lldp array is completed, the n.children contains all the node objects related to n, namely, each child node object of the root node object is determined; steps 2-7 are the second stage, by which the second stage process ends. And in the second stage, firstly, the device with the minimum IP serves as a root device of the tree layout, a node object is created for the device, all devices associated with the device also create the node object, and link objects are created for the connection relationship of the devices. Nodes are placed in the topo.
Step 8, referring to fig. 3, sorting the child node objects corresponding to the root node object from small to large according to the IP addresses, determining the child node objects of the child node objects according to the steps 2 to 7 in sequence for each child node object, determining the parent-child hierarchy and the link relation between the node objects, and completing the creation of all node objects and link data link; the present stage is immediately followed by the previous stage, and the processing manner is similar to the previous stage, namely, child nodes of the child nodes are found and created for the child nodes of the child node of the first node of the previous stage, and link objects are created for the child nodes. And then carrying out recursive processing on the child nodes created at the stage until all the child nodes can not find the associated nodes any more.
Step 9, referring to fig. 4, traversing the topo. Nodes array, determining the node row coordinates of each node object according to the row where each node object is located, and implementing assignment of the node column coordinates of the node object of the layer through establishment of the corresponding key value pair of each layer, wherein the node column coordinates of the node object represent the position sequence of the node object on the layer;
step 10, determining the maximum depth of a tree structure according to the number of layers of parent-child layers of nodes, determining the maximum width of the tree structure according to the number of node objects in each layer, encapsulating the maximum depth and the maximum width in topology data topo, and transmitting the topology data topo to a front end by a background server; this is the fourth stage. In this stage, assignment of the node row coordinates and the node column coordinates of the node objects is realized, and the node coordinates of each node object are determined. And determining the maximum depth and the maximum width of the parent-child hierarchy, namely determining the display interval of the node coordinates.
And 11, receiving topo data by the front end, creating a graphic element according to the nodes data, and creating a connecting line according to the links data. Since the topo object contains the maximum depth and maximum width of the tree, the front end can divide the topology display area into columns of maximum depth and rows of maximum width according to the maximum depth and maximum width. Because each node has its own node row coordinate x and node column coordinate y, which correspond to the corresponding table, the front end can conveniently distinguish the positions of all the graphic elements and display the graphic elements to the user in a tree topology diagram mode.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (6)

1. A topological graph tree layout generating method in a network management system is characterized in that the method firstly defines the format of topological data returned to a front end by an application server, the topological data comprises a node object set and a link relation set, the node object set comprises node objects with node coordinates, when the application server constructs the topological data, the relative position of each device can be calculated when the topological data is constructed, and only the display is carried out according to the relative position when the topology is displayed;
when constructing topological data, acquiring device data and a link relation between devices, associating the devices through the link relation between the devices to form a parent-child hierarchy, sequencing the devices of each layer in the parent-child hierarchy, sequencing the devices in each sub-layer in sequence according to the sequence of the devices in the parent layer according to the link relation, determining the relative position of each device in a tree structure, and generating a topological graph tree layout structure of the devices;
the specific steps of associating the devices to form a parent-child hierarchy are as follows:
s1: defining a node object of the equipment, wherein the node object comprises a node ID, a node IP, an equipment ID, a node row coordinate, a node column coordinate, a father node ID and a child node object set;
s2: determining a father node ID and a child node object set of a node object corresponding to each device according to the link relation among the devices, wherein the father node ID of a root node object is null, and the node ID of the node object is the father node ID of the child node of the node object;
s3: and after the parent-child hierarchy is determined, the number of the node objects on each layer is more than one, and each node object corresponds to more than one child node object.
The ordering mode of the node objects corresponding to each layer of equipment is as follows:
s21: determining a root node object, wherein the root node object is a node object with the minimum node IP value;
s22: determining more than one child node object of the root node object according to the root node object and the parent-child hierarchy among the nodes, and sequencing the child node objects;
s22: traversing the sequenced child node objects, taking the child node objects as parent node objects according to parent-child hierarchies, and acquiring the child node object of each parent node object;
s23: sequencing more than one child node object of each parent node object to a corresponding child layer of the parent layer in sequence according to the parent-child layer and the sequence of the parent node objects in the parent layer;
s24: repeating the steps S22-S23 aiming at each sequenced child node object, and sequentially sequencing the child node objects of each child node object until all child node objects are subjected to traversing sequencing;
s25: and after all the child node objects are subjected to traversal sequencing, the parent-child hierarchy comprises the sequencing of each layer of node objects.
The specific steps for determining the relative position of each device in the tree structure are as follows:
s31: aiming at each node object after sequencing, sequentially storing each node object in a node object set from a root node object to a child node object according to a parent-child hierarchy and from left to right of each layer of node object;
s32: temporarily creating a key value pair set in a memory, wherein the key value pair set comprises a key value pair of each layer of a parent-child layer, the key value of the key value pair corresponds to the layer number of the layer, namely the node row mark value of the node object of the layer, and the value corresponds to the maximum width of the layer, and the maximum width refers to the number of the node objects of the layer;
s33: defining the node row coordinate of the root node object as 1, and the node row coordinate of the node object of the child layer as the node row coordinate value of the node object of the parent layer plus 1; when each layer of key value pair < key, value > is created, the key value is determined by the node row coordinates of the layer of node object, and the value is assigned to null;
s34: traversing the node object set, acquiring a value of the key value pair from a layer corresponding to each node object according to the node row coordinate of each node object, and assigning the value to be 1 if the value is null; if the value is not null, adding 1 to the value; updating the value of the key value pair, and assigning the value of the key value pair to the node column coordinates of the node object;
s35: after traversing the node object set, determining the key value pair of each layer, and obtaining the node row coordinate and the node column coordinate of each node object.
2. The method for generating a topology tree layout in a network management system according to claim 1, wherein the method for generating the topology tree layout structure of the device specifically comprises the following steps:
s41: constructing a link relation set, wherein the link relation set comprises a set of link relations among all devices;
s42: constructing a topological data set, wherein the topological data set comprises a node object set, a link relation set, a maximum depth and a maximum width, and the maximum depth refers to the depth of a tree structure, namely the number of layers of a parent-child layer formed by each node object; the maximum width refers to the number of node objects contained in the layer with the most node objects;
s43: the background server returns the topological data set to the front-end interface; the front-end interface creates a primitive according to the node object set in the topological data set, creates a connection line according to the link relation set, creates node object intervals according to the maximum depth and the maximum width, displays the node objects in each interval according to the node row coordinates and the node column coordinates of the node objects, and completes the generation of the topological graph tree layout.
3. The method for generating topology tree in network management system according to claim 2, wherein said node object further includes node type, device ID, node name, and node status.
4. The method as claimed in claim 3, wherein the link relationship includes a home node ID, a home port number, an opposite port number, and an opposite node ID, and the link relationship indicates that the home device points to a link of the opposite device.
5. The method for generating topology tree layout in network management system according to claim 4, wherein the topology data format is:
topo:{
nodes-node object set
links-Link object set
Int, max depth
Int- -maximum Width of MaxY
}
The node object format is:
node:{
int — node ID
Int, node type
deviceId int — device ID
deviceName-string, -node name
String, node IP
Int, node status of alarmGrade
Int, -node line coordinates
Int, -node column coordinates
parentNodeId int, -parent ID
child node (node) [ ] - -child node set (opposite end node)
}
The link relationship format is:
link:{
int, home node ID
Int, local port number
Int, remNodeId- -Peer node ID
RemIfIndex int- -opposite port number
}。
6. The method for generating a tree topology of a topology map in a network management system according to claim 5, wherein the specific steps of generating the tree topology of the topology map are as follows:
s501, creating a node object set topo, sequentially placing node objects into devices arrays according to the sequence from small to large of IP addresses, inquiring link data from a database, and placing the link relation of equipment into lldps arrays;
s502, taking out a first device d from the devices array, and deleting d from the devices, wherein the device d is the device with the minimum IP address;
s503, finding out all links related to the device d from the lldps array, putting the links into the temp _ lldps array, and deleting the links from the lldps array;
s504, creating a node object n for d, and putting the node object n into a topo.
S505, traversing the temp _ lldp array, creating an object n1 of opposite-end equipment d1 of the equipment d aiming at each link data L, and deleting d1 from devices; let n1.Parentnodeid = n.nodeid, add n1 to n.children neutralization topo.nodes;
s506, creating a link object according to the link data L, and putting the link object into a topo.
S507, after the traversal of the temp _ lldp array is completed, the n.children includes all node objects related to n;
s508, when n1.Children is not empty, taking n1 as n, and performing recursive call processing on the flow of the stage until all n.children is processed;
s509, traversing the topo. Nodes array, determining the node row coordinates of each node object according to the row of each node object, and realizing assignment of the node column coordinates of the node objects in the layer through establishment of corresponding key value pairs in each layer, wherein the node column coordinates of the node objects represent the position sequence of the node objects in the layer;
s510, determining the maximum depth of a tree structure according to the number of layers of the parent-child layers of the nodes, determining the maximum width of the tree structure according to the number of node objects of each layer, encapsulating the maximum depth and the maximum width in topology data topo, and transmitting the topology data topo to a front end by a background server;
s511, the front end receives topo data, creates a primitive according to the nodes data, and creates a connecting line according to the links data; since the topo object contains the maximum depth and the maximum width of the tree, the front end can divide the topology display area into a "table" with the maximum depth and the maximum width as columns and the maximum width as rows; because each node has its own node row coordinate x and node column coordinate y, which correspond to the corresponding table, the front end can conveniently distinguish the positions of all the primitives and display the primitives to the user in a tree topology map manner.
CN202010402416.1A 2020-05-13 2020-05-13 Topological graph tree layout generating method in network management system Active CN111669286B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010402416.1A CN111669286B (en) 2020-05-13 2020-05-13 Topological graph tree layout generating method in network management system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010402416.1A CN111669286B (en) 2020-05-13 2020-05-13 Topological graph tree layout generating method in network management system

Publications (2)

Publication Number Publication Date
CN111669286A CN111669286A (en) 2020-09-15
CN111669286B true CN111669286B (en) 2023-04-07

Family

ID=72383538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010402416.1A Active CN111669286B (en) 2020-05-13 2020-05-13 Topological graph tree layout generating method in network management system

Country Status (1)

Country Link
CN (1) CN111669286B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112711507A (en) * 2020-12-17 2021-04-27 浙江高速信息工程技术有限公司 Device alarm method, electronic device, and medium
CN113315650B (en) * 2021-04-26 2022-05-27 新华三大数据技术有限公司 Node layout method and device
CN113822963A (en) * 2021-09-22 2021-12-21 济南浪潮数据技术有限公司 Method, system, equipment and storage medium for drawing and displaying topological graph
CN114205281B (en) * 2021-11-30 2023-08-08 科大国创云网科技有限公司 Metadata-driven end-to-end network topology dynamic generation system and method
CN114924801B (en) * 2022-05-26 2023-09-15 中国人民解放军国防科技大学 Multi-core processor thread awakening method based on cache topology
CN115309397B (en) * 2022-08-11 2023-04-07 广州芯德通信科技股份有限公司 Canvas topology management method and system of data interpretation model
CN117354164B (en) * 2023-12-05 2024-02-20 长沙先度科技有限公司 Automatic generation method of Ethernet topology structure

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102752146A (en) * 2012-07-13 2012-10-24 中国科学院微电子研究所 Cluster topological graph generation method and server
CN102868972A (en) * 2012-09-05 2013-01-09 河海大学常州校区 Internet of things (IoT) error sensor node location method based on improved Q learning algorithm
CN103973484A (en) * 2014-04-29 2014-08-06 上海上讯信息技术股份有限公司 Operation and maintenance management system based on network topological structure

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10046312B4 (en) * 2000-09-19 2004-02-26 Siemens Ag Procedure for determining network topologies
US20070097883A1 (en) * 2005-08-19 2007-05-03 Yigong Liu Generation of a network topology hierarchy

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102752146A (en) * 2012-07-13 2012-10-24 中国科学院微电子研究所 Cluster topological graph generation method and server
CN102868972A (en) * 2012-09-05 2013-01-09 河海大学常州校区 Internet of things (IoT) error sensor node location method based on improved Q learning algorithm
CN103973484A (en) * 2014-04-29 2014-08-06 上海上讯信息技术股份有限公司 Operation and maintenance management system based on network topological structure

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"网络拓扑可视化系统设计与实现";贾诺;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》;20181015;第1、7、26-27页 *
Akio Koyama ; Shohei Sato ; Leonard Barolli ; Makoto Takizawa."An Implementation of Visualization System for Visualizing Network Topology and Packet Flow in Mobile Ad Hoc Networks".《2012 15th International Conference on Network-Based Information Systems》.2012, *

Also Published As

Publication number Publication date
CN111669286A (en) 2020-09-15

Similar Documents

Publication Publication Date Title
CN111669286B (en) Topological graph tree layout generating method in network management system
CN109981346B (en) Network space coordinate system creating method and device based on autonomous system
JP3006909B2 (en) Automatic layout of network topology
CN104679949B (en) Paramics road network construction methods based on XML road net datas
US6608635B1 (en) Apparatus and method for mapping network topology elements and connections
CN109150640A (en) A kind of method for discovering network topology and system based on double layer network agreement
CN108282362B (en) Network topology generation method, device and equipment
CN102546251A (en) Hybrid-detection-technology-based network topology discovery and automatic topology method and system
CN110738577A (en) Community discovery method, device, computer equipment and storage medium
CN113792008B (en) Method and device for acquiring network topology structure, electronic equipment and storage medium
CN108023770B (en) Data center equipment-based relation topological graph generation method and equipment
CN110647610A (en) Construction method and device of power system visualization platform
CN101222391A (en) Method for constructing topological tree in server/client terminal structure
CN101179475B (en) Method for downloading map data in peer-to-peer network mode
CN102394777A (en) Network management method and system based on geographical position information
Zhang et al. Incompatibility networks as models of scale-free small-world graphs
CN110730093B (en) Metropolitan area network topology mapping method and device
US20050204290A1 (en) System and method for generating distributed application and distributed system topologies with management information in a networked environment
US8743736B2 (en) Inferring connectivity in the presence of conflicting network data
CN105022730A (en) Method and system generating geography network according to browser
Toce et al. An efficient hypercube labeling schema for dynamic peer-to-peer networks
JP2023108058A5 (en) Communication methods and networking systems
JP2020065202A (en) Network management apparatus, method and program
CN107864069B (en) Method for realizing automatic cloud testing of communication equipment
CN117354164B (en) Automatic generation method of Ethernet topology structure

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
GR01 Patent grant
GR01 Patent grant