Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

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

Inactive Publication Date: 2020-01-17
JIANGSU SUNING LOGISTICS CO LTD
View PDF1 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] There are many kinds of relational databases commonly used, including Oracle database, mysql database, sqlServer database and db2 database. Among them, Oracle database and sqlServer database need to use specific functions and syntax to support recursive query, and mysql database and db2 database need to use custom Functions can support recursive queries. It can be seen that the existing relational databases have different methods for querying tree-structured data, and they all rely on recursive query strategies to realize the query of subtree data. As we all know, recursive query needs to query the database multiple times. In order to obtain the query set of sub-nodes, especially for tree structures with a large number of sub-nodes, it takes more database performance

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Universal tree structure data query method and device
  • Universal tree structure data query method and device
  • Universal tree structure data query method and device

Examples

Experimental program
Comparison scheme
Effect test

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,...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a universal tree structure data query method and device, relates to the technical field of computers, and aims to realize the universality of a child node set query method andreduce the performance consumption of a database. The universal tree structure data query method comprises the following steps: establishing a tree structure in a database, wherein each node in the tree structure is used for storing resource data; optimizing a table structure of each node, wherein the table structure comprises a father node ID, a node ID, a node name, a node hierarchy and a searchID; and obtaining a query instruction, and obtaining a query result of the child node set through the search ID. The universal tree structure data query device applies the universal tree structure data query method provided by the scheme.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a general tree structure data query method and device. Background technique [0002] There are many kinds of relational databases commonly used, including Oracle database, mysql database, sqlServer database and db2 database. Among them, Oracle database and sqlServer database need to use specific functions and syntax to support recursive query, and mysql database and db2 database need to use custom Functions can support recursive queries. It can be seen that the existing relational databases have different methods for querying tree-structured data, and they all rely on recursive query strategies to realize the query of subtree data. As we all know, recursive query needs to query the database multiple times. In order to obtain the query set of sub-nodes, especially for tree structures with a large number of sub-nodes, more database performance is consumed. Contents of the inven...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/22G06F16/2455
CPCG06F16/2246G06F16/2455
Inventor 王震侯诗磊
Owner JIANGSU SUNING LOGISTICS CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products