CN107807932A - A kind of hierarchical data management method and system based on path enumeration - Google Patents

A kind of hierarchical data management method and system based on path enumeration Download PDF

Info

Publication number
CN107807932A
CN107807932A CN201610812627.6A CN201610812627A CN107807932A CN 107807932 A CN107807932 A CN 107807932A CN 201610812627 A CN201610812627 A CN 201610812627A CN 107807932 A CN107807932 A CN 107807932A
Authority
CN
China
Prior art keywords
node
hierarchical data
destination node
interface
inquiry
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
CN201610812627.6A
Other languages
Chinese (zh)
Other versions
CN107807932B (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.)
Tencent Technology Shenzhen Co Ltd
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610812627.6A priority Critical patent/CN107807932B/en
Publication of CN107807932A publication Critical patent/CN107807932A/en
Application granted granted Critical
Publication of CN107807932B publication Critical patent/CN107807932B/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/2228Indexing structures
    • G06F16/2272Management 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/21Design, administration or maintenance of databases
    • G06F16/214Database migration support
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24564Applying rules; Deductive queries
    • G06F16/24566Recursive queries
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application

Abstract

The present invention proposes a kind of hierarchical data management method and system based on path enumeration, and hierarchical data is stored in non-relational database in the form of secondary index, and the hierarchical data is tree-type structure data;In the secondary index, first order index is the root node of tree, second level index is the destination node of tree, the target data that the secondary index points to includes the root node to the path data of the destination node, in addition, also include inquiring about the hierarchical data, include the superior node and downstream site of inquiry destination node.Hierarchical data is stored in non-relational database by the present invention with the storage mode of the key assignments of secondary index, higher by using non-relational database, read-write efficiency;Recursive mode is exempted from using path enumeration and realizes inquiry to hierarchical data, search efficiency is more excellent.

Description

A kind of hierarchical data management method and system based on path enumeration
Technical field
The present invention relates to data management field, and in particular to hierarchical data management method and system based on path enumeration.
Background technology
In the instant communications field, two kinds of MSNs be present, the respectively instant messaging based on flat architecture is soft Part and the instant communication software applied to multi-level architecture, wherein, multi-level architecture is used to represent that the superior and the subordinate between user to close System.It is in tree-shaped knot because the data model of the communication software based on flat architecture can not be handled for characterize multi-level architecture The hierarchical data of structure, therefore the communication software based on flat architecture is difficult to support between it the user of relationship between superior and subordinate be present Communication, so as to limit its use range.
At present, it is the tissue based on relevant database MySql progress hierarchical datas mostly, specifically using MySql The mode organizational hierarchy data combined with adjacency list, and MySql is to use hard disk relatively low as memory, read-write efficiency, is being entered SQL statement recursive query is needed to use during the read-write of row hierarchical data or carries out the correlation inquiry of multilist so that system operation It is complicated;Non-relational database organizational hierarchy data by way of fit adjacent table can also be selected, but use adjacency list The increase increased with network flow consumption of the network interaction number in the interaction about hierarchical data can be caused.
The content of the invention
In order to solve the above-mentioned technical problem, the present invention propose a kind of hierarchical data management method based on path enumeration and System.The present invention is realized with following technical scheme:
A kind of hierarchical data management method based on path enumeration, including:
Hierarchical data is stored in non-relational database in the form of secondary index, the hierarchical data is tree-shaped knot Structure data;
In the secondary index, the first order index for tree root node, the second level index for tree destination node, described two The target data that level index points to includes the root node to the path data of the destination node.What the secondary index pointed to Target data also includes depth value, and the depth value represents hierarchical location of the destination node in tree.
Also include inquiring about the hierarchical data, include the superior node and downstream site of inquiry destination node.Institute The superior node of inquiry destination node is stated, includes the father node and ancestor node of inquiry destination node.The inquiry destination node Downstream site, include inquiry destination node child node and descendent node.
Also include the hierarchical data is inserted, deleted and/or migrated.
A kind of hierarchical data management system based on path enumeration, including:
Secondary index builds module, and for building the secondary index of hierarchical data, the hierarchical data is tree number According in the secondary index, first order index is the root node of tree, and the second level is indexed as the destination node of tree, the two level rope Drawing the target data of sensing includes the root node to the path data of the destination node;
Database sharing module, for the hierarchical data to be stored in into non-relational database in the form of secondary index In.
Also include:Data inquiry module;The data inquiry module includes higher level and inquires about submodule and subordinate's inquiry submodule Block, the higher level inquire about the superior node that submodule is used to inquire about destination node, and subordinate's inquiry submodule is used to inquire about mesh Mark the downstream site of node.
The higher level, which inquires about submodule, includes immediate superior query unit and whole higher level's query units, the immediate superior Query unit is used for the father node for inquiring about the destination node, and whole higher level's query units are used to inquire about the destination node Ancestor node.
Subordinate's inquiry submodule includes direct subordinate's query unit and whole subordinate's query units, the direct subordinate Query unit is used for the child node for inquiring about the destination node, and whole subordinate's query units are used to inquire about the destination node Descendent node.
Also include:Database operating modules, for expanding the function logic of database, the function logic include insertion, Delete and/or migrate.
Also include:Interface module, for providing the interface operated to database, the interface module provides inquiry and connect Mouth, insertion interface, delete interface and/or migration interface.
A kind of instantaneous communication system, including the above-mentioned hierarchical data management system based on path enumeration, in addition to:
Database operating modules, for expanding the function logic of database, the function logic includes insertion, delete and/ Or migration;
Interface module, for providing the interface operated to database, the interface module includes query interface, insertion Interface, interface and/or migration interface are deleted, the insertion interface is used to provide the interface for inserting hierarchical data, described Delete interface to be used to provide the interface for deleting hierarchical data, the migration interface, which is used to provide, grasps hierarchical data The interface of work.
Also include:
Instant communication server and at least one instant communication client;
The instant communication client is used to send operational order;
The instant communication server is used to receive operational order, calls the relevant interface of the interface module, realizes more Communication between hierarchy.
The beneficial effects of the invention are as follows:
(1) non-relational database organizational hierarchy data are used, non-relational database uses internal memory or solid state hard disc (SSD) storage and read-write of data are carried out, it is stored and data read-write efficiency is higher.
(2) by recording the All Paths of tree hierarchy data in the form of enumerating, and by described in secondary index organization Path, it can realize and recursive query is exempted to hierarchical data, so that search efficiency is more excellent, the operation related to hierarchical data The response speed of instruction is faster.
(3) in the hierarchical data management system based on path enumeration, the algorithm logic related to hierarchical data management and deposit Storage management is realized in a modular manner, so that the hierarchical data management system becomes with interacting between other systems Simply, the adaptability and portability of hierarchical data management system are enhanced;
(4) by being interacted with the hierarchical data management system based on path enumeration so that can only support originally flat The communication of user between multi-level architecture can be supported by changing the instantaneous communication system of communication, so as to expand the suitable of flattening communication software Use scope.
Brief description of the drawings
Fig. 1 (a) is the tree figure of hierarchical data;
Fig. 1 (b) is with the schematic diagram of the formal recording layer DBMS of adjacency list;
Fig. 2 is a kind of flow chart for hierarchical data management method based on path enumeration that embodiment 1 provides;
Fig. 3 is the network interaction schematic diagram of adjacency list recursive query in embodiment 1;
Fig. 4 is full dose pulling data laminar flow amount schematic diagram in embodiment 1;
Fig. 5 (a) is the tree figure of hierarchical data in embodiment 1;
Fig. 5 (b) is with the schematic diagram in the path of formal recording layer DBMS enumerated in embodiment 1;
Fig. 6 is a kind of schematic diagram of the hierarchical data management system based on path enumeration provided in embodiment 3;
Fig. 7 is data inquiry module schematic diagram in embodiment 3;
Fig. 8 is a kind of schematic diagram of the instantaneous communication system provided in embodiment 4;
Fig. 9 is the timing diagram of the inquiry operation provided in embodiment 4;
Figure 10 is the timing diagram of the insertion operation provided in embodiment 4;
Figure 11 is the timing diagram of the deletion action of the leaf node provided in embodiment 4;
Figure 12 is the timing diagram of the flexible deletion action of the branch provided in embodiment 4;
Figure 13 is the timing diagram of the Force Deletion operation of the branch provided in embodiment 4;
Figure 14 is the timing diagram of the migration operation provided in embodiment 4.
Specific implementation method
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people The every other embodiment that member is obtained under the premise of creative work is not made, it should all belong to the model that the present invention protects Enclose.
It should be noted that term " comprising " and " having " and their any deformation, it is intended that covering is non-exclusive Include, be not necessarily limited to clearly arrange for example, containing the process of series of steps or unit, method, system, product or equipment Those steps or unit gone out, but may include not list clearly or consolidate for these processes, method, product or equipment The other steps or unit having.
Supporting the field of wireless communications based on multi-level architecture using relevant database MySql fit adjacent tables Mode manages the hierarchical data in tree, data management side of this method different from the use of non-relational database NoSql Formula, following drawbacks be present:
(1) it is compared for non-relational database and relational data library facility, as a result as shown in table 1:
The MySQL of table 1 and NoSql function contrast table
Functional characteristic Relevant database MySql Non-relational database NoSql
Data storage length Unrestrictedly 64kb
Complicated inquiry operation Support Do not support
Data reading performance using redundancy It is relatively low It is higher
Data storage method Hard disk Internal memory and hard disk
Automated back-up One main prepare more One main prepare more
Strange land stores Support Support
Automatic dilatation Do not support Support
It is as follows for the analysis result of table 1:
In the instant communications field, MySql data length unrestrictedly has little significance, but strange land storage and automatic dilatation are but Management for hierarchical data has practical significance.MySql does not support automatic dilatation, so as to be MySql in instant communication software Use bring hidden danger.
MySql supports complicated inquiry operation, therefore is had using MySql management levels data and develop simple advantage, But MySql data reading performance using redundancies are relatively low, in the instant communications field, it is necessary to perform more query actions to hierarchical data, show So, software performance is developed more preferably using NoSql.
NoSql relies on internal memory and hard disk to carry out data storage, compared to the MySql for relying on hard disk, it is clear that has higher The speed of service.
In summary, compared to non-relational database NoSql in performance there is larger difference in relevant database MySql Away from.
(2) in relevant database MySql using adjacency list storage hierarchical data, occupy little space, change efficiency high but It is that search efficiency is low:
, it is necessary to handle the service logic of many complexity in multi-level architecture module, such as the higher level of inquiry destination node Node and downstream site, the superior node of the inquiry destination node include the father node and ancestor node of inquiry destination node, The downstream site of the inquiry destination node includes the child node and descendent node of inquiry destination node;These operations are required to pass Return inquiry.As shown in figure 1, Fig. 1 (a) is the tree figure of hierarchical data, Fig. 1 (b) is the formal recording layer level with adjacency list The schematic diagram of data.Wherein, it is higher level that MySql each row of data, which records a node and an associated nodes, the associated nodes, Node and downstream site, it is required to use recursive mode when inquiring about superior node and downstream site, causes performance to be lost, for Unfamiliar developer or DBA DBA, performance loss will be more serious.
In summary, to lift the storage and management performance of hierarchical data, non-relational database organized layer series is used According to prominent advantage.
Embodiment 1:
As shown in Fig. 2 a kind of hierarchical data management method based on path enumeration is present embodiments provided, including:
S101. hierarchical data is stored in non-relational database in the form of secondary index, the hierarchical data is Tree-type structure data.
In the secondary index, the first order index for tree root node, the second level index for tree destination node, described two The target data that level index points to includes the root node to the path data of the destination node.What the secondary index pointed to Target data also includes depth value, and the depth value represents hierarchical location of the destination node in tree.
S102. the hierarchical data is inquired about, inserted, deleted and/or migrated.
The inquiry includes inquiring about the superior node and downstream site of destination node.
The superior node of the inquiry destination node, include the father node and ancestor node of inquiry destination node.It is described to look into The downstream site of destination node is ask, includes the child node and descendent node of inquiry destination node.
Inquired about in the prior art using non-relational database, there can be two kinds of situations:
The first situation, using secondary index (KeyKeyRow) storage mode organizational hierarchy data and select adjacency list Hierarchical data is represented, the inquiry for hierarchical data is realized by recursive query, as shown in figure 3, every 1 inquiry request is on backstage Averagely produce the request amount of 3 times.
Second of situation, using the storage mode organizational hierarchy data of key-value pair (KeyValue), as shown in figure 4, in number According in inquiry operation, every time operation all can full dose pulling data, network throughput will lift 1 order of magnitude.
Be lost in the prior art using performance caused by non-relational database inquiry to overcome, in the present embodiment by with All Paths for the form record tree hierarchy data enumerated, and by path described in secondary index organization, can realize for Hierarchical data exempts from recursive query, so as to solve the problems, such as that above-mentioned network interaction number becomes more and network traffics increase, wherein The storage mode of path enumeration is shown in Fig. 5, wherein, Fig. 5 (a) is the tree figure of hierarchical data, and Fig. 5 (b) is to enumerate Formal recording layer DBMS path schematic diagram.
The storage of hierarchical data is carried out in the present embodiment based on non-relational database, readwrite performance has significant advantage; Realize and exempt from recursive query solve the problems, such as that network interaction number becomes more and network traffics increase by using path enumeration, from And ensure higher search efficiency.
Embodiment 2:
A kind of hierarchical data management method based on path enumeration is present embodiments provided, including:
S201. hierarchical data is stored in non-relational database in the form of secondary index, the hierarchical data is Tree-type structure data.
In the secondary index, the first order index for tree root node, the second level index for tree destination node, described two The target data that level index points to includes the root node to the path data of the destination node.What the secondary index pointed to Target data also includes depth value, and the depth value represents hierarchical location of the destination node in tree.For the tree in Fig. 5 (a) Shape structure, the concrete structure of the storage in the non-relational database are as shown in table 2;
The specific storage organization of secondary index in the non-relational database of table 2
S202. the hierarchical data is inquired about, inserted, deleted and/or migrated,
Inquiry to the hierarchical data includes inquiring about the superior node and downstream site of destination node.
The superior node of the inquiry destination node, include the father node and ancestor node of inquiry destination node, it is described to look into The downstream site of destination node is ask, includes the child node and descendent node of inquiry destination node.
The present embodiment realizes that the concrete mode for exempting from recursive operation is as follows with reference to table 2:
A) father node of destination node is inquired about
I. target data corresponding to destination node is taken out from non-relational database, first corresponding to the target data Level index (main key) is the root node of tree where destination node, and second level index (row key) is mesh corresponding to the target data Mark node;
Ii. depth value of the destination node in tree is obtained by target data;In the target data, " depth value -1 " The value of position is the father node of destination node.
5 father node is such as inquired about, in table 2, then it is 1 to inquire about main key, and row key is 5 this row data, target data Depth value is 3, then depth value -1 is 2, and therefore, the value of node 2 is 5 father node.
B) ancestor node of destination node is inquired about
I. target data corresponding to destination node is taken out from non-relational database, first corresponding to the target data Level index (main key) is the root node of tree where destination node, and second level index (row key) is mesh corresponding to the target data Mark node;
Ii. depth value of the destination node in tree is obtained by target data;In the target data, 0 arrives " depth The value of value -1 " position is the ancestor node of destination node.
5 ancestor node is such as inquired about, in table 2, then inquires about main key as 1, row key is 5 this row data, target data Depth value be 3, then depth value -1 is 2, then node 1 and node 2 are 5 ancestor node.
C) child node of destination node is inquired about
I. target data corresponding to destination node is taken out from non-relational database, first corresponding to the target data Level index (main key) is the root node of tree where destination node, and second level index (row key) is mesh corresponding to the target data Mark node;
Ii. depth value of the destination node in tree is obtained by target data;
Iii. target second level index (row key) is searched in the case where the first order corresponding with target data indexes framework, it is described The value of target second level index is the child node of destination node.
The target data that the target second level index points to has following characteristics:
Depth value is depth value+1 of the destination node in book;
Node N value is destination node, wherein depth value of the N=destination nodes in tree.
1 descendent node is such as inquired about, in table 2, then it is 1 to inquire about main key, and row key is 1 this row data, obtains 1 depth Angle value is 1;Filter out that " value of the position of node 1 " is " 1 ", and depth value is 2 in total data from non-relational database Data, obtain two row data, and the row key of the row data of gained two is 1 child node.
D) descendent node of destination node is inquired about
I. target data corresponding to destination node is taken out from non-relational database, first corresponding to the target data Level index (main key) is the root node of tree where destination node, and second level index (row key) is mesh corresponding to the target data Mark node;
Ii. depth value of the destination node in tree is obtained by target data;
Iii. target second level index (row key) is searched in the case where the first order corresponding with target data indexes framework, it is described The value of target second level index is the descendent node of destination node.
The target data that the target second level index points to has following characteristics:
Node N value is destination node, wherein depth value of the N=destination nodes in tree.
5 descendent node is such as inquired about, in table 2, then it is 1 to inquire about main key, and row key is 5 this row data, obtains 5 depth Angle value is 3;Filter out that " value of the position of node 3 " is the data of " 5 ", obtains three rows from the total data of non-relational database Data, the row data row key of gained three are 5 descendent node.
Further, the deletion to the hierarchical data includes leaf node deletion and branch deletes, and the branch deletes Including flexibility deletion and Force Deletion.
The flexible deleted representation, data carry out deletion confirmation before being deleted, remind data to be deleted;It is described Force Deletion represents, proposes removal request, reads after abreviation point, confirms directly to be deleted without deleting.
A kind of hierarchical data querying method based on path enumeration is present embodiments provided, hierarchical data is stored in non-pass It is type database, recursive mode is exempted from using path enumeration, realize the various inquiries of destination node, flow and is gulped down in query process The amount of telling meets expected low overhead, improves the performance of system on the whole.
Embodiment 3:
As shown in fig. 6, a kind of hierarchical data management system based on path enumeration is present embodiments provided, including:
Secondary index builds module 401, and for building the secondary index of hierarchical data, the hierarchical data is tree Data, in the secondary index, first order index is the root node of tree, and second level index is the destination node of tree, the two level The target data that index points to includes the root node to the path data of the destination node.
Database sharing module 402, for the hierarchical data to be stored in into non-relational number in the form of secondary index According in storehouse.
Data inquiry module 403, for inquiring about the data in the database sharing module, as shown in fig. 7, the data Enquiry module includes higher level and inquires about submodule 4031 and subordinate's inquiry submodule 4032, and the higher level inquires about submodule 4031 and is used for The superior node of destination node is inquired about, subordinate's inquiry submodule 4032 is used for the downstream site for inquiring about destination node.
The higher level, which inquires about submodule 4031, includes immediate superior query unit and whole higher level's query units, described direct Higher level's query unit is used for the father node for inquiring about the destination node, and whole higher level's query units are used to inquire about the target The ancestor node of node.
Subordinate's inquiry submodule 4032 includes direct subordinate's query unit and whole subordinate's query units, described direct Subordinate's subquery module is used for the child node for inquiring about the destination node, and whole subordinate's query units are used to inquire about the mesh Mark the descendent node of node.
Also include:
Database operating modules 404, for expanding the function logic of database, the function logic includes insertion, deleted And/or migration.
Interface module 405, for providing the interface operated to database, the interface module 405 connects including inquiry Mouth, interface is inserted, delete interface and/or migrates interface, the interface that the insertion interface is inserted for offer to database, The interface of deleting is used to provide the interface for deleting database, and the migration interface is used to provide to be grasped to database The interface of work.
A kind of hierarchical data management system provided in the present embodiment, is implemented for embodiment 1 and embodiment 2 provides Hierarchical data management method, the algorithm logic related to hierarchical data management and storage management are real in a modular manner It is existing, so that the hierarchical data management system becomes simple with interacting between other systems, enhance hierarchical data management The adaptability and portability of system.
Embodiment 4:
As shown in figure 8, a kind of instantaneous communication system is present embodiments provided, including hierarchical data management system 501, it is described The realization of the hierarchical data management system based on path enumeration that hierarchical data management system 501 is provided by embodiment 4, including two Level index construct module 5011, database sharing module 5012, data inquiry module 5013, database manipulation mould fast 5014 and connect Mouth mold block 5015;
Instant communication server 502 and at least one instant communication client 503;
The instant communication client 503 is used to send operational order;
The instant communication server 502 is used to receive operational order, calls the relevant interface of the interface module 5015, Using the extension of fast 5014 function logic of the database manipulation mould, the communication between multi-level architecture is realized.
Specifically, the operational order includes query statement, inserting instruction, deletes instruction and migration instruction, the interface Module 5015 includes query interface, insertion interface, deletes interface and migration interface.
Further, as shown in figure 9, the timing diagram for the inquiry operation that the present embodiment provides, specifically, inquires about descendent node Timing diagram, instant communication client 503 sends query statement, the calling interface module 5015 of instant communication server 502 The query interface of offer reads destination node, and the descendent node of the destination node of reading is filtered out according to filter condition.
Further, as shown in Figure 10, the timing diagram for the insertion operation that the present embodiment provides, specifically, instant messaging visitor Family end 503 sends inserting instruction, and the insertion interface that the calling interface module 5015 of instant communication server 502 provides reads father Node;Before the parameter execution insert action carried in inserting instruction, it is also necessary to carry out validity checking, such as insertion section The physical presence of the quantity legitimacy of point, the level legitimacy for inserting node and node.
Specifically, in instantaneous communication system, the deletion action includes leaf node deletion and branch deletes, described point Branch, which is deleted, includes flexible deletion and Force Deletion.
As shown in figure 11, for leaf node deletion action timing diagram, specifically, instant communication client 503 is sent Leaf node instruction is deleted, the deletion interface that the calling interface module 5015 of instant communication server 502 provides reads point to be abridged; Wherein, before deleting instruction execution deletion action, validity checking is carried out to leaf node to be deleted.
As shown in figure 12, for branch flexible deletion action timing diagram, specifically, instant communication client 503 is sent The flexible of branch deletes instruction, and the deletion interface that the calling interface module 5015 of instant communication server 502 provides, which is read, to be waited to abridge Point, go out to treat the descendent node of abreviation point according to the record filtering of reading;Wherein, before deleting instruction execution deletion action, return Confirmation is deleted to instant communication client 503, the confirmation, which is used for prompting, will delete total data.
As shown in figure 13, the timing diagram operated for the Force Deletion of branch, specifically, instant communication client 503 is sent The Force Deletion instruction of branch, the deletion interface that the calling interface module 5015 of instant communication server 502 provides, which is read, to be waited to abridge Point, goes out to treat the descendent node of abreviation point according to the record filtering of reading, and then directly deletes.
As shown in figure 14, it is the timing diagram of migration operation, specifically, instant communication client 503 sends migration instruction, i.e., When the migration interface that provides of the communication server 502 calling interface module 5015 read root node, gone out according to the record filtering of reading The descendent node of root node, further reads destination node;Wherein, moved before fresh target node is write, it is necessary to check The legitimacy of node is moved, and the new data after migration is assembled.
The modules in technical scheme in the present invention can be realized by terminal or miscellaneous equipment.The meter Calculation machine terminal includes processor and memory.The memory is used to store programmed instruction/module in the present invention, the processing Device is stored in programmed instruction/module in memory by operation, realizes corresponding function of the present invention.
The part or the technical scheme that technical scheme in the present invention substantially contributes to prior art in other words All or part can be embodied in the form of software product, the computer software product is stored in storage medium, bag Some instructions are included to so that one or more computer equipment (can be personal computer, server or network equipment etc.) is held The all or part of step of each embodiment methods described of the row present invention.
The division of heretofore described module/unit, only a kind of division of logic function, can have when actually realizing another Outer dividing mode, such as multiple units or component can combine or be desirably integrated into another system, or some features can To ignore, or do not perform.Some or all of module/unit therein can be selected according to the actual needs realizes this to reach The purpose of scheme of the invention.
In addition, each module/unit in each embodiment of the present invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
Described above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (13)

  1. A kind of 1. hierarchical data management method based on path enumeration, it is characterised in that including:
    Hierarchical data is stored in non-relational database in the form of secondary index, the hierarchical data is tree number According to;
    In the secondary index, first order index is the root node of tree, and the second level is indexed as the destination node of tree, the two level rope Drawing the target data of sensing includes the root node to the path data of the destination node.
  2. 2. the hierarchical data management method according to claim 1 based on path enumeration, it is characterised in that the two level rope The target data for drawing sensing also includes depth value, and the depth value represents hierarchical location of the destination node in tree.
  3. 3. the hierarchical data management method according to claim 1 based on path enumeration, it is characterised in that also include:It is right The hierarchical data is inquired about, and includes the superior node and downstream site of inquiry destination node.
  4. 4. the hierarchical data management method according to claim 3 based on path enumeration, it is characterised in that the inquiry mesh The superior node of node is marked, includes the father node and ancestor node of inquiry destination node.
  5. 5. the hierarchical data management method according to claim 3 based on path enumeration, it is characterised in that the inquiry mesh The downstream site of node is marked, includes the child node and descendent node of inquiry destination node.
  6. 6. the hierarchical data management method according to claim 1 based on path enumeration, it is characterised in that also include to institute Hierarchical data is stated to be inserted, deleted and/or migrated.
  7. A kind of 7. hierarchical data management system based on path enumeration, it is characterised in that including:
    Secondary index builds module, and for building the secondary index of hierarchical data, the hierarchical data is tree-type structure data, institute State in secondary index, first order index is the root node of tree, and second level index is the destination node of tree, and the secondary index points to Target data include the root node to the destination node path data;
    Database sharing module, for the hierarchical data to be stored in non-relational database in the form of secondary index.
  8. 8. the hierarchical data management system according to claim 7 based on path enumeration, it is characterised in that also including data Enquiry module;
    The data inquiry module includes higher level and inquires about submodule and subordinate's inquiry submodule, and the higher level inquires about submodule and is used for The superior node of destination node is inquired about, subordinate's inquiry submodule is used for the downstream site for inquiring about destination node.
  9. 9. the hierarchical data management system according to claim 8 based on path enumeration, it is characterised in that the higher level looks into Asking submodule includes immediate superior query unit and whole higher level's query units, and the immediate superior query unit is used to inquire about institute The father node of destination node is stated, whole higher level's query units are used for the ancestor node for inquiring about the destination node.
  10. 10. the hierarchical data management system according to claim 8 based on path enumeration, it is characterised in that the subordinate Inquiry submodule includes direct subordinate's query unit and whole subordinate's query units, and directly subordinate's query unit is used to inquire about The child node of the destination node, whole subordinate's query units are used for the descendent node for inquiring about the destination node.
  11. 11. the hierarchical data management system according to claim 7 based on path enumeration, it is characterised in that also include:
    Database operating modules, for expanding the function logic of database, the function logic includes insertion, deletes and/or move Move.
  12. 12. the hierarchical data management system according to claim 11 based on path enumeration, it is characterised in that also include:
    Interface module, for providing the interface operated to database, the interface module provides query interface, insertion connects Mouth, delete interface and/or migration interface.
  13. 13. a kind of instantaneous communication system, including the hierarchical data management system based on path enumeration described in claim 7, its It is characterised by, in addition to:
    Database operating modules, for expanding the function logic of database, the function logic includes insertion, deletes and/or move Move;
    Interface module, for providing the interface operated to database, the interface module provides query interface, insertion connects Mouth, delete interface and/or migration interface;
    Also include:
    Instant communication server and at least one instant communication client;
    The instant communication client is used to send operational order;
    The instant communication server is used to receive operational order, calls the relevant interface of the interface module, realizes multi-layer Communication between framework.
CN201610812627.6A 2016-09-08 2016-09-08 Hierarchical data management method and system based on path enumeration Active CN107807932B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610812627.6A CN107807932B (en) 2016-09-08 2016-09-08 Hierarchical data management method and system based on path enumeration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610812627.6A CN107807932B (en) 2016-09-08 2016-09-08 Hierarchical data management method and system based on path enumeration

Publications (2)

Publication Number Publication Date
CN107807932A true CN107807932A (en) 2018-03-16
CN107807932B CN107807932B (en) 2021-11-16

Family

ID=61576233

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610812627.6A Active CN107807932B (en) 2016-09-08 2016-09-08 Hierarchical data management method and system based on path enumeration

Country Status (1)

Country Link
CN (1) CN107807932B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062936A (en) * 2018-06-15 2018-12-21 中国平安人寿保险股份有限公司 A kind of data query method, computer readable storage medium and terminal device
CN110110007A (en) * 2019-04-15 2019-08-09 平安普惠企业管理有限公司 Data managing method and Related product
CN110471916A (en) * 2019-07-03 2019-11-19 平安科技(深圳)有限公司 Querying method, device, server and the medium of database
CN111177206A (en) * 2018-11-09 2020-05-19 阿里巴巴集团控股有限公司 Method, device and system for processing pivot table
CN112256690A (en) * 2019-07-22 2021-01-22 上海汇招信息技术有限公司 Novel tree structure method and novel tree structure updating method
CN112948385A (en) * 2021-03-02 2021-06-11 深圳大学 Method and device for displaying sequence data distribution, storage medium and terminal equipment
CN113626433A (en) * 2021-08-03 2021-11-09 浪潮云信息技术股份公司 Data storage method based on two-layer ART tree
US11762859B2 (en) 2020-09-28 2023-09-19 International Business Machines Corporation Database query with index leap usage

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080086448A1 (en) * 2006-10-10 2008-04-10 Samsung Electronics Co. Ltd. Method of generating node indentifier in tree structure
CN101840400A (en) * 2009-03-19 2010-09-22 北大方正集团有限公司 Multilevel classification retrieval method and system
CN102467521A (en) * 2010-11-08 2012-05-23 北大方正集团有限公司 Easily-extensible multi-level classification search method and system
CN103279544A (en) * 2013-06-05 2013-09-04 中国电子科技集团公司第十五研究所 Method and device for storing and inquiring tree structure data in relational database
CN103853773A (en) * 2012-12-04 2014-06-11 厦门亿联网络技术股份有限公司 Searching method of tree data structure of Mysql database
CN104239511A (en) * 2014-09-15 2014-12-24 西安交通大学 File system in user space implementation method oriented to MongoDB
CN104281701A (en) * 2014-10-20 2015-01-14 北京农业信息技术研究中心 Method and system for querying distributed multi-scale spatial data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080086448A1 (en) * 2006-10-10 2008-04-10 Samsung Electronics Co. Ltd. Method of generating node indentifier in tree structure
CN101840400A (en) * 2009-03-19 2010-09-22 北大方正集团有限公司 Multilevel classification retrieval method and system
CN102467521A (en) * 2010-11-08 2012-05-23 北大方正集团有限公司 Easily-extensible multi-level classification search method and system
CN103853773A (en) * 2012-12-04 2014-06-11 厦门亿联网络技术股份有限公司 Searching method of tree data structure of Mysql database
CN103279544A (en) * 2013-06-05 2013-09-04 中国电子科技集团公司第十五研究所 Method and device for storing and inquiring tree structure data in relational database
CN104239511A (en) * 2014-09-15 2014-12-24 西安交通大学 File system in user space implementation method oriented to MongoDB
CN104281701A (en) * 2014-10-20 2015-01-14 北京农业信息技术研究中心 Method and system for querying distributed multi-scale spatial data

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062936A (en) * 2018-06-15 2018-12-21 中国平安人寿保险股份有限公司 A kind of data query method, computer readable storage medium and terminal device
CN109062936B (en) * 2018-06-15 2023-10-31 中国平安人寿保险股份有限公司 Data query method, computer readable storage medium and terminal equipment
CN111177206A (en) * 2018-11-09 2020-05-19 阿里巴巴集团控股有限公司 Method, device and system for processing pivot table
CN111177206B (en) * 2018-11-09 2023-07-11 盒马(中国)有限公司 Method, device and system for processing pivot table
CN110110007A (en) * 2019-04-15 2019-08-09 平安普惠企业管理有限公司 Data managing method and Related product
CN110471916B (en) * 2019-07-03 2023-05-26 平安科技(深圳)有限公司 Database query method, device, server and medium
WO2021000671A1 (en) * 2019-07-03 2021-01-07 平安科技(深圳)有限公司 Database query method and apparatus, server and medium
CN110471916A (en) * 2019-07-03 2019-11-19 平安科技(深圳)有限公司 Querying method, device, server and the medium of database
CN112256690B (en) * 2019-07-22 2022-09-13 上海汇招信息技术有限公司 Novel tree structure method and novel tree structure updating method
CN112256690A (en) * 2019-07-22 2021-01-22 上海汇招信息技术有限公司 Novel tree structure method and novel tree structure updating method
US11762859B2 (en) 2020-09-28 2023-09-19 International Business Machines Corporation Database query with index leap usage
CN112948385A (en) * 2021-03-02 2021-06-11 深圳大学 Method and device for displaying sequence data distribution, storage medium and terminal equipment
CN112948385B (en) * 2021-03-02 2024-02-13 深圳大学 Display method and device for sequence data distribution, storage medium and terminal equipment
CN113626433A (en) * 2021-08-03 2021-11-09 浪潮云信息技术股份公司 Data storage method based on two-layer ART tree
CN113626433B (en) * 2021-08-03 2024-01-19 上海沄熹科技有限公司 Data storage method based on two-layer ART tree

Also Published As

Publication number Publication date
CN107807932B (en) 2021-11-16

Similar Documents

Publication Publication Date Title
CN107807932A (en) A kind of hierarchical data management method and system based on path enumeration
CN103902623B (en) Method and system for the accessing file in storage system
KR101956236B1 (en) Data replication technique in database management system
CN103902632B (en) The method, apparatus and electronic equipment of file system are built in key assignments storage system
CN101719141B (en) File processing method and system based on directory object
CN103902653B (en) A kind of method and apparatus for building data warehouse table genetic connection figure
CN107918612A (en) The implementation method and device of key assignments memory system data structure
CN105930387A (en) Data operation system and method based on data routing and sharding
CN105468473A (en) Data migration method and data migration apparatus
CN103714163B (en) Pattern management method and system of NoSQL database
CN103577440A (en) Data processing method and device in non-relational database
CN102375852A (en) Method for building data index as well as method and system using data index for inquiring data
CN104424219B (en) A kind of management method and device of data file
CN104239377A (en) Platform-crossing data retrieval method and device
CN110109910A (en) Data processing method and system, electronic equipment and computer readable storage medium
CN104112011B (en) The method and device that a kind of mass data is extracted
CN107783988A (en) The locking method and equipment of a kind of directory tree
CN103198150A (en) Big data indexing method and system
CN104573112B (en) Page interrogation method and data processing node in OLTP Cluster Databases
US7792966B2 (en) Zone control weights
CN105787090A (en) Index building method and system of OLAP system of electric data
CN107766355B (en) Hierarchical data management method, hierarchical data management system and instant messaging system
CN101963993B (en) Method for fast searching database sheet table record
CN111680019A (en) Data capacity expansion method and device for block chain
US9275091B2 (en) Database management device and database management method

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
TR01 Transfer of patent right

Effective date of registration: 20231008

Address after: 518057 Tencent Building, No. 1 High-tech Zone, Nanshan District, Shenzhen City, Guangdong Province, 35 floors

Patentee after: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

Patentee after: TENCENT CLOUD COMPUTING (BEIJING) Co.,Ltd.

Address before: 2, 518000, East 403 room, SEG science and Technology Park, Zhenxing Road, Shenzhen, Guangdong, Futian District

Patentee before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

TR01 Transfer of patent right