Method and system for generating and rendering large-scale complex topology scenarios in a network range
Patent Information
- Application Number
- CN202311469302.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-07
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-11-07
AI Technical Summary
随着大规模复杂拓扑场景需求,现有场景显示方案如下不足:1、一般电脑或笔记本的GPU、内存等硬件设备的性能不足以应对大规模复杂网络靶场拓扑场景的渲染和启动,这会严重影响用户体验
[0024] Beneficial Effects: Compared with existing technologies, this invention has the following advantages: 1. This invention avoids the problem of rendering large-scale complex scenes all at once, solves the high requirements of large-scale complex scenes on hardware devices, has a wider range of applications, and enhances the simulation capabilities of network test ranges. 2. This invention introduces layer nodes, which improves the possibility of collaborative cooperation when constructing topologies. Different people can focus on editing their own topologies and then connect layer nodes and ordinary nodes to form a complete topology. 3. This invention is further compatible with old topologies without location information, avoiding the problem of having to modify a large number of resources (such as courses, training, red-blue team exercises, etc.).
Smart Images

Figure CN117614839B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and system for generating and rendering large-scale complex topology scenes in a network range, belonging to the fields of computer software and network security technology. Background Technology
[0002] A network range is a technology based on virtualization that simulates network architecture and devices in real-world cyberspace. In recent years, with increasing emphasis on cybersecurity, the market demands for network simulation and network topology have become increasingly sophisticated. Furthermore, the internal topology scenarios within various organizations are constantly being updated and becoming more complex.
[0003] Existing common network range topology scene rendering, such as Figure 1 As shown, all nodes are on the same level, and the interface returns all node data at once. With the increasing demand for large-scale, complex topology scenarios, the existing scenario display solution has the following shortcomings: 1. The performance of hardware devices such as GPUs and memory in general computers or laptops is insufficient to handle the rendering and startup of large-scale, complex network target range topology scenarios, which will seriously affect the user experience. 2. The interface does not support the storage of large-scale data, such as data from 100,000 nodes. Loading large-scale data can also cause browser crashes and memory overflows. 3. Constructing or editing a large topology scenario sequentially is too time-consuming for one person. 4. With continuous technological updates, old topology scenarios lacking location information become incompatible with new topology editors, appearing disorganized. It is also impractical to invest a large amount of manpower to re-edit the topology scenarios. Summary of the Invention
[0004] Purpose of the invention: In view of the problems existing in the prior art, the purpose of this invention is to provide a method and system for generating and rendering large-scale complex topology scenes in network test ranges, thereby improving the efficiency of scene generation and rendering and reducing the hardware requirements of the client.
[0005] Technical solution: To achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0006] A method for generating and rendering large-scale complex topology scenes in a network test range includes the following steps:
[0007] When a user enters the first-layer topology scene, the first-layer topology data is obtained, including the node set, block set, ordinary connection set, and layer node connection set.
[0008] For both ordinary nodes in the node set and layer nodes in the block set, node instances that can be rendered on the topology canvas are generated according to the data object fields and the node class of the AntV graph engine, and the node positions are set.
[0009] Ordinary nodes are associated using the set of ports and the set of ordinary connections of ordinary nodes, and the associated ordinary nodes are connected using the first line type;
[0010] By connecting layer nodes to a set of lines, layer nodes are associated with ordinary nodes, and the associated layer nodes and ordinary nodes are connected using a second line type that is different from the first line type.
[0011] Preferably, the fields of each node data object in the node set include a unique node identifier, name, legend, location, and a set of ports configured for the node; the fields of a single data object in the port set include a unique port identifier; the fields of a single data object in the ordinary connection set include a source port identifier and a destination port identifier, and ordinary nodes are connected by ports.
[0012] Preferably, the fields of a single layer node data object in the block set include a unique identifier of the layer node and its location; the fields of a single data object in the layer node connection set include a source node identifier and a destination node identifier, with values corresponding to the identifier of a certain layer node in the block set or the identifier of a certain node in the node set, and the layer nodes and ordinary nodes are connected to each other.
[0013] Furthermore, if the position field of a node in the topology data has no value, a position at a distance from the center point of the container is randomly generated. If the distance from the center point exceeds a preset pixel distance threshold, the position is randomly generated again to control the node to be around the center point.
[0014] Furthermore, when a user double-clicks a layer node in the first-level topology scene to enter the layer node topology scene, the corresponding layer node topology data is obtained based on the clicked layer node identifier. Its data structure is the same as the homepage topology data structure, including a node set, a block set, a normal connection set, and a layer node connection set. It is displayed using the same method as the first-level topology scene, and the parent topology nodes are displayed differently.
[0015] Furthermore, when a user clicks on a layer node in a layer node topology scene to enter the next layer node topology scene, the same method as the previous layer node topology scene is used to obtain and display data.
[0016] A system for generating and rendering large-scale complex topology scenes in a network test range, comprising:
[0017] The topology data acquisition module is used to acquire the first-layer topology data when a user enters the first-layer topology scene, including the node set, block set, ordinary connection set, and layer node connection set;
[0018] The node transformation module converts ordinary nodes in the node set and layer nodes in the block set according to the data object fields and the node class of the AntV graph engine to generate node instances that can be rendered on the topology canvas, and sets the node positions.
[0019] The ordinary node connection module is used to associate ordinary nodes through the port set and ordinary connection set of ordinary nodes, and connect the associated ordinary nodes using the first line type;
[0020] The layer node connection module is used to associate layer nodes with ordinary nodes through the layer node connection set, and connect the associated layer nodes and ordinary nodes using a second line type that is different from the first line type.
[0021] Furthermore, the system also includes: a layer node display module, used to obtain the corresponding layer node topology data according to the identifier of the clicked layer node when the user double-clicks a layer node in the first-layer topology scene to enter the layer node topology scene. Its data structure is the same as the homepage topology data structure, including a node set, a block set, a normal connection set, and a layer node connection set; it is displayed using the same method as the first-layer topology scene, and the parent topology nodes are displayed differently.
[0022] Furthermore, the system also includes a topology editing module, which is used by the editor to edit the first-level topology scene or the layer node topology scene. After the layer node topology scene is created or edited, it is saved as a component, which can be added to the upper-level topology scene and connected to the nodes in the upper-level topology scene.
[0023] A computer system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when loaded onto the processor, implements the steps of the method for generating and rendering large-scale complex topology scenes in a network range.
[0024] Beneficial Effects: Compared with existing technologies, this invention has the following advantages: 1. This invention avoids the problem of rendering large-scale complex scenes all at once, solves the high requirements of large-scale complex scenes on hardware devices, has a wider range of applications, and enhances the simulation capabilities of network test ranges. 2. This invention introduces layer nodes, which improves the possibility of collaborative cooperation when constructing topologies. Different people can focus on editing their own topologies and then connect layer nodes and ordinary nodes to form a complete topology. 3. This invention is further compatible with old topologies without location information, avoiding the problem of having to modify a large number of resources (such as courses, training, red-blue team exercises, etc.). Attached Figure Description
[0025] Figure 1 This is a diagram showing the topology of an existing ordinary network range.
[0026] Figure 2 This is a diagram showing the network topology of the layer node model in an embodiment of the present invention.
[0027] Figure 3 This is a diagram showing the internal network topology of the layer node model in an embodiment of the present invention.
[0028] Figure 4 This is a diagram showing the construction or editing of a network topology scenario in an embodiment of the present invention.
[0029] Figure 5 This is a flowchart illustrating the topology scene generation process in an embodiment of the present invention.
[0030] Figure 6 This is a flowchart illustrating the generation process of the layer node model topology scene in an embodiment of the present invention. Detailed Implementation
[0031] The technical solution of the present invention will now be clearly and completely described in conjunction with the accompanying drawings and specific embodiments.
[0032] This invention discloses a method for generating and rendering large-scale complex topology scenes in a network test range. When a user enters the first-layer topology scene, the first-layer topology data is obtained, including a node set, a block set, a set of ordinary connections, and a set of layer node connections. For ordinary nodes in the node set and layer nodes in the block set, node instances that can be rendered on the topology canvas are generated according to the node class conversion of the data object field using the AntV graph engine, and the node positions are set. Ordinary nodes are associated through the port set and ordinary connection set of ordinary nodes, and the associated ordinary nodes are connected using a first line type. Layer nodes are associated with ordinary nodes through the layer node connection set, and the associated layer nodes are connected to ordinary nodes using a second line type different from the first line type. When the user double-clicks a layer node in the first-layer topology scene to enter the layer node topology scene, the topology data of the corresponding layer node is obtained according to the identifier of the clicked layer node. Its data structure is the same as the topology data structure of the homepage, and it is displayed using the same method as the first-layer topology scene, while the parent topology nodes are displayed differently. When a user clicks on a layer node in a layer node topology scene to enter the next layer node topology scene, the same method as the previous layer node topology scene is used to obtain and display data.
[0033] In this invention, a layer node model is adopted in the network range topology, such as... Figure 2 As shown, a complex topology that appears to be a single layer is actually constructed from multiple layers. Furthermore, for the topological structure of a layer node, data is retrieved and rendered upon entering that layer, and the topology can be represented by only one layer node in the previous layer, as shown below. Figure 3As shown. This significantly reduces the need for acquiring and processing large amounts of data at once, and also greatly reduces GPU or memory consumption when rendering or starting a scene. Furthermore, for older topologies without explicit location information, a reasonable location assignment algorithm is provided internally, ensuring compatibility with older topologies. Constructing or editing the topology is as follows: Figure 4 As shown. Editors can drag and drop corresponding targets, including layer nodes, from the commonly used targets and operating system menus on the left to the topology canvas on the right. Each person constructs only a different topology or the internal topology of a layer node, and the nodes are ultimately connected by lines. Layer nodes and ordinary nodes are connected by dashed lines. This allows multiple people to construct topologies in parallel or at different times, saving manpower costs and avoiding work conflicts.
[0034] The following is combined Figure 5 and Figure 6 The method for generating and rendering complex topology scenes according to embodiments of the present invention will be described in detail. The generation and rendering of the first-layer topology scene includes the following steps:
[0035] Step 1. When entering the topology scene, retrieve the topology data from the interface. The topology data mainly includes the node set elements, the block set areas, the ordinary connection set connections, and the layer node connection set node_connections.
[0036] Step 2. After obtaining the data, parse the data. According to the code logic, the above set of data will be converted into the data structure required by the AntV graph engine (such as AntV-X6, AntV-G6, AntV-X6 is used in this example), such as nodes and connections.
[0037] Step 3. Parse the `elements` collection and convert it according to the AntV-X6 node class to generate node instances that can be rendered on the topology canvas. Each data object in the `elements` collection contains several fields, such as: `id` for unique identification, `name` for name, `icon` for legend, `position` for location, and the `ports` array representing the set of ports configured for this node. These fields are converted to the corresponding `id` identifier, `text` for text, `image` for icon, `x` and `y` coordinates, and `ports` for node ports in the AntV-X6 node class. After integrating the objects composed of these fields, finally use the AntV-X6 canvas add node method: `graph.addNode`, to render all the nodes from the `elements` collection on the topology canvas.
[0038] Step 4. When parsing the block set area, determine whether it is a layer node based on the type value of a single data object in the set. If type is 1, it indicates that it is a layer node, and a node instance is generated according to the AntV-X6 node class. A single data object in the block set area also has several fields, such as: id (unique identifier), name (name), position (position), and no icon or ports fields. These fields correspond to the fields in the AntV-X6 node class as in step 3. The layer node icon is represented directly by a default image. Finally, use the AntV-X6 canvas add node method: graph.addNode, to render all layer nodes in the block set area on the topology canvas.
[0039] Step 5. Connect the regular nodes. Each regular node's ports collection contains a unique identifier (id) field. Similarly, each connection collection's connections object has source and target fields. source represents the source port, and target represents the destination port. The values of these three fields all contain the node ID, and their string format is the same: port + node ID + port number. Extract the node ID from source and target to identify the two nodes. Then, combine the two node IDs with the values of source and target and assign them to the cell and port fields of the source and target fields of the AntV-X6 connection instance, respectively. Finally, using the AntV-X6 canvas add connection method: graph.addEdge, render the port-to-port connection between the two regular nodes on the canvas.
[0040] Step 6. Connect layer nodes and regular nodes. Each layer node object in the block set includes a unique identifier (id) representing a layer node, and each regular node object also has a unique identifier (id) representing a regular node. Each data object in the layer node connection set (node_connections) contains source and target fields. The source and target values are assigned to the cell fields within the source and target fields of the AntV-X6 connection instance. Finally, the connection between layer nodes and regular nodes is rendered on the canvas using the AntV-X6 canvas addition method: graph.addEdge. The connection is represented by a dashed line for distinction.
[0041] If the `position` field of a node in the topology data has no value (while both regular nodes and layer nodes have a `position` field), then the topology nodes need to be arranged to avoid positional chaos during rendering. 1. Randomly select positions relative to the container's center point. 2. If the x-axis distance from the center point exceeds 200 pixels, re-randomize the positions, controlling the nodes to be around the center point, thus assigning positional information to the nodes and ensuring the topology is displayed correctly.
[0042] For generation and rendering of hierarchical node topology scenes, see Figure 6 Double-click a layer node in the first-level topology scene to pass the layer node ID to the topology interface and enter the layer node topology. The topology generation process is the same as above. If there are more layer nodes in the layer node scene, repeat the operation as in the first step. If there are also nodes missing positions in the layer nodes, arrange the layer node topology in the same way as the first-level topology. Nodes with background coloring in the layer nodes are nodes of the parent topology, such as... Figure 3 The switches in the topology can be used to visually demonstrate their relationship with the parent topology.
[0043] Based on the same inventive concept, this invention discloses a system for generating and rendering large-scale complex topology scenes in a network range, comprising: a topology data acquisition module, used to acquire first-layer topology data when a user enters the first-layer topology scene, including a node set, a block set, a set of ordinary connections, and a set of layer node connections; a node conversion module, used to convert ordinary nodes in the node set and layer nodes in the block set according to the data object field and the node class of the AntV graph engine to generate node instances that can be rendered on the topology canvas, and set the node positions; an ordinary node connection module, used to associate ordinary nodes through the port set and the ordinary connection set, and connect the associated ordinary nodes using a first line type; and a layer node connection module, used to associate layer nodes with ordinary nodes through the layer node connection set, and connect the associated layer nodes with ordinary nodes using a second line type different from the first line type. It further includes a layer node display module, which is used to obtain the corresponding layer node topology data according to the identifier of the clicked layer node when the user double-clicks a layer node in the first layer topology scene to enter the layer node topology scene. Its data structure is the same as the homepage topology data structure, including node set, block set, ordinary connection set and layer node connection set; it is displayed in the same way as the first layer topology scene, and the parent topology nodes are displayed differently.
[0044] In addition, the system provides a topology editing module, which allows editors to edit the first-level topology scene or the layer node topology scene. After the layer node topology scene is created or edited, it is saved as a component, which can be added to the upper-level topology scene and connected to the nodes in the upper-level topology scene.
[0045] Based on the same inventive concept, an embodiment of the present invention discloses a computer system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded onto the processor, it implements the steps of the method for generating and rendering large-scale complex topology scenes in a network range.
Claims
1. A method for generating and rendering large-scale complex topology scenes in a network test range, characterized in that, Includes the following steps: When a user enters the first-layer topology scene, the first-layer topology data is obtained, including the node set, block set, ordinary connection set, and layer node connection set. For both ordinary nodes in the node set and layer nodes in the block set, node instances that can be rendered on the topology canvas are generated according to the data object fields and the node class of the AntV graph engine, and the node positions are set. Ordinary nodes are associated using the set of ports and the set of ordinary connections of ordinary nodes, and the associated ordinary nodes are connected using the first line type; By connecting layer nodes to a set of lines, layer nodes are associated with ordinary nodes, and the associated layer nodes and ordinary nodes are connected using a second line type that is different from the first line type.
2. The method for generating and rendering large-scale complex topology scenes in a network test range according to claim 1, characterized in that, The fields of each node data object in the node set include a unique node identifier, name, legend, location, and the set of ports configured for the node; the fields of a single data object in the port set include a unique port identifier; the fields of a single data object in the ordinary connection set include a source port identifier and a destination port identifier, and ordinary nodes are connected by ports.
3. The method for generating and rendering large-scale complex topology scenes in a network test range according to claim 1, characterized in that, The fields of a single layer node data object in the block set include the unique identifier of the layer node and its location; the fields of a single data object in the layer node connection set include the source node identifier and the destination node identifier, with values corresponding to the identifier of a certain layer node in the block set or the identifier of a certain node in the node set. Layer nodes and ordinary nodes are connected to each other.
4. The method for generating and rendering large-scale complex topology scenes in a network test range according to claim 1, characterized in that, If the position field of a node in the topology data has no value, a position relative to the center point of the container is randomly generated. If the distance from the center point exceeds a preset pixel distance threshold, a new random position is generated to control the node to be located around the center point.
5. The method for generating and rendering large-scale complex topology scenes in a network test range according to claim 1, characterized in that, When a user double-clicks a layer node in the first-level topology scene to enter the layer node topology scene, the corresponding layer node topology data is obtained based on the clicked layer node identifier. Its data structure is the same as the first-level topology data structure, including node set, block set, ordinary connection set, and layer node connection set. It is displayed using the same method as the first-level topology scene, and the parent topology nodes are displayed differently.
6. The method for generating and rendering large-scale complex topology scenes in a network test range according to claim 5, characterized in that, When a user clicks on a layer node in a layer node topology scene to enter the next layer node topology scene, the same method as the previous layer node topology scene is used to obtain and display data.
7. A system for generating and rendering large-scale complex topology scenes in a network test range, characterized in that, include: The topology data acquisition module is used to acquire the first-layer topology data when a user enters the first-layer topology scene, including the node set, block set, ordinary connection set, and layer node connection set; The node transformation module converts ordinary nodes in the node set and layer nodes in the block set according to the data object fields and the node class of the AntV graph engine to generate node instances that can be rendered on the topology canvas, and sets the node positions. The ordinary node connection module is used to associate ordinary nodes through the port set and ordinary connection set of ordinary nodes, and connect the associated ordinary nodes using the first line type; The layer node connection module is used to associate layer nodes with ordinary nodes through the layer node connection set, and connect the associated layer nodes and ordinary nodes using a second line type that is different from the first line type.
8. The system for generating and rendering large-scale complex topology scenes in a network range according to claim 7, characterized in that, Also includes: The layer node display module is used to retrieve the corresponding layer node topology data based on the identifier of the clicked layer node when the user double-clicks a layer node in the first-layer topology scene to enter the layer node topology scene. Its data structure is the same as that of the first-layer topology data structure, including node set, block set, ordinary connection set and layer node connection set. It is displayed in the same way as the first-layer topology scene, and the parent topology nodes are displayed differently.
9. The system for generating and rendering large-scale complex topology scenes in a network range according to claim 7, characterized in that, Also includes: The topology editing module is used by editors to edit the first-level topology scene or the topology scene of layer nodes. After the topology scene of layer nodes is created or edited, it is saved as a component, which can be added to the topology scene of the previous level and connected to the nodes in the topology scene of the previous level.
10. A computer system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is loaded into the processor, it implements the steps of the method for generating and rendering large-scale complex topology scenes in a network range according to any one of claims 1-6.
Citation Information
Patent Citations
Large-scale multi-dimensional fusion virtual network mapping method
CN110380906A
Visual network optimization method, device, equipment and system
CN115442235A