Method and system capable of realizing multi-person cooperation topology arrangement in network target range

By introducing multi-person collaborative orchestration method and quadtree data structure into the network range, the problem of low efficiency in large-scale network topology orchestration is solved, the efficiency and consistency of multi-person collaborative editing are achieved, and the usability and scalability of the system are improved. sex.

CN118659975APending Publication Date: 2024-09-17NANJING NANZI DIGITAL SECURITY TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410935039.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Existing topology orchestration methods in network ranges are inefficient when dealing with large networks. It is difficult for a single user to quickly complete the orchestration, and editing conflicts and consistency issues are prone to occur.

Method used

Using a multi-person collaborative orchestration method, real-time collaboration and synchronization is achieved by establishing coordinate systems and quadtree data structure management nodes in the topology canvas. It combines load balancing and operation transformation algorithms to ensure real-time consistency of multi-user editing.

Benefits of technology

It improves the efficiency of large-scale topology editing, reduces editing errors, realizes the efficiency and consistency of multi-person collaborative orchestration, and improves the usability and scalability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118659975A
    Figure CN118659975A
Patent Text Reader

Abstract

The invention discloses a method and a system for multi-person cooperation topology arrangement in a network target range, and relates to the technical field of network security, and the method comprises the following steps: S1, creating a topology canvas in the network target range, and establishing a coordinate system for the topology canvas needing arrangement; s2, receiving a drawing area applied by a user through a user-oriented drawing application interface; s3, displaying an editable drawing area in the topology canvas, arranging the topology of the drawing area based on a real-time cooperation and synchronization strategy, and recording and storing an editing result; and S4, receiving a revocation application initiated by the user through the user-oriented application revocation interface. According to the method, the coordinate system is introduced, the position of each node is marked in the coordinate system, and the coordinate system is divided into different areas, so that editing operation of the nodes and the connecting lines can be independently carried out in the different areas, the areas do not influence one another, multi-person topology editing can be carried out, the editing efficiency of the large topology is improved, and errors are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security technology, and in particular to a method and system for topology orchestration by multiple people in a network range. Background Art

[0002] A cyber range is a simulated network environment used for network attack and defense training. It is usually a virtual network system consisting of a series of computers, servers, network devices and applications, designed to simulate a real-world network environment.

[0003] When using the network target range, it is necessary to describe the network environment that you want to simulate by arranging a topology diagram in the target range, including the network elements, the network connectivity between the elements, and the allocation of resources of each element (IP, memory, disk, etc.).

[0004] The existing topology arrangement methods generally include the basic operations of dragging, connecting, adding nodes, and deleting nodes. Adding nodes and deleting nodes are used to add and delete elements in the network topology, dragging is used to change the position of nodes, and connecting lines is used to draw the network connectivity relationship between two nodes. When there are fewer node elements in the network topology, this arrangement method is fine and can be completed quickly by a single user. However, when it is necessary to arrange a large network topology (such as one containing thousands of nodes), this arrangement method is too inefficient. Drawing the topology by a single user will be extremely time-consuming. Summary of the invention

[0005] Based on this, it is necessary to provide a method and system for multi-person collaborative topology orchestration in a network target range to address the above technical issues.

[0006] In a first aspect, the present invention provides a method for multi-person collaborative topology orchestration in a network range, the method comprising the following steps:

[0007] S1. Create a topology canvas in the network target range and establish a coordinate system for the topology canvas that needs to be arranged;

[0008] S2. receiving a drawing area requested by a user through a drawing application interface facing a user, and identifying overlap of the drawing areas based on the area application table of stored records;

[0009] S3. Display the editable drawing area in the topology canvas, arrange the topology of the drawing area based on the real-time collaboration and synchronization strategy, and record and save the editing results;

[0010] S4. Receive the cancellation application initiated by the user through the user-oriented application cancellation interface, and delete the drawing area applied by the user from the area application table.

[0011] Furthermore, a topology canvas is created in the network range, and a coordinate system is established for the topology canvas to be arranged, including the following steps:

[0012] S11. Arrange all nodes in the topology, create a rectangular area containing all nodes in the network target range as a topology canvas, and record the length and width of the topology canvas;

[0013] S12, using one of the endpoints of the topology canvas as the origin, establishing a rectangular coordinate system, and using the coordinate system position to represent any node in the topology canvas;

[0014] S13. Build a quadtree data structure to manage the drawable area in the topological canvas.

[0015] Furthermore, constructing a quadtree data structure and managing the drawable area in the topology canvas includes the following steps:

[0016] S131. Create a quadtree root node to represent the initial area of ​​the entire topology canvas;

[0017] S132, when a new node is added to the topology canvas, a suitable leaf node is recursively found for storage according to the position of the node. If the leaf node is full, the leaf node is subdivided and the new node is reallocated to the new leaf node contained in the subdivided leaf node;

[0018] S133, before inserting a new node, traverse all nodes in the leaf node to check whether there is a conflict with the existing node. If there is no conflict, insert it successfully;

[0019] S134. When a node in the topology canvas is deleted, the node is deleted from the quadtree, and the quadtree data structure is updated.

[0020] Furthermore, receiving the drawing area requested by the user through the drawing application interface for the user, and identifying the overlap of the drawing areas based on the area application table of the stored records includes the following steps:

[0021] S21, obtaining a drawing application initiated by a user, and determining whether there are drawing applications of other users being processed. If there are no other drawing applications being processed, executing step S22; if there are other drawing applications being processed, entering a waiting state, and executing step S22 after the waiting state ends;

[0022] S22, querying the list of all applied area information in the current topology, and determining whether the area information list is empty, if not empty, executing step S23, if empty, executing step S25;

[0023] S23, remove a region information from the region information list, and mark the coordinate values ​​of the four vertices of the region information as the region value, and then execute step S24;

[0024] S24, marking the area corresponding to the user's drawing application as a drawing rectangle, and recording the area value, and then marking the removed area information as a removal rectangle, and determining whether there is an overlapping part between the drawing rectangle and the removal rectangle. If there is no overlapping part, returning to step S22, if there is an overlapping part, returning a failure signal, and ending the application;

[0025] S25, mark the topology corresponding to the drawing application as the topology id, and then query all data rows contained in the topology id in the area application table to find the largest area id value. If there is a largest area id value, add 1 to the largest area id value as the newly applied area id. If there is no largest area id value, use 1 as the newly applied area id, and then execute step S26;

[0026] S26, save the area information to the area application form, and then execute step S27;

[0027] S27. Return a success signal and the assigned area ID value as the drawing area requested by the user.

[0028] Furthermore, displaying the editable drawing area in the topology canvas, arranging the topology of the drawing area based on the real-time collaboration and synchronization strategy, and recording and saving the editing results include the following steps:

[0029] S31. Display the drawing area requested by the user in the topology canvas, and provide a visual display of node and line information, as well as free editing by the user;

[0030] S32, obtaining server cluster information, allocating multi-user requests to different server instances, and using an operation transformation algorithm to merge editing operations of multiple users to keep the topology canvas globally consistent;

[0031] S33, manage shared state and data storage, and monitor and dynamically adjust server load;

[0032] S34. Record the editing information during the editing process of the user's application and save the editing results.

[0033] Furthermore, obtaining server cluster information, allocating multi-user requests to different server instances, and using the operation transformation algorithm to merge the editing operations of multiple users to keep the topology canvas globally consistent includes the following steps:

[0034] S321, using a reverse proxy server, distributing editing requests of different users to different server instances according to the current network load;

[0035] S322, deploy multiple server instances to process the user's real-time communication request at the same time, and the user establishes a real-time communication channel with the server through the server instance and performs editing operations in the visual interface;

[0036] S323, the server receives the user operation request, and uses the operation transformation algorithm to merge the operations of multiple users to maintain the global consistency of the topology canvas;

[0037] S324. Utilize the server to calculate the difference between the operations of multiple users, and push it to each user through the real-time communication channel to achieve information synchronization.

[0038] Furthermore, managing shared state and data storage, and monitoring and dynamically adjusting server load includes the following steps:

[0039] S331, using a memory database as a shared state storage to manage state synchronization and management between multiple server instances, achieving fast access between server instances, and using a database to store the real-time canvas state of the topology canvas during the editing operation;

[0040] S332. Use consistent hashing algorithm to distribute user sessions between servers, monitor the load of server cluster in real time, and dynamically adjust the number of server instances.

[0041] Furthermore, the consistent hashing algorithm is used to distribute user sessions between servers, and the load of the server cluster is monitored in real time. The number of server instances is dynamically adjusted, including the following steps:

[0042] S3321. Deploy the server instances in a hash ring, calculate the hash value of each server instance through a hash function, and then map it to a corresponding position on the hash ring;

[0043] S3322: When a user initiates a drawing application and connects to a server, the user's hash coefficient is calculated, and the user's hash value is mapped to a hash ring. The first server instance is searched in a clockwise direction, and the user session is assigned to the server instance.

[0044] S3323. Define the load threshold, deploy a load balancing manager to monitor the load situation, dynamically adjust the number of server instances based on the load situation, and dynamically update the hash ring after the adjustment.

[0045] In a second aspect, the present invention also provides a system for multi-person collaborative topology arrangement in a network range, the system comprising: a collaborative control module, a drawing module and a storage module, wherein:

[0046] The collaborative control module is used to establish a coordinate system for the topological canvas to be arranged in the network range; receive the drawing area requested by the user and identify the overlap of the drawing area;

[0047] The drawing module is used to display the drawing area requested by the user in the topology canvas for the user to edit, query and display the edited node and connection information, and save the user's editing results;

[0048] The storage module is used to store topology information, drawing area application information and topology drawing data information.

[0049] Furthermore, the collaboration control module provides two interfaces to the outside, including a drawing application interface and an application cancellation interface, and the storage module includes a topology table, a topology node table, a topology node connection table and an area application table.

[0050] The beneficial effects of the present invention are:

[0051] 1. The present invention introduces a coordinate system to mark the position of each node in the coordinate system. By dividing different areas in the coordinate system, nodes and lines can be edited separately in different areas without affecting each other. Multi-person topology editing is possible, which greatly improves the editing efficiency of large topologies and reduces errors. At the same time, by splitting the large topology according to the coordinates and dividing it into multiple independent drawing areas, each drawing area can be edited by an independent user, thereby realizing multi-person collaborative editing of large topologies and improving drawing efficiency.

[0052] 2. By introducing quadtree structure management, operation transformation and differential synchronization to improve real-time collaboration capabilities, as well as role-based permission control and transaction management, the efficiency and experience of multi-person collaborative orchestration topology are improved; at the same time, it can handle large-scale network topologies and ensure that the operations of each user are synchronized and consistent in real time, reflecting the functional advantages of multi-person collaborative orchestration. In addition, by combining load balancing and real-time collaboration strategies, the function of displaying editable drawing areas in the topology canvas and recording and saving editing results is realized, which not only improves the high availability and scalability of the system, but also ensures the efficiency and consistency of multi-person collaborative orchestration topology. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0054] Figure 1 is a flow chart of a method for multi-person collaborative topology orchestration in a network range according to an embodiment of the present invention;

[0055] Figure 2It is a principle block diagram of a system capable of multi-person collaborative topology orchestration in a network range according to an embodiment of the present invention;

[0056] Figure 3 is a schematic diagram of coordinate system segmentation of a topological canvas according to an embodiment of the present invention;

[0057] Figure 4 is a flowchart of topological editing based on region segmentation of a coordinate system according to an embodiment of the present invention;

[0058] Figure 5 is a flowchart of a drawing application interface process according to an embodiment of the present invention;

[0059] Figure 6 is an execution flow chart of a drawing module according to an embodiment of the present invention;

[0060] Figure 7 is a schematic diagram of node and line information within a drawing area according to an embodiment of the present invention;

[0061] Figure 8 is a schematic diagram of inter-region node connections according to an embodiment of the present invention;

[0062] Fig. 9 is a schematic diagram of external node connections according to an embodiment of the present invention;

[0063] Fig.10 is a logical diagram of querying nodes within the region and external nodes according to an embodiment of the present invention;

[0064] Fig.11 is a schematic diagram of topology legitimacy judgment according to an embodiment of the present invention;

[0065] Fig.12 4 is a schematic diagram of a legality detection process according to an embodiment of the present invention. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0067] See also Figure 1 , provides a method for multi-person collaborative topology orchestration in a network range, the method comprising the following steps:

[0068] S1. Create a topology canvas in the network target range and establish a coordinate system for the topology canvas that needs to be arranged.

[0069] In the description of the present invention, creating a topology canvas in a network range and establishing a coordinate system for the topology canvas to be arranged include the following steps:

[0070] S11. Arrange all nodes in the topology, create a rectangular area containing all nodes in the network target range as the topology canvas, and record the length and width of the topology canvas.

[0071] S12. Using one of the endpoints of the topology canvas as the origin, establish a rectangular coordinate system, and use the coordinate system position to represent any node in the topology canvas.

[0072] S13. Build a quadtree data structure to manage the drawable area in the topological canvas.

[0073] Among them, Quadtree is a tree data structure, which is particularly suitable for managing objects such as points and rectangles in two-dimensional space. It recursively divides the space into four quadrants or sub-areas, and each quadrant can be further subdivided. Using Quadtree to manage canvas areas can efficiently perform operations such as area allocation and conflict detection. Node types include internal nodes and leaf nodes, where an internal node contains four child nodes, representing the four quadrants of the space. Leaf nodes contain the actual stored area information.

[0074] The quadtree recursively divides the two-dimensional space into four sub-quadrants, each of which is further subdivided until a specific condition (such as the number of elements contained in each node) is met. Each quadtree node represents a rectangular area of ​​the canvas and stores the topological nodes in the area. When new topological nodes are added or deleted, the quadtree can efficiently update the structure to ensure efficient operation.

[0075] By using a quadtree data structure to manage canvas regions, region allocation, conflict detection, and undo operations can be performed efficiently. Quadtrees can quickly locate and manage objects in two-dimensional space, significantly improving the performance and efficiency of processing large-scale regions.

[0076] In the description of the present invention, constructing a quadtree data structure and managing the drawable area in the topological canvas includes the following steps:

[0077] S131. Create a quadtree root node to represent the initial area of ​​the entire topology canvas.

[0078] S132. When a new node is added to the topology canvas, a suitable leaf node is recursively found for storage according to the position of the node. If the leaf node is full, the leaf node is subdivided and the new node is reallocated to the new leaf node contained in the subdivided leaf node.

[0079] S133. Before inserting a new node, traverse all nodes in the leaf node to check whether there is a conflict with the existing node. If there is no conflict, the new node is inserted smoothly.

[0080] S134. When a node in the topology canvas is deleted, the node is deleted from the quadtree, and the quadtree data structure is updated.

[0081] S2. Receive the drawing area requested by the user through the user-oriented drawing application interface, and identify the overlap of the drawing areas based on the area application table with stored records.

[0082] In the description of the present invention, receiving the drawing area applied by the user through the drawing application interface facing the user, and identifying the overlap of the drawing area based on the area application table of the storage record includes the following steps:

[0083] S21, obtaining the drawing application initiated by the user, and determining whether there are other users' drawing applications being processed. If there are no other drawing applications being processed, executing step S22; if there are other drawing applications being processed, entering the waiting state, and executing step S22 after the waiting state ends.

[0084] S22. Query the list of all applied area information in the current topology, and determine whether the area information list is empty. If it is not empty, execute step S23; if it is empty, execute step S25.

[0085] S23, remove a region information from the region information list, and mark the coordinate values ​​of the four vertices of the region information as the region value, and then execute step S24.

[0086] S24. Mark the area corresponding to the user's drawing application as a drawing rectangle, record the area value, and then mark the removed area information as a removed rectangle, and determine whether there is an overlapping part between the drawing rectangle and the removed rectangle. If there is no overlapping part, return to step S22. If there is an overlapping part, return a failure signal and end the application.

[0087] Specifically, after the user issues a drawing application, it is necessary to determine whether the drawing area applied for by the user overlaps with the drawing area that has been applied for; if it overlaps, the application fails, otherwise the application is successful and recorded as the drawing area that has been applied for. The applied drawing area is displayed in the topology canvas for the user to edit, the edited node and connection information in the applied drawing area is queried and displayed, and the user's editing results are saved.

[0088] Determine whether the drawing area applied for by the user overlaps with the drawing area that has been applied for, including: judging whether the four vertices of the drawing area applied for by the user on the topological coordinate system fall within the coordinate rectangle of the drawing area that has been applied for in the same topology, and if at least one vertex falls within the drawing area that has been applied for, it is judged to overlap; and judging whether the four vertices of each drawing area that has been applied for in the same topology fall within the coordinate rectangle of the drawing area applied for by the user, and if at least one vertex falls within the drawing area that has been applied for by the user, it is judged to overlap; otherwise, it is not overlapped.

[0089] S25. Mark the topology corresponding to the drawing application as the topology id, and then query all data rows contained in the topology id in the area application table to find the largest area id value. If there is a maximum area id value, add 1 to the maximum area id value as the newly applied area id. If there is no maximum area id value, use 1 as the newly applied area id, and then execute step S26.

[0090] Specifically, query and display the edited node and line information in the applied drawing area, including: querying and displaying the node set whose topological node coordinates are within the drawing area; querying and displaying the line data whose starting point and end point are both in the node set.

[0091] The drawing area application information is saved in the area application table, including the topology ID, area ID, X-axis coordinate starting point, X-axis coordinate end point, Y-axis coordinate starting point and Y-axis coordinate end point; the drawn node information is saved in the topology node table, including the topology ID, node ID, X-axis coordinate and Y-axis coordinate; the drawn line information is saved in the topology node line table, including the topology ID, line ID, line starting point node ID and line end point node ID.

[0092] S26. Save the area information to the area application form, and then execute step S27.

[0093] S27. Return a success signal and the assigned area ID value as the drawing area requested by the user.

[0094] S3. Display the editable drawing area in the topology canvas, arrange the topology of the drawing area based on the real-time collaboration and synchronization strategy, and record and save the editing results.

[0095] In the description of the present invention, displaying an editable drawing area in a topology canvas, arranging the topology of the drawing area based on a real-time collaboration and synchronization strategy, and recording and saving the editing results include the following steps:

[0096] S31. Display the drawing area requested by the user in the topology canvas, and provide a visual display of node and line information, as well as free editing by the user.

[0097] S32. Obtain server cluster information, distribute multi-user requests to different server instances, and use an operation transformation algorithm to merge the editing operations of multiple users to keep the topology canvas globally consistent.

[0098] In the description of the present invention, obtaining server cluster information, allocating multi-user requests to different server instances, and merging the editing operations of multiple users using an operation transformation algorithm to maintain global consistency of the topology canvas include the following steps:

[0099] S321. Use a reverse proxy server (such as Nginx and other reverse proxy servers, which can distribute user requests to different server instances according to the load conditions, achieve load balancing, and avoid single-point overload) to distribute editing requests of different users to different server instances according to the current network load conditions.

[0100] S322. Deploy multiple server instances (WebSocket server instances) to process users' real-time communication requests at the same time. Users establish real-time communication channels with the server through the server instances and perform editing operations in the visual interface (users establish real-time communication channels with the server through WebSocket and perform operations such as adding, deleting, and moving nodes on the interface).

[0101] S323. The server receives the user operation request and uses an operation transformation algorithm to merge the operations of multiple users to maintain the global consistency of the topology canvas.

[0102] Among them, the Operational Transformation (OT) algorithm can ensure that when multiple users edit different parts of the same canvas at the same time, the operations can be merged correctly.

[0103] S324. Utilize the server to calculate the difference between the operations of multiple users, and push it to each user through the real-time communication channel to achieve information synchronization.

[0104] S33. Manage shared state and data storage, and monitor and dynamically adjust server load.

[0105] In the description of the present invention, managing shared state and data storage, and monitoring and dynamically adjusting server load includes the following steps:

[0106] S331. Use the memory database as a shared state storage to manage the state synchronization and management between multiple server instances, realize fast access between server instances, and use the database to store the real-time canvas state of the topology canvas during the editing operation.

[0107] S332. Use consistent hashing algorithm to distribute user sessions between servers, monitor the load of server cluster in real time, and dynamically adjust the number of server instances.

[0108] In the description of the present invention, the consistent hashing algorithm is used to distribute user sessions between servers, and the load of the server cluster is monitored in real time. The dynamic adjustment of the number of server instances includes the following steps:

[0109] S3321. Deploy the server instances in a hash ring, calculate the hash value of each server instance through a hash function, and then map it to the corresponding position on the hash ring.

[0110] S3322. When a user initiates a drawing application and connects to the server, the user's hash coefficient is calculated, and the user's hash value is mapped to the hash ring. The first server instance is found in a clockwise direction, and the user session is assigned to the server instance.

[0111] S3323. Define the load threshold, deploy a load balancing manager to monitor the load situation, dynamically adjust the number of server instances based on the load situation, and dynamically update the hash ring after the adjustment.

[0112] Specifically, define load thresholds, including upper and lower limits, to determine whether to increase or decrease server instances. Upper threshold: When the load exceeds this value, you need to increase server instances. Lower threshold: When the load is lower than this value, you can reduce server instances. Deploy a load balancing manager to monitor the load of the server cluster and dynamically adjust the number of server instances based on the load. The load balancing manager regularly obtains and analyzes load data.

[0113] When it is detected that the load of some server instances exceeds the upper threshold, the load balancing manager starts a new WebSocket server instance, adds the new server instance to the hash ring, and redistributes some user sessions to the new server instance to balance the load.

[0114] When it is detected that the overall load of the server cluster is lower than the lower threshold, the load balancing manager can choose to shut down some low-load WebSocket server instances, redistribute user sessions on the server instance to be shut down to other server instances, and remove the instance from the hash ring.

[0115] Each time you increase or decrease the number of server instances, the hash ring is dynamically updated to recalculate and distribute user sessions to ensure load balancing and session stickiness.

[0116] S34. Record the editing information during the editing process of the user's application and save the editing results.

[0117] S4. Receive the cancellation application initiated by the user through the user-oriented application cancellation interface, and delete the drawing area applied by the user from the area application table.

[0118] See also Figure 2 , provides a system for multi-person collaborative topology arrangement in a network range, the system comprising: a collaborative control module, a drawing module and a storage module, wherein the collaborative control module is used to establish a coordinate system for the topology canvas to be arranged in the network range. Receive the drawing area requested by the user and identify the overlap of the drawing area. The drawing module is used to display the drawing area requested by the user in the topology canvas for the user to edit, query and display the edited node and connection information, and save the user's editing results. The storage module is used to store topology information, drawing area application information and topology drawing data information.

[0119] In the description of the present invention, the collaboration control module provides two interfaces externally, including a drawing application interface and an application cancellation interface, and the storage module includes a topology table, a topology node table, a topology node connection table and an area application table.

[0120] In summary, the present invention discloses a method for multi-person collaborative topology arrangement in a network range, by splitting a large-scale topology according to coordinates into multiple independent drawing areas, each drawing area can be edited by an independent user, thereby realizing multi-person collaborative editing of a large topology and improving drawing efficiency. The method first establishes a coordinate system for the topology canvas to be arranged in the network range, and when the user needs to draw an area, receives the drawing area applied by the user, and determines whether the drawing area applied by the user overlaps with the drawing area that has been applied for; if it overlaps, the application fails, otherwise the application succeeds and is recorded as the drawing area that has been applied for, and the applied drawing area is displayed in the topology canvas for the user to edit, and the edited node and connection information in the applied drawing area is queried and displayed, and the user's editing results are saved; after the user has finished drawing, the user's application to cancel the drawing area is received, and the area is deleted from the list of applied drawing areas.

[0121] The overall idea of ​​the present invention is that when drawing a topology with N nodes, the N nodes can be scattered in a rectangular area, such as an area with a length of L and a height of H. A coordinate system is established with the length of the rectangle as the X-axis and the Y-axis. Then, any node in the topology can be identified by the coordinate system position. The coordinates of any node M are expressed as (X m , Y m ), where 0 <X m <L+1,0<Y m <H+1。

[0122] When the number of nodes N is large, the rectangle will also be large. You can use the X-axis and Y-axis to establish a dividing line to divide a rectangle into multiple rectangles. The content in each rectangle is edited by different users. After editing each rectangle, the nodes related to each rectangle are processed. In this way, collaborative arrangement among multiple people can be achieved. Figure 3 and Figure 7 As shown, the entire topology is divided into multiple parts, each of which can be edited by one user, which greatly improves efficiency.

[0123] Figure 4 The topological editing process of region segmentation based on the above coordinate system is illustrated, including:

[0124] N1: The user creates a new square canvas and sets the side length of the canvas to N. Thus, a rectangular coordinate system can be established with the lower left corner of the square as the origin. All nodes in the topology can be represented in this coordinate system, inside a rectangle formed by four straight lines x=0, x=L+1, y=0, and y=H+1. Go to step N2.

[0125] N2: When a user needs to edit the topology, he needs to apply for the editing area first, and enter the range of the X-axis and Y-axis to circle the topology area, such as (X1, X2, Y1, Y2). Enter judgment S1.

[0126] S1: Determine whether the area passed in overlaps with other applied areas. If so, proceed to step S2; if not, proceed to step N3.

[0127] N3: The user obtains the authority of the specified area and draws the topology in the area. After the drawing is completed, it goes to step N4.

[0128] N4: Save the result drawn by the user, and enter judgment S2 after saving.

[0129] S2: If it is necessary to continue drawing, go to step N2, otherwise end.

[0130] like Figure 2 As shown, an embodiment of the present invention also discloses a system for multi-person collaborative topology arrangement in a network range, comprising: a drawing module, a storage module and a collaborative control module.

[0131] The drawing module is a user interface for visually editing topology. It displays the drawing area requested by the user in the topology canvas for editing, queries and displays the edited node and line information, and saves the user's editing results.

[0132] The storage module is used to store the data after the entire topology is drawn, including topology information, drawing area application information, and topology drawing data information;

[0133] The collaborative control module is used to establish a coordinate system for the topological canvas to be arranged in the network target range; receive the drawing area requested by the user, and determine whether the drawing area requested by the user overlaps with the drawing area that has been requested; if it overlaps, the application fails, otherwise the application succeeds and is recorded as the drawing area that has been requested; and receive the user's application to cancel the drawing area and delete the area from the list of drawing areas that have been requested.

[0134] Since it can support multiple people to edit a topology at the same time, in order to avoid editing conflicts, this module is introduced to limit each person's editing.

[0135] The storage module mainly contains the following four tables.

[0136] Table 1: Topology table attributes

[0137] Topology ID Region size Other properties 100 1000 /

[0138] The topology table is shown in Table 1. It is used to store the basic information of a topology, including the topology id and the area size. The topology id can be represented by an increasing number, which is unique in the entire table and is used to specify a certain topology. The number of nodes indicates the side length of the area occupied by the current topology. For example, if the area size is 1000, it means that all nodes are scattered in a square area with a length of 1000 and a height of 1000. Whether it is an external node attribute indicates whether the node is an external node and can be displayed in other areas and directly connected to nodes in other areas. Other attributes such as topology name, icon, etc. can be added to the table as needed.

[0139] Table 2: Topology node table attributes

[0140]

[0141]

[0142] The topology node table is shown in Table 2, which is used to store information about a batch of nodes, including topology id, node id, X coordinate, and Y coordinate. The topology id refers to which topology the node belongs to, and is associated with the topology id field of the topology table; the node id indicates the id of the node, which is identified by uuid and is unique in the current table, and the ids of any two nodes will not be repeated; the X coordinate indicates the position of the node on the X axis; the Y coordinate indicates the position of the node on the Y axis; other attributes such as node name, CPU size, memory size, disk size, etc. can be added to the table as needed.

[0143] Table 3: Topology node connection table attributes

[0144]

[0145] The topology node connection table is shown in Table 3, which is used to store connection information, including topology id, connection id, connection start node id, and connection end node id. The topology id is which topology the connection belongs to, and is associated with the topology id field of the topology table; the connection id represents the id of the connection, which is identified by uuid and is unique in the current table. The ids of any two connections will not be repeated; the connection start node id represents the id of the first node during the connection operation, and is associated with the node id of the topology node table; the connection end node id represents the id of the second node during the connection operation, and is associated with the node id of the topology node table.

[0146] Table 4: Regional Application Form Attributes

[0147] Topology ID Region ID X1 value X2 value Y1 value Y2 value 100 1 10 30 10 30 100 2 30 40 10 30

[0148] The area application table is shown in Figure 4. It is used to store the areas currently applied for by all users, including topology id, area id, X1 value, X2 value, Y1 value, and Y2 value. The topology id refers to which topology the line belongs to, and is associated with the topology id field of the topology table; the area id is the identifier of an area, which can be represented by an increasing number and is unique within the same topology id; the X1 value represents the minimum X-axis value of the area; the X2 value represents the maximum X-axis value of the area; the Y1 value represents the minimum Y-axis value of the area; and the Y2 value represents the maximum Y-axis value of the area.

[0149] The collaborative control module can receive the area application from the drawing module, and query the applied area from the storage module. After judgment, it returns the application result to the drawing module. If there is a successful application or a revoked application, the data can also be sent to the storage module for storage and deletion.

[0150] The collaboration control module provides HTTP services to the outside world and includes two interfaces: drawing application interface and application cancellation interface. The parameters of the two interfaces are shown in Table 5 and Table 6.

[0151] Table 5: Drawing application interface

[0152]

[0153] Table 6: Application cancellation interface

[0154]

[0155] Figure 5 The drawing application interface processing flow is illustrated, including the following contents.

[0156] S1: Determine whether there are other applications being processed to avoid conflicts when concurrent applications are processed. If there are no other applications, proceed to step N1, otherwise wait for 1 second and continue to execute determination S1;

[0157] N1: Query the list of all applied area information in the current topology. Assume the input topology id is ${topo_id}. The specific logic is to query all data rows in the area application form where topo_id = ${topo_id}. Proceed to judgment S2;

[0158] S2: Judge whether the queried list of area information is empty. If it is not empty, it means there are still areas that need to be judged for conflicts, and proceed to step N2; otherwise, proceed to step N3.

[0159] N2: Remove one area information from the queried list of area information, and mark its coordinate values as X1, X2, Y1, Y2. After removal, the queried list of area information will have one less element. Proceed to judgment S3.

[0160] S3: Mark the area input during application as rectangle A, and its area values are ${input_x1}, ${input_x2}, ${input_y1}, ${input_y2}. Mark the area removed in step N2 as rectangle B, and its area values are X1, X2, Y1, Y2. Judge whether the two areas overlap, and calculate the following 8 conditions in sequence:

[0161] Condition 1: Judge whether the lower left corner (${input_x1}, ${input_y1}) of rectangle A is contained in rectangle B, that is, X1 < ${input_x1} < X2 and Y1 < ${input_y1} < Y2. If it is satisfied, proceed to step N6;

[0162] Condition 2: Judge whether the upper left corner (${input_x1}, ${input_y2}) of rectangle A is contained in rectangle B, that is, X1 < ${input_x1} < X2 and Y1 < ${input_y2} < Y2. If it is satisfied, proceed to step N6;

[0163] Condition 3: Judge whether the upper right corner (${input_x2}, ${input_y2}) of rectangle A is contained in rectangle B, that is, X1 < ${input_x2} < X2 and Y1 < ${input_y2} < Y2. If it is satisfied, proceed to step N6;

[0164] Condition 4: Judge whether the lower right corner (${input_x2}, ${input_y1}) of rectangle A is contained in rectangle B, that is, X1 < ${input_x2} < X2 and Y1 < ${input_y1} < Y2. If it is satisfied, proceed to step N6;

[0165] Condition 5: Determine whether the lower left corner (X1, Y1) of rectangle B is contained in rectangle A, that is, ${input_x1}<X1<${input_x2}, ${input_y1}<Y1<${input_y2}. If it is satisfied, proceed to step N6;

[0166] Condition 6: Determine whether the upper left corner (X1, Y2) of rectangle B is contained in rectangle A, that is, ${input_x1}<X1<${input_x2}, ${input_y1}<Y2<${input_y2}. If it is satisfied, proceed to step N6;

[0167] Condition 7: Determine whether the upper right corner (X2, Y2) of rectangle B is contained in rectangle A, that is, ${input_x1}<X2<${input_x2}, ${input_y1}<Y2<${input_y2}. If it is satisfied, proceed to step N6;

[0168] Condition 8: Determine whether the lower right corner (X2, Y1) of rectangle B is contained in rectangle A, that is, ${input_x1}<X2<${input_x2}, ${input_y1}<Y1<${input_y2}. If it is satisfied, proceed to step N6;

[0169] After the 8 conditions are judged, proceed to judge S2;

[0170] N3: Obtain the largest area id in the current topology. Assume the input topology id is ${topo_id}, then query the data row in the area application form where topo_id = ${topo_id} for the largest area id value. If there is one, add 1 as the newly applied area id. If not, use 1 as the newly applied area id. Proceed to step N4;

[0171] N4: Save the area information into the area application form, including the input topology id, X1, X2, Y1, Y2, and the allocated area id value;

[0172] N5: Return result = true, and the allocated area id value;

[0173] N6: Return result = false.

[0174] For the application revocation interface process, just delete the record corresponding to the application id.

[0175] The drawing module can send drawing area application and revocation applications to the collaboration control module, and can query and send the data that needs to be saved to the storage module. Figure 6 Schematically shows the execution process of the drawing module, including:

[0176] N1: Set the X1, X2, Y1, and Y2 values of the set area, and send a request for a drawing application to the collaboration control module. Enter judgment S1;

[0177] S1: If the drawing application interface returns result = true, then enter step N2; otherwise, enter judgment S2;

[0178] S2: If there is no more drawing, then end; if still need to draw, then enter step N1;

[0179] N2: Query the node and connection information within the current area and draw it on the interface for display. The specific query logic is as follows. Assume the current area boundary values ${input_x1}, ${input_x2}, ${input_y1}, ${input_y2}. Query the nodes in the node table that satisfy ${input_x1} < X1 attribute value < ${input_x2} and ${input_x1} < X2 attribute value < ${input_x2} and ${input_y1} < Y1 attribute value < ${input_y2} and ${input_y1} < Y2 attribute value < ${input_y2} as the nodes to be displayed; query the connection data in the node connection table that satisfies the start node id and the end node id are both the node ids in the previous step as the connections to be displayed. The result of such a query is to only display the nodes and connections that are completely within the area. For example, Figure 6 , for the area selected by x1, x2, y1, y2, nodes A, B, and connection 2 can be displayed. Then enter step N3;

[0180] N3: The user edits the interface and enters step N4;

[0181] N4: The drawing module saves the latest data to the topology node table and topology node connection table in the storage module. Specifically, first delete all the data queried in step N2, and then write the new data. Then enter step N5;

[0182] N5: After saving, release the applied data, delete the data corresponding to the current application id, and then end.

[0183] In addition, regarding the connection of nodes between regions, after dividing the regions, there may be a problem that nodes in different regions need to be connected. Therefore, a setting of external nodes is introduced. For example, Figure 8 As shown, when a node is selected in the region and right-clicked or other methods are used, an option to set the node as an external node will pop up. If the current node is not an external node, the option "Set as External Node" will pop up; if the current node is already an external node, the option "Cancel External Node" will pop up.

[0184] After setting as external nodes, when editing other areas, these nodes will appear in the external node area above the area. Nodes in this area can be directly connected to nodes in the external node area, such as Fig. 9 shown.

[0185] The query logic of nodes within the region and external nodes is as follows Fig.10 As shown, including the following.

[0186] N1: Set the area to be queried to ${input_x1}, ${input_x2}, ${input_y1}, ${input_y2}, and the topology id to ${topo_id}, and go to step N2;

[0187] N2: Query the nodes inside the area from the topological node table according to the area range. The query conditions are as follows:

[0188] [Topology id = ${topo_id}] and [${input_x1} <= X coordinate <= ${input_x2}] and [${input_y1} <= Y coordinate <= ${input_y2}]. Let the list of all nodes to be queried be L1, and go to step N3;

[0189] N3: Based on the area range, query the nodes that can be connected outside the area from the topological node table. The query conditions are as follows:

[0190] [Topology id = ${topo_id}] and [(X coordinate < ${input_x1} or X coordinate > ${input_x2}

[0191] or Y coordinate <${input_y1} or Y coordinate >${input_y2})] and [Is it an external node = yes]. Let the list of all nodes to be queried be L2, and go to step N4.

[0192] N4: Extract all node IDs according to the node lists L1 and L2 queried in N2 and N3, set them as ${id_list}, and query the topology node connection table attribute table. The query conditions are as follows:

[0193] [Topology id = ${topo_id}] and [the connection start node id is contained in ${id_list}] and [the connection end node id is contained in ${id_list}].

[0194] All the queried nodes and links are returned as results, and the process ends.

[0195] Regarding the topology legitimacy judgment, in a normal topology, all nodes should be connected. An isolated node or multiple groups of isolated nodes have no meaning for the target range. Fig.11 , there are three groups of nodes in the area, but not all of them are connected. Such a topology is meaningless in business use. Therefore, it is necessary to detect it when saving the topology.

[0196] Due to the large number of nodes in a large topology, it is difficult to detect whether there are independent nodes manually. After saving the topology data, you can perform topology detection. The detection process is as follows: Fig.12 , including the following contents.

[0197] N1: Assume that the input topology id is ${topo_id}, the processed node id set to be used in the process is ${handle_id_list}, the current processing node id set is ${current_handle_id_list}, the queue used is ${queue}, query all node id lists ${all_id_list} from the topology node table, the query condition is [topology id = ${topo_id}], and go to step N2;

[0198] N2: Get an unprocessed node id from ${all_id_list}, that is, the id is not included in ${handle_id_list}, and set the id to ${id_x1}. If it is obtained, go to step N3, otherwise go to step N10;

[0199] N3: Add ${id_x1} to ${handle_id_list}, ${current_handle_id_list} and ${queue}. Go to step N4;

[0200] N4: Pop a node id from ${queue}. If the node is popped successfully, it is set to ${id_x2} and the process goes to step N5. If the node fails to be popped, the process goes to step N8.

[0201] N5: Query all node IDs connected to the ${id_x2} node from the topology node connection table. First, according to the query conditions [topology ID = ${topo_id}] and [connection start node ID = ${id_x2}], obtain all connection end node IDs and set them as ${target_id_list}; then according to the query conditions [topology ID = ${topo_id}] and [connection end node ID = ${id_x2}], obtain all connection start node IDs and set them as ${source_id_list}, aggregate ${target_id_list} and ${source_id_list} together, set them as ${connect_id_list}, and proceed to step N6;

[0202] N6: Remove the node IDs contained in ${handle_id_list} from ${connect_id_list}, and set the remaining node ID list as ${filter_connect_id_list}. Go to step N7.

[0203] N7: Add ${filter_connect_id_list} to ${queue}, ${handle_id_list}, and ${current_handle_id_list}, and go to step N4;

[0204] N8: Record all node IDs in ${current_handle_id_list} and set them to ${handle_id_list_N}, where N increases from 1, and go to step N9;

[0205] N9: Clear ${current_handle_id_list} and go to step N2;

[0206] N10: ${handle_id_list_1}, ${handle_id_list_2}...${handle_id_list_N} are all the detected connected node groups. If there is more than one group, a prompt is given. The process ends.

[0207] In summary, with the help of the above technical solution of the present invention, the present invention introduces a coordinate system to mark the position of each node in the coordinate system, and by dividing different areas in the coordinate system, nodes and lines can be edited separately in different areas, and the areas will not affect each other, and multi-person topology editing can be performed, which greatly improves the editing efficiency of large topologies and reduces errors; at the same time, by splitting the large topology according to the coordinates, it is divided into multiple independent drawing areas, and each drawing area can be edited by an independent user, thereby realizing multi-person collaborative editing of large topologies and improving drawing efficiency. By introducing quadtree structure management, operation transformation and differential synchronization to improve real-time collaboration capabilities, as well as role-based permission control and transaction management, the efficiency and experience of multi-person collaborative topology orchestration are improved; at the same time, it can handle large-scale network topologies, ensure that the operations of each user are synchronized and consistent in real time, and reflect the functional advantages of multi-person collaborative orchestration. In addition, by combining load balancing and real-time collaboration strategies, the function of displaying editable drawing areas in the topology canvas and recording and saving editing results is realized, which not only improves the high availability and scalability of the system, but also ensures the efficiency and consistency of multi-person collaborative topology orchestration.

[0208] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

Claims

1. A method for multi-person collaborative topology arrangement in a network range, characterized in that: The method comprises the following steps: S1. Create a topology canvas in the network target range and establish a coordinate system for the topology canvas that needs to be arranged; S2. receiving a drawing area requested by a user through a drawing application interface facing a user, and identifying overlap of the drawing areas based on the area application table of stored records; S3. Display the editable drawing area in the topology canvas, arrange the topology of the drawing area based on the real-time collaboration and synchronization strategy, and record and save the editing results; S4. Receive the cancellation application initiated by the user through the user-oriented application cancellation interface, and delete the drawing area applied by the user from the area application table.

2. According to claim 1, a method for multi-person collaborative topology arrangement in a network range is characterized in that: The step of creating a topology canvas in the network range and establishing a coordinate system for the topology canvas to be arranged includes the following steps: S11, sorting all nodes in the topology, creating a rectangular area containing all nodes in the network target range as a topology canvas, and recording the length and width of the topology canvas; S12, using one of the endpoints of the topology canvas as the origin, establishing a rectangular coordinate system, and using the coordinate system position to represent any node in the topology canvas; S13. Build a quadtree data structure to manage the drawable area in the topological canvas.

3. The method for multi-person collaborative topology arrangement in a network range according to claim 2, characterized in that: The construction of the quadtree data structure and management of the drawable area in the topology canvas includes the following steps: S131. Create a quadtree root node to represent the initial area of ​​the entire topology canvas; S132, when a new node is added to the topology canvas, a suitable leaf node is recursively found for storage according to the position of the node. If the leaf node is full, the leaf node is subdivided and the new node is reallocated to the new leaf node contained in the subdivided leaf node; S133, before inserting a new node, traverse all nodes in the leaf node to check whether there is a conflict with the existing node. If there is no conflict, insert it successfully; S134. When a node in the topology canvas is deleted, the node is deleted from the quadtree, and the quadtree data structure is updated.

4. The method for multi-person collaborative topology arrangement in a network range according to claim 1, characterized in that: The method of receiving the drawing area requested by the user through the drawing application interface for the user and identifying the overlap of the drawing areas based on the area application table with stored records includes the following steps: S21, obtaining a drawing application initiated by a user, and determining whether there are drawing applications of other users being processed. If there are no other drawing applications being processed, executing step S22; if there are other drawing applications being processed, entering a waiting state, and executing step S22 after the waiting state ends; S22, querying the list of all applied area information in the current topology, and determining whether the area information list is empty, if not empty, executing step S23, if empty, executing step S25; S23, remove a region information from the region information list, and mark the coordinate values ​​of the four vertices of the region information as the region value, and then execute step S24; S24, marking the area corresponding to the user's drawing application as a drawing rectangle, and recording the area value, and then marking the removed area information as a removal rectangle, and determining whether there is an overlapping part between the drawing rectangle and the removal rectangle. If there is no overlapping part, returning to step S22, if there is an overlapping part, returning a failure signal, and ending the application; S25, mark the topology corresponding to the drawing application as the topology id, and then query all data rows contained in the topology id in the area application table to find the largest area id value. If there is a largest area id value, add 1 to the largest area id value as the newly applied area id. If there is no largest area id value, use 1 as the newly applied area id, and then execute step S26; S26, save the area information to the area application form, and then execute step S27; S27. Return a success signal and the assigned area ID value as the drawing area requested by the user.

5. The method for multi-person collaborative topology arrangement in a network range according to claim 1, characterized in that: The process of displaying an editable drawing area in a topology canvas, arranging the topology of the drawing area based on a real-time collaboration and synchronization strategy, and recording and saving the editing results includes the following steps: S31. Display the drawing area requested by the user in the topology canvas, and provide a visual display of node and line information, as well as free editing by the user; S32, obtaining server cluster information, allocating multi-user requests to different server instances, and using an operation transformation algorithm to merge editing operations of multiple users to keep the topology canvas globally consistent; S33, manage shared state and data storage, and monitor and dynamically adjust server load; S34. Record the editing information during the editing process of the user's application and save the editing results.

6. The method for multi-person collaborative topology arrangement in a network range according to claim 5, characterized in that: The steps of obtaining server cluster information, allocating multi-user requests to different server instances, and merging editing operations of multiple users using an operation transformation algorithm to maintain global consistency of the topology canvas include the following steps: S321, using a reverse proxy server, distributing editing requests of different users to different server instances according to the current network load; S322, deploy multiple server instances to process the user's real-time communication request at the same time, and the user establishes a real-time communication channel with the server through the server instance and performs editing operations in the visual interface; S323, the server receives the user operation request, and uses the operation transformation algorithm to merge the operations of multiple users to maintain the global consistency of the topology canvas; S324. Utilize the server to calculate the difference between the operations of multiple users, and push it to each user through the real-time communication channel to achieve information synchronization.

7. The method for multi-person collaborative topology arrangement in a network range according to claim 6, characterized in that: The management of shared state and data storage, and monitoring and dynamically adjusting server load includes the following steps: S331, using a memory database as a shared state storage to manage state synchronization and management between multiple server instances, achieving fast access between server instances, and using a database to store the real-time canvas state of the topology canvas during the editing operation; S332. Use consistent hashing algorithm to distribute user sessions between servers, monitor the load of server cluster in real time, and dynamically adjust the number of server instances.

8. The method for topology arrangement by multiple people in a network range according to claim 7, characterized in that: The method of using a consistent hashing algorithm to distribute user sessions between servers, monitoring the load of the server cluster in real time, and dynamically adjusting the number of server instances includes the following steps: S3321. Deploy the server instances in a hash ring, calculate the hash value of each server instance through a hash function, and then map it to a corresponding position on the hash ring; S3322: When a user initiates a drawing application and connects to a server, the user's hash coefficient is calculated, and the user's hash value is mapped to a hash ring. The first server instance is searched in a clockwise direction, and the user session is assigned to the server instance. S3323. Define the load threshold, deploy a load balancing manager to monitor the load situation, dynamically adjust the number of server instances based on the load situation, and dynamically update the hash ring after the adjustment.

9. A system for multi-person collaborative topology arrangement in a network range, used to implement a method for multi-person collaborative topology arrangement in a network range as described in any one of claims 1 to 9, characterized in that: The system includes: a collaborative control module, a drawing module and a storage module, wherein: The collaborative control module is used to establish a coordinate system for the topological canvas to be arranged in the network range; receive the drawing area requested by the user, and identify the overlap of the drawing area; The drawing module is used to display the drawing area requested by the user in the topology canvas for the user to edit, query and display the edited node and connection information, and save the user's editing results; The storage module is used to store topology information, drawing area application information and topology drawing data information.

10. A method and system for multi-person collaborative topology arrangement in a network range according to claim 9, characterized in that: The collaboration control module provides two interfaces externally, including a drawing application interface and an application cancellation interface. The storage module includes a topology table, a topology node table, a topology node connection table and an area application table.

Citation Information

Cited By

  • Target network construction method for software-defined target range and related equipment

    CN120811909A