CN108920708A - A kind of data processing method and device - Google Patents

A kind of data processing method and device Download PDF

Info

Publication number
CN108920708A
CN108920708A CN201810805648.4A CN201810805648A CN108920708A CN 108920708 A CN108920708 A CN 108920708A CN 201810805648 A CN201810805648 A CN 201810805648A CN 108920708 A CN108920708 A CN 108920708A
Authority
CN
China
Prior art keywords
page
key
node page
memory element
leaf node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810805648.4A
Other languages
Chinese (zh)
Other versions
CN108920708B (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.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies 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 New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201810805648.4A priority Critical patent/CN108920708B/en
Publication of CN108920708A publication Critical patent/CN108920708A/en
Application granted granted Critical
Publication of CN108920708B publication Critical patent/CN108920708B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The present invention provides a kind of data processing method and device, the method includes:Create target multi version B+ tree MVBT data store organisation;The data processing request received is responded based on the target MVBT data store organisation.Data processing performance can be improved using the embodiment of the present invention.

Description

A kind of data processing method and device
Technical field
The present invention relates to network communication technology field more particularly to a kind of data processing method and devices.
Background technique
Traditional B+Tree is transformed in MVBT (Multi-version B+Tree, multi version B+ tree), to each A Key (key) increases life cycle (LifeSpan), be denoted as [a, b) (b >=a).Wherein, a is the version generated when being inserted into the Key This number, b is the version number generated when deleting the Key;When b is+∞, show that the Key is not deleted;LifeSpan be [a ,+ Key ∞) is properly termed as Key (Live Key) living, remaining Key (terminating the Key that version number is not +∞) is known as dead Key (Dead key)。
However practice discovery, in traditional MVBT implementation, in page the sequence of each memory element be it is chaotic (i.e. not It is ranked up according to the size of Key), when needing to carry out the search of Key, need by each memory element progress time in page The mode gone through realizes that efficiency is lower.
Summary of the invention
The present invention provides a kind of data processing method and device, only supports fixed length to solve existing MVBT implementation The problem of Key and Value.
According to the first aspect of the invention, a kind of data processing method is provided, including:
Create target multi version B+ tree MVBT data store organisation;Wherein, the target MVBT data store organisation includes The page of tree structure and respectively with the associated sequence array of each page, the page include at least one memory member Element, key Key is recorded in each memory element, and each array element in the sequence array exists for characterizing the memory element Position offset in the page;
The data processing request received is responded based on the target MVBT data store organisation.
According to the second aspect of the invention, a kind of data processing equipment is provided, including:
Creating unit, for creating target multi version B+ tree MVBT data store organisation;Wherein, the target MVBT data Storage organization include tree structure page and respectively with the associated sequence array of each page, the page include extremely Lack a memory element, key Key is recorded in each memory element, each array element in the sequence array is for characterizing institute State position offset of the memory element in the page;
Receiving unit, for receiving data processing request;
Processing unit, for being rung based on the target MVBT data store organisation to the data processing request received It answers.
The third aspect, the application provide a kind of network equipment, including processor and machine readable storage medium, the machine Readable storage medium storing program for executing is stored with the machine-executable instruction that can be executed by the processor;The processor is for executing machine Executable instruction, to realize above-mentioned data processing method steps.
Fourth aspect, the application provide a kind of machine readable storage medium, and the machine readable storage medium storage is organic Device executable instruction, for the machine-executable instruction when being called and being executed by processor, the machine-executable instruction can be with The processor is promoted to realize above-mentioned data processing method steps.
Using technical solution disclosed by the invention, by being repaired to the data store organisation in traditional MVBT implementation Change, is that the page of each tree structure increases associated sequence array, each array element in the sequence array is for characterizing Position offset of the memory element in page, and then can be based on the sequence array to the page of associated tree structure In memory element in the Key that records sequentially searched for, improve data processing performance.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of data processing method provided in an embodiment of the present invention;
Fig. 2A~2B is a kind of page of tree structure provided in an embodiment of the present invention and showing for associated sequence array It is intended to;
Fig. 3 A is that a kind of pair of page provided in an embodiment of the present invention is terminated and share the schematic diagram of operation equally;
Fig. 3 B be a kind of pair of page provided in an embodiment of the present invention terminate and insertion operation schematic diagram;
Fig. 4 A~4C is the signal of anti-Key range overlapping when being inserted into memory element in page provided in an embodiment of the present invention Figure;
Fig. 5 A be a kind of pair of page provided in an embodiment of the present invention terminate and splitting operation schematic diagram;
Fig. 5 B be a kind of pair of page provided in an embodiment of the present invention terminate and union operation schematic diagram;
Fig. 6 is a kind of schematic diagram of the page of tree structure provided in an embodiment of the present invention;
A kind of Fig. 7 structural schematic diagram of data processing equipment provided in an embodiment of the present invention;
Fig. 8 is a kind of hardware structural diagram of data processing equipment provided in an embodiment of the present invention.
Specific embodiment
Technical solution in embodiment in order to enable those skilled in the art to better understand the present invention, below first to this hair Bright embodiment is related to part term and Key ordering rule is briefly described.
One, term is explained:
Termination:The memory element for the Live Key for having included in one Page (page) is inserted into a new Page, And the Live Key in former Page is labeled as Dead Key;
It terminates and is inserted into:The Key that the memory element of the Live Key for having included in one Page and record are inserted into Memory element be inserted into a new Page, and the Live Key in former Page is labeled as Dead Key;
It terminates and shares equally:The Key that the memory element for the Live Key for having included in one Page and record are inserted into Memory element, which is divided equally, is inserted into two new Page, and the Live Key in former Page is labeled as Dead Key;
It terminates and merges:By the memory member for the Live Key for having included in a Page and its brother (Sibling) Page Element is inserted into a new Page, and the Live Key in former Page and its brother Page is labeled as Dead Key;
It terminates and divides:By the memory member for the Live Key for having included in a Page and its brother (Sibling) Page Element, which is divided equally, is inserted into two new Page, and the Live Key in former Page and its brother Page is labeled as Dead Key.
Wherein, the end version number of the Dead Key newly marked in any of the above-described operation is the corresponding version number of the operation, The starting version number for being inserted into the Live Key in new Page is that this operates corresponding version number.
Two, Key ordering rule:
For Key according to sorting from big to small or from small to large, the composition and comparison rule of Key is as follows:
Key consists of two parts:The value of Key and the life cycle of Key.The value of Key can be customized by the user, and be survived Period be with generation/the modify Key write affairs depending on.The form of { a, [b, c) } used herein indicates Key, wherein a For the value of the Key, [b, c) be the Key life cycle.
The comparison of Key is divided to two kinds, and one is comparisons when insertion, comparison when searching for when a kind of:
Comparison when for insertion:
Compare the value of Key first, it is bigger to be worth more big then Key;If value is identical, then compares the life cycle of Key:Key at this time Starting version number it is bigger, then Key is bigger.Citing:
1, Key1={ 3, [1, +≤) } and Key2={ 4, [5,6) }, then due to 4 > 3, Key2>Key1.
2, Key1={ 3, [Isosorbide-5-Nitrae) } and Key2=3, [6, +≤) }, then due to 6 > 1, Key2>Key1.
Comparison when for search:
Key to be searched is referred to as Search_Key herein, and Key present in MVBT is Compare_Key.When search The version number of Search_Key is a unique value, is not section.
Compare the value of two Key when Search_Key and Compare_Key compare first, it is bigger to be worth more big then Key.
It is worth in identical situation, if the end version of the version number >=Compare_Key life cycle of Search_Key Number, then Search_Key > Compare_Key;
If the starting version number of the life cycle of the version number < Compare_Key of Serach_Key, Search_Key < Compare_Key;
If starting version number≤Search_Key version number < Compare_Key of the life cycle of Compare_Key Life cycle end Version, then Search_Key=Compare_Key.Citing:
Search_Key={ 3,8 }, Compare_Key={ 3, [10, +≤) }, then Search_Key < Compare_ Key;
Search_Key={ 3,8 }, Compare_Key={ 3, [2,6) }, then Serach_Key > Compare_Key;
Search_Key={ 3,8 }, Compare_Key={ 3, [8,9) }, then Search_Key=Compare_Key;
Search_Key={ 3,8 }, Compare_Key={ 3, [6,8) }, then Search_Key > Compare_Key.
It should be noted that under normal circumstances, the life cycle of a Key will not cover mutually, but in the same affairs Inside a Key is deleted in addition repeatedly, may result in that there are multiple identical Key.For such in the same affairs The Key deleted after addition thinks Compare_Key < Search_key when relatively.Such as:Compare_Key=3, [8, 8) } { 3,8 } < Search_Key=.
In order to keep the above objects, features, and advantages of the embodiment of the present invention more obvious and easy to understand, with reference to the accompanying drawing Technical solution in the embodiment of the present invention is described in further detail.
It referring to Figure 1, is a kind of flow diagram of data processing method provided in an embodiment of the present invention, wherein the number According to processing method can be applied to support Key-Value data model storage the network equipment (hereinafter referred to as network is set It is standby), as shown in Figure 1, the data processing method may comprise steps of:
Step 101, creation target MVBT data store organisation.
In the embodiment of the present invention, it is contemplated that the memory element in traditional MVBT implementation in each page be it is out-of-order, When carrying out the search for Key, each memory element in page is needed to be traversed for, Key search efficiency is poor, data processing performance It is lower, therefore, in order to improve data processing performance, it can modify to the data store organisation of existing MVBT, make MVBT Key can sequentially be searched for.
Wherein, which includes tree The page of shape structure and respectively with the associated sequence array of each page, which also includes at least one memory element, Key is recorded in each memory element, each array element in the array that sorts is for characterizing position of the memory element in page Set offset.
Wherein, each array element sequentially stores in sequence array, and the sequence stored is recorded with each memory element Key ranking results it is consistent (hereinafter by taking Key is according to sequence sequence from small to large as an example).
For the page shown in Fig. 2A, the associated sequence array of the page can be as shown in Figure 2 B, wherein the sequence Each array element is for identifying position offset of the memory element in page in array, and each array element in the array that sorts The sequence of storage is consistent with the ranking results of Key that each memory element records.
It should be noted that in practical applications, memory element in memory page node can also be recorded in the array that sorts Quantity, specific implementation do not repeat them here herein.
Further, in embodiments of the present invention, it is contemplated that only supported in traditional MVBT implementation fixed length Key and Value, it is poor so as to cause data storage flexibility, and storage resource waste and data processing performance decline.
Correspondingly, the present invention in one embodiment, the page of tree structure is (referred to herein as in the first kind Page is deposited, TreeNodePage (tree node page) is referred to as) for storing location information (referred to herein as Key of Key Set), the location information (the referred to herein as position Value) of Value corresponding with the Key and the life cycle of the Key, no longer Store specific Key and Value;In addition, increasing the page (Data for storing Key in target MVBT data store organisation newly Page for Key, referred to herein as Second Type page) and page (Data Page for for storing Value Value, referred to herein as third type memory page).
Wherein, as the first kind page of leaf node, wherein the position Value stored includes storing the Value Third type memory page index (such as position of the third type memory page) and the Value in the third type memory page In offset;As the first kind page of n omicronn-leaf child node, wherein the position Value stored includes the Value corresponding Key where next layer (according to the root node page-branch node page-sequence of leaf node page from top to bottom) first kind memory Offset of the index and the position Value of page in the first kind page.
For any Key, which includes in the Second Type for storing the Key in the position Key in first kind page Deposit the offset of the index (such as position of the Second Type page) and the Key of page in Second Type page.
In this embodiment, pass through Key location field, Value location field and life in first kind page respectively Cycle of deposit field stores the position Key, the position Value and life cycle;Wherein, a Key location field and its corresponding Value field and field life cycle collectively form the memory element (referred to herein as first in first kind page Type memory element).
Wherein, the length of each first kind memory element is fixed and identical in first kind page, i.e., in the first kind The quantity for depositing the first kind memory element that can be accommodated in page is fixed, therefore, the merging and division of the first kind page The specific implementation of equal operations is referred to the implementation of the operations such as merging and division of page in traditional MVBT.
The length of the Key and Value that store in Second Type page and third type memory page are no longer fixed, but can To include that the random length that Key and Value are supported in practical application reduces to improve the flexibility of data storage Storage resource waste, improves data processing performance.
Optionally, the associated sequence array of each first kind page can recorde (herein in the 4th type memory page It is properly termed as SortListPage).
Step 102 responds the data processing request received based on target MVBT data store organisation.
In the embodiment of the present invention, the network equipment is established after above-mentioned target MVBT data store organisation, can be based on the mesh Mark MVBT data store organisation responds the data processing request received.
Wherein, which can include but is not limited to:Key insertion request, Key removal request and Key are read Take request etc..
As it can be seen that in method flow shown in Fig. 1, by being carried out to the data store organisation in traditional MVBT implementation Modification is that the page of each tree structure increases associated sequence array, and each array element characterizes memory in the sequence array Position offset of the element in page, and each array element sequence array in sequentially store, and store sequence with The ranking results of the Key of each memory element record are consistent, and then can be based on the sequence array to associated tree structure Key in page is sequentially searched for, and data processing performance is improved.
Below based on above-mentioned target MVBT data store organisation, to the processing stream of various types of data processing request Journey is illustrated.
It should be noted that hereinafter if non-specified otherwise, mentioned page refer both to target MVBT data storage knot The page of tree structure in structure.
The application in one embodiment, it is above-mentioned based on target MVBT data store organisation to the data received at Reason request is responded, and may include:
When data processing request is the insertion request for the first Key, root node in the page of tree structure is judged Page whether there is next layer of node page;
If so, according to from root node page to the sequence of leaf node page, based on sequence array, the is determined using dichotomy The first object leaf node page of one Key insertion;Otherwise, root node page is determined as first object leaf node page;
In first object leaf node page, be inserted into the first memory element, record in the first memory element this first Key。
It should be noted that in embodiments of the present invention, the insertion to Key may include Key and Key corresponding The insertion of Value and life cycle;It similarly, also may include the reading of the corresponding Value of Key and Key to the reading of Key, The embodiment of the present invention is subsequent no longer to be repeated.
In this embodiment, when needing to be inserted into the first Key, it can first judge that root node page whether there is Next layer of node page;If it does not exist, then directly the leaf node page that the root node is determined as the first Key insertion (is claimed herein For first object leaf node page).
Wherein, when the page of tree structure only includes a page, which had not only been used as root node page, but also made For leaf node page.
It, can be according to from root node page to the sequence of leaf node page, base if one layer of node page in the presence of root node page In the associated sequence array of each page of target MVBT, the leaf node of the first Key insertion is determined (herein using dichotomy Referred to as first object leaf node page).
Specifically, can be selected in the associated sequence array of root node page first with dichotomy an array element (under Referred to herein as first object array element, the position offset of first object array element characterization is hereinafter referred to as first object Position offset), and compare the Key and the of the memory element record in the root node page of first object position offset direction One Key.
If the Key is greater than the first Key, sorted in the associated sequence array of root node page in the first mesh using dichotomy Array element selection is carried out again in array element after mark array element, until determining the Key of hit.
If the Key is sorted in the associated sequence array of root node page in the first mesh less than the first Key using dichotomy Array element before mark array element carries out array element selection again, until determining the Key of hit.
For ease of description, hereinafter directly will be described as selecting from sequence array from selection array element in sequence array Position offset.
As an example it is assumed that including Key in root node page:1,4 and 7, the position offset difference in root node page It is 0,2 and 1, then the vertical sequence of sequence of each position offset is 0-2-1 in associated sequence array in root node page, When needing the Key that is inserted into is 5, it can first compare 5 and the corresponding Key of position offset 2 (i.e. 4), due to 5 > 4, can To select a position offset, i.e. position offset 1 again in the subsequent position offset of position offset 2 in sequence, Since 5 less than the corresponding Key of position offset 1 (i.e. 7), hence, it can be determined that the Key hit in root node page is 4.
In this embodiment, it is determined that, can be again using dichotomy in the hit after the Key hit in root node page The associated sequence array of next layer of node page be directed toward of Key in carry out the comparison of position offset selection and Key, until find It is inserted into the first object leaf node page of the first Key.
Further, in this embodiment, it is contemplated that the capacity of single page is limited, when identified progress Key is inserted When the off-capacity of the page entered, need to create new page for carrying out the insertion of Key.
Wherein, the capacity of page can be characterized by memory number of elements, which can be above-described embodiment Described in first kind memory element, alternatively, the memory element can be by the corresponding Value of Key and Key and life cycle It constitutes;The length of single memory element is fixed, and therefore, the memory number of elements that can be accommodated in single page is can in advance really Fixed.
Further, since there is limitation (the i.e. most parcel of minimum Live Key quantity (generally higher than 1) in MVBT in page The limitation of the quantity of the memory element of the Key containing Live), therefore, it is identified carry out Key insertion page capacity not When sufficient, new page is directly created, and insertion includes the realization of the memory element of the Key directly in the new creation page Mode is unable to satisfy the limitation of the minimum Live Key quantity of page.
To solve the above-mentioned problems, above-mentioned in first object leaf node page in a kind of implementation of the embodiment In, it is inserted into the first memory element, may include:
Judge whether the quantity of memory element in first object leaf node page is greater than default first amount threshold;
If the quantity of memory element is greater than default first amount threshold in first object leaf node page, the first leaf is created Child node page;
The memory element for the work Key for having included in first memory element and first object leaf node page is inserted into first Leaf node page;
Work Key in first object leaf node is labeled as dead Key;
Creation and the associated sequence array of the first leaf node page.
In this embodiment, when the first object leaf node page of the first Key of insertion has been determined, it can be determined that first Whether memory number of elements reaches the default memory number of elements upper limit and (is properly termed as default the herein in target leaves node page One amount threshold can be set according to actual scene, such as the maximum capacity of page), if not up to, directly in first mesh The first memory element is inserted into mark leaf node page;If reaching, the network equipment can be carried out first object leaf node page Termination creates the first leaf node page for being inserted into the memory element for the work Key for having included in first object leaf node page With the first memory element, and the work Key in first object leaf node page is labeled as dead Key.
Wherein, when the network equipment creates the first leaf node page, the first associated sequence of leaf node page can also be created Array, and the position offset of each memory element in the first leaf node page is recorded in the sequence array, and each position The ranking results for setting the Key of the sequence memory element record corresponding with position offset of offset are consistent.
It should be noted that in this embodiment, if after the first memory element of insertion, it is interior in first object leaf node page The quantity for depositing element is less than or equal to default first amount threshold, then the first memory element directly can be inserted into first object leaf Child node page, and update the associated sequence array of first object leaf node page, that is, increase by the first memory element in first object Position offset in leaf node page, and each position offset is ranked up, specific implementation does not repeat them here herein.
Further, it is contemplated that when terminating to first object leaf node page, if in first object leaf node page When the quantity of the memory element for the work Key for having included is more, by the memory for the work Key for having included in first object leaf node page When element and the first memory element are inserted into a first leaf node page, the quantity of memory element in the first leaf node page Default first amount threshold can be greater than.
For example, it is assumed that default first amount threshold is 6, when needing to be inserted into the first memory element, first object leaf knot The memory number of elements for the work Key for having included in point page is 6, then needs to terminate to first object leaf node page, still If only creating a first leaf node page at this time, need to be inserted into 7 memory elements, memory in the new first leaf node page Number of elements can be greater than default first amount threshold and therefore in this case, need to create two the first leaf node pages.
Correspondingly, in one example, above-mentioned to have included in the first memory element and first object leaf node page The memory element of Key living is inserted into the first leaf node page, may include:
Judge the quantity and the first memory element of the memory element for the work Key for having included in first object leaf node page Whether the sum of quantity is greater than default first amount threshold;
If so, two the first leaf node pages of creation, and will be in the first memory element and first object leaf node page The memory element for the work Key for having included, which is divided equally, is inserted into each first leaf node page;
Otherwise, create a first leaf node page, and by the first memory element and first object leaf node page The memory element for the work Key for including is inserted into the first leaf node page.
Specifically, in this example, when determination needs to create the first leaf node page, it can be determined that first object leaf Whether the sum of the quantity of the memory element for the work Key for having included in node page and the quantity of the first memory element are greater than default first Amount threshold.
If the number of the quantity of the memory element for the work Key for having included in first object leaf node page and the first memory element The sum of amount is greater than default first amount threshold, then can be terminated and share operation equally, that is, creates two the first leaf node pages, The memory element for the work Key for having included in first object leaf node page and the first memory element are divided equally and are inserted into each first Leaf node page, and the work Key in first object leaf node page is labeled as dead Key.
For example, shown in Fig. 3 A for scene, in this scenario, it is assumed that default first amount threshold is 6, is inserted into The first Key be 11, [10, +≤), it (is comprising Key living that the quantity of memory element, which is 6, in first object leaf node page Memory element), due to be inserted into comprising the first Key the first memory element after, include in first object leaf node page The quantity (7) of memory element is greater than default first amount threshold (6), and the work Key for having included in first object leaf node page The quantity (6) of memory element and the sum of the quantity (1) (7) of the first memory element be greater than default first amount threshold (6), because This, needs to create two the first leaf node pages, and by the memory element for the work Key for having included in first object leaf node page Divide equally with the first memory element and is inserted into each first leaf node page (4 memory elements of one of insertion, another insertion 3 memory elements), and the work Key in first object leaf node page is labeled as dead Key.
It should be noted that in embodiments of the present invention, memory element may be out-of-order in tree structure page, i.e., Not according to comprising Key be ranked up, need based on memory the associated sequence array of page realize and sequentially search for, and in order to just In understanding and explanation, in attached drawing in page each memory element by comprising Key be ranked up, the embodiment of the present invention is subsequent not It repeats again.
In this example, if the quantity and first of the memory element for the work Key for having included in first object leaf node page The sum of quantity of memory element is less than or equal to default first amount threshold, then can carry out terminating simultaneously insertion operation, that is, creates one A first leaf node page, by the memory element and the first memory element of the work Key for having included in first object leaf node page It is inserted into the first leaf node page, and the work Key in first object leaf node page is labeled as dead Key.
For example, shown in Fig. 3 B for scene, in this scenario, it is assumed that default first amount threshold is 6, is inserted into The first Key be 11, [10, +≤), the quantity of memory element is 6 (comprising in Key living in first object leaf node page The quantity for depositing element is 2, i.e., 9, [3, +≤) and 10, [3, +≤)), due to being inserted into the first memory member comprising the first Key After element, the quantity (7) in first object leaf node page comprising memory element is greater than default first amount threshold (6), and the The quantity (2) of the memory element for the work Key for having included in one target leaves node page and the sum of the quantity (1) of the first memory element (3) it is less than default first amount threshold (6), thus, it is only required to create a first leaf node page, and by first object leaf The memory element for the work Key for having included in node page and the first memory element are inserted into the first leaf node page, and by the first mesh Work Key in mark leaf node page is labeled as dead Key.
Further, in this embodiment, it is contemplated that in MVBT Key insertion, delete and read etc. operations be required to by The positioning of leaf node page is carried out, according to the sequence (sequence from top to bottom) from root node page to leaf node page in order to guarantee Newly created leaf node page is navigated to, needs to increase in the upper layer node of newly created leaf node page and is directed toward the new creation Leaf node memory element.
Correspondingly, after above-mentioned the first leaf node of creation page, can also include:
Judge whether first object leaf node page is root node page;
If first object leaf node page is not root node page, it is inserted into the father node page of first object leaf node page It is directed toward the second memory element, records data pointer in the second memory element, which is directed toward the first leaf node page, and It updates and the associated sequence array of the father node page;
If first object leaf node page is root node page, and the quantity of the first leaf node page is greater than 1, then creates another Root node page is inserted into the second memory element in another root node page, which records data pointer, the data Pointer is directed toward the first leaf node page, and creates and the associated sequence array of another root node page.
Specifically, if first object leaf node page is that (tree i.e. where first object leaf node page is only for root node page There are one layer of node, first object leaf node page is that root node page is also leaf node page), then creating the first leaf When node page, one tree originally become two tree (one tree be using former first object leaf node page as the tree of root, it is another Tree is the corresponding tree of the first leaf node page), at this time, it may be necessary to further be determined according to the quantity of the first leaf node page subsequent Processing strategie.
Wherein, if the quantity of the first leaf node page is 1, directly using the first leaf node page as the root knot of new tree Point page does not need to carry out in father node page in insertion second at this point, father node page is not present in the first leaf node page Deposit the operation of element.
If the quantity of the first leaf node page is greater than 1 (being in this embodiment 2), needs to create another root node page and make For the root node page of new tree, and it is inserted into the second memory element in another root node page, and creates another root node page association Sequence array.
Wherein, record has position offset of the second memory element in another root node page in the sequence array, and The position offset is ranked up in the manner described above.
If first object leaf node page is not root node page, when having applied for the first leaf node page, need The father node page of one target leaves node page is inserted into the second memory element, and updates the associated sequence array of the father node page.
It should be noted that in inventive embodiments, when first object leaf node page is not root node page, and this When inserting the second memory element in the father node page of one target leaves node page, memory may also be will appear in the father node page The case where number of elements is more than default first amount threshold, accordingly it is also possible to be determined according to mode described in above-described embodiment Whether operation, specific implementation may refer to above-mentioned reality if needing to be terminated to the father node page and be inserted into or terminated and shared equally etc. It applies to the relevant treatment of first object leaf node page in example, details are not described herein for the embodiment of the present invention.
Further, in this embodiment, it is contemplated that when first object leaf node page is not root node page, and first When inserting the second memory element in the father node page of target leaves node page, it is possible that Key range in the father node page (there is the memory element for recording identical Key) in the case where overlapping, in turn, search carrying out data using dichotomy i.e. in father node page Suo Shi, it is possible that abnormal.
For example, shown in Fig. 4 A for scene, it is assumed that default first amount threshold is 5, when need to be inserted into Key 9, [9, +≤) } when, the first object leaf node page of hit is the leaf node page (Page3) of bottom right, since insertion includes After the memory element of Key { 9, [9, +≤) }, the quantity of memory element is 6 in first object leaf node page, is greater than default the One amount threshold (5), and the quantity (5) of the memory element for the work Key for having included in first object leaf node page and be inserted into The sum of the quantity (1) of memory element (6) be greater than default first amount threshold (5), therefore, it is necessary to carry out to the leaf node page It terminates and shares operation equally, wherein terminate and the schematic diagram for sharing the tree structure page after operation equally can be as shown in Figure 4 B.
In the tree structure page shown in Fig. 4 B, the leaf knot being terminated that Key in root node page { 4, [6,9) } is directed toward The range of the value of Key is 4~8 in point page (Page3), and since the value of Key in root node page (Page1) is respectively 1,4 and 7, According to dichotomy principle, Key of the value greater than 7 should the search in the leaf node page (Page5) that Key { 7, [9, +≤) } are directed toward, Therefore, in the tree when Key corresponding memory element of the search value greater than 7, it is only capable of searching what Key { 7, [9, +≤) } was directed toward Data in leaf node page (Page5), and can not search in the leaf node page (Page3) that Key { 4, [6,9) } is directed toward Data.
In view of the above-mentioned problems, in one example, the above-mentioned father node page in first object leaf node page is inserted into second After memory element, can also include:
Judge in memory element that the father node page includes with the presence or absence of the memory for recording identical Key with the second memory element Element;
If it exists, then a same layer node page with father node page same layer, the work Key that will included in father node page are created Memory element and the second memory element be inserted into same layer node page;
Work Key in father node page is labeled as dead Key;
Creation and the associated sequence array of same layer node page.
Specifically, in this example, the first leaf knot is directed toward in insertion in the father node page of first object leaf node page After second memory element of point page, it can be determined that whether there is and second memory in the memory element that the father node page includes Element records the memory element of identical Key.
In this example, identical Key is recorded with the second memory element if existing in the memory element that father node page includes Memory element can then create a same layer node page with father node page same layer, the work Key that will included in father node page Memory element and the second memory element are inserted into the same layer node page, and the work Key in the father node is labeled as dead Key.
For example, still for the scene shown in Fig. 4 A, when Key 9, [9, +≤) insertion results in the need for bottom right leaf Node page (Page3) carries out termination when sharing equally, in order to avoid there is the overlapping of Key range, carries out eventually to the bottom right leaf node page When knot is shared equally, to its father node page (Page1) can also terminate simultaneously insertion operation, i.e., will include in the father node page The memory element and direction of Key living terminates to bottom right leaf node page (Page3) and shares two created when operation equally The memory element of first leaf node page (Page4 and Page5) is inserted into same layer node page (Page6), and by the father node page (Page1) the work Key in is labeled as dead Key, and schematic diagram can be as shown in Figure 4 C.
It should be noted that in this example, the same layer node page of above-mentioned creation, and will in father node page include to live The memory element of Key and the second memory element are inserted into after the same layer node page, if the father node page is not root node page, are also needed The memory element that record is directed toward the data pointer of the same layer node page is inserted into the father node page of the father node page.
For example, for the scene shown in Fig. 4 C, it is assumed that Page1 is not root node page, then after completing aforesaid operations, needs Insertion record is directed toward the memory element of the data pointer of Page6 in the father node page of Page1.
In this case, may also will appear memory number of elements in the father node page of the father node page is more than default first The case where amount threshold, accordingly it is also possible to determine the need for according to mode described in above-described embodiment to the father node page Father node page the operation such as terminated and be inserted into or terminated and shared equally, specific implementation may refer in above-described embodiment to the The relevant treatment of one target leaves node page, details are not described herein for the embodiment of the present invention.
In another embodiment of the application, the above-mentioned data processing based on target MVBT data store organisation to receiving Request is responded, and may include:
When data processing request is the removal request for the 2nd Key, according to root node page in tree structure to leaf The sequence of node page selects array element in sequence array using dichotomy;
Compare the Key and the 2nd Key recorded in the corresponding memory element of the array element, to determine the second target leaves knot Point page;It wherein, include first object memory element, the Key of first object memory element record in the second target leaves node page It is matched with the 2nd Key;
The Key of target memory element record in second target leaves node page is labeled as dead Key.
In this embodiment, the 2nd Key and it is not specific to the Key of a certain fixation, but may refer to any for needing to delete Key。
In this embodiment, it when needing to delete the 2nd Key, can first be arrived according to root node page in tree structure The sequence of leaf node page selects array element, and it is corresponding to compare the array element in sequence array using dichotomy The Key and the 2nd Key recorded in memory element, to determine the second target leaves node page.
Specifically, a position offset can be selected in the associated sequence array of root node page first with dichotomy (hereinafter referred to the second target position offset), and compare interior in the root node page that the second target position offset is directed toward Deposit the Key and the 2nd Key that element includes.
If the Key is equal to the 2nd Key, when next layer of node page is not present in the root node page, then directly by the root knot Point page is determined as the second target leaves node page, which is determined as and the matched target memory element of the 2nd Key;When this In the presence of root node page when one layer of node page, then dichotomy next layer that the memory element is directed toward in root node page is continued with Position offset selection is carried out in the associated sequence array of node page and Key compares;
If the Key is greater than the 2nd Key, continues with dichotomy and sort from the associated sequence array of the root node page The selection of position offset is carried out in position offset after second target offset amount and Key compares, until finding adjacent Two position offsets, wherein the preceding corresponding Key that sorts is less than the 2nd Key, sort a posterior corresponding Key When greater than two Key, the corresponding memory element of the preceding position offset of the sequence is determined as hitting in the root node page Memory element;Alternatively, the position offset that corresponding Key is equal to the 2nd Key is found, by the corresponding memory of the position offset Element is determined as the memory element hit in the root node page;
If the Key continues with dichotomy and sorts from the associated sequence array of the root node page less than the 2nd Key The selection of position offset is carried out in position offset before second target offset amount and Key compares, until finding adjacent Two position offsets, wherein the preceding corresponding Key that sorts is less than the 2nd Key, sort a posterior corresponding Key When greater than two Key, the corresponding memory element of the preceding position offset of the sequence is determined as hitting in the root node page Memory element;Alternatively, the position offset that corresponding Key is equal to the 2nd Key is found, by the corresponding memory of the position offset Element is determined as the memory element hit in the root node page.
In this embodiment, it is determined that with the second target leaves node where the matched target memory element of the 2nd Key When page, the Key that target memory element includes in the second target leaves node page can be labeled as dead Key, for example, by this The end version number for the Key that target memory element includes in two target leaves node pages is updated to this time operate corresponding version Number.
Further, in this embodiment, it is contemplated that the page of non-root node page has minimum Key quantity living in MVBT Limitation (limitation that the Key that i.e. minimum includes is the memory number of elements of Key living), and the Key for including in page is carried out The quantity that can reduce the memory element comprising Key living in page is deleted, so as to will lead in page comprising Key's living The quantity of memory element is unable to satisfy the limitation of minimum Key quantity living.
Correspondingly, in a kind of embodiment of the embodiment, in the above-mentioned target by the second target leaves node page The Key for depositing element record is labeled as after dead Key, can also include:
When the second target leaves node page is not root node page, the work for having included in the second target leaves node page is judged Whether the quantity of the memory element of Key is less than default second amount threshold;
If so, the second leaf node page of creation, by the second target leaves node page and the second target leaves node page The memory element for the work Key for having included in fraternal page is inserted into the second leaf node page, and by the second target leaves node page and Work Key in fraternal page is labeled as dead Key;
Create the associated sequence array of the second leaf node page.
In this embodiment, when the second target leaves node page is not root node page, by the second target leaves knot The Key that target memory element in point page includes is labeled as after dead Key, it can be determined that has been wrapped in the second target leaves node page Whether the quantity of the memory element of the work Key contained is less than default second amount threshold.
If being less than, the fraternal page of the second target leaves node page and the second target leaves node page can be carried out eventually Knot operation, that is, create the second leaf node page, by the fraternal page of the second target leaves node page and the second target leaves node page In included the memory element of work Key be inserted into the second leaf node page, and by the second target leaves node page and the second mesh The work Key for marking the fraternal page of leaf node page is labeled as dead key.
Wherein, the fraternal page of the second target leaves node page can be the second target leaves node page left or right side phase Neighbour, and the identical same layer node page of father node page.
Wherein, when the network equipment creates the second leaf node page, the second associated sequence of leaf node page can also be created Array.
Further, it is contemplated that the fraternal page of the second target leaves node page and the second target leaves node page is carried out When termination, if the memory element comprising Key living in the fraternal page of the second target leaves node page and the second target leaves node page Quantity it is more when, the work Key that will include in the fraternal page of the second target leaves node page and the second target leaves node page When memory element is inserted into the second leaf node page, the quantity of memory element can be greater than default first in the second leaf node page Amount threshold.
Correspondingly, in one example, above-mentioned the second leaf node of creation page, by the second target leaves node page and second The memory element for the work Key for having included in the fraternal page of target leaves node page is inserted into the second leaf node page, including:
Whether judge the sum of quantity of memory element of work Key for having included in the second target leaves node page and fraternal page Greater than default first amount threshold;
If so, two the second leaf node pages of creation, and will include in the second target leaves node page and fraternal page The memory element of work Key divide equally and be inserted into each second leaf node page;
Otherwise, a second leaf node page is created, and will include in the second target leaves node page and fraternal page The memory element of Key living is inserted into the second leaf node page.
Specifically, in this example, when creating the second leaf node page, it can be determined that in the second target leaves node page The work Key's for having included in the fraternal page of the quantity of the memory element for the work Key for having included and the second target leaves node page is interior Deposit whether the sum of quantity of element is greater than default first amount threshold.
If so, the simultaneously splitting operation that can carry out terminating, that is, create two new leaf node pages, by the second target leaves The memory element for the work Key for having included in the fraternal page of node page and the second target leaves node page, which is divided equally, is inserted into each second Leaf node page, and the work Key in the fraternal page of the second target leaves node page and the second target leaves node page is marked For dead Key.
For example, shown in Fig. 5 A for scene, in this scenario, it is assumed that default second amount threshold is 2, presets the One amount threshold is 6, the 2nd Key to be deleted be 9, [10, +≤), the interior of Key living is included in the second target leaves node page The quantity for depositing element is 2, then when the 2nd Key being labeled as dead Key, the memory comprising Key living in the second target leaves node page The quantity of element will be unsatisfactory for the limitation of default second amount threshold, at this time, it may be necessary to the second target leaves node less than 2 The fraternal page of page and the second target leaves node page terminates, due to the second target leaves node page and the second target leaves knot The sum of the quantity of memory element of work Key for having included in the fraternal page of point page (1+6=7) is greater than default first amount threshold (6), therefore, it is necessary to create two the second leaf node pages, by the second target leaves node page and the second target leaves node page Fraternal page in included the memory element of work Key divide equally and be inserted into (the one of insertion 4 of each second leaf node page Memory element, another 3 memory element of insertion), and by the second target leaves node page and the second target leaves node page Work Key in fraternal page is labeled as dead Key.
In this example, if having included in the fraternal page of the second target leaves node page and the second target leaves node page The sum of the quantity of memory element of Key living is less than or equal to default first amount threshold, then can carry out terminating simultaneously union operation, i.e., A second leaf node page is created, will have been wrapped in the fraternal page of the second target leaves node page and the second target leaves node page The memory element of the work Key contained is inserted into the second leaf node page, and by the second target leaves node page and the second target leaves Work Key in the fraternal page of node page is labeled as dead Key.
For example, shown in Fig. 5 B for scene, in this scenario, it is assumed that default second amount threshold is 2, presets the One amount threshold is 6, the 2nd Key to be deleted be 9, [10, +≤), the interior of Key living is included in the second target leaves node page The quantity for depositing element is 2, then when the 2nd Key being labeled as dead Key, the memory comprising Key living in the second target leaves node page The quantity of element will be unsatisfactory for the limitation of default second amount threshold, at this time, it may be necessary to the second target leaves node less than 2 The fraternal page of page and the second target leaves node page terminates, due to the second target leaves node page and the second target leaves knot The sum of the quantity of memory element of work Key for having included in the fraternal page of point page (1+3=4) is less than default first amount threshold (6), a second leaf node page therefore, can be only created, by the second target leaves node page and the second target leaves node The memory element for the work Key for having included in the fraternal page of page is inserted into the second leaf node page, and by the second target leaves knot Work Key in the fraternal page of point page and the second target leaves node page is labeled as dead Key.
Further, in this embodiment, it is contemplated that in MVBT Key insertion, delete and read etc. operations be required to by The positioning of leaf node page is carried out, according to the sequence (sequence from top to bottom) from root node page to leaf node page in order to guarantee Newly created leaf node page is navigated to, needs to increase in the upper layer node page of newly created leaf node page and is directed toward the new wound The memory element for the leaf node built.
Correspondingly, in one example, after above-mentioned the second leaf node of creation page, further include:
It is inserted into third memory element in the father node page of the second target leaves node page, records data in third memory element Pointer, which is directed toward the second leaf node page, and updates and the associated sequence array of the father node page.
Wherein, which may refer to the first mesh in the process flow for the insertion request of the first Key The related realization for the case where leaf node page is not root node page is marked, details are not described herein for the embodiment of the present invention.
Further, in this embodiment, it is contemplated that when the second target leaves node page is not root node page, and second When inserting the third memory element for being directed toward the second leaf node page in the father node page of target leaves node page, the father node page In it is possible that Key range be overlapped the case where, in turn, using dichotomy carry out data search when, it is possible that extremely.
In view of the above-mentioned problems, in one example, being inserted into third memory in the father node page of the second target leaves node page After element, further include:
Judge in memory element that father node page includes with the presence or absence of the memory member for recording identical Key with third memory element Element;
If it exists, then one and a same layer node page of father node page same layer are created, will include in father node page Work Key memory element and third memory element be inserted into same layer node page;
Work Key in father node page is labeled as dead Key;
Creation and the associated sequence array of same layer node page.
Wherein, which may refer to the correlation in the process flow for the insertion request of the first Key It realizes, details are not described herein for the embodiment of the present invention.
In another embodiment of the application, the above-mentioned data processing based on target MVBT data store organisation to receiving Request is responded, and may include:
When data processing request is for the 3rd Key with the read requests to corresponding 3rd Value of the 3rd Key, press According to the sequence of root node page in tree structure to leaf node page, array element is selected in sequence array using dichotomy;
Compare the Key and the 3rd Key recorded in the corresponding memory element of the array element, to determine third target leaves knot Point page;It wherein, include the second target memory element, the Key of the second target memory element record in third target leaves node page It is matched with the 3rd Key;
From the second target memory element for including in third target leaves node page, the 3rd Key and third are read Value。
In this embodiment, the 3rd Key and it is not specific to the Key of a certain fixation, but may refer to any for needing to read Key。
In this embodiment, when needing to be read out the 3rd Key and corresponding 3rd Value of the 3rd Key, Ke Yixian According to the sequence of root node page in tree structure to leaf node page, using dichotomy, in the sequence array, array is selected Element, and compare the Key and the 3rd Key recorded in the corresponding memory element of the array element, to determine third target leaves knot Point page.
Wherein, the determining third target leaves node with where the matched target memory element of the 3rd Key of dichotomy is utilized The specific implementation of page may refer to the related realization in the process flow for the removal request of the 2nd Key, the embodiment of the present invention Details are not described herein.
It should be noted that when carrying out Key search, matched Key is Key living (i.e. existence week when carrying out Key deletion Phase is +≤);And when carrying out Key reading, the version number of Key can be carried in read requests, when carrying out Key search, it is also necessary into The matching of row version number.
In this embodiment, it is determined that with the third target leaves where the matched second target memory element of the 3rd Key When node page, can according to the second target memory element in third target leaves node page to the 3rd Key and the 3rd Value into Row is read.
Wherein, when the memory element in leaf node page include be Key and corresponding Value and when life cycle, The 3rd Key and its corresponding third can be read directly from the second target memory element in third target leaves node page Value。
Including when the memory element in leaf node page is the position Key and the corresponding position Value and life cycle When, it can be read according to the position Key for including in the second target memory element in third target leaves node page and the position Value Take the 3rd Key and its corresponding 3rd Value.
It should be noted that in embodiment, when needing to be read out the 3rd Key, and determine and the 3rd Key When third target leaves node page where the second target memory element matched, if second in the third target leaves node page (i.e. final search result is Search_ to the version numbers match of the life cycle for the Key that target memory element includes and the 3rd Key Key=Compare Key), it is determined that search result is accurate matching;If in the third target leaves node page in the second target Deposit the Key that element includes life cycle and the 3rd Key version number mismatch (i.e. final search result be Search_Key > Compare Key or Search_Key < Compare Key), it is determined that search result is inexact matching.
Further, in embodiment, it is contemplated that the search of Key is according to root node page in tree structure to leaf node What the sequence of page carried out, but be according to from leaf node page to root node page when the operation such as insertion or deletion of progress Key What sequence carried out, therefore, for the efficiency of the operations such as the insertion or the deletion that improve Key, data-handling efficiency is further increased, Carry out the searching route that can recorde Key when the search of Key.
Correspondingly, in a kind of embodiment of the embodiment, when need to the 3rd Key with to the 3rd Key corresponding When three Value are read out, it can record according to the sequence of root node page in tree structure to leaf node page and obtain third The searching route of Key and Value corresponding with the 3rd Key;Wherein, which may include each layer life in search process In the number of page, the Key information and hit hit in page Key information corresponding life cycle.
In one example, an array can be increased in target MVBT data store organisation and (is properly termed as Stack (heap) structure), searching route when Key reading is carried out for recording.Each element of the array includes two domains:Page Number and Key information.In the access information of root node page, the 1st element representation in 0th element representation search process of array In the access information of second layer node page (if present), the 2nd element representation is believed in the access of third layer node page (if present) Breath, and so on, until leaf node page.The node in searching route can be recalled, by Stack structure in order to rear afterflow The operations such as Key insertion, deletion in journey.
It should be noted that can also include that the number of plies of node page in searching route (can be in above-mentioned searching route information As depth (depth)).For example, can increase a depth variable (can be denoted as Stack structure Stack.depth).Due to the access information of each one layer of memory page node of element representation in Stack structure, Stack.depth can also indicate the number of effective element in Stack.
For example, for the page of the tree structure shown in Fig. 6, it is assumed that the value for the Key for needing to search for is 5, version Number be 1, then the search first in the root node page (i.e. Page1), can use dichotomy in the associated sequence array of Page1 into The selection of row position offset, and the Key that the memory element in the page being directed toward according to the position offset includes carries out Key Compare, the value for the Key for including in the memory element finally hit is 4, and the value of the Key in the memory element and life cycle are remembered Stack.depth is added one in Stack.path [0] by record.At this point, Stack information is at this time:
Stack.depth=1;
Stack.path [0]=Page1, Key 4, [1,2) } }
The next layer of node page that the memory element that value it is possible to further the Key for including in Page1 is 4 is directed toward is (i.e. Page6 it is scanned in), can use dichotomy and carry out position offset selection, and root in the associated sequence array of Page6 The Key that the memory element in page being directed toward according to the position offset includes carries out the comparison of Key, the memory member finally hit The value of Key is 5 in element, by the value of the Key in the memory element and is recorded in life cycle in Stack.path [1], Stack.depth adds one.Since searching structure is matched with Key to be searched, search terminates, and returns the result accurately to match.
The information of Stack is at this time:
Stack.depth=2;
Stack.path [0]=Page1, Key 4, [1,2) } }
Stack.path [1]=Page6, Key 5, [1,2) } }.
It should be noted that reduce the complexity that search is realized in order to avoid there is search time too long situation, into When row Key is searched for, the maximum value (i.e. the maximum value of depth) of the number of plies of searched for node page can be preset, when being searched When the number of plies of the node page of rope is more than the maximum value, search failure is directly determined.
Through above description as can be seen that in technical solution provided in an embodiment of the present invention, by real to traditional MVBT Data store organisation in existing scheme is modified, and is that the page of each tree structure increases associated sequence array, the sequence Each array element in array can be based on the sequence for characterizing position offset of the memory element in page Array sequentially searches for the Key recorded in the memory element in the page of associated tree structure, improves at data Rationality energy.
Fig. 7 is referred to, provides a kind of structural schematic diagram of data processing equipment for the embodiment of the present invention, wherein the device It can be applied to the network equipment in above method embodiment, as shown in fig. 7, the data processing equipment may include:
Creating unit 710, for creating target multi version B+ tree MVBT data store organisation;Wherein, the target MVBT Data store organisation include tree structure page and respectively with the associated sequence array of each page, the page packet At least one memory element is included, key Key is recorded in each memory element, each array element in the sequence array is used for table Levy position offset of the memory element in the page;
Receiving unit 720, for receiving data processing request;
Processing unit 730, for based on the target MVBT data store organisation to the data processing request received into Row response.
In an alternative embodiment, the processing unit 730 is specifically used for when the data processing request being for first When the insertion request of Key, judge that root node page whether there is next layer of node page in the page of the tree structure;
If so, to the sequence of leaf node page, it is based on the sequence array according to from root node page, it is true using dichotomy The first object leaf node page of the fixed first Key insertion;Otherwise, the root node page is determined as first object leaf knot Point page;
In the first object leaf node page, it is inserted into the first memory element, records institute in the first memory element State the first Key.
In an alternative embodiment, the processing unit 730 is specifically used for judging in the first object leaf node page Whether the quantity for depositing element is greater than default first amount threshold;
The creating unit 710, if the quantity for being also used to memory element in the first object leaf node page is greater than institute Default first amount threshold is stated, then creates the first leaf node page;
The processing unit 730, also particularly useful for by the first memory element and the first object leaf node page In included the memory element of work Key be inserted into the first leaf node page, and will be in the first object leaf node Work Key be labeled as dead Key;
The creating unit 710 is also used to create and the associated sequence array of the first leaf node page.
In an alternative embodiment, the processing unit 730 is also used to judge to have wrapped in the first object leaf node page Whether the sum of the quantity of the memory element of the work Key contained and the quantity of the first memory element are greater than default first quantity Threshold value;
The creating unit 710, if the memory member for the work Key for being also used in the first object leaf node page include The sum of quantity and the quantity of the first memory element of element are greater than default first amount threshold, then create two the first leaves Child node page;
The processing unit 730, be also used to by the first memory element and the first object leaf node page The memory element for the work Key for including, which is divided equally, is inserted into each first leaf node page;
The creating unit 710, if the memory member for the work Key for being also used in the first object leaf node page include Quantity of element and the sum of quantity of the first memory element are less than or equal to default first amount threshold, then create one the One leaf node page;
The processing unit 730, be also used to by the first memory element and the first object leaf node page The memory element for the work Key for including is inserted into the first leaf node page.
In an alternative embodiment, the processing unit 730, is also used to whether the first object leaf node page is root knot Point page;
The processing unit 730, if being also used to the first object leaf node page is not root node page, described The father node page of one target leaves node page is inserted into the second memory element, records data pointer in the second memory element, institute It states data pointer and is directed toward the first leaf node page, and update and the associated sequence array of the father node page;
The creating unit 710, if being also used to the first object leaf node page is root node page, and first leaf The quantity of child node page is greater than 1, then creates another root node page;
The processing unit 730 is also used in another root node page of creation, is inserted into the second memory element, and described the Record data pointer in two memory elements, the data pointer is directed toward the first leaf node page, and create with it is described another The associated sequence array of root node page.
In an alternative embodiment, the processing unit 730 is also used to judge in memory element that the father node page includes With the presence or absence of the memory element for recording identical Key with the second memory element;
The creating unit 710, is also used to if it exists, then creates a same layer node with the father node page same layer Page;
The processing unit 730 is also used to the memory element and described for the work Key that will included in the father node page Two memory elements are inserted into the same layer node page;Work Key in the father node page is labeled as dead Key;
The creating unit 710 is also used to create and the associated sequence array of the same layer node page.
In an alternative embodiment, the processing unit 730 is also used to compare and remember in the corresponding memory element of the array element The Key of record and the 2nd Key, to determine the second target leaves node page;Wherein, it is wrapped in the second target leaves node page First object memory element is included, the Key of the first object memory element record is matched with the 2nd Key;
The processing unit 730 is also used to the target memory element note in the second target leaves node page The Key of record is labeled as dead Key.
In an alternative embodiment, the processing unit 730 is also used to when the second target leaves node page not be root knot When point page, it is default to judge whether the quantity of the memory element for the work Key for having included in the second target leaves node page is less than Second amount threshold;
The creating unit 710, if the memory member for the work Key for being also used in the second target leaves node page include The quantity of element is less than default second amount threshold, then creates the second leaf node page;
The processing unit 730 is also used to the second target leaves node page and the second target leaves node The memory element for the work Key for having included in the fraternal page of page is inserted into the second leaf node page, and by second target Work Key in leaf node page and the fraternal page is labeled as dead Key;
The creating unit 710 is also used to create the associated sequence array of the second leaf node page.
In an alternative embodiment, the processing unit 730 is also used to judge the second target leaves node page and described Whether the sum of quantity of memory element of work Key for having included in fraternal page is greater than default first amount threshold;
The creating unit 710 included if being also used in the second target leaves node page and the fraternal page The sum of the quantity of memory element of Key living is greater than default first amount threshold, then creates two the second leaf node pages;
The processing unit 730, be also used to will include in the second target leaves node page and the fraternal page The memory element of Key living, which is divided equally, is inserted into each second leaf node page;
The creating unit 710 included if being also used in the second target leaves node page and the fraternal page The sum of the quantity of memory element of Key living is less than or equal to default first amount threshold, then creates a second leaf node page;
The processing unit 730, be also used to will include in the second target leaves node page and the fraternal page The memory element of Key living is inserted into the second leaf node page.
In an alternative embodiment, the processing unit 730 is also used to the father node in the second target leaves node page Page is inserted into third memory element, and data pointer is recorded in the third memory element, and the data pointer is directed toward second leaf Child node page, and update and the associated sequence array of the father node page.
In an alternative embodiment, the processing unit 730 is also used to judge in memory element that the father node page includes With the presence or absence of the memory element for recording identical Key with the third memory element;
The creating unit 710, is also used to if it exists, then creates the same layer knot of one with the father node page same layer Point page;
The processing unit 730 is also used to the memory element of the work Key for having included in the father node page and described Third memory element is inserted into the same layer node page;Work Key in the father node page is labeled as dead Key;
The creating unit 710 is also used to create and the associated sequence array of the same layer node page.
In an alternative embodiment, the processing unit 730 is also used to when the data processing request be for the 3rd Key When with the read requests to corresponding 3rd Value of the 3rd Key, according to root node page in the tree structure to leaf knot The sequence of point page in the sequence array, selects array element using dichotomy;
The processing unit 730 is also used to compare the Key that records in the corresponding memory element of the array element and described the Three Key, to determine third target leaves node page;It wherein, include the second target memory in the third target leaves node page The Key of element, the second target memory element record is matched with the 3rd Key;
The processing unit 730 is also used to the second target memory for including from third target leaves node page member In element, the 3rd Key and the 3rd Value is read.
In an alternative embodiment, the processing unit 730 is also used to according to root node page in the tree structure to leaf The sequence of node page, record obtain the searching route of the 3rd Key and Value corresponding with the 3rd Key;
Wherein, described search path includes the number of the page of each layer hit in search process, hits in page The Key information of Key information and hit corresponding life cycle.
Fig. 8 is referred to, is a kind of hardware structural diagram of data processing equipment provided in an embodiment of the present invention.The data Processing unit may include processor 801, the machine readable storage medium 802 for being stored with machine-executable instruction.Processor 801 It can be communicated via system bus 803 with machine readable storage medium 802.Also, by reading and executing machine readable storage Jie Above-described data processing side can be performed in machine-executable instruction corresponding with data process method, processor 801 in matter 802 Method.
Machine readable storage medium 802 referred to herein can be any electronics, magnetism, optics or other physical stores Device may include or store information, such as executable instruction, data, etc..For example, machine readable storage medium can be: RAM (Radom Access Memory, random access memory), volatile memory, nonvolatile memory, flash memory, storage are driven Dynamic device (such as hard disk drive), solid state hard disk, any kind of storage dish (such as CD, dvd) or similar storage are situated between Matter or their combination.
The embodiment of the invention also provides a kind of machine readable storage mediums including machine-executable instruction, such as Fig. 8 In machine readable storage medium 802, the machine-executable instruction can by the processor 801 in data processing equipment execute with Realize data processing method described above.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual The purpose for needing to select some or all of the modules therein to realize the present invention program.Those of ordinary skill in the art are not paying Out in the case where creative work, it can understand and implement.
It as seen from the above-described embodiment, is each by modifying to the data store organisation in traditional MVBT implementation The page of tree structure increases associated sequence array, and each array element in the sequence array is for characterizing memory element Position offset in page, and then can be based on the sequence array to the memory in the page of associated tree structure The Key recorded in element is sequentially searched for, and data processing performance is improved.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.

Claims (16)

1. a kind of data processing method, which is characterized in that including:
Create target multi version B+ tree MVBT data store organisation;Wherein, the target MVBT data store organisation includes tree-like The page of structure and respectively with the associated sequence array of each page, the page includes at least one memory element, Key Key is recorded in each memory element, each array element in the sequence array is for characterizing the memory element in institute State the position offset in page;
The data processing request received is responded based on the target MVBT data store organisation.
2. the method according to claim 1, wherein it is described based on the MVBT data store organisation to receiving Data processing request responded, including:
When the data processing request is the insertion request for the first Key, root in the page of the tree structure is judged Node page whether there is next layer of node page;
If so, to the sequence of leaf node page, being based on the sequence array according to from root node page, determining institute using dichotomy State the first object leaf node page of the first Key insertion;Otherwise, the root node page is determined as first object leaf node Page;
In the first object leaf node page, it is inserted into the first memory element, described the is recorded in the first memory element One Key.
3. according to the method described in claim 2, it is characterized in that, described in the first object leaf node page, insertion First memory element, including:
Judge whether the quantity of memory element in the first object leaf node page is greater than default first amount threshold;
If the quantity of memory element is greater than default first amount threshold in the first object leaf node page, the is created One leaf node page;
The memory element for the work Key for having included in the first memory element and the first object leaf node page is inserted into The first leaf node page;
Work Key in the first object leaf node is labeled as dead Key;
Creation and the associated sequence array of the first leaf node page.
4. according to the method described in claim 3, it is characterized in that, described by the first memory element and the first object The memory element for the work Key for having included in leaf node page is inserted into the first leaf node page, including:
Judge the quantity and first memory member of the memory element for the work Key for having included in the first object leaf node page Whether the sum of quantity of element is greater than default first amount threshold;
If so, two the first leaf node pages of creation, and by the first memory element and the first object leaf node The memory element for the work Key for having included in page, which is divided equally, is inserted into each first leaf node page;
Otherwise, a first leaf node page is created, and by the first memory element and the first object leaf node page In included the memory element of work Key be inserted into the first leaf node page.
5. the method according to claim 3 or 4, which is characterized in that after the first leaf node page of the creation, also wrap It includes:
Judge whether the first object leaf node page is root node page;
If the first object leaf node page is not root node page, in the father node page of the first object leaf node page It is inserted into the second memory element, data pointer is recorded in the second memory element, the data pointer is directed toward first leaf Node page, and update and the associated sequence array of the father node page;
If the first object leaf node page is root node page, and the quantity of the first leaf node page is greater than 1, then creates Another root node page;In another root node page of creation, it is inserted into the second memory element, records number in the second memory element According to pointer, the data pointer is directed toward the first leaf node page, and creates and another associated sequence of root node page Array.
6. according to the method described in claim 5, it is characterized in that, the father node in the first object leaf node page After page the second memory element of insertion, further include:
Judge in memory element that the father node page includes with the presence or absence of being recorded in identical Key with the second memory element Deposit element;
If it exists, then a same layer node page with the father node page same layer is created, will include in the father node page The memory element and the second memory element of Key living is inserted into the same layer node page;
Work Key in the father node page is labeled as dead Key;
Creation and the associated sequence array of the same layer node page.
7. the method according to claim 1, wherein it is described based on the MVBT data store organisation to receiving Data processing request responded, including:
When the data processing request is the removal request for the 2nd Key, according to root node page in tree structure to leaf The sequence of node page in the sequence array, selects array element using dichotomy;
Compare the Key and the 2nd Key recorded in the corresponding memory element of the array element, to determine the second target leaves knot Point page;It wherein, include first object memory element in the second target leaves node page, the first object memory element note The Key of record is matched with the 2nd Key;
The Key of target memory element record in the second target leaves node page is labeled as dead Key.
8. the method according to the description of claim 7 is characterized in that described will be described in the second target leaves node page The Key of target memory element record is labeled as after dead Key, further includes:
When the second target leaves node page is not root node page, judge included in the second target leaves node page The quantity of memory element of work Key whether be less than default second amount threshold;
If so, the second leaf node page of creation, by the second target leaves node page and the second target leaves node The memory element for the work Key for having included in the fraternal page of page is inserted into the second leaf node page, and by second target Work Key in leaf node page and the fraternal page is labeled as dead Key;
Create the associated sequence array of the second leaf node page.
9. according to the method described in claim 8, it is characterized in that, the second leaf node page of the creation, by second mesh The memory element for the work Key for having included in the fraternal page of mark leaf node page and the second target leaves node page is inserted into institute The second leaf node page is stated, including:
Judge the sum of the quantity of the memory element for the work Key for having included in the second target leaves node page and the fraternal page Whether default first amount threshold is greater than;
If so, creation two the second leaf node pages, and will the second target leaves node page and it is described brother page in The memory element for the work Key for including, which is divided equally, is inserted into each second leaf node page;
Otherwise, a second leaf node page is created, and will have been wrapped in the second target leaves node page and the fraternal page The memory element of the work Key contained is inserted into the second leaf node page.
10. method according to claim 8 or claim 9, which is characterized in that after the second leaf node page of the creation, also wrap It includes:
It is inserted into third memory element in the father node page of the second target leaves node page, is recorded in the third memory element Data pointer, the data pointer is directed toward the second leaf node page, and updates and the associated sequence array of the father node page.
11. according to the method described in claim 10, it is characterized in that, the father in the second target leaves node page ties After point page insertion third memory element, further include:
Judge in memory element that the father node page includes with the presence or absence of being recorded in identical Key with the third memory element Deposit element;
If it exists, then one and a same layer node page of the father node page same layer are created, by the father node page The memory element for the work Key for including and the third memory element are inserted into the same layer node page;
Work Key in the father node page is labeled as dead Key;
Creation and the associated sequence array of the same layer node page.
12. the method according to claim 1, wherein described be based on the MVBT data store organisation to reception To data processing request responded, including:
When the data processing request is for the 3rd Key and the read requests to corresponding 3rd Value of the 3rd Key When, according to the sequence of root node page in the tree structure to leaf node page, using dichotomy, in the sequence array, Select array element;
Compare the Key and the 3rd Key recorded in the corresponding memory element of the array element, to determine third target leaves knot Point page;It wherein, include the second target memory element in the third target leaves node page, the second target memory element note The Key of record is matched with the 3rd Key;
From the second target memory element for including in the third target leaves node page, the 3rd Key and third are read Value。
13. according to the method for claim 12, which is characterized in that the method also includes:
According to the sequence of root node page in the tree structure to leaf node page, record obtain the 3rd Key and with institute State the searching route of the corresponding Value of the 3rd Key;
Wherein, described search path include the number of the page of each layer hit in search process, the Key letter that is hit in page The Key information corresponding life cycle of breath and hit.
14. a kind of data processing equipment, which is characterized in that including:
Creating unit, for creating target multi version B+ tree MVBT data store organisation;Wherein, the target MVBT data storage Structure include tree structure page and respectively with the associated sequence array of each page, the page include at least one A memory element records key Key in each memory element, and each array element in the sequence array is for characterizing in described Deposit position offset of the element in the page;
Receiving unit, for receiving data processing request;
Processing unit, for being responded based on the target MVBT data store organisation to the data processing request received.
15. device according to claim 14, which is characterized in that
The processing unit, specifically for when the data processing request is to request for the insertion of the first Key, described in judgement Root node page whether there is next layer of node page in the page of tree structure;
If so, to the sequence of leaf node page, being based on the sequence array according to from root node page, determining institute using dichotomy State the first object leaf node page of the first Key insertion;Otherwise, the root node page is determined as first object leaf node Page;
In the first object leaf node page, it is inserted into the first memory element, described the is recorded in the first memory element One Key.
16. device according to claim 15, which is characterized in that
The processing unit, specifically for judging it is pre- whether the quantity of memory element in the first object leaf node page is greater than If the first amount threshold;
The creating unit, if the quantity for being also used to memory element in the first object leaf node page is greater than described default the One amount threshold then creates the first leaf node page;
The processing unit, also particularly useful for will include in the first memory element and the first object leaf node page The memory element of work Key be inserted into the first leaf node page, and the work Key in the first object leaf node is marked Note is dead Key;
The creating unit is also used to create and the associated sequence array of the first leaf node page.
CN201810805648.4A 2018-07-20 2018-07-20 Data processing method and device Active CN108920708B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810805648.4A CN108920708B (en) 2018-07-20 2018-07-20 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810805648.4A CN108920708B (en) 2018-07-20 2018-07-20 Data processing method and device

Publications (2)

Publication Number Publication Date
CN108920708A true CN108920708A (en) 2018-11-30
CN108920708B CN108920708B (en) 2021-04-27

Family

ID=64415574

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810805648.4A Active CN108920708B (en) 2018-07-20 2018-07-20 Data processing method and device

Country Status (1)

Country Link
CN (1) CN108920708B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990377A (en) * 2019-11-21 2020-04-10 上海达梦数据库有限公司 Data loading method and device, server and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609490A (en) * 2012-01-20 2012-07-25 东华大学 Column-storage-oriented B+ tree index method for DWMS (data warehouse management system)
CN103116641A (en) * 2013-02-21 2013-05-22 新浪网技术(中国)有限公司 Acquisition method of ordering statistical data and ordering device
CN104252528A (en) * 2014-09-04 2014-12-31 国家电网公司 Big data secondary index establishing method based on identifier space mapping
CN105095197A (en) * 2014-04-16 2015-11-25 华为技术有限公司 Method and device for processing data
CN105930280A (en) * 2016-05-27 2016-09-07 诸葛晴凤 Efficient page organization and management method facing NVM (Non-Volatile Memory)
CN105988876A (en) * 2015-03-27 2016-10-05 杭州迪普科技有限公司 Memory allocation method and apparatus
CN106462592A (en) * 2014-03-28 2017-02-22 华为技术有限公司 Systems and methods to optimize multi-version support in indexes
CN106775435A (en) * 2015-11-24 2017-05-31 腾讯科技(深圳)有限公司 Data processing method, device and system in a kind of storage system
CN107038206A (en) * 2017-01-17 2017-08-11 阿里巴巴集团控股有限公司 The method for building up of LSM trees, the method for reading data and server of LSM trees
CN107612765A (en) * 2016-07-12 2018-01-19 华为技术有限公司 The method and device of data processing

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609490A (en) * 2012-01-20 2012-07-25 东华大学 Column-storage-oriented B+ tree index method for DWMS (data warehouse management system)
CN103116641A (en) * 2013-02-21 2013-05-22 新浪网技术(中国)有限公司 Acquisition method of ordering statistical data and ordering device
CN106462592A (en) * 2014-03-28 2017-02-22 华为技术有限公司 Systems and methods to optimize multi-version support in indexes
CN105095197A (en) * 2014-04-16 2015-11-25 华为技术有限公司 Method and device for processing data
CN104252528A (en) * 2014-09-04 2014-12-31 国家电网公司 Big data secondary index establishing method based on identifier space mapping
CN105988876A (en) * 2015-03-27 2016-10-05 杭州迪普科技有限公司 Memory allocation method and apparatus
CN106775435A (en) * 2015-11-24 2017-05-31 腾讯科技(深圳)有限公司 Data processing method, device and system in a kind of storage system
CN105930280A (en) * 2016-05-27 2016-09-07 诸葛晴凤 Efficient page organization and management method facing NVM (Non-Volatile Memory)
CN107612765A (en) * 2016-07-12 2018-01-19 华为技术有限公司 The method and device of data processing
CN107038206A (en) * 2017-01-17 2017-08-11 阿里巴巴集团控股有限公司 The method for building up of LSM trees, the method for reading data and server of LSM trees

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
骆娟: ""高并发读写性能的多版本B+树研究"", 《万方学位论文数据库》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990377A (en) * 2019-11-21 2020-04-10 上海达梦数据库有限公司 Data loading method and device, server and storage medium
CN110990377B (en) * 2019-11-21 2023-08-22 上海达梦数据库有限公司 Data loading method, device, server and storage medium

Also Published As

Publication number Publication date
CN108920708B (en) 2021-04-27

Similar Documents

Publication Publication Date Title
US20170063695A1 (en) Full flow retrieval optimized packet capture
US5487164A (en) Distribution-based replacement selection sorting system
US7523288B2 (en) Dynamic fragment mapping
US4945475A (en) Hierarchical file system to provide cataloging and retrieval of data
US5276874A (en) Method for creating a directory tree in main memory using an index file in secondary memory
US8335889B2 (en) Content addressable storage systems and methods employing searchable blocks
CN105637491B (en) A kind of file migration method, device and storage device
CN103581331B (en) The online moving method of virtual machine and system
CN103870588B (en) A kind of method and device used in data base
CN108280229B (en) Memory data read-write method and device
CN106294352B (en) A kind of document handling method, device and file system
CN111190904B (en) Method and device for hybrid storage of graph-relational database
CN110825794B (en) Partition merging method and database server
CN104021223B (en) The access method and device of a kind of Cluster Database measuring point
KR101744892B1 (en) System and method for data searching using time series tier indexing
CN107707600A (en) A kind of date storage method and device
CN105224532A (en) Data processing method and device
CN109325022A (en) A kind of data processing method and device
CN108920708A (en) A kind of data processing method and device
JPH02231675A (en) Information retrieving apparatus and method
GB2196764A (en) Hierarchical file system
JP3691018B2 (en) Longest match search circuit and method, program, and recording medium
JPH08129551A (en) Hash system
CN110096458A (en) Name data network content storage pool data retrieval method neural network based
CN106934033A (en) A kind of bent plate robot data indexing means and device

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