Universal tree structure data query method and device
A data query and tree structure technology, applied in the computer field, can solve problems such as consumption, multi-database performance, and inconsistency of relational database methods, and achieve the effect of reducing performance consumption and better versatility
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0040] see figure 1 This embodiment provides a general tree structure data query method, including:
[0041] Establish a tree structure in the database, each node in the tree structure is used to store resource data; optimize the table structure of each node, the table structure includes parent node ID, node ID, node name, node level and search ID; obtain query instructions, through Search ID to get the query result of the child node collection.
[0042] In the general tree structure data query method provided by this embodiment, by establishing a tree structure in the database, such as Oracle database, mysql database, sqlServer database, db2 database, etc., then optimize the table structure of each node in the tree structure, wherein, after optimization The table structure includes parent node ID, node ID, node name, node level and search ID. Since the search ID can represent the node level of the current node and the relationship with the parent node, in the process of obta...
Embodiment 2
[0059] This embodiment provides a general tree structure data query device, including:
[0060] The tree structure unit is used to establish a tree structure in the database, and each node in the tree structure is used to store resource data;
[0061] The table structure optimization unit is used to optimize the table structure of each node, and the table structure includes parent node ID, node ID, node name, node level and search ID;
[0062] The query unit is configured to obtain a query instruction, and obtain a query result of a child node set through a search ID.
[0063] Preferably, it also includes:
[0064] configuration unit, configured to configure the optimized table structure on each node of the tree structure;
[0065] Wherein, the search ID of the node is used to represent the node level where the current node is located and the affiliation relationship with the parent node.
[0066] Preferably, the query unit includes:
[0067] The command parsing module is ...
Embodiment 3
[0071] This embodiment provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of the above general tree structure data query method are executed.
[0072] Compared with the prior art, the beneficial effect of the computer-readable storage medium provided by this embodiment is the same as the beneficial effect of the general tree structure data query method provided by the above technical solution, which will not be repeated here.
[0073] Those of ordinary skill in the art can understand that all or part of the steps in the above-mentioned inventive method can be completed by instructing related hardware through a program. The above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it includes: For each step of the method in the foregoing embodiments, the foregoing storage medium may be: ROM / RAM, magnetic disk,...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com