Tree structure display method and device based on virtual nodes, electronic equipment, storage medium and program product
By only calling other data nodes except the virtual node child nodes in the tree structure display method, the problem of low efficiency in the existing technology is solved, efficient tree structure display is realized, and user experience is improved.
Patent Information
- Application Number
- CN202411603406.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-03-04
AI Technical Summary
When displaying a tree structure, the prior art requires retrieval and display of all nodes, resulting in large amount of data and low efficiency, which affects the user experience.
A tree structure display method based on virtual nodes is used to retrieve only other data nodes other than the child nodes of the virtual node and display them.
By reducing the amount of data retrieved and displayed, the efficiency of tree structure display is improved and the user experience is improved.
Smart Images

Figure CN119557484A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the financial field or other fields, and in particular to a tree structure display method, device, electronic device, storage medium and program product based on virtual nodes. Background Art
[0002] The tree structure can be applied in a variety of scenarios (such as subject codes, electronic products, etc.), so it is necessary to display the tree structure. The tree structure includes multiple nodes.
[0003] In the prior art, the tree structure is displayed by calling all the nodes.
[0004] However, the above method has low efficiency due to the large amount of data retrieved and displayed. Summary of the invention
[0005] The embodiments of the present application provide a tree structure display method, device, electronic device, storage medium and program product based on virtual nodes, so as to achieve the effect of high efficiency in retrieving and displaying the tree structure.
[0006] In a first aspect, an embodiment of the present application provides a tree structure display method based on virtual nodes, comprising:
[0007] Receive a display request sent by a client; wherein the display request indicates a tree structure to be displayed; the tree structure includes a plurality of data nodes; the data node has a node type and a hierarchy; the node type includes a virtual node; the virtual node has child nodes;
[0008] In the tree structure, other data nodes except the child nodes of the virtual node are retrieved; and the retrieved other data nodes are displayed.
[0009] In a possible implementation, in the tree structure, other data nodes except the child nodes of the virtual node are retrieved; and the retrieved other data nodes are displayed, including:
[0010] In the tree structure, other data nodes belonging to the preset level except the child nodes of the virtual node are retrieved; and the retrieved other data nodes belonging to the preset level are displayed.
[0011] In a possible implementation, the method further includes:
[0012] Receiving a virtual node display request sent by a client; wherein the virtual node display request indicates a virtual node to be displayed;
[0013] The data node belonging to the virtual node to be displayed is retrieved; and the retrieved data node is displayed.
[0014] In a possible implementation, retrieving a data node belonging to the virtual node to be displayed; and displaying the retrieved data node includes:
[0015] Retrieving the child nodes belonging to the virtual node to be displayed; and displaying the retrieved child nodes.
[0016] In a possible implementation, the method further includes:
[0017] A display level request sent by a client is received, wherein the display level request indicates a level to be displayed; a data node of the level to be displayed is retrieved; and the retrieved data node is displayed.
[0018] In a possible implementation, the method further includes:
[0019] Receiving a node type modification instruction sent by a client, wherein the node type modification instruction indicates a data node of a type to be modified and a first modification method;
[0020] According to the first modification manner, the node type of the data node of the type to be modified is modified.
[0021] In a possible implementation manner, the data node further has attribute information, and the method further includes:
[0022] Receive a display attribute request sent by a client; wherein the display attribute request indicates a data node of a property to be displayed; retrieve attribute information of the data node of the property to be displayed; and display the retrieved attribute information;
[0023] receiving a modification instruction sent by a client, wherein the modification instruction indicates a data node to be modified and a second modification method; and modifying the data node to be modified according to the second modification method;
[0024] Before receiving the display request sent by the client, the method further includes: receiving data nodes, and creating a tree structure according to the data nodes.
[0025] In a second aspect, an embodiment of the present application provides a tree structure display device based on virtual nodes, comprising:
[0026] A receiving module, configured to receive a display request sent by a client; wherein the display request indicates a tree structure to be displayed; the tree structure includes a plurality of data nodes; the data nodes have a node type and a hierarchy; the node type includes a virtual node; the virtual node has child nodes;
[0027] A calling module, used for calling other data nodes except the child nodes of the virtual node in the tree structure;
[0028] The display module is used to display other retrieved data nodes.
[0029] In a possible implementation, the calling module is specifically used to call other data nodes belonging to the preset level except the child nodes of the virtual node in the tree structure; the display module is specifically used to display the called other data nodes belonging to the preset level.
[0030] In a possible implementation manner, the device is further used for:
[0031] Receiving a virtual node display request sent by a client; wherein the virtual node display request indicates a virtual node to be displayed;
[0032] The data node belonging to the virtual node to be displayed is retrieved; and the retrieved data node is displayed.
[0033] In a possible implementation manner, the “retrieving a data node belonging to the virtual node to be displayed; and displaying the retrieved data node” in the device is specifically used for:
[0034] Retrieving the child nodes belonging to the virtual node to be displayed; and displaying the retrieved child nodes.
[0035] In a possible implementation manner, the device is further used for:
[0036] A display level request sent by a client is received, wherein the display level request indicates a level to be displayed; a data node of the level to be displayed is retrieved; and the retrieved data node is displayed.
[0037] In a possible implementation manner, the device is further used for:
[0038] Receiving a node type modification instruction sent by a client, wherein the node type modification instruction indicates a data node of a type to be modified and a first modification method;
[0039] According to the first modification manner, the node type of the data node of the type to be modified is modified.
[0040] In a possible implementation manner, the data node further has attribute information.
[0041] In a possible implementation manner, the device is further used for:
[0042] Receive a display attribute request sent by a client; wherein the display attribute request indicates a data node of a property to be displayed; retrieve attribute information of the data node of the property to be displayed; and display the retrieved attribute information;
[0043] A modification instruction sent by a client is received, wherein the modification instruction indicates a data node to be modified and a second modification method; and the data node to be modified is modified according to the second modification method.
[0044] In a possible implementation manner, before the receiving module, the device is further used to: receive data nodes, and create a tree structure according to the data nodes.
[0045] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0046] The memory stores computer-executable instructions;
[0047] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.
[0048] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.
[0049] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.
[0050] The tree structure display method, device, electronic device, storage medium and program product based on virtual nodes provided in the embodiment of the present application receive a display request sent by a client; wherein the display request indicates a tree structure to be displayed; the tree structure includes multiple data nodes; the data nodes have node types and levels; the node types include virtual nodes; the virtual nodes have child nodes. Then, in the tree structure to be displayed, other data nodes except the child nodes of the virtual nodes are retrieved; and the retrieved other data nodes are sent to the client for display.
[0051] Since only data nodes other than child nodes of the virtual node are retrieved and displayed when displaying the tree structure, the amount of data retrieved and displayed is reduced, thereby increasing the efficiency of retrieval and display and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0053] Figure 1 A flowchart of a tree structure display method based on virtual nodes provided in this application;
[0054] Figure 2 The tree structure provided for this application Figure 1 ;
[0055] Figure 3 The tree structure provided for this application Figure 2 ;
[0056] Figure 4 A flowchart of another tree structure display method based on virtual nodes provided in this application;
[0057] Figure 5 The tree structure provided for this application Figure 3 ;
[0058] Figure 6 The tree structure provided for this application Figure 4 ;
[0059] Figure 7 The tree structure provided for this application Figure 5 ;
[0060] Figure 8 The tree structure provided for this application Figure 6 ;
[0061] Fig. 9 A schematic diagram of the attribute information of data nodes in the tree structure provided by this application;
[0062] Fig.10 The tree structure provided for this application Figure 7 ;
[0063] Fig.11 A schematic diagram of the structure of a tree structure display device based on virtual nodes provided in this application;
[0064] Fig.12 A schematic diagram of the structure of the electronic device provided in this application.
[0065] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0066] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0067] Multi-level data (such as subject codes, electronic products, etc.) are often expressed using a tree structure, so the tree structure needs to be displayed. The tree structure includes multiple nodes.
[0068] In one example, the server can retrieve all nodes and send them to the client for display.
[0069] However, in the above method, since the data volume of all nodes is relatively large, the efficiency of server retrieval and client display is low, which affects the user experience.
[0070] The present application provides a tree structure display method, device, electronic device, storage medium and program product based on virtual nodes to solve the above technical problems.
[0071] It should be noted that the tree structure display method, device, electronic device, storage medium and program product based on virtual nodes provided in the present application can be used in the financial field, and can also be used in any field other than the financial field. The present application does not limit the application field of the tree structure display method, device, electronic device, storage medium and program product based on virtual nodes.
[0072] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0073] Figure 1 A flowchart of a tree structure display method based on virtual nodes provided in this application is shown in FIG. Figure 1 As shown, the method includes:
[0074] S101, receiving a display request sent by a client; wherein the display request indicates a tree structure to be displayed; the tree structure includes a plurality of data nodes; the data nodes have node types and levels; the node types include virtual nodes; and the virtual nodes have child nodes.
[0075] Exemplarily, the execution subject of this embodiment can be a server, a distributed system, a terminal device, other electronic devices / computer devices, or any other device or equipment that can implement the solution of this application, without limitation. Among them, the server can be an independent server, or a server cluster, such as but not limited to any form including a cloud server, a distributed server, a blockchain server, etc.
[0076] This embodiment is introduced with the execution subject being a server.
[0077] Exemplarily, after the user clicks on the client to display tree structure A and submits it, the client sends a display request to the server, where the display request may include an identifier of the tree structure A, which may be a globally unique ID (such as UUID), or a simple string, or a number, etc. This embodiment does not limit the expression form of the identifier, as long as the identifier can uniquely identify a tree structure.
[0078] The display request may also include identifiers of multiple tree structures. For example, after the user clicks on the client to display tree structure A and tree structure B and submits, the client sends a display request to the server, wherein the display request may include the identifier of tree structure A and the identifier of tree structure B.
[0079] The data nodes in the tree structure can be understood as the content to be displayed, such as subject codes or electronic products. Data nodes with child nodes can be set as virtual nodes, for example, data nodes with a large number of child nodes can be set as virtual nodes; leaf nodes cannot be set as virtual nodes. The level of a data node refers to the hierarchical position of the data node in the tree structure, and the level of a child node is equal to the level of its parent node plus 1.
[0080] For example, you can combine Figure 2 To understand, Figure 2 The tree structure provided for this application Figure 1 , assuming that the server receives an identifier indicating a tree structure A in a display request sent by the client, the tree structure A is as follows Figure 2 As shown, the tree structure A includes but is not limited to Figure 2As shown in the figure: the root data node C of level 0 (the level may also be 1, and the present embodiment is described with the root data node of level 0); the child nodes of the root data node C are the first-level data node C1, the first-level data node C2, and the first-level data node C3 of level 1; the child nodes of the first-level data node C1 are the second-level data node C11, the second-level data node C12, and the second-level data node C13 of level 2; wherein the second-level data node C12 is a virtual node in the tree structure A;
[0081] The child nodes of the second-level data node C11 are the third-level data nodes C111 and C112 of level 3; the child nodes of the second-level data node C12 are the third-level data nodes C121 and C122 of level 3; the child nodes of the third-level data node C121 are the fourth-level data nodes C1211 and C1212 of level 4.
[0082] S102: In the tree structure, retrieve other data nodes except the child nodes of the virtual node; and display the retrieved other data nodes.
[0083] Exemplarily, after receiving the display request sent by the client, the server may retrieve other data nodes except the child nodes of the virtual node in the tree structure indicated by the display request; and send the retrieved other data nodes to the client for display.
[0084] In one example, still referring to the example in S101, after the server receives the display request sent by the client, it can Figure 2 In the tree structure A, other data nodes except the child nodes (third-level data node C121 and third-level data node C122) of the virtual node (second-level data node C12) are retrieved; and the retrieved other data nodes are sent to the client for display.
[0085] The client's display results are as follows Figure 3 As shown, Figure 3 The tree structure provided for this application Figure 2 , Figure 3 The display results are Figure 2 On the basis of, the third-level data node C121, the third-level data node C122, the fourth-level data node C1211, and the fourth-level data node C1212 are removed. Figure 3 Description of other data nodes in Figure 2 The same as the description in , so it will not be repeated here. When the client displays the tree structure, the virtual node can be marked, such as Figure 3As shown, for example, an arrow shape is marked on the right side of the virtual node (secondary data node C12), and other forms of identification can also be used, such as the word "virtual", etc. This embodiment does not limit the identification form of the virtual node, as long as the data node can be identified as a virtual node.
[0086] It is worth noting that since the third-level data node C121 is not called, the child nodes of the third-level data node C121, that is, the fourth-level data node C1211 and the fourth-level data node C1212 will not be called. There can also be multiple virtual nodes, and the implementation method of displaying each virtual node is similar to the implementation method of displaying the second-level data node C12 introduced above, which will not be repeated here. If there are multiple tree structures to be displayed, the implementation method of displaying each tree structure is similar to the implementation method of displaying the tree structure A introduced above, which will not be repeated here.
[0087] The tree structure display method based on virtual nodes provided in the embodiment of the present application receives a display request sent by a client; wherein the display request indicates a tree structure to be displayed; the tree structure includes multiple data nodes; the data nodes have node types and levels; the node types include virtual nodes; the virtual nodes have child nodes. Then, in the tree structure to be displayed, other data nodes except the child nodes of the virtual nodes are retrieved; and the retrieved other data nodes are sent to the client for display.
[0088] Since only data nodes other than child nodes of the virtual node are retrieved and displayed when displaying the tree structure, the amount of data retrieved and displayed is reduced, thereby increasing the efficiency of retrieval and display and improving user experience.
[0089] Figure 4 A flowchart of another tree structure display method based on virtual nodes provided in this application is shown in FIG. Figure 4 As shown, in this embodiment Figure 1 Based on the embodiment, a tree structure display method based on virtual nodes is described in detail, and the method includes:
[0090] S401, receiving data nodes, and creating a tree structure according to the data nodes.
[0091] Exemplarily, the execution subject of this embodiment can be a server, a distributed system, a terminal device, other electronic devices / computer devices, or any other device or equipment that can implement the solution of this application, without limitation. Among them, the server can be an independent server, or a server cluster, such as but not limited to any form including a cloud server, a distributed server, a blockchain server, etc.
[0092] This embodiment is introduced with the execution subject being a server.
[0093] Exemplarily, the data node received by the server may be, for example, a data node for which a tree structure has not been generated, or a data node for which a tree structure has been generated.
[0094] In one example, if the data node received by the server is a data node that has not generated a tree structure, the server can create a tree structure based on the database according to each data node, as well as the node type (including virtual nodes), hierarchy, child nodes, and attribute information of the data node. Among them, the data node and the node type and hierarchy of the data node have been introduced in step S101 and will not be repeated here. The attribute information of the data node may, for example, include one or more attributes of the data node, and the number of attributes included in the attribute information of different data nodes may be the same or different; for example, if the data node is an account code, the attribute information of the account code may include but is not limited to account code, account name, account nature, profit and loss type, element ID, element name, data node ID, parent node ID, securities code source, etc.
[0095] In another example, if the data node received by the server is a data node that has already generated a tree structure, the server can copy all or part of the content in the tree structure based on the database to obtain a tree structure with virtual nodes. During the copying process, the content in the original tree structure can also be adjusted, such as adding virtual nodes, adjusting the name of the original data node, the attribute form of the original data node, etc.
[0096] The database for creating the tree structure may be, for example, MySQL, PostgreSQL, SQLite, etc. This embodiment does not limit the database for creating the tree structure.
[0097] It is worth noting that one or more tree structures can be created at the same time. The implementation method for creating each tree structure can adopt the implementation method of the first example or the second example introduced above. The specific implementation method is detailed in the introduction of the above two examples and will not be repeated here.
[0098] S402, receiving a display request sent by a client; wherein the display request indicates a tree structure to be displayed; the tree structure includes a plurality of data nodes; the data nodes have node types and levels; the node types include virtual nodes; and the virtual nodes have child nodes.
[0099] Exemplarily, the implementation of step S402 is similar to that of step S101. For a detailed description, please refer to the description of step S101, which will not be repeated here.
[0100] S403 . In the tree structure, retrieve other data nodes belonging to the preset level except the child nodes of the virtual node; and display the retrieved other data nodes belonging to the preset level.
[0101] Exemplarily, step S403 can be understood as further reducing the retrieved data nodes on the basis of step S102. Specifically, after the server receives the display request sent by the client, it can retrieve other data nodes belonging to the preset level except the child nodes of the virtual node in the tree structure indicated by the display request; and send the retrieved other data nodes belonging to the preset level to the client for display. Among them, the level of the data node has been introduced in step S101 and will not be repeated here. The preset level can be understood as a pre-set level, assuming it is 2. The data nodes belonging to the preset level can be understood as data nodes up to the preset level, for example, or can be understood as lower-level nodes that do not include data nodes of the preset level.
[0102] In one example, still referring to the example in S101, after the server receives the display request sent by the client, it can Figure 2 In the tree structure A, call other data nodes (including but not limited to) belonging to level 2 except the child nodes (third-level data node C121 and third-level data node C122) of the virtual node (second-level data node C12). Figure 2 As shown in the figure: the root data node C of level 0; the first-level data nodes C1, C2, C3, etc. of level 1; the second-level data nodes C11, C12, C13, etc. of level 2); and the retrieved other data nodes belonging to level 2 are sent to the client for display.
[0103] The client's display results are as follows Figure 5 As shown, Figure 5 The tree structure provided for this application Figure 3 , Figure 5 The display results are Figure 2 On the basis of, the third-level data nodes C121, the third-level data nodes C122, the fourth-level data nodes C1211, and the fourth-level data nodes C1212 are removed, and the third-level data nodes C111 and the third-level data nodes C112 of level 3 are removed. Figure 5 Description of other data nodes in Figure 2 The instructions are the same as in , and will not be repeated here. Figure 5 The arrow in is an identification that the secondary data node C12 is a virtual node. This identification has been introduced in step S102 and will not be repeated here.
[0104] S404: receiving a virtual node display request sent by the client, wherein the virtual node display request indicates a virtual node to be displayed, retrieving a data node belonging to the virtual node to be displayed, and displaying the retrieved data node.
[0105] In one example, a sub-node belonging to a virtual node to be displayed is retrieved, and the retrieved sub-node is displayed.
[0106] Exemplarily, after the client displays the tree structure, the user can click on the identifier of the virtual node in the tree structure on the client, and then the client sends a request to display the virtual node of the identifier to the server, and then the server retrieves the data node belonging to the virtual node of the identifier and sends the retrieved data node to the client for display. The data node belonging to the virtual node of the identifier can be, for example, a descendant node of the virtual node of the identifier, or a child node of the virtual node of the identifier.
[0107] In one example, you can combine Figure 2 , Figure 3 , Figure 6 , Figure 7 Still referring to the example in step S102, that is, Figure 2 The tree structure A is displayed on the client as follows: Figure 3 , after which the user can click on the client Figure 3 The client then sends a request to display the secondary data node C12 to the server.
[0108] Afterwards, the server calls Figure 3 The descendant nodes (third-level data node C121, fourth-level data node C1211, fourth-level data node C1212, and third-level data node C122) belonging to the second-level data node C12 are retrieved, and the retrieved data nodes are sent to the client for display. The display result is as follows Figure 6 As shown, Figure 6 The tree structure provided for this application Figure 4 , Figure 6 Description of each data node and Figure 2 The instructions are the same as in , and will not be repeated here. Figure 6 The arrow in indicates that the secondary data node C12 is a virtual node. Alternatively, the server retrieves the child nodes (third-level data node C121 and third-level data node C122) belonging to the secondary data node C12, and sends the retrieved data nodes to the client for display. The display result is as follows: Figure 7 As shown, Figure 7 The tree structure provided for this application Figure 5 , Figure 7Description of each data node and Figure 2 The instructions are the same as in , and will not be repeated here. Figure 7 The arrow in indicates that the secondary data node C12 is a virtual node.
[0109] It is worth noting that one or more virtual nodes can be displayed at the same time, and the implementation method of each virtual node display can be the same or different. Figure 6 The implementation method or Figure 7 For details on how to implement Figure 6 and Figure 7 The examples are not repeated here.
[0110] S405 , receiving a display level request sent by the client, wherein the display level request indicates a level to be displayed; retrieving a data node of the level to be displayed; and displaying the retrieved data node.
[0111] For example, after the client displays the tree structure, the user can also submit the level to be displayed on the client, where the level to be displayed can be understood as, for example, displaying up to the level to be displayed, and the child nodes of the data node of the level to be displayed are no longer displayed. Then, the client sends the level to be displayed to the server, and then the server retrieves the data nodes from the level of the root node to the level to be displayed, and sends the retrieved data nodes to the client for display.
[0112] In one example, you can combine Figure 2 , Figure 3 , Figure 8 Still referring to the example in step S102, that is, Figure 2 The tree structure A is displayed on the client as follows: Figure 3 Then, the user can submit the level to be displayed on the client, assuming it is level 1, and then, the server calls Figure 3 From the root node of level 0 to the data node of level 1 (including but not limited to Figure 2 As shown in the figure: the root data node C of level 0; the first-level data nodes C1, C2, C3, etc. of level 1), and the retrieved data nodes are sent to the client for display.
[0113] The client's display results are as follows Figure 8 As shown, Figure 8 The tree structure provided for this application Figure 6 , Figure 8 Description of each data node and Figure 2 The instructions are the same as in , and will not be repeated here.
[0114] S406: Receive a node type modification instruction sent by the client, wherein the node type modification instruction indicates a data node of a type to be modified and a first modification method. According to the first modification method, modify the node type of the data node of the type to be modified.
[0115] Exemplarily, the user can also submit the data node of the type to be modified and the first modification method on the client. Among them, the data node of the type to be modified can be understood as the data node whose node type is to be modified. The node type can include virtual nodes, entity nodes, or the node type can also include only virtual nodes, in which case all non-virtual nodes are considered to be entity nodes. The first modification method can be, for example, to modify the original virtual node into an entity node, or to modify the original entity node into a virtual node. Then, the client sends the data node of the type to be modified and the first modification method to the server, and then the server modifies the node type of the data node of the type to be modified according to the first modification method.
[0116] It is worth noting that step S406 can be implemented before or after displaying the tree structure. After step S406 is implemented, when the tree structure is displayed again, it will be displayed based on any implementation method in steps S401 to S405 according to the node type of the latest modified data node.
[0117] In one example, still referring to the example in step S102, that is, Figure 2 The tree structure A is displayed on the client as follows: Figure 3 , then, if the user submits the data node to be modified on the client side Figure 3 The first modification method is to modify the original virtual node into a physical node. Then, the client will modify the type of Figure 3 The secondary data node C12 in the virtual node and the modification method of changing the original virtual node to a physical node are sent to the server. Then, the server Figure 3 The node type of the secondary data node C12 in is changed from a virtual node to a physical node.
[0118] If step S102 is executed again at this time, due to Figure 2 The tree structure A in is full of entity nodes, so, Figure 2 It is the display result of the client.
[0119] S407, receiving a display attribute request sent by the client; wherein the display attribute request indicates a data node of an attribute to be displayed; retrieving attribute information of the data node of the attribute to be displayed; and displaying the retrieved attribute information.
[0120] Exemplarily, the user may also submit a data node of a property to be displayed on the client. The data node of a property to be displayed may be understood as a data node for which property information is to be viewed. Then, the client sends the data node of the property to be displayed to the server, and then the server retrieves the property information of the data node of the property to be displayed and sends it to the client for display. The property information of the data node has been introduced in step S401 and will not be repeated here.
[0121] It is worth noting that step S407 can be implemented after the tree structure is displayed in any implementation manner in steps S401 to S405.
[0122] In an example, referring to the example in step S405, assuming that the display result of the client is as follows Figure 8 As shown, after that, the user submits the data node of the attribute to be displayed on the client as the first-level data node C1, and then the client sends the first-level data node C1 of the attribute to be displayed to the server. Then, the server retrieves the attribute information of the first-level data node C1 and sends it to the client for display. The display result is as follows Fig. 9 As shown, Fig. 9 A schematic diagram of the attribute information of a data node in a tree structure provided in this application, in Fig. 9 In the property box 901 of the primary data node C1, the following information is displayed, including but not limited to: Fig. 9 Attribute information such as attribute D1 shown in FIG.
[0123] S408: Receive a modification instruction sent by the client, where the modification instruction indicates the data node to be modified and the second modification method; and modify the data node to be modified according to the second modification method.
[0124] Exemplarily, the user may also submit the data node to be modified and the second modification method on the client. The data node to be modified may be understood as a data node to be modified. The second modification method may be, for example, adding, modifying, or deleting. Then, the client sends the data node to be modified and the second modification method to the server, and then the server modifies the data node to be modified according to the second modification method.
[0125] It is worth noting that step S408 may be implemented before displaying the tree structure, or may be implemented after displaying the tree structure in any implementation manner in steps S401 to S405.
[0126] In one example, still referring to the example in step S102, that is, Figure 2 The tree structure A is displayed on the client as follows: Figure 3 , then, if the user submits the data node to be modified on the client Figure 3 The third-level data node C111 in the second modification method is deletion. Then, the client will Figure 3 The third-level data node C111 in the deletion and the modification method are sent to the server, and then the server Figure 3 The third-level data node C111 in the , and the modified content is sent to the client for display. The display result is as follows Fig.10 As shown, Fig.10 The tree structure provided for this application Figure 7 , Fig.10 Description of the data nodes in Figure 2 The instructions are the same as in the description, so I will not repeat them here; Fig.10 The arrow in indicates that the secondary data node C12 is a virtual node.
[0127] In another example, if step S408 is implemented before displaying the tree structure, the specific implementation is similar to that of the previous example, except that the modified content does not need to be sent to the client for display at the end.
[0128] The tree structure display method based on virtual nodes provided in the embodiment of the present application creates a tree structure with virtual nodes according to data nodes. Afterwards, if a display request sent by a client is received, wherein the display request indicates a tree structure to be displayed, other data nodes belonging to a preset level except the child nodes of the virtual node are retrieved in the tree structure; and the retrieved other data nodes belonging to the preset level are displayed. Since only other data nodes belonging to the preset level except the child nodes of the virtual node are displayed, the amount of data retrieved and displayed can be further reduced, thereby making the retrieval and display more efficient and improving the user experience.
[0129] By calling the data node belonging to the virtual node to be displayed and displaying the called data node, the data node of the virtual node can be viewed when needed. By calling the data node of the level to be displayed and displaying the called data node, it is convenient to view the data nodes in the tree structure according to different levels. By modifying the node type of the data node of the type to be modified according to the first modification method, the node type in the tree structure can be modified.
[0130] By retrieving the attribute information of the data node whose attribute is to be displayed and displaying the retrieved attribute information, the attribute information of the data node can be viewed when needed. By modifying the data node to be modified according to the second modification method, the data node in the tree structure can be modified.
[0131] Fig.11A schematic diagram of the structure of a tree structure display device based on virtual nodes provided in this application, such as Fig.11 As shown, the tree structure display device 110 based on virtual nodes provided in this embodiment includes:
[0132] The receiving module 1101 is used to receive a display request sent by a client; wherein the display request indicates a tree structure to be displayed; the tree structure includes a plurality of data nodes; the data node has a node type and a hierarchy; the node type includes a virtual node; the virtual node has child nodes;
[0133] The calling module 1102 is used to call other data nodes except the child nodes of the virtual node in the tree structure;
[0134] The display module 1103 is used to display other retrieved data nodes.
[0135] In a possible implementation, the retrieval module 1102 is specifically used to retrieve other data nodes belonging to a preset level except for the child nodes of the virtual node in the tree structure; the display module 1103 is specifically used to display the retrieved other data nodes belonging to the preset level.
[0136] In a possible implementation manner, the device 110 is further configured to:
[0137] receiving a virtual node display request sent by a client; wherein the virtual node display request indicates a virtual node to be displayed;
[0138] The data node belonging to the virtual node to be displayed is retrieved; and the retrieved data node is displayed.
[0139] In a possible implementation manner, the “retrieving a data node belonging to a virtual node to be displayed; and displaying the retrieved data node” in the device 110 is specifically used to:
[0140] Retrieve the child nodes belonging to the virtual node to be displayed; and display the retrieved child nodes.
[0141] In a possible implementation manner, the device 110 is further configured to:
[0142] A display level request sent by a client is received, wherein the display level request indicates a level to be displayed; a data node of the level to be displayed is retrieved; and the retrieved data node is displayed.
[0143] In a possible implementation manner, the device 110 is further configured to:
[0144] Receiving a node type modification instruction sent by a client, wherein the node type modification instruction indicates a data node of a type to be modified and a first modification method;
[0145] According to the first modification manner, the node type of the data node of the to-be-modified type is modified.
[0146] In a possible implementation manner, the data node further has attribute information.
[0147] In a possible implementation manner, the device 110 is further configured to:
[0148] Receive a display attribute request sent by a client; wherein the display attribute request indicates a data node of the attribute to be displayed; retrieve attribute information of the data node of the attribute to be displayed; and display the retrieved attribute information;
[0149] A modification instruction sent by a client is received, wherein the modification instruction indicates a data node to be modified and a second modification method; and the data node to be modified is modified according to the second modification method.
[0150] In a possible implementation, before receiving module 1101, device 110 is further configured to: receive data nodes, and create a tree structure according to the data nodes.
[0151] The tree structure display device based on virtual nodes provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.
[0152] Fig.12 This is a schematic diagram of the structure of the electronic device provided in this application. Fig.12 As shown, the electronic device 120 provided in this embodiment includes: at least one processor 1201 and a memory 1202. Optionally, the device 120 also includes a communication component 1203. The processor 1201, the memory 1202 and the communication component 1203 are connected via a bus 1204.
[0153] In a specific implementation process, at least one processor 1201 executes the computer-executable instructions stored in the memory 1202, so that at least one processor 1201 executes the above method.
[0154] The specific implementation process of the processor 1201 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0155] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0156] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0157] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0158] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0159] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0160] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0161] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0162] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0163] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0164] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0165] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0166] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
[0167] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A tree structure display method based on virtual nodes, characterized in that: The method comprises: Receive a display request sent by a client; wherein the display request indicates a tree structure to be displayed; the tree structure includes a plurality of data nodes; the data node has a node type and a hierarchy; the node type includes a virtual node; the virtual node has child nodes; In the tree structure, other data nodes except the child nodes of the virtual node are retrieved; and the retrieved other data nodes are displayed.
2. The method according to claim 1, characterized in that In the tree structure, call other data nodes except the child nodes of the virtual node; And display other retrieved data nodes, including: In the tree structure, other data nodes belonging to a preset level except the child nodes of the virtual node are retrieved; And display other data nodes belonging to the preset level.
3. The method according to claim 1, characterized in that The method further comprises: Receiving a virtual node display request sent by a client; wherein the virtual node display request indicates a virtual node to be displayed; The data node belonging to the virtual node to be displayed is retrieved; and the retrieved data node is displayed.
4. The method according to claim 3, characterized in that Retrieving the data node belonging to the virtual node to be displayed; And display the retrieved data nodes, including: Retrieving the child nodes belonging to the virtual node to be displayed; And display the retrieved child nodes.
5. The method according to claim 1, characterized in that The method further comprises: A display level request sent by a client is received, wherein the display level request indicates a level to be displayed; a data node of the level to be displayed is retrieved; and the retrieved data node is displayed.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Receiving a node type modification instruction sent by a client, wherein the node type modification instruction indicates a data node of a type to be modified and a first modification method; According to the first modification manner, the node type of the data node of the type to be modified is modified.
7. The method according to any one of claims 1 to 5, characterized in that The data node also has attribute information, and the method further includes: Receive a display attribute request sent by a client; wherein the display attribute request indicates a data node of a property to be displayed; retrieve attribute information of the data node of the property to be displayed; and display the retrieved attribute information; receiving a modification instruction sent by a client, wherein the modification instruction indicates a data node to be modified and a second modification method; and modifying the data node to be modified according to the second modification method; Before receiving the display request sent by the client, the method further includes: receiving data nodes, and creating a tree structure according to the data nodes.
8. A tree structure display device based on virtual nodes, characterized in that: The device comprises: A receiving module, configured to receive a display request sent by a client; wherein the display request indicates a tree structure to be displayed; the tree structure includes a plurality of data nodes; the data nodes have a node type and a hierarchy; the node type includes a virtual node; the virtual node has child nodes; A calling module, used for calling other data nodes except the child nodes of the virtual node in the tree structure; The display module is used to display other retrieved data nodes.
9. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
Tree structure display method and system
CN105488128A
Data visualization rendering method and device, computer equipment and storage medium
CN112650899A
Display list generation method and device, equipment and storage medium
CN118606341A