[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN102902811A - Database design method for quickly generating tree structure - Google Patents

Database design method for quickly generating tree structure Download PDF

Info

Publication number
CN102902811A
CN102902811A CN2012104014038A CN201210401403A CN102902811A CN 102902811 A CN102902811 A CN 102902811A CN 2012104014038 A CN2012104014038 A CN 2012104014038A CN 201210401403 A CN201210401403 A CN 201210401403A CN 102902811 A CN102902811 A CN 102902811A
Authority
CN
China
Prior art keywords
tree structure
sort
node
information
tree
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012104014038A
Other languages
Chinese (zh)
Other versions
CN102902811B (en
Inventor
刘欣茹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jinher Software Co Ltd
Original Assignee
Beijing Jinher Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jinher Software Co Ltd filed Critical Beijing Jinher Software Co Ltd
Priority to CN201210401403.8A priority Critical patent/CN102902811B/en
Publication of CN102902811A publication Critical patent/CN102902811A/en
Application granted granted Critical
Publication of CN102902811B publication Critical patent/CN102902811B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a database design method for quickly generating a tree structure, which comprises the following steps that (1) a tree structure information sheet and a Sort sheet are created in a database with tree relation data, the tree structure information sheet is used for recording node information in the tree structure, the Sort sheet is related to the tree structure information sheet and used for recording the relation between nodes of the tree structure, and each node has a Sort ID value; (2) when the node information in the tree structure information sheet is modified, the modified information is saved in the tree structure information sheet and related in the Sort sheet, and then the Sort sheet is reordered, so that the modified tree structure relation is recorded in the Sort sheet; and (3) sequencing is performed according to the field ID value in the Sort sheet, data are read, and the tree structure information is queried. By using the method disclosed by the invention, the operating efficiency is increased, and server resources are saved.

Description

A kind of database design method of rapid spanning-tree structure
Technical field
The present invention relates to field of computer technology, in particular, relate to the database design field in the application system.
Background technology
At present, in traditional application system, the design in tree structure data storehouse all is the ID of child node record father node, adopt the mode production tree structure of recurrence during webpage representation, this method for designing has a strong impact on system effectiveness when big data quantity is represented, might cause whole application system to be in torpor.
Summary of the invention
The database design method that the purpose of this invention is to provide a kind of rapid spanning-tree structure, described method adopt during the spanning tree structured data mode of directly ordering directly to generate in all application systems.
The difficulty that exists in order to solve prior art achieves the above object, and the invention provides a kind of database design method of rapid spanning-tree structure, and described method comprises the steps:
Step 1, in having the database of tree-shaped relation data, create bivariate table, comprising:
The tree structure information table is for the nodal information of record tree construction;
Sort table carries out relatedly with described tree structure information table, is used for the relation between the node of record tree construction, and each node has a Sort ID value;
Step 2, when the nodal information in the described tree structure information table is made amendment, modification information is saved in the described tree structure information table, and the information of will revising is carried out association in the Sort table, then the described Sort of rearrangement shows in same affairs, so that amended tree structure relation is recorded in the described Sort table;
Step 3, press the Field ID value ordering reading out data in the Sort table, query tree structure information.
Preferably, described nodal information comprises the description of node ID, nodename, his father's node ID and other property value information thereof.
Preferably, comprise in the described Sort table that the level node is at the particular location of affiliated level under Sort ID, node ID and father node ID thereof, sort type, the node.
Preferably, the modification of the nodal information described in the step 2 comprises increases and the deletion child node.
The invention has the beneficial effects as follows: the database design method of rapid spanning-tree structure of the present invention, so that in all application systems, do not adopt recursive fashion during the spanning tree structured data, and adopt the mode of directly ordering directly to generate, and improved operational efficiency, saved server resource; Unique database structure design, the resource that takies during spanning tree is carried out reasonable distribution, when the part resource occupation is transferred to newly-increased, deletion of node, improves the spanning tree structure efficiency; The method of the invention has been simplified the process of spanning tree structure greatly, gets final product with simple Sql query statement ordering inquiry.
Description of drawings
Fig. 1 is the schematic flow sheet of the method for the invention
Fig. 2 is the bivariate table that creates in the embodiment of the invention
Embodiment
The present invention will be further described below in conjunction with accompanying drawing, so that those of ordinary skills are with reference to implementing according to this behind this instructions.
As shown in Figure 1, the database design method of rapid spanning-tree structure of the present invention comprises the steps:
Step 1, in having the database of tree-shaped relation data, create bivariate table, comprise tree structure information table and Sort table, described tree structure information table is used for the nodal information of record tree construction, and described nodal information comprises the description of node ID, nodename, his father's node ID and other attribute informations thereof.Be to utilize described tree structure information table in the traditional approach, adopt recursive fashion during the spanning tree structured data, this method for designing has a strong impact on system effectiveness when big data quantity represents, might cause whole application system to be in torpor.Described Sort table, carry out related with institute tree structure information table, for the relation between the node of record tree construction, comprise Sort ID in the described Sort table, node ID and father node ID thereof, sort type, level under the node, node is in the particular location of affiliated level and other information of external data table etc., the DISPLAY ORDER of described sort type index certificate, a plurality of departments are for example arranged, the DISPLAY ORDER of these departments can be set so that check, market department is set ranked first the position, second etc. is clapped by technology department, as do not have sort type, then data initial is by name carried out auto-sequencing smoothly.Fig. 2 for the described bivariate table that creates for example, comprise the first level chairman of the board and the second level general manager (GM) such as company management's layer, the general manager (GM) administers assistant manager A, assistant manager B and assistant manager C, it is the 3rd hierarchy management layer, the department of each assistant manager management is the 4th level, assistant manager A regulating the market section and purchasing department, assistant manager B manage production section and technology department, assistant manager C management office and Human Resources Department have so just formed the simple tree-shaped structural relation of a company.Described nodal information comprises, such as 02, assistant manager B, father node be general manager (GM), management be technology and production field etc.; Or 07, market department, father node be that assistant manager A, main working tasks are the exploitations of marketing etc.Described Sort table comprises IV, 02, belongs to second position of the 3rd level etc.; Or VII, 07, belong to first position of the 4th level etc.Described Sort ID is corresponding with sort level (affiliated level), level code (particular location of affiliated level), and the Sort ID value that namely belongs to first position of the first level is minimum, comes the foremost.
Step 2, when the nodal information in the described tree structure information table is made amendment, first described nodal information is made amendment and be saved in the described tree structure information table, and modification information is increased in the Sort table carries out association, then calling program rearrangement Sort shows in same affairs, make the amended tree structure relation of described Sort table record, the modification of described nodal information comprises to be increased and the deletion child node.When increase or deletion child node, at first amended information is kept in the tree structure information table, and the information of will revising is carried out association in the Sort table, have some information and change thereupon this moment, as delete the general manager (GM) of the second level, and then the deputy general manager of the 3rd level just becomes the second level, and its father node becomes the chairman of the board, each department of the 4th level just becomes the 3rd level, be to the rearrangement of Sort table.At this moment, calling program rearrangement Sort table makes the amended tree structure relation of described Sort table record in same affairs.
The code of rearrangement Sort table is:
Figure BDA00002281548900031
Figure BDA00002281548900041
Figure BDA00002281548900051
The Sql statement of step 3, execution query tree structure, the ID that shows by Sort sorts, and shows the tree construction data.Because described Sort ID is corresponding with sort level (affiliated level), level code (particular location of affiliated level), so by described Sort ID described Sort is shown to sort just can show tree construction.The Sql statement of query tree structure is:
Figure BDA00002281548900052
The method of the invention adopts unique database structure design, the resource that takies during spanning tree is carried out reasonable distribution, when the part resource occupation is transferred to newly-increased, deletion of node, improve the spanning tree structure efficiency, and greatly simplified the process of spanning tree structure, get final product with simple Sql query statement ordering inquiry.
Although embodiment of the present invention are open as above, but it is not restricted to listed utilization in instructions and the embodiment, it can be applied to various suitable the field of the invention fully, for those skilled in the art, can easily realize other modification, therefore do not deviating under the universal that claim and equivalency range limit, the present invention is not limited to specific details and illustrates here and the legend of describing.

Claims (4)

1. the database design method of a rapid spanning-tree structure is characterized in that, described method comprises the steps:
Step 1, in having the database of tree-shaped relation data, create bivariate table, comprising:
The tree structure information table is for the nodal information of record tree construction;
Sort table carries out relatedly with described tree structure information table, is used for the relation between the node of record tree construction, and each node has a Sort ID value;
Step 2, when the nodal information in the described tree structure information table is made amendment, modification information is saved in the described tree structure information table, and the information of will revising is carried out association in the Sort table, then the described Sort of rearrangement shows in same affairs, so that amended tree structure relation is recorded in the described Sort table;
Step 3, press the Field ID value ordering reading out data in the Sort table, query tree structure information.
2. the database design method of rapid spanning-tree structure as claimed in claim 1 is characterized in that, described nodal information comprises the description of node ID, nodename, his father's node ID and other property value information thereof.
3. the database design method of rapid spanning-tree structure as claimed in claim 1 is characterized in that, comprises in the described Sort table that the level node is at the particular location of affiliated level under Sort ID, node ID and father node ID thereof, sort type, the node.
4. the database design method of rapid spanning-tree structure as claimed in claim 1 is characterized in that, the modification of the nodal information described in the step 2 comprises to be increased and the deletion child node.
CN201210401403.8A 2012-10-19 2012-10-19 A kind of database design method quickly generating tree construction Active CN102902811B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210401403.8A CN102902811B (en) 2012-10-19 2012-10-19 A kind of database design method quickly generating tree construction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210401403.8A CN102902811B (en) 2012-10-19 2012-10-19 A kind of database design method quickly generating tree construction

Publications (2)

Publication Number Publication Date
CN102902811A true CN102902811A (en) 2013-01-30
CN102902811B CN102902811B (en) 2016-09-14

Family

ID=47575043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210401403.8A Active CN102902811B (en) 2012-10-19 2012-10-19 A kind of database design method quickly generating tree construction

Country Status (1)

Country Link
CN (1) CN102902811B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104408067A (en) * 2014-10-29 2015-03-11 中国建设银行股份有限公司 Multi-tree structure database design method and device
CN105335501A (en) * 2015-10-28 2016-02-17 南车青岛四方机车车辆股份有限公司 Technical standard database as well as estimating method and device thereof
CN105809594A (en) * 2016-03-11 2016-07-27 武汉天量数据技术有限公司 Flexible knowledge point system construction method and system
CN110569300A (en) * 2018-05-17 2019-12-13 江苏优瀛科技有限公司 Method and system for realizing data sorting of report forms with tree hierarchical structure
CN110768882A (en) * 2019-11-07 2020-02-07 青岛合启立智能科技有限公司 Data monitoring method and system, monitoring equipment and vehicle
CN113064881A (en) * 2021-04-15 2021-07-02 深信服科技股份有限公司 Database management method, device, equipment and readable storage medium
CN115840751A (en) * 2023-02-21 2023-03-24 山东经伟晟睿数据技术有限公司 Novel tree data coding method
CN116561650A (en) * 2023-07-10 2023-08-08 中汽智联技术有限公司 Scene file classification and updating method, device and equipment based on tree structure

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101236550A (en) * 2007-02-01 2008-08-06 阿里巴巴公司 Method and system for processing tree -type structure data
US7512594B2 (en) * 2005-08-17 2009-03-31 Lixin Zhang Computer controlled user display interface with a tree to represent data relationships in a database
CN101706820A (en) * 2009-12-10 2010-05-12 金蝶软件(中国)有限公司 Storing method and device and query method and device of bill of materials
CN102096711A (en) * 2011-01-24 2011-06-15 四川长虹电器股份有限公司 Method for constructing tree structural directory in database
CN102508866A (en) * 2011-10-09 2012-06-20 中国电子科技集团公司第二十八研究所 Digital addressing-based method for structured storage and rapid processing of command relation tree

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7512594B2 (en) * 2005-08-17 2009-03-31 Lixin Zhang Computer controlled user display interface with a tree to represent data relationships in a database
CN101236550A (en) * 2007-02-01 2008-08-06 阿里巴巴公司 Method and system for processing tree -type structure data
CN101706820A (en) * 2009-12-10 2010-05-12 金蝶软件(中国)有限公司 Storing method and device and query method and device of bill of materials
CN102096711A (en) * 2011-01-24 2011-06-15 四川长虹电器股份有限公司 Method for constructing tree structural directory in database
CN102508866A (en) * 2011-10-09 2012-06-20 中国电子科技集团公司第二十八研究所 Digital addressing-based method for structured storage and rapid processing of command relation tree

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
愤怒的小狐狸: ""树形结构的数据库表Schema设计"", 《CSDN.NET》, 30 July 2011 (2011-07-30) *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104408067A (en) * 2014-10-29 2015-03-11 中国建设银行股份有限公司 Multi-tree structure database design method and device
CN104408067B (en) * 2014-10-29 2019-08-13 中国建设银行股份有限公司 A kind of database design method and device of polytree structure
CN105335501A (en) * 2015-10-28 2016-02-17 南车青岛四方机车车辆股份有限公司 Technical standard database as well as estimating method and device thereof
CN105809594A (en) * 2016-03-11 2016-07-27 武汉天量数据技术有限公司 Flexible knowledge point system construction method and system
CN105809594B (en) * 2016-03-11 2020-05-01 武汉天量数据技术有限公司 Flexible knowledge point system construction method and system
CN110569300A (en) * 2018-05-17 2019-12-13 江苏优瀛科技有限公司 Method and system for realizing data sorting of report forms with tree hierarchical structure
CN110768882A (en) * 2019-11-07 2020-02-07 青岛合启立智能科技有限公司 Data monitoring method and system, monitoring equipment and vehicle
CN113064881A (en) * 2021-04-15 2021-07-02 深信服科技股份有限公司 Database management method, device, equipment and readable storage medium
CN113064881B (en) * 2021-04-15 2024-05-24 深信服科技股份有限公司 Database management method, device, equipment and readable storage medium
CN115840751A (en) * 2023-02-21 2023-03-24 山东经伟晟睿数据技术有限公司 Novel tree data coding method
CN116561650A (en) * 2023-07-10 2023-08-08 中汽智联技术有限公司 Scene file classification and updating method, device and equipment based on tree structure
CN116561650B (en) * 2023-07-10 2023-09-19 中汽智联技术有限公司 Scene file classification and updating method, device and equipment based on tree structure

Also Published As

Publication number Publication date
CN102902811B (en) 2016-09-14

Similar Documents

Publication Publication Date Title
CN102902811A (en) Database design method for quickly generating tree structure
CN102918530B (en) Data mart automation
CN102141992B (en) Method for storing and querying multidimensional database
CN102426587B (en) Method for customizing and inquiring heterogeneous BOM (Bill of Materiel) based on complex product
CN102426582B (en) Data manipulation management devices and data manipulation management method
CN103678569B (en) Construction method of virtual scene generation-oriented video image material library
CN101789045B (en) Implementation method of MDA modeling tool for manufacturing field
CN104346377A (en) Method for integrating and exchanging data on basis of unique identification
CN102789491B (en) A kind of configurable data subscription and delivery system and method thereof
CN101826100A (en) Automatic integrated system and method of wide area network (WAN)-oriented multisource emergency information
CN103853759B (en) A kind of generation method and system of adaptive list
CN103617175A (en) Method for virtualization of large-scale distributed heterogeneous data
US9805112B2 (en) Method and structure for managing multiple electronic forms and their records using a static database
CN105243237A (en) Assembly technology structure tree and building method thereof
CN104361091A (en) Big data system
CN101408909B (en) Method for describing product information model
CN109977496A (en) Efficient information exchange and the architectural engineering artwork integrated system and method to cooperate
CN102024182A (en) System for managing asset information
CN104239470A (en) Distributed environment-oriented space data compound processing system and method
US20100049734A1 (en) Fast search views over business objects
CN110083664B (en) Method for automatically constructing topological model based on CMDB model
CN105303465A (en) Tree-shaped view defining and displaying method based on CIM model
CN104572832A (en) Requirement meta model construction method and device
CN113722564A (en) Visualization method and device for energy and material supply chain based on space map convolution
CN103064877A (en) Method for producing BOM (Bill of Material) memory model building based on XML (extensive markup language)

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant