Network topology graph generation method and apparatus, computer device, and storage medium
By randomly generating topology nodes within the network topology plane and determining the connection relationships based on heuristic factor values, the problem of unreasonable node connections in the generation of network topology graphs in existing technologies is solved. The generated topology graph conforms to the actual situation of communication networks, reducing complexity and improving efficiency.
Patent Information
- Application Number
- CN202411659747.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2044-11-20
AI Technical Summary
In existing technologies for routing simulation, traffic scheduling, and path planning, the network topology simulated by graph models is difficult to control the connection relationships between nodes. This leads to problems such as too many connections between distant nodes, disconnected network topology, and isolated nodes, which cannot reflect the actual communication network situation.
By randomly generating multiple topology nodes in the network topology plane, candidate nodes are determined based on the distance between topology nodes and the heuristic factor value. The target number of candidate nodes are selected, and the node connection relationship is determined based on the heuristic factor value to generate a network topology graph.
The generated network topology map conforms to the actual situation of communication networks, avoiding problems such as multiple connections between distant nodes, network disconnection, and node isolation, reducing the complexity of topology map generation and improving generation efficiency.
Smart Images

Figure CN119561843B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of network technology and security technology, and particularly relates to a network topology graph generation method and device, computer equipment and a storage medium. BACKGROUND
[0002] In the research of route simulation, traffic scheduling, path planning and the like, because it is huge to build a real network topology test environment and not flexible enough, therefore, a graph model in graph theory is usually used to simulate an actual communication network.
[0003] However, the edges obtained by the above method are difficult to control the connection relationship between nodes, and there may be problems such as too many connection relationships between two nodes far away from each other, network topology not being connected, nodes being isolated and the like, which do not conform to the actual situation of the network, and network simulation cannot be performed on this basis. SUMMARY
[0004] Therefore, it is necessary to provide a network topology graph generation method, device, computer equipment and storage medium which can conform to the actual situation of the network in view of the above technical problems.
[0005] In a first aspect, the present application provides a network topology graph generation method. The method comprises:
[0006] randomly generating a plurality of topology nodes in a network topology plane;
[0007] determining a target number of candidate nodes corresponding to each topology node in turn according to the interval distance between different topology nodes; wherein the candidate node is a node in each topology node;
[0008] determining the node connection relationship corresponding to each topology node according to the heuristic factor value of the candidate node corresponding to each topology node; wherein the heuristic factor value of the candidate node is used to represent the connection probability between the candidate node and the corresponding topology node;
[0009] connecting each topology node according to the node connection relationship corresponding to each topology node to generate a network topology graph.
[0010] In one of the embodiments, the determining of the node connection relationship corresponding to each topology node according to the heuristic factor value of the candidate node corresponding to each topology node comprises:
[0011] determining the heuristic factor value and the random factor value of each candidate node corresponding to each topology node for each topology node;
[0012] determining the protection distance corresponding to the topology 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 with the topology node is selected from each candidate node, so as to obtain the node connection relationship corresponding to the topology node.
[0014] In one of the embodiments, the selecting a target node connected with the topology node from each candidate node according to the protection distance, and the heuristic factor value and the random factor value of each candidate node comprises:
[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 topology node is greater than the protection distance, the candidate node is taken as the target node connected with the topology node.
[0016] In one of the embodiments, the determining the heuristic factor value of each candidate node corresponding to the topology node comprises:
[0017] For each candidate node, the current connection degree corresponding to the topology node, the current total connection degree corresponding to each topology node, and the interval distance between the candidate node and the topology node are obtained.
[0018] According to the preset adjustment parameter, the total number of topology nodes, the current connection degree corresponding to the topology node, the current total connection degree corresponding to each topology node, and the interval distance between the candidate node and the topology node, the heuristic factor value corresponding to the candidate node is determined.
[0019] In one of the embodiments, the sequentially determining the target number of candidate nodes corresponding to each topology node according to the interval distance between each topology node comprises:
[0020] For each topology node, according to the interval distance between the topology node and other topology nodes, the other topology nodes are sorted in ascending order.
[0021] The target number of nodes in the other topology nodes sorted in front are taken as the candidate nodes corresponding to the topology node.
[0022] In one of the embodiments, the target number is related to the average degree of each topology node.
[0023] In a second aspect, the application further provides a network topology graph generation device. The device comprises:
[0024] A generation module is configured to randomly generate a plurality of topology nodes in a network topology plane.
[0025] The first determining module is configured to determine, according to interval distances between different topology nodes, a target number of candidate nodes corresponding to each topology node in sequence; wherein the candidate node is a node in each topology node;
[0026] The second determining module is configured to determine, according to heuristic factor values of the candidate nodes corresponding to each topology node, a node connection relationship corresponding to each topology node; wherein the heuristic factor value of the candidate node is used to represent a connection probability between the candidate node and the corresponding topology node.
[0027] The connecting module is configured to connect each topology node according to the node connection relationship corresponding to each topology node, so as to generate a network topology graph.
[0028] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0029] a plurality of topology nodes are randomly generated in a network topology plane;
[0030] a target number of candidate nodes corresponding to each topology node are determined in sequence according to interval distances between different topology nodes; wherein the candidate node is a node in each topology node;
[0031] a node connection relationship corresponding to each topology node is determined according to heuristic factor values of the candidate nodes corresponding to each topology node; wherein the heuristic factor value of the candidate node is used to represent a connection probability between the candidate node and the corresponding topology node.
[0032] each topology node is connected according to the node connection relationship corresponding to each topology node, so as to generate a network topology 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 the computer program is executed by a processor to implement the following steps:
[0034] a plurality of topology nodes are randomly generated in a network topology plane;
[0035] a target number of candidate nodes corresponding to each topology node are determined in sequence according to interval distances between different topology nodes; wherein the candidate node is a node in each topology node;
[0036] determine a node connection relationship corresponding to each of the topology nodes according to the heuristic factor value of the candidate node corresponding to each of the topology nodes; wherein the heuristic factor value of the candidate node is used to represent a connection probability between the candidate node and the corresponding topology node;
[0037] connect each of the topology nodes according to the node connection relationship corresponding to each of the topology nodes to generate a network topology graph.
[0038] In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the following steps:
[0039] randomly generating a plurality of topology nodes in a network topology plane;
[0040] determining a target number of candidate nodes corresponding to each of the topology nodes in sequence according to a spacing distance between different topology nodes; wherein the candidate node is a node in each of the topology nodes;
[0041] determine a node connection relationship corresponding to each of the topology nodes according to the heuristic factor value of the candidate node corresponding to each of the topology nodes; wherein the heuristic factor value of the candidate node is used to represent a connection probability between the candidate node and the corresponding topology node;
[0042] connect each of the topology nodes according to the node connection relationship corresponding to each of the topology nodes to generate a network topology graph.
[0043] The aforementioned network topology graph generation method, apparatus, computer equipment, and storage medium generate multiple topology nodes randomly within the network topology plane and determine a target number of candidate nodes corresponding to each topology node. This enables the determination of node connection relationships corresponding to each topology node based on the heuristic factor values of the candidate nodes. Furthermore, based on these node connection relationships, each topology node is connected to generate a network topology graph. As described above, this application determines the target number of candidate nodes corresponding to each topology node, as well as the heuristic factor value of each candidate node. The heuristic factor value characterizes the connection probability between a candidate node and its corresponding topology node. Therefore, this application uses the heuristic factor value of each candidate node to filter the connection relationships of each topology node, thus determining the node connection relationships. Since the heuristic factor value is not randomly generated but determined based on the total number of topology nodes, the current connectivity of each topology node, and the current total connectivity of each topology node, the network topology graph generated by this application based on the node connection relationships of each topology node will not have problems such as too many connections between distant nodes, disconnected network topology, or isolated nodes. This ensures that the generated network topology graph conforms to the actual situation of the communication network, reduces the complexity of generating the network topology graph, and improves the efficiency of generating the network topology graph. Attached Figure Description
[0044] Figure 1 This application provides an example of a network topology graph generation method.
[0045] Figure 2 A flowchart illustrating the first network topology graph generation method provided in this application embodiment;
[0046] Figure 3 A flowchart illustrating the second network topology graph generation method provided in this application embodiment;
[0047] Figure 4 A flowchart illustrating the third network topology graph generation method provided in this application embodiment;
[0048] Figure 5 A flowchart illustrating the fourth network topology graph generation method provided in this application embodiment;
[0049] Figure 6 A structural block diagram of a network topology graph generation device provided in an embodiment of this application;
[0050] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0051] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.
[0052] The network topology graph generation method provided by the embodiments of the present application can be applied in an application environment as shown in Figure 1 The terminal 102 communicates with the server 104 through the network. The data storage system can store the data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. A plurality of topology nodes are randomly generated in the network topology plane, and a target number of candidate nodes corresponding to each topology node are determined, 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 connect each topology node according to the node connection relationship corresponding to each topology node, so as to generate a network topology graph. The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle-mounted device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0053] In one embodiment, as shown in Figure 2 , a network topology graph generation method is provided. Taking the server 104 in Figure 1 as an example, the method includes the following steps:
[0054] S201, a plurality of topology nodes are randomly generated in the network topology plane.
[0055] It should be noted that when a plurality of topology nodes need to be randomly generated, the number of topology nodes to be generated can be determined according to the actual communication network, and then a plurality of topology nodes are randomly generated in the network topology plane according to the number of topology nodes.
[0056] Further, an adaptive network topology generator can be called to enable the network topology generator to randomly generate a plurality of topology nodes in the network topology plane after inputting the number of topology nodes and related demand parameters into the network topology generator.
[0057] In an embodiment of the present application, the plurality of topology nodes can be randomly generated in the network topology plane based on a Python (a programming language) and NetworkX (a Python library) library, or the plurality of topology nodes can be randomly generated in the network topology plane based on a Brite (a topology generator) topology generator.
[0058] S202, a target number of candidate nodes corresponding to each topology node is determined in sequence according to the interval distance between different topology nodes.
[0059] It should be noted that the interval distance between different topology nodes can be obtained in advance, and then, according to the interval distance between the topology node and other topology nodes, the other topology nodes are sorted in ascending order, and according to the sorting result, the target number of nodes are selected as the candidate nodes corresponding to each topology node.
[0060] It should be noted that the interval distance between different topology nodes can be obtained in advance, and then, according to the interval distance between the topology node and other topology nodes, the other topology nodes are sorted in ascending order, and according to the sorting result, the target number of nodes are selected as the candidate nodes corresponding to each topology node.
[0061] In an embodiment of the present application, for each topology node, the other topology nodes are sorted in ascending order according to the interval distance between the topology node and the other topology nodes; and then, the target number of nodes in the other topology nodes sorted in front are selected as the candidate nodes corresponding to the topology node.
[0062] It should be noted that the target number is related to the average degree of each topology node, and further, when the target number needs to be determined, the average degree of each topology node and a preset value can be operated in sum value, and the obtained operation result is the target number.
[0063] In an embodiment of the present application, if the preset value is 1, when the target number needs to be determined, the following formula can be used:
[0064] K= +1;
[0065] Wherein, K refers to the target number; 1 is the preset value; refers to the average degree of each topology node, and >2.
[0066] S203, the node connection relationship corresponding to each topology node is determined according to the heuristic factor value of the candidate node corresponding to each topology node.
[0067] Wherein, the heuristic factor value of the candidate node is used to represent the connection probability between the candidate node and the corresponding topology node; the node connection relationship is used to represent which candidate node and topology node exist connection relationship.
[0068] It should be noted that when it is necessary to determine the node connection relationship corresponding to each topology node, the heuristic factor value of each candidate node corresponding to each topology node can be determined in advance, and then the node connection relationship corresponding to each topology node is determined according to the heuristic factor value of each candidate node corresponding to each topology node.
[0069] In the process of determining the heuristic factor value of each candidate node corresponding to each topology node, the total number of topology nodes, the current connection degree of each topology node, the current total connection degree of each topology node, and the interval distance between each candidate node and the corresponding topology node need to be considered.
[0070] In an embodiment of the present application, for each topology node, it can be verified whether the heuristic factor value of each candidate node corresponding to the topology node is greater than the pre-set factor value threshold. If the heuristic factor value of a certain candidate node is greater than the pre-set factor value threshold, the candidate node is regarded as a node having a node connection relationship with the topology node. If the heuristic factor value of a certain candidate node is not greater than the pre-set factor value threshold, it is determined that the candidate node is not a node having a node connection relationship with the topology node.
[0071] In an embodiment of the present application, for each topology node, the random factor value of each candidate node corresponding to the topology 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 certain candidate node is greater than the heuristic factor value, the candidate node is regarded as a node having a node connection relationship with the topology node. If the random factor value of a certain candidate node is not greater than the heuristic factor value, it is determined that the candidate node is not a node having a node connection relationship with the topology node.
[0072] S204, connecting each topology node according to the node connection relationship corresponding to each topology node to generate a network topology graph.
[0073] In an embodiment of the present application, when it is necessary to connect each topology node according to the node connection relationship corresponding to each topology node to generate a network topology graph, a professional network topology graph drawing software can be selected in advance, and then the topology nodes are connected by using straight lines, curves or specific connection segments to represent the communication paths or connection relationships therebetween according to the randomly generated plurality of topology nodes in the network topology plane and the node connection relationship corresponding to each topology node, so as to ensure that each topology node is correctly connected with its adjacent topology nodes. In addition, text notes can be added beside the topology nodes or on the connection lines to provide additional information about the nodes or connections, wherein the additional information can include device model, IP address, port number, connection speed, etc. Finally, the connected topology nodes can be modified and improved according to actual needs to realize the operation of generating a network topology graph.
[0074] According to the above content, it can be known that the application determines the target number of candidate nodes corresponding to each topology node and the heuristic factor value of the candidate nodes corresponding to each topology node, wherein the heuristic factor value is used to represent the connection probability between the candidate node and the corresponding topology node. Therefore, the application realizes the connection relationship screening of the candidate nodes corresponding to each topology node through the heuristic factor value of the candidate nodes corresponding to each topology node, and realizes the determination of the node connection relationship corresponding to each topology node. Since the heuristic factor value is not randomly generated, but is determined according to the total number of topology nodes, the current connection degree corresponding to the topology node, and the current total connection degree corresponding to each topology node, the network topology graph generated according to the node connection relationship corresponding to each topology node does not have problems such as too many connection relationships between two nodes far away from each other, network topology disconnection, node isolation, etc. It is ensured that the generated network topology graph conforms to the actual situation of the communication network, reduces the complexity of generating the network topology graph, and improves the efficiency of generating the network topology graph.
[0075] In one embodiment, as shown in Figure 3 When it is necessary to determine the node connection relationship corresponding to each topology node according to the heuristic factor value of the candidate nodes corresponding to each topology node, the following content can be included:
[0076] S301, for each topology node, determining the heuristic factor value and the random factor value of each candidate node corresponding to the topology node.
[0077] It should be noted that when it is necessary to determine the heuristic factor value of each candidate node corresponding to the topology node, the following content can be included: for each candidate node, obtaining the current connection degree corresponding to the topology node, the current total connection degree corresponding to each topology node, and the interval distance between the candidate node and the topology node; determining the heuristic factor value corresponding to the candidate node according to the preset adjustment parameter, the total number of topology nodes, the current connection degree corresponding to the topology node, the current total connection degree corresponding to each topology node, and the interval distance between the candidate node and the topology node.
[0078] Specifically, according to the above content, the determination formula of the heuristic factor value is as follows:
[0079] ;
[0080] wherein, refers to the heuristic factor value; refers to the adjustment parameter; refers to the number of edges determined in the network topology plane at the current moment; e k refers to the current connectivity degree corresponding to the topology node; d k refers to the interval distance between the candidate node and the topology node; N refers to the total number of topology nodes.
[0081] Further, when it is necessary to determine the random factor value of each candidate node corresponding to the topology node, the value range corresponding to the random factor value can be predefined, and then the operation of randomly selecting a value in the value range as the random factor value is performed for each candidate node corresponding to the topology node, so as to realize the operation of determining the random factor value of each candidate node corresponding to the topology node.
[0082] As an example, the value range corresponding to the random factor value can be [0, 1], so when it is necessary to determine the random factor value of each candidate node corresponding to the topology node, a value in [0, 1] needs to be randomly selected as the random factor value of each candidate node.
[0083] S302, determining the protection distance corresponding to the topology node.
[0084] It should be noted that the protection distance refers to the minimum distance between two topology nodes with node connection relationship, and further, the protection distance can be set or adjusted according to actual conditions and historical experience of operation and maintenance personnel, and the value range of the protection distance is not limited here.
[0085] S303, selecting the target node connected with the topology node from each candidate node according to the protection distance, and the heuristic factor value and the random factor value of each candidate node, to obtain the node connection relationship corresponding to the topology node.
[0086] It should be noted that, in order to avoid problems such as too many connection relationships between two nodes with long distance, network topology not connected, node isolated, etc., when selecting the target node connected with the topology node from each candidate node, the following content can be included: 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 topology node is greater than the protection distance, the candidate node is selected as the target node connected with the topology node.
[0087] In an embodiment of the present application, when it is necessary to determine the node connection relationship corresponding to the topology node, the heuristic factor value of each candidate node corresponding to the topology node can be determined for each candidate node in each topology node and the random factor value R; the protection distance r corresponding to the topology node is determined; therefore, when the random factor value R> the heuristic factor value , and the interval distance between the candidate node and the topology node The candidate node is taken as the target node connected with the topology node in the case of the protection distance r (m and n are node serial numbers, and m≠n).
[0088] The network topology graph generation method, by determining the heuristic factor value and the random factor value of each candidate node corresponding to the topology node, realizes selecting the target node connected with the topology node from each candidate node according to the protection distance, and the heuristic factor value and the random factor value of each candidate node, to obtain the node connection relationship corresponding to the topology node, to ensure that there is no problem of too many connections between two nodes far away from each other, network topology disconnection, node isolation, etc., to ensure that the generated network topology graph conforms to the actual situation of the communication network, to reduce the complexity of generating the network topology graph, and to improve the efficiency of generating the network topology graph.
[0089] In an embodiment, as shown in Figure 4 When it is needed to determine the target number of candidate nodes corresponding to each topology node according to the interval distance between each topology node, the following content can be included:
[0090] S401, for each topology node, according to the interval distance between the topology node and other topology nodes, the other topology nodes are sorted in ascending order.
[0091] In an embodiment of the present application, when it is needed to sort the other topology nodes, the interval distance between the topology node and the other topology nodes can be determined in advance, and then the order of the other topology nodes in the sorting result is determined in ascending order of the interval distance, to realize the operation of sorting the other topology nodes.
[0092] The interval distance between the topology node and the other topology nodes can be the Euclidean distance between the topology node and the other topology nodes.
[0093] S402, the target number of nodes in the other topology nodes sorted in the front are taken as the candidate nodes corresponding to the topology node.
[0094] In an embodiment of the present application, when it is needed to determine the candidate nodes corresponding to the topology node, the target number can be determined in advance according to the average degree of each topology node, and then the target number of nodes in the other topology nodes sorted in the front are taken as the candidate nodes corresponding to the topology node.
[0095] The network topology graph generation method sorts other topology nodes, so that a target number of nodes in front of the other topology nodes are used as candidate nodes corresponding to the topology nodes, thereby providing a data basis for determining the node connection relationship of each topology node, and ensuring the smooth operation of subsequent operations.
[0096] In one embodiment, as shown in Figure 5 when it is necessary to generate a network topology graph, the method can include the following steps:
[0097] S501, a plurality of topology nodes are randomly generated in a network topology plane.
[0098] S502, for each topology node, other topology nodes are sorted in ascending order according to the interval distance between the topology node and other topology nodes.
[0099] S503, a target number of nodes in front of the other topology nodes are used as candidate nodes corresponding to the topology node.
[0100] S504, each candidate node obtains the current connection degree corresponding to the topology node, the current total connection degree corresponding to each topology node, and the interval distance between the candidate node and the topology node.
[0101] S505, according to the preset adjustment parameter, the total number of topology nodes, the current connection degree corresponding to the topology node, the current total connection degree corresponding to each topology node, and the interval distance between the candidate node and the topology node, a heuristic factor value corresponding to the candidate node is determined.
[0102] S506, a random factor value of each candidate node corresponding to the topology node is determined.
[0103] S507, a protection distance corresponding to the topology node is determined.
[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 topology node is greater than the protection distance, the candidate node is used as a target node connected to the topology node.
[0105] S509, according to the node connection relationship corresponding to each topology node, each topology node is connected to generate a network topology graph.
[0106] According to the above content, the target quantity of candidate nodes corresponding to each topology node is determined, and the heuristic factor value of the candidate nodes corresponding to each topology node, wherein the heuristic factor value is used to represent the connection probability between the candidate node and the corresponding topology node. Therefore, the application realizes the connection relationship screening of the candidate nodes corresponding to each topology node through the heuristic factor value of the candidate nodes corresponding to each topology node, and realizes the determination of the node connection relationship corresponding to each topology node. Since the heuristic factor value is not randomly generated, but is determined according to the total number of topology nodes, the current connection degree corresponding to the topology node, and the current total connection degree corresponding to each topology node, the network topology graph generated according to the node connection relationship corresponding to each topology node does not have the problem of excessive connection relationship between two nodes far away from each other, network topology disconnection, node isolation and the like, ensures that the generated network topology graph conforms to the actual situation of the communication network, reduces the complexity of generating the network topology graph, and improves the efficiency of generating the network topology graph.
[0107] It should be understood that, although each step in the flowchart involved in each of the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each of the above embodiments can include multiple steps or stages, which 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 sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.
[0108] Based on the same inventive concept, the embodiments of the application also provide a network topology graph generation device for implementing the above-mentioned network topology graph generation method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more network topology graph generation device embodiments provided below can refer to the limitations of the network topology graph generation method in the above text, which will not be repeated here.
[0109] In one embodiment, as Figure 6As shown, a network topology graph generation apparatus is provided, comprising a generation module 10, a first determination module 20, a second determination module 30 and a connection module 40, wherein:
[0110] The generation module 10 is configured to randomly generate a plurality of topology nodes in a network topology plane.
[0111] The first determination module 20 is configured to determine, according to interval distances between different topology nodes, a target number of candidate nodes corresponding to each topology node in turn; wherein the candidate node is a node in each topology node.
[0112] The second determination module 30 is configured to determine, according to heuristic factor values of the candidate nodes corresponding to each topology node, node connection relationships corresponding to each topology node; wherein the heuristic factor value of the candidate node is used to represent a connection probability between the candidate node and the corresponding topology node.
[0113] The connection module 40 is configured to connect each topology node according to the node connection relationship corresponding to each topology node, to generate a network topology graph.
[0114] In an embodiment, for each topology node, the heuristic factor value and the random factor value of each candidate node corresponding to the topology node are determined;
[0115] A protection distance corresponding to the topology node is determined.
[0116] 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 topology node is selected from each candidate node, to obtain the node connection relationship corresponding to the topology 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 topology node is greater than the protection distance, the candidate node is taken as the target node connected to the topology node.
[0118] For each candidate node, the current connection degree corresponding to the topology node, the current total connection degree corresponding to each topology node, and the interval distance between the candidate node and the topology node are obtained.
[0119] According to a preset adjustment parameter, the total number of topology nodes, the current connection degree corresponding to the topology node, the current total connection degree corresponding to each topology node, and the interval distance between the candidate node and the topology node, the heuristic factor value corresponding to the candidate node is determined.
[0120] In an embodiment, for each topology node, according to the interval distances between the topology node and other topology nodes, the other topology nodes are sorted in ascending order;
[0121] The target number of nodes in the other topological nodes in order is taken as the candidate nodes corresponding to the topological nodes.
[0122] In an embodiment, the target number is related to the average degree of each topological node.
[0123] The network topology graph generation apparatus determines 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 connects each topological node according to the node connection relationship corresponding to each topological node to generate a network topology graph. According to the above content, it can be known that the 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 heuristic factor value is used to represent the connection probability between the candidate node and the corresponding topological node. Therefore, the application realizes the connection relationship screening of the candidate node corresponding to each topological node through the heuristic factor value of the candidate node corresponding to each topological node, and realizes the determination of the node connection relationship corresponding to each topological node. Since the heuristic factor value of the application is not randomly generated, but is determined according to the total number of topological nodes, the current connection degree corresponding to the topological node, and the current total connection degree corresponding to each topological node, the network topology graph generated by the application according to the node connection relationship corresponding to each topological node will not have the problem that two nodes far away from each other establish too many connection relationships, the network topology is not connected, the nodes are isolated, and the like. It is ensured that the generated network topology graph conforms to the actual situation of the communication network, the complexity of generating the network topology graph is reduced, and the efficiency of generating the network topology graph is improved.
[0124] Each module in the network topology graph generation apparatus can be realized by software, hardware, and a combination thereof in whole or in part. Each module can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to each module.
[0125] In an embodiment, a computer device is provided, which can be a terminal, and the internal structure diagram thereof can be as shown in Figure 7As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. 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 operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for wired or wireless communication with external terminals, and wireless communication can be realized through WIFI, mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by the processor to realize a network topology graph generation method. The display unit of the computer device is used to form a visually visible picture, which can 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 overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0126] Those skilled in the art can understand that, Figure 7 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0127] In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the following steps:
[0128] Randomly generating a plurality of topology nodes in a network topology plane;
[0129] According to the interval distance between different topology nodes, a target number of candidate nodes corresponding to each topology node is determined in turn; wherein the candidate node is a node in each topology node;
[0130] According to the heuristic factor value of the candidate node corresponding to each topology node, the node connection relationship corresponding to each topology node is determined; wherein the heuristic factor value of the candidate node is used to represent the connection probability between the candidate node and the corresponding topology node;
[0131] According to the node connection relationship corresponding to each topology node, the topology nodes are connected to generate a network topology graph.
[0132] In one embodiment, the processor, when executing the computer program, further implements the following steps:
[0133] For each topology node, a heuristic factor value and a random factor value of each candidate node corresponding to the topology node are determined;
[0134] A protection distance corresponding to the topology node is determined.
[0135] According to the protection distance, and the heuristic factor value and the random factor value of each candidate node, a target node connected with the topology node is selected from each candidate node, to obtain a node connection relationship corresponding to the topology node.
[0136] In one embodiment, the processor, when executing the computer program, 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 an interval distance between the candidate node and the topology node is greater than the protection distance, the candidate node is taken as the target node connected with the topology node.
[0138] In one embodiment, the processor, when executing the computer program, further implements the following steps:
[0139] For each candidate node, a current connection degree corresponding to the topology node, a current total connection degree corresponding to each topology node, and an interval distance between the candidate node and the topology node are obtained.
[0140] According to a preset adjustment parameter, a total number of topology nodes, the current connection degree corresponding to the topology node, the current total connection degree corresponding to each topology node, and the interval distance between the candidate node and the topology node, a heuristic factor value corresponding to the candidate node is determined.
[0141] In one embodiment, the processor, when executing the computer program, further implements the following steps:
[0142] For each topology node, according to interval distances between the topology node and other topology nodes, the other topology nodes are sorted in ascending order.
[0143] A target number of nodes in front of the other topology nodes are taken as candidate nodes corresponding to the topology node.
[0144] In one embodiment, the processor, when executing the computer program, further implements the following steps:
[0145] The target number is related to average degrees of each topology node.
[0146] In one embodiment, a computer readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, implements the following steps:
[0147] randomly generating a plurality of topology nodes in a network topology plane;
[0148] determining, according to interval distances between different topology nodes, a target number of candidate nodes corresponding to each topology node in turn; wherein the candidate node is a node in each topology node;
[0149] determining, according to heuristic factor values of the candidate nodes corresponding to each topology node, a node connection relationship corresponding to each topology node; wherein the heuristic factor value of the candidate node is used to represent a connection probability between the candidate node and the corresponding topology node;
[0150] connecting each topology node according to the node connection relationship corresponding to each topology node, to generate a network topology graph.
[0151] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0152] for each topology node, determining a heuristic factor value and a random factor value of each candidate node corresponding to the topology node;
[0153] determining a protection distance corresponding to the topology node;
[0154] selecting, according to the protection distance, the heuristic factor value and the random factor value of each candidate node, a target node connected to the topology node from each candidate node, to obtain a node connection relationship corresponding to the topology node.
[0155] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[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 topology node is greater than the protection distance, the candidate node is selected as the target node connected to the topology node.
[0157] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0158] for each candidate node, obtaining a current connection degree corresponding to the topology node, a current total connection degree corresponding to each topology node, and an interval distance between the candidate node and the topology node;
[0159] determining, according to a preset adjustment parameter, a total number of topology nodes, the current connection degree corresponding to the topology node, the current total connection degree corresponding to each topology node, and the interval distance between the candidate node and the topology node, a heuristic factor value corresponding to the candidate node.
[0160] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0161] For each topology node, other topology nodes are sorted in ascending order according to interval distances between the topology node and the other topology nodes;
[0162] The target number of nodes sorted in front of the other topology nodes are taken as candidate nodes corresponding to the topology node.
[0163] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0164] The target number is related to average degrees of the topology nodes.
[0165] In one embodiment, a computer program product is provided, comprising a computer program which, when executed by the processor, implements the following steps:
[0166] A plurality of topology nodes are randomly generated in a network topology plane;
[0167] According to interval distances between different topology nodes, a target number of candidate nodes corresponding to each topology node are determined in turn; wherein the candidate nodes are nodes in the topology nodes;
[0168] According to heuristic factor values of the candidate nodes corresponding to each topology node, node connection relationships corresponding to each topology node are determined; wherein the heuristic factor values of the candidate nodes are used to represent connection probabilities between the candidate nodes and the corresponding topology nodes;
[0169] According to the node connection relationships corresponding to each topology node, the topology nodes are connected to generate a network topology graph.
[0170] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0171] For each topology node, heuristic factor values and random factor values of the candidate nodes corresponding to the topology node are determined;
[0172] A protection distance corresponding to the topology node is determined;
[0173] According to the protection distance, and the heuristic factor values and the random factor values of the candidate nodes, target nodes connected to the topology node are selected from the candidate nodes to obtain node connection relationships corresponding to the topology node.
[0174] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[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 topology node is greater than the protection distance, the candidate node is taken as a target node connected with the topology node.
[0176] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0177] For each candidate node, the current connection degree corresponding to the topology node, the current total connection degree corresponding to each topology node, and the interval distance between the candidate node and the topology node are obtained.
[0178] According to the preset adjustment parameter, the total number of topology nodes, the current connection degree corresponding to the topology node, the current total connection degree corresponding to each topology node, and the interval distance between the candidate node and the topology node, the heuristic factor value corresponding to the candidate node is determined.
[0179] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0180] For each topology node, according to the interval distance between the topology node and other topology nodes, other topology nodes are sorted in ascending order.
[0181] The target number of nodes in front of the other topology nodes are taken as the candidate nodes corresponding to the topology node.
[0182] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0183] The target number is related to the average degree of each topology node.
[0184] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant national and regional laws, regulations and standards.
[0185] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0186] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0187] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for generating a network topology graph, characterized in that, The method includes: Randomly generate multiple topology nodes within the network topology plane; Based on the interval distance between different topological nodes, the target number of candidate nodes corresponding to each topological node is determined sequentially; For each topology node, determine the heuristic factor value and random factor value of each candidate node corresponding to the topology node; Determine the protection distance corresponding to the topology 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 topology node is greater than the protection distance, then the candidate node is used as the target node to connect with the topology node, so as to obtain the node connection relationship corresponding to the topology node. Based on the node connection relationships corresponding to each of the topology nodes, the topology nodes are connected to generate a network topology; The formula for determining the heuristic factor value is shown below: ; This refers to the heuristic factor value; This refers to adjusting parameters; This refers to the number of edges determined in the network topology plane at the current moment; e k This refers to the current connectivity of the topology node; d k This refers to the distance between candidate nodes and topology nodes; N refers to the total number of topology nodes.
2. The method according to claim 1, characterized in that, The activation factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topology node.
3. The method according to claim 1, characterized in that, The candidate nodes are nodes among the topology nodes.
4. The method according to claim 1, characterized in that, The activation factor value of the candidate node is used to characterize the connection probability between the candidate node and the corresponding topology node.
5. The method according to any one of claims 1-4, characterized in that, The step of determining the target number of candidate nodes corresponding to each topology node in sequence according to the interval distance between each topology node includes: For each topology node, the other topology nodes are sorted in ascending order based on the distance between the topology node and other topology nodes. The target number of nodes that are ranked first among the other topology nodes are selected as candidate nodes corresponding to the topology node.
6. The method according to any one of claims 1-4, characterized in that, The target number is related to the average degree of each of the topology nodes.
7. A network topology graph generation device, characterized in that, The device includes: The generation module is used to randomly generate multiple topology nodes within the network topology plane. The first determining module is used to determine the target number of candidate nodes corresponding to each topological node in sequence according to the interval distance between different topological nodes; The second determining module is used to determine the heuristic factor value and random factor value of each candidate node corresponding to each topology node. Determine the protection distance corresponding to the topology 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 topology node is greater than the protection distance, then the candidate node is used as the target node to connect with the topology node, so as to obtain the node connection relationship corresponding to the topology node. A connection module is used to connect the topology nodes according to the node connection relationship corresponding to each topology node to generate a network topology graph; The formula for determining the heuristic factor value is shown below: ; This refers to the heuristic factor value; This refers to adjusting parameters; This refers to the number of edges determined in the network topology plane at the current moment; e k This refers to the current connectivity of the topology node; d k This refers to the distance between candidate nodes and topology nodes; N refers to the total number of topology nodes.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method for establishing sensor network with small world and scale-free properties
CN102185916A
Road network topological graph division method and device, equipment and computer program product
CN113821550A