Hidden node expansion method, device, computing equipment and storage medium

By obtaining the attribute information of the target contraction node and determining the development level, the problem of the hidden nodes in the existing technologies in the existing technologies is insufficient, and the higher user experience is achieved.

CN114140554BActive Publication Date: 2025-01-28HARBIN ANTIY TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111490374.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-08
Publication Date
2025-01-28
Estimated Expiration
2041-12-08

Smart Images

  • Figure CN114140554B_ABST
    Figure CN114140554B_ABST
Patent Text Reader

Abstract

The present invention provides a hidden node expansion method, device, computing device and storage medium, wherein the method includes: when receiving an expansion initiation instruction for a target shrink node in a point-line relationship diagram, obtaining the attribute information of the target shrink node; determining the maximum level to which the target shrink node can be expanded according to the attribute information, and responding to the expansion initiation instruction according to the maximum level; receiving an expansion operation instruction for the target shrink node, determining the expansion level that does not exceed the maximum level required for the target shrink node according to the expansion operation instruction; and expanding the hidden nodes on the expansion level under the target shrink node according to the attribute information of the target shrink node. This solution can improve the flexibility and controllability of the selection of the expansion level, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a hidden node expansion method, device, computing equipment and storage medium. Background Art

[0002] In the drawing of point-line relationship diagrams, when there are a large number of point-line relationships, problems such as obstructed vision and poor neatness may occur. Therefore, a certain type or group of nodes can be collapsed, and the collapsed nodes can be expanded when needed. In the prior art, when a collapsed node is expanded, all hidden nodes under the collapsed node are expanded at once. It can be seen that the flexibility and controllability of the prior art method of expanding hidden nodes are poor, which affects the user experience. Summary of the invention

[0003] Based on the problem that the existing method of expanding hidden nodes has poor flexibility and controllability, which affects the user experience, the embodiments of the present invention provide a hidden node expansion method, apparatus, computing device and storage medium, which can improve flexibility and controllability, thereby improving the user experience.

[0004] In a first aspect, an embodiment of the present invention provides a hidden node expansion method, comprising:

[0005] When receiving an expansion initiation instruction for a target shrink node in the point-line relationship graph, acquiring attribute information of the target shrink node;

[0006] Determine the maximum level at which the target contracted node can be expanded according to the attribute information, and respond to the expansion initiation instruction according to the maximum level;

[0007] receiving an expansion operation instruction for the target contraction node, and determining, according to the expansion operation instruction, an expansion level that does not exceed the maximum level required to expand the target contraction node;

[0008] According to the attribute information of the target shrinking node, the hidden nodes on the expansion level under the target shrinking node are expanded.

[0009] Preferably, before acquiring the attribute information of the target shrink node, the method further includes:

[0010] Determine a first set of connected subgraphs contained in the point-line relationship graph;

[0011] For each connected subgraph in the first set, node attribute information is established respectively; the attribute information includes at least one of a node unique identifier, a parent node attribute, a child node attribute, a node state, a hierarchical depth of a descendant node, and a position relative to a parent node;

[0012] The determining, according to the attribute information, a maximum level to which the target contracted node can be expanded includes: determining a level depth of a descendant node in the attribute information as the maximum level.

[0013] Preferably, the method for establishing the attribute information of each node in the connected subgraph includes:

[0014] Determine the root node in the connected subgraph;

[0015] Starting from the root node of the connected subgraph, the parent-child relationship between each node in the connected subgraph and its directly connected node is determined one by one, and recorded in the parent node attribute and child node attribute of the corresponding node.

[0016] Preferably, the expansion operation instruction carries the required expansion level depth;

[0017] The step of determining, according to the expansion operation instruction, an expansion level that does not exceed the maximum level required to expand the target contraction node includes:

[0018] Determine whether the required expanded level depth is not greater than the maximum level;

[0019] If yes, determining a level that is not greater than the required expanded level depth as the expanded level;

[0020] If not, a level not greater than the maximum level is determined as the expanded level.

[0021] Preferably, the expansion operation instruction carries at least one expansion level required to be expanded; and the at least one expansion level required to be expanded includes any level not exceeding the maximum level.

[0022] Preferably, after expanding the hidden nodes on the expansion level under the target contraction node, the method further includes:

[0023] Determine whether there is a non-expanded level greater than the minimum expanded level under the target contraction node;

[0024] If so, the hidden node on the non-expanded level greater than the minimum expanded level is changed from under the target contraction node to under the corresponding parent node.

[0025] Preferably, it also includes:

[0026] When a shrink instruction for a target expanded node is received, the nodes in the expanded state among the descendant nodes of the target expanded node are traversed one by one starting from the target expanded node;

[0027] If the traversal reaches a descendant node in a contracted state, the traversal of the child nodes of the descendant node is stopped; if the traversal does not reach a descendant node in a contracted state, the traversal continues until a descendant node that does not include a child node is reached;

[0028] The descendant nodes that are traversed but do not include the collapsed state are hidden under the target expanded node.

[0029] In a second aspect, an embodiment of the present invention further provides a hidden node expansion device, comprising:

[0030] An attribute information acquisition unit, configured to acquire attribute information of a target shrink node in a point-line relationship graph when receiving an expansion initiation instruction for the target shrink node;

[0031] a maximum level determination unit, configured to determine a maximum level at which the target contracted node can be expanded according to the attribute information, and respond to the expansion initiation instruction according to the maximum level;

[0032] an expansion level determination unit, configured to receive an expansion operation instruction for the target contraction node, and determine an expansion level not exceeding the maximum level required to be expanded for the target contraction node according to the expansion operation instruction;

[0033] The expansion operation unit is used to expand the hidden nodes on the expansion level under the target shrinking node according to the attribute information of the target shrinking node.

[0034] In a third aspect, an embodiment of the present invention further provides a computing device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in any embodiment of this specification is implemented.

[0035] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, enables the computer to execute the method described in any embodiment of this specification.

[0036] The embodiment of the present invention provides a hidden node expansion method, device, computing device and storage medium, which determines the maximum level to which the target shrink node can be expanded through the attribute information of the target shrink node, so as to respond to the expansion initiation instruction, and when the expansion operation instruction for the target shrink node is received after the response is completed, determines the expansion level that does not exceed the maximum level for the target shrink node, and then expands the hidden nodes on the expansion level under the target shrink node. It can be seen that this scheme can specify the required expansion level according to the needs, and when expanding, only the hidden nodes on the expansion level are expanded, and other hidden nodes will not be expanded. It has high flexibility and controllability, and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 is a flow chart of a hidden node expansion method provided by an embodiment of the present invention;

[0039] Figure 2 It is a flow chart of a method for establishing node attribute information provided by an embodiment of the present invention;

[0040] Figure 3 is a point-line relationship diagram provided by an embodiment of the present invention;

[0041] Figure 4 is another point-line relationship diagram provided by an embodiment of the present invention;

[0042] Figure 5 is a hardware architecture diagram of a computing device provided by an embodiment of the present invention;

[0043] Figure 6 It is a structural diagram of a hidden node expansion device provided by an embodiment of the present invention;

[0044] Figure 7 It is a structural diagram of another hidden node expansion device provided by an embodiment of the present invention;

[0045] Figure 8 This is a structural diagram of another hidden node expansion device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0047] As mentioned above, when expanding a contracted node, all hidden nodes under the contracted node are expanded at once. For example, if there are three levels of hidden nodes under the contracted node, and the hidden nodes need to be expanded, an expansion instruction can be generated for the contracted node, and all three levels of hidden nodes can be expanded according to the expansion instruction. However, this method of expanding hidden nodes has poor flexibility and controllability, which affects the user experience. In order to improve flexibility and controllability, when initiating an expansion instruction for a contracted node, it can be considered to respond to the expansion instruction using the maximum level to which the contracted node can be expanded, so that the user inputs the required expansion level according to the maximum level that can be expanded. After determining that the expansion level does not exceed the maximum level, only the hidden nodes of the expansion level need to be expanded, and there is no need to expand other hidden nodes, thereby improving the user experience.

[0048] The specific implementation of the above concept is described below.

[0049] Please refer to Figure 1 , an embodiment of the present invention provides a hidden node expansion method, the method comprising:

[0050] Step 100, when receiving an expansion initiation instruction for a target shrink node in a point-line relationship graph, acquiring attribute information of the target shrink node;

[0051] Step 102, determining the maximum level at which the target contracted node can be expanded according to the attribute information, and responding to the expansion initiation instruction according to the maximum level;

[0052] Step 104, receiving an expansion operation instruction for the target contraction node, and determining an expansion level that does not exceed the maximum level required to expand the target contraction node according to the expansion operation instruction;

[0053] Step 106: Expand the hidden nodes on the expansion level under the target shrinking node according to the attribute information of the target shrinking node.

[0054] In the embodiment of the present invention, the maximum level to which the target shrink node can be expanded is determined through the attribute information of the target shrink node, so as to respond to the expansion initiation instruction. When the expansion operation instruction for the target shrink node is received after the response is completed, the expansion level that does not exceed the maximum level for the target shrink node is determined, and then the hidden nodes on the expansion level under the target shrink node are expanded. It can be seen that this solution can specify the required expansion level according to the needs, and when expanding, only the hidden nodes on the expansion level are expanded, and other hidden nodes will not be expanded. It has high flexibility and controllability, and improves the user experience.

[0055] Described below Figure 1 How the various steps are performed.

[0056] First, with respect to step 100, when an expansion initiation instruction for a target shrink node in the point-line relationship graph is received, the attribute information of the target shrink node is acquired.

[0057] In one embodiment of the present invention, in order to obtain the attribute information of the target contraction node, please refer to Figure 2 Before step 100, the following operations may be performed on the point-line relationship diagram:

[0058] Step 200: determine a first set of connected subgraphs included in the point-line relationship graph.

[0059] In some cases, in the topological structure involved in the point-line relationship graph, due to network isolation and other reasons, not all nodes in the topological structure can be connected to other nodes. Therefore, after the point-line relationship graph is completed, in order to obtain the attribute information of each node in the point-line relationship graph, it is necessary to determine the connected subgraphs contained in the point-line relationship graph based on the connection relationship between nodes.

[0060] In one embodiment of the present invention, after configuring a node unique identifier for each node in the point-line relationship graph, this step 200 can determine each connected subgraph in the following manner:

[0061] a) Create a set A containing all the nodes in the point-line relationship graph, and create a set B, which is initially an empty set;

[0062] b) Extract any node a from set A to set B;

[0063] c) According to the connection relationship of node a, all the connected nodes directly connected to node a are found in set A, such as {a1, a2, a3, ..., an}; all the connected nodes found this time are moved to set B;

[0064] d) For each node moved to set B this time, find all connected nodes that have direct connection relationships in set A, and move all connected nodes found this time from set A to set B. Continue to perform this step until no nodes that have connection relationships with nodes in set B are found in set A; all nodes in set B are determined as a connected subgraph;

[0065] For example, the nodes moved to set B this time are {a1, a2, a3, …, an}, then for each node in {a1, a2, a3, …, an}, search for nodes {a11, a12, a13, …, a1n, a21, a22, a23, …, a2n …, an1, an2, …, ann} in set A that have direct connections; among them, {a11, a12, a13, …, a1n} are the connecting nodes of node a1; and {a21, a22, a23, …, a2n} are the connecting nodes of node a2.

[0066] e) Determine whether there are still remaining nodes in set A. If so, create a set C, which is initially an empty set. Extract a node b from set A and move it to set C. Repeat steps c and d to determine all nodes in set C as a connected subgraph. Continue step e until there are no nodes in set A, and obtain all connected subgraphs.

[0067] Step 202, for each connected subgraph in the first set, establish node attribute information respectively; the attribute information includes at least one of the node unique identifier, parent node attributes, child node attributes, node status, hierarchical depth of descendant nodes and position relative to the parent node.

[0068] For ease of description, the attribute information of a node can be represented by the following parameters:

[0069] id: unique node identifier

[0070] parenteid: parent node id (if there is a parent node, there is only one parent node)

[0071] childrenid: child node id (if there are child nodes, there can be one or more child nodes)

[0072] scaleState: node state (including expansion state and contraction state, true means that the child nodes of the node do not exist and are contracted under the node, false means that the child nodes of the node exist and are contracted under the node)

[0073] childrenlevel: the level depth of descendant nodes

[0074] pos: The position of the node relative to the parent node

[0075] In one embodiment of the present invention, in order to establish attribute information for each node in the connected subgraph, it can be established in the following manner:

[0076] First, determine the root node in the connected subgraph;

[0077] Then, starting from the root node of the connected subgraph, the parent-child relationship between each node in the connected subgraph and its directly connected node is determined one by one, and recorded in the parent node attribute and child node attribute of the corresponding node.

[0078] Specifically, in one embodiment of the present invention, when determining the root node in the connected subgraph, the following steps may be used to determine the root node:

[0079] a) Determine all leaf nodes in the connected subgraph and assign a weight of 1 to the leaf nodes; a node with only one connection relationship is a leaf node;

[0080] b) Determine the nodes in the connected subgraph that are directly connected to the leaf node with a weight of 1, and assign a weight of 2 to these nodes;

[0081] c) determining the nodes in the connected subgraph that are directly connected to the node with a weight of 2 and have no weight assigned, and assigning a weight of 3 to these nodes;

[0082] d) Repeat the weighting method until all nodes are assigned weights;

[0083] In repeating the weighting method, specifically, determine the nodes in the connected subgraph that are directly connected to the nodes that were weighted last time and have not been weighted, and assign the weight + 1 assigned last time to the nodes determined this time until all nodes are weighted.

[0084] e) Determine the root node of the connected subgraph according to the assigned weight.

[0085] This step e may include: determining whether there is one node with the largest weight in the connected subgraph, and if so, determining the node with the largest weight as the root node of the connected subgraph; otherwise, for each node with the largest weight, calculating the sum of the weights of the nodes directly connected to it, and determining whether there is one node with the largest weight sum, and if so, determining the node with the largest weight sum as the root node, otherwise, determining any node with the largest weight sum as the root node.

[0086] In this embodiment, the level of the node is determined by assigning weights. The smaller the weight, the lowest level, that is, the leaf node is the lowest level node. The largest weight indicates that the node has the highest level in the connected subgraph. Therefore, the node with the highest level is determined as the root node, so that the root node can be accurately found by using the weight assignment method.

[0087] Specifically, in one embodiment of the present invention, starting from the root node of the connected subgraph, the parent-child relationship between each node in the connected subgraph and its directly connected node is determined one by one, and recorded in the parent node attribute and child node attribute of the corresponding node, which can be achieved by the following steps:

[0088] Starting from the root node, since the root node has no parent node, the parentid attribute of the root node is the root node's own id, and all nodes directly connected to the root node (such as node1, node2, node3, ..., nodeN) are its child nodes, and these child nodes are stored in the childrenid attribute of the root node; traverse all the child nodes of the root node, and set the parent node and child node for each child node as follows: Take one of the child nodes, node1, as an example, its parentid attribute is the root node's id, and its child nodes traverse all the nodes directly connected to it and without the parentid attribute set, and record them as child nodes of the node1 node in the childrenid attribute; in this way, traverse all the nodes of the connected subgraph; if the node has no child nodes, the childrenid attribute is empty, and its scaleState attribute is always in the true state.

[0089] It should be noted that in the above-mentioned node traversal process, the node state of the node can be recorded in the scaleState attribute at the same time. In addition, after all nodes have completed the recording of attribute information, for each node, the hierarchical depth of its descendant nodes is determined, and the hierarchical depth of the descendant nodes is recorded in the childrenlevel attribute of the node. Furthermore, in order to ensure that the connection and position of other nodes are not affected after some nodes in the point-line relationship diagram are expanded or contracted, the relative position of the node and its parent node can be configured for each node in its attribute information. Among them, when there is no contracted node in the point-line relationship diagram, the original relative position of each node and its parent node can be recorded in the pos attribute of the corresponding node.

[0090] In this embodiment, in order to obtain the attribute information of the target contraction node, it is necessary to know which connected subgraph the target contraction node belongs to, and then establish the attribute information of the node for the connected subgraph to which it belongs, so as to ensure the accuracy of the attribute information in the process of establishing the attribute information, and then quickly determine the corresponding attribute information according to the unique node identifier of the target contraction node.

[0091] In this step 100, when the user clicks on a node in the point-line relationship diagram, if the node state of the node is a contracted state, the node is determined as a target contracted node, and the click operation can generate an expansion initiation instruction. At this time, it is necessary to obtain the attribute information of the target contracted node. Among them, the attribute information of the node can be obtained through the unique identifier of the node.

[0092] Then, for step 102, the maximum level at which the target contracted node can be expanded is determined according to the attribute information, and the expansion initiation instruction is responded to according to the maximum level.

[0093] In one embodiment of the present invention, the childrenlevel attribute in the attribute information is the hierarchical depth of the descendant nodes. For example, the hierarchical depth of the descendant nodes of the target contracted node is 5, which indicates that the maximum level that can be expanded for the target contracted node is 5. Therefore, in this step, the hierarchical depth of the descendant nodes in the attribute information is determined as the maximum level that can be expanded.

[0094] When responding to the expansion initiation instruction according to the maximum level, the response can be made in an interactive manner. Specifically, the maximum level is displayed on the display interface of the point-line relationship diagram. The user can input the expansion level required to be expanded according to the maximum level, thereby generating an expansion operation instruction for the target contraction node.

[0095] Finally, step 104 "receive an expansion operation instruction for the target shrink node, and determine the expansion level that does not exceed the maximum level required to expand the target shrink node according to the expansion operation instruction" and step 106 "expand the hidden nodes on the expansion level under the target shrink node according to the attribute information of the target shrink node" are explained at the same time.

[0096] In the embodiment of the present invention, the content carried by the expansion operation instruction may be any of the following:

[0097] In case 1, the expansion operation instruction carries the required expansion level depth.

[0098] In case 2, the expansion operation instruction carries the expansion level to be expanded.

[0099] The following describes the execution process of the expansion operation instruction for the above two situations respectively.

[0100] In case one, when the expansion operation instruction carries the required expansion level depth, this step 104 determines the expansion level that does not exceed the maximum level required to expand the target contraction node, which may include: determining whether the required expansion level depth is not greater than the maximum level; if so, determining the level that is not greater than the required expansion level depth as the expansion level; if not, determining the level that is not greater than the maximum level as the expansion level.

[0101] For example, if the level depth of the descendant nodes of the target shrink node is 5, then the maximum level is 5. Assuming that the required expansion level depth carried by the expansion operation instruction is 4, the first level, second level, third level and fourth level belonging to the descendants of the target shrink node are all determined as expansion levels.

[0102] In this case one, the level depth can be input as needed, and then the hidden nodes from the first level of the descendants of the target contracted node to the level depth can be expanded. This allows the user to flexibly select the required expansion level according to the user's needs, and then control the expansion of the nodes on the corresponding expansion level, thereby improving the user experience.

[0103] In the second case, when the expansion operation instruction carries the expansion level required to be expanded, the expansion level may be at least one, and the at least one expansion level required to be expanded includes any level not exceeding the maximum level.

[0104] For example, if the level depth of the descendant nodes of the target shrink node is 5, then the maximum level is 5, and the expanded level can be the first level or the third level of the descendants of the target shrink node, or the expanded level can be the second level or the third level of the descendants of the target shrink node.

[0105] In the second case, it can be seen that the expansion level to be expanded can be selected more flexibly, and the expansion levels can be continuous or discontinuous, and can be one expansion level or multiple expansion levels, thereby being able to meet more needs of users.

[0106] Regardless of the above situation one or situation two, there is a situation that there is a non-expanded level greater than the minimum expansion level under the target shrinkage node. Therefore, based on this situation, in order to ensure the continuity of the point-line relationship diagram during the expansion process and not affect the expansion of subsequent nodes, after step 106, it can also include: determining whether there is a non-expanded level greater than the minimum expansion level under the target shrinkage node; if so, changing the hidden nodes on the non-expanded level greater than the minimum expansion level from under the target shrinkage node to under the corresponding parent node.

[0107] For example, if the level depth of the descendant nodes of the target shrink node is 5, then the maximum level is 5, and the expanded levels are the first and third levels belonging to the descendants of the target shrink node. Assuming that there are non-expanded levels greater than the first level, namely the second, fourth and fifth levels, since the hidden nodes on the second, fourth and fifth levels are shrunk under the target shrink node, and the first level is the expanded level, it is necessary to change the hidden nodes on the second, fourth and fifth levels from under the target shrink node to under the corresponding parent node.

[0108] In one embodiment of the present invention, when determining the parent node corresponding to a hidden node on a non-expanded level, it can include: for each hidden node on the non-expanded level, determining the expanded level that is closest to the level of the hidden node and higher than the level of the hidden node, and determining the node on the expanded level that is the parent node of the hidden node as the parent node to be changed.

[0109] Continuing with the above example, for the hidden node on the second level, the expansion level that is closest to the level of the hidden node and higher than the level of the hidden node is the first level, so the node that is the parent node of the hidden node on the first level determines the parent node to which the hidden node is changed. That is, after the hidden node of the first level is expanded, the hidden node of the second level is still in a contracted state, and is changed from the target contracted node to the node of the first level.

[0110] When a hidden node is expanded, the pos attribute of the hidden node may be used to determine the expanded position of the hidden node, so that the expanded point-line relationship diagram can maintain the original relative position relationship.

[0111] Furthermore, since the hidden node on the non-expanded level is changed from under the target contraction node to under the corresponding parent node, the position of the hidden node on the non-expanded level is also changed to the position of the corresponding parent node. In this way, the point-line relationship diagram can be guaranteed to have an accurate connection relationship.

[0112] In one embodiment of the present invention, an expansion animation may be set and executed during the expansion process.

[0113] After the hidden nodes on the expansion level are expanded, the scaleState attribute of each node is changed according to whether each expanded node is a contracted node.

[0114] In one embodiment of the present invention, the nodes whose scaleState attribute is true (expanded state) can also be shrunk. Specifically, when a shrink instruction for a target expanded node is received, the nodes in the expanded state among the descendant nodes of the target expanded node are traversed one by one starting from the target expanded node; if a descendant node in the shrunk state is traversed, the traversal of the child nodes of the descendant node is stopped; if a descendant node in the shrunk state is not traversed, the traversal is continued until a descendant node that does not include a child node is traversed; and the descendant nodes that do not include a shrunk state are hidden under the target expanded node.

[0115] It can be seen that when shrinking, since the descendant nodes in the shrunken state will not be shrunk by the target expanded node, when expanding the target shrunken node, if there are nodes whose level is the expanded level among the nodes shrunk by the descendant nodes in the shrunken state, the nodes shrunk by the descendant nodes in the shrunken state will still be expanded.

[0116] For example, see Figure 3In this point-line relationship diagram, node 1 is the target shrink node, the nodes in the dotted box are hidden nodes, and the childrenlevel attribute of the target shrink node is 3. If you need to expand the nodes on the first level, the second level, and the third level, you will get Figure 4 As shown in the point-line relationship diagram, at this time, the scaleState attribute of each node in the diagram is in the expanded state true. It can be seen that in this embodiment, the flexibility of selecting the expansion level is further improved.

[0117] like Figure 5 , Figure 6 As shown, an embodiment of the present invention provides a hidden node deployment device. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. From the hardware level, Figure 5 As shown, it is a hardware architecture diagram of a computing device where a hidden node expansion device provided by an embodiment of the present invention is located, except Figure 5 In addition to the processor, memory, network interface, and non-volatile memory shown in the figure, the computing device in which the device is located in the embodiment may also generally include other hardware, such as a forwarding chip responsible for processing messages, etc. Taking software implementation as an example, Figure 6 As shown, as a device in a logical sense, the CPU of the computing device in which it is located reads the corresponding computer program in the non-volatile memory into the memory and runs it. This embodiment provides a hidden node expansion device, including:

[0118] The attribute information acquisition unit 601 is used to acquire the attribute information of the target shrink node in the point-line relationship diagram when receiving an expansion initiation instruction for the target shrink node;

[0119] A maximum level determination unit 602 is used to determine the maximum level at which the target collapsed node can be expanded according to the attribute information, and respond to the expansion initiation instruction according to the maximum level;

[0120] The expansion response unit 603 is used to receive an expansion operation instruction for the target shrink node, determine the expansion level that does not exceed the maximum level required to expand the target shrink node according to the expansion operation instruction; and expand the hidden nodes on the expansion level under the target shrink node according to the attribute information of the target shrink node.

[0121] In one embodiment of the present invention, please refer to Figure 7 , the hidden node expansion device also includes:

[0122] The attribute establishment unit 604 is used to determine a first set of connected subgraphs included in the point-line relationship graph; and establish attribute information of nodes for each connected subgraph in the first set; the attribute information includes at least one of a node unique identifier, a parent node attribute, a child node attribute, a node state, a hierarchical depth of a descendant node, and a position relative to a parent node;

[0123] The maximum level determination unit 602 is specifically configured to determine the level depth of the descendant node in the attribute information as the maximum level.

[0124] In one embodiment of the present invention, the attribute establishment unit 604 establishes the attribute information of each node in the connected subgraph in the following manner: determine the root node in the connected subgraph; starting from the root node of the connected subgraph, determine the parent-child relationship between each node in the connected subgraph and its directly connected node one by one, and record them in the parent node attributes and child node attributes of the corresponding node.

[0125] In one embodiment of the present invention, the expansion operation instruction carries the required expansion level depth;

[0126] The expansion response unit 603 is specifically used to determine whether the required expansion level depth is not greater than the maximum level; if so, determine the level not greater than the required expansion level depth as the expansion level; if not, determine the level not greater than the maximum level as the expansion level.

[0127] In one embodiment of the present invention, the expansion operation instruction carries at least one expansion level required to be expanded; and the at least one expansion level required to be expanded includes any level not exceeding the maximum level.

[0128] In one embodiment of the present invention, the expansion response unit 603 is also used to determine whether there is a non-expanded level greater than the minimum expansion level under the target shrink node; if so, the hidden nodes on the non-expanded level greater than the minimum expansion level are changed from under the target shrink node to under the corresponding parent node.

[0129] In one embodiment of the present invention, please refer to Figure 8 , the hidden node expansion device also includes:

[0130] The shrink response unit 605 is used to, when receiving a shrink instruction for a target expanded node, traverse the nodes in the expanded state among the descendant nodes of the target expanded node one by one with the target expanded node as the starting point; if a descendant node in the shrunk state is traversed, stop traversing the child nodes of the descendant node; if a descendant node in the shrunk state is not traversed, stop traversing until a descendant node that does not include a child node is traversed; and hide the descendant nodes that do not include a shrunk state under the target expanded node.

[0131] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on a hidden node deployment device. In other embodiments of the present invention, a hidden node deployment device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0132] The information interaction, execution process and other contents between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention. For the specific contents, please refer to the description in the embodiment of the method of the present invention, and no further description is given here.

[0133] An embodiment of the present invention further provides a computing device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, a hidden node expansion method in any embodiment of the present invention is implemented.

[0134] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor executes a hidden node expansion method in any embodiment of the present invention.

[0135] Specifically, a system or device equipped with a storage medium can be provided, on which software program code that implements the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program code stored in the storage medium.

[0136] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0137] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.

[0138] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0139] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0140] Each embodiment of the present invention has at least the following beneficial effects:

[0141] 1. In one embodiment of the present invention, the maximum level to which the target shrink node can be expanded is determined through the attribute information of the target shrink node, so as to respond to the expansion initiation instruction. When the expansion operation instruction for the target shrink node is received after the response is completed, the expansion level that does not exceed the maximum level for the target shrink node is determined, and then the hidden nodes on the expansion level under the target shrink node are expanded. It can be seen that this solution can specify the required expansion level according to the needs, and when expanding, only the hidden nodes on the expansion level are expanded, and other hidden nodes will not be expanded. It has high flexibility and controllability, and improves the user experience.

[0142] 2. In one embodiment of the present invention, the level of the node is determined by assigning weights. The smaller the weight, the lowest level, that is, the leaf node is the node of the lowest level. The largest weight indicates that the node has the highest level in the connected subgraph. Therefore, the node with the highest level is determined as the root node, so that the root node can be accurately found by using the weight assignment method.

[0143] 3. In one embodiment of the present invention, in order to obtain the attribute information of the target contraction node, it is necessary to know which connected subgraph the target contraction node belongs to, and then establish the attribute information of the node for the connected subgraph to which it belongs, so as to ensure the accuracy of the attribute information in the process of establishing the attribute information, and then quickly determine the corresponding attribute information based on the unique node identifier of the target contraction node.

[0144] 4. In one embodiment of the present invention, the level depth can be input according to demand, and then the hidden nodes from the first level of the descendants of the target contracted node to the level depth are expanded, so that the required expansion level can be flexibly selected according to user needs, and then the nodes on the corresponding expansion level can be controlled to expand, thereby improving the user experience.

[0145] 5. In one embodiment of the present invention, the desired expansion level can be selected more flexibly, and the expansion levels can be continuous or discontinuous, and can be one expansion level or multiple expansion levels, thereby meeting more user needs.

[0146] It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical factors in the process, method, article or device including the elements.

[0147] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.

[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A hidden node expansion method, characterized in that: include: When receiving an expansion initiation instruction for a target shrink node in the point-line relationship graph, acquiring attribute information of the target shrink node; Determine the maximum level at which the target contracted node can be expanded according to the attribute information, and respond to the expansion initiation instruction according to the maximum level; receiving an expansion operation instruction for the target contraction node, and determining, according to the expansion operation instruction, an expansion level that does not exceed the maximum level required to expand the target contraction node; Expand the hidden nodes on the expansion level under the target shrinking node according to the attribute information of the target shrinking node; Before acquiring the attribute information of the target contraction node, the method further includes: determining a first set of connected subgraphs contained in the point-line relationship graph; establishing attribute information of nodes for each connected subgraph in the first set; the attribute information includes at least one of a node unique identifier, a parent node attribute, a child node attribute, a node state, a hierarchical depth of a descendant node, and a position relative to a parent node; The step of determining the maximum level at which the target contracted node can be expanded according to the attribute information includes: determining the level depth of the descendant nodes in the attribute information as the maximum level; The expansion operation instruction carries at least one expansion level required to be expanded; and the at least one expansion level required to be expanded includes any level not exceeding the maximum level.

2. The method according to claim 1, characterized in that The establishment method of the attribute information of each node in the connected subgraph includes: Determine the root node in the connected subgraph; Starting from the root node of the connected subgraph, the parent-child relationship between each node in the connected subgraph and its directly connected node is determined one by one, and recorded in the parent node attribute and child node attribute of the corresponding node.

3. The method according to claim 1, characterized in that The expansion operation instruction carries the required expansion level depth; The step of determining, according to the expansion operation instruction, an expansion level that does not exceed the maximum level required to expand the target contraction node includes: Determine whether the required expanded level depth is not greater than the maximum level; If yes, determining a level that is not greater than the required expanded level depth as the expanded level; If not, a level not greater than the maximum level is determined as the expanded level.

4. The method according to claim 3, characterized in that: After expanding the hidden nodes on the expansion level under the target contraction node, the method further includes: Determine whether there is a non-expanded level greater than the minimum expanded level under the target contraction node; If so, the hidden node on the non-expanded level greater than the minimum expanded level is changed from under the target contraction node to under the corresponding parent node.

5. The method according to claim 1, characterized in that Also includes: When a shrink instruction for a target expanded node is received, the nodes in the expanded state among the descendant nodes of the target expanded node are traversed one by one starting from the target expanded node; If the traversal reaches a descendant node in a contracted state, the traversal of the child nodes of the descendant node is stopped; if the traversal does not reach a descendant node in a contracted state, the traversal continues until a descendant node that does not include a child node is reached; The descendant nodes that are traversed but do not include the collapsed state are hidden under the target expanded node.

6. A hidden node expansion device, characterized in that: include: An attribute information acquisition unit, configured to acquire attribute information of a target shrink node in a point-line relationship graph when receiving an expansion initiation instruction for the target shrink node; a maximum level determination unit, configured to determine a maximum level at which the target contracted node can be expanded according to the attribute information, and respond to the expansion initiation instruction according to the maximum level; an expansion response unit, configured to receive an expansion operation instruction for the target contraction node, and determine an expansion level not exceeding the maximum level required to be expanded for the target contraction node according to the expansion operation instruction; and expanding the hidden nodes on the expansion level under the target shrinking node according to the attribute information of the target shrinking node; An attribute establishment unit, used to determine a first set of connected subgraphs contained in the point-line relationship graph; and establish attribute information of nodes for each connected subgraph in the first set; the attribute information includes at least one of a node unique identifier, a parent node attribute, a child node attribute, a node state, a hierarchical depth of a descendant node, and a position relative to a parent node; The maximum level determination unit is specifically used to determine the level depth of the descendant node in the attribute information as the maximum level; The expansion operation instruction carries at least one expansion level required to be expanded; and the at least one expansion level required to be expanded includes any level not exceeding the maximum level.

7. The device according to claim 6, characterized in that The attribute establishment unit establishes the attribute information of each node in the connected subgraph in the following manner: determine the root node in the connected subgraph; starting from the root node of the connected subgraph, determine the parent-child relationship between each node in the connected subgraph and its directly connected node one by one, and record it in the parent node attribute and child node attribute of the corresponding node.

8. The device according to claim 6, characterized in that The expansion operation instruction carries the required expansion level depth; The expansion response unit is specifically used to determine whether the required expansion level depth is not greater than the maximum level; if so, determine the level not greater than the required expansion level depth as the expansion level; if not, determine the level not greater than the maximum level as the expansion level.

9. The device according to claim 8, characterized in that The expansion response unit is also used to determine whether there is a non-expanded level greater than the minimum expansion level under the target shrink node; if so, the hidden nodes on the non-expanded level greater than the minimum expansion level are changed from under the target shrink node to under the corresponding parent node.

10. The device according to claim 6, characterized in that Also includes: A contraction response unit, configured to, when receiving a contraction instruction for a target expanded node, traverse the nodes in the expanded state one by one among the descendant nodes of the target expanded node starting from the target expanded node; If the traversal reaches a descendant node in a contracted state, the traversal of the child nodes of the descendant node is stopped; if the traversal does not reach a descendant node in a contracted state, the traversal continues until a descendant node that does not include a child node is reached; The descendant nodes that are traversed but do not include the collapsed state are hidden under the target expanded node.

11. A computing device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

12. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Android platform based realization method for multi-level tree menu

    CN105630306A

  • Tree-form data structure display method and device

    CN105786829A