Network topological graph generation method and device, computer equipment and storage medium
By randomly generating topology nodes in the network topology plane and determining the node connection relationship based on the heuristic factor value, the problem of difficulty in connecting relationship control in network topology simulation in the prior art is solved. The generated topology map is in line with the actual communication network situation and improves the generation efficiency.
Patent Information
- Application Number
- CN202411659747.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-20
AI Technical Summary
When simulating the communication network topology of the prior art, it is difficult to effectively control the connection relationship between nodes, resulting in excessive connections between nodes at far distances, network disconnection or node isolation, and cannot conform to the actual communication network situation.
By randomly generating multiple topology nodes in the network topology plane, and determining candidate nodes based on the interval distance between nodes, using the heuristic factor value to characterize the connection probability between the candidate node and the topology node, determining the node connection relationship, and finally generating a network topology diagram.
The generated network topology map can effectively avoid problems such as excessive connections, network disconnection, and node isolation from far away nodes, ensuring that the topology map complies with the actual situation of the communication network, reduce the generation complexity and improve efficiency.
Smart Images

Figure CN119561843A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of network technology and security technology, and in particular to a method, device, computer equipment and storage medium for generating a network topology map. Background Art
[0002] In research on routing simulation, traffic scheduling, path planning, etc., because building a real network topology test environment is costly and not flexible enough, graph models in graph theory are usually used to simulate actual communication networks.
[0003] However, it is difficult to control the connection relationship between nodes using the edges obtained by the above method. There may be problems such as too many connections between two distant nodes, disconnected network topology, and isolated nodes. These situations do not conform to the actual situation of the network and network simulation cannot be performed on this basis. Summary of the invention
[0004] Based on this, it is necessary to provide a network topology map generation method, device, computer equipment and storage medium that can meet the actual situation of the network in order to solve the above technical problems.
[0005] In a first aspect, the present application provides a method for generating a network topology diagram. The method comprises:
[0006] Randomly generate multiple topological nodes in the network topology plane;
[0007] According to the interval distances between different topological nodes, determine the target number of candidate nodes corresponding to each topological node in turn; wherein the candidate nodes are nodes in each topological node;
[0008] Determine the node connection relationship corresponding to each topological node according to the heuristic factor value of the candidate node corresponding to each topological node; wherein the initiation factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topological node;
[0009] According to the node connection relationship corresponding to each of the topological nodes, each of the topological nodes is connected to generate a network topological graph.
[0010] In one embodiment, determining the node connection relationship corresponding to each of the topological nodes according to the heuristic factor value of the candidate node corresponding to each of the topological nodes includes:
[0011] For each topological node, determining the heuristic factor value and the random factor value of each candidate node corresponding to the topological node;
[0012] Determine the protection distance corresponding to the topological node;
[0013] According to the protection distance, and the heuristic factor value and the random factor value of each candidate node, a target node connected to the topological node is selected from each candidate node to obtain a node connection relationship corresponding to the topological node.
[0014] In one embodiment, selecting a target node connected to the topological node from each of the candidate nodes according to the protection distance and the heuristic factor value and the random factor value of each of the candidate nodes includes:
[0015] For each candidate node, if the random factor value of the candidate node is greater than the heuristic factor value, and the interval distance between the candidate node and the topological node is greater than the protection distance, the candidate node is used as a target node connected to the topological node.
[0016] In one embodiment, determining the heuristic factor value of each candidate node corresponding to the topological node includes:
[0017] For each candidate node, obtain the current connectivity corresponding to the topological node, the current total connectivity corresponding to each of the topological nodes, and the interval distance between the candidate node and the topological node;
[0018] The heuristic factor value corresponding to the candidate node is determined according to preset adjustment parameters, the total number of topological nodes, the current connectivity corresponding to the topological node, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node.
[0019] In one embodiment, determining the target number of candidate nodes corresponding to each topological node in sequence according to the interval distance between each topological node includes:
[0020] For each topological node, sort the other topological nodes in ascending order according to the distance between the topological node and other topological nodes;
[0021] The target number of nodes ranked first among the other topological nodes are used as candidate nodes corresponding to the topological node.
[0022] In one embodiment, the target number is related to the average degree of each of the topological nodes.
[0023] In a second aspect, the present application also provides a network topology map generating device. The device comprises:
[0024] A generation module, used for randomly generating a plurality of topological nodes in a network topological plane;
[0025] A first determination module is used to determine, in sequence, a target number of candidate nodes corresponding to each of the topological nodes according to the interval distances between different topological nodes; wherein the candidate nodes are nodes in each of the topological nodes;
[0026] A second determination module is used to determine the node connection relationship corresponding to each of the topological nodes according to the heuristic factor value of the candidate node corresponding to each of the topological nodes; wherein the heuristic factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topological node;
[0027] The connection module is used to connect each of the topological nodes according to the node connection relationship corresponding to each of the topological nodes to generate a network topology diagram.
[0028] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0029] Randomly generate multiple topological nodes in the network topology plane;
[0030] According to the interval distances between different topological nodes, determine the target number of candidate nodes corresponding to each topological node in turn; wherein the candidate nodes are nodes in each topological node;
[0031] Determine the node connection relationship corresponding to each topological node according to the heuristic factor value of the candidate node corresponding to each topological node; wherein the initiation factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topological node;
[0032] According to the node connection relationship corresponding to each of the topological nodes, each of the topological nodes is connected to generate a network topological graph.
[0033] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0034] Randomly generate multiple topological nodes in the network topology plane;
[0035] According to the interval distances between different topological nodes, determine the target number of candidate nodes corresponding to each topological node in turn; wherein the candidate nodes are nodes in each topological node;
[0036] Determine the node connection relationship corresponding to each topological node according to the heuristic factor value of the candidate node corresponding to each topological node; wherein the initiation factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topological node;
[0037] According to the node connection relationship corresponding to each of the topological nodes, each of the topological nodes is connected to generate a network topological graph.
[0038] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0039] Randomly generate multiple topological nodes in the network topology plane;
[0040] According to the interval distances between different topological nodes, determine the target number of candidate nodes corresponding to each topological node in turn; wherein the candidate nodes are nodes in each topological node;
[0041] Determine the node connection relationship corresponding to each topological node according to the heuristic factor value of the candidate node corresponding to each topological node; wherein the initiation factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topological node;
[0042] According to the node connection relationship corresponding to each of the topological nodes, each of the topological nodes is connected to generate a network topological graph.
[0043] The above-mentioned network topology map generation method, device, computer equipment and storage medium randomly generate multiple topology nodes in the network topology plane and determine the target number of candidate nodes corresponding to each topology node, so as to determine the node connection relationship corresponding to each topology node according to the heuristic factor value of the candidate node corresponding to each topology node, and then, according to the node connection relationship corresponding to each topology node, connect each topology node to generate a network topology map. According to the above content, the present application determines the target number of candidate nodes corresponding to each topological node, and the heuristic factor value of the candidate node corresponding to each topological node, wherein the initiation factor value is used to characterize the connection probability between the candidate node and the corresponding topological node; therefore, the present application implements connection relationship screening of the candidate nodes corresponding to each topological node through the heuristic factor value of the candidate node corresponding to each topological node, and determines the node connection relationship corresponding to each topological node. Since the heuristic factor value of the present application is not randomly generated, but is determined based on the total number of topological nodes, the current connectivity corresponding to the topological node, and the current total connectivity corresponding to each topological node, therefore, the network topology map generated by the present application based on the node connection relationship corresponding to each topological node will not have problems such as too many connection relationships between two nodes that are far apart, disconnected network topology, and isolated nodes, thereby ensuring that the generated network topology map conforms to the actual situation of the communication network, reducing the complexity of generating the network topology map, and improving the efficiency of generating the network topology map. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] FIG1 is an application environment diagram of a network topology diagram generation method provided in an embodiment of the present application;
[0045] FIG2 is a schematic diagram of a flow chart of a first network topology diagram generating method provided in an embodiment of the present application;
[0046] FIG3 is a schematic diagram of a flow chart of a second network topology diagram generating method provided in an embodiment of the present application;
[0047] FIG4 is a schematic diagram of a flow chart of a third network topology diagram generating method provided in an embodiment of the present application;
[0048] FIG5 is a schematic diagram of a flow chart of a fourth network topology diagram generating method provided in an embodiment of the present application;
[0049] FIG6 is a structural block diagram of a network topology diagram generating device provided in an embodiment of the present application;
[0050] FIG. 7 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0052] The network topology map generation method provided in the embodiment of the present application can be applied in the application environment shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. By randomly generating multiple topological nodes in the network topology plane, and determining the target number of candidate nodes corresponding to each topological node, so as to achieve the node connection relationship corresponding to each topological node according to the heuristic factor value of the candidate node corresponding to each topological node, and then, according to the node connection relationship corresponding to each topological node, each topological node is connected to generate a network topology map. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0053] In one embodiment, as shown in FIG. 2 , a method for generating a network topology diagram is provided, which is described by taking the method applied to the server 104 in FIG. 1 as an example, and includes the following steps:
[0054] S201, randomly generate multiple topological nodes in the network topology plane.
[0055] It should be noted that when multiple topological nodes need to be randomly generated, the number of topological nodes to be generated can be determined according to the actual communication network situation, and then, based on the number of topological nodes, multiple topological nodes are randomly generated in the network topological plane.
[0056] Furthermore, an adapted network topology generator may be called to realize random generation of multiple topology nodes in the network topology plane after the number of topology nodes and related required parameters are input into the network topology generator.
[0057] In one embodiment of the present application, multiple topology nodes can be randomly generated in a network topology plane based on Python (a programming language) and NetworkX (a Python library) libraries, or multiple topology nodes can be randomly generated in a network topology plane based on a Brite (a topology generator) topology generator.
[0058] S202: According to the interval distances between different topological nodes, determine the target number of candidate nodes corresponding to each topological node in turn.
[0059] The candidate nodes are nodes in each topological node.
[0060] It should be noted that the interval distances between different topological nodes can be obtained in advance, and then, according to the interval distances between the topological nodes and other topological nodes, the other topological nodes are sorted in order from small to large, and according to the sorting results, a target number of nodes are selected as candidate nodes corresponding to each topological node.
[0061] In one embodiment of the present application, for each topological node, other topological nodes are sorted in ascending order according to the distance between the topological node and other topological nodes; then, a target number of nodes ranked in front of other topological nodes are used as candidate nodes corresponding to the topological node.
[0062] It should be noted that the target number is related to the average degree of each topological node. Further, when the target number needs to be determined, the average degree of each topological node and a preset value may be summed, and the result of the calculation is the target number.
[0063] In one embodiment of the present application, if the preset value is 1, when the target quantity needs to be determined, it can be based on the following formula:
[0064] K= +1;
[0065] Among them, K refers to the target number; 1 is the preset value; refers to the average degree of each topological node, and >2.
[0066] S203: Determine the node connection relationship corresponding to each topological node according to the heuristic factor value of the candidate node corresponding to each topological node.
[0067] The activation factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topological node; the node connection relationship is used to characterize which candidate nodes have a connection relationship with the topological node.
[0068] It should be noted that when it is necessary to determine the node connection relationship corresponding to each topological node, the heuristic factor value of each candidate node corresponding to each topological node can be determined in advance, and then, based on the heuristic factor value of each candidate node corresponding to each topological node, the node connection relationship corresponding to each topological node can be determined.
[0069] Among them, when determining the heuristic factor value of each candidate node corresponding to each topological node, it is necessary to combine the total number of topological nodes, the current connectivity corresponding to each topological node, the current total connectivity corresponding to each topological node, and the interval distance between each candidate node and the corresponding topological node.
[0070] In one embodiment of the present application, for each topological node, it can be verified whether the heuristic factor value of each candidate node corresponding to the topological node is greater than a preset factor value threshold. If the heuristic factor value of a candidate node is greater than the preset factor value threshold, the candidate node is regarded as a node that has a node connection relationship with the topological node; if the heuristic factor value of a candidate node is not greater than the preset factor value threshold, it is determined that the candidate node is not a node that has a node connection relationship with the topological node.
[0071] In one embodiment of the present application, for each topological node, the random factor value of each candidate node corresponding to the topological node can be determined in advance, and then, it is verified whether the random factor value of each candidate node is greater than the heuristic factor value. If the random factor value of a candidate node is greater than the heuristic factor value, the candidate node is regarded as a node that has a node connection relationship with the topological node; if the random factor value of a candidate node is not greater than the heuristic factor value, it is determined that the candidate node is not a node that has a node connection relationship with the topological node.
[0072] S204, connecting the topological nodes according to the node connection relationship corresponding to each topological node to generate a network topological graph.
[0073] In one embodiment of the present application, when it is necessary to connect each topological node according to the node connection relationship corresponding to each topological node to generate a network topology diagram, a professional network topology diagram drawing software can be pre-selected, and then, according to the multiple topological nodes randomly generated in the network topology plane and the node connection relationship corresponding to each topological node, the topological nodes are connected using straight lines, curves or specific line segments to represent the communication path or connection relationship between them, and each topological node is ensured to be correctly connected to its adjacent topological node according to the determined topological edge; and text notes are added next to the topological node or on the connection line to provide additional information about the node or connection, wherein the additional information may include device model, IP address, port number, connection speed, etc. Finally, the operation of generating a network topology diagram can be realized by modifying and improving the connected topological nodes according to actual needs.
[0074] The above-mentioned network topology map generation method randomly generates multiple topology nodes in the network topology plane and determines the target number of candidate nodes corresponding to each topology node, so as to determine the node connection relationship corresponding to each topology node according to the heuristic factor value of the candidate node corresponding to each topology node, and then, according to the node connection relationship corresponding to each topology node, connect each topology node to generate a network topology map. According to the above content, the present application determines the target number of candidate nodes corresponding to each topological node, and the heuristic factor value of the candidate node corresponding to each topological node, wherein the initiation factor value is used to characterize the connection probability between the candidate node and the corresponding topological node; therefore, the present application implements connection relationship screening of the candidate nodes corresponding to each topological node through the heuristic factor value of the candidate node corresponding to each topological node, and determines the node connection relationship corresponding to each topological node. Since the heuristic factor value of the present application is not randomly generated, but is determined based on the total number of topological nodes, the current connectivity corresponding to the topological node, and the current total connectivity corresponding to each topological node, therefore, the network topology map generated by the present application based on the node connection relationship corresponding to each topological node will not have problems such as too many connection relationships between two nodes that are far apart, disconnected network topology, and isolated nodes, thereby ensuring that the generated network topology map conforms to the actual situation of the communication network, reducing the complexity of generating the network topology map, and improving the efficiency of generating the network topology map.
[0075] In one embodiment, as shown in FIG3 , when it is necessary to determine the node connection relationship corresponding to each topological node according to the heuristic factor value of the candidate node corresponding to each topological node, the following contents may be specifically included:
[0076] S301 : for each topological node, determining the heuristic factor value and the random factor value of each candidate node corresponding to the topological node.
[0077] It should be noted that when it is necessary to determine the heuristic factor value of each candidate node corresponding to a topological node, the following may be specifically included: for each candidate node, obtain the current connectivity corresponding to the topological node, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node; determine the heuristic factor value corresponding to the candidate node based on preset adjustment parameters, the total number of topological nodes, the current connectivity corresponding to the topological node, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node.
[0078] Specifically, according to the above content, the formula for determining the heuristic factor value is as follows:
[0079] ;
[0080] in, refers to the heuristic factor value; Refers to the adjustment parameters; Refers to the number of edges determined in the network topology plane at the current moment; e k Refers to the current connectivity corresponding to the topological node; d k It refers to the distance between the candidate node and the topological node; N refers to the total number of topological nodes.
[0081] To further explain, when it is necessary to determine the random factor value of each candidate node corresponding to a topological node, the value range corresponding to the random factor value can be pre-specified, and then, for each candidate node corresponding to the topological node, an operation of randomly selecting a value within the value range as the random factor value is performed to achieve the operation of determining the random factor value of each candidate node corresponding to the topological node.
[0082] As an example, the value range corresponding to the random factor value may be [0, 1]. Therefore, when determining the random factor value of each candidate node corresponding to the topological node, it is necessary to randomly select a value in [0, 1] as the random factor value of each candidate node.
[0083] S302: Determine the protection distance corresponding to the topological node.
[0084] It should be noted that the protection distance refers to the minimum distance between two topological nodes with a node connection relationship. Furthermore, the protection distance can be set or adjusted according to actual conditions and the historical experience of operation and maintenance personnel. The value range of the protection distance is not limited here.
[0085] S303 , selecting a target node connected to the topological node from each candidate node according to the protection distance, and the heuristic factor value and the random factor value of each candidate node, so as to obtain a node connection relationship corresponding to the topological node.
[0086] It should be noted that in order to avoid problems such as too many connections between two nodes that are far apart, disconnected network topology, and isolated nodes, the following content can be included when selecting a target node to be connected to a topological node from each candidate node: For each candidate node, if the random factor value of the candidate node is greater than the heuristic factor value, and the interval distance between the candidate node and the topological node is greater than the protection distance, the candidate node will be used as the target node to be connected to the topological node.
[0087] In one embodiment of the present application, when it is necessary to determine the node connection relationship corresponding to the topological node, the heuristic factor value of each candidate node corresponding to the topological node can be determined for each candidate node in each topological node. and random factor value R; determine the protection distance r corresponding to the topological node; therefore, when the random factor value R> heuristic factor value , and the distance between the candidate node and the topological node >When the protection distance is r (m and n are node numbers, and m≠n), the candidate node is used as the target node to connect to the topological node.
[0088] The above-mentioned network topology map generation method determines the heuristic factor value and random factor value of each candidate node corresponding to the topological node, so as to select the target node connected to the topological node from each candidate node according to the protection distance, as well as the heuristic factor value and random factor value of each candidate node, so as to obtain the node connection relationship corresponding to the topological node, so as to ensure that there will not be too many connection relationships between two nodes with a long distance, the network topology is not connected, the node is isolated, and other problems, thereby ensuring that the generated network topology map conforms to the actual situation of the communication network, reducing the complexity of generating the network topology map, and improving the efficiency of generating the network topology map.
[0089] In one embodiment, as shown in FIG. 4 , when it is necessary to sequentially determine the target number of candidate nodes corresponding to each topological node according to the interval distance between each topological node, the following may be specifically included:
[0090] S401 , for each topological node, sort other topological nodes in ascending order according to the distance between the topological node and other topological nodes.
[0091] In one embodiment of the present application, when it is necessary to sort other topological nodes, the interval distance between the topological node and the other topological nodes can be determined in advance, and then the order of each other topological node in the sorting result can be determined in order from small to large according to the interval distance, so as to realize the operation of sorting other topological nodes.
[0092] The interval distance between a topological node and other topological nodes may be the Euclidean distance between the topological node and other topological nodes.
[0093] S402: select a target number of nodes ranked in front of other topological nodes as candidate nodes corresponding to the topological node.
[0094] In one embodiment of the present application, when it is necessary to determine the candidate nodes corresponding to a topological node, the target number can be determined in advance based on the average degree of each topological node, and then the target number of nodes ranked in front of other topological nodes can be used as candidate nodes corresponding to the topological node.
[0095] The above-mentioned network topology map generation method, by sorting other topological nodes, realizes that the target number of nodes sorted in front of other topological nodes are used as candidate nodes corresponding to the topological nodes, which provides a data basis for the subsequent determination of the node connection relationship corresponding to each topological node and ensures the smooth progress of subsequent operations.
[0096] In one embodiment, as shown in FIG5 , when a network topology diagram needs to be generated, the following contents may be specifically included:
[0097] S501, randomly generate multiple topological nodes in the network topological plane.
[0098] S502 , for each topological node, sort other topological nodes in ascending order according to the distance between the topological node and other topological nodes.
[0099] S503: select a target number of nodes that are ranked first among other topological nodes as candidate nodes corresponding to the topological node.
[0100] S504, for each candidate node, obtain the current connectivity corresponding to the topological node, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node.
[0101] S505, determining the heuristic factor value corresponding to the candidate node according to the preset adjustment parameters, the total number of topological nodes, the current connectivity corresponding to the topological node, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node.
[0102] S506: Determine the random factor value of each candidate node corresponding to the topological node.
[0103] S507: Determine the protection distance corresponding to the topological node.
[0104] S508: If the random factor value of the candidate node is greater than the heuristic factor value, and the interval distance between the candidate node and the topological node is greater than the protection distance, the candidate node is used as a target node connected to the topological node.
[0105] S509: Connect the topological nodes according to the node connection relationship corresponding to each topological node to generate a network topological graph.
[0106] The above-mentioned network topology map generation method randomly generates multiple topology nodes in the network topology plane and determines the target number of candidate nodes corresponding to each topology node, so as to determine the node connection relationship corresponding to each topology node according to the heuristic factor value of the candidate node corresponding to each topology node, and then, according to the node connection relationship corresponding to each topology node, connect each topology node to generate a network topology map. According to the above content, the present application determines the target number of candidate nodes corresponding to each topological node, and the heuristic factor value of the candidate node corresponding to each topological node, wherein the initiation factor value is used to characterize the connection probability between the candidate node and the corresponding topological node; therefore, the present application implements connection relationship screening of the candidate nodes corresponding to each topological node through the heuristic factor value of the candidate node corresponding to each topological node, and determines the node connection relationship corresponding to each topological node. Since the heuristic factor value of the present application is not randomly generated, but is determined based on the total number of topological nodes, the current connectivity corresponding to the topological node, and the current total connectivity corresponding to each topological node, therefore, the network topology map generated by the present application based on the node connection relationship corresponding to each topological node will not have problems such as too many connection relationships between two nodes that are far apart, disconnected network topology, and isolated nodes, thereby ensuring that the generated network topology map conforms to the actual situation of the communication network, reducing the complexity of generating the network topology map, and improving the efficiency of generating the network topology map.
[0107] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0108] Based on the same inventive concept, the embodiment of the present application also provides a network topology map generation device for implementing the network topology map generation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more network topology map generation device embodiments provided below can refer to the limitations of the network topology map generation method above, and will not be repeated here.
[0109] In one embodiment, as shown in FIG6 , a network topology diagram generating device is provided, comprising: a generating module 10, a first determining module 20, a second determining module 30 and a connecting module 40, wherein:
[0110] The generating module 10 is used to randomly generate a plurality of topological nodes in the network topological plane.
[0111] The first determination module 20 is used to determine a target number of candidate nodes corresponding to each topological node in turn according to the interval distances between different topological nodes; wherein the candidate nodes are nodes in each topological node.
[0112] The second determination module 30 is used to determine the node connection relationship corresponding to each topological node according to the heuristic factor value of the candidate node corresponding to each topological node; wherein the heuristic factor value of the candidate node is used to represent the connection probability between the candidate node and the corresponding topological node.
[0113] The connection module 40 is used to connect the topological nodes according to the node connection relationship corresponding to each topological node to generate a network topology graph.
[0114] In one embodiment, for each topological node, determining the heuristic factor value and the random factor value of each candidate node corresponding to the topological node;
[0115] Determine the protection distance corresponding to the topological node;
[0116] According to the protection distance, the heuristic factor value and the random factor value of each candidate node, a target node connected to the topological node is selected from each candidate node to obtain a node connection relationship corresponding to the topological node.
[0117] For each candidate node, if the random factor value of the candidate node is greater than the heuristic factor value, and the interval distance between the candidate node and the topological node is greater than the protection distance, the candidate node is used as the target node connected to the topological node.
[0118] For each candidate node, obtain the current connectivity corresponding to the topological node, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node;
[0119] The heuristic factor value corresponding to the candidate node is determined according to the preset adjustment parameters, the total number of topological nodes, the current connectivity corresponding to the topological nodes, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node.
[0120] In one embodiment, for each topological node, other topological nodes are sorted in ascending order according to the distance between the topological node and other topological nodes;
[0121] The target number of nodes ranked in front of other topological nodes are used as candidate nodes corresponding to the topological node.
[0122] In one embodiment, the target number is related to the average degree of each topological node.
[0123] The above-mentioned network topology map generating device randomly generates multiple topology nodes in the network topology plane and determines the target number of candidate nodes corresponding to each topology node, so as to determine the node connection relationship corresponding to each topology node according to the heuristic factor value of the candidate node corresponding to each topology node, and then, according to the node connection relationship corresponding to each topology node, connect each topology node to generate a network topology map. According to the above content, the present application determines the target number of candidate nodes corresponding to each topological node, and the heuristic factor value of the candidate node corresponding to each topological node, wherein the initiation factor value is used to characterize the connection probability between the candidate node and the corresponding topological node; therefore, the present application implements connection relationship screening of the candidate nodes corresponding to each topological node through the heuristic factor value of the candidate node corresponding to each topological node, and determines the node connection relationship corresponding to each topological node. Since the heuristic factor value of the present application is not randomly generated, but is determined based on the total number of topological nodes, the current connectivity corresponding to the topological node, and the current total connectivity corresponding to each topological node, therefore, the network topology map generated by the present application based on the node connection relationship corresponding to each topological node will not have problems such as too many connection relationships between two nodes that are far apart, disconnected network topology, and isolated nodes, thereby ensuring that the generated network topology map conforms to the actual situation of the communication network, reducing the complexity of generating the network topology map, and improving the efficiency of generating the network topology map.
[0124] Each module in the above network topology diagram generating device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0125] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a network topology map generation method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0126] Those skilled in the art will understand that the structure shown in FIG. 7 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0127] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0128] Randomly generate multiple topological nodes in the network topology plane;
[0129] According to the interval distances between different topological nodes, the target number of candidate nodes corresponding to each topological node is determined in turn; wherein the candidate node is a node in each topological node;
[0130] According to the heuristic factor value of the candidate node corresponding to each topological node, the node connection relationship corresponding to each topological node is determined; wherein the initiation factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topological node;
[0131] According to the node connection relationship corresponding to each topological node, each topological node is connected to generate a network topology graph.
[0132] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0133] For each topological node, determine the heuristic factor value and random factor value of each candidate node corresponding to the topological node;
[0134] Determine the protection distance corresponding to the topological node;
[0135] According to the protection distance, the heuristic factor value and the random factor value of each candidate node, a target node connected to the topological node is selected from each candidate node to obtain a node connection relationship corresponding to the topological node.
[0136] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0137] For each candidate node, if the random factor value of the candidate node is greater than the heuristic factor value, and the interval distance between the candidate node and the topological node is greater than the protection distance, the candidate node is used as the target node connected to the topological node.
[0138] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0139] For each candidate node, obtain the current connectivity corresponding to the topological node, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node;
[0140] The heuristic factor value corresponding to the candidate node is determined according to the preset adjustment parameters, the total number of topological nodes, the current connectivity corresponding to the topological nodes, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node.
[0141] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0142] For each topological node, sort the other topological nodes in ascending order according to the distance between the topological node and other topological nodes;
[0143] The target number of nodes ranked in front of other topological nodes are used as candidate nodes corresponding to the topological node.
[0144] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0145] The target number is related to the average degree of each topological node.
[0146] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0147] Randomly generate multiple topological nodes in the network topology plane;
[0148] According to the interval distances between different topological nodes, the target number of candidate nodes corresponding to each topological node is determined in turn; wherein the candidate node is a node in each topological node;
[0149] According to the heuristic factor value of the candidate node corresponding to each topological node, the node connection relationship corresponding to each topological node is determined; wherein the initiation factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topological node;
[0150] According to the node connection relationship corresponding to each topological node, each topological node is connected to generate a network topology graph.
[0151] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0152] For each topological node, determine the heuristic factor value and random factor value of each candidate node corresponding to the topological node;
[0153] Determine the protection distance corresponding to the topological node;
[0154] According to the protection distance, the heuristic factor value and the random factor value of each candidate node, a target node connected to the topological node is selected from each candidate node to obtain a node connection relationship corresponding to the topological node.
[0155] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0156] For each candidate node, if the random factor value of the candidate node is greater than the heuristic factor value, and the interval distance between the candidate node and the topological node is greater than the protection distance, the candidate node is used as the target node connected to the topological node.
[0157] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0158] For each candidate node, obtain the current connectivity corresponding to the topological node, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node;
[0159] The heuristic factor value corresponding to the candidate node is determined according to the preset adjustment parameters, the total number of topological nodes, the current connectivity corresponding to the topological nodes, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node.
[0160] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0161] For each topological node, sort the other topological nodes in ascending order according to the distance between the topological node and other topological nodes;
[0162] The target number of nodes ranked in front of other topological nodes are used as candidate nodes corresponding to the topological node.
[0163] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0164] The target number is related to the average degree of each topological node.
[0165] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0166] Randomly generate multiple topological nodes in the network topology plane;
[0167] According to the interval distances between different topological nodes, the target number of candidate nodes corresponding to each topological node is determined in turn; wherein the candidate node is a node in each topological node;
[0168] According to the heuristic factor value of the candidate node corresponding to each topological node, the node connection relationship corresponding to each topological node is determined; wherein the initiation factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topological node;
[0169] According to the node connection relationship corresponding to each topological node, each topological node is connected to generate a network topology graph.
[0170] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0171] For each topological node, determine the heuristic factor value and random factor value of each candidate node corresponding to the topological node;
[0172] Determine the protection distance corresponding to the topological node;
[0173] According to the protection distance, the heuristic factor value and the random factor value of each candidate node, a target node connected to the topological node is selected from each candidate node to obtain a node connection relationship corresponding to the topological node.
[0174] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0175] For each candidate node, if the random factor value of the candidate node is greater than the heuristic factor value, and the interval distance between the candidate node and the topological node is greater than the protection distance, the candidate node is used as the target node connected to the topological node.
[0176] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0177] For each candidate node, obtain the current connectivity corresponding to the topological node, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node;
[0178] The heuristic factor value corresponding to the candidate node is determined according to the preset adjustment parameters, the total number of topological nodes, the current connectivity corresponding to the topological nodes, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node.
[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0180] For each topological node, sort the other topological nodes in ascending order according to the distance between the topological node and other topological nodes;
[0181] The target number of nodes ranked in front of other topological nodes are used as candidate nodes corresponding to the topological node.
[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0183] The target number is related to the average degree of each topological node.
[0184] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0185] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0186] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0187] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for generating a network topology graph, characterized in that: The method comprises: Randomly generate multiple topological nodes in the network topology plane; According to the interval distances between different topological nodes, determine the target number of candidate nodes corresponding to each topological node in turn; wherein the candidate nodes are nodes in each topological node; Determine the node connection relationship corresponding to each topological node according to the heuristic factor value of the candidate node corresponding to each topological node; wherein the initiation factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topological node; According to the node connection relationship corresponding to each of the topological nodes, each of the topological nodes is connected to generate a network topological graph.
2. The method according to claim 1, characterized in that: The determining, according to the heuristic factor value of the candidate node corresponding to each of the topological nodes, the node connection relationship corresponding to each of the topological nodes comprises: For each topological node, determining the heuristic factor value and the random factor value of each candidate node corresponding to the topological node; Determine the protection distance corresponding to the topological node; According to the protection distance, and the heuristic factor value and the random factor value of each candidate node, a target node connected to the topological node is selected from each candidate node to obtain a node connection relationship corresponding to the topological node.
3. The method according to claim 2, characterized in that The selecting a target node connected to the topological node from each of the candidate nodes according to the protection distance, and the heuristic factor value and the random factor value of each of the candidate nodes includes: For each candidate node, if the random factor value of the candidate node is greater than the heuristic factor value, and the interval distance between the candidate node and the topological node is greater than the protection distance, the candidate node is used as a target node connected to the topological node.
4. The method according to claim 2, characterized in that: The determining of the heuristic factor value of each candidate node corresponding to the topological node includes: For each candidate node, obtain the current connectivity corresponding to the topological node, the current total connectivity corresponding to each of the topological nodes, and the interval distance between the candidate node and the topological node; The heuristic factor value corresponding to the candidate node is determined according to preset adjustment parameters, the total number of topological nodes, the current connectivity corresponding to the topological node, the current total connectivity corresponding to each topological node, and the interval distance between the candidate node and the topological node.
5. The method according to any one of claims 1 to 4, characterized in that: The step of sequentially determining a target number of candidate nodes corresponding to each of the topological nodes according to the interval distances between the topological nodes includes: For each topological node, sort the other topological nodes in ascending order according to the distance between the topological node and other topological nodes; The target number of nodes ranked first among the other topological nodes are used as candidate nodes corresponding to the topological node.
6. The method according to any one of claims 1 to 4, characterized in that: The target number is related to the average degree of each of the topological nodes.
7. A network topology diagram generating device, characterized in that: The device comprises: A generation module, used for randomly generating a plurality of topological nodes in a network topological plane; A first determination module is used to determine, in sequence, a target number of candidate nodes corresponding to each of the topological nodes according to the interval distances between different topological nodes; wherein the candidate nodes are nodes in each of the topological nodes; A second determination module is used to determine the node connection relationship corresponding to each of the topological nodes according to the heuristic factor value of the candidate node corresponding to each of the topological nodes; wherein the heuristic factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topological node; The connection module is used to connect each of the topological nodes according to the node connection relationship corresponding to each of the topological nodes to generate a network topology diagram.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method for establishing sensor network with small world and scale-free properties
CN102185916A
Wireless network topology optimizing and generating method
CN103701647A
Fast convergence ant colony algorithm for satellite network topology generation
CN108540204A
Road network topological graph division method and device, equipment and computer program product
CN113821550A
Method for generating topology diagram, anomaly detection method, device, apparatus, and storage medium
WO2021109874A1