A tree data multi-selection method and a system for implementing tree data multi-selection

By incrementally recording user actions and combining front-end and back-end processing, the problem of slow loading and saving when multiple selections are made in tree-structured data is solved, achieving high efficiency in data loading and saving.

CN115237919BActive Publication Date: 2026-02-03INSPUR GENERSOFT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210894981.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-28
Publication Date
2026-02-03
Estimated Expiration
2042-07-28

AI Technical Summary

Technical Problem

In existing technologies, when multiple selections are made in tree-structured data, there are problems such as slow loading speed, inability to load, and slow saving of multiple selections, which are particularly evident with large amounts of data.

Method used

By employing a tree-structured multi-select method and recording user operations incrementally, combined with front-end and back-end processing, we can achieve fast data loading and accurate data saving.

Benefits of technology

It improves the loading and saving speed of tree structure data, prevents slow loading or loading failures caused by excessively large data, and ensures the efficiency of multi-selection operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115237919B_ABST
    Figure CN115237919B_ABST
Patent Text Reader

Abstract

The application discloses a tree data multi-selection method and a system for realizing tree data multi-selection, and belongs to the technical field of computer data processing, and the realization of the method comprises the following steps: data reading, acquiring first layer data from a server end and displaying the first layer data to a client end; meanwhile, the data that has been selected and saved on the server end is acquired; front-end data object definition, the front end adopts an incremental mode to record all operations of a user, and the specific contents of the data selected by the user and the data unselected by the user are recorded respectively; front-end data operation, according to the operation sequence of the user and according to the agreement in the front-end data object definition, data processing is carried out, including front-end interface processing and back-end processing. The application can improve the loading speed and saving speed of a large amount of tree structure data, and prevent the phenomenon of slow front-end loading, even loading failure, slow multi-selection saving and the like caused by too large data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer data processing, in particular to a tree data multi-selection method and a system for implementing tree data multi-selection. BACKGROUND

[0002] With the continuous development of information technology, more and more large enterprises change from original independent deployment and independent operation to group unified deployment and unified operation. The data of all subordinate units of the group are uniformly supervised and stored, which faces the problem of more and more business data tables, and when the tree structure data is presented to the user, it brings the problems of slow display speed, even unable to load and slow multi-selection saving.

[0003] In the prior art, data is displayed in a list, which can be loaded by a paging loading mode to reduce the problem of slow loading caused by too large data amount. For tree structure display, data can be pulled and displayed by a hierarchical loading mode, but there is no unified solution for tree data multi-selection. SUMMARY

[0004] The technical task of the present application is to solve the above problems, and provide a tree data multi-selection method and a system for implementing tree data multi-selection, which can improve the loading speed and saving speed of large amount of tree structure data, and prevent the phenomenon of slow front-end loading, even unable to load, and slow multi-selection saving caused by too large data.

[0005] The technical solution adopted by the present application to solve the technical problems is:

[0006] A tree data multi-selection method, the implementation of the method comprises:

[0007] Data reading, obtaining first layer data from a server side and displaying to a client side; and obtaining data that has been selected and saved by the server side;

[0008] Front-end data object definition, the front-end records all operations of the user in an incremental manner, and records specific contents of the user selecting data and canceling selecting data respectively;

[0009] Front-end data operation, according to the operation sequence of the user and according to the agreement in the front-end data object definition, data processing is performed, including front-end interface processing and back-end processing.

[0010] Preferably, in the data reading, the data that has been selected and saved by the server side is obtained, and if the first layer has data that has been selected, the data is checked.

[0011] Preferably, in the front-end data object definition,

[0012] TreeNodeSelect is used to record the selected tree node data, TreeNodeSelect includes attribute node unique ID, whether contains all children IsContainsAllChildren;

[0013] The following conventions are made at the same time:

[0014] If all selected or cancel all, TreeNodeSelect = {ID = '* ', IsContainsAllChildren = True} is used to represent, where * represents all data, and IsContainsAllChildren = True indicates that it contains the lower level.

[0015] Further, two arrays are used to record the incremental selected and deleted data, AddNodeDatas represents the incremental selected data set, and DeleteNodeDatas represents the incremental deleted data set. For example, the user selects 001 and all subordinates, and 002 and all subordinates, and the record is as follows:

[0016] AddNodeDatas = [{ID = '001', IsContainsAllChildren = True}, {ID = '002', IsContainsAllChildren = True}]

[0017] The user selects 001 and all subordinates, deletes 002 and all subordinates, and 003 itself, and the record is as follows:

[0018] AddNodeDatas = [{ID = '001', IsContainsAllChildren = True}]

[0019] DeleteNodeDatas = [{ID = '002', IsContainsAllChildren = True}, {ID = '003', IsContainsAllChildren = False}];

[0020] All selected is recorded in AddNodeDatas = [{ID = '*', IsContainsAllChildren = True}], and all deleted is recorded in DeleteNodeDatas = [{ID = '*', IsContainsAllChildren = True}].

[0021] Preferably, the front-end interface processing of the front-end data operation,

[0022] When all are selected, the DeleteNodeData array is cleared; when all are deselected, the AddNodeData array is cleared. For example, if the user selects all: the DeleteNodeDatas array is cleared, and the new node status is recorded.

[0023] DeleteNodeDatas = []

[0024] AddNodeDatas=[{ID='*', IsContainsAllChildren=True}];

[0025] When the interface is in a "select all" state, deleting a node requires recording the deleted node in `DeleteNodeDatas` and all other nodes displayed on the interface in `AddNodeDatas`. Similarly, when selecting a node while the interface is in a "select all" state, the selected node needs to be recorded in `AddNodeDatas` and all other nodes displayed on the interface need to be recorded in `DeleteNodeDatas`. For example, when selecting all and deleting node 001: the current node 001 is recorded in `Add DeleteNodeDatas`, and all nodes other than the current node are marked as newly added.

[0026] DeleteNodeDatas=[{ID='001',IsContainsAllChildren=True}]

[0027] AddNodeDatas=[{ID='002',IsContainsAllChildren=True},

[0028] {ID='003',IsContainsAllChildren=True},

[0029] {ID='004',IsContainsAllChildren=False},

[0030] {ID='004001', IsContainsAllChildren=True},…];

[0031] When the interface is not in a state of not selecting all nodes, when a node is selected or deselected, the current node and all expanded nodes are added to AddNodeDatas or DeleteNodeDatas based on whether it contains sub-nodes and whether the node has been expanded.

[0032] Preferably, when expanding a node, if the node is being expanded for the first time, all its subordinates are retrieved from the server and the current node is marked as "expanded". At the same time, if the current node is recorded in AddNodeDatas and the current node's state is that it and all its subordinates are selected, the current node is marked as selecting only itself, and all its subordinate nodes are marked as selecting themselves and added to AddNodeDatas.

[0033] Furthermore, in the non-select all state, if a node is selected and all its children are selected but not expanded, a record {ID='node identifier', IsContainsAllChildren=True} is added to AddNodeDatas; if a child is selected and the child is already expanded, the current node is added as selected, and all its child nodes are added as selected (including both the current node and its children). For example, if node 001 is selected, and node 001 is already expanded, node 001 includes 001002 and 001003. 001002 is not expanded, while 001003 is expanded.

[0034] AddNodeDatas=[{ID='001',IsContainsAllChildren=False},

[0035] {ID='001002',IsContainsAllChildren=True},

[0036] {ID='001003',IsContainsAllChildren=False},

[0037] {ID='001003001',IsContainsAllChildren=True}]

[0038] Furthermore, in the non-select all state, if only the node itself is selected, a record {ID='node identifier', IsContainsAllChildren=False} is added to AddNodeDatas. At the same time, it is determined whether the node has been added to DeleteNodeDatas. If it has been added, it is removed from DeleteNodeDatas, that is, only the last state of the currently operated node is retained.

[0039] Preferably, the backend processing of the frontend data operations,

[0040] The server backend receives AddNodeDatas and DeleteNodeDatas, representing the final incremental operations performed by the frontend, such as selections or cancellations.

[0041] For AddNodeDatas, first determine whether the selected record has already been stored in the database. If it has been stored, do not save it to the database; otherwise, save it to the database.

[0042] For DeleteNodeDatas, perform the database deletion operation directly.

[0043] This invention also claims a system for implementing multi-selection of tree-structured data, comprising a data reading module, a front-end data object definition module, and a front-end data manipulation module.

[0044] The data reading module retrieves the first-level data from the server and displays it on the client; it also retrieves the selected data saved on the server.

[0045] The front-end data object definition module uses an incremental approach to record all user operations, specifically recording the selected and deselected data.

[0046] The front-end data operation module processes data according to the user's operation sequence and the conventions in the front-end data object definition, including front-end interface processing and back-end processing.

[0047] The system achieves multiple selection of tree-shaped data through the aforementioned tree-shaped data selection method.

[0048] Compared with existing technologies, the tree-structured data multi-selection method and system of the present invention have the following advantages:

[0049] This method provides a way to perform multiple selections and save selection results using a tree-structured data structure. It can accurately save user selection data and solves the problem of data not loading properly under large data volumes, or the inability to accurately save multi-select data on the interface when using hierarchical loading.

[0050] This method or system can enable multiple selections of large amounts of tree-structured data, improve the loading and saving speed of large numbers of tree structures, and prevent the occurrence of slow front-end loading, or even failure to load, and slow saving of multiple selections due to excessive data. Attached Figure Description

[0051] Figure 1 This is a diagram illustrating the implementation process of the tree-based data multi-selection method provided in this embodiment of the invention. Detailed Implementation

[0052] This invention provides a method for multi-selection of tree-structured data, the specific implementation process of which is as follows:

[0053] Step 1: Data Retrieval. The first layer of data is retrieved from the server and displayed on the client. Simultaneously, the selected data stored on the server is retrieved; if selected data already exists in the first layer, it is checked. This layered data loading mechanism is a common technical method and will not be elaborated upon here.

[0054] Step 2: Front-end data object definition. The front-end uses an incremental approach to record all user operations, specifically recording the selected and deselected data.

[0055] The specific objects and agreements involved are as follows:

[0056] TreeNodeSelect is used to record the selected tree node data. TreeNodeSelect includes the unique identifier ID of the attribute node and whether it contains all children (IsContainsAllChildren).

[0057] The following agreement shall be made simultaneously:

[0058] To select or deselect all, use TreeNodeSelect = {ID = '*', IsContainsAllChildren = True}, where * represents all data and IsContainsAllChildren = True means including sub-children.

[0059] Two arrays are used to record incrementally selected and deselected data: AddNodeDatas represents the set of incrementally selected data, and DeleteNodeDatas represents the set of incrementally deleted data. For example, if the user selects 001 and all its sub-items, and 002 and all its sub-items, the record would be as follows:

[0060] AddNodeDatas=[{ID='001', IsContainsAllChildren=True}, {ID='002', IsContainsAllChildren=True}];

[0061] The user selected 001 and all its subordinates, and deleted 002 and all its subordinates, as well as 003 itself. The record is as follows:

[0062] AddNodeDatas=[{ID='001',IsContainsAllChildren=True}]

[0063] DeleteNodeDatas=[{ID='002', IsContainsAllChildren=True}, {ID='003', IsContainsAllChildren=False}].

[0064] Selecting all children will record them in AddNodeDatas = [{ID = '*', IsContainsAllChildren = True}], and deleting all children will record them in DeleteNodeDatas = [{ID = '*', IsContainsAllChildren = True}].

[0065] Step 3: Front-end Data Manipulation. Data processing is performed according to the user's operation sequence and the conventions defined in the front-end data object definition in Step 2. This includes front-end interface processing and back-end processing. The processing steps for several different operation states are detailed below.

[0066] Among them, front-end interface processing:

[0067] 1. When all are selected, the DeleteNodeData array will be cleared; when all are deselected, the AddNodeData array will be set to empty. For example,

[0068] User selects all: Clears and deletes DeleteNodeDatas, and records the new node's status:

[0069] DeleteNodeDatas = []

[0070] AddNodeDatas=[{ID='*', IsContainsAllChildren=True}];

[0071] 2. When the interface is in the selected state, if a node is canceled, the currently canceled node needs to be recorded in DeleteNodeDatas, and all other nodes displayed on the interface should be recorded in AddNodeDatas.

[0072] When all nodes are canceled, selecting a node requires recording the currently selected node in AddNodeDatas, while recording all other nodes displayed on the interface in DeleteNodeDatas.

[0073] For example, when all nodes are selected, deselecting node 001: The current node 001 is recorded in the newly added DeleteNodeDatas, and all nodes except the current node are marked as newly added:

[0074] DeleteNodeDatas=[{ID='001',IsContainsAllChildren=True}]

[0075] AddNodeDatas=[{ID='002',IsContainsAllChildren=True},

[0076] {ID='003',IsContainsAllChildren=True},

[0077] {ID='004',IsContainsAllChildren=False},

[0078] {ID='004001', IsContainsAllChildren=True},…];

[0079] 3. When expanding a node, if it is the first time expanding a node, retrieve all its subordinates from the server and mark the current node as "expanded". At the same time, if the current node is recorded in AddNodeDatas and the current node's state is that it and all its subordinates are selected, mark the current node as selecting only itself, mark all its subordinate nodes as selecting itself and add them to AddNodeDatas.

[0080] 4. When a node is selected or deselected in a non-selected state, the current node and all expanded nodes are added to AddNodeDatas or DeleteNodeDatas based on whether it contains sub-nodes and whether it has been expanded.

[0081] For example, if a node is selected and all its children are selected without being expanded, a record {ID='node identifier', IsContainsAllChildren=True} is added to AddNodeDatas. If a child is selected and the child is already expanded, the current node is added as the selected node, and all its child nodes are added as the selected node and all its children. For example, if node 001 is selected, and node 001 is already expanded, and node 001 contains 001002 and 001003, where 001002 is not expanded and 001003 is expanded:

[0082] AddNodeDatas=[{ID='001',IsContainsAllChildren=False},

[0083] {ID='001002',IsContainsAllChildren=True},

[0084] {ID='001003',IsContainsAllChildren=False},

[0085] {ID='001003001',IsContainsAllChildren=True}]

[0086] If only the node itself is selected, a record {ID='Node Identifier', IsContainsAllChildren=False} will be added to AddNodeDatas;

[0087] At the same time, it checks whether the node has been added to DeleteNodeDatas. If it has, it is removed from DeleteNodeDatas, meaning only the last state of the currently operated node is retained.

[0088] Backend processing:

[0089] The server backend receives AddNodeDatas and DeleteNodeDatas, representing the final incremental operations performed by the frontend, such as selections or cancellations.

[0090] For AddNodeDatas, first determine whether the selected record has already been stored in the database. If it has been stored, do not save it to the database; otherwise, save it to the database.

[0091] For DeleteNodeDatas, perform the database deletion operation directly.

[0092] This embodiment also provides a system for implementing multi-selection of tree-shaped data, including a data reading module, a front-end data object definition module, and a front-end data operation module.

[0093] The data reading module retrieves the first layer of data from the server and displays it to the client; it also retrieves the selected data stored on the server, and selects the selected data if it exists in the first layer.

[0094] The front-end data object definition module records all user operations incrementally, including the specific content of selected and deselected data.

[0095] The specific objects and agreements involved are as follows:

[0096] TreeNodeSelect is used to record the selected tree node data. TreeNodeSelect includes the unique identifier ID of the attribute node and whether it contains all children (IsContainsAllChildren).

[0097] The following agreement shall be made simultaneously:

[0098] To select or deselect all, use TreeNodeSelect = {ID = '*', IsContainsAllChildren = True}, where * represents all data and IsContainsAllChildren = True means including sub-children.

[0099] Two arrays are used to record incrementally selected and deselected data: AddNodeDatas represents the set of incrementally selected data, and DeleteNodeDatas represents the set of incrementally deleted data. For example, if the user selects 001 and all its sub-items, and 002 and all its sub-items, the record would be as follows:

[0100] AddNodeDatas=[{ID='001', IsContainsAllChildren=True}, {ID='002', IsContainsAllChildren=True}];

[0101] The user selected 001 and all its subordinates, and deleted 002 and all its subordinates, as well as 003 itself. The record is as follows:

[0102] AddNodeDatas=[{ID='001',IsContainsAllChildren=True}]

[0103] DeleteNodeDatas=[{ID='002', IsContainsAllChildren=True}, {ID='003', IsContainsAllChildren=False}].

[0104] Selecting all children will record them in AddNodeDatas = [{ID = '*', IsContainsAllChildren = True}], and deleting all children will record them in DeleteNodeDatas = [{ID = '*', IsContainsAllChildren = True}].

[0105] The front-end data operation module processes data according to the user's operation sequence and the conventions defined in step two of the front-end data object definition, including front-end interface processing and back-end processing. The processing steps for several different operation states are described in detail below.

[0106] The system implements tree-based data multi-selection using the tree-based data multi-selection method described in the above embodiments.

[0107] Through the specific embodiments described above, those skilled in the art can easily implement the present invention. However, it should be understood that the present invention is not limited to the specific embodiments described above. Based on the disclosed embodiments, those skilled in the art can arbitrarily combine different technical features to achieve different technical solutions.

[0108] Except for the technical features described in the specification, all other technologies are known to those skilled in the art.

Claims

1. A method for multiple selection of tree-structured data, characterized in that... The implementation of this method includes: Data reading involves retrieving the first layer of data from the server and displaying it on the client; it also retrieves the selected data stored on the server. The front-end data object is defined, and the front-end uses an incremental method to record all user operations, recording the specific content of the data selected and deselected by the user. Front-end data operations are performed according to the user's operation sequence and the conventions in the front-end data object definition, including front-end interface processing and back-end processing. The front-end interface processing for the aforementioned front-end data operations. When all are selected, the DeleteNodeData array will be cleared; when all are deselected, the AddNodeData array will be set to empty. When the interface is in the "select all" state, if a node is deselected, the currently deselected node needs to be recorded in "DeleteNodeDatas", and all other nodes displayed on the interface need to be recorded in "AddNodeDatas". When the interface is in the "deselect all" state, if a node is selected, the currently selected node needs to be recorded in "AddNodeDatas", and all other nodes displayed on the interface need to be recorded in "DeleteNodeDatas". When the interface is not in a state of not selecting all nodes, when a node is selected or deselected, the current node and all expanded nodes are added to AddNodeDatas or DeleteNodeDatas based on "whether it contains sub-nodes" and "whether the node has been expanded". When expanding a node, if it is the first time expanding a node, all its subordinates are retrieved from the server and the current node is marked as "expanded". At the same time, if the current node is recorded in AddNodeDatas and the current node's state is that it and all its subordinates are selected, the current node is marked as selecting only itself, all its subordinate nodes are marked as selecting itself and added to AddNodeDatas. Two arrays are used to record the incremental selection and deselection data: AddNodeDatas represents the set of incrementally selected data, and DeleteNodeDatas represents the set of incrementally deleted data. Selecting all children will record them in AddNodeDatas= [{ID='*', IsContainsAllChildren=True}], and deleting all children will record them in DeleteNodeDatas= [{ID='*', IsContainsAllChildren=True}]; In the non-select all state, if a node is selected and all its children are selected and the children are not expanded, then add a record {ID='node identifier', IsContainsAllChildren=True} to AddNodeDatas; if a child is selected and the child is expanded, then add the current node as selected and all its children as selected. In the non-select all state, if only the node itself is selected, a record {ID='node identifier', IsContainsAllChildren=False} is added to AddNodeDatas. At the same time, it is determined whether the node has been added to DeleteNodeDatas. If it has been added, it is removed from DeleteNodeDatas, that is, only the last state of the currently operated node is retained. The backend processing of the aforementioned frontend data operations. The server backend receives AddNodeDatas and DeleteNodeDatas, representing the final incremental operations performed by the frontend, such as selections or cancellations. For AddNodeDatas, first determine whether the selected record has already been stored in the database. If it has been stored, do not save it to the database; otherwise, save it to the database. For DeleteNodeDatas, perform the database deletion operation directly.

2. The method for multiple selection of tree-structured data according to claim 1, characterized in that... The data reading process retrieves the selected data stored on the server. If selected data already exists in the first layer, it is then selected.

3. A method for multiple selection of tree-structured data according to claim 1 or 2, characterized in that... The front-end data object definition TreeNodeSelect is used to record the selected tree node data. TreeNodeSelect includes the unique identifier ID of the attribute node and whether it contains all children (IsContainsAllChildren). The following agreement shall be made simultaneously: If you want to select all or deselect all, use TreeNodeSelect={ID='*',IsContainsAllChildren=True}, where * represents all data and IsContainsAllChildren=True means including children.

4. A system for implementing multi-selection of tree-structured data, characterized in that... It includes a data reading module, a front-end data object definition module, and a front-end data manipulation module. The data reading module retrieves the first-level data from the server and displays it on the client; it also retrieves the selected data saved on the server. The front-end data object definition module uses an incremental approach to record all user operations, specifically recording the selected and deselected data. The front-end data operation module processes data according to the user's operation sequence and the conventions in the front-end data object definition, including front-end interface processing and back-end processing. The system achieves tree data multi-selection through the tree data multi-selection method described in any one of claims 1-3.

Citation Information

Patent Citations

  • Tree-node displaying method and device

    CN101639845A

  • Data selection method and device

    CN114546566A