Methods and apparatus for displaying maps, as well as storage media and electronic devices.
By constructing node data structure blocks and generating identical node data arrays using preset mounting rules, the problem of repeated display of related child nodes in the graph is solved, enabling rapid cropping and clear display of the graph and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-18
- Publication Date
- 2026-03-13
AI Technical Summary
In existing technologies, the repeated display of related child nodes of nodes in the graph at different positions leads to redundancy and endless display problems, making it difficult to clearly and concisely display business data.
By constructing node data structure blocks in the graph, a preset traversal algorithm is used to generate an array of identical node data. According to the preset mounting rules, related child nodes are mounted in the array of identical node data pointed to by the position marker data. The graph is then displayed in conjunction with user operations, including mounting changes and fusion operations.
It enables rapid graph cropping, simplifies the structure, makes the graph clearer, improves the user experience, and allows for flexible adjustment of the mounting position of associated child nodes according to user needs.
Smart Images

Figure CN116662614B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of page display technology, specifically to a method and apparatus for displaying graphs, as well as a storage medium and electronic device. Background Technology
[0002] In the field of business queries, tree-structured graphs and radial-structured graphs are often used to display business data. However, business data is often complex and voluminous, making it difficult to present it clearly and concisely in a graph.
[0003] For example, in equity relationship structure diagrams, it is common to encounter situations where the same business data appears in multiple positions at different levels of the diagram. Figure 1 As shown, in this tree structure diagram, Company C's node appears in two different positions, at the second and fourth levels. Its associated child nodes, Company E, Company F, and Company G, also appear twice. This indicates redundancy in the tree structure diagram because these child nodes appear twice. Furthermore, as business data becomes increasingly abundant and complex, this redundancy will occupy more and more space, making the tree structure diagram large and cumbersome, thus preventing it from clearly and concisely displaying the business data to the user.
[0004] Furthermore, as the number of nodes increases and relationships are established, Company B nodes may appear among the associated child nodes of Company F, and Company B nodes may appear among the associated child nodes of Company F, and so on. In this way, the tree structure graph will continue to extend upwards, making it infinitely visible without boundaries.
[0005] Therefore, the existing technology lacks a graph display method, apparatus, storage medium, and electronic device that can solve the problem of redundancy and / or infinite display caused by the repeated display of related child nodes of nodes that appear more than twice in different positions in the graph. Summary of the Invention
[0006] The purpose of this invention is to provide a method and apparatus for displaying graphs, as well as a storage medium and electronic device, to solve the aforementioned problems existing in related technologies.
[0007] According to a first aspect of the present invention, a method for displaying a spectrum is provided, the method comprising:
[0008] Construct the data structure blocks for each node in the graph based on the preset data structure.
[0009] According to the preset traversal algorithm, each node in the graph is traversed to obtain the depth data of each node in the graph. Based on the preset mounting rules, data structure blocks and depth data, a data array of the same node is generated. The data array of the same node includes the depth data of each node in the data array of the same node and the position marker data corresponding to the data array of the same node.
[0010] Based on the data structure blocks of each node in the same node data array and the position marker data corresponding to the same node data array, the associated child nodes that are associated with each node in the same node data array are attached to the nodes in the same node data array pointed to by the position marker data for graph display.
[0011] Optionally, the method further includes:
[0012] In response to a user-triggered mounting change operation of associated child nodes, the current location marker data is updated to the node identifier of the node in the same node data array pointed to by the user-triggered mounting change operation of associated child nodes, and the associated child nodes are mounted to the nodes in the same node data array pointed to by the updated location marker data for graph display.
[0013] Optionally, the method further includes:
[0014] When there are multiple associated child nodes and none of them have any associated child nodes, in response to the user triggering the merging operation of the associated child nodes, the selected multiple associated child nodes are merged into a merged associated child node; wherein, the merged associated child node displays the node data of the selected multiple associated child nodes.
[0015] Optionally, the method further includes:
[0016] When there are multiple associated child nodes, and one or more of these associated child nodes also have associated child nodes, in response to the user triggering a merging operation of the associated child nodes, the selected multiple associated child nodes are merged into a single merged associated child node, and all associated child nodes of the selected multiple associated child nodes are hidden; the merged associated child node displays the node data of the selected multiple associated child nodes.
[0017] Optionally, the data structure blocks of each node in the graph include: node identifier, node data, and data structure blocks of associated child nodes; wherein, the data structure blocks of associated child nodes have the same data structure as the data structure blocks of the nodes.
[0018] Optionally, according to a preset traversal algorithm, each node in the graph is traversed to obtain the depth data of each node in the graph, and an array of identical node data is generated according to preset mounting rules, data structure blocks, and depth data, including:
[0019] Based on the preorder traversal algorithm, traverse each node in the graph, performing the following traversal operation for each node:
[0020] Get the data structure block and depth data of the currently traversed node and the traversed nodes, and compare the node data of the currently traversed node with the node data of the traversed nodes.
[0021] If there is no traversed node with the same node data as the currently traversed node, create an array of identical node data with the node data of the currently traversed node as the query identifier, and store the depth data of the currently traversed node and the node identifier of the currently traversed node as the position marker data corresponding to the identical node data array into the identical node data array.
[0022] If a previously visited node has the same node data as the currently visited node, find the matching node data array corresponding to the query identifier that matches the node data of the currently visited node, and store the depth data of the currently visited node in the matching node data array. Also, compare the depth data of the currently visited node with the depth data of the node pointed to by the position marker data corresponding to the matching node data array. If it meets the preset mounting rules, update the position marker data corresponding to the matching node data array to the node identifier of the currently visited node. If it does not meet the preset mounting rules, the position marker data corresponding to the matching node data array remains unchanged.
[0023] After traversing each node in the graph, an array of identical node data is generated.
[0024] Optionally, the preset mounting rules include: the associated child node is mounted on the node with the smallest depth data among multiple identical nodes in the graph; or, the associated child node is mounted on the node with the largest depth data among multiple identical nodes in the graph; or, the associated child node is mounted on any node selected by the user among multiple identical nodes in the graph.
[0025] According to a second aspect of the present invention, a map display device is provided, the device comprising: a construction module, a set generation module, and a display module; wherein,
[0026] The construction module is used to construct the data structure blocks of each node in the graph according to the preset data structure.
[0027] The set generation module is used to traverse each node in the graph according to a preset traversal algorithm, obtain the depth data of each node in the graph, and generate a data array of identical nodes according to preset mounting rules, data structure blocks and depth data; wherein, the data array of identical nodes includes the depth data of each node in the data array of identical nodes and the position marker data corresponding to the data array of identical nodes.
[0028] The display module is used to attach the associated child nodes that are associated with each node in the same node data array to the nodes in the same node data array pointed to by the position marker data, based on the data structure blocks of each node in the same node data array and the position marker data corresponding to the same node data array, so as to display the graph.
[0029] According to a third aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0030] A memory on which computer programs are stored;
[0031] A processor for executing the computer program in memory to implement the steps of the above method.
[0032] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, characterized in that the program, when executed by a processor, implements the steps of the above-described method.
[0033] The graph display method, apparatus, storage medium, and electronic device provided by this invention solve the problem of redundancy and / or infinite display caused by the repeated display of related child nodes of nodes that appear more than twice in different positions in the graph. The drawing process is simple, and the graph can be quickly cropped by setting preset mounting rules, which simplifies the graph structure and makes the graph structure clearer. In addition, it can flexibly adjust the mounting position of related child nodes according to user needs, realize personalized customization, and improve the user experience.
[0034] Other features and advantages of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0035] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the following detailed description to explain the invention, but do not constitute a limitation thereof. In the drawings:
[0036] Figure 1 This is a schematic diagram of the structure of a tree-like graph in the prior art;
[0037] Figure 2 This is a schematic diagram of a process for the spectrum display method provided by the present invention;
[0038] Figure 3a A schematic diagram of a graph display after associating child nodes is mounted according to the graph display method provided by the present invention;
[0039] Figure 3b This is a schematic diagram illustrating another graph display after associating child nodes with the graph display method provided by the present invention.
[0040] Figure 4 This is another schematic diagram of the spectrum display method provided by the present invention;
[0041] Figure 5 A schematic diagram of a graph display after the fusion of associated sub-nodes according to the graph display method provided by the present invention;
[0042] Figure 6 This is a schematic diagram of a module structure of the spectrum display device provided by the present invention;
[0043] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0044] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0045] It should be noted that in this invention, terms such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order; terms such as "S101," "S102," "S201," and "S202" are used to distinguish steps and should not be construed as performing method steps in a specific order or sequence; when the following description relates to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. Furthermore, the term "multiple" in this invention includes two or more, unless otherwise specified.
[0046] Exemplary methods
[0047] Figure 2 This is a schematic diagram of a spectrum display method provided by the present invention, such as... Figure 2 As shown, this method can be applied to electronic devices, which include:
[0048] Step S101: Construct the data structure blocks for each node in the graph according to the preset data structure;
[0049] In this invention, the atlas is a atlas generated using methods in the prior art, such as a tree structure atlas, a radial structure atlas, etc., generated using methods in the prior art. Those skilled in the art can choose according to actual needs, and no limitation is made here.
[0050] In an optional embodiment of the present invention, step S101 specifically includes: acquiring data of each node in the graph; after acquiring the data of each node in the graph, constructing the data structure of each node in the graph according to a preset data structure.
[0051] Regarding the methods for acquiring data for each node in the graph, those skilled in the art can flexibly choose existing methods according to actual needs, and no limitations are imposed here. Figure 1 Taking the tree structure graph shown as an example, after generating the tree structure graph using existing methods, the data of each node in the graph can be obtained by acquiring the code corresponding to the tree structure graph.
[0052] In this invention, those skilled in the art can flexibly set preset data structures to construct data structure blocks for each node in the graph according to actual needs, without limitation. Preferably, the data structure block for each node in the graph includes: node identifier, node data, and data structure blocks for associated child nodes; wherein, the data structure blocks for associated child nodes have the same data structure as the data structure blocks for the nodes. The specific data structure blocks for the nodes in the graph are as follows:
[0053] node{ / / Node label name
[0054] id, / / Node identifier
[0055] data, / / Node data
[0056] children / / Data structure block related to child nodes
[0057] }
[0058] It should be noted that the node identifier (id) is used to identify the node, and the location of the node can be uniquely determined by identifying the node identifier; the node data (data) is the data displayed in the node, also known as business data. The type of business data is different depending on the type of content displayed in the graph. For example, if the graph is an equity relationship structure graph, then the business data is the company name; the data structure block (children) of the associated child nodes is used to identify the associated child nodes attached to the node. By identifying the data structure block of the associated child nodes, the associated child nodes attached to the node can be quickly and accurately located.
[0059] Step S102: According to the preset traversal algorithm, traverse each node in the graph, obtain the depth data of each node in the graph, and generate a data array of the same node according to the preset mounting rules, data structure blocks and depth data; wherein, the data array of the same node includes the depth data of each node in the data array of the same node and the position mark data corresponding to the data array of the same node.
[0060] The preset traversal algorithm can be any existing traversal algorithm, and those skilled in the art can choose flexibly according to actual needs; no limitation is made here. Preferably, the preset traversal algorithm is a preorder traversal algorithm.
[0061] In an optional embodiment of the present invention, step S102 specifically includes:
[0062] Based on the preorder traversal algorithm, traverse each node in the graph, performing the following traversal operation for each node:
[0063] Get the data structure block and depth data of the currently traversed node and the traversed nodes, and compare the node data of the currently traversed node with the node data of the traversed nodes.
[0064] If there is no traversed node with the same node data as the currently traversed node, create an array of identical node data with the node data of the currently traversed node as the query identifier, and store the depth data of the currently traversed node and the node identifier of the currently traversed node as the position marker data corresponding to the identical node data array into the identical node data array.
[0065] If a previously visited node has the same node data as the currently visited node, find the matching node data array corresponding to the query identifier that matches the node data of the currently visited node, and store the depth data of the currently visited node in the matching node data array. Also, compare the depth data of the currently visited node with the depth data of the node pointed to by the position marker data corresponding to the matching node data array. If it meets the preset mounting rules, update the position marker data corresponding to the matching node data array to the node identifier of the currently visited node. If it does not meet the preset mounting rules, the position marker data corresponding to the matching node data array remains unchanged.
[0066] After traversing each node in the graph, an array of identical node data is generated.
[0067] In this invention, the preset mounting rules include: the associated child node is mounted on the node with the smallest depth data among multiple identical nodes in the graph; or, the associated child node is mounted on the node with the largest depth data among multiple identical nodes in the graph; or, the associated child node is mounted on any node selected by the user among multiple identical nodes in the graph.
[0068] by Figure 1 Taking the tree structure graph shown as an example, after step S101, the nodes in the graph are traversed according to the preorder traversal algorithm. The specific process is as follows:
[0069] The first step is to traverse the A company node (the currently traversed node) in the tree structure graph, obtain the data structure block and depth data of the A company node, as well as the data structure block and depth data of the traversed nodes, and compare the node data of the A company node with the node data of the traversed nodes. It should be noted that since the A company node is the root node, there are no previously traversed nodes. Therefore, it is determined that there is no previously traversed node with the same node data data_A as the A company node, that is, the A company node is appearing for the first time. Create a same node data array depthAry_A with the A company node node data data_A as the query identifier, and store the A company node depth data depth_A and the A company node node identifier id_A as the position marker data TAG_A corresponding to the same node data array depthAry_A into the same node data array depthAry_A. That is, depthAry_A is represented as data_A: {depth_A, TAG_A}.
[0070] The second step involves traversing the tree structure after completing the traversal of Company A's nodes. This involves traversing the left-to-right order, specifically Company B's nodes (the currently traversed nodes) on the left branch of the tree structure graph. The data structure block and depth data (depth_B) of Company B's nodes, along with the data structure block and depth data (depth_A) of Company A's nodes, are then compared. Since they are different nodes, there is no node among the traversed nodes that matches Company B's node. For nodes that have been traversed with the same data data_B, i.e., the B company node is appearing for the first time, create a data array depthAry_B with the node data data_B of the B company node as the query identifier. Store the depth data depth_B of the B company node and the node identifier id_B of the B company node as the position marker data TAG_B corresponding to the data array depthAry_B in the data array depthAry_B. That is, depthAry_B is represented as data_B: {depth_B, TAG_B}.
[0071] The third step involves continuing to traverse the tree structure graph, specifically node 10 of Company C (the currently traversed node). This process retrieves the data structure block and depth data (depth_C1) of node 10, as well as the data structure blocks and depth data (depth_A and depth_B) of nodes A and B (both nodes already traversed in steps one and two). The node data (data_C) of node 10 is then compared with the node data (data_A) of node A and the node data (data_B) of node B. Since node 10 of company C is different from nodes A and B, the previously traversed nodes do not... If there is a traversed node with the same node data_C as node 10 of Company C, that is, node 10 of Company C is appearing for the first time, create a node data array depthAry_C with node data_C of Company C as the query identifier, and store the depth data depth_C1 of node 10 of Company C and the node identifier id_C1 of node 10 of Company C as the position marker data TAG_C1 corresponding to the node data array depthAry_C in the node data array depthAry_C. That is, depthAry_C is represented as data_C: {depth_C1, TAG_C1}.
[0072] Fourth, traverse the other company nodes sequentially using the method in step S102. When traversing to company C node 11 (the currently traversed node), obtain the data structure block and depth data depth_C2 of company C node 11. Compare the node data data_C of company C node 11 with the node data of company A node, company B node, company C node 10, company D node, company E node, company F node, company G node, and company H node (8 traversed nodes). Since the node data data_C of company C node 10 is the same as the node data data_C of company C node 11 among the 8 traversed nodes, there is a traversed node with the same node data data_C as company C node 11. It is determined that company C node 11 is not the first occurrence. Find the same node data array depthAry_C corresponding to the query identifier with the same node data_C as company C node 11, and set company C... The depth data depth_C2 of node 11 is stored in the same node data array depthAry_C. The depth data depth_C2 of node 11 of Company C is compared with the depth data depth_C1 of the node (node 10 of Company C) pointed to by the position marker data corresponding to the same node data array depthAry_C. If it meets the preset mounting rules, the position marker data TAG_C1 corresponding to the same node data array depthAry_C is updated to the node identifier id_C2 (i.e., TAG_C2) of node 11 of Company C. That is, depthAry_C is represented as data_C: {depth_C1, depth_C2, TAG_C2}. If it does not meet the preset mounting rules, the position marker data corresponding to the same node data array depthAry_C remains unchanged. That is, depthAry_C is represented as data_C: {depth_C1, depth_C2, TAG_C1}.
[0073] The fifth step is to generate an array of identical node data after traversing each node in the graph.
[0074] It's important to understand that if the preset mounting rule is that associated child nodes are mounted to the node with the smallest depth data among multiple identical nodes in the graph, then due to... Figure 1 In the graph, the depth data depth_C1 of node 10 in company C is 2, while the depth data depth_C2 of node 11 in company C is 4. Therefore, depth_C1 < depth_C2. To conform to the preset mounting rules, the final generated array of identical node data depthAry_C is represented as data_C: {depth_C1, depth_C2, TAG_C1}. If the preset mounting rule is that associated child nodes are mounted on the node with the smallest depth data among multiple identical nodes in the graph, since... Figure 1In the example, the depth data depth_C1 of node 10 of company C is 2, while the depth data depth_C2 of node 11 of company C is 4. Therefore, depth_C1 < depth_C2. In order to conform to the preset mounting rules, the final generated data array depthAry_C of the same node is represented as data_C: {depth_C1, depth_C2, TAG_C2}.
[0075] Step S103: Based on the data structure blocks of each node in the same node data array and the position marker data corresponding to the same node data array, attach the associated child nodes that are associated with each node in the same node data array to the nodes in the same node data array pointed to by the position marker data for graph display.
[0076] because Figure 1 In the graph, nodes 10 and 11 of Company C are the same node and have the same associated child nodes E, F, and G. If the preset mounting rule is that associated child nodes are mounted to the node with the smallest depth data among multiple identical nodes in the graph, based on the data structure blocks of each node (i.e., nodes 10 and 11 of Company C) in the identical node data array depthAry_C and the location marker data TAG_C1 corresponding to the identical node data array depthAry_C, the associated child nodes E, F, and G, which are associated with both nodes 10 and 11 of Company C in the identical node data array depthAry_C, are mounted to node 10 of the identical node data array depthAry_C pointed to by the location marker data TAG_C1 for graph display. The graph display result is as follows: Figure 3a As shown.
[0077] because Figure 1 In the graph, nodes 10 and 11 of Company C are the same node and have the same associated child nodes E, F, and G. If the preset mounting rule is that associated child nodes are mounted to the node with the largest depth data among multiple identical nodes in the graph, based on the data structure blocks of each node (i.e., nodes 10 and 11 of Company C) in the identical node data array depthAry_C and the location marker data TAG_C2 corresponding to the identical node data array depthAry_C, the associated child nodes E, F, and G, which are associated with both nodes 10 and 11 of Company C in the identical node data array depthAry_C, are mounted to node 11 of the identical node data array depthAry_C pointed to by the location marker data TAG_C2 for graph display. The graph display result is as follows: Figure 3b As shown.
[0078] In one alternative implementation, such as Figure 4 As shown, the method of the present invention further includes:
[0079] Step S104: In response to the user-triggered mounting change operation of associated child nodes, update the current location marker data to the node identifier of the node in the same node data array pointed to by the user-triggered mounting change operation of associated child nodes, and mount the associated child nodes to the nodes in the same node data array pointed to by the updated location marker data for graph display.
[0080] If the preset mounting rule is that associated child nodes are mounted to the node with the smallest depth data among multiple identical nodes in the graph, and this preset mounting has already been performed... Figure 3a The graph is displayed as shown. If a user triggers a change operation to attach a related child node, such as by double-clicking node 11 of Company C, the current location marker data TAG_C1 is updated to the node identifier id_C2 (i.e., TAG_C2) of the node in the same node data array depthAry_C pointed to by the user-triggered attachment change operation. The related child node is then attached to the node in the same node data array depthAry_C pointed to by the updated location marker data TAG_C2 for graph display. The graph display result is as follows: Figure 3b As shown.
[0081] In this invention, the method by which a user triggers the mounting change operation of associated child nodes can be selected by those skilled in the art according to actual needs, and is not limited here. For example, double-clicking, selecting by box, etc.
[0082] This method can change the attachment of related child nodes to the node that the user is following, even if the node is not a node that meets the preset mounting rules. This allows the user to quickly and accurately know the related child nodes of the node without moving the currently followed node, which is convenient and improves the user experience.
[0083] In another alternative implementation, such as Figure 4 As shown, the method of the present invention further includes:
[0084] Step S105: When there are multiple associated child nodes and none of the multiple associated child nodes have associated child nodes, in response to the user triggering the fusion operation of the associated child nodes, the selected multiple associated child nodes are merged into a fused associated child node; wherein, the fused associated child node displays the node data of the selected multiple associated child nodes;
[0085] If the preset mounting rule is that associated child nodes are mounted to the node with the smallest depth data among multiple identical nodes in the graph, and this preset mounting has already been performed... Figure 3aThe graph shown is illustrated. Since node 10 of company C has three associated child nodes, and none of these three associated child nodes have any other associated child nodes, if the user triggers a merging operation on the associated child nodes, such as dragging associated child nodes E and G onto node F, then the selected E, G, and F nodes will be merged into a single merged associated child node 12. The graph display result is as follows. Figure 5 As shown.
[0086] It should be noted that if a user only drags and drops a node from Company E to a node from Company F, then only the nodes from Company E and Company F will be merged.
[0087] Step S106: When there are multiple associated child nodes and one or more of the multiple associated child nodes also have associated child nodes, in response to the user triggering the fusion operation of the associated child nodes, the selected multiple associated child nodes are merged into a fused associated child node, and all associated child nodes of the selected multiple associated child nodes are hidden; wherein, the fused associated child node displays the node data of the selected multiple associated child nodes.
[0088] If there are multiple associated child nodes, and one or more of these associated child nodes also have associated child nodes, after the user triggers the merging operation of the associated child nodes, the selected multiple associated child nodes will be merged into one merged associated child node. This processing method can simplify the displayed graph and avoid the problem of the associated child nodes being displayed in a chaotic manner after they are merged.
[0089] In this invention, the method for hiding the related child nodes of the selected related child nodes (i.e., the related child nodes to be merged) can be as follows: First, a virtual layer can be created. Then, for the related child nodes to be merged, virtual related child nodes identical to those in the virtual layer can be created, and the related child nodes of the related child nodes can be attached to the virtual related child nodes to hide the entire virtual layer. Specifically, if the two related child nodes, E Company node and F Company node, further have related child nodes, to merge the two related child nodes, a virtual layer can be created first. Then, virtual related child nodes E' Company node and F' Company node identical to those in the virtual layer can be created, and their related child nodes can be attached to E' Company node and F' Company node to hide the entire virtual layer.
[0090] This approach enables the overall migration of related child nodes, avoiding changes to the relationships between related child nodes during the fusion process and ensuring the accuracy of the graph display.
[0091] In this invention, the method by which the user triggers the merging operation of associated child nodes can be selected by those skilled in the art according to actual needs, and is not limited here. For example, dragging, selecting by box, etc.
[0092] In this invention, when displaying identical nodes in a graph, these identical nodes can be uniformly marked for easy user reference. For example, identical nodes in the graph can be highlighted with the same color, or marked with one or more combinations of Chinese characters, numbers, English letters, etc. Those skilled in the art can flexibly choose the marking method according to actual needs; no limitation is made here.
[0093] It should be noted that the method for drawing the atlas in this invention can be the same as the methods in the prior art. Those skilled in the art can choose flexibly according to actual needs, and there is no limitation here.
[0094] The graph display method provided by this invention solves the problem of redundancy and / or infinite display caused by the repeated display of related child nodes of nodes that appear more than twice in different positions in the graph. The drawing process is simple, and the graph can be quickly cropped by setting preset mounting rules, which simplifies the graph structure and makes the graph structure clearer. In addition, it can flexibly adjust the mounting position of related child nodes according to user needs, realize personalized customization, and improve the user experience.
[0095] Exemplary device
[0096] Figure 6 This is a schematic diagram of a module structure of the spectrum display device provided by the present invention, as shown below. Figure 6 As shown, the device includes: a construction module 201, an set generation module 202, and a display module 203; wherein, the construction module 201 is used to construct data structure blocks for each node in the graph according to a preset data structure; the set generation module 202 is used to traverse each node in the graph according to a preset traversal algorithm, obtain the depth data of each node in the graph, and generate a data array of identical nodes according to preset mounting rules, data structure blocks, and depth data, wherein the data array of identical nodes includes the depth data of each node in the data array of identical nodes and the position marker data corresponding to the data array of identical nodes; the display module 203 is used to mount the associated child nodes that are associated with each node in the data array of identical nodes to the nodes in the data array of identical nodes pointed to by the position marker data for graph display, according to the data structure blocks of each node in the data array of identical nodes and the position marker data corresponding to the data array of identical nodes.
[0097] Optionally, the data structure blocks of each node in the graph include: node identifier, node data, and data structure blocks of associated child nodes; wherein, the data structure blocks of associated child nodes have the same data structure as the data structure blocks of the nodes.
[0098] Optionally, the preset mounting rules include: the associated child node is mounted on the node with the smallest depth data among multiple identical nodes in the graph; or, the associated child node is mounted on the node with the largest depth data among multiple identical nodes in the graph; or, the associated child node is mounted on any node selected by the user among multiple identical nodes in the graph.
[0099] Optionally, the set generation module 202 is specifically used to: traverse each node in the graph according to the preorder traversal algorithm, and perform the following traversal operation for each node in the graph:
[0100] Get the data structure block and depth data of the currently traversed node and the traversed nodes, and compare the node data of the currently traversed node with the node data of the traversed nodes.
[0101] If there is no traversed node with the same node data as the currently traversed node, create an array of identical node data with the node data of the currently traversed node as the query identifier, and store the depth data of the currently traversed node and the node identifier of the currently traversed node as the position marker data corresponding to the identical node data array into the identical node data array.
[0102] If a previously visited node has the same node data as the currently visited node, find the matching node data array corresponding to the query identifier that matches the node data of the currently visited node, and store the depth data of the currently visited node in the matching node data array. Also, compare the depth data of the currently visited node with the depth data of the node pointed to by the position marker data corresponding to the matching node data array. If it meets the preset mounting rules, update the position marker data corresponding to the matching node data array to the node identifier of the currently visited node. If it does not meet the preset mounting rules, the position marker data corresponding to the matching node data array remains unchanged.
[0103] After traversing each node in the graph, an array of identical node data is generated.
[0104] Optionally, the display module 203 is also used to uniformly mark identical nodes in the graph for easy user reference. For example, identical nodes in the graph can be highlighted with the same color, or identical nodes in the graph can be marked with one or more combinations of Chinese characters, numbers, English letters, etc. Those skilled in the art can flexibly choose the marking method according to actual needs, and there is no limitation here.
[0105] Optionally, the device further includes: a mount change module (not shown in the figure); the mount change module is used to respond to the user-triggered mount change operation of the associated child node, update the current location marker data to the node identifier of the node in the same node data array pointed to by the user-triggered mount change operation of the associated child node, and mount the associated child node to the node in the same node data array pointed to by the updated location marker data for map display.
[0106] This method can change the attachment of related child nodes to the node that the user is following, even if the node is not a node that meets the preset mounting rules. This allows the user to quickly and accurately know the related child nodes of the node without moving the currently followed node, which is convenient and improves the user experience.
[0107] Optionally, the device further includes: a fusion module (not shown in the figure); the fusion module is used to merge the selected multiple associated child nodes into a single merged associated child node in response to a user triggering a fusion operation when there are multiple associated child nodes and none of the multiple associated child nodes have associated child nodes; wherein the merged associated child node displays the node data of the selected multiple associated child nodes; and / or, when there are multiple associated child nodes and one or more of the multiple associated child nodes also have associated child nodes, in response to a user triggering a fusion operation, merge the selected multiple associated child nodes into a single merged associated child node, and hide all the associated child nodes of the selected multiple associated child nodes; wherein the merged associated child node displays the node data of the selected multiple associated child nodes.
[0108] If there are multiple associated child nodes, and one or more of these associated child nodes also have associated child nodes, after the user triggers the merging operation of the associated child nodes, the selected multiple associated child nodes will be merged into one merged associated child node. This processing method can simplify the displayed graph and avoid the problem of the associated child nodes being displayed in a chaotic manner after they are merged.
[0109] Optionally, the fusion module is also used to create a virtual layer, on which a virtual associated child node identical to the selected associated child node is created, and the associated child node of the selected associated child node is attached to the virtual associated child node to hide the virtual layer.
[0110] In this invention, the method for hiding the related child nodes of the selected related child nodes (i.e., the related child nodes to be merged) can be as follows: First, a virtual layer can be created. Then, for the related child nodes to be merged, virtual related child nodes identical to those in the virtual layer can be created, and the related child nodes of the related child nodes can be attached to the virtual related child nodes to hide the entire virtual layer. Specifically, if the two related child nodes, E Company node and F Company node, further have related child nodes, to merge the two related child nodes, a virtual layer can be created first. Then, virtual related child nodes E' Company node and F' Company node identical to those in the virtual layer can be created, and their related child nodes can be attached to E' Company node and F' Company node to hide the entire virtual layer.
[0111] This approach enables the overall migration of related child nodes, avoiding changes to the relationships between related child nodes during the fusion process and ensuring the accuracy of the graph display.
[0112] In this invention, the method by which the user triggers the merging operation of associated child nodes can be selected by those skilled in the art according to actual needs, and is not limited here. For example, dragging, selecting by box, etc.
[0113] It should be noted that, Figure 6 The illustrated spectrum display device corresponds to the spectrum display method in this invention, and its description can be referred to the description of the spectrum display method in this invention, which will not be repeated here.
[0114] The graph display device provided by this invention solves the problem of redundancy and / or infinite display caused by the repeated display of related child nodes of nodes that appear more than twice in different positions in the graph. The drawing process is simple, and the graph can be quickly cropped by setting preset mounting rules, which simplifies the graph structure and makes the graph structure clearer. In addition, it can flexibly adjust the mounting position of related child nodes according to user needs, realize personalized customization, and improve the user experience.
[0115] Exemplary electronic devices
[0116] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device can be any one or both of a first device and a second device, or a standalone device independent of them. This standalone device can communicate with the first and second devices to receive collected input signals from them. For example... Figure 7 As shown, the electronic device 30 includes one or more processors 31 and memory 32.
[0117] The processor 31 may be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0118] The memory 32 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 31 may execute the program instructions to implement the software program graph representation method of the various embodiments of this disclosure described above and / or other desired functions. In one example, the electronic device may further include an input device 33 and an output device 34, these components being interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0119] In addition, the input device 33 may also include, for example, a keyboard, a mouse, etc.
[0120] The output device 34 can output various information to the outside. The output device 34 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0121] Of course, for the sake of simplicity, Figure 7 Only some of the components of the electronic device relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.
[0122] Exemplary computer program products and storage media
[0123] In addition to the methods and apparatus described above, embodiments of this disclosure may also be computer program products comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps of the atlas display methods according to various embodiments of this disclosure as described in the "Exemplary Methods" section of this specification.
[0124] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this disclosure. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0125] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps in the atlas display methods according to various embodiments of this disclosure as described in the "Exemplary Methods" section of this specification.
[0126] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0127] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0128] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0129] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0130] The methods and apparatus of this disclosure may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of this disclosure are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, this disclosure may also be implemented as a program recorded on a recording medium, the program including machine-readable instructions for implementing the methods according to this disclosure. Thus, this disclosure also covers recording media storing programs for performing the methods according to this disclosure.
[0131] It should also be noted that in the apparatus, devices, and methods of this disclosure, the components or steps are decomposable and / or recombinable. Such decomposition and / or recombination should be considered equivalent to the present disclosure. The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0132] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A method of mapping presentation, characterized by, The method comprises: According to the preset data structure, the data structure block of each node in the graph is constructed; According to the preset traversal algorithm, each node in the graph is traversed, the depth data of each node in the graph is obtained, and according to the preset mounting rule, the data structure block and the depth data, the same node data array is generated; wherein the same node data array includes the depth data of each node in the same node data array and the position mark data corresponding to the same node data array; According to the data structure block of each node in the same node data array and the position mark data corresponding to the same node data array, the associated sub-nodes associated with each node in the same node data array are mounted on the node in the same node data array pointed by the position mark data for graph display; The preset mounting rule includes: the associated sub-nodes are mounted on the node with the smallest depth data in the plurality of same nodes in the graph; or, the associated sub-nodes are mounted on the node with the largest depth data in the plurality of same nodes in the graph; or, the associated sub-nodes are mounted on any node selected by the user in the plurality of same nodes in the graph.
2. The method of claim 1, wherein, The method further comprises: In response to the user triggering the mounting change operation of the associated sub-node, the current position mark data is updated to the node identifier of the node in the same node data array pointed by the user triggered mounting change operation of the associated sub-node, and the associated sub-node is mounted on the node in the same node data array pointed by the updated position mark data for graph display.
3. The method of claim 1, wherein, The method further comprises: When the number of the associated sub-nodes is multiple and none of the multiple associated sub-nodes has an associated sub-node, in response to the user triggering the fusion operation of the associated sub-nodes, the selected multiple associated sub-nodes are fused into one fusion associated sub-node; wherein the fusion associated sub-node displays the node data of the selected multiple associated sub-nodes.
4. The method of claim 1, wherein, The method further comprises: When the number of the associated sub-nodes is multiple and one or more of the multiple associated sub-nodes has an associated sub-node, in response to the user triggering the fusion operation of the associated sub-nodes, the selected multiple associated sub-nodes are fused into one fusion associated sub-node, and all associated sub-nodes of the selected multiple associated sub-nodes are hidden; wherein the fusion associated sub-node displays the node data of the selected multiple associated sub-nodes.
5. The method according to any one of claims 1 to 4, characterized in that, The data structure block of each node in the graph comprises: node identifier, node data, and data structure block of the associated sub-node associated with the node; wherein the data structure block of the associated sub-node is the same as the data structure of the data structure block of the node.
6. The method of claim 5, wherein, The method according to the preset traversal algorithm, traversing each node in the graph, obtaining the depth data of each node in the graph, and generating the same node data array according to the preset mounting rule, the data structure block and the depth data, comprises: According to the pre-order traversal algorithm, each node in the graph is traversed, and the following traversal operation is performed for each node in the graph: Obtain the data structure block and depth data of the currently traversed node and the traversed node, and compare the node data of the currently traversed node with the node data of the traversed node; If there is no traversed node with the same node data as the node data of the currently traversed node, create an identical node data array with the node data of the currently traversed node as the query identifier, and store the depth data of the currently traversed node and the node identifier of the currently traversed node as the position marker data corresponding to the identical node data array into the identical node data array; If there is a traversed node with the same node data as the node data of the currently traversed node, find the identical node data array corresponding to the query identifier with the same node data as the node data of the currently traversed node, and store the depth data of the currently traversed node into the identical node data array, and compare the depth data of the currently traversed node with the depth data of the node pointed to by the position marker data corresponding to the identical node data array; if it meets the preset mounting rule, update the position marker data corresponding to the identical node data array to the node identifier of the currently traversed node; if it does not meet the preset mounting rule, the position marker data corresponding to the identical node data array remains unchanged; After the traversal of each node in the graph is completed, the identical node data array is generated.
7. A map display device characterized by comprising: The device includes a construction module, a set generation module and a display module; wherein, The construction module is configured to construct a data structure block of each node in a graph according to a preset data structure; The set generation module is configured to traverse each node in the graph according to a preset traversal algorithm, obtain depth data of each node in the graph, and generate an identical node data array according to a preset mounting rule, the data structure block and the depth data; wherein the identical node data array includes depth data of each node in the identical node data array and position marker data corresponding to the identical node data array; The display module is configured to mount an associated sub-node associated with each node in the identical node data array to a node in the identical node data array pointed to by the position marker data corresponding to the identical node data array according to the data structure block of each node in the identical node data array and the position marker data corresponding to the identical node data array, and display the graph. The preset mounting rule includes: the associated sub-node is mounted on the node with the smallest depth data in the plurality of identical nodes in the graph; or, the associated sub-node is mounted on the node with the largest depth data in the plurality of identical nodes in the graph; or, the associated sub-node is mounted on any node selected by a user in the plurality of identical nodes in the graph.
8. An electronic device, comprising: The electronic device includes: a memory having a computer program stored thereon; a processor for executing the computer program in the memory to implement the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, the program which, when executed by the processor, implements the steps of the method of any of claims 1 to 6.
Citation Information
Patent Citations
Web application page rendering optimization
CN104933078A
Equity structure diagram display method and device and electronic equipment
CN113343039A