Topological graph generation method and device, electronic equipment and storage medium
By allocating nodes to multiple logical layers in the microservice architecture and performing layered layout rendering, the problems of insufficient layout performance and low rendering flexibility in the prior art are solved, and topology maps of complex call relationships are efficiently generated and positioned.
Patent Information
- Application Number
- CN202410216889.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-27
- Publication Date
- 2025-08-29
AI Technical Summary
When the prior art generates topology diagrams in microservice architecture, it is difficult to effectively display complex call relationships, resulting in insufficient layout performance, unable to adapt to large-scale call scenarios, and the rendering flexibility is not high, making it difficult to locate faults in a convenient way.
By analyzing the call relationship information, nodes are allocated to multiple logical layers, and hierarchical layout and rendering methods are adopted to reduce the number of crossed edges, improve layout performance, and hierarchical rendering strategies are used to improve rendering flexibility and scalable performance of topology maps, which facilitates the positioning of nodes or edges.
It realizes efficient generation of topology maps in large-scale complex call scenarios, reduces crossed edges, improves layout and rendering performance, facilitates fault location, and is suitable for topology map generation for online payment and other services.
Smart Images

Figure CN120561340A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of image processing technology, and in particular to a method for generating a topological map, a device for generating a topological map, an electronic device, and a computer-readable storage medium. Background Art
[0002] In a microservices architecture, services often interact with each other. For example, a platform's online payment service typically requires a user service to handle operations like login verification, an order service to process orders and send payment requests to a payment service, and a payment service to receive payment requests and verify order information. A risk control service may also be called to conduct risk control reviews. A payment core service may also be called to invoke a payment interface to deduct funds and process refund requests. A notification service may also be used to notify users of payment results. Clearly, microservices involve multiple services working together to complete the relevant business processes.
[0003] The topology diagram can be used to explicitly present the complex call relationships between microservices. In addition, when a business function fails, the topology diagram can be used to conveniently locate the fault. This technical solution provides a solution for generating a topology diagram that reflects the call relationship. Summary of the Invention
[0004] The present application provides a method for generating a topology map, a device for generating a topology map, an electronic device, and a computer-readable storage medium, which can provide a solution for generating a topology map that reflects a call relationship.
[0005] In a first aspect, the present application provides a method for generating a topological graph, which includes: parsing call relationship information to obtain nodes contained in the call relationship information and edges reflecting the topological relationship between the nodes; allocating the nodes to N logical layers according to the topological relationship reflected by the edges, sorting the nodes in the i-th logical layer, and obtaining layout information of the call relationship information, where N is a positive integer and i is a positive integer not greater than N; and, in a layered manner, rendering processing is performed according to the layout information to obtain a topological graph corresponding to the call relationship information.
[0006] In an exemplary embodiment, based on the aforementioned scheme, allocating the nodes to N logical layers according to the topological relationship reflected by the edges includes: allocating the nodes to N logical layers based on a preset hierarchical principle; wherein the hierarchical principle includes one or more of the following information: arranging as many edges as possible in one direction, and adjacent nodes are allocated to the same layer or adjacent layers.
[0007] In an exemplary embodiment, based on the aforementioned scheme, the rendering processing is performed according to the layout information in a layered manner to obtain a topological graph corresponding to the call relationship information, including: performing rendering processing in a point rendering layer according to the node coordinates in the layout information to obtain a node-associated area in the topological graph; and performing rendering processing in an edge rendering layer according to the topological relationship between the node coordinates reflected by the edge to obtain an edge-associated area in the topological graph.
[0008] In an exemplary embodiment, based on the above solution, the node association area includes at least one or more of the following information: an icon area, a label area, an extended information area, an in-degree information area, an out-degree information area, an operation area, and a wrapping layer;
[0009] Among them, the icon area in the node association area of the target node is used to display the icon associated with the target node; the label area in the node association area of the target node is used to describe the attribute information of the target node; the in-degree information area in the node association area of the target node is used to represent the information of the edge pointing to the target node; the out-degree information area in the node association area of the target node is used to represent the information of the edge starting from the target node; the operation area in the node association area of the target node is a functional area for the user to interact with the target node; the wrapping layer in the node association area of the target node is a visual container or layout element surrounding the association area of the target node.
[0010] In an exemplary embodiment, based on the aforementioned solution, the edge-associated area includes at least one or more of the following information: a connecting edge, a label area, and a wrapping layer;
[0011] Among them, the connecting edge in the area associated with the target edge is used to connect the starting node and the ending node of the target edge; the label area in the area associated with the target edge is used to describe the attribute information of the target edge; and the wrapping layer in the area associated with the target edge is a visual container or layout element surrounding the area associated with the target edge.
[0012] In an exemplary embodiment, based on the aforementioned scheme, the rendering processing is performed according to the layout information in a layered manner to obtain a topology graph corresponding to the call relationship information, including: determining highlight processing information based on at least one of the package layer in the node association area and the package layer in the edge association area; and rendering processing of the highlight processing information in the effect layer to determine the topology graph.
[0013] In an exemplary embodiment, based on the aforementioned scheme, rendering processing is performed in a point rendering layer according to the node coordinates in the layout information, including: dividing the nodes into M groups, and performing rendering processing in the jth group in the point rendering layer according to the node coordinates of the jth group of nodes, where M is a positive integer and j is a positive integer less than or equal to M; and rendering processing is performed in an edge rendering layer according to the topological relationship between the node coordinates reflected by the edge, including: performing rendering processing in the jth group of the edge rendering layer for the connection relationship related to the jth group of nodes.
[0014] In an exemplary embodiment, based on the aforementioned scheme, the parsing of the call relationship information to obtain the nodes contained in the call relationship information and the edges reflecting the topological relationship between the nodes includes: parsing the call relationship information to obtain the nodes contained in the call relationship information and the edges reflecting the topological relationship between the nodes and graph information; wherein the graph information includes at least one of the following information: graph attribute information, graph size information and graph layout information.
[0015] In an exemplary embodiment, based on the aforementioned scheme, before allocating the nodes to N logical layers according to the topological relationship reflected by the edges, sorting the nodes in the i-th logical layer, and obtaining the layout information of the call relationship information, where N is a positive integer and i is a positive integer not greater than N, the method further includes: fusing the graph information, the node coordinates in the layout dotted line, and the topological relationship between the node coordinates; wherein the information after the fusion processing is used to determine the layout information of the call relationship information.
[0016] In an exemplary embodiment, based on the aforementioned scheme, the method for generating a topology map further includes: predetermining and storing layout information about the first display interface of the topology map and layout information corresponding to the second display interface; in response to receiving a drill-down operation or a hide operation on a target identifier in the first display interface, obtaining the rendering of the layout information corresponding to the second display interface; and rendering according to the layout information corresponding to the second display interface to display the second display interface of the topology map.
[0017] In a second aspect, the present application provides a device for generating a topological map, comprising: a parsing module, a layout module, and a rendering module; wherein the parsing module is used to parse call relationship information to obtain the nodes contained in the call relationship information and the edges reflecting the topological relationship between the nodes; the layout module is used to allocate the nodes to N logical layers according to the topological relationship reflected by the edges, sort the nodes in the i-th logical layer, and obtain layout information of the call relationship information, where N is a positive integer and i is a positive integer not greater than N; and the rendering module is used to perform rendering processing according to the layout information in a layered manner to obtain a topological map corresponding to the call relationship information.
[0018] In an exemplary embodiment, based on the aforementioned scheme, the above-mentioned layout module is specifically used to: allocate the nodes to N logical layers based on a preset layering principle; wherein the layering principle includes one or more of the following information: arranging as many edges as possible in one direction, and adjacent nodes are allocated to the same layer or adjacent layers.
[0019] In an exemplary embodiment, based on the aforementioned scheme, the rendering module includes a first rendering unit and a second rendering unit; wherein the first rendering unit is used to: perform rendering processing on a point rendering layer according to the node coordinates in the layout information to obtain a node-associated area in the topological graph; and the second rendering unit is used to: perform rendering processing on an edge rendering layer according to the topological relationship between the node coordinates reflected by the edges to obtain an edge-associated area in the topological graph.
[0020] In an exemplary embodiment, based on the above solution, the node association area includes at least one or more of the following information: an icon area, a label area, an extended information area, an in-degree information area, an out-degree information area, an operation area, and a wrapping layer;
[0021] Among them, the icon area in the node association area of the target node is used to display the icon associated with the target node; the label area in the node association area of the target node is used to describe the attribute information of the target node; the in-degree information area in the node association area of the target node is used to represent the information of the edge pointing to the target node; the out-degree information area in the node association area of the target node is used to represent the information of the edge starting from the target node; the operation area in the node association area of the target node is a functional area for the user to interact with the target node; the wrapping layer in the node association area of the target node is a visual container or layout element surrounding the association area of the target node.
[0022] In an exemplary embodiment, based on the aforementioned solution, the edge-associated area includes at least one or more of the following information: a connecting edge, a label area, and a wrapping layer;
[0023] Among them, the connecting edge in the area associated with the target edge is used to connect the starting node and the ending node of the target edge; the label area in the area associated with the target edge is used to describe the attribute information of the target edge; and the wrapping layer in the area associated with the target edge is a visual container or layout element surrounding the area associated with the target edge.
[0024] In an exemplary embodiment, based on the aforementioned solution, the rendering module further includes: a third rendering unit;
[0025] The third rendering unit is configured to: determine highlight processing information based on at least one of the wrapping layer in the node-associated area and the wrapping layer in the edge-associated area; and render the highlight processing information in the effect layer to determine the topology map.
[0026] In an exemplary embodiment, based on the aforementioned solution, the first rendering unit is specifically configured to divide the nodes into M groups, and perform rendering processing on the jth group in a point rendering layer based on the node coordinates of the jth group of nodes, where M is a positive integer and j is a positive integer less than or equal to M. The second rendering unit is specifically configured to perform rendering processing on the jth group of nodes in an edge rendering layer for connection relationships associated with the jth group of nodes.
[0027] In an exemplary embodiment, based on the aforementioned scheme, the parsing module is specifically used to: parse the call relationship information to obtain the nodes contained in the call relationship information and the edges reflecting the topological relationship between the nodes and the graph information; wherein the graph information includes at least one of the following information: graph attribute information, graph size information and graph layout information.
[0028] In an exemplary embodiment, based on the aforementioned scheme, the device for generating the above-mentioned topological graph further includes a fusion module; wherein the above-mentioned fusion module is used for: the layout module distributes the nodes to N logical layers according to the topological relationship reflected by the edges, sorts the nodes in the i-th logical layer, and obtains the layout information of the call relationship information, where N is a positive integer and i is a positive integer not greater than N, and the graph information, the node coordinates in the layout dotted line, and the topological relationship between the node coordinates are fused; wherein the information after the fusion processing is used to determine the layout information of the call relationship information.
[0029] In an exemplary embodiment, based on the aforementioned solution, the topology map generating device further includes: a pre-storage module and an acquisition module;
[0030] Among them, the above-mentioned pre-storage module is used to: pre-determine and store the layout information of the first display interface of the topology map and the layout information corresponding to the second display interface; the above-mentioned acquisition module is used to: respond to receiving a drill-down operation or a hide operation on the target identifier in the first display interface, and obtain the layout information rendering corresponding to the second display interface; and the above-mentioned rendering module is also used to: render according to the layout information corresponding to the second display interface to display the second display interface of the topology map.
[0031] In a third aspect, an electronic device is provided, comprising a processor and a memory; the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method for generating a topology map in the above-mentioned first aspect and its various implementation methods.
[0032] In a fourth aspect, a chip is provided for implementing the method described in any aspect of the first aspect or its implementations. Specifically, the chip includes a processor configured to retrieve and execute a computer program from a memory, causing a device equipped with the chip to execute the method for generating a topology map described in the first aspect and its implementations.
[0033] In a fifth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method for generating a topology map in the first aspect and its various implementations.
[0034] In a sixth aspect, a computer program product is provided, comprising computer program instructions, wherein the computer program instructions enable a computer to execute the method for generating a topology map in the first aspect and its various implementations.
[0035] In a seventh aspect, a computer program is provided, which, when executed on a computer, enables the computer to execute the method for generating a topology map in the first aspect and its various implementations.
[0036] In summary, in the solution provided by the embodiment of the present application, the call relationship information to be explicitly displayed is parsed to determine the nodes contained therein and the edges reflecting the topological relationship between the nodes. For example, taking online payment as an example, the nodes obtained by parsing can reflect the services related to online payment, and the edges obtained by parsing can reflect the calls between the online payment related services. Then, the nodes are allocated to multiple logical layers according to the topological relationship reflected by the edges, and the nodes in each logical layer are sorted to obtain the layout information of the call relationship information. The layout is performed in a hierarchical manner, which is conducive to reducing the number of cross edges and optimizing the layout. Furthermore, the rendering is performed in a hierarchical manner according to the layout information to obtain a topological graph corresponding to the call relationship information. The rendering is performed in a hierarchical manner, which is conducive to improving the flexibility of rendering, while improving the scalability of the topological graph, and also facilitates the positioning of a node or edge therein. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0038] Figure 1 Schematic diagram of a system framework applicable to embodiments of the present application;
[0039] Figure 2 A schematic diagram of a process for generating a topology map according to an embodiment of the present application;
[0040] Figure 3 A schematic diagram showing edges and nodes after layout processing provided in one embodiment of the present application;
[0041] Figure 4 A schematic diagram of a layered rendering strategy provided in one embodiment of the present application;
[0042] Figure 5 A schematic diagram of the structure of a point association area provided in one embodiment of the present application;
[0043] Figure 6 A schematic diagram of the structure of an edge-associated region provided in one embodiment of the present application;
[0044] Figure 7 A schematic diagram of a process for generating a topology map according to an embodiment of the present application;
[0045] Figure 8 A schematic diagram of a process for generating a topology map according to an embodiment of the present application;
[0046] Figure 9 This is a schematic diagram of the structure of a topology map generating device provided in one embodiment of the present application;
[0047] Figure 10 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0049] It should be noted that the terms "first," "second," and the like in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In the embodiments of the present invention, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A, but that B can also be determined based on A and / or other information. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or devices. In the description of this application, unless otherwise specified, "plurality" refers to two or more than two.
[0050] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0051] The graph generation solution provided by the related art uses the dagre.js library for layout implementation. Specifically, the dagre.js library leverages the powerful graphics rendering capabilities of the D3.js (Data-Driven Documents) library, combined with its own graph layout algorithms, to render structured graph data into visual graphics in the Scalable Vector Graphics (SVG) format. However, the layout performance of the solution provided by this related art needs to be improved, making it unsuitable for handling large-scale, complex call scenarios.
[0052] The solution provided by the embodiment of the present application can solve the above-mentioned technical problems existing in the relevant technology. Specifically, the embodiment of the present application distributes the nodes to multiple logical layers according to the topological relationship reflected by the edges, sorts the nodes in each logical layer, and obtains the layout information of the call relationship information. Among them, the layout is carried out in a layered manner, which is conducive to reducing the number of cross edges, improving the layout performance, and is suitable for processing large-scale complex call scenarios. Furthermore, in a layered manner, rendering processing is performed according to the layout information to obtain a topological graph corresponding to the call relationship information. Among them, the rendering processing is carried out in a layered manner, which is conducive to improving the flexibility of rendering, while improving the scalability of the topological graph, and also facilitates the positioning of a node or edge therein.
[0053] For example, Figure 1 FIG. 1 is a schematic diagram of a system framework applicable to an embodiment of the present application. Figure 1 As shown, the system framework may include a terminal 102 and a server 104 .
[0054] Exemplarily, the call relationship information to be explicitly displayed can be sent to the server 104 via the terminal 102. The server 104 parses the call relationship information to be explicitly displayed to determine the nodes contained in the call relationship information and the edges reflecting the topological relationship between the nodes. For example, taking online payment as an example, the nodes obtained by parsing can reflect the services related to online payment, and the edges obtained by parsing can reflect the calls between the online payment related services. Then, according to the topological relationship reflected by the edges, the nodes are allocated to N logical layers, and the nodes in the i-th logical layer are sorted to obtain the layout information of the call relationship information, where N is a positive integer and i is a positive integer not greater than N. Furthermore, in a layered manner, rendering processing is performed according to the layout information to obtain a topological graph corresponding to the call relationship information.
[0055] For example, the server 104 may also transmit the generated topology map to the terminal 102 so that the generated topology map can be displayed via the terminal 102. For example, during the layered rendering process, the server 104 may transmit the image corresponding to each layer to the terminal 102 for display after the image area for each layer is generated, so that the user can view the process of gradually generating the topology map. For example, when the server 104 performs rendering processing on multiple layers in parallel, the results of the parallel processing may be transmitted to the terminal 102 at once. This embodiment of the present application is not limited to this.
[0056] In an exemplary embodiment, the above-mentioned system architecture may also only include terminal 102. That is, after terminal 102 obtains the call relationship information to be explicitly displayed, it parses the call relationship information to be explicitly displayed to obtain the nodes contained in the call relationship information and the edges reflecting the topological relationship between the nodes. For example, taking online payment as an example, the nodes obtained by parsing can reflect the services related to online payment, and the edges obtained by parsing can reflect the calls between the online payment-related services. Then, according to the topological relationship reflected by the edges, the nodes are allocated to N logical layers, and the nodes in the i-th logical layer are sorted to obtain the layout information of the call relationship information. Furthermore, in a layered manner, rendering processing is performed according to the layout information to obtain a topological map corresponding to the call relationship information. The generated topological map is then displayed.
[0057] Among them, the above-mentioned terminal 102 is a smart phone, a tablet, an intelligent audio and video interactive device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a wearable smart device, a medical device, etc. As mentioned above, the above-mentioned terminal 102 is often equipped with a display device, which can also be a display, a display screen, a touch screen, etc. The touch screen can also be a touch screen, a touch panel, etc. However, it is not limited to this. The above-mentioned server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal 102 and the server 104 can be directly or indirectly connected via wired or wireless communication, and the embodiments of the present application are not limited thereto.
[0058] The following describes the technical solutions of the embodiments of the present application in detail through some embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0059] Figure 2 The flowchart of the method P200 for generating a topology map provided in the embodiment of the present application is shown in FIG. Figure 1 The terminal 104 can also be Figure 1 or an electronic device storing relevant algorithms, such as Figure 10 The electronic device 1000 shown in FIG. 1 is a schematic diagram of a method P200 in which the execution subject is a server. Figure 2, method P200 includes S210-S230.
[0060] In S210 , the call relationship information is parsed to obtain the nodes contained in the call relationship information and the edges reflecting the topological relationship between the nodes.
[0061] Parsing the original call relationship data. Exemplarily, the original call relationship data may be call links or function call sequences obtained from sources such as log files, interface responses, and code analysis tool output.
[0062] Exemplarily, based on the results obtained from parsing the call relationship data, such as a call chain or function call sequence, a node list of multiple nodes is constructed. Each independent module, class, method, or function in the call chain or function call sequence can be considered a node. Furthermore, the name, identity, and possible additional information of each node, such as type and location, are recorded to form the node list.
[0063] Exemplarily, based on the results obtained by parsing the above-mentioned call relationship data, such as call links or function call sequences, an edge list of multiple edges is constructed. For each edge, the two nodes connected by each edge can be specifically determined based on the call relationship. In other words, the edges in the topology graph reflect the call relationship between the nodes. For example, the edge from node A to node B reflects that node A calls node B. In this embodiment, the variable list is used to record the starting node ID (Identity) and ending node ID of each edge, as well as possible additional information, such as configuration information such as timeout and call volume, number of calls, call direction, timestamp, etc.
[0064] Through the above analysis process, the original abstract call relationship is converted into structured nodes and edges that are easy to display graphically. Furthermore, the layout information of the above nodes and edges is determined to draw a topological graph reflecting the call relationship based on the layout information.
[0065] Continue to refer Figure 2 In S220, the nodes are allocated to N logical layers according to the topological relationship reflected by the edge, and the nodes in the i-th logical layer are sorted to obtain the layout information of the call relationship information, where N is a positive integer and i is a positive integer not greater than N.
[0066] In an exemplary embodiment, the present application can use an open source layout engine to implement layout calculations. For example, a layer-based ELK (Eclipse Layout Kernel) algorithm can be used to implement layout.
[0067] First, in order to reduce the number of cross edges, a hierarchical method is used to first divide the nodes in the point list into different logical layers according to the topological relationship, for example, to N logical layers. Specifically, based on the preset hierarchical principle, the nodes are allocated to N logical layers. An exemplary hierarchical principle may be: arrange as many edges as possible in one direction. For example, if a node A is assigned to the i-th logical layer, the edges related to node A are not in the same direction (such as the horizontal direction) as the edges of the assigned nodes, and node A can be assigned to the i+1-th logical layer. An exemplary hierarchical principle may also be: adjacent nodes are assigned to the same layer or adjacent layers to reduce the number of cross edges. It should be noted that the above-mentioned hierarchical principle can also be a principle customized according to actual needs, and the embodiments of the present application are not limited to this. Exemplary reference Figure 3 , distribute the nodes into 3 logical layers, Figure 3 The direction of the edges shown in the figure is horizontal and to the right as much as possible.
[0068] Nodes are then sorted within and across layers. Within each logical layer, the horizontal order of nodes is further determined to minimize intra-layer line crossings. Aesthetic considerations, such as maintaining symmetry or balance, can also be considered during the sorting process within logical layers.
[0069] After all nodes are layered and the nodes within each logical layer are sorted, the coordinate information of each node can be determined based on the distance between nodes, the spacing between logical layers, and the space occupancy of the overall layout.
[0070] In an exemplary embodiment, for edges that span different logical layers, the number of crossings between these edges can be reduced as much as possible by adjusting the positions of nodes within the layers or introducing curved paths.
[0071] Exemplarily, during the layout calculation process, in addition to determining the coordinate information of each node in the above-mentioned point list, the port information of the relevant nodes can also be determined. Among them, ports are connectable elements attached to relevant nodes, which can be specifically expressed as specific connection points on the node boundary (specifically, the node's outline or area boundary). In a visual diagram, the port can be expressed as a small circle, rectangular box or other shape on the node boundary. The port can identify the specific location where information, data or control signals are received or sent from the node. For example, when displaying the program call relationship, the input and output ports of different function nodes can clearly reflect the call link between functions; for example, in a hardware circuit diagram, the port of the component node shows the input and output line of the signal. It can be seen that ports can be used to connect to other nodes or external elements. In an embodiment of the present application, the precise position of each port on the node boundary is determined, and the port coordinates or the offset of the port relative to the node coordinates are specifically determined. Furthermore, the position of the ports will be taken into account in the edge connection path planning, so that the edge connection lines can be accurately led from the port of one node to the port of another node. By accurately configuring the position and direction of the ports, a clear and organized connection relationship can be established to ensure that the edge connection lines do not cross or overlap too much, making the generated topology diagram more orderly, intuitive and easy to understand, which is conducive to optimizing the layout.
[0072] Exemplarily, a hierarchical layout means that some nodes may contain other nodes as their child nodes, thereby forming a nested structure of points. The embodiment of the present application uses a layout algorithm to identify and process the above-mentioned hierarchical relationship. A tree layout, radial layout, nested pie chart layout, etc. can be used to reasonably arrange the spatial distribution and arrangement order between nodes at each level, reflecting the parent-child relationship between nodes, so that child nodes are arranged inside or around the parent node to form a hierarchical structure, thereby ensuring that the overall layout can reflect the inherent structure of the data while ensuring visual clarity and readability.
[0073] For example, ELK can also provide a rich set of layout algorithms, allowing you to select appropriate layout strategies based on different types of graphics and different visualization requirements. The open source nature of ELK allows developers to freely modify and extend the algorithms to meet the needs of specific projects or applications. Furthermore, KLK is a layout kernel implemented in Java that can be easily integrated into various Java-based desktop or web applications. It is compatible with multiple operating system environments and can efficiently determine the layout information of call relationships even for cross-platform call relationships.
[0074] The layout algorithm used in the embodiments of the present application is based on the hierarchical principles of arranging as many edges as possible in one direction, assigning adjacent nodes to the same layer or adjacent layers by assigning nodes to different logical layers to minimize edge crossings; it also sorts the nodes within each layer to minimize edge crossings; in addition, for edges that span different logical layers, the number of crossings between these edges can be minimized by adjusting the position of the nodes within the layer or introducing curved paths. The hierarchical layout composite graph provided in the embodiments of the present application improves layout performance by minimizing crossing edges, making it suitable for processing large-scale complex call scenarios.
[0075] Continue to refer Figure 2 In S230, rendering processing is performed according to the layout information in a layered manner to obtain a topology graph corresponding to the call relationship information.
[0076] In an exemplary embodiment, parsing the call relationship information in S210 can not only determine the aforementioned vertex list and edge list, but also obtain graph information. Exemplarily, the graph information includes the aforementioned vertex list and variable list, i.e., the original vertex and edge information before layout processing. Furthermore, the graph information can include overall graph attribute information, such as whether it is a directed graph. The graph information can also include graph size information and graph layout information, such as the graph layout algorithm.
[0077] In an exemplary embodiment, after the layout calculation of the target layout algorithm, the original information of the points and edges may be updated. In addition, the coordinate information of the ports of the nodes may be added. Therefore, in the embodiment of the present application, the above-mentioned graph information and the above-mentioned layout information are fused to update the original information of the above-mentioned points and edges through the layout information, and the above-mentioned layout information is re-assigned to the graph information. Performing rendering processing on the fused graph information is conducive to ensuring the accuracy of the generated topology map and improving rendering efficiency.
[0078] The embodiment of the present application adopts a layered approach to perform rendering processing based on the graph information including the above layout information. For example, the embodiment of the present application adopts Konva as the rendering engine.
[0079] Specifically, S230-1 initializes the stage and layer. For example, a new graph instance, Konva.Stage, is created. This Konva.Stage can serve as a container for all graphic elements (including the aforementioned point list and variable list). The stage's dimensions, including width and height, can be determined by the size information contained in the graph information.
[0080] Furthermore, multiple layer instances Konva.Layer are created. In the embodiment of the present application, each layer instance Layer can be used to organize and render an independent context of a graphic element. Figure 4 , from top to bottom it can be divided into effect layer, edge rendering layer, point rendering layer and background layer.
[0081] Among them, each layer is an independent object that can contain multiple shapes, pictures, groups or other graphic elements. Therefore, it is convenient to perform separate operations, transformations, animations and effects on the elements in each layer without affecting the content of other layers. In the embodiment of the present application, the background is placed on one layer, the node information is set on one layer, the edge information is set on one layer, and the animation elements are set on an effect layer. The layering is conducive to maintaining code and working together. At the same time, because each layer can be calculated and rendered independently, if there are a large number of graphic elements but there is no overlap between them, assigning them to different layers can reduce unnecessary redrawing operations, especially when the content of some layers remains static, the entire scene can be avoided from being re-rendered. For complex user interfaces or animations, layering can organize the scene structure well, and layered rendering helps improve performance and is conducive to the generation of topological maps suitable for complex call scenarios.
[0082] S230-2. Add the created graphic elements to the corresponding layer instance. Specifically, the nodes in the node list can be added to the point rendering layer, and the edges in the edge list can be added to the edge rendering layer.
[0083] In an exemplary embodiment, the nodes in the point list may be divided into M groups according to actual needs. For example, the nodes in a group may move synchronously, etc. By further grouping the nodes and adding the jth node to the jth group of the point rendering layer, rendering flexibility may be further improved.
[0084] Exemplarily, after the j-th node is added to the j-th group of the point rendering layer, the topological relationship edges related to the j-th group of nodes are added to the j-th group of the edge rendering layer.
[0085] S230-3. Add layers to the created stage. Add layers containing graphic elements, such as the point rendering layer and edge rendering layer, to the stage, making them visible.
[0086] S230-4. Update and Render. All changes, such as moving, scaling, rotating, adding, and deleting graphic elements, trigger automatic updates to the corresponding layer. For example, you can call the layer.draw() or stage.draw() method to implement rendering, which updates the state of all current graphic elements on the layer to the corresponding canvas on the stage.
[0087] Exemplarily, S230-41, performing rendering processing on a point rendering layer according to the node coordinates in the above layout information to obtain a node-associated area in the topology graph.
[0088] refer to Figure 5 The node-related area includes at least one or more of the following information: an icon area, a label area, an extended information area, an in-degree information area, an out-degree information area, an operation area, and a wrapper layer. It is understood that the node-related area can be further expanded based on actual needs, and this embodiment of the application does not limit this.
[0089] Wherein, the target node is any node, and the node association area is introduced below by taking the target node as an example. The icon area in the node association area of the target node is used to display the icon associated with the target node, which can be used to display the icon or small image associated with the point, representing a certain type, state or identification; the label area in the node association area of the target node is used to describe the attribute information of the target node, such as timeout, call volume and other configuration information; the in-degree information area in the node association area of the target node is used to represent the information of the edge pointing to the target node, such as the number of in-degree edges, etc.; the out-degree information area in the node association area of the target node is used to represent the information of the edge starting from the target node, such as the number and attributes of the out-degree edges, etc.; the operation area in the node association area of the target node is The functional area for the user to interact with the target node, such as buttons, links or other clickable / touch-triggered action elements, is used for operations such as editing, deleting, viewing details, and connecting to other nodes; the expansion area in the node-associated area of the target node is used to display more detailed information when needed, which may be foldable / expandable, containing richer content or additional data attributes; the wrapping layer in the node-associated area of the target node is a visual container or layout element (such as a graphic element) surrounding the associated area of the target node to ensure the unity and operability of the entire node-associated area of the target node, and may also be responsible for processing interactive behaviors such as mouse hover and click events.
[0090] Exemplarily, S230-42: performing rendering processing in an edge rendering layer according to the topological relationship between the node coordinates reflected by the edge to obtain an edge-associated area in the topological graph.
[0091] refer to Figure 6The edge association area includes at least one or more of the following information: connection edge, label area, and wrapping layer. It is understandable that the edge association area can be further expanded according to actual needs, and this embodiment of the application does not limit this.
[0092] Among them, the connecting edge in the area associated with the target edge is used to connect the starting node and the ending node of the target edge, for example, it can be a straight line, a curve, a broken line, etc.; the label area in the area associated with the target edge is used to describe the attribute information of the target edge, such as presentation timeout, call volume and other configuration information, such as displaying text or other information areas on the path of the edge or in the vicinity, used to describe the specific content such as the attributes, weight, relationship type, etc. of this edge; the wrapping layer in the area associated with the target edge is a visual container or layout element surrounding the area associated with the target edge to ensure the unity and operability of the entire area associated with the target edge, and may also be responsible for processing interactive behaviors such as mouse hover and click events.
[0093] In an exemplary embodiment, when the nodes in the point list are divided into M groups, the node coordinates of the nodes in the jth group can be used to render the nodes in the jth group in the point rendering layer. Furthermore, the connection relationships associated with the nodes in the jth group are rendered in the jth group in the edge rendering layer. In this embodiment of the present application, grouping rendering within a layer also helps improve rendering flexibility and thus enhance rendering performance.
[0094] S230-5. Animation and Interaction: For example, animation effects can be created through Tween or Transition, and event listeners can be added through on('eventType') to handle user interactions.
[0095] For example, when highlighting a node or edge is needed, a copy layer can be created based on the original wrapper layer's contents. This copy layer retains all the visual attributes of the original element, such as shape, color, and transparency, but with the added highlighting style applied. The highlighting effect is rendered through the effect layer, such as changing the fill color or stroke width, adding a shadow, or an animation effect. This makes the highlighted node or edge more noticeable during user interactions, such as hovering over the mouse or clicking to select it.
[0096] In the embodiment of the present application, by Figure 4 The layered rendering strategy shown in FIG can flexibly control the visual performance of elements in different states while maintaining good performance and a clear hierarchical structure. Figure 4Each layer shown can have its own event handler added, making it easier to control user interaction behavior, such as responding to mouse events only on a specific layer while leaving other layers unaffected. In summary, the layered rendering mechanism in the embodiments of the present application can improve development efficiency, simplify graphics management, and provide guarantees for high-performance and flexible visual performance.
[0097] Figure 7 This is a flow chart of a method P700 for generating a topology map according to an embodiment of the present application. Figure 7 , method P700 provides a solution including the following steps.
[0098] S710: Predetermine and store layout information of a first display interface and layout information corresponding to a second display interface of a topology map.
[0099] In an embodiment of the present application, in order to avoid or reduce the jitter that may occur in the generated topology map when performing operations such as drill-down and hiding, the layout information corresponding to each display interface of the topology map can be pre-determined and stored to ensure interactive continuity through means of visual core stabilization.
[0100] S720: In response to receiving a drill-down operation or a hide operation on a target identifier in the first display interface, obtaining layout information rendering corresponding to the second display interface. Exemplarily, if the operation is a drill-down operation, the target identifier is an identifier for expanding information; if the operation is a hide operation, the target identifier is an identifier for hiding information.
[0101] S730: Render according to the layout information corresponding to the second display interface to display the second display interface of the topology map.
[0102] Exemplarily, in the case where the first display interface includes hidden information that is not displayed, in response to a user performing a drill-down operation on the first display interface, pre-calculated layout information of the second display interface is obtained, so that the second display interface displaying the hidden information can be quickly rendered based on the layout information, thereby ensuring interactive consistency and facilitating an improved user viewing experience. In the case where hidden information is displayed in the first display interface, in response to a user performing a hide operation on the first display interface, pre-calculated layout information of the second display interface is obtained, so that the second display interface displaying the hidden information can be quickly rendered and displayed based on the layout information, thereby ensuring interactive consistency and facilitating an improved user viewing experience.
[0103] Exemplarily, different interactive positions of the drill-down operation or the hide operation have a mapping relationship with different layout information of the first display interface and the second display interface. For example, the drill-down operation or the hide operation at the A node has a mapping relationship with the layout information a1 (first display interface) and the layout information a2 (second display interface). If the drill-down operation is performed on the A node, the layout information a1 can be obtained according to the mapping relationship, and then the first display interface is rendered. If the drill-down operation is performed on the A node, the layout information a1 can be obtained according to the mapping relationship, and then the first display interface is rendered, or if the hide operation is performed on the A node, the layout information a2 can be obtained according to the mapping relationship, and then the second display interface is rendered. For another example, the drill-down operation or the hide operation at the B node has a mapping relationship with the layout information b1 (first display interface) and the layout information b2 (second display interface). If the drill-down operation is performed on the B node, the layout information b1 can be obtained according to the mapping relationship, and then the first display interface is rendered, or if the hide operation is performed on the B node, the layout information b2 can be obtained according to the mapping relationship, and then the second display interface is rendered.
[0104] In the topology map generation method provided in the embodiments of the present application, the call relationship information to be displayed is parsed, converting the originally abstract call relationship into structured nodes and edges that are easily graphically displayed, thereby identifying the nodes contained therein and the edges reflecting the topological relationships between the nodes. For example, in the case of online payment, the parsed nodes can reflect online payment-related services, and the parsed edges can reflect the calls between these services. The nodes are then assigned to multiple logical layers based on the topological relationships reflected by the edges. The nodes within each logical layer are sorted to obtain layout information for the call relationship information. This layered layout approach helps reduce the number of intersecting edges and optimizes the layout, making it suitable for the layout of nodes and edges in complex call relationships. Furthermore, a layered rendering process is performed based on the layout information to obtain a topology map corresponding to the call relationship information. This layered rendering approach improves rendering flexibility and the scalability of the topology map. Layered rendering effectively organizes the scene structure, improving performance and facilitating topology map generation for complex call scenarios. It also facilitates the location of individual nodes or edges within the scene.
[0105] The above generally introduces the method for generating a topology map provided by the embodiment of the present application. The following further introduces the method for generating a building information model provided by the embodiment of the present application through specific examples.
[0106] Figure 8 This is a flow chart of a method for generating a topology map provided in one embodiment of the present application, which includes two parts: business information conversion and topology map generation.
[0107] The business information conversion is used to process data conversion related to a business (e.g., online payment business). The original call relationship information includes interface call information and module call information. Exemplarily, the call relationship information is parsed to obtain nodes and edges.
[0108] The topology map generation process includes the following information: information and instances for processing graph elements, namely, graph primitive information (graph instances); a graph event delegation layer for handling graph-related event delegation; graph API capabilities for providing graph-related API functions; a layout engine for generating layout information; and a rendering engine for rendering based on the layout information.
[0109] Based on the preceding template, perform the following steps to generate a topology diagram that reflects the call relationship.
[0110] Step S1: Collect business information: First, collect the required raw information from the business layer, including business information conversion, interface call relationships, and module call relationships. The raw call relationship data can be call links or function call sequences obtained from sources such as log files, interface responses, and code analysis tool output.
[0111] Step S2, processing business information: converting and processing the collected business information for subsequent graphical display. In the embodiment of the present application, the collected business information is parsed, specifically parsing each independent module, class, method or function in the above-mentioned call link or function call sequence to obtain a node, and parsing to obtain an edge reflecting the topological relationship between nodes. Exemplarily, before the parsing process, the call relationship data can be cleaned, format converted, and other operations to improve the parsing efficiency.
[0112] Step S3: Generate graph primitive information: Generate a graph instance containing graph primitive information based on the processed business information. Graph primitive information is the basic unit of a topological graph and may include nodes, edges, and other graph elements, such as ports on node boundaries.
[0113] Step S4, processing the primitive information through the layout engine: Use the layout engine (such as ELK or other layout tools) to layout the above primitive information. As described in the embodiment corresponding to S220, in order to reduce the number of cross edges, a hierarchical method is used to first divide the nodes in the point list into different logical layers according to the topological relationship, for example, to N logical layers. Specifically, based on a preset hierarchical principle, the nodes are allocated to N logical layers. An exemplary hierarchical principle can be: arranging as many edges as possible in one direction. For example, if a node A is assigned to the i-th logical layer, the edge related to node A is not in the same direction (such as the horizontal direction) as the edge of the assigned node, and node A can be assigned to the i+1-th logical layer. An exemplary hierarchical principle can also be: adjacent nodes are assigned to the same layer or adjacent layers to reduce the number of cross edges. Then, the nodes are sorted within and between layers. Within each logical layer, the horizontal order of the nodes is further determined to minimize the crossing of lines within the layer. After all nodes are layered and sorted within each logical layer, the coordinates of each node can be determined based on the distance between nodes, the spacing between logical layers, and the spatial occupancy of the overall layout. In an exemplary embodiment, for edges that span different logical layers, the number of intersections between these edges can be minimized by adjusting the position of the nodes within the layers or introducing curved paths.
[0114] In the embodiment of the present application, the above-mentioned layout engine accurately determines the coordinates of the nodes and the directed lines between the coordinates that reflect the topological relationship, thereby facilitating the generation of a clear and easy-to-read topological map.
[0115] Step S5, reassigning the above layout information to the primitive information (also called graph information): After the layout calculation of the above target layout algorithm, the original information of the points and edges may be updated. In addition, the coordinate information of the ports of the nodes may also be added. Therefore, in the embodiment of the present application, the original information of the above points and edges is updated through the layout information, and the above layout information is reassigned to the graph information. Performing rendering processing by fusion processing of the graph information is conducive to ensuring the accuracy of the generated topological map and improving rendering efficiency.
[0116] Step S6, rendering processing is performed by the rendering engine: Konva is used to realize layered rendering: As described in the embodiment corresponding to S230, S230-1, initializing the stage and multiple layers (such as Figure 4As shown), each layer is an independent object that can contain multiple shapes, pictures, groups or other graphic elements. This makes it easy to perform separate operations, transformations, animations and effects on the elements in each layer without affecting the content of other layers. S230-2. Add the created graphic elements to the corresponding layer instance. Specifically, the nodes in the above node list can be added to the point rendering layer, and the edges in the edge list can be added to the edge rendering layer. S230-3. Add the layer to the created stage. S230-41. Perform rendering processing on the point rendering layer according to the node coordinates in the above layout information to obtain the node association area in the topology diagram (as shown in the figure). Figure 5 S230-42, according to the topological relationship between the node coordinates reflected by the edge, rendering processing is performed in the edge rendering layer to obtain the edge associated area in the topological graph (as shown); Figure 6 S230-5, Animation and Interaction: When highlighting a node or edge, create a duplicate layer based on the original wrapper layer's contents. This duplicate layer retains all the visual attributes of the original element, such as shape, color, and transparency, but also applies a highlighting style. Highlighting effects can be rendered using the effect layer, such as changing the fill color or stroke width, adding shadows, or animation effects. This makes the highlighted node or edge more noticeable during user interactions, such as when hovering over the mouse or clicking to select it.
[0117] This application is approved by Figure 4 The layered rendering strategy shown in FIG can flexibly control the visual performance of elements in different states while maintaining good performance and a clear hierarchical structure. Figure 4 Each layer shown can have its own event handler added, making it easier to control user interaction behavior, such as responding to mouse events only on a specific layer while leaving other layers unaffected. In summary, the layered rendering mechanism in the embodiments of the present application can improve development efficiency, simplify graphics management, and provide guarantees for high-performance and flexible visual performance.
[0118] Step S7, Event Delegation: This means that in the hierarchical structure of graphics rendering components, in order to optimize rendering performance, instead of directly binding an event handler for each graphic element, the event handler is bound to an object at a higher level (such as a layer or stage). For example, there are a large number of graphic elements in the scene drop of the call relationship load. If an event is bound to each graphic element separately, it may consume more memory resources. However, through event delegation, it is only necessary to bind the event handler once when binding it to a higher level, thereby reducing memory usage and improving program performance. In addition, when graphic elements are frequently added, deleted, and modified, there is no need to rebind or unbind the event handler for each change. As long as these elements exist under the same parent container to which events can be delegated, it can be ensured that their events can still be handled correctly, thereby achieving dynamic content management.
[0119] Step S8, Graph API capability: Through the graph API capability, various operation interfaces for graphs can be provided (such as Figure 8 These interfaces can be used to add, delete, modify graphic elements, or change the layout of the graphic.
[0120] Finally, the rendered graphics are output to obtain a topology map. Users can understand the structure and operation status of the system by viewing the topology map.
[0121] The topology map generation solution provided by the embodiment of the present application can draw a topology map with a hierarchy that reflects the complex microservice call architecture. Based on the generated topology map, configuration information such as timeout and call volume can be presented on nodes or edges, making it easier for users to view the business execution process; at the same time, the generated topology map has the ability to quickly locate and visualize abnormal call links, making it easier for users to locate faults and improve fault resolution efficiency; in addition, the topology map generated by the embodiment of the present application can be edited in situ, making it easier for users to dynamically adjust call relationships and dynamically expand performance; in addition, by Figure 7 In the embodiment shown, the topology map in the embodiment of the present application can realize free map exploration, with the ability of drill-down, hidden thumbnails, etc., and can ensure interactive continuity.
[0122] Combined with the above Figures 1 to 8 , describes in detail the embodiment of the method for generating the topology map of the present application, and the following is combined with Figure 9 , describe in detail an embodiment of the topology map generation device of the present application.
[0123] Figure 9 Schematic diagram of the structure of the topology map generating device 900 provided in the embodiment of the present application. Figure 9The topology map generating device 900 includes: a parsing module 910, a layout module 920 and a rendering module 930; wherein the parsing module 910 is used to parse the call relationship information to obtain the nodes contained in the call relationship information and the edges reflecting the topological relationship between the nodes; the layout module 920 is used to allocate the nodes to N logical layers according to the topological relationship reflected by the edges, sort the nodes in the i-th logical layer, and obtain the layout information of the call relationship information, where N is a positive integer and i is a positive integer not greater than N; and the rendering module 930 is used to perform rendering processing according to the layout information in a layered manner to obtain a topology map corresponding to the call relationship information.
[0124] In an exemplary embodiment, based on the aforementioned scheme, the above-mentioned layout module 920 is specifically used to: allocate the nodes to N logical layers based on a preset layering principle; wherein the layering principle includes one or more of the following information: arranging as many edges as possible in one direction, and adjacent nodes are allocated to the same layer or adjacent layers.
[0125] In an exemplary embodiment, based on the above solution, the rendering module 930 includes a first rendering unit and a second rendering unit;
[0126] The first rendering unit is configured to perform rendering processing on a point rendering layer according to the node coordinates in the layout information to obtain a node-associated area in the topological graph; and the second rendering unit is configured to perform rendering processing on an edge rendering layer according to the topological relationship between the node coordinates reflected by the edges to obtain an edge-associated area in the topological graph.
[0127] In an exemplary embodiment, based on the above solution, the node association area includes at least one or more of the following information: an icon area, a label area, an extended information area, an in-degree information area, an out-degree information area, an operation area, and a wrapping layer;
[0128] Among them, the icon area in the node association area of the target node is used to display the icon associated with the target node; the label area in the node association area of the target node is used to describe the attribute information of the target node; the in-degree information area in the node association area of the target node is used to represent the information of the edge pointing to the target node; the out-degree information area in the node association area of the target node is used to represent the information of the edge starting from the target node; the operation area in the node association area of the target node is a functional area for the user to interact with the target node; the wrapping layer in the node association area of the target node is a visual container or layout element surrounding the association area of the target node.
[0129] In an exemplary embodiment, based on the aforementioned solution, the edge-associated area includes at least one or more of the following information: a connecting edge, a label area, and a wrapping layer;
[0130] Among them, the connecting edge in the area associated with the target edge is used to connect the starting node and the ending node of the target edge; the label area in the area associated with the target edge is used to describe the attribute information of the target edge; and the wrapping layer in the area associated with the target edge is a visual container or layout element surrounding the area associated with the target edge.
[0131] In an exemplary embodiment, based on the above solution, the rendering module 930 further includes: a third rendering unit;
[0132] The third rendering unit is configured to: determine highlight processing information based on at least one of the wrapping layer in the node-associated area and the wrapping layer in the edge-associated area; and render the highlight processing information in the effect layer to determine the topology map.
[0133] In an exemplary embodiment, based on the aforementioned solution, the first rendering unit is specifically configured to divide the nodes into M groups, and perform rendering processing on the jth group in a point rendering layer based on the node coordinates of the jth group of nodes, where M is a positive integer and j is a positive integer less than or equal to M. The second rendering unit is specifically configured to perform rendering processing on the jth group of nodes in an edge rendering layer for connection relationships associated with the jth group of nodes.
[0134] In an exemplary embodiment, based on the aforementioned scheme, the parsing module 910 is specifically used to: parse the call relationship information to obtain the nodes contained in the call relationship information and the edges reflecting the topological relationship between the nodes and the graph information; wherein the graph information includes at least one of the following information: graph attribute information, graph size information and graph layout information.
[0135] In an exemplary embodiment, based on the above solution, the device for generating the topology map further includes a fusion module;
[0136] Among them, the above-mentioned fusion module is used for: the layout module 920 distributes the nodes to N logical layers according to the topological relationship reflected by the edges, sorts the nodes in the i-th logical layer, and obtains the layout information of the call relationship information, where N is a positive integer and i is a positive integer not greater than N, and fuses the graph information, the node coordinates in the layout dotted line, and the topological relationship between the node coordinates; wherein the information after the fusion processing is used to determine the layout information of the call relationship information.
[0137] In an exemplary embodiment, based on the aforementioned solution, the topology map generating device further includes: a pre-storage module and an acquisition module;
[0138] Among them, the above-mentioned pre-storage module is used to: pre-determine and store the layout information of the first display interface of the topology map and the layout information corresponding to the second display interface; the above-mentioned acquisition module is used to: respond to receiving a drill-down operation or a hide operation on the target identifier in the first display interface, and obtain the layout information rendering corresponding to the second display interface; and the above-mentioned rendering module 930 is also used to: render according to the layout information corresponding to the second display interface to display the second display interface of the topology map.
[0139] In the topology map generation scheme provided in the embodiments of the present application, the call relationship information to be displayed is parsed, converting the originally abstract call relationship into structured nodes and edges that are easily graphically displayed, thereby identifying the nodes contained therein and the edges that reflect the topological relationships between the nodes. For example, in the case of online payment, the parsed nodes can reflect online payment-related services, and the parsed edges can reflect the calls between these services. Then, based on the topological relationships reflected by the edges, the nodes are assigned to multiple logical layers, and the nodes within each logical layer are sorted to obtain layout information for the call relationship information. This layered layout approach helps reduce the number of intersecting edges and optimizes the layout, making it suitable for the layout of nodes and edges in complex call relationships. Furthermore, a layered rendering process is performed based on the layout information to obtain a topology map corresponding to the call relationship information. This layered rendering approach improves rendering flexibility and the scalability of the topology map. Layered rendering effectively organizes the scene structure, improving performance and facilitating topology map generation for complex call scenarios. It also facilitates the location of individual nodes or edges within the scene.
[0140] It should be understood that the embodiment of the topology map generation device and the embodiment of the topology map generation method can correspond to each other, and similar descriptions can refer to the method embodiment. To avoid repetition, they will not be described here. Specifically, Figure 9 The topology map generation device shown can execute the embodiment of the above-mentioned topology map generation method, and the aforementioned and other operations and / or functions of each module in the device are respectively for implementing the embodiment of the topology map generation method, which will not be repeated here for the sake of brevity.
[0141] The above text describes the apparatus for generating an embodiment of the building information model of the present application from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in the form of hardware, or can be implemented by instructions in the form of software, or can be implemented by a combination of hardware and software modules. Specifically, the various steps of the method embodiments in the embodiments of the present application can be completed by hardware integrated logic circuits and / or software instructions in the processor, and the steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiments in conjunction with its hardware.
[0142] Figure 10 is a schematic block diagram of an electronic device 1000 provided in an embodiment of the present application. Figure 10 The electronic device 1000 can be used to execute the above-mentioned method for generating a topology map, and the electronic device 1000 can be the server 104.
[0143] like Figure 10 As shown, the electronic device 1000 may include:
[0144] The memory 1010 and the processor 1020 are configured to store a computer program 1030 and transmit the program code 1030 to the processor 1020. In other words, the processor 1020 can call and execute the computer program 1030 from the memory 1010 to implement the method in the embodiment of the present application.
[0145] For example, the processor 1020 may be configured to execute the steps in the above method according to the instructions in the computer program 1030 .
[0146] In some embodiments of the present application, the processor 1020 may include but is not limited to:
[0147] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
[0148] In some embodiments of the present application, the memory 1010 includes but is not limited to:
[0149] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0150] In some embodiments of the present application, the computer program 1030 may be divided into one or more modules, which are stored in the memory 1010 and executed by the processor 1020 to implement the method for generating a topology map provided in the present application. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 1030 in the electronic device.
[0151] like Figure 10 As shown, the electronic device 1000 may further include:
[0152] The transceiver 1040 may be connected to the processor 1020 or the memory 1010 .
[0153] The processor 1020 may control the transceiver 1040 to communicate with other devices. Specifically, the processor 1020 may send information or data to other devices or receive information or data sent by other devices. The transceiver 1040 may include a transmitter and a receiver. The transceiver 1040 may further include one or more antennas.
[0154] It should be understood that the various components in the electronic device 1030 are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0155] According to one aspect of the present application, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a computer, the computer is enabled to perform the method of the above-mentioned method embodiment. Alternatively, the present application also provides a computer program product containing instructions. When the computer is executed by the instructions, the computer is enabled to perform the method of the above-mentioned method embodiment.
[0156] According to another aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method of the above-described method embodiment.
[0157] In other words, when implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0158] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0159] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0160] Modules described as separate components may or may not be physically separate, and components displayed as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected based on actual needs to achieve the purpose of the present embodiment. For example, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module.
[0161] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for generating a topological map, characterized in that: The method comprises: Parsing the call relationship information to obtain the nodes contained in the call relationship information and the edges reflecting the topological relationship between the nodes; Allocating the nodes to N logical layers according to the topological relationships reflected by the edges, sorting the nodes in the i-th logical layer, and obtaining layout information of the call relationship information, where N is a positive integer and i is a positive integer not greater than N; By performing rendering processing according to the layout information in a layered manner, a topology graph corresponding to the call relationship information is obtained.
2. The method according to claim 1, characterized in that Allocating the nodes to N logical layers according to the topological relationships reflected by the edges includes: Based on a preset layering principle, the nodes are allocated to N logical layers; wherein the layering principle includes one or more of the following information: arranging as many edges as possible in one direction, and adjacent nodes are allocated to the same layer or adjacent layers.
3. The method according to claim 1 or 2, characterized in that The rendering process is performed according to the layout information in a layered manner to obtain a topology graph corresponding to the call relationship information, including: Performing rendering processing on a point rendering layer according to the node coordinates in the layout information to obtain a node-associated area in the topology graph; According to the topological relationship between the node coordinates reflected by the edges, rendering processing is performed in the edge rendering layer to obtain the edge-associated area in the topological graph.
4. The method according to claim 3, characterized in that The node association area includes at least one or more of the following information: an icon area, a label area, an extended information area, an in-degree information area, an out-degree information area, an operation area, and a wrapping layer; Wherein, the icon area in the node association area of the target node is used to display an icon associated with the target node; The label area in the node association area of the target node is used to describe the attribute information of the target node; The in-degree information area in the node association area of the target node is used to represent the information of the edge pointing to the target node; The out-degree information area in the node association area of the target node is used to represent the information of the edge starting from the target node; The operation area in the node association area of the target node is a functional area for the user to interact with the target node; The wrapping layer in the node-associated area of the target node is a visual container or layout element surrounding the associated area of the target node.
5. The method according to claim 3, characterized in that The edge association area includes at least one or more of the following information: a connecting edge, a label area, and a wrapping layer; The connecting edge in the region associated with the target edge is used to connect the starting node and the ending node of the target edge; The label area in the area associated with the target edge is used to describe the attribute information of the target edge; The wrapping layer in the area associated with the target edge is a visual container or layout element surrounding the area associated with the target edge.
6. The method according to claim 3, characterized in that The rendering process is performed according to the layout information in a layered manner to obtain a topology graph corresponding to the call relationship information, including: determining highlight processing information according to at least one of a wrapping layer in the node-associated region and a wrapping layer in the edge-associated region; The highlight processing information is rendered in an effect layer to determine the topology map.
7. The method according to claim 3, characterized in that The rendering process is performed at the point rendering layer according to the node coordinates in the layout information, including: Divide the nodes into M groups, and perform rendering processing on the j group in the point rendering layer according to the node coordinates of the j group of nodes, where M is a positive integer and j is a positive integer less than or equal to M; The rendering process is performed in the edge rendering layer according to the topological relationship between the node coordinates reflected by the edge, including: For the connection relationship related to the j-th group of nodes, rendering processing is performed in the j-th group of edge rendering layers.
8. The method according to claim 1 or 2, characterized in that The parsing of the call relationship information to obtain the nodes contained in the call relationship information and the edges reflecting the topological relationships between the nodes includes: Parsing the call relationship information to obtain nodes, edges reflecting the topological relationship between nodes, and graph information contained in the call relationship information; The graph information includes at least one of the following information: graph attribute information, graph size information, and graph layout information.
9. The method according to claim 8, characterized in that Before allocating the nodes to N logical layers according to the topological relationships reflected by the edges, sorting the nodes in the i-th logical layer, and obtaining layout information of the call relationship information, where N is a positive integer and i is a positive integer not greater than N, the method further includes: fusing the graph information, the node coordinates in the layout dotted lines, and the topological relationship between the node coordinates; The information after the fusion process is used to determine the layout information of the call relationship information.
10. The method according to claim 1 or 2, characterized in that The method further comprises: Predetermining and storing layout information of the first display interface and layout information corresponding to the second display interface of the topology map; In response to receiving a drill-down operation or a hide operation on a target identifier in the first display interface, obtaining layout information corresponding to the second display interface for rendering; Rendering is performed according to the layout information corresponding to the second display interface to display the second display interface of the topology map.
11. A device for generating a topological map, characterized in that: The device comprises: A parsing module, configured to parse the call relationship information to obtain the nodes contained in the call relationship information and the edges reflecting the topological relationships between the nodes; a layout module, configured to allocate the nodes to N logical layers according to the topological relationships reflected by the edges, sort the nodes in the i-th logical layer, and obtain layout information of the call relationship information, where N is a positive integer and i is a positive integer not greater than N; The rendering module is used to perform rendering processing according to the layout information in a hierarchical manner to obtain a topology map corresponding to the call relationship information.
12. An electronic device comprising a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the computer program to implement the method for generating a topology map as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that For storing computer programs; The computer program enables a computer to execute the method for generating a topology map according to any one of claims 1 to 10.