[go: up one dir, main page]

CN102012903A - Method and equipment for organizing hierarchical data in relational database - Google Patents

Method and equipment for organizing hierarchical data in relational database Download PDF

Info

Publication number
CN102012903A
CN102012903A CN2009101738125A CN200910173812A CN102012903A CN 102012903 A CN102012903 A CN 102012903A CN 2009101738125 A CN2009101738125 A CN 2009101738125A CN 200910173812 A CN200910173812 A CN 200910173812A CN 102012903 A CN102012903 A CN 102012903A
Authority
CN
China
Prior art keywords
data item
unique identifier
data
value
equipment
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.)
Pending
Application number
CN2009101738125A
Other languages
Chinese (zh)
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.)
SPX Technologies Inc
Original Assignee
SPX Corp
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 SPX Corp filed Critical SPX Corp
Priority to CN2009101738125A priority Critical patent/CN102012903A/en
Publication of CN102012903A publication Critical patent/CN102012903A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

The invention provides a relational database storing a plurality of data items. A hierarchical relationship is formed among the data items which are allocated for a real number, wherein the real number can be calculated by using a convergent series, is a unique identifier and can be used for positioning each data item in the hierarchical structure. A hierarchical value in a floating point type is allocated for each data item and used for identifying the layer of the data item in the structure. A family value is allocated for the data items and used for defining the hierarchical relationship between one data item and the other data item. According to the method, a sublayer structure of any data item can be obtained by comparing two real numbers and new data items or subtrees can be added without changing other data items.

Description

Be used for organizing the method and apparatus of individual-layer data at a relational database
Technical field
The present invention relates generally to data organization system, parts and method.Specifically, the invention relates to data organization system, parts and the method for in relational database organisational level data of being used for.
Background technology
Aspect data base administration and structure, how making one's options between the two at hierarchical data base and relational database has constituted a basic problem.Hierarchical data base can be organized data well, wherein is set as a kind of hierarchical relationship of strictness between each data element in the database and other data element.Yet hierarchical data base has some bigger shortcomings.Maximum shortcoming is, lacks the ability of the various non-hierarchy type relation between the data element in the process database easily, can not work well during the complex relationship between deal with data unit simultaneously.
Substitute as a kind of, better relatively aspect the complex relationship of relational database product between process information and data.Relational database is for software developer and data base administration person provide a great help, and comprises Structured Query Language (SQL) (SQL) and is suitable for the issued transaction of mission critical applications.But relational database is unwell to the storage of hierarchically data.Therefore, data base administration person and developer be the problem in the face of how to make one's options between relational database and hierarchical data base often, considers that particularly the data of many types need layer-stepping management and correlation management.
Certain methods before and equipment can management of co-development hierarchical data and relation data management.Yet these method and apparatus have more and more stronger complicacy, great program design, ever-increasing management of computing expense, and lack the dirigibility of expansion.
Therefore, be necessary the method for organizing individual-layer data in relation data is improved.
Summary of the invention
At least as can be seen preferably can provide a kind of method of organizing individual-layer data in relational database from above, store data items wherein and is associated with the information of the hierarchy type that defines between data item relation in a relational database.Better is, such information allows in layer structure expansion neatly and changes, and can effectively recover and operate data item and hierarchical relationship.
To a great extent, some embodiment of the present invention can satisfy above demand.According to one embodiment of present invention, a kind of method of individual-layer data of organizing in relation data is included in the step of storing this relational database on the storer, wherein this database contains a plurality of data item that have hierarchical relationship each other, and this storer is communicated by letter with an opertaing device.Also further be included as the step that each data item produces unique identifier, this unique identifier has defined the hierarchical relationship between this data item and another data item.This method also is included as each data item and distributes family's value of the hierarchical relationship between this data item of indication and another data item and the layer value of distributing the hierarchical relationship of an indication in a layer structure for this data item.
According to another embodiment of the invention, a kind of equipment that is used for organizing at relational database individual-layer data further is provided, this equipment has a storer, wherein store the database and the instruction that is used for organizing this individual-layer data of an individual-layer data, this database comprises the form of a plurality of data item of storage and individual-layer data at least.This form comprises a plurality of row: the row of a storage unique identifier, the row of a storage family value, the row of the row of an accumulation layer value and a storing data item.This form also comprises the row of this unique identifier of storage, family's value, layer value and data item.This equipment further can comprise an opertaing device with this memory communication, and interacts to carry out this instruction or this instruction is carried out in request with this database.
According to another embodiment of the invention, a kind of system that is used for organizing at a relational database individual-layer data is provided, this system comprises an equipment and an equipment of organizing this data item with layer mode of storing a plurality of data item in the mode of being mutually related.Also comprise one for each data item produces the equipment of a unique identifier, wherein this unique identifier defined this data item and at least one other data item between hierarchical relationship.This system also can comprise an equipment that distributes a family's value and a layer value for each data item, wherein, this family this data item of value indication and the hierarchical relationship between another data item at least, this layer value indicated the hierarchical relationship of this data item at least one level.Other more equipment can comprise that a storage is used for organizing the equipment of method of individual-layer data and the equipment of a request execution command.
Below some embodiments of the present invention are compared the general introduction of rough property,, will be better understood the contribution of the present invention simultaneously technical field can understand better about detailed description of the present invention.Certainly, the present invention also has other embodiment will be described below, and they have constituted the theme in this appended claim.
In this respect, before in detail explaining at least one embodiment, should recognize that application of the present invention is not limited to the detailed construction illustrated and the arrangement layout of parts in as following description or accompanying drawing.The present invention also has the embodiment except the embodiment of those descriptions, and can implement in many ways and carry out.Simultaneously, should be understood that the wording and the term that adopt herein, together with notion, all is the needs in order to describe, and can not be considered to a kind of restriction.
Similarly, the person of ordinary skill in the field can understand, the present invention based on notion can be used as design at an easy rate for other structure that reaches purposes more of the present invention, the basis of method and system.Therefore, it is highly important that these claims should be considered as having covered the scope that comprises equivalent constructions, because they do not break away from the spirit and scope of the present invention.
Description of drawings
Fig. 1 is a schematic diagram that is used for organizing at a relational database system of individual-layer data according to an embodiment of the invention.
Fig. 2 A is a schematic diagram of organizing data item at a form of a relational database of the system that is used for organizing individual-layer data according to an embodiment of the invention.
Fig. 2 B is the tree construction chart of the data of Fig. 2 A.
Fig. 3 is a process flow diagram that is used for operating and organizes the instruction of the database that is used to produce unique identifier according to an embodiment of the invention.
Fig. 4 is the process flow diagram that is used for operating and organizes the instruction of the database that is used to obtain subhierarchy according to an embodiment of the invention.
Fig. 5 is the process flow diagram that is used for operating and organizes the instruction of the database that is used to delete subhierarchy according to an embodiment of the invention.
Fig. 6 is the process flow diagram of instruction that is used for operating and organizes in order to realize geometric series the database that is the new unique identifier of data item reallocation according to an embodiment of the invention.
Embodiment
The utilization of method and system of the present invention by convergent series is implemented in organizes individual-layer data in the relational database, a memory stores data storehouse is provided, and one group is instructed and operates and tissue database, and opertaing device and database interact.
Storer can provide memory function for database, comprises the structural element of database and organizes element, and be used for the data item in padding data storehouse.Other embodiment may have the storer that memory function is provided for the instruction of operation and tissue database.For example, storer may exist with an independent entity, perhaps as the part of database server, perhaps as the part of opertaing device.
Except storer, this method and system also provides the one group of instruction that is used for operating and organizing data.No matter whether storer is separated with opertaing device, these instructions can all be stored on the storer.Perhaps, these instructions also can be stored on the second memory as the part of opertaing device.These instructions can provide the function of a series of operation and tissue database.These functions comprise, for example, for each data item produces a unique identifier, for each data item is distributed family's value, for each data item is distributed a layer value, be the data reallocation unique identifier after moving, reallocate unique identifier to reach geometric series on a level for data, obtain a child level of any data input, delete the child level of any data item, the table that founds an organization extracts data item to a data file.
This method and system further provides one and the interactional opertaing device of database.Such equipment can with the storer communication.This opertaing device can be used to ask to carry out the instruction that is used for operating with tissue database, for example, when these instruction storage on storer, for example, as the part of database server.In another embodiment, opertaing device is used for executing instruction, for example, on the second memory of these instruction storage at opertaing device, and this storer and the opertaing device that comprise database be separated from one another, perhaps when these instruction and data library storage are on as the storer of the part of opertaing device.
Now with reference to accompanying drawing the present invention is described, the identical identical parts of reference number indication wherein.Fig. 1 be one according to the schematic diagram of in a relational database (organization system) 10, organizing the system of individual-layer data of the present invention.Organization system 10 comprises a storer 20.Storer 20 further comprises a relational database 22 that comprises a plurality of data item 24.Data item 24 has the layer-stepping relation each other.In certain embodiments, the storer 20 that comprises database 22 can be used as the part of a database server.
In another embodiment, storer 20 can also comprise the instruction that is used to operate with tissue database 28.Instruction 28 will go through hereinafter.
This organization system can comprise an opertaing device 30.Opertaing device 30 comprises 36, one processors 38 of 34, one communication apparatus of 32, one second memories of an input equipment, and a display device 40, more than all parts all can interconnect by a data link.Opertaing device 30 can be a common computer, a PC (PC) for example, a unix station, a server, a mainframe computer, personal digital assistant (PDA) one by one, a portable phone, the combination of a smart mobile phone or above these equipment.Perhaps, opertaing device 30 is as a specific calculations device, for example a vehicle diagnostics instrument.Remaining parts comprise program code, source program code for example, program codes or executable code are stored on the computer-readable medium, can be downloaded to storer 34 and can be handled, to realize the ideal functionality of organization system 10 by processor 38.
In different embodiment, opertaing device 30 and storer 20 can be connected to a communication network 50, wherein can comprise and to connect based on the equipment of computer system and any combination of system, the Internet for example, Intranet that or extranets, people's network one by one, a public network, a system based on Ethernet, a Token Ring, a value-added network, the network based on phone comprises, for example, T1 or E1 equipment, an ATM network, a wired system, a wireless system, a fibre system, the distributed processing network of an any amount or the combination of system or similar system, communication network 50 allows to communicate between opertaing devices 30 and the storer 20.
Opertaing device 30 can be connected to communication network 50 by communication facilities 36, can merge the combination of any equipment and relevant software or firmware-be connected system based on processor with configuration in different embodiment.Such communication facilities 36 can comprise modulator-demodular unit, network interface card, universal serial bus, parallel bus, LAN or wan interface, wired, wireless or optical fiber interface or the like.Such design even preferably needs or relevant host-host protocol must be arranged.
In addition, an embodiment of organization system 10 can need the user to import (GUI) input information by input equipment 32 via mutual, that have menu, visual a user interface or a graphic user interface based on demonstration by display device 40 and user's exchange of information simultaneously.This user interface can go up in for example PC (PC) that has mouse and a keyboard and carry out, by direct control GUI user input information alternately.Direct control can comprise and utilize a pointing device, and for example mouse or stylus to select, comprise optional menu, pull-down menu, label, connector, check box, text box or the like from a plurality of options.But, different embodiment of the present invention can add any amount of extra user interface scheme and substitute this interface scheme, with or without mouse, button or key, for example comprise a trace ball, a touch-screen or a voice activated control.
Comprise the database 28 that is used for operating and organizing the second memory 34 that is positioned at opertaing device 30 in the additional embodiments, and relational database 22 is arranged in storer 20.Instruction 28 also can be kept in the storer 20 and relational database 22 can be kept in the second memory 34.Also can think the part of storer 20 as opertaing device 30.Further, database server can be used as the part of opertaing device 30 and exists.
With reference to figure 2A, relational database 22 is organized data item 24 at least in a form 60.Form 60 comprises a row 62 corresponding with each data item 24.In one embodiment of the invention, form 60 further comprises unique identifier row 64, at least one data item row 66, at least one stratose 68 and at least one family's row 70.
These at least one unique identifier row 64 comprise a unique identifier 72 that is used for each data item 24.In one embodiment of the invention, unique identifier 72 is real numbers.Further, unique identifier 72 can be floating type data.This unique identifier 72 is assigned to each data item by a kind of specific identification method, and this method calculates each unique identifier 72 by convergent series, and this will be described in more detail below.As an embodiment, in this data hierarchy, except the data item 24 of top, each data item 24 all has one greater than 0 unique identifier 72.This unique identifier 72 has defined a data position for data 24 with respect to other data item 24 in this data hierarchy, this will be described in more detail below equally.
Data item row 66 comprise a plurality of data item 24.The person of ordinary skill in the field will be appreciated that data item 24 can comprise as long as one is listed as the information that just can store and organize separately, and perhaps a plurality of row of the informational needs of data item 24 are suitably stored and organized.In another example, no matter be used for comprising what of quantity of the row of data item 24, the unique identifier 72 of distributing to data item all row relevant with data item 24 in 62 that can be used for being expert at recognize that this point is very important.Data item row 66 are not restricted to the information of the type that they can store.
This at least one stratose 68 is configured to store one and is used to refer to the layer value 74 that be positioned at which position of a data item 24 in a data level.As an example, a data level may present the form of a tree, and wherein the relation between each data item 24 and another data item 24 shows by the branch of this tree.This tree has the layer of some, and data item 24 is positioned on each layer.Each branch of this tree all ends at the data item 24 that is positioned at certain one deck.In an embodiment of the invention, layer value 74 can be the integer type data.In a such embodiment, this top layer value 74 is 0 typically.
These at least one family's row 70 are configured to store family's value 76 that is used to refer to a data item 24 and another relation between the data item 24 of last layer or following one deck.In one embodiment of the invention, the family of data item 24 value 76 is as the unique identifier 72 of its father node data item 24, and perhaps being positioned at as one more high-rise has the unique identifier 72 of the data item 24 of direct relation with it.In this case, family's value 76 can be the real number of floating type.Further, top layer data in data hierarchy 24 are not owing to there is father node data item 24, and therefore, family's value 76 should be given one not as the value of the unique identifier 72 of another data item 24.For example, the family of top layer data item 24 value is for-1.
Refer again to Fig. 2 A.Row 62 is identified as R1-R5, next to explain the embodiment that describes in the figure.Just as can be seen, the layer value 74 of R1 is 0, and family's value of R1 is for-1, and the data item 24 that more than shows the R1 place is root nodes of data hierarchy.Next, can find that R2 and R3 have identical layer value 74 and family's value 76, R4 has identical layer value 74 and family's value 76 with R5.This shows that in the data hierarchy of these data the data item 24 at R2 and R3 place is in identical layer in this data hierarchy.It shows that also the data item at R2 and R3 place all is the child node of R1 place data item 24, because family's value 76 of R2 and R3 equals the unique identifier 72 of R1.Similarly, the data item 24 of R4 and R5 is in identical layer owing to have identical layer value 74 in data hierarchy, and R1-R3 then is in different layers.Further, the data item 24 of R4 and R5 is as the child node of the data item 24 of R3, because the family of R4 and R5 value 76 equates with the unique identifier 72 of R3.Like this, form 60 has been represented the data hierarchy of a tree shown in Fig. 2 B, and it is corresponding with the sign R1-R5 among Fig. 2 A wherein to identify R1-R5.
The person of ordinary skill in the field should be appreciated that the realization of form 60 is not limited to a data level, and data item 24 may reside in a plurality of data hierarchies.Just because of this, be necessary to allow the form of multiple version form, each row wherein can be determined position and the relation of a data item in data hierarchy.By visiting a different set of row, simple data base querying just can be constructed different data hierarchies.
In an embodiment of the invention, storer 20 comprises a plurality of instructions that are used to operate with tissue database 28, yet instruction 28 can be stored on the second memory 34.
The instruction of describing among Fig. 3 28 is the methods that produce unique identifier 80.When being inserted into database 22, can be this data item 24 and produce unique identifier 72 as a new data item 24.Producing unique identifier 72 is to finish by the unique identifier 72 that compares two adjacent data item 24, when inserting a new data item between them, selecting a value is new unique identifier 72 between the value of two other unique identifier 72.In one embodiment of the invention, finish, utilize it, from form 60, select Next have identical layer value 74 and unique identifier 72 (step 90) with higher identifier 72 values as a reference by utilizing unique identifier 72.Then, calculate the difference (step 92) between higher value unique identifier and the smaller value unique identifier 72 and this difference be multiply by a coefficient (step 94) between 0 to 1, for example 0.5.The gained result is added to smaller value unique identifier 72 (step 96) (perhaps deducting the gained result from higher value unique identifier 72), and its result just distributes to the new data item 24 (step 98) that is inserted into data hierarchy as a new unique identifier 72.
The method that produces unique identifier 80 can be unified to being in the method for a unique identifier 72 of a data item that moves in data hierarchy 24 reallocation.Yet, difference is, not that a new data item 24 will be inserted in the data hierarchy, here data item 24 preexists are in database 22, unique identifier 72 by above-mentioned identical method calculate (step 100 among Fig. 4) as in this data hierarchy and other data item between new position.In case this new unique identifier 72 calculates, will be assigned to the data item 24 that will move.Therefore, when reorientating a data item, correspondingly need to reassign layer value 74 and family's value 76.
The method that produces unique identifier 80 also can consolidation to the reallocate part of method of unique identifier of the secondary data level that is a data item that redeploys.In an embodiment of the invention, the top layer data item 24 of secondary data level is a designated new position in data hierarchy, for example, by reallocating its family's value 76, with utilize the method identical with producing unique identifier 80, be the data item 24 that in data hierarchy, the is moved unique identifier 72 of reallocating.Then, repeat said process for each data item 24 in the secondary data level.
An advantage that produces the method for unique identifier 80 is: owing to be to arrange a new unique identifier 72 between the unique identifier 72 that has existed, therefore, except new and data item that be moved, there is no need to renumber for other data item 24.Among the embodiment of present invention, the characteristic that reaches above-mentioned advantage has been to utilize the float of unique identifier 72.Floating number (for example has a very wide in range magnitude value scope,-1.79E+308 arrives-2.23E-308,0 and 2.23E-308 to 1.79E+308), very little fractional value is provided simultaneously, this is helpful for the numerical value that calculates between other two numerical value.This method and floating type further allow the data hierarchy flexibly that can expand, and do not need to add row to form 60 again, thereby can increase assessing the cost of complexity and inquiry statement.Utilize another advantage of floating type to be that its Billy that assesses the cost is low with character string data, character string data need utilize expensive character string decomposition operation.
With reference to Fig. 4, a kind of method that obtains a secondary data level 82 also can be performed.In one embodiment of the invention, the secondary data level by one of this secondary data level given top layer data item 24 and and its all data item 24 that have between the next data item 24 of identical layer value 74 form.This method comprises more adjacent data item 24 (just a data item 24 and the Next data item 24 that has identical layer value 74 with it) (step 100).This method can be returned all data item 24 of (step 102) of value between top layer data item 24 and next data item 24 of its unique identifier 72 from database 22.Fig. 5 has described the method for a similar executable deletion subdata level 84.This method is identical with the method that obtains subdata level 82, except it can delete subdata level 82 from database 22, rather than return these data this point, the value of the unique identifier 72 of all these data item wherein is between top layer data item 24 and next data item 24.The method that obtains subdata level 82 and deletion subdata level 84 has shown another advantage of the present invention.Because the mode of reallocation unique identifier 72, data hierarchy can not need to move expensive recursion method and realize traversal.Data hierarchy only just can travel through by the value that compares unique identifier 72.
Produce unique identifier 80 method utilization and utilize this method to increase a new data item and represented convergent series to data hierarchy.Below be to specify (wherein NodeID is used for marking unique identifier 72, node be used for labeled data item 24):
Suppose x 1, x 2, x 3, K, x 4Be the NodeIDs of the child node of node x, the NodeID of node x is x, and x 1<x 2<x 3<K<x n. notice that node x can be the arbitrary node in the data hierarchy.
parent_id(x 1)=parent_id(x 2)=K=parent_id(x n)=x <1>
Below be 4 definition:
next_node(x n-1):=x n=x n-1+step_br(x n-1) <2>
step _ br ( x n ) : = x n + 1 - x n = step _ ch ( parent _ id ( x n ) ) 2 n = step _ ch ( x ) 2 n - - - < 3 >
step _ ch ( x ) : = x - x 1 = step _ br ( x ) 2 = next _ node ( x ) - x 2 - - - < 4 >
step_ch(0):=1 <5>
Defined function parent_id (x):
CREATE?Function?dbo.parent_id(@x?float)
RETURN?int
AS
BEGIN
DECLARE@parent_x?int
SELECT@parent_x=ParentID?FROM?Tree
WHERE?NodeID=@x
RETURN(@next_x)
END;
Defined function the function next_node (x):
CREATE?Function?dbo.next_node(@x?float)
RETURN?int
AS
BEGIN
DECLARE@next_x?int
SELECT@next_x=TOP?NodeID?FROM?Tree
WHERE?NodeID>x?AND?Level=(SELECT?Level?FROM?Tree
WHERE?NodeID=@x)
ORDER?BY?NodeID?ASC
RETURN(@next_x)
END;
Verify that at first the algorithm of this method obtains the validity of subdata level.
From aforementioned formula<4 〉, can obtain:
x 1=x+step_ch(x)
x 2 = x 1 + step _ br ( x 1 ) = x + step _ ch ( x ) + step _ ch ( x ) 2
x n : = x n - 1 + step _ br ( x n - 1 ) = x + step _ ch ( x ) + step _ ch ( x ) 2 + step _ ch ( x ) 4 + K
+ step _ ch ( x ) 2 n - 1 = x + step _ ch ( x ) 1 - 0.5 n 1 - . 05 - - - < 6 >
When n is enough big, x nIncrease with n increases:
lim n &RightArrow; &infin; x n = lim n &RightArrow; &infin; ( x + step _ ch ( x ) 1 - 0.5 n 1 - 0.5 ) = x + 2 step _ ch ( x ) = x + step _ br ( x )
= next _ node ( x ) - - - < 7 >
The result is:
x n<next_node(x)=next_node(parent_id(x n)) <8>
Inequality<8〉show the node x that any one is given all NodeID of subdata level all less than the next node of x, this point has confirmed to obtain the algorithm of subdata level.
From also proving the validity of utilizing the method that produces unique identifier 80 to increase the algorithm of a node or a sub-data hierarchy here.Consider that a sub-data hierarchy comprises a plurality of nodes, be proved if utilize to produce the method for unique identifier 80 and increase the validity of the algorithm of a node, the scheme that this algorithm is applied to increase a sub-data hierarchy also is self-evident.In order to prove the validity that increases a separate nodes, be necessary to prove formula<9〉increase again behind the new node still correct.Suppose x aThe NodeID of any one node in the expression data hierarchy, x b=next_node (xa) and x 1, x 2, x 3, K, x 4Be node x a(x 1<x 2<x 3<K<x n). child node NodeIDs.According to formula<8 〉:
x n<next_node(x a)=x b
Present x aAnd x bBetween increase a new node, and the NodeID of hypothesis new node is x c. below be to be used in producing a unique identifier 80 and being x aProduce the method for an adjustable value.Suppose this adjustable value called after y, then:
x a<x n<x b
x n≤max_id(x)|x<x b,x∈{NodeID}=y
x n < x n + x b 2 &le; y + x b 2 = x c - - - < 9 >
Inequality<9〉show x n<x c=next_node (x a), that is to say is increasing a new node x c. after, formula<8〉still set up.At this, proved that it is correct utilizing the increase algorithm of the method that produces a unique identifier 80.
Notice that from above-mentioned a coefficient 0.5 is used to calculate this unique identifier 72.That coefficient is used in formula<6 in the above-mentioned demonstration once more〉in.Yet, consider the convergent rate of change, this coefficient can be any number between 0 to 1, this point is obviously for the person of ordinary skill in the field.For example, with respect to adopting coefficient 0.5, coefficient 0.9 can bring a slower convergence, and can allow the available unique identifier 72 of a bigger quantity.
Except the data item that is moved,, had better renumber to constitute a geometric series whole data hierarchy although there is no need the data item in the data level 24 is renumberd.The method that produces unique identifier 80 can be further used in and be whole data hierarchy reallocation unique identifier 72.In one embodiment of the invention, the unique identifier new for the data item reallocation comprises two circulations with the method that constitutes geometric series 86, described in Fig. 6.At first, to maximum layer value 74 (steps 110) of database 22 inquiries.Enter first circulation then, and this layer value compared with a layer value variable, this layer value variable is set as 0, for example when the layer value of root node is-1 (step 112).If should maximum layer value 74 less than this layer value variable, this method step finishes (step 114).Otherwise, find out the data item 24 (step 116) that all layer values 74 equal layer value variable in the mode of ascending order.Obtain the quantity of the data item 24 that is positioned at this layer and set a data item variable (step 118) with quantitative value.A counter is set at 0 (step 120).This data item variable and this counter are compared (step 122).If this data item variable is less than or equal to the value of counter, then increases described layer value and be back to the above-mentioned step 112 (step 124) that maximum layer value 74 and layer value variable are compared.Otherwise, select the data item 24 that in this group data item 24, has corresponding to the position of Counter Value in 24 groups of the data item that from step 116, obtains, and obtain all subdata items 24 (step 126) of the data item of selecting.Utilize the method that produces unique identifier 80 to be each data item that newly receives 24 reallocation unique identifiers 72 (step 128).Increase the value of counter and be back to the above-mentioned step 122 (step 130) that the value and the data item variable of counter are compared.
Yet another method of the present invention is the method for a kind of extraction and translation data item.Data item also can be converted to a data file that can miscellaneous equipment reads.In one embodiment of the invention, data item 24 according to family's value, sorts according to unique identifier then at first according to the ordering of layer value.Then, the data item 24 through ordering is compressed to a binary file.The data that are documented in this binary file preferably include the information that obtains from data item 24: the start address of data item 24 (being converted by unique identifier 72), data item 24 stored start addresses, the start address of first subdata item of data item 24 (being converted by family's value 76) is with the quantity (quantity by the data item with value 76 mutually of the same clan calculates) of the child node of present node.
Fig. 1-the 7th, the schematic diagram and the process flow diagram of the different embodiment of the method according to this invention and system.The combination that should be understood that step in each step in the process flow diagram and the process flow diagram can realize by computer program instructions or other means.Although the computer programming instruction was discussed, an apparatus according to the invention can comprise other device, and for example combination of hardware or some software and hardwares comprises one or more processor or controller, to be used for carrying out the function that is disclosed.
In this respect, Fig. 1 has described a system embodiment that comprises some critical components of a multi-purpose computer, can realize the present invention by means of this.Those described those skilled in the art understand a clear and definite computing machine and can comprise than the more parts of parts shown in Figure 1.Yet,, there is no need to illustrate all legacy devices in general sense in order to disclose a kind of illustrative embodiment of the present invention that is used to put into practice.This multi-purpose computer can comprise a processing unit 38 and a system storage 34, wherein can comprise random-access memory (ram) and ROM (read-only memory) (ROM).Computing machine can also comprise nonvolatile memory, and for example a hard drive wherein can be stored excessive data.
An embodiment of the invention also can comprise one or more input equipments 32, for example mouse, keyboard or the like.A display device 40 can be used to provide browses text and graph data, and a user interface allows the user to ask specific operation.In addition, one embodiment of the present of invention can be connected with one or more remote computers by a communication facilities 36.This connection can be passed through a communication network 50, for example Local Area Network, wide area network (WAN), and can comprise all necessary circuit for this connection.
Typically, computer program instructions, the instruction that for example is used to operate with the part of tissue database 28 can be downloaded to computing machine or other general programmable machine, to produce the particular machines language, like this, these instructions of carrying out on counter or other programmable machine are that the function of stipulating among the implementing procedure figure has been created means.Such computer program instructions also can be stored in the computer-readable medium, in the time of in being downloaded to a computing machine or other programmable machine, can move in a particular manner by guidance machine, like this, the instruction of storing on computer-readable medium has produced a kind of result, comprises the instruction means of the function of appointment among the implementing procedure figure.
In addition, computer program instructions is downloaded in a computing machine or other programmable machine, carried out by this computing machine or other programmable machine to impel the sequence of operations step, to produce a computer executable program, so, the function stipulated in for flowchart of the instruction that moves on computing machine or other programmable machine provides step.
Therefore, the step support in the process flow diagram is that the equipment of finishing the function of regulation makes up mutually, also supports to make up mutually for the step and the programmed instruction equipment of the function that puts rules into practice.Need equally to understand, each step in the process flow diagram and the combination between the step, can carry out by hardware based computer system, perhaps carry out with the function that puts rules into practice or the combination of step computer instruction by the hardware of special-purpose with special-purpose.
As an example, be used for just illustrating that the data Input Software instrument of a search engine application can be used for receiving the inquiry that comprises one or more search items as representative means.Similarly the execution of Software tool of using or embodiments of the invention can be used as the instrument of the function that puts rules into practice.For example, one embodiment of the present of invention can comprise computer software, are used to connect the input equipment of a treatment element and user's control, for example mouse, keyboard, touch panel display device, scanner or the like.Similarly, the output of one embodiment of the present of invention can comprise, for example, and the combination of software for display, sound card hardware and viewing hardware.A treatment element comprises, for example, and controller or microprocessor, a CPU (central processing unit) (CPU) for example, ALU (ALU), perhaps control module.
Can obviously find out numerous characteristics of the present invention and advantage from above-mentioned detailed description, therefore, appended claim has contained all characteristics and the advantage that falls into true spirit of the present invention and scope.Further, because the person of ordinary skill in the field can make various modifications and distortion, the invention is not restricted to described structure and operation, therefore, modification that all are suitable and the embodiment that is equal to all can fall within the scope of the present invention.

Claims (33)

1. method of organizing individual-layer data in a relational database comprises step:
Storage package contains a plurality of described relational databases that have the data item of hierarchical relationship each other on a storer, and this storer is communicated by letter with an opertaing device simultaneously;
For each data item produces a unique identifier, this unique identifier has defined the hierarchical relationship between this data item and at least one other data item;
Family's value of distributing the described hierarchical relationship between this data item of indication and at least one other data for this data item;
And the layer value of distributing the described hierarchical relationship of an indication in a layer structure for this data item.
2. method according to claim 1, wherein produce the unique identifier that described unique identifier further is included in this layer structure adjacent data item and compare, and calculate a value between the value of the unique identifier of described adjacent data items.
3. method according to claim 2, wherein said value are real numbers.
4. method according to claim 2 further is included as a new unique identifier of data item reallocation after being moved in described layer structure.
5. method according to claim 2, further being included in any one layer structure in order to realize geometric series is the new unique identifier of data item reallocation.
6. method according to claim 1 further comprises the sublayer structure that obtains any data item.
7. method according to claim 1 further comprises:
In described layer structure, determine the unique identifier of adjacent data items;
And return data item with value unique identifier between the adjacent identifier that is compared.
8. method according to claim 1 further comprises a sublayer structure of deleting any data item.
9. method according to claim 1 further comprises:
In described layer structure, determine the unique identifier of adjacent data items;
And deletion has the data item of the unique identifier of value between the adjacent identifier that is compared.
10. method according to claim 1, wherein provide a relational database further to comprise the table that founds an organization, it has the row of a described unique identifier of storage, the row of the described family of a storage value, the row of a described layer value of storage, the row of a described data item of storage, and the row of the described unique identifier of storage, family's value, layer value and a data item.
11. method according to claim 10, wherein said unique identifier are the floating point type number.
12. comprise further that according to the method for claim 1 data file that can read to a miscellaneous equipment extracts described data item.
13. according to the method for claim 12, wherein extract data item and comprise according to layer value data item is sorted, then according to family's value, again according to unique identifier.
14., wherein extract data and further comprise described data item is converted to a binary file according to the method for claim 13.
15. an equipment that is used for organizing at a relational database individual-layer data comprises:
A storer, wherein store the database and the instruction that is used for organizing this individual-layer data of an individual-layer data, this database comprises that at least one stores the form of a plurality of data item and individual-layer data, this at least one form comprises the row of a storage unique identifier, the row of a storage family value, the row of the row of an accumulation layer value and a storing data item, and the row of the described unique identifier of storage, family's value, layer value and a data item;
And with this memory communication and with the interactional opertaing device of described database, and can carry out this instruction or this instruction is carried out in request.
16. according to the equipment of claim 15, further being included in the described unique identifier of storing in the described row is floating point type data.
17. according to the equipment of claim 15, wherein said storer further comprises an instruction of calculating described unique identifier for described data item.
18. according to the equipment of claim 15, wherein said storer further comprises an instruction for the data item that is moved reallocation unique identifier.
19. according to the equipment of claim 15, wherein said storer further comprises an instruction that is used for distributing into all data item unique identifiers.
20. according to the equipment of claim 15, wherein said storer further comprises an instruction that is used for obtaining a sublayer structure, this sublayer structure comprises the data item of unique identifier between adjacent data item in the described layer structure.
21. according to the equipment of claim 15, wherein said storer further comprises an instruction that is used for deleting a sublayer structure, this sublayer structure comprises the data item of unique identifier between adjacent data item in the described layer structure.
22. according to the equipment of claim 15, wherein said storer further comprises an instruction that is used for extracting the data file that described data item to an energy read by other software service.
23. according to the equipment of claim 15, wherein said storer further comprises an instruction, it is used for according to layer value described data item being sorted, and sorts according to family's value then, sorts according to unique identifier again.
24. according to the equipment of claim 15, wherein said storer further comprises an instruction that is used for described data item is converted to a binary file.
25. according to the equipment of claim 15, wherein said storer is the part of a database server.
26. a system that is used for organizing individual-layer data in a relational database comprises:
Be used for storing the equipment of a plurality of data item in the mode of being mutually related;
Be used for organizing the equipment of described data item in different levels mode;
Be that each given data item produces the equipment of a unique identifier, wherein said unique identifier be used for defining this data item and at least one other data item between hierarchical relationship;
The equipment that distributes value with the value of the described hierarchical relationship of this data item of indication at least one layer structure of the hierarchical relationship between this data item of indication and at least one other data item for each data item;
Be used for the equipment of method of the described individual-layer data of storage organization;
Be used for asking the equipment that executes instruction.
27., further be included as the equipment of the data item reallocation unique identifier that is moved according to the system of claim 26.
28., further comprise the equipment that is used for to all data item reallocation unique identifiers according to the system of claim 26.
29. according to the system of claim 26, further comprise the equipment that is used for obtaining a sublayer structure, this sublayer structure comprises the data item of unique identifier between adjacent data item in the described layer structure.
30. according to the system of claim 26, further comprise an equipment that is used for deleting a sublayer structure, this sublayer structure comprises the data item of unique identifier between adjacent data item in the described layer structure.
31., further comprise the equipment that is used for extracting the data file that described data item to an energy read by other software service according to the system of claim 26.
32. according to the system of claim 31, further comprise being used for described data item being sorted, sort according to family's value then, again the equipment that sorts according to unique identifier according to layer value.
33., further comprise being used for described data item is converted to the equipment of a binary file according to the system of claim 32.
CN2009101738125A 2009-09-04 2009-09-04 Method and equipment for organizing hierarchical data in relational database Pending CN102012903A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101738125A CN102012903A (en) 2009-09-04 2009-09-04 Method and equipment for organizing hierarchical data in relational database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101738125A CN102012903A (en) 2009-09-04 2009-09-04 Method and equipment for organizing hierarchical data in relational database

Publications (1)

Publication Number Publication Date
CN102012903A true CN102012903A (en) 2011-04-13

Family

ID=43843075

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101738125A Pending CN102012903A (en) 2009-09-04 2009-09-04 Method and equipment for organizing hierarchical data in relational database

Country Status (1)

Country Link
CN (1) CN102012903A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104808980A (en) * 2014-01-27 2015-07-29 Ls产电株式会社 Data display apparatus and method for energy management system
CN106815346A (en) * 2017-01-18 2017-06-09 济南浪潮高新科技投资发展有限公司 A kind of synchronous migration method for being classified code multi-stage data
CN111313905A (en) * 2020-02-24 2020-06-19 南京大学 Floating point number conversion method and device
CN111324258A (en) * 2020-02-04 2020-06-23 北京字节跳动网络技术有限公司 Method, device, equipment and medium for generating contents of configuration items of multilevel pull-down menu
CN111813555A (en) * 2020-07-21 2020-10-23 国网湖南省电力有限公司 Hierarchical resource management system for hyper-converged infrastructure based on Internet technology
CN112966279A (en) * 2021-02-08 2021-06-15 北京金山云网络技术有限公司 Distributed data processing method and system

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104808980A (en) * 2014-01-27 2015-07-29 Ls产电株式会社 Data display apparatus and method for energy management system
CN106815346A (en) * 2017-01-18 2017-06-09 济南浪潮高新科技投资发展有限公司 A kind of synchronous migration method for being classified code multi-stage data
CN111324258A (en) * 2020-02-04 2020-06-23 北京字节跳动网络技术有限公司 Method, device, equipment and medium for generating contents of configuration items of multilevel pull-down menu
CN111324258B (en) * 2020-02-04 2021-07-06 北京字节跳动网络技术有限公司 Method, device, equipment and medium for generating contents of configuration items of multilevel pull-down menu
CN111313905A (en) * 2020-02-24 2020-06-19 南京大学 Floating point number conversion method and device
CN111313905B (en) * 2020-02-24 2023-10-13 南京大学 A floating point number conversion method and device
CN111813555A (en) * 2020-07-21 2020-10-23 国网湖南省电力有限公司 Hierarchical resource management system for hyper-converged infrastructure based on Internet technology
CN112966279A (en) * 2021-02-08 2021-06-15 北京金山云网络技术有限公司 Distributed data processing method and system
CN112966279B (en) * 2021-02-08 2023-11-03 北京金山云网络技术有限公司 Distributed data processing method and system

Similar Documents

Publication Publication Date Title
Sarkar et al. Outfittransformer: Learning outfit representations for fashion recommendation
Holten et al. Visual comparison of hierarchically organized data
US7099887B2 (en) Hierarchical environments supporting relational schemas
TW200903324A (en) Systems and methods for modeling partitioned tables as logical indexes
CN102012903A (en) Method and equipment for organizing hierarchical data in relational database
WO2007133694A2 (en) Fast computation of compact poset isomorphism certificates
CN102117361A (en) Design of an assembly modeled by a graph
CN106202240A (en) Material coding data processing method and device
CN107463665A (en) A kind of data correlation rule mining algorithms
CN115329504A (en) BOM construction method based on complex product structure
CN107729396A (en) Data Dynamic Query method and device
CN107066246A (en) A kind of software development methodology and device
Anagnostopoulos et al. The importance of being expert: Efficient max-finding in crowdsourcing
CN115062365A (en) BIM model-based component modeling method, storage medium and management system
Černjeka et al. NoSQL document store translation to data vault based EDW
CN103927168B (en) A kind of method and device of object-oriented data model persistence
CN115827715B (en) Search recommendation list generation system based on user behavior and design hierarchical tree
CN101458786A (en) Method and system for changing material level of bill of material
EP2187320A2 (en) Apparatus and method for utilizing context to resolve ambiguous queries
CN111680337B (en) PDM system product design requirement information acquisition method and system
US20110060718A1 (en) Method and Apparatus for Organizing Hierarchical Data in a Relational Database
JP2006065706A (en) Application requirement design support system and method
CN113138637B (en) Computer configuration information processing method, device and storage medium thereof
Kunii What’s wrong with wrapper approaches in modeling information system integration and interoperability?
Ellison et al. FortSP: a stochastic programming solver

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20110413