Tree structure data processing method, electronic device and storage medium

By using related fields to determine the selected data of parent nodes step by step in tree structure data processing, the problem of inaccurate display of associated data of parent nodes and child nodes in the lazy loading scenario of tree structure data is solved, and accurate display of data is achieved. .

CN114880041BInactive Publication Date: 2024-10-11BEIJING KUANGSHI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210417016.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-20
Publication Date
2024-10-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the lazy loading scenario of tree structure data, the associated data of parent nodes and child nodes is displayed inaccurately. Especially when the parent node is not expanded, the number of child nodes and parent node status cannot be accurately obtained, resulting in inaccurate display of selected data.

Method used

By responding to the selection request of the target node, the association field is used to determine the parent-child relationship of the target node, and the selected data of the parent node is determined step by step until the display data of the root node to ensure data accuracy.

Benefits of technology

It improves the accuracy of the selected data of the target node and each parent node and the display data of the root node, and solves the problem of inaccurate display of associated data of parent nodes and child nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114880041B_ABST
    Figure CN114880041B_ABST
Patent Text Reader

Abstract

The present application provides a method for processing tree-structured data, an electronic device, and a storage medium, the method comprising: in response to a selection request for a target node in the tree-structured data, determining the selected data corresponding to the target node according to an associated field of the target node, the associated field being used to characterize the parent-child relationship of the target node; determining the selected data corresponding to the parent node step by step according to the associated field of the target node and the selected data corresponding to the target node, until determining the display data corresponding to the root node of the tree-structured data. The present application can accurately obtain the parent-child relationship of the target node through the associated field, thereby improving the accuracy of the selected data of the target node and each parent node and the displayed data of the root node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data processing, and in particular to a method for processing tree-structured data, an electronic device, and a storage medium. Background Art

[0002] Tree-structured data is used extensively in business scenarios to select corresponding objects, such as selecting multiple devices under a department, selecting multiple users under a department, and so on.

[0003] Lazy loading of tree-structured data is a solution used in scenarios with large amounts of data. The lazy loading rule is to load the parent node first, load the child node set asynchronously after the parent node is expanded, and then display the full or half selected state of the parent node based on the number of selected child nodes under the parent node.

[0004] However, in lazy loading scenarios, when a parent node is selected, if the list of child nodes under the parent node is not loaded, the data associated with the parent node and child nodes will be inaccurately displayed. For example, when the parent node is not expanded, the list of child nodes under the parent node is not obtained, and the number of child node items under the parent node cannot be known, resulting in the inability to accurately display the number of selected child nodes; when a child node is selected, the parent node corresponding to the child node cannot be known, and the parent node cannot be selected and the status of the parent node cannot be accurately displayed. Summary of the invention

[0005] In view of the above problems, embodiments of the present application are proposed to provide a method for processing tree-structured data, an electronic device, and a storage medium that overcome the above problems or at least partially solve the above problems.

[0006] According to a first aspect of an embodiment of the present application, a method for processing tree structured data is provided, comprising:

[0007] In response to a request for selecting a target node in the tree structure data, determining the selected data corresponding to the target node according to an associated field of the target node, wherein the associated field is used to represent a parent-child association relationship of the target node;

[0008] According to the associated field of the target node and the selected data corresponding to the target node, the selected data corresponding to the parent node is determined level by level until the display data corresponding to the root node of the tree structure data is determined.

[0009] According to a second aspect of an embodiment of the present application, a tree structure data processing device is provided, comprising:

[0010] A selected data determination module, for responding to a selection request for a target node in the tree structure data, and determining the selected data corresponding to the target node according to an associated field of the target node, wherein the associated field is used to represent a parent-child association relationship of the target node;

[0011] The display data determination module is used to determine the selected data corresponding to the parent node step by step according to the associated field of the target node and the selected data corresponding to the target node, until the display data corresponding to the root node of the tree structure data is determined.

[0012] According to the third aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the method for processing tree structured data as described in the first aspect is implemented.

[0013] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for processing tree-structured data as described in the first aspect is implemented.

[0014] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising a computer program or computer instructions, wherein when the computer program or computer instructions are executed by a processor, the method for processing tree structured data described in the first aspect is implemented.

[0015] The tree-structured data processing method, electronic device and storage medium provided in the embodiments of the present application respond to a selection request for a target node in the tree-structured data, determine the selected data corresponding to the target node according to the associated field of the target node, and determine the selected data corresponding to the parent node step by step according to the associated field of the target node and the selected data corresponding to the target node, until the display data corresponding to the root node of the tree-structured data is determined. Since the parent-child association relationship of the target node can be accurately known through the associated field, the accuracy of the selected data of the target node and each parent node and the displayed data of the root node can be improved, thereby solving the problem of inaccurate display of the associated data of the parent node and the child node.

[0016] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the following detailed description of the preferred embodiment.The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application.

[0018] Figure 1 It is a flowchart of a method for processing tree structure data provided by an embodiment of the present application;

[0019] Figure 2 is an example diagram of tree structure data in an embodiment of the present application;

[0020] Figure 3 It is a structural block diagram of a tree structure data processing device provided in an embodiment of the present application;

[0021] Figure 4 It is a structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0023] In recent years, research on computer vision, deep learning, machine learning, image processing, image recognition and other technologies based on artificial intelligence has made important progress. Artificial Intelligence (AI) is an emerging science and technology that studies and develops theories, methods, technologies and application systems for simulating and extending human intelligence. Artificial intelligence is a comprehensive discipline involving many types of technologies such as chips, big data, cloud computing, the Internet of Things, distributed storage, deep learning, machine learning, neural networks, etc. Computer vision, as an important branch of artificial intelligence, specifically allows machines to recognize the world. Computer vision technology usually includes face recognition, liveness detection, fingerprint recognition and anti-counterfeiting verification, biometric recognition, face detection, pedestrian detection, target detection, pedestrian recognition, image processing, image recognition, image semantic understanding, image retrieval, text recognition, video processing, video content recognition, 3D reconstruction, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), computational photography, robot navigation and positioning and other technologies. With the research and progress of artificial intelligence technology, this technology has been applied in many fields, such as security control, urban management, traffic management, building management, park management, face access, face attendance, logistics management, warehouse management, robots, intelligent marketing, computational photography, mobile phone imaging, cloud services, smart homes, wearable devices, unmanned driving, automatic driving, smart medical care, face payment, face unlocking, fingerprint unlocking, identity verification, smart screens, smart TVs, cameras, mobile Internet, live webcasting, beauty, beauty, medical beauty, intelligent temperature measurement, etc. The above technical fields involve the processing of tree-structured data. The embodiment of the present application provides a method for processing tree-structured data, which can solve the problem of inaccurate display of parent node and child node associated data. The specific solution is as follows:

[0024] Figure 1 is a flowchart of a method for processing tree structure data provided by an embodiment of the present application, such as Figure 1 As shown, the method may include:

[0025] Step 101, in response to a request to select a target node in tree structure data, determining selected data corresponding to the target node according to an associated field of the target node, wherein the associated field is used to represent a parent-child association relationship of the target node.

[0026] The selected data may include the selected state and / or the selected number of subordinate nodes. The subordinate nodes may be child nodes, grandchild nodes, or lower-level nodes of the current node. The associated field includes a child node number field and / or a parent node identification field, and the value of the child node number field may include the number of child nodes and the number of grandchild nodes.

[0027] When a request to select a target node in tree structure data is received, it can be determined that the selection state of the target node is a fully selected state; based on the associated field of the target node, the number of child nodes and grandchild nodes of the target node can be obtained, and then the number of child nodes or grandchild nodes of the target node can be determined as the selected number of subordinate nodes corresponding to the target node.

[0028] Step 102, according to the associated field of the target node and the selected data corresponding to the target node, the selected data corresponding to the parent node is determined level by level until the display data corresponding to the root node of the tree structure data is determined.

[0029] According to the parent node identification field in the associated field of the target node, the parent node corresponding to the target node can be determined, and then the number of child nodes of the parent node can be determined based on the number of child nodes field of the parent node, and then the selected data corresponding to the target node and the selected data of other child nodes under the parent node can be determined. Then, the selected data corresponding to the parent node of the parent node is determined step by step in the same way as that of determining the selected data corresponding to the parent node, until the display data corresponding to the root node of the tree structure data is determined. Among them, the display data corresponding to the root node includes the selected number of subordinate nodes and / or the selected state of the root node.

[0030] When the parent node in the tree structure data is in an unexpanded state, the selected data corresponding to the parent node associated with the target node can also be accurately determined based on the associated field of the target node.

[0031] In one embodiment of the present application, the display data includes the selected state and the number of selected subordinate nodes;

[0032] According to the associated field of the target node and the selected data corresponding to the target node, the selected data corresponding to the parent node is determined step by step until the display data corresponding to the root node of the tree structure data is determined, including: determining the parent node corresponding to the target node according to the associated field of the target node; determining the selected number of subordinate nodes corresponding to the parent node according to the selected number of subordinate nodes corresponding to the target node and the selected number of subordinate nodes of other child nodes corresponding to the parent node, and, according to the selected number of subordinate nodes corresponding to the parent node and the associated field of the parent node, determining the selected number of subordinate nodes corresponding to the parent node step by step until the selected number of subordinate nodes corresponding to the root node of the tree structure data is determined; wherein the other child nodes are child nodes under the parent node except the target node;

[0033] The selected state of the parent node is determined based on the selected state of the target node and the selected states of other child nodes corresponding to the parent node, and the selected state corresponding to the parent node is determined step by step based on the selected state of the parent node and the associated field of the parent node until the selected state corresponding to the root node of the tree structure data is determined.

[0034] In the case where the display data only includes the selected number of subordinate nodes, the selected data corresponding to the parent node is determined level by level according to the associated field of the target node and the selected data corresponding to the target node, until the display data corresponding to the root node of the tree structure data is determined, including: determining the parent node corresponding to the target node according to the associated field of the target node; determining the selected number of subordinate nodes corresponding to the parent node according to the selected number of subordinate nodes corresponding to the target node and the selected number of subordinate nodes of other child nodes corresponding to the parent node, and determining the selected number of subordinate nodes corresponding to the parent node according to the selected number of subordinate nodes corresponding to the parent node and the associated field of the parent node, until the selected number of subordinate nodes corresponding to the root node of the tree structure data is determined; wherein the other child nodes are child nodes under the parent node except the target node.

[0035] In the case where the display data only includes the selected state of the root node, the selected data corresponding to the parent node is determined level by level based on the associated field of the target node and the selected data corresponding to the target node, until the display data corresponding to the root node of the tree structure data is determined, including: determining the selected state of the parent node based on the selected state of the target node and the selected states of other child nodes corresponding to the parent node, and, determining the selected state corresponding to the parent node level by level based on the selected state of the parent node and the associated field of the parent node, until the selected state corresponding to the root node of the tree structure data is determined.

[0036] According to the parent node identification field in the associated field of the target node, the parent node corresponding to the target node can be determined, and then the number of child nodes of the parent node can be determined based on the number of child nodes field of the parent node. Then, based on the selected number of subordinate nodes of the target node and the selected number of subordinate nodes of other child nodes under the parent node, the selected number of subordinate nodes corresponding to the parent node can be determined as the sum of the selected number of subordinate nodes corresponding to each child node. Then, the selected number of subordinate nodes corresponding to each parent node of the parent node is determined step by step in the same way as that of determining the selected number of subordinate nodes corresponding to the parent node, until the selected number of subordinate nodes corresponding to the root node of the tree structure data is determined.

[0037] After determining the number of child nodes of the parent node, the number of selected child nodes corresponding to the parent node is determined based on the selected state corresponding to the target node and the selected states of other child nodes under the parent node. If the number of selected child nodes corresponding to the parent node is less than the number of child nodes of the parent node, the selected state corresponding to the parent node is determined to be a half-selected state. If the number of selected child nodes of the parent node is equal to the number of child nodes of the parent node, the selected state corresponding to the parent node is determined to be a fully selected state. Then, the selected data corresponding to each parent node of the parent node is determined step by step in the same way as that for determining the selected state corresponding to the parent node, until the display data corresponding to the root node of the tree structure data is determined. Among them, the fully selected state of a node means that all the child nodes under the node are in the selected state, and the half-selected state of a node means that not all the child nodes under the node are in the selected state, for example, some child nodes are in the selected state, and some child nodes are in the unselected state or half-selected state.

[0038] By determining the selected number of subordinate nodes corresponding to the parent node step by step according to the associated fields of the target node and the selected number of subordinate nodes, until the selected number corresponding to the root node of the tree structure data is determined, and by determining the selected state corresponding to the parent node step by step according to the associated fields of the target node and the selected state of the target node, until the selected state corresponding to the root node of the tree structure data is determined, the selected data of nodes at each level and the display data of the root node are determined more accurately.

[0039] The method for processing tree-structured data provided in the embodiment of the present application responds to a selection request for a target node in the tree-structured data, determines the selected data corresponding to the target node according to the associated field of the target node, determines the selected data corresponding to the parent node step by step according to the associated field of the target node and the selected data corresponding to the target node, until the selected data corresponding to the root node of the tree-structured data is determined. Since the parent-child association relationship of the target node can be accurately known through the associated field, the accuracy of the selected data of the target node and each parent node and the displayed data of the root node can be improved, thereby solving the problem of inaccurate display of the associated data of the parent node and the child node.

[0040] In one embodiment of the present application, the selection request is triggered by clicking; the target node is in an unexpanded state;

[0041] In response to a selection request for a target node in the tree structure data, the selected data corresponding to the target node is determined according to the associated field of the target node, including: in response to the selection request for the target node in the tree structure data, the selected state of the target node is determined to be a fully selected state, and the value of the child node number field of the target node is determined as the selected number of subordinate nodes corresponding to the target node.

[0042] When the target node is in an unexpanded state, if the check box of the target node is selected, a request to select the target node by clicking is received. At this time, the selected state of the target node is determined to be a fully selected state, and the value of the number of child nodes field (count field) of the target node is obtained, and the value is determined as the selected number of subordinate nodes corresponding to the target node.

[0043] When determining the selected data of the parent node, the selected status of the target node's peer nodes and the selected number of subordinate nodes are counted at the same time, and feedback is given to the parent until the selected status of the root node and the selected number of subordinate nodes are determined. The selected status of the corresponding node can be displayed in the check box of each node, and the selected number of subordinate nodes corresponding to the root node can be displayed. For example, the selected number of subordinate nodes corresponding to the root node can be displayed on the unselected number.

[0044] When the target node is in an unexpanded state, if the child node list of the target node is in an unloaded state, if a request to select the target node is received by clicking, the selected number of subordinate nodes corresponding to the target node can still be determined based on the child node number field of the target node, which solves the problem in the prior art that the selected number of subordinate nodes of the target node cannot be accurately displayed when the child node list of the target node is not loaded.

[0045] In another embodiment of the present application, the selection request is triggered by a search method;

[0046] According to the associated fields of the target node and the selected data corresponding to the target node, the selected data corresponding to the parent node is determined step by step until the display data corresponding to the root node of the tree structure data is determined, including: determining the parent node corresponding to the target node according to the parent node identification field of the target node; determining the selected data corresponding to the parent node according to the associated fields corresponding to the parent node and the search results; wherein the search results include node information that meets the search conditions; according to the selected data of the parent node, determining the selected data corresponding to the parent node step by step until the display data corresponding to the root node of the tree structure data is determined.

[0047] In a fuzzy query scenario, when searching based on the search conditions in the search box to obtain search results, it is determined that a selection request for each target node in the search results is received. At this time, the parent node of each target node is in an unexpanded state, that is, the child node list of the parent node is not loaded. At this time, for each target node in the search results, the value of the parent node identification field of the target node can be obtained to obtain the parent node corresponding to the target node, and based on the associated fields corresponding to the parent node and the search results, the selected data corresponding to the parent node can be determined. For example, the value of the child node quantity field corresponding to the parent node can be obtained, and the value of the child node quantity field is compared with the value of the parent node identification field in the search results as the number of nodes of the parent node, so as to determine the selected data corresponding to the parent node; after determining the selected data of the parent node, based on the determination method of the selected data corresponding to the parent node, the selected data corresponding to each parent node of the parent node is determined step by step until the display data corresponding to the root node of the tree structure data is determined.

[0048] When the selection request is triggered by a search method, the parent node of the target node is in an unexpanded state and the child node list of the parent node is not loaded. The parent node of the target node can be determined based on the parent node identification field of the target node, and then the selected data corresponding to the parent node can be accurately determined based on the associated fields of the parent node and the search results, which solves the problem in the prior art that the parent node and its selected data cannot be accurately determined when the target node is selected by a search method.

[0049] On the basis of the above technical solution, the selected data of the parent node includes the selected number of subordinate nodes corresponding to the parent node;

[0050] Determine the selected data corresponding to the parent node according to the associated fields corresponding to the parent node and the search results, including: determining the number of nodes in the search results whose parent nodes are the parent nodes; and determining the number of nodes as the selected number of subordinate nodes corresponding to the parent node.

[0051] According to the parent node identification field of each node in the search results, the number of nodes whose parent node identification field value is the identification of the parent node is determined, that is, the number of nodes in the search results whose parent node is the parent node, and this number of nodes is the selected number of subordinate nodes corresponding to the parent node. The selected number of subordinate nodes corresponding to the parent node can be accurately determined through the associated field of each node in the search results.

[0052] Based on the above technical solution, the selected data of the parent node also includes the selected state of the parent node;

[0053] Determining the selected data corresponding to the parent node according to the associated fields corresponding to the parent node and the search results, also includes: determining the value of the child node quantity field corresponding to the parent node according to the associated fields corresponding to the parent node; if the number of nodes is less than the value of the child node quantity field, determining that the selected state of the parent node is a half-selected state; if the number of nodes is equal to the value of the child node quantity field, determining that the selected state of the parent node is a fully selected state.

[0054] Get the value of the subnode quantity field from the associated field corresponding to the parent node, compare the value of the node quantity field with the value of the subnode quantity field, if the node quantity is less than the value of the subnode quantity field, it means that the subnodes under the parent node are not all selected, and the parent node is determined to be half selected. If the target node quantity is equal to the value of the subnode quantity field, it means that the subnodes under the parent node are all selected, and the parent node is determined to be fully selected. The value of the subnode quantity field corresponding to the parent node can be determined through the associated field corresponding to the parent node, and then the node quantity and the value of the subnode quantity field corresponding to the parent node can be compared to accurately determine the selection state of the parent node.

[0055] In the fuzzy query scenario, the parent node of each node in the search results is not expanded and the child node list of each parent node is not loaded. The selected state of the parent node corresponding to each node in the search results can be determined according to the associated fields of each node in the search results, and the number of selected nodes under the parent node can be determined. According to the parent node identification field of each target node in the search results, the parent node of each target node is determined, and then based on the number of child nodes of the parent node and the number of nodes whose parent nodes are the current parent nodes in the search results, it is determined whether the current parent node is fully selected or half selected, and the selected state of the parent node is determined level by level until the root node. If it is determined that the selected state of a parent node is half-selected, the number of subordinate nodes corresponding to the parent node is determined, and the selected state corresponding to the parent node and the selected number of subordinate nodes are passed upward, and the grandparent nodes above the parent node are all half-selected, until the root node, and the selected number of subordinate nodes corresponding to the root node is displayed; if it is determined that the selected state of a parent node is fully selected, the selected number of subordinate nodes corresponding to the parent node (i.e., grandparent node) of the parent node is counted, and the selected number of subordinate nodes is passed to the parent node until the root node. If the selected state of all nodes is fully selected, the selected number of subordinate nodes corresponding to the root node can be determined based on the value of the number of child nodes field of the root node, and the selected number of subordinate nodes is displayed on the number of deselected; if the selected state of the root node is half-selected, the sum of the selected number of subordinate nodes corresponding to the fully selected parent node and the selected number of subordinate nodes corresponding to the half-selected parent node is counted, and the result is the selected number of subordinate nodes corresponding to the root node, and the selected number of subordinate nodes is displayed on the number of deselected.

[0056] On the basis of the above technical solution, after determining the display data corresponding to the root node of the tree structure data, it also includes: displaying the display data corresponding to the root node on the display interface of the tree structure data.

[0057] The display interface of the tree structure data displays nodes of each level in the tree structure data, and a check box can be displayed for each node, and the selected state of the node can be displayed in the check box. For the root node, the selected state of the root node is displayed in the check box corresponding to the root node, and the selected number of subordinate nodes corresponding to the root node can be displayed, and the selected number of subordinate nodes can be displayed on the number of unselected nodes. The display data corresponding to the root node determined based on the embodiment of the present application is relatively accurate, so that accurate data can be displayed on the display interface.

[0058] In tree structure data, if all parent nodes below the root node have been expanded and the child nodes under each parent node have been loaded, the number of selected child nodes can be directly counted, and the selected state of the parent nodes up to the root node can be controlled according to the number of selected child nodes, and the selected nodes can be displayed on the number of unselected nodes. Figure 2 is an example diagram of tree structure data in the embodiment of the present application, such as Figure 2 As shown, the list of child nodes under the parent node "Parent Node" has been expanded, which means that the child nodes under the parent node are "Child Node 1", "Child Node 2", "Child Node 3", and "Child Node 4", and the child nodes under "Child Node 1" have also been expanded. "Child Node 1" has a total of 10 child nodes, including "Selected 1", "Selected 2", "Selected 3", "Selected 4", "Selected 5", "Selected 6", "Selected 7", "Selected 8", "Selected 9", and "Selected 10". If all 10 child nodes are selected, it can be determined that the selection state of "Child Node 1" is the fully selected state, and the selection state of the parent node is the half-selected state.

[0059] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0060] Figure 3 is a structural block diagram of a tree structure data processing device provided in an embodiment of the present application, such as Figure 3 As shown, the tree structure data processing device may include:

[0061] A selected data determination module 301 is used to respond to a selection request for a target node in the tree structure data and determine the selected data corresponding to the target node according to an associated field of the target node, wherein the associated field is used to represent a parent-child association relationship of the target node;

[0062] The display data determination module 302 is used to determine the selected data corresponding to the parent node level by level according to the associated field of the target node and the selected data corresponding to the target node, until the display data corresponding to the root node of the tree structure data is determined.

[0063] Optionally, the selected data includes the selected state and / or the selected number of subordinate nodes; the display data corresponding to the root node includes the selected number of subordinate nodes and / or the selected state of the root node.

[0064] Optionally, the display data includes the selected state and the number of selected subordinate nodes;

[0065] The display data determination module comprises:

[0066] A parent node determination unit, configured to determine a parent node corresponding to the target node according to an associated field of the target node;

[0067] A selected node quantity determination unit, used to determine the selected quantity of subordinate nodes corresponding to the parent node according to the selected quantity of subordinate nodes corresponding to the target node and the selected quantity of subordinate nodes of other child nodes corresponding to the parent node, and to determine the selected quantity of subordinate nodes corresponding to the parent node step by step according to the selected quantity of subordinate nodes corresponding to the parent node and the associated field of the parent node, until the selected quantity of subordinate nodes corresponding to the root node of the tree structure data is determined; wherein the other child nodes are child nodes under the parent node except the target node;

[0068] A selection state determination unit is used to determine the selection state of the parent node based on the selection state of the target node and the selection states of other child nodes corresponding to the parent node, and to determine the selection state corresponding to the parent node level by level based on the selection state of the parent node and the associated field of the parent node until the selection state corresponding to the root node of the tree structure data is determined.

[0069] Optionally, the associated field includes a child node quantity field and / or a parent node identification field.

[0070] Optionally, the selection request is triggered by clicking; the target node is in an unexpanded state;

[0071] The selected data determination module comprises:

[0072] In response to a request to select a target node in the tree structure data, the selected state of the target node is determined to be a fully selected state, and the value of the child node quantity field of the target node is determined to be the selected number of subordinate nodes corresponding to the target node.

[0073] Optionally, the selected request is triggered by searching;

[0074] The display data determination module comprises:

[0075] A parent node determination unit, configured to determine the parent node corresponding to the target node according to the parent node identification field of the target node;

[0076] A parent node data determination unit, configured to determine the selected data corresponding to the parent node according to the associated field corresponding to the parent node and the search result; wherein the search result includes node information that meets the search condition;

[0077] The data determining unit is used to determine the selected data corresponding to the parent node step by step according to the selected data of the parent node, until the display data corresponding to the root node of the tree structure data is determined.

[0078] Optionally, the selected data of the parent node includes the selected number of subordinate nodes corresponding to the parent node;

[0079] The parent node data determination unit comprises:

[0080] A node quantity determination subunit, used to determine the number of nodes in the search result whose parent node is the parent node;

[0081] The selected number determination subunit is used to determine the node number as the selected number of subordinate nodes corresponding to the parent node.

[0082] Optionally, the selected data of the parent node also includes the selected state of the parent node;

[0083] The parent node data determination unit further includes:

[0084] A child node quantity determination subunit, used to determine the value of the child node quantity field corresponding to the parent node according to the associated field corresponding to the parent node;

[0085] The parent node selection state determination subunit is used to determine that the selection state of the parent node is a half-selected state if the number of nodes is less than the value of the child node number field; if the number of nodes is equal to the value of the child node number field, determine that the selection state of the parent node is a fully selected state.

[0086] Optionally, the device further comprises:

[0087] A display data display module is used to display the display data corresponding to the root node on the display interface of the tree structure data.

[0088] For the specific implementation process of the functions corresponding to each module and unit in the device provided in the embodiment of the present application, please refer to Figure 1 The method embodiment shown here will not repeat the specific implementation process of the functions corresponding to each module and unit of the device.

[0089] The tree structure data processing device provided in the present embodiment responds to a selection request for a target node in the tree structure data, determines the selected data corresponding to the target node according to the associated field of the target node, determines the selected data corresponding to the parent node step by step according to the associated field of the target node and the selected data corresponding to the target node, until the display data corresponding to the root node of the tree structure data is determined. Since the parent-child association relationship of the target node can be accurately known through the associated field, the accuracy of the selected data of the target node and each parent node and the display data of the root node can be improved, thereby solving the problem of inaccurate display of the associated data of the parent node and the child node.

[0090] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0091] Figure 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 4 As shown, the electronic device 400 may include one or more processors 410 and one or more memories 420 connected to the processor 410. The electronic device 400 may also include an input interface 430 and an output interface 440 for communicating with another device or system. The program code executed by the processor 410 may be stored in the memory 420.

[0092] The processor 410 in the electronic device 400 calls the program code stored in the memory 420 to execute the method for processing tree structure data in the above embodiment.

[0093] According to one embodiment of the present application, a computer-readable storage medium is also provided, and the computer-readable storage medium includes but is not limited to a disk storage, a CD-ROM, an optical storage, etc., and a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method for processing the tree structured data of the aforementioned embodiment is implemented.

[0094] According to one embodiment of the present application, a computer program product is also provided, including a computer program or computer instructions, and when the computer program or computer instructions are executed by a processor, the method for processing tree structured data described in the above embodiment is implemented.

[0095] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0096] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0097] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0098] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0099] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0100] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0101] Finally, it should be noted that, in this article, relational terms such as first and second, etc. 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 terminal 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 terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0102] The above is a detailed introduction to a tree-structured data processing method, electronic device and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for processing tree structure data, characterized in that: include: In response to a request for selecting a target node in the tree structure data, determining the selected data corresponding to the target node according to an associated field of the target node, wherein the associated field is used to represent a parent-child association relationship of the target node, and the associated field includes a child node quantity field; According to the associated field of the target node and the selected data corresponding to the target node, the selected data corresponding to the parent node is determined level by level until the display data corresponding to the root node of the tree structure data is determined, including: Determining selected data of the target node according to an associated field of the target node, the selected data including a selected state and / or a selected number of subordinate nodes; Determining the selected data of the parent node step by step according to the selected data of the target node until the root node display data of the tree structure data is obtained, wherein the display data corresponding to the root node includes the selected number of subordinate nodes and / or the selected state of the root node; The step of responding to a request for selecting a target node in the tree structure data and determining the selected data corresponding to the target node according to an associated field of the target node includes: In response to a request to select a target node in the tree structure data, the selected state of the target node is determined to be a fully selected state, and the value of the child node quantity field of the target node is determined to be the selected number of subordinate nodes corresponding to the target node.

2. The method according to claim 1, characterized in that: The display data includes the selected state and the selected number of the subordinate nodes; According to the associated field of the target node and the selected data corresponding to the target node, the selected data corresponding to the parent node is determined level by level until the display data corresponding to the root node of the tree structure data is determined, including: Determine the parent node corresponding to the target node according to the associated field of the target node; Determine the selected number of subordinate nodes corresponding to the parent node according to the selected number of subordinate nodes corresponding to the target node and the selected number of subordinate nodes of other child nodes corresponding to the parent node, and determine the selected number of subordinate nodes corresponding to the parent node step by step according to the selected number of subordinate nodes corresponding to the parent node and the associated field of the parent node, until the selected number of subordinate nodes corresponding to the root node of the tree structure data is determined; wherein the other child nodes are the child nodes under the parent node except the target node; The selected state of the parent node is determined based on the selected state of the target node and the selected states of other child nodes corresponding to the parent node, and the selected state corresponding to the parent node is determined step by step based on the selected state of the parent node and the associated field of the parent node until the selected state corresponding to the root node of the tree structure data is determined.

3. The method according to claim 1 or 2, characterized in that: The association field also includes a parent node identification field.

4. The method according to claim 3, characterized in that: The selection request is triggered by clicking; the target node is in an unexpanded state.

5. The method according to claim 3, characterized in that: The selected request is triggered by a search method; According to the associated field of the target node and the selected data corresponding to the target node, the selected data corresponding to the parent node is determined level by level until the display data corresponding to the root node of the tree structure data is determined, including: Determine the parent node corresponding to the target node according to the parent node identification field of the target node; Determine the selected data corresponding to the parent node according to the associated field corresponding to the parent node and the search result; wherein the search result includes node information that meets the search condition; According to the selected data of the parent node, the selected data corresponding to the parent node is determined level by level until the display data corresponding to the root node of the tree structure data is determined.

6. The method according to claim 5, characterized in that The selected data of the parent node includes the selected number of subordinate nodes corresponding to the parent node; Determining the selected data corresponding to the parent node according to the associated field corresponding to the parent node and the search result includes: Determine the number of nodes in the search results whose parent node is the parent node; The number of nodes is determined as the selected number of subordinate nodes corresponding to the parent node.

7. The method according to claim 6, characterized in that The selected data of the parent node also includes the selected state of the parent node; Determining the selected data corresponding to the parent node according to the associated field corresponding to the parent node and the search result, further comprising: Determine the value of the number of child nodes field corresponding to the parent node according to the association field corresponding to the parent node; If the number of nodes is less than the value of the child node number field, the selected state of the parent node is determined to be a half-selected state; if the number of nodes is equal to the value of the child node number field, the selected state of the parent node is determined to be a fully selected state.

8. The method according to any one of claims 1 to 7, characterized in that: After determining the display data corresponding to the root node of the tree structure data, the method further includes: The display data corresponding to the root node is displayed on the display interface of the tree structure data.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the method for processing tree structured data as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for processing tree-structured data according to any one of claims 1 to 8 is implemented.

11. A computer program product, characterized in that It comprises a computer program or a computer instruction, which, when executed by a processor, implements the method for processing tree structured data as described in any one of claims 1 to 8.