Network topology drawing method and device, equipment and medium
By calculating the logical size of the network device and determining the position coordinates, the problem of overlapping annotation information in the network topology is solved, and the topology presentation effect is improved.
Patent Information
- Application Number
- CN202510181118.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-05-27
AI Technical Summary
The annotation information of different network devices in the network topology is easily overlapped and covered, affecting the presentation effect of the topology.
By obtaining the annotation information and connection information of each network device, calculating its logical size, and determining the position coordinates based on the logical size, avoiding overlap of annotation information.
It effectively solves the problem of overlapping annotation information, and improves the rendering effect and readability of network topology.
Smart Images

Figure CN120050180A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technologies, and in particular, to a method, apparatus, device, and medium for network topology drawing. Background Art
[0002] A network topology is a logical representation of the connection manner between various network devices in a network. Through a graphical network topology, a network administrator can very intuitively view the networking situation of network devices. In a network topology, annotation information such as a display name and an operating state can be noted beside the icon of a network device. However, when noting the annotation information, it is very easy for the annotation information of different network devices to overlap and cover each other in the network topology, which seriously affects the presentation effect of the network topology. Summary of the Invention
[0003] The purpose of the embodiments of the present application is to provide a method, apparatus, device, and medium for network topology drawing to solve the problem that the annotation information of different network devices overlaps and covers each other, and improve the presentation effect of the network topology. The specific technical solutions are as follows:
[0004] In a first aspect, the embodiments of the present application provide a method for network topology drawing, the method including:
[0005] Obtaining first annotation information and connection information of a plurality of network devices included in a network;
[0006] Determining a first logical size of each network device according to the icon and the first annotation information of each network device and a preset information radius, where the preset information radius indicates the radius of the logical range occupied by the device icon and the annotation information;
[0007] Using the first logical size of each network device to determine the position coordinates of each network device in a topology view;
[0008] In the topology view, drawing the icon of each network device at the position coordinates of each network device, and drawing a link between the plurality of network devices between the icons of the plurality of network devices according to the connection information;
[0009] In the topology view, adding the first annotation information of each network device within a first logical range where the icon of each network device is located, and the size of the first logical range where the icon of each network device is located is the first logical size of each network device.
[0010] In some embodiments, the preset information radius includes a first radius corresponding to the device icon and a second radius corresponding to an annotation information;
[0011] The step of determining the first logical size of each network device according to the icon and the first annotation information of each network device, and the preset information radius includes:
[0012] Calculate the product of the quantity of the first annotation information of each network device and the second radius to obtain the third radius of each network device;
[0013] Calculate the sum of the third radius of each network device and the first radius to obtain the first logical size of each network device.
[0014] In some embodiments, the method further includes:
[0015] Obtain the second annotation information of each link among the multiple network devices;
[0016] Determine the second logical size of each link according to the second annotation information of each link and the preset information radius;
[0017] In the topology view, add the second annotation information of each link within the second logical range passed by each link, and the size of the second logical range passed by each link is the second logical size of each link;
[0018] The step of determining the position coordinates of each network device in the topology view by using the first logical size of each network device includes:
[0019] Determine the position coordinates of each network device in the topology view by using the first logical size of each network device and the second logical size of each link.
[0020] In some embodiments, the preset information radius includes the second radius corresponding to one annotation information;
[0021] The step of determining the second logical size of each link according to the second annotation information of each link and the preset information radius includes:
[0022] Calculate the product of the quantity of the second annotation information of each link and the second radius to obtain the second logical size of each link.
[0023] In some embodiments, the step of determining the position coordinates of each network device in the topology view by using the first logical size of each network device and the second logical size of each link includes:
[0024] Traverse the network devices whose position coordinates are to be determined among the multiple network devices in a preset traversal order to obtain the first network device;
[0025] Determine the first position coordinate of the first network device according to the second position coordinate of the second network device and the third position coordinate of the third network device whose position coordinates have been determined in the topology view;
[0026] Wherein, there is a link between the second network device and the first network device, and there is no link between the third network device and the first network device; the first distance between the first position coordinate and the second position coordinate is greater than or equal to the sum of the first length and the second length, the first length is the sum of the first logical size of the first network device and the first logical size of the second network device, and the second length is the product of the second logical size of the first link between the second network device and the first network device and a preset multiple; the second distance between the first position coordinate and the third position coordinate is greater than or equal to the sum of the first logical size of the first network device and the first logical size of the third network device.
[0027] In some embodiments, after determining the first position coordinate of the first network device, it further includes:
[0028] Determine the fourth position coordinate on the first link, the fourth position coordinate is the center of the second logical range passed by the first link, the distance between the fourth position coordinate and the second position coordinate is greater than or equal to the sum of the first logical size of the second network device and the second logical size of the first link, the distance between the fourth position coordinate and the first position coordinate is greater than or equal to the sum of the first logical size of the first network device and the second logical size of the first link, the distance between the fourth position coordinate and the third position coordinate is greater than or equal to the sum of the first logical size of the third network device and the second logical size of the first link, and the distance between the fourth position coordinate and the fifth position coordinate is greater than or equal to the sum of the second logical sizes of the first link and the second link, and the fifth position coordinate is the center of the second logical range passed by the second link.
[0029] In some embodiments, the method further includes:
[0030] If the fourth position coordinate is not determined, adjust the first position coordinate of the first network device to obtain a sixth position coordinate, the distance between the sixth position coordinate and the second position coordinate is greater than the first distance, and the distance between the sixth position coordinate and the third position coordinate is greater than the second distance;
[0031] Re-execute the step of determining the fourth position coordinate on the first link.
[0032] In a second aspect, an embodiment of the present application provides a network topology drawing device, and the device includes:
[0033] An acquisition module, configured to acquire first annotation information and connection information of a plurality of network devices included in a network formation;
[0034] A first determination module, configured to determine a first logical size of each network device according to an icon of each network device, the first annotation information, and a preset information radius, where the preset information radius indicates a radius of a logical range occupied by a device icon and annotation information;
[0035] A second determination module, configured to determine position coordinates of each network device in a topology view by using the first logical size of each network device;
[0036] A drawing module, configured to draw an icon of each network device at the position coordinates of each network device in the topology view, and draw a link between the plurality of network devices between the icons of the plurality of network devices according to the connection information;
[0037] An adding module, configured to add the first annotation information of each network device within a first logical range where an icon of each network device is located in the topology view, and a size of the first logical range where an icon of each network device is located is the first logical size of each network device.
[0038] In some embodiments, the preset information radius includes a first radius corresponding to a device icon and a second radius corresponding to an annotation information; the first determination module is specifically configured to:
[0039] Calculate a product of the number of the first annotation information of each network device and the second radius to obtain a third radius of each network device; calculate a sum value of the third radius of each network device and the first radius to obtain the first logical size of each network device.
[0040] In some embodiments, the acquisition module is further configured to: acquire second annotation information of each link between the plurality of network devices;
[0041] The first determination module is further configured to: determine a second logical size of each link according to the second annotation information of each link and the preset information radius;
[0042] The adding module is further configured to: add the second annotation information of each link within a second logical range through which each link passes in the topology view, and a size of the second logical range through which each link passes is the second logical size of each link;
[0043] The second determination module is specifically configured to: determine position coordinates of each network device in the topology view by using the first logical size of each network device and the second logical size of each link.
[0044] In some embodiments, the preset information radius includes a second radius corresponding to an annotation information; the first determining module is specifically configured to:
[0045] Calculate the product of the number of second annotation information of each link and the second radius to obtain the second logical size of each link.
[0046] In some embodiments, the second determining module is specifically configured to:
[0047] Traverse the network devices to be determined for position coordinates among the multiple network devices according to a preset traversal order to obtain a first network device;
[0048] Determine the first position coordinate of the first network device according to the second position coordinate of a second network device and the third position coordinate of a third network device whose position coordinates have been determined in the topology view;
[0049] Wherein, there is a link between the second network device and the first network device, and there is no link between the third network device and the first network device; the first distance between the first position coordinate and the second position coordinate is greater than or equal to the sum value of a first length and a second length, the first length is the sum value of the first logical size of the first network device and the first logical size of the second network device, and the second length is the product of the second logical size of the first link between the second network device and the first network device and a preset multiple; the second distance between the first position coordinate and the third position coordinate is greater than or equal to the sum value of the first logical size of the first network device and the first logical size of the third network device.
[0050] In some embodiments, the second determining module is further configured to:
[0051] After determining the first position coordinate of the first network device, determine a fourth position coordinate on the first link, where the fourth position coordinate is the center of a second logical range passed by the first link, the distance between the fourth position coordinate and the second position coordinate is greater than or equal to the sum value of the first logical size of the second network device and the second logical size of the first link, the distance between the fourth position coordinate and the first position coordinate is greater than or equal to the sum value of the first logical size of the first network device and the second logical size of the first link, the distance between the fourth position coordinate and the third position coordinate is greater than or equal to the sum value of the first logical size of the third network device and the second logical size of the first link, and the distance between the fourth position coordinate and a fifth position coordinate is greater than or equal to the sum value of the second logical size of the first link and the second logical size of a second link, where the fifth position coordinate is the center of the second logical range passed by the second link.
[0052] In some embodiments, the second determination module is further configured to:
[0053] If the fourth position coordinate is not determined, adjust the first position coordinate of the first network device to obtain a sixth position coordinate, where the distance between the sixth position coordinate and the second position coordinate is greater than the first distance, and the distance between the sixth position coordinate and the third position coordinate is greater than the second distance;
[0054] Re - execute the step of determining the fourth position coordinate on the first link.
[0055] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0056] The memory is used to store a computer program;
[0057] The processor is configured to implement the network topology drawing method described in any one of the above when executing the program stored on the memory.
[0058] In a fourth aspect, an embodiment of the present application provides a computer - readable storage medium, where a computer program is stored in the computer - readable storage medium, and when the computer program is executed by a processor, the network topology drawing method described in any one of the above is implemented.
[0059] In a fifth aspect, an embodiment of the present application provides a computer program product containing instructions, which when running on a computer, causes the computer to execute the network topology drawing method described in any one of the above.
[0060] Beneficial effects of the embodiments of the present application:
[0061] In the technical solution provided by the embodiments of the present application, the logical size of each network device is determined by using the first annotation information of each network device, and the position coordinates of each network device are determined according to the logical size. In the process of calculating the logical size of each network device in the embodiments of the present application, the first annotation information is considered. Furthermore, in the process of determining the position coordinates of each network device in the topological view, the network device itself and the first annotation information are comprehensively considered, the logical size is automatically adjusted according to the first annotation information, and then the distance between network devices is adjusted. In this way, the annotation information of different network devices will not overlap and cover each other, solving the problem that the annotation information of different network devices overlaps and covers each other, and improving the presentation effect of the network topology.
[0062] Of course, when implementing any product or method of the present application, it is not necessarily required to achieve all the above - mentioned advantages simultaneously. Brief Description of the Drawings
[0063] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can also obtain other embodiments based on these drawings.
[0064] Figure 1 It is a schematic diagram of a network topology;
[0065] Figure 2 It is the first flow schematic diagram of the network topology drawing method provided by the embodiment of the present application;
[0066] Figure 3a It is the first schematic diagram of the logical structure of the network device provided by the embodiment of the present application;
[0067] Figure 3b It is the second schematic diagram of the logical structure of the network device provided by the embodiment of the present application;
[0068] Figure 4 It is the second flow schematic diagram of the network topology drawing method provided by the embodiment of the present application;
[0069] Figure 5 It is a schematic diagram of a logical structure of a link provided by the embodiment of the present application;
[0070] Figure 6 It is the first schematic diagram of the logical structure of the network topology provided by the embodiment of the present application;
[0071] Figure 7a It is the second schematic diagram of the logical structure of the network topology provided by the embodiment of the present application;
[0072] Figure 7b It is a schematic diagram of a network topology provided by the embodiment of the present application;
[0073] Figure 8 It is a schematic diagram of a structure of a network topology drawing device provided by the embodiment of the present application;
[0074] Figure 9 It is a schematic diagram of a structure of an electronic device provided by the embodiment of the present application. Detailed Description of the Embodiments
[0075] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art based on the present application belong to the scope of protection of the present application.
[0076] The network topology is a logical representation of the connection method between various network devices in the network and plays an important role in the operation and maintenance of the network management system. Through the graphical network topology, network administrators can very intuitively view the networking situation of network devices. In the network topology, annotation information such as the display name and operating status can be noted beside the icons of network devices. Through the network topology, it can effectively help network administrators to perform good operation and maintenance management on the network, and the presentation effect of the network topology is crucial for the network topology function. Generally, the network topology consists of the following elements:
[0077] 1) Nodes. Nodes are network devices, generally presented by icons, such as circular icons or square icons, etc. Icons of different shapes can represent different types of network devices.
[0078] 2) Annotation information of the nodes displayed beside the nodes, such as the label name, system name, Internet Protocol (IP) address, type, model, and manufacturer of the nodes.
[0079] 3) Links. Links are the connections between network devices, generally presented by straight lines or curves, and the interfaces at both ends of the link are connected to the nodes.
[0080] 4) Annotation information of the links displayed beside the links, such as the name of the link, the interfaces on both sides, the link type, and various traffic data on the link (interface transmission rate, interface reception rate, interface bandwidth utilization rate, interface transmission packet discard rate, and interface reception packet discard rate).
[0081] 5) Other annotation information, such as the status information of the nodes and the status information of the links, etc., which will also be represented by small icons or text information in the network topology.
[0082] However, when noting the annotation information, it is very easy for the annotation information of different network devices to overlap and cover each other in the network topology, such as Figure 1The network topology shown. The network topology includes four network devices, namely Node 1 to Node 4. Among them, annotation information, including IP address, node type, node model, and status information, is noted beside Node 2 to Node 4. According to the noted annotation information, the network administrator can view that the IP addresses of Node 2 to Node 4 are respectively: 192.168.88.252, 192.168.88.251, and 192.168.162.81, the type is switch, and the model is xxx. The network administrator can also view status information such as the CPU utilization rate (%) and memory utilization rate (%) of Node 3 and Node 4. However, Figure 1 in the status information of Node 4, there is an overlapping coverage with the IP address of Node 3, resulting in unclear presentation of the annotation information, which seriously affects the presentation effect of the network topology.
[0083] To solve the above problems, the embodiments of the present application provide a network topology drawing method, which is applied to electronic devices such as computers and servers. For the convenience of description, the electronic device will be used as the execution subject in the following, which does not play a limiting role. Refer to Figure 2 , Figure 2 as the first process schematic diagram of the network topology drawing method provided by the embodiments of the present application. The network topology drawing method includes the following steps.
[0084] Step S21, obtain the first annotation information and connection information of multiple network devices included in the network formation.
[0085] Step S22, according to the icon and the first annotation information of each network device, and the preset information radius, determine the first logical size of each network device, where the preset information radius indicates the radius of the logical range occupied by the device icon and the annotation information.
[0086] Step S23, use the first logical size of each network device to determine the position coordinates of each network device in the topology view.
[0087] Step S24, in the topology view, draw the icon of each network device at the position coordinates of each network device, and draw the links between multiple network devices among the icons of multiple network devices according to the connection information.
[0088] Step S25, in the topology view, add the first annotation information of each network device within the first logical range where the icon of each network device is located, and the size of the first logical range where the icon of each network device is located is the first logical size of each network device.
[0089] In the technical solution provided by the embodiments of the present application, the electronic device determines the logical size of each network device by using the first annotation information of each network device, and determines the position coordinates of each network device according to the logical size. In the process of calculating the logical size of each network device, the technical solution provided by the embodiments of the present application takes into account the first annotation information. Furthermore, in the process of determining the position coordinates of each network device in the topological view, the network device itself and the first annotation information are comprehensively considered. The electronic device automatically adjusts the logical size according to the first annotation information, and then adjusts the distance between network devices. In this way, the annotation information of different network devices will not overlap and cover each other, solving the problem of the annotation information of different network devices overlapping and covering each other, and improving the rendering effect of the network topology.
[0090] In the above step S21, the network formation is any network to be drawn in the topological view. The network formation includes multiple network devices, and the number of network devices included in the network formation is not limited here.
[0091] The first annotation information is the attribute information that the network device needs to present in the topological view. For example, the first annotation information can be the label name, system name, IP address, type, model, manufacturer, and status information of the network device, etc. The types of the first annotation information are not limited here.
[0092] In the embodiments of the present application, one attribute information that any network device needs to present is one first annotation information of the network device, and the number of attribute information that the network device needs to present is the number of the first annotation information of the network device. For example, in the topological view, if the network device needs to present the IP address and type, then the network device has 2 first annotation information, which are the IP address and type of the network device respectively; another example is that in the topological view, if the network device only needs to present the IP address, then the network device has 1 first annotation information, which is the IP address of the network device. The content and number of the first annotation information of each network device are not limited here.
[0093] The connection information is the connection relationship of the links between multiple network devices in the network formation. Take Figure 1 as an example, Figure 1 In the network formation shown, the connection information of nodes 1 to 4 is: node 1 is connected to node 2 by 1 link, node 1 is connected to node 3 by 1 link, and node 1 is connected to node 4 by 2 links.
[0094] The electronic device can obtain the network formation information of the network formation to be drawn, and determine multiple network devices included in the network formation, the attribute information that these multiple network devices need to present, and the connection information of these multiple network devices from the network formation information. The attribute information that each obtained network device needs to present is the first annotation information of each network device.
[0095] In the embodiments of the present application, a network administrator may select the attribute information that each network device needs to present. The electronic device may configure networking information according to the attribute information selected by the network administrator, and obtain the first annotation information of each network device from the networking information, so as to enable the network administrator to independently select the attribute information that needs to be presented. Here, the method for the electronic device to obtain the first annotation information is not limited.
[0096] In the above step S22, the device icon of the network device may be a circular icon, a square icon, or an icon of other shapes, which is not limited herein.
[0097] In the embodiments of the present application, the preset information radius may include the radius of the logical range occupied by the device icon and the radius of the logical range occupied by the annotation information.
[0098] 1) The radius of the logical range occupied by the device icon.
[0099] The logical range occupied by the device icon represents the area occupied by the device icon in the topology view, and the radius of the occupied logical range represents the size of the occupied area. When the device icon is a circular icon, the radius of the logical range occupied by the device icon may be: the radius of the device icon; when the device icon is a square icon, the radius of the logical range occupied by the device icon may be: the length and width of the device icon. For the convenience of description, hereinafter, it will be described by taking the shape of the device icon as a circle as an example, which does not play a limiting role.
[0100] In one example, the shapes and the radii of the logical ranges occupied by the device icons of different types of network devices may be the same. In this case, the radius of the logical range occupied by the device icon included in the preset information radius is a fixed value. For the convenience of description, this radius is referred to as the first radius corresponding to the device icon. For example, for network devices such as switches and servers, the device icons may all be circular icons, and the radii of the logical ranges occupied are all R1, and R1 is the first radius.
[0101] In another example, the shapes and the radii of the logical ranges occupied by the device icons of different types of network devices may be different. In this case, the preset information radius includes the types of network devices and the radii of the logical ranges occupied by each type. For example, for network devices such as switches and routers, the device icons may be circular icons, and for network devices such as servers, the device icons may be square icons; for switches, the radius of the logical range occupied by the device icon may be R1, and for routers, the radius of the logical range occupied by the device icon may be R2.
[0102] 2) The radius of the logical range occupied by the annotation information.
[0103] The logical range occupied by the annotation information represents the area occupied by the annotation information in the topological view, and the radius of the occupied logical range represents the size of the occupied area.
[0104] In the embodiments of the present application, the radius of the logical range occupied by the annotation information can be the radius corresponding to one annotation information. In this case, when the annotation information is presented in the form of a ring (i.e., each annotation information is located within a ring), the radius of the logical range occupied by the annotation information can be: the width of the ring; when the annotation information is presented in the form of a square (i.e., each annotation information is located within a square), the radius of the logical range occupied by the annotation information can be: the width of the square. Here, the presentation method of the annotation information is not limited.
[0105] In one example, the radii of the logical ranges occupied by different types of annotation information are the same. In this case, the radius of the logical range occupied by the annotation information included in the preset information radius is a fixed value. For the convenience of description, this radius is referred to as the second radius corresponding to one annotation information. For example, the radii of the logical ranges occupied by the IP address and type of a network device are both R3, and R3 is the second radius.
[0106] In another example, the radii of the logical ranges occupied by different types of annotation information are different. In this case, the preset information radius includes the types of annotation information and the radii of the logical ranges occupied by various types. For example, the radius of the logical range occupied by the IP address of a network device can be R3, and the radius of the logical range occupied by the type can be R4.
[0107] The radius of the logical range occupied by the annotation information can also be the radius corresponding to all annotation information. In this case, the radius of the logical range occupied by the annotation information is a fixed value, indicating that all annotation information is located within the range delimited by the radius.
[0108] In the embodiments of the present application, the first logical dimension is the dimension of the logical range occupied by the network device in the topological view, representing the size of the occupied area. For the convenience of description, the logical range occupied by the network device in the topological view is hereinafter simply referred to as the first logical range. The first logical dimension of a network device includes the radius of the logical range occupied by the icon of the network device and the radius of the logical range occupied by the first annotation information of the network device.
[0109] For each network device, the electronic device can determine the radius of the logical range occupied by the icon of the network device and the radius of the logical range occupied by the first annotation information according to the icon and the first annotation information of the network device, as well as the radius of the logical range occupied by the device icon and the radius of the logical range occupied by the annotation information in the preset information radius, and calculate the sum of the radius of the logical range occupied by the icon of the network device and the radius of the logical range occupied by the first annotation information. The calculated sum of the radii is the first logical dimension of the network device.
[0110] For example, for each network device, when the shapes of the device icons of different types of network devices and the radii of the logical ranges they occupy are the same, the electronic device can directly use the radius of the logical range occupied by the device icon in the preset information radius as the radius of the logical range occupied by the icon of each network device; when the shapes of the device icons of different types of network devices and the radii of the logical ranges they occupy are different, the electronic device can determine the radius of the logical range occupied by the icon of each network device according to the type of each network device, and the shape and the radius of the logical range occupied by the device icon of each type of network device in the preset information radius.
[0111] For another example, for each network device, when the radii of the logical ranges occupied by different types of annotation information are the same, the electronic device can calculate the radius of the logical range occupied by the first annotation information of each network device according to the radius of the logical range occupied by the annotation information in the preset information radius. The specific method will be described in detail later and will not be elaborated here for the time being; when the radii of the logical ranges occupied by different types of annotation information are different, the electronic device can determine the radius of the logical range occupied by each first annotation information of each network device according to the type of the first annotation information of each network device and the radius of the logical range occupied by each type of annotation information in the preset information radius, and calculate the sum of the radii of the logical ranges occupied by all the first annotation information of each network device to obtain the radius of the logical range occupied by the first annotation information of each network device.
[0112] For yet another example, when the radius of the logical range occupied by the annotation information is the radius corresponding to all the annotation information, the electronic device can directly use the radius of the logical range occupied by the annotation information in the preset information radius as the radius of the logical range occupied by the first annotation information of each network device. In this way, the logical ranges occupied by the first annotation information of each network device are the same.
[0113] In the above step S23, after determining the first logical dimension of each network device, the electronic device can sequentially determine the position coordinates of each network device in the topology view, and use the position coordinates of each network device as the position of the icon of the network device in the topology view.
[0114] In the topology view, the first logical ranges of the multiple network devices included in the network formation do not intersect, that is, there is no overlapping situation in the first logical ranges.
[0115] In the process of sequentially determining the position coordinates of each network device, the electronic device can first determine the position coordinates of the current network device, and determine whether there is an intersection between the first logical range of the current network device at the determined position coordinates and the first logical ranges of all the network devices whose position coordinates have been determined.
[0116] If there is no intersection, the determined position coordinates are used as the position coordinates of the current network device, and the position coordinates of the next network device are determined continuously; if there is an intersection, the position coordinates of the current network device are re-determined until the position coordinates of all network devices are determined.
[0117] In the above step S24, after the electronic device determines the position coordinates of all network devices, for each network device, an icon of the network device is drawn at the position coordinates of the network device in the topology view, and corresponding links are drawn between the icons of the multiple network devices according to the connection relationship of the links between the multiple network devices.
[0118] In the above step S25, the logical range where the icon of each network device is located is the logical range occupied by the network device in the topology view, that is, the first logical range of the network device.
[0119] For each network device, the electronic device adds the first annotation information of the network device within the first logical range of the network device. For example, the electronic device can add the first annotation information below the first logical range of the network device, or on the side or above, which is not limited herein.
[0120] Compared with the solution of setting a fixed distance between network devices to draw the topology view, the technical solution provided by the embodiments of the present application can automatically adjust the distance between each network device when the annotation information of the network device is more or less, preventing the situation that the annotation information of multiple network devices still overlaps and covers each other when the annotation information of the network device is more, and preventing the distance between multiple network devices from being too large when the annotation information of the network device is less, which affects the overall aesthetics and readability of the topology view. In addition, compared with the solution of manually dragging network devices to adjust the distance between network devices, the technical solution provided by the embodiments of the present application can automatically determine the reasonable distance between network devices without manual adjustment, with a high degree of automation and reduced labor costs.
[0121] In the embodiments of the present application, when the radius of the logical range occupied by the annotation information is the radius corresponding to all annotation information, since the logical ranges occupied by the first annotation information of each network device are the same, the electronic device can adjust the font size of the first annotation information of each network device according to the quantity of the first annotation information of each network device to ensure that all the first annotation information of each network device can be written into the first logical range.
[0122] For ease of description, in the following, it is taken as an example that the shapes of the device icons of different types of network devices and the radii of the occupied logical ranges are the same, the radius of the logical range occupied by the annotation information can be the radius corresponding to one annotation information, and the radii of the logical ranges occupied by different types of annotation information are the same, which is not restrictive.
[0123] In some embodiments, when the device icon is a circular icon and the annotation information is presented in the form of a ring, the preset information radius may include a first radius corresponding to the device icon and a second radius corresponding to one annotation information. Then, the above step S22 may be implemented through the following steps: calculate the product of the number of the first annotation information of each network device and the second radius to obtain the third radius of each network device; calculate the sum value of the third radius and the first radius of each network device to obtain the first logical size of each network device.
[0124] In the embodiments of the present application, the logical structure of the network device includes a circle corresponding to the device icon and multiple rings corresponding to multiple first annotation information. For each network device, the electronic device may calculate the product of the number of the first annotation information of the network device and the second radius to obtain the radii of the multiple rings corresponding to the first annotation information of the network device, and this radius is the third radius of the network device, that is, the radius of the logical range occupied by the first annotation information of the network device. After obtaining the third radius of each network device, for each network device, the electronic device calculates the sum value of the third radius and the radius of the circle corresponding to the device icon (i.e., the first radius) to obtain the first logical size.
[0125] As Figure 3a shown in the logical structure of the network device, the innermost circle corresponds to the device icon of the network device, and the multiple external rings correspond to the first annotation information of the network device. Each ring may correspond to one first annotation information, that is, the nth ring corresponds to the nth-level first annotation information, and n represents the number of the first annotation information of the network device. Figure 3a In [the figure], the network device includes 3 first annotation information, that is, n = 3, and the width of each ring is the second radius. Furthermore, the radius of the ring corresponding to the first annotation information of the network device is 3 times the second radius. Here, the value of n is not limited.
[0126] The first radius may be 0.5 unit lengths, 1 unit length, etc., and the second radius may be 1 unit length, 2 unit lengths, etc. For ease of description, in the following, it is taken as an example that the first radius is 0.5 unit lengths and the second radius is 1 unit length, which is not restrictive.
[0127] In this case, the third radius is 3×1 = 3 unit lengths, and the first logical dimension is the sum of the radius of the circle corresponding to the device icon and the radius of the ring corresponding to the first annotation information, that is, 0.5 + 3 = 3.5 unit lengths.
[0128] Furthermore, after determining the position coordinates of the network device, the electronic device can use the determined position coordinates as the center of the icon of the network device and draw the icon at the position coordinates. At this time, the first logical range of the network device includes the icon and the ring outside the icon. The electronic device can add the first annotation information inside the outer ring. For example, the first-level first annotation information, the second-level first annotation information, and the third-level first annotation information can be added in sequence in the ring from the inside out, and so on.
[0129] In the embodiment of the present application, the device icon can also be a square icon, and the preset information radius can include the length and width corresponding to the device icon of the network device, as well as the second radius. As Figure 3b shown in the logical structure of the network device. In the embodiment of the present application, the annotation information can also be presented in the form of a square box, which is similar to the logical structure of the network device shown above Figure 3a and will not be elaborated here.
[0130] In the technical solution provided by the embodiment of the present application, the electronic device can calculate the first logical dimension of each network device according to the first radius of the icon, the radius of each first annotation information, and the number of first annotation information. When determining the position coordinates of each network device subsequently, it is possible to prevent the icon of the network device from overlapping with the first annotation information, improving the display effect of the topology view.
[0131] In some embodiments, the electronic device can combine the attribute information (i.e., the second annotation information) that needs to be presented in the link in the topology view to draw the network topology. The above topology view drawing method can further include the following steps: obtaining the second annotation information of each link between multiple network devices; determining the second logical dimension of each link according to the second annotation information of each link and the preset information radius. The above step S23 can be implemented through the following steps: using the first logical dimension of each network device and the second logical dimension of each link to determine the position coordinates of each network device in the topology view.
[0132] The second annotation information can be the name of the link, the interfaces on both sides, the link type, various traffic data on the link, and status information, etc. The traffic data can include the interface transmission rate, the interface reception rate, the interface bandwidth utilization rate, the interface transmission packet discard rate, and the interface reception packet discard rate, etc. The types of the second annotation information are not limited here.
[0133] In an embodiment of the present application, an attribute information that any link needs to present is a second annotation information of the link, and the number of attribute information that the link needs to present is the number of second annotation information of the link. For example, in a topology view, if a link needs to present a name and a link type, then there are 2 second annotation information of the link, namely the name and the link type of the link. Here, the content and quantity of the second annotation information of each link are not limited.
[0134] The electronic device can determine one or more links between multiple network devices and the attribute information that needs to be presented for these one or more links based on the networking information and the connection information of the multiple network devices, and obtain the second annotation information of each link.
[0135] In an embodiment of the present application, the network administrator can select the attribute information that each link needs to present. The electronic device can configure the networking information according to the attribute information selected by the network administrator, and obtain the second annotation information of each link from the networking information, so as to enable the network administrator to select the attribute information that needs to be presented by himself / herself. Here, the method for the electronic device to obtain the second annotation information is not limited.
[0136] The second logical size is the size of the logical range occupied by the link in the topology view, indicating the size of the occupied area. For the convenience of description, hereinafter, the logical range occupied by the link in the topology view will be simply referred to as the second logical range.
[0137] For each link, the electronic device can determine the radius of the logical range occupied by the second annotation information of the link according to the second annotation information of the link and the radius of the logical range occupied by the annotation information in the preset information radius. The calculated radius is the second logical size of the link.
[0138] For example, for each link, when the radii of the logical ranges occupied by different types of annotation information are the same, the electronic device can calculate the radius of the logical range occupied by the second annotation information of each link according to the radius of the logical range occupied by the annotation information in the preset information radius. The specific method will be described in detail later and will not be elaborated here for the time being; when the radii of the logical ranges occupied by different types of annotation information are different, the electronic device can determine the radius of the logical range occupied by each second annotation information of each link according to the type of the second annotation information of each link and the radius of the logical range occupied by each type of annotation information in the preset information radius, and calculate the sum of the radii of the logical ranges occupied by all the second annotation information of each link to obtain the radius of the logical range occupied by the second annotation information of each link. The method for the electronic device to obtain the second logical size is similar to the method for obtaining the first logical size, and the specific details can be referred to the relevant description in the above step S22.
[0139] After obtaining the second logical size of each link, the electronic device can use the first logical size of each network device and the second logical size of each link to sequentially determine the position coordinates of each network device in the topology view, and use the position coordinates of each network device as the position of the icon of the network device in the topology view.
[0140] In the topology view, the first logical ranges of multiple network devices included in the network formation do not intersect, the second logical ranges of multiple links do not intersect, and any first logical range does not intersect with any second logical range. That is, there is no overlapping situation between the first logical range and the second logical range.
[0141] In the process of sequentially determining the position coordinates of each network device, the electronic device can first determine the position coordinates of the current network device, and judge whether there is an intersection between the first logical range of the current network device at the determined position coordinates, the first logical ranges of all network devices whose position coordinates have been determined, and the second logical ranges of the links between all network devices whose position coordinates have been determined.
[0142] If there is no intersection, the determined position coordinates are used as the position coordinates of the current network device, and the position coordinates of the next network device are continued to be determined; if there is an intersection, the position coordinates of the current network device are re-determined until the position coordinates of all network devices are determined.
[0143] After the electronic device determines the position coordinates of each network device and draws the link, it can also add the second annotation information of the link. Then, the above topology view drawing method can further include the following steps: in the topology view, add the second annotation information of each link within the second logical range passed by each link, and the size of the second logical range passed by each link is the second logical size of each link.
[0144] In the embodiments of the present application, the logical range passed by each link is the logical range occupied by the link in the topology view, that is, the second logical range of the link. The center of the second logical range of each link is on the link.
[0145] For each link, the electronic device can determine any position on the link as the center of the second logical range of the link, and add the second annotation information of the link within the second logical range. For example, the electronic device can determine the midpoint position on the link as the center of the second logical range, and add the second annotation information below the second logical range. The electronic device can also add the second annotation information on the side or above, which is not limited herein. For the convenience of description, the position coordinates of the center of the second logical range passed later are referred to as the fourth position coordinates, and the fourth position coordinates are not limited herein.
[0146] Based on the above description, refer toFigure 4 , Figure 4 This is the second schematic flowchart of the topology view drawing method provided by the embodiments of the present application. The topology view drawing method may include the following steps.
[0147] Step S41: Obtain the first annotation information and connection information of multiple network devices included in the network. This is the same as step S21 above.
[0148] Step S42: Determine the first logical size of each network device according to the icon and the first annotation information of each network device, and a preset information radius, where the preset information radius indicates the radius of the logical range occupied by the device icon and the annotation information. This is the same as step S22 above.
[0149] Step S43: Determine the second logical size of each link according to the second annotation information of each link and the preset information radius.
[0150] Step S44: Use the first logical size of each network device and the second logical size of each link to determine the position coordinates of each network device in the topology view.
[0151] Step S45: In the topology view, draw the icon of each network device at the position coordinates of each network device, and draw the links between multiple network devices among the icons of multiple network devices according to the connection information. This is the same as step S24 above.
[0152] Step S46: In the topology view, add the first annotation information of each network device within the first logical range where the icon of each network device is located, and the size of the first logical range where the icon of each network device is located is the first logical size of each network device. This is the same as step S25 above.
[0153] Step S47: In the topology view, add the second annotation information of each link within the second logical range through which each link passes, and the size of the second logical range through which each link passes is the second logical size of each link.
[0154] Figure 4 Only taking the example of first executing step S42 and then step S43, and first executing step S46 and then step S47, the execution order of step S42 and step S43, and the execution order of step S46 and step S47 are not limited herein.
[0155] In the technical solution provided by the embodiments of the present application, the electronic device combines the first annotation information of the network device and the second annotation information of the link to determine the position coordinates of the network device, reducing the possibility of overlap between the second annotation information of the link and the first annotation information of the network device, and further improving the presentation effect of the network topology.
[0156] In some embodiments, when the annotation information is presented in the form of a ring, the preset information radius may include a second radius corresponding to one annotation information. Then, the above step S43 may be implemented through the following steps: calculate the product of the number of second annotation information of each link and the second radius to obtain the second logical size of each link.
[0157] In the embodiments of the present application, for each link, the electronic device may calculate the product of the number of second annotation information of the link and the second radius to obtain the radius of the logical range occupied by the second annotation information of the link, and this radius is the second logical size of the link.
[0158] As Figure 5 shown in the logical structure of the link, both ends of the link are a network device respectively, and each ring in the link corresponds to one second annotation information, that is, the m-th ring corresponds to the m-th level of second annotation information, and m represents the number of second annotation information of the link.
[0159] Figure 5 In, the link includes 3 second annotation information, m = 3. The innermost ring corresponds to the first-level second annotation information, and the radius is the second radius; the middle ring corresponds to the second-level second annotation information, and the width is the second radius; the outermost ring corresponds to the third-level first annotation information, and the width is the second radius. Furthermore, the radius of the ring corresponding to the second annotation information of the link is 3 times the second radius. When the second radius is 1 unit length, the second logical size is 3×1 = 3 unit lengths. Here, the value of m is not limited.
[0160] After calculating the second logical size and drawing the link, the electronic device may use the central position on the link as the center of the second logical range to determine the second logical range of the link, as Figure 5 shown. At this time, the second logical range of the link includes multiple rings. The electronic device may add the first-level second annotation information in the innermost circle, add the second-level second annotation information in the middle ring, add the third-level second annotation information in the outermost ring, and so on.
[0161] In the technical solution provided by the embodiments of the present application, the electronic device calculates the second logical size of each link according to the radius of each second annotation information and the number of second annotation information. When determining the position coordinates of each network device subsequently, it can prevent the icons of the network devices and the first annotation information, as well as the second annotation information of the link, from overlapping, improving the display effect of the topology view.
[0162] In some embodiments, the above step S44 may be implemented through the following steps: Traverse the network devices whose position coordinates need to be determined among multiple network devices in a preset traversal order to obtain a first network device; Determine the first position coordinate of the first network device according to the second position coordinate of a second network device with a determined position coordinate and the third position coordinate of a third network device in the topology view;
[0163] Wherein, there is a link between the second network device and the first network device, and there is no link between the third network device and the first network device; The first distance between the first position coordinate and the second position coordinate is greater than or equal to the sum of the first length and the second length. The first length is the sum of the first logical size of the first network device and the first logical size of the second network device, and the second length is the product of the second logical size of the first link between the second network device and the first network device and a preset multiple; The second distance between the first position coordinate and the third position coordinate is greater than or equal to the sum of the first logical size of the first network device and the first logical size of the third network device.
[0164] In the embodiments of the present application, the first network device is the network device among the network devices whose position coordinates need to be determined that the electronic device currently needs to determine the position coordinates of. The preset traversal order is the order for the electronic device to determine the first network device from the network devices whose position coordinates need to be determined, and the preset traversal order may be related to the topology structure. For example, for a star-shaped topology structure, the preset traversal order may be: Start traversing from the network device with the largest number of connection links until the network device with the smallest number of connection links; For a tree-shaped network map, the preset traversal order may be: Start traversing from the core network device until the terminal network device. The preset traversal order is not limited here.
[0165] The second network device is the network device among the network devices with determined position coordinates that has a link with the first network device. The link between the second network device and the first network device is the first link, and the position coordinate of the second network device in the topology view is the second position coordinate; The third network device is the network device among the network devices with determined position coordinates that has no link with the first network device, and the position coordinate of the third network device in the topology view is the third position coordinate. The second network device and the third network device may not exist, or may be one or more. The number of the second network device and the third network device is not limited here.
[0166] The electronic device can determine the position coordinates of the first network device in the topology view (i.e., the first position coordinates) based on the second position coordinates and the first logical size of the second network device, as well as the third position coordinates and the first logical size of the third network device, such that the first logical range of the first network device does not intersect with the first logical ranges of all the second network devices and all the third network devices.
[0167] In the embodiments of the present application, to determine the first position coordinates, the electronic device can calculate the first minimum distance between the first network device and the second network device, and calculate the second minimum distance between the first network device and the third network device.
[0168] The first minimum distance is the sum value of the first length and the second length, that is, the first minimum distance is the sum value of the first logical size of the first network device, the first logical size of the second network device, and the preset multiple of the second logical size of the first link. The preset multiple can be 2, 3, etc., so the first minimum distance can be: the first logical size of the first network device + the first logical size of the second network device + 2×the second logical size of the first link. The preset multiple is not limited here.
[0169] The second minimum distance is the sum value of the first logical size of the first network device and the first logical size of the third network device.
[0170] In one example, the electronic device can use the second position coordinates of each second network device and the first minimum distance between each second network device and the first network device to determine the first area in the topology view where the distance (i.e., the first distance) between the first network device and all the second network devices is greater than or equal to the corresponding first minimum distance, and determine a position coordinate from the determined first area as the first position coordinates.
[0171] To reduce the space occupied by the network topology, the electronic device can determine the position coordinates where the first distance between the first network device and any second network device is equal to the corresponding first minimum distance as the first position coordinates. The electronic device can also randomly determine a position coordinate from the determined first area as the first position coordinates, which is not limited here.
[0172] After determining the first position coordinates, the electronic device can determine whether the distances (i.e., the second distances) between the current first position coordinates and all the third position coordinates are all greater than or equal to the corresponding second minimum distances.
[0173] If the second distance between the current first position coordinates and any third position coordinate is less than the corresponding second minimum distance, the electronic device adjusts the current first position coordinates so that the distance between the adjusted first position coordinates and the third position coordinate is greater than the second distance.
[0174] The electronic device can adjust the first position coordinate multiple times according to a preset adjustment step size until the distance between the adjusted first position coordinate and the third position coordinate is greater than or equal to the corresponding second minimum distance. The adjustment step size can be 5 unit lengths, 10 unit lengths, etc.; the electronic device can also directly adjust the first position coordinate to a position where the distance between it and the third position coordinate is greater than or equal to the corresponding second minimum distance, and there is no limitation on this.
[0175] If the second distance between the current first position coordinate and each third position coordinate is greater than or equal to the corresponding second minimum distance, the electronic device does not need to adjust the current first position coordinate.
[0176] In another example, the electronic device can use the second position coordinates of each second network device and the first minimum distance between each second network device and the first network device to determine a first area in the topological view where the first distance between the first network device and all second network devices is greater than or equal to the corresponding first minimum distance, and use the third position coordinates of each third network device and the second minimum distance between each third network device and the first network device to determine a second area in the topological view where the second distance between the first network device and all third network devices is greater than or equal to the corresponding second minimum distance.
[0177] The electronic device can determine a position coordinate as the first position coordinate from the intersection between the determined first area and the second area. The specific determination method can refer to the relevant description of determining the first position coordinate from the first area above. There is no limitation on the method of the first position coordinate of the electronic device here.
[0178] By traversing multiple network devices, the electronic device sequentially determines the position coordinates of each network device, so that the first logical ranges of each network device do not overlap, improving the view rendering effect.
[0179] In some embodiments, after determining the first position coordinates of the first network device, the electronic device may further determine the fourth position coordinates on the first link. The fourth position coordinates are the center of the second logical range through which the first link passes. The distance between the fourth position coordinates and the second position coordinates is greater than or equal to the sum of the first logical size of the second network device and the second logical size of the first link. The distance between the fourth position coordinates and the first position coordinates is greater than or equal to the sum of the first logical size of the first network device and the second logical size of the first link. The distance between the fourth position coordinates and the third position coordinates is greater than or equal to the sum of the first logical size of the third network device and the second logical size of the first link. The distance between the fourth position coordinates and the fifth position coordinates is greater than or equal to the sum of the second logical size of the first link and the second logical size of the second link. The fifth position coordinates are the center of the second logical range through which the second link passes.
[0180] In the embodiments of the present application, the second link is a link whose center of the second logical range has been determined, and the determined center of the second logical range is the fifth position coordinates. For each first link, the electronic device may determine a position coordinate on the first link as the center of the second logical range of the first link, and the determined position coordinate is the fourth position coordinates on the first link, so that the second logical range of the first link does not intersect with the first logical range of the first network device, the first logical range of the second network device corresponding to the first link, the first logical range of the third network device, and the second logical range of the second link.
[0181] To determine the fourth position coordinates, the electronic device may calculate the third minimum distance between the first network device and the second logical range of the first link, calculate the fourth minimum distance between the second network device and the second logical range of the first link, calculate the fifth minimum distance between the third network device and the second logical range of the first link, and calculate the sixth minimum distance between the second logical range of the first link and the second logical range of the second link.
[0182] The third minimum distance is the sum of the first logical size of the first network device and the second logical size of the first link. The fourth minimum distance is the sum of the first logical size of the second network device and the second logical size of the first link. The fifth minimum distance is the sum of the first logical size of the third network device and the second logical size of the first link. The sixth minimum distance is the sum of the second logical size of the first link and the second logical size of the second link.
[0183] The electronic device may determine, on a first link, a position coordinate whose distance from the first position coordinate is greater than or equal to a third minimum distance, whose distance from the second position coordinates of each second network device is greater than or equal to a corresponding fourth minimum distance, whose distance from the third position coordinates of each third network device is greater than or equal to a corresponding fifth minimum distance, and whose distance from the fifth position coordinates on each second link is greater than or equal to a corresponding sixth minimum distance, and use the determined position coordinate as the fourth position coordinate.
[0184] In the technical solution provided by the embodiments of the present application, the electronic device considers the second annotation information of the link to avoid the non - overlap between the second logical range of the link and the first logical range of the network device, further improving the display effect of the network topology.
[0185] In some embodiments, if the electronic device fails to determine the fourth position coordinate, it adjusts the first position coordinate of the first network device to obtain a sixth position coordinate, where the distance between the sixth position coordinate and the second position coordinate is greater than a first distance, and the distance between the sixth position coordinate and the third position coordinate is greater than a second distance; then it re - executes the step of determining the fourth position coordinate on the first link.
[0186] In the embodiments of the present application, there may be no fourth position coordinate on the first link that satisfies the conditions. In this case, the electronic device can adjust the first position coordinate and adjust the first position coordinate to a position coordinate far from the second position coordinate and the third position coordinate. The adjusted first position coordinate is the sixth position coordinate.
[0187] The electronic device may use the sixth position coordinate as the new first position coordinate of the first network device, and re - determine the fourth position coordinate on the first link as the center of the second logical range of the first link according to the new first position coordinate, the second position coordinate, the third position coordinate, and the fifth position coordinate.
[0188] The electronic device may repeatedly execute the steps of adjusting the first position coordinate of the first network device to obtain the sixth position coordinate and determining the fourth position coordinate on the first link until the first position coordinate and the fourth position coordinate are determined.
[0189] In the embodiments of the present application, there may be multiple links between two network devices. When the electronic device determines the position coordinates of the network devices and the center of the second logical range of the link, it may regard these multiple links as 1 link, and use the largest second logical size among the multiple links as the second logical size of these multiple links. When drawing the link, the electronic device may draw multiple links between these two network devices and add the second annotation information of each of these multiple links respectively, and there is no limitation on this.
[0190] Such as Figure 6Taking the logical structure of the network topology shown as an example where the device icon is a circular icon and the annotation information is presented in the form of a ring, there is no overlap in the first logical range of 4 network devices and the second logical range of 3 links. In this way, when subsequently drawing network devices and links and adding the first annotation information and the second annotation information, there will be no overlap in the annotation information.
[0191] In the embodiments of the present application, Figure 1 the network topology shown includes 4 network devices from Node 1 to Node 4. Among them, the number of annotation information to be displayed for Node 2 is 3, the number of annotation information to be displayed for Node 3 is 5, and the number of annotation information to be displayed for Node 4 is 5. Taking the device icon as a circular icon and the annotation information as a ring as an example, the electronic device can obtain the logical structure of the network topology as Figure 7a shown. On the basis of Figure 7a , the electronic device can draw the icons of the nodes and the links and add annotation information, such as the network topology after adding annotation information as Figure 7b shown.
[0192] Applying the technical solution provided by the embodiments of the present application, the logical size of each network device is calculated through the annotation information of the network device, the logical size of each link is calculated through the annotation information of the link, the minimum distance between the network devices with links is determined through the logical size of the network device and the logical size of the link, and mutual exclusion calculation is performed according to the logical size of the network device and the logical size of the link to obtain the position coordinates of each network device, achieving the effect that the boundaries of the network device (i.e., the first logical range) and the boundaries of the link (i.e., the second logical range) do not overlap.
[0193] Through the above key points, automatic layout and dynamic layout can be realized, the appropriate positions of each network device can be automatically calculated, the relevant annotation information of the network device and the link do not overlap or cover, and the distance between network devices is neither too large nor too small, making the topological layout reach a relatively ideal effect.
[0194] In addition, the technical solution provided by the embodiments of the present application does not require manually dragging to adjust the positions of the topological network devices, and can achieve the effect that various annotation information in the topological display does not overlap or cover each other. The positions of each network device dynamically calculated through the actual annotation information of the network device and the link can make the topological display effect better, and there will be no problem of excessive node spacing when various annotation information does not overlap or cover.
[0195] Corresponding to the above network topology drawing method, the embodiments of the present application provide a network topology drawing device, as Figure 8 shown. The network topology drawing device includes:
[0196] An obtaining module 81, configured to obtain first annotation information and connection information of a plurality of network devices included in a network formation;
[0197] A first determination module 82, configured to determine a first logical size of each network device according to an icon of each network device, the first annotation information, and a preset information radius, where the preset information radius indicates a radius of a logical range occupied by a device icon and annotation information;
[0198] A second determination module 83, configured to determine position coordinates of each network device in a topology view by using the first logical size of each network device;
[0199] A drawing module 84, configured to draw an icon of each network device at the position coordinates of each network device in the topology view, and draw links between a plurality of network devices between the icons of the plurality of network devices according to the connection information;
[0200] An adding module 85, configured to add the first annotation information of each network device within a first logical range where an icon of each network device is located in the topology view, and a size of the first logical range where the icon of each network device is located is the first logical size of each network device.
[0201] In the technical solution provided by the embodiment of the present application, the first annotation information of each network device is used to determine the logical size of each network device, and the position coordinates of each network device are determined according to the logical size. In the process of calculating the logical size of each network device in the technical solution provided by the embodiment of the present application, the first annotation information is considered. Furthermore, in the process of determining the position coordinates of each network device in the topology view, the network device itself and the first annotation information are comprehensively considered, the logical size is automatically adjusted according to the first annotation information, and then the distance between network devices is adjusted. In this way, the annotation information of different network devices will not overlap and cover each other, the problem that the annotation information of different network devices overlaps and covers each other is solved, and the rendering effect of the network topology is improved.
[0202] In some embodiments, the preset information radius may include a first radius corresponding to a device icon and a second radius corresponding to an annotation information; the first determination module 82 may specifically be configured to:
[0203] Calculate a product of the number of the first annotation information of each network device and the second radius to obtain a third radius of each network device; calculate a sum value of the third radius and the first radius of each network device to obtain the first logical size of each network device.
[0204] In some embodiments, the obtaining module 81 may further be configured to: obtain second annotation information of each link between a plurality of network devices;
[0205] The first determination module 82 can also be used to: determine the second logical size of each link according to the second annotation information of each link and a preset information radius;
[0206] The adding module 85 can also be used to: in the topology view, add the second annotation information of each link within the second logical range passed by each link, and the size of the second logical range passed by each link is the second logical size of each link;
[0207] The second determination module 83 can specifically be used to: determine the position coordinates of each network device in the topology view by using the first logical size of each network device and the second logical size of each link.
[0208] In some embodiments, the preset information radius may include a second radius corresponding to an annotation information; the first determination module 82 can specifically be used to:
[0209] Calculate the product of the number of the second annotation information of each link and the second radius to obtain the second logical size of each link.
[0210] In some embodiments, the second determination module 83 can specifically be used to:
[0211] Traverse the network devices to be determined for position coordinates among multiple network devices in a preset traversal order to obtain a first network device;
[0212] Determine the first position coordinates of the first network device according to the second position coordinates of a second network device and the third position coordinates of a third network device whose position coordinates have been determined in the topology view;
[0213] Wherein, there is a link between the second network device and the first network device, and there is no link between the third network device and the first network device; the first distance between the first position coordinates and the second position coordinates is greater than or equal to the sum value of a first length and a second length, the first length is the sum value of the first logical size of the first network device and the first logical size of the second network device, and the second length is the product of the second logical size of the first link between the second network device and the first network device and a preset multiple; the second distance between the first position coordinates and the third position coordinates is greater than or equal to the sum value of the first logical size of the first network device and the first logical size of the third network device.
[0214] In some embodiments, the second determination module 83 can also be used to:
[0215] After determining the first position coordinates of the first network device, determine the fourth position coordinates on the first link. The fourth position coordinates are the center of the second logical range passed by the first link. The distance between the fourth position coordinates and the second position coordinates is greater than or equal to the sum of the first logical dimension of the second network device and the second logical dimension of the first link. The distance between the fourth position coordinates and the first position coordinates is greater than or equal to the sum of the first logical dimension of the first network device and the second logical dimension of the first link. The distance between the fourth position coordinates and the third position coordinates is greater than or equal to the sum of the first logical dimension of the third network device and the second logical dimension of the first link. The distance between the fourth position coordinates and the fifth position coordinates is greater than or equal to the sum of the second logical dimension of the first link and the second logical dimension of the second link. The fifth position coordinates are the center of the second logical range passed by the second link.
[0216] In some embodiments, the second determination module 83 may further be configured to:
[0217] If the fourth position coordinates are not determined, adjust the first position coordinates of the first network device to obtain the sixth position coordinates. The distance between the sixth position coordinates and the second position coordinates is greater than the first distance, and the distance between the sixth position coordinates and the third position coordinates is greater than the second distance;
[0218] Re-execute the step of determining the fourth position coordinates on the first link.
[0219] The embodiments of the present application further provide an electronic device, as Figure 9 shown, including a processor 91, a communication interface 92, a memory 93, and a communication bus 94. Among them, the processor 91, the communication interface 92, and the memory 93 complete communication with each other through the communication bus 94;
[0220] The memory 93 is used to store a computer program;
[0221] The processor 91, when executing the program stored on the memory 93, implements the steps of any of the above network topology drawing methods.
[0222] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0223] The communication interface is used for communication between the above electronic device and other devices.
[0224] The memory may include a Random Access Memory (RAM), or may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0225] The aforementioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0226] In another embodiment provided by the present application, a computer-readable storage medium is further provided. A computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the above-mentioned any network topology drawing method is implemented.
[0227] In another embodiment provided by the present application, a computer program product containing instructions is further provided. When it runs on a computer, it causes the computer to execute the steps of any network topology drawing method in the above embodiments.
[0228] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (such as coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0229] It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements that are not explicitly listed, or further includes elements that are inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device that includes the element.
[0230] Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for the embodiments of the device, electronic device, computer storage medium, and computer program product, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments.
[0231] The above are only the preferred embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application are all included in the protection scope of the present application.
Claims
1. A network topology drawing method, characterized in that: The method comprises: Acquire first annotation information and connection information of a plurality of network devices included in the network; Determine a first logical size of each network device according to the icon and the first annotation information of each network device, and a preset information radius, wherein the preset information radius indicates the radius of a logical range occupied by the device icon and the annotation information; Determine the location coordinates of each network device in the topology view using the first logical size of each network device; In the topology view, an icon of each network device is drawn at the position coordinates of each network device, and links between the multiple network devices are drawn between the icons of the multiple network devices according to the connection information; In the topology view, first annotation information of each network device is added to the first logical range where the icon of each network device is located, and the size of the first logical range where the icon of each network device is located is the first logical size of each network device.
2. The method according to claim 1, characterized in that The preset information radius includes a first radius corresponding to the device icon and a second radius corresponding to an annotation information; The step of determining the first logical size of each network device according to the icon and the first annotation information of each network device and the preset information radius includes: Calculate the product of the amount of first annotation information of each network device and the second radius to obtain a third radius of each network device; The sum of the third radius of each network device and the first radius is calculated to obtain the first logical size of each network device.
3. The method according to claim 1, characterized in that The method further comprises: Acquire second annotation information of each link between the plurality of network devices; Determine a second logical size of each link according to the second annotation information of each link and the preset information radius; In the topology view, second annotation information of each link is added to the second logical range through which each link passes, and the size of the second logical range through which each link passes is the second logical size of each link; The step of determining the location coordinates of each network device in the topology view by using the first logical size of each network device includes: The location coordinates of each network device in the topology view are determined using the first logical size of each network device and the second logical size of each link.
4. The method according to claim 3, characterized in that: The preset information radius includes a second radius corresponding to the annotation information; The step of determining the second logical size of each link according to the second annotation information of each link and the preset information radius includes: The product of the amount of the second annotation information of each link and the second radius is calculated to obtain the second logical size of each link.
5. The method according to claim 3, characterized in that: The step of determining the position coordinates of each network device in the topology view by using the first logical size of each network device and the second logical size of each link comprises: Traversing the network devices whose location coordinates are to be determined among the plurality of network devices in a preset traversal order to obtain a first network device; Determine the first location coordinates of the first network device according to the second location coordinates of the second network device and the third location coordinates of the third network device whose location coordinates have been determined in the topology view; Among them, there is a link between the second network device and the first network device, and there is no link between the third network device and the first network device; the first distance between the first position coordinate and the second position coordinate is greater than or equal to the sum of the first length and the second length, the first length is the sum of the first logical size of the first network device and the first logical size of the second network device, and the second length is the product of the second logical size of the first link between the second network device and the first network device and a preset multiple; the second distance between the first position coordinate and the third position coordinate is greater than or equal to the sum of the first logical size of the first network device and the first logical size of the third network device.
6. The method according to claim 5, characterized in that After determining the first location coordinates of the first network device, the method further includes: Determine a fourth position coordinate on the first link, the fourth position coordinate being the center of a second logical range through which the first link passes, a distance between the fourth position coordinate and the second position coordinate being greater than or equal to the sum of a first logical size of the second network device and a second logical size of the first link, a distance between the fourth position coordinate and the first position coordinate being greater than or equal to the sum of a first logical size of the first network device and a second logical size of the first link, a distance between the fourth position coordinate and the third position coordinate being greater than or equal to the sum of a first logical size of the third network device and a second logical size of the first link, a distance between the fourth position coordinate and a fifth position coordinate being greater than or equal to the sum of a second logical size of the first link and a second logical size of the second link, and the fifth position coordinate being the center of the second logical range through which the second link passes.
7. The method according to claim 6, characterized in that The method further comprises: If the fourth position coordinate is not determined, adjusting the first position coordinate of the first network device to obtain a sixth position coordinate, wherein the distance between the sixth position coordinate and the second position coordinate is greater than the first distance, and the distance between the sixth position coordinate and the third position coordinate is greater than the second distance; The step of determining the fourth position coordinates on the first link is re-executed.
8. A network topology drawing device, characterized in that: The device comprises: An acquisition module, used to acquire first annotation information and connection information of a plurality of network devices included in the network; A first determination module, configured to determine a first logical size of each network device according to an icon and first annotation information of each network device, and a preset information radius, wherein the preset information radius indicates a radius of a logical range occupied by the device icon and the annotation information; A second determination module, configured to determine the position coordinates of each network device in the topology view by using the first logical size of each network device; A drawing module, used for drawing an icon of each network device at the position coordinates of each network device in the topology view, and drawing links between the multiple network devices between the icons of the multiple network devices according to the connection information; The adding module is used to add the first annotation information of each network device within the first logical range where the icon of each network device is located in the topology view, and the size of the first logical range where the icon of each network device is located is the first logical size of each network device.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-7 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.