CN107092659A - A kind of general tree structure storing and resolving method - Google Patents

A kind of general tree structure storing and resolving method Download PDF

Info

Publication number
CN107092659A
CN107092659A CN201710191450.7A CN201710191450A CN107092659A CN 107092659 A CN107092659 A CN 107092659A CN 201710191450 A CN201710191450 A CN 201710191450A CN 107092659 A CN107092659 A CN 107092659A
Authority
CN
China
Prior art keywords
tree
data
node
encoding
tree node
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
CN201710191450.7A
Other languages
Chinese (zh)
Other versions
CN107092659B (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.)
Chengdu Gifted Data Co Ltd
Original Assignee
Chengdu Gifted Data 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 Chengdu Gifted Data Co Ltd filed Critical Chengdu Gifted Data Co Ltd
Priority to CN201710191450.7A priority Critical patent/CN107092659B/en
Publication of CN107092659A publication Critical patent/CN107092659A/en
Application granted granted Critical
Publication of CN107092659B publication Critical patent/CN107092659B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees

Abstract

The present invention discloses a kind of general tree structure storing and resolving method, the present invention relates to computer application field, prior art is solved because the amount of calculation for parsing and existing to tree structure data using recursive fashion is huge, store code is complicated, logic is complicated and data tree structures technical problem not directly perceived etc. enough.The main data list for including being generated by level associated data by temporary variable searching loop, read the single data of data list, utilize burl point feature in data list, threshold condition is built with reference to ephemeral data set, tree-encoding is sequentially incrementally set to the tree node for meeting threshold condition, again by current tree node correspondence tree-encoding deposit ephemeral data set in data list, at the end of circulation, the complete tree-like ephemeral data set of relative data list is obtained;Correspondence single data searches ephemeral data set, obtains the root tree node and all children tree nodes of tree structure.The characteristics of present invention has easy to use, maintainable, workable.

Description

A kind of general tree structure storing and resolving method
Technical field
The present invention relates to computer application field, and in particular to a kind of general tree structure storing and resolving method.
Background technology
In application software field, often use tree structure to represent above and below the incidence relation of some data, such as enterprise Level department, commodity classification, regional information, navigation column structural information, role-security information, resources relationship information etc..These numbers According to storage, parsing, safeguard all be sufficiently complex.
At present, the storage of tree structure data is mainly based upon the storage of database.It is main to use two kinds of implementation methods.
The first implementation method stores tree structure by the way of father node id associations.
Datagram 1 (being illustrated with some areas information) based on tree structure:
The mode which stores upper figure tree structure uses succession mode between node, passes through the description of display some section The father node of point, so as to set up two-dimentional relation table, the table structure of this scheme is typically designed to { id, name, parent_ id}.The data that Fig. 1 is stored in actual database are as shown in table 1 below.
id name parent_id
1 Beijing
2 Chaoyang District 1
3 Guan Village 2
4 Within three rings 2
5 Haidian District 1
6 Xisanqi 5
7 Sichuan Province
8 Chengdu 7
9 Wuhou District 8
10 Qingyang District 8
11 Chenghua district 8
12 Jinjiang District 8
13 Jinniu District 8
14 Deyang City 7
15 Guanghan City 14
16 Mianyang City 7
17 Jiangyou City 16
18 San Tai cities 16
The database purchase some areas information of table 1
The storage, which is realized, is primarily present problems with:
1. safeguard that the relation between id and parent_id is complicated;
2. the more difficult tree-like relation intuitively seen between data of user;
3. the addition of node, deletion and modification cost are larger, it will be related to the change of many-sided data in table;
4. to obtain tree structure as a result, it is desirable to carry out recursive query, recursive traversal writes complexity, and maintenance cost is larger.
Second of implementation method stores tree structure by the way of based on left and right value coding.
Which is worth using left and right and encoded, can be carried out the coding of infinite stages tree using a kind of brand-new without recursive query, The coded system realizes unlimited classification under the premise of elimination is recursive, and querying condition is compared based on shaped digital, Efficiency is very high.As shown in Fig. 2 on each node, there is left, two fields of right, it is seen that, from root node along son on figure Node starts one line of picture, often gos deep into one layer of left and plus one, on earth after, right=left+1, then along node recall, Right adds one step by step, and root node is returned to always.If inquiring about some node and its child node, such as Beijing's node, condition For the and 13 of where left between 2.The table structure of left and right value coding is typically designed to { id, name, lft, rgt }. Store as shown in table 2 below with Fig. 1 data in actual database.
The value code storage of table 2 or so some areas information
The storage, which is realized, is primarily present problems with:
1. or so value coding mode and common Arabic numerals intuitively sort difference, along with layer of the node in tree Secondary, order is not intuitively to show, and is obtained after must being calculated by simple formula, it is necessary to take some time to it Mathematical modeling is deeply understood;
2. the more difficult tree-like relation intuitively seen between data of user;
3. writing associated storage process using the program, increase newly, delete, need to look into whole tree with layer translational nodes Modification is ask, thus caused code complexity, the degree of coupling is higher, change the risk safeguarded higher.
No matter the data of tree structure are stored using which kind of above-mentioned scheme, all there is that user is more difficult to be can be visually seen between data Tree-like relation, in order to obtain relevance tree relation need largely to be calculated during data write into Databasce, in order to reappear Tree structure needs to write the storing process of complexity or needs recursive call logic complicated.Therefore a kind of user can intuitively see To relation between data, it tree structure can be embodied by rapid coding scheme, quickly can reappear tree structure between data Scheme is badly in need of being suggested.
The content of the invention
For above-mentioned prior art, present invention aims at provide a kind of general tree structure storing and resolving method, solution Certainly prior art due to using recursive fashion to tree structure data parse and exist amount of calculation it is huge, store code is complicated, The tree structure technical problem not directly perceived etc. enough of logic complexity and data.
To reach above-mentioned purpose, the technical solution adopted by the present invention is as follows:
A kind of general tree structure storing and resolving method, including
Step 1, the data list generated by temporary variable searching loop by level associated data, read data list Single data, using burl point feature in data list, builds threshold condition, to meeting threshold condition with reference to ephemeral data set Tree node sequentially incrementally sets tree-encoding, then by current tree node correspondence tree-encoding deposit ephemeral data set in data list, At the end of circulation, the complete tree-like ephemeral data set of relative data list is obtained;
Step 2, correspondence single data search ephemeral data set, obtain the root tree node and all subtree sections of tree structure Point.
In the above method, described step 1 comprises the following steps:
Step 1.1, the attribute for being defined in each level each burl point data of correspondence are unique sequence number and tree-encoding;
Step 1.2, the data list of preset data level association;
Step 1.3, create the results list, with tree-encoding be key assignments and tree node be value data ephemeral data set With the temporary variable for each tree node sequence number cycle traversal of correspondence;
Step 1.4, judge whether current temporary variable is less than the sequence length of data list, if current temporary variable is less than The sequence length of data list, then carry out step 1.5, if current temporary variable is more than or equal to the sequence length of data list, The data of current tree node are back to the results list and terminated;
Step 1.5, the current tree node obtained in current temporary variable corresponding data list, judge in ephemeral data set The value of the tree node of correspondence current tree node tree-encoding key assignments whether is included, if including the value of the tree node, nonce is taken out According to the value of set tree node, then the value of current tree node is set to be the value of ephemeral data set tree node, to current temporary variable Increase and the temporary variable after updating is returned after unit quantity to step 1.4, if not including the value of the tree node, carry out step 1.6;
Step 1.6, by current tree node add ephemeral data set in, judge current tree node tree-encoding length whether Equal to level threshold value, if equal to level threshold value, current tree node being added into the results list, if being not equal to level threshold value, entered Row step 1.7;
Step 1.7, judge whether the tree-encoding length of current tree node is more than level threshold value, if less than level threshold value, it is right The temporary variable after updating is returned to after current temporary variable increase unit quantity to step 1.4, if more than level threshold value, being walked Rapid 1.8;
Step 1.8, current tree node tree-encoding is updated to the tree node that length subtracts level threshold value, from ephemeral data set The middle child list for taking out tree node corresponding to tree-encoding after renewal, it is right after current tree node is added in child list The temporary variable after updating is returned after current temporary variable increase unit quantity to step 1.4, is set if tree-encoding is corresponding after updating The value of node is sky, then carries out step 1.9;
Step 1.9, the new tree node of establishment simultaneously set the tree-encoding of new tree node to be the tree-encoding after step 1.8 renewal, then Current tree node is updated to new tree node and as new current tree node, is key assignments and new tree node by tree-encoding after renewal Ephemeral data set is stored in for the data of value, then judges whether tree-encoding length is equal to level threshold value after updating again, if waiting In level threshold value, the data of new tree node are added into the results list, current temporary variable is increased after unit quantity and returned after renewal Temporary variable to step 1.4, if being not equal to level threshold value, carry out step 1.7.
In the above method, described step 1 is additionally included in the results list and deletes data, specially deletes data correspondence Tree node and using the tree-encoding of the tree node as all tree nodes of prefix tree-encoding.
In the above method, described step 2 is read using LI KE sentences.
Compared with prior art, beneficial effects of the present invention:
1. proposing each node in a kind of encoding scheme of tree-encoding, tree structure has a unique tree-encoding, Tree-encoding embodies the set membership between back end, by the form of tree-encoding can by complicated tree structure relation data with The form of bivariate table is stored;
2. the bivariate table stored using the form of tree-encoding can store the data of the tree structure of infinite depth in theory, As long as the form that data are arranged in strict accordance with tree-encoding, the tree for only needing to pay close attention to the father node of present node in storing process is compiled The quantity of code and all brotghers of node is the tree-encoding that can obtain present node;
3. in the case where ensuring that all data are encoded according to tree-encoding form, carried out for tree structure data CRUD process very simples, ensure tree-encoding under the premise of correct without being concerned about the letters of other any nodes during establishment Breath, only needs to utilize simple LI KE sentences during related data is read, and during data are changed, only needs Simple tree-encoding attribute modification is carried out, only needs to delete corresponding node in data procedures are deleted and its is compiled with the node tree Code is all nodes of its prefix tree-encoding;
4. according to the characteristic of tree-encoding, it is proposed that a kind of general flow for reading tree structure, the flow provides one kind General tree structure read schemes based on tree-encoding, recursive fashion could form tree-like the need for the present invention has abandoned tradition The mode of structure, whole reading process only need to all related datas carry out once simple traversal processing can form tree-like Structure, implementation is easy to use, maintainable, workable.
Brief description of the drawings
Fig. 1 is some areas tree structure schematic diagram;
Fig. 2 is the tree-like structural representation of left and right value coding;
Fig. 3 is the operating process schematic diagram of analyzing step of the present invention;
Fig. 4 is main flow schematic diagram of the invention.
Embodiment
All features disclosed in this specification, or disclosed all methods or during the step of, except mutually exclusive Feature and/or step beyond, can combine in any way.
The present invention will be further described below in conjunction with the accompanying drawings:
Present invention also offers a kind of characteristic of utilization tree-encoding, tree structure data reading is carried out without recursive fashion Solution.
To reach above-mentioned purpose, what what the present invention was implemented be specifically realized in:
A kind of general tree structure storing and resolving system, this method includes:Tree-encoding, the solution of general reading tree Two parts.
Tree-encoding, is a kind of coded system, and the coded system is encoded for every layer of tree structure using 2, every Value is numeral and letter, and letter includes capital and small letter, and digital alphabet carries out incremented by successively, which in the way of 0-9a-zA-Z In every can have 62 optional characters, dibit encoding can have 3843 kinds of different modes, to general tree structure individual layer There is the possibility very little of 3843 nodes, so two tree-encodings just, can if it is expected that individual layer interstitial content is very big in theory To increase every layer of tree-encoding digit, hereinafter associated description is encoded with giving tacit consent to 2.The tree-encoding mode is directed to three It is 56 755 918 107 that layer tree construction, which can accommodate interstitial content,.Only needed to per the corresponding child node of layer data in father node Increase the coding that dibit encoding carries out the node on the basis of tree-encoding, and coded sequence is 01,02 to ZZ mode.Tree is compiled The table structure of code is typically designed to { id, name, treeCode }, and table name is tree.
The general solution for reading tree is that one kind abandons recursive fashion, directly utilizes tree by program inter-process mode The process that the characteristics of coding embodies the tree-like relation of data., it is necessary to reappear using some node as root in reading process Tree structure, it is only necessary to using the list of related all nodes of corresponding node as Parameter, then parsed, have Body resolving is as shown in Figure 3.
The general solution for reading tree, as shown in figure 3, mainly comprising the following steps:
It is determined that the highest level of reading node is needed, and all data related with the level, which passes through simple Sql inquiry can draw correspondence result;
The ephemeral data set map of temporary storage node is created, fast and easy determines the corresponding numbers of tree-encoding treeCode According to being to have treated, returning result list is created;
Traversal processing list related interior joint data;
The tree node treeNode of the corresponding node datas of treeCode is taken out from the map of temporary storage node, if Father node is created during processing child node before being represented for non-NULL, setting parent information is now only needed;
If treeNode nodes are sky, by the rule of tree-encoding, father node is built successively, and father node is added In map, then the data configuration of tree structure is completed by this way;
In whole processing procedure, if the treeCode of node is equal to level * 2, this node is added to return knot In fruit list.
Embodiment 1
Table structure of the present invention is { id, name, treeCode }.The data in Fig. 1 are arranged first, lattice are stored Formula is as shown in table 3.
The tree-encoding of table 3 stores some areas information
In the table structure, the process for carrying out CRUD is as follows:
Increase node, when increasing the Xindu District of new node, such as Sichuan Province Chengdu subordinate in the table, only need The maximum numbering observed in the maximum numbering of the current child node below Chengdu, table 3 is Jinniu District 020105, so will Xindu District tree-encoding is 020106.Perform insertion sentence as follows:
INSERT INTO tree (name, treeCode) VALUES (' Xindu District ', ' 020106').
Data are table 4 after insertion, and the relation between data has just been automatically formed after data are inserted by way of tree-encoding, And the data newly inserted do not influence on other data.
Area data behind the insertion of table 4 Xindu District
Node is changed, directly node can be grasped in the case of ensuring that node treeCode hierarchical relationships are immovable Make, if integrally-built movement simultaneously, therefore, to assure that father and son's node is modified, it is assumed that the treeCode in Chengdu is repaiied It is changed to 0204.Change sentence as follows:UPDATE`tree`SET treeCode=CONCAT (" 0204 ", RIGHT (treeCode, LENGTH (`treeCode`) -4)) WHERE treeCode LIKE'0201%'.
Perform database data after modification sentence as shown in table 5.If advised in the case of inessential not to possessing child node Node carry out treeCode modification.
Area data after the modification of table 5 Chengdu treeCode
Deletion of node, to the deletion action of some node, it is only necessary to match the treeCode of the node, it is assumed that to delete moral Yang Shi, the treeCode of Deyang City is 0202.Perform cancel statement as follows:
Delete from`tree`WHERE treeCode LIKE'0202%'.
Perform database data after cancel statement as shown in table 6.
Table 6 deletes area data after Deyang City
Query node, to the inquiry operation of some node, it is only necessary to match the treeCode of the node, it is assumed that to inquire about four Chuan Sheng, the treeCode in Sichuan Province is 02.Perform cancel statement as follows:
Select*from`tree`WHERE treeCode LIKE'02%'
Perform database data after query statement as shown in table 7.
Area data behind the inquiry of table 7 Sichuan Province
The process for carrying out tree structure reading in the data to the table is as follows:
Assuming that it is Sichuan Province to read data, the level in Sichuan Province is 1, in order to preferably describe the general solution for reading tree Scheme, is simply adjusted, structure is as shown in table 8 after adjustment to the result form for reading Sichuan Province's related data.
The general reading tree structure data flow map flow chart provided according to Fig. 3 is, it is necessary to be stored in Sichuan Province's relative region Data list, it is concretely comprised the following steps:
Step 301, the related area data list in Sichuan Province of reading is assigned to dList, observation determines the layer in Sichuan Level is 1, so level is entered as into 1, into step 302;
Step 302, establishment returning result tList, for storing final returning result list, create interim storage data Map and temporary variable i, and i is entered as 0, into step 303;
Step 303, judge whether i is less than dList length, if being more than, then step 319 is jumped to, less than then entering Enter 304 flows;
I-th of element in step 304, reading dList, the data read for the first time are that line number is the data that 1, id is 9, it Corresponding title is Jinniu District, and treeCode is 020101, and the data processing of later step is entered both for the flow of Jinniu District OK, into step 305;
Step 305, judge whether to contain key in map for 020101 data, due to data in first time typing map For sky, so into step 308;
Step 308, setting Jinniu District node are into map, into step 309;
Step 309, judge whether treeCode length is 2 (because level is equal to 1, Rule of judgment is level*2), gold Ox area node treeNode treeCode is 6, into step 311;
Step 311, judge treeCode length whether be more than 2, current treeCode be 020101, into step 312;Such as Fruit length is not more than 2 and enters step 307;
Step 312, the renewal treeCode strings that treeCode length subtracts 2 for before, the treeCode after renewal is 0201, TreeCode respective values are taken out from map, into step 313;
There was only 020101 this key value in step 313, present map, so when looking for the value that key is 0201 in map Data are sky, into step step 314;
Step 314, newTreeNode nodes are created, and set the treeCode of this newTreeNode node to be 0201, Jinniu District node is put into newTreeNode child node;TreeNode before is entered as newTreeNode; It is the data that 0201 value is treeNode that key is stored in map, into step 315;
Whether step 315, the length for judging current treeCode are 2, are currently 0201, are not 2 to enter steps 311, Enter step 316 when length is 2;
Step 316, treeNode added in the results list tList, into step 311;
Due to passing through processing above, current treeCode is 0201, and length is more than 2, so also needing to perform a wheel Since 311 to 316 flow.After this node of Jinniu District is added, have 02 in the map of interim storage data, 0201, The corresponding data of 020101 3 key, have the node data that treeCode is 02 in the tList of final result.
The mode of other nodes of typing is carried out in strict accordance with Fig. 3 flow chart, in order to better illustrate whole flow process figure, under Typing flow of the text to line number in table 8 for 7 Sichuan Province's back end is described:
Line number id name treeCode
1 9 Wuhou District 020101
2 10 Qingyang District 020102
3 11 Chenghua district 020103
4 16 Mianyang City 0203
5 12 Jinjiang District 020104
6 13 Jinniu District 020105
7 7 Sichuan Province 02
8 17 Jiangyou City 020301
9 18 San Tai cities 020302
10 8 Chengdu 0201
11 19 Xindu District 020106
Area data behind the inquiry of table 8 Sichuan Province
Element when step 304, taking-up i=6, the line number of the element is that 7, treeCode is that 02, name is Sichuan Province, is entered Enter step 305;
Step 305, the data that treeCode is 02 are taken from map, should when first time typing Jinniu District Data are put into map, corresponding node treeNode are taken out, into step 306;
Step 306, the entitled Sichuan Province that treeNode is set, into step 307;
Step 307, i increases by 1, into step 303;
By the traversal to dList data lists, by processing of each node data by step 304 to step 318, just A complete tree structure can be formed.TList only one of which node data is Sichuan Province, correspondence in total TreeCode is 02;Its child node be treeCode be 0203 Mianyang City, treeCode be 0201 Chengdu;Mianyang City Child node be treeCode be 020301 Jiangyou City, treeCode be 020302 San Tai cities;The child node in Chengdu is Chenghua district that Qingyang District that Wuhou District that treeCode is 020101, treeCode are 020102, treeCode are 020103, The Xindu District that Jinniu District that Jinjiang District that treeCode is 020104, treeCode are 020105, treeCode are 020106.
The such scheme provided from the present invention is as can be seen that the tree proposed in general tree structure storage and parsing scheme Coding causes the expression for the relation of tree structure data to become simple, clear, is caused by the coded system to dependency number Become simple according to the process logic for carrying out CRUD, user only needs to carry out nodes encoding in accordance with the mode of tree-encoding, and data are entered With regard to the tree structure relation between data can be kept after row CUD operations.The general flow for reading tree structure provides a kind of base Recursive fashion could form tree-like the need for tradition has been abandoned in the general tree structure read schemes of tree-encoding, the program The mode of structure, whole reading process only need to all related datas carry out once simple traversal processing can form tree-like Structure, implementation is easy to use, maintainable, workable.
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any Belong to those skilled in the art the invention discloses technical scope in, the change or replacement that can be readily occurred in, all should It is included within the scope of the present invention.

Claims (4)

1. a kind of general tree structure storing and resolving method, it is characterised in that including
Step 1, the data list generated by temporary variable searching loop by level associated data, read the radical of data list According to, utilize burl point feature in data list, with reference to ephemeral data set build threshold condition, the burl to meeting threshold condition Point sequentially incrementally sets tree-encoding, then by current tree node correspondence tree-encoding deposit ephemeral data set in data list, is following At the end of ring, the complete tree-like ephemeral data set of relative data list is obtained;
Step 2, correspondence single data search ephemeral data set, obtain the root tree node and all children tree nodes of tree structure.
2. a kind of general tree structure storing and resolving method according to claim 1, it is characterised in that described step 1, comprise the following steps:
Step 1.1, the attribute for being defined in each level each burl point data of correspondence are unique sequence number and tree-encoding;
Step 1.2, data list that is default and reading the association of data level;
Step 1.3, create the results list, with tree-encoding be key assignments and tree node be value data ephemeral data set and use In the temporary variable of each tree node sequence number cycle traversal of correspondence;
Step 1.4, judge whether current temporary variable is less than the sequence length of data list, if current temporary variable is less than data The sequence length of list, then carry out step 1.5, ought if current temporary variable is more than or equal to the sequence length of data list The data of preceding tree node are back to the results list and terminated;
Step 1.5, the current tree node obtained in current temporary variable corresponding data list, judge in ephemeral data set whether The value of tree node comprising correspondence current tree node tree-encoding key assignments, if including the value of the tree node, takes out temporary data set The value of tree node is closed, then sets the value of current tree node to be the value of ephemeral data set tree node, to the increase of current temporary variable The temporary variable after updating is returned after unit quantity to step 1.4, if not including the value of the tree node, step 1.6 is carried out;
Step 1.6, by current tree node add ephemeral data set in, judge whether the tree-encoding length of current tree node is equal to Level threshold value, if equal to level threshold value, current tree node being added into the results list, if being not equal to level threshold value, walked Rapid 1.7;
Step 1.7, judge whether the tree-encoding length of current tree node is more than level threshold value, if less than level threshold value, to current The temporary variable after updating is returned to after temporary variable increase unit quantity to step 1.4, if more than level threshold value, carrying out step 1.8;
Step 1.8, current tree node tree-encoding is updated to the tree node that length subtracts level threshold value, taken from ephemeral data set Go out the child list of tree node corresponding to tree-encoding after updating, after current tree node is added in child list, to current The temporary variable after updating is returned to after temporary variable increase unit quantity to step 1.4, if tree node corresponding to tree-encoding after updating Value for sky, then carry out step 1.9;
Step 1.9, the new tree node of establishment simultaneously set the tree-encoding of new tree node to be the tree-encoding after step 1.8 renewal, then ought Preceding tree node is updated to new tree node and as new current tree node, and by tree-encoding after renewal be key assignments and new tree node is value Data deposit ephemeral data set, then again judge update after tree-encoding length whether be equal to level threshold value, if be equal to layer The data of new tree node are added the results list by level threshold value, current temporary variable is increased facing after updating is returned after unit quantity Variations per hour is to step 1.4, if being not equal to level threshold value, carries out step 1.7.
3. a kind of general tree structure storing and resolving method according to claim 1 or 2, it is characterised in that described Step 1, it is additionally included in the results list and deletes data, specially deletes the corresponding tree node of data and the tree with the tree node It is encoded to all tree nodes of prefix tree-encoding.
4. a kind of general tree structure storing and resolving method according to claim 1, it is characterised in that described step 2, it is read using LIKE sentences.
CN201710191450.7A 2017-03-28 2017-03-28 Universal tree structure storage and analysis method Active CN107092659B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710191450.7A CN107092659B (en) 2017-03-28 2017-03-28 Universal tree structure storage and analysis method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710191450.7A CN107092659B (en) 2017-03-28 2017-03-28 Universal tree structure storage and analysis method

Publications (2)

Publication Number Publication Date
CN107092659A true CN107092659A (en) 2017-08-25
CN107092659B CN107092659B (en) 2021-05-28

Family

ID=59649011

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710191450.7A Active CN107092659B (en) 2017-03-28 2017-03-28 Universal tree structure storage and analysis method

Country Status (1)

Country Link
CN (1) CN107092659B (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108924215A (en) * 2018-06-28 2018-11-30 北京顺丰同城科技有限公司 A kind of service discovery processing method and processing device based on tree structure
CN109766337A (en) * 2018-11-28 2019-05-17 杭州云为科技有限公司 Storage method, electronic equipment, storage medium and the system of tree structure data
CN110019006A (en) * 2017-10-16 2019-07-16 航天信息股份有限公司 A kind of method and system classified and sorted for infinite stages
CN110704450A (en) * 2019-10-14 2020-01-17 北京和利时系统工程有限公司 Method and device for realizing data processing, computer storage medium and terminal
CN110889022A (en) * 2018-08-17 2020-03-17 迈普通信技术股份有限公司 Data query method and device and electronic equipment
CN111475482A (en) * 2020-04-03 2020-07-31 北京东方金信科技有限公司 HDFS (Hadoop distributed File System) data display method and device
CN112000667A (en) * 2020-08-10 2020-11-27 多点(深圳)数字科技有限公司 Method, apparatus, server and medium for retrieving tree data
CN112446594A (en) * 2020-11-12 2021-03-05 书丸子(北京)科技有限公司 Multi-level quantifiable computing method for comprehensive ability analysis of preschool children
CN113039547A (en) * 2018-10-10 2021-06-25 美光科技公司 Counter-based compression of key-value storage tree data blocks
CN113095719A (en) * 2021-04-29 2021-07-09 中国科学院水生生物研究所 Lake ecosystem health evaluation and restoration method
CN113628038A (en) * 2021-08-30 2021-11-09 中国银行股份有限公司 Bank invoice tax number change processing method and system based on block chain
CN113676437A (en) * 2020-05-14 2021-11-19 中国移动通信集团云南有限公司 Parameter analysis method, parameter acquisition method, parameter setting method and device
CN113961713A (en) * 2021-09-29 2022-01-21 中国科学院计算机网络信息中心 Graph data structure representing, storing and inquiring method and device based on hierarchical coding
CN115407942A (en) * 2022-08-29 2022-11-29 深圳市锦锐科技股份有限公司 Data processing method suitable for single chip microcomputer chip
CN112000667B (en) * 2020-08-10 2024-04-12 多点(深圳)数字科技有限公司 Method, apparatus, server and medium for retrieving tree data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102867059A (en) * 2012-09-19 2013-01-09 浪潮(北京)电子信息产业有限公司 Method and system for processing data in treelike structures
US20130151565A1 (en) * 2011-12-08 2013-06-13 Xerox Corporation Arithmetic node encoding for tree structures
CN106339450A (en) * 2016-08-25 2017-01-18 成都索贝数码科技股份有限公司 Index method of tree-shaped data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130151565A1 (en) * 2011-12-08 2013-06-13 Xerox Corporation Arithmetic node encoding for tree structures
CN102867059A (en) * 2012-09-19 2013-01-09 浪潮(北京)电子信息产业有限公司 Method and system for processing data in treelike structures
CN106339450A (en) * 2016-08-25 2017-01-18 成都索贝数码科技股份有限公司 Index method of tree-shaped data

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019006B (en) * 2017-10-16 2022-03-04 航天信息股份有限公司 Method and system for infinite classification and sorting
CN110019006A (en) * 2017-10-16 2019-07-16 航天信息股份有限公司 A kind of method and system classified and sorted for infinite stages
CN108924215B (en) * 2018-06-28 2021-03-19 北京顺丰同城科技有限公司 Service discovery processing method and device based on tree structure
CN108924215A (en) * 2018-06-28 2018-11-30 北京顺丰同城科技有限公司 A kind of service discovery processing method and processing device based on tree structure
CN110889022A (en) * 2018-08-17 2020-03-17 迈普通信技术股份有限公司 Data query method and device and electronic equipment
CN113039547A (en) * 2018-10-10 2021-06-25 美光科技公司 Counter-based compression of key-value storage tree data blocks
CN109766337A (en) * 2018-11-28 2019-05-17 杭州云为科技有限公司 Storage method, electronic equipment, storage medium and the system of tree structure data
CN109766337B (en) * 2018-11-28 2023-05-09 杭州云为科技有限公司 Tree structure data storage method, electronic device, storage medium and system
CN110704450A (en) * 2019-10-14 2020-01-17 北京和利时系统工程有限公司 Method and device for realizing data processing, computer storage medium and terminal
CN110704450B (en) * 2019-10-14 2023-02-17 北京和利时系统集成有限公司 Method and device for realizing data processing, computer storage medium and terminal
CN111475482B (en) * 2020-04-03 2023-09-05 北京东方金信科技股份有限公司 HDFS data display method and device
CN111475482A (en) * 2020-04-03 2020-07-31 北京东方金信科技有限公司 HDFS (Hadoop distributed File System) data display method and device
CN113676437A (en) * 2020-05-14 2021-11-19 中国移动通信集团云南有限公司 Parameter analysis method, parameter acquisition method, parameter setting method and device
CN113676437B (en) * 2020-05-14 2023-08-18 中国移动通信集团云南有限公司 Parameter acquisition method, parameter setting method and device
CN112000667A (en) * 2020-08-10 2020-11-27 多点(深圳)数字科技有限公司 Method, apparatus, server and medium for retrieving tree data
CN112000667B (en) * 2020-08-10 2024-04-12 多点(深圳)数字科技有限公司 Method, apparatus, server and medium for retrieving tree data
CN112446594A (en) * 2020-11-12 2021-03-05 书丸子(北京)科技有限公司 Multi-level quantifiable computing method for comprehensive ability analysis of preschool children
CN112446594B (en) * 2020-11-12 2023-07-21 书丸子科技(云南)有限公司 Multi-level quantifiable calculation method for analysis of comprehensive capacity of preschool children
CN113095719A (en) * 2021-04-29 2021-07-09 中国科学院水生生物研究所 Lake ecosystem health evaluation and restoration method
CN113095719B (en) * 2021-04-29 2022-05-06 中国科学院水生生物研究所 Lake ecosystem health evaluation and restoration method
CN113628038A (en) * 2021-08-30 2021-11-09 中国银行股份有限公司 Bank invoice tax number change processing method and system based on block chain
CN113961713A (en) * 2021-09-29 2022-01-21 中国科学院计算机网络信息中心 Graph data structure representing, storing and inquiring method and device based on hierarchical coding
CN115407942A (en) * 2022-08-29 2022-11-29 深圳市锦锐科技股份有限公司 Data processing method suitable for single chip microcomputer chip

Also Published As

Publication number Publication date
CN107092659B (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN107092659A (en) A kind of general tree structure storing and resolving method
CN109445834B (en) Program code similarity rapid comparison method based on abstract syntax tree
CN104866593B (en) A kind of database search method of knowledge based collection of illustrative plates
CN109657074B (en) News knowledge graph construction method based on address tree
CN103514201B (en) Method and device for querying data in non-relational database
CN104809117B (en) Video data aggregation processing method, paradigmatic system and video search platform
CN106649464A (en) Method of building Chinese address tree and device
CN102867049B (en) Chinese PINYIN quick word segmentation method based on word search tree
US11789923B2 (en) Compression units in an index block
JP2004518226A (en) Database system and query optimizer
CN107291858B (en) Data indexing method based on character string suffix
CN107766555A (en) Image search method based on the unsupervised type cross-module state Hash of soft-constraint
CN106131139A (en) The encryption of the floating data of a kind of cloud relational database and querying method
CN103123650A (en) Extensible markup language (XML) data bank full-text indexing method based on integer mapping
CN113094449A (en) Large-scale knowledge map storage scheme based on distributed key value library
CN109299443B (en) News text duplication eliminating method based on minimum vertex coverage
Sun et al. GEDIT: geographic-enhanced and dependency-guided tagging for joint POI and accessibility extraction at baidu maps
CN107679187A (en) A kind of construction method and device of Chinese address tree
CN115203337A (en) Database metadata relation knowledge graph generation method
CN104615782A (en) Address matching method based on sliding window maximum matching algorithm
CN109933589A (en) The data structure conversion method based on ElasticSearch aminated polyepichlorohydrin result for data summarization
CN115840751B (en) Novel tree-shaped data coding method
Xu et al. Construction of chinese sports knowledge graph based on neo4j
Zheng et al. INSPIRE: A framework for incremental spatial prefix query relaxation
US20090112913A1 (en) Efficient mechanism for managing hierarchical relationships in a relational database system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant