CN106156070A - A kind of querying method, Piece file mergence method and relevant apparatus - Google Patents

A kind of querying method, Piece file mergence method and relevant apparatus Download PDF

Info

Publication number
CN106156070A
CN106156070A CN201510148521.6A CN201510148521A CN106156070A CN 106156070 A CN106156070 A CN 106156070A CN 201510148521 A CN201510148521 A CN 201510148521A CN 106156070 A CN106156070 A CN 106156070A
Authority
CN
China
Prior art keywords
record
rowkey
file
target
new
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
CN201510148521.6A
Other languages
Chinese (zh)
Other versions
CN106156070B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201510148521.6A priority Critical patent/CN106156070B/en
Publication of CN106156070A publication Critical patent/CN106156070A/en
Application granted granted Critical
Publication of CN106156070B publication Critical patent/CN106156070B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the invention discloses a kind of data query method, for promoting the search efficiency of data base.The method comprise the steps that inquiry unit receives query statement;Determine the N bar target record that target RowKey is corresponding;According to by newly to old order, it is successively read the target record determined;If inquiry unit reads M article of target record, the flag bit of this target record is 1, then terminate being successively read the operation of the target record determined.The M bar target record read is merged into a Query Result record, and using Query Result record as Query Result;By Query Result record write into Databasce.Present invention also offers a kind of Piece file mergence method and relevant apparatus.

Description

A kind of querying method, Piece file mergence method and relevant apparatus
Technical field
The present invention relates to database field, particularly relate to a kind of querying method, Piece file mergence method to relevant Device.
Background technology
Growing along with internet data, the demand of management distributed data increases, therefore the most day by day A kind of efficient, quick, distributed data base of excellent performance is provided, there is important practical significance.
Log-structured merging tree (Log-Structured Merge-Tree, LSM-Tree) provides one The thought of data storage: the renewal of data record will be saved in internal memory, treat the more new data in internal memory Record remerges after reaching a certain size and writes disk into file.From LSM-Tree data base querying data Time, need the more new data records in the historgraphic data recording in reading disk and internal memory, and reading is tied As Query Result after fruit merging.
But in actual application, if having carried out repeatedly updating to certain data record, then disk will be protected There is the file of multiple more fresh information that have recorded this data record.So when inquiring about data, just need To access more file from disk, query time is longer, and search efficiency is relatively low.
Summary of the invention
Embodiments provide a kind of data query method, for promoting the search efficiency of data base.
Embodiment of the present invention first aspect provides a kind of querying method, it is adaptable to log-structured merging tree LSM-Tree data base, including:
Receiving query statement, described query statement includes target RowKey to be found;
Determine the N bar target record that described target RowKey is corresponding, wherein, described N bar target record Including the initial target record that described target RowKey is corresponding, and/or it is used for updating described initial target note The renewal target record of record, and/or the Query Result record that described target RowKey is corresponding, described in every Target record includes flag bit, and wherein, the flag of initial target record and Query Result record is 1, more The flag bit of fresh target record is 0;
According to by newly to old order, it is successively read the target record determined;
If the flag bit of the M article of target record read is 1, then it is successively read, described in termination, the mesh determined The operation of labelling record, wherein 1≤M≤N;
The M bar target record read is merged into a Query Result record, and by described Query Result Record is as Query Result.
Described Query Result record is write described data base.
In conjunction with the first aspect of the embodiment of the present invention, the first of the first aspect of the embodiment of the present invention realizes In mode, described the M bar target record read merged into a Query Result record include:
According to the M bar target record read, generating Query Result record, wherein said Query Result is remembered The RowKey of record is described target RowKey, and the flag bit of described Query Result record is 1.
In conjunction with first aspect or the first implementation of first aspect of the embodiment of the present invention, the present invention is real In the second implementation of the first aspect executing example, described target record also includes timestamp and/or version Number, described timestamp is for representing the generation time of described target record, and described version number is used for representing institute State the new and old of target record;
Described according to by newly to old order, it is successively read the target record determined and includes: according to described N The timestamp of bar target record and/or version number, according to by newly to old order, be successively read the mesh determined Labelling is recorded.
The second aspect of the embodiment of the present invention provides a kind of Piece file mergence method, it is adaptable to log-structured Merge tree LSM-Tree data base, including:
Determining P ancient deed to be combined, wherein, each described ancient deed includes one or more old note Record, every old record includes flag bit and for identifying the RowKey of described old record, wherein, described mark The value of will position includes 0 or 1, and wherein, P is the integer not less than 2;
Being a new file by described P Geju City Piece file mergence, wherein, described new file includes that Q bar is newly remembered Record, every new record includes flag bit and for identifying the RowKey of described new record, and described Q bar is new The union of the RowKey that Q RowKey is described P ancient deed of record;Wherein, if the R article In the old record corresponding for RowKey of new record, there is the old record that flag bit is 1, the most described R The flag bit of bar new record is 1, if the flag bit of old record corresponding to the RowKey of R article of new record All 0, the flag bit of the most described R article of new record is 0, wherein, Q >=1,1≤R≤Q.
In conjunction with the second aspect of the embodiment of the present invention, the first of the second aspect of the embodiment of the present invention realizes In mode, described is that a new file includes by described P Geju City Piece file mergence:
Determine the RowKey of R article of new record to be determined in described new file, wherein, 1≤R≤Q;
According to by newly determining successively in described P ancient deed to old order, described the R article new record The flag bit of the old record corresponding to RowKey;
If in the S the ancient deed read, the old note corresponding to the RowKey of described R article of new record The flag bit of record is 1, it is determined that in described new file, the flag bit of R article of new record is 1, and terminates institute State according to by newly determining successively in described P ancient deed to old order, described R article of new record The step of the flag bit of the old record corresponding to RowKey, wherein, 1≤S≤P;
If in described P the ancient deed read, old corresponding to the RowKey of described R article of new record The flag bit of record is 0, it is determined that in described new file, the flag bit of R article of new record is 0.
In conjunction with second aspect or the first implementation of second aspect of the embodiment of the present invention, the present invention is real In the second implementation of the second aspect executing example, described method also includes:
After P Geju City Piece file mergence is a new file, delete described P ancient deed.
The third aspect of the embodiment of the present invention provides a kind of inquiry unit, it is adaptable to log-structured merging Tree LSM-Tree data base, including:
Command reception module, is used for receiving query statement, and described query statement includes target to be found RowKey;
Record determines module, for determining the N bar target record that described target RowKey is corresponding, wherein, Described N bar target record includes the initial target record that described target RowKey is corresponding, and/or for more The renewal target record of new described initial target record, and/or the inquiry knot that described target RowKey is corresponding Really record, every described target record includes flag bit, wherein, initial target record and Query Result note The flag of record is 1, and the flag bit updating target record is 0;
Record read module, for according to by newly to old order, is successively read the target record determined;
If the flag bit of the M article of target record read is 1, the most described record read module terminates described It is successively read the operation of the target record determined, wherein 1≤M≤N;
Record merges module, for the M bar target record read is merged into a Query Result record, And using described Query Result record as Query Result.
Result writing module, for writing described data base by described Query Result record.
In conjunction with the third aspect of the embodiment of the present invention, the first of the third aspect of the embodiment of the present invention realizes In mode, described record merge module specifically for:
According to the M bar target record read, generate Query Result record, and described Query Result is remembered Record is as Query Result, and the RowKey of wherein said Query Result record is described target RowKey, institute The flag bit stating Query Result record is 1.
In conjunction with the third aspect or the first implementation of the third aspect of the embodiment of the present invention, the present invention is real In the second implementation of the third aspect executing example, described target record also includes timestamp and/or version Number, described timestamp is for representing the generation time of described target record, and described version number is used for representing institute State the new and old of target record;
Described record read module specifically for: according to timestamp and/or the version of described N bar target record Number, according to by newly to old order, it is successively read the target record determined.
The fourth aspect of the embodiment of the present invention provides a kind of Piece file mergence device, it is adaptable to log-structured Merge tree LSM-Tree data base, including:
File determines module, for determining P ancient deed to be combined, wherein, each described ancient deed Including one or more old record, every old record includes flag bit and for identifying described old record RowKey, wherein, the value of described flag bit includes 0 or 1, and wherein, P is the integer not less than 2;
File combination module, for being a new file by described P Geju City Piece file mergence, wherein, described New file includes that Q bar new record, every new record include flag bit and for identifying described new record RowKey, the RowKey's that Q RowKey is described P ancient deed of described Q bar new record Union;Wherein, if in old record corresponding to the RowKey of R article of new record, there is flag bit is 1 Old record, the flag bit of the most described R article of new record is 1, if the RowKey of R article of new record The flag bit all 0 of corresponding old record, the flag bit of the most described R article of new record is 0, wherein, Q >=1,1≤R≤Q.
In conjunction with the fourth aspect of the embodiment of the present invention, the first of the fourth aspect of the embodiment of the present invention realizes In mode, described file combination module specifically for:
Determine the RowKey of R article of new record to be determined in described new file, wherein, 1≤R≤Q;
According to by newly determining successively in described P ancient deed to old order, described the R article new record The flag bit of the old record corresponding to RowKey;
If in the S the ancient deed read, the old note corresponding to the RowKey of described R article of new record The flag bit of record is 1, it is determined that in described new file, the flag bit of R article of new record is 1, and terminates institute State according to by newly determining successively in described P ancient deed to old order, described R article of new record The step of the flag bit of the old record corresponding to RowKey, wherein, 1≤S≤P;
If in described P the ancient deed read, old corresponding to the RowKey of described R article of new record The flag bit of record is 0, it is determined that in described new file, the flag bit of R article of new record is 0.
In conjunction with fourth aspect or the first implementation of fourth aspect of the embodiment of the present invention, the present invention is real In the second implementation of the fourth aspect executing example, described device also includes:
File removing module, for after being a new file by P Geju City Piece file mergence, deletes described P Individual ancient deed.
In the embodiment of the present invention, inquiry unit receives query statement;Determine the N that target RowKey is corresponding Bar target record;According to by newly to old order, it is successively read the target record determined;If inquiry unit When reading M article of target record, the flag bit of this target record is 1, then terminate being successively read really The operation of fixed target record.The M bar target record read is merged into a Query Result record, And using Query Result record as Query Result;By Query Result record write into Databasce.Due to inquiry knot The flag bit of fruit record is 1, so when inquiry unit searches target RowKey again, it is only necessary to according to The production time order of the target record that target RowKey in data base is corresponding, is successively read up-to-date The Query Result record generated, generates the N bar target record of this Query Result record without being read. With prior art, inquiry unit needs all of target record reading target RowKey corresponding to compare, The querying method that the present embodiment provides can reduce the quantity of the file of reading, has saved query time sum According to the resource in storehouse, improve search efficiency.
Accompanying drawing explanation
Fig. 1 is one embodiment flow chart of querying method in the embodiment of the present invention;
Fig. 2 is one embodiment flow chart of Piece file mergence method in the embodiment of the present invention;
Fig. 3 is one example structure figure of inquiry unit in the embodiment of the present invention;
Fig. 4 is one example structure figure of Piece file mergence device in the embodiment of the present invention;
Fig. 5 is inquiry unit or one example structure figure of Piece file mergence device in the embodiment of the present invention.
Detailed description of the invention
Embodiments provide a kind of querying method, for promoting the performance of LSM-Tree data base. The embodiment of the present invention additionally provides relevant Piece file mergence method and relevant apparatus, will carry out respectively below Describe.
In the technology of present stage, data base based on LSM-Tree structure (hereinafter referred to as LSM-Tree number According to storehouse) in file structure refer to table 1 (a).Wherein, table 1 (a) is only LSM-Tree data base The logical structure of middle file, its bottom document can be other form, does not limits.
Table 1 (a)
An every record in row respective file File A in table 1 (a), as shown in table 1 (a), every Record includes major key (RowKey) and key assignments (Value).RowKey is for uniquely marking in File A Knowing this record, Value is for recording concrete numerical value.Every record can also include other guide, as Timestamp, version number, data type etc., do not limit.
File structure in LSM-Tree data base has been made trickle amendment by the embodiment of the present invention, specifically , with the addition of a flag bit (Flag) for every data, the value of flag bit can be 0 or 1.This In inventive embodiments, the file structure in LSM-Tree data base refers to table 1 (b).Wherein, table 1 (b) Being only in the embodiment of the present invention logical structure of file in LSM-Tree data base, its bottom document can be Other form, does not limits.
Table 1 (b)
An every record in row respective file File A in table 1 (b), as shown in table 1 (b), every Record includes RowKey, flag bit and Value.RowKey identifies this for unique in File A Record, flag bit has 0,1 two kind of value, and Value is for recording concrete numerical value.Every record is also Other guide can be included, such as timestamp, version number or data type etc., do not limit.
Wherein, the assignment of flag bit can follow following rule: as a example by RowKey 1, when at the beginning of data base When beginning generates the original records that RowKey value is RowKey 1, the flag bit value of this original records is 1;If this original records is done by the more new record hereafter generating RowKey 1 update, then RowKey 1 The flag bit of more new record be 0;When inquiring about the record of RowKey 1 correspondence from data base, data If a plurality of record of RowKey 1 correspondence is merged by storehouse meeting, obtain Query Result record, wherein inquire about The flag bit of result record is 1.
The embodiment of the present invention is based on the file structure shown in table 1 (b), and the assignment rule of above-mentioned flag bit Rule, it is proposed that a kind of querying method, is used for inquiring about target RowKey.Its basic procedure refers to Fig. 1, Including:
101, query statement is received;
LSM-Tree data base includes inquiry unit, is used for inquiring about data.In the present embodiment, inquiry unit Receive query statement.Wherein, query statement includes target RowKey to be found;
102, the N bar target record that target RowKey is corresponding is determined.
Inquiry unit determines the N bar target record that target RowKey is corresponding, and by this N bar target record According to by being newly ranked up to old order.Wherein, this N bar target record includes target RowKey pair The initial target record answered and/or for updating the renewal target record of this initial target record, and/or should The Query Result record that target RowKey is corresponding.Wherein, this N bar target record can be in internal memory Target record, it is also possible to for the target record in disk file, do not limit in the present embodiment.
103, according to by newly to old order, it is successively read the target record determined;
This N bar target record according to by newly to old order, is successively read the target determined by inquiry unit Record.
Particularly, this step is not required for inquiry unit and reads whole N bar target records.If inquiry dress Putting when reading M article of target record, the flag bit of this target record is 1, then terminate being successively read The operation of the target record determined.It should be understood that 1≤M≤N.From the point of view of theoretically, M entry Labelling record can be any one flag bit be the target record of 1, but in order to save the reading resource of data base, Simplify the operation of inquiry unit, it is preferred that the M article target record can be that inquiry unit reads Article 1, flag bit is the target record of 1.
104, the M bar target record read is merged into a Query Result record, and by Query Result Record is as Query Result.
The M bar target record read is merged into an inquiry corresponding to target RowKey by inquiry unit Result record, and using this Query Result record as Query Result corresponding to query statement.
It should be understood that the RowKey of Query Result record should be target RowKey, Query Result record The value of flag bit be 1.
105, by Query Result record write into Databasce.
The Query Result record write into Databasce of target RowKey that inquiry unit will obtain.Wherein, look into Asking device both can be by the internal memory of Query Result record write into Databasce, it is also possible to write by Query Result record Enter the disk of data base, the present embodiment does not limits.
It is worthy of note, the flag bit of the Query Result record owing to being newly generated in step 105 is 1, So when inquiry unit performs step 101 again to 105 lookup target RowKey, it is only necessary to according to The production time order of the target record corresponding for RowKey in data base, is successively read this up-to-date The Query Result record generated, generates the N bar target record of this Query Result record without being read.
In the present embodiment, inquiry unit receives query statement;Determine the N entry that target RowKey is corresponding Labelling is recorded;According to by newly to old order, it is successively read the target record determined;If inquiry unit reads During to M article of target record, the flag bit of this target record is 1, then terminate being successively read determining The operation of target record;The M bar target record read is merged into a Query Result record, and will Query Result record is as Query Result;By Query Result record write into Databasce.Owing to Query Result is remembered The flag bit of record is 1, so when inquiry unit searches target RowKey again, it is only necessary to according to data The production time order of the target record that target RowKey in storehouse is corresponding, is successively read and is newly generated Query Result record, generate the N bar target record of this Query Result record without being read.With In prior art, inquiry unit needs all of target record reading target RowKey corresponding to compare, The querying method that the present embodiment provides can reduce the quantity of the file of reading, has saved query time sum According to the resource in storehouse, improve search efficiency.
Wherein, every record in LSM-Tree data base can include timestamp, and timestamp is used for representing The generation time of this record.In step 103, inquiry unit can according to this N bar target record time Between stab, by N bar target record according to by being newly successively read the target record determined to old order.Step In rapid 104, Query Result record can also include timestamp, and this timestamp is used for representing this Query Result The generation time of record.It should be understood that the time of the timestamp of this Query Result record should be later than N bar The time of the timestamp of target record.
Wherein, every record in LSM-Tree data base can include version number, and version number is used for representing Version new and old of this record.In step 103, inquiry unit can be according to this N bar target record Version number, according to by being newly successively read the target record determined to old order.In step 104, look into Asking result record and can also include version number, this version number is for representing the new and old of this Query Result record. It should be understood that the version number of this Query Result record should be newly in the version number of this N bar target record.
There is record corresponding for identical RowKey be likely to be present in multiple different file.Along with file Be on the increase, be required for from multiple files reading record during inquiry RowKey every time and merge. The time that data base runs is the most long, and the file in data base is the most, and the efficiency causing inquiry is the lowest. Multiple ancient deeds are usually merged into a new file by the technology of present stage, then deletes the plurality of old literary composition Part, has reached to reduce file number, has improved the purpose of search efficiency.Due to the file structure in the application Add a flag bit on the basis of existing technology, therefore when Piece file mergence, it is thus necessary to determine that merge After file in, every record flag bit.
Therefore, the embodiment of the present invention additionally provides a kind of Piece file mergence method, is used for explaining in detail based on table 1 How the file of the file structure shown in (b) determines flag bit when merging.Its basic procedure refers to figure 2, including:
201, determining P ancient deed to be combined, wherein, each ancient deed includes one or more old note Record, every old record includes flag bit and for identifying the RowKey of this old record, wherein, flag bit Value include 0 or 1, wherein, P is the integer not less than 2.Wherein, this P ancient deed can position In the disk of data base.
202, it is a new file by this P Geju City Piece file mergence.Wherein, this new file includes that Q bar is newly remembered Record, every new record includes flag bit and for identifying the RowKey of this new record, Q bar new record Q RowKey is the union of the RowKey of this P ancient deed;Wherein, if R article of new record In the old record that RowKey is corresponding, there is the old record that flag bit is 1, the then mark of R article of new record Will position is 1, if the flag bit all 0 of old record corresponding to the RowKey of R article of new record, then The flag bit of R bar new record is 0.Wherein, Q >=1,1≤R≤Q.Wherein, this new file can position In the disk of data base.
The present embodiment provides a kind of Piece file mergence method based on the file structure shown in table 1 (b), it is possible to When Piece file mergence, determine the flag bit of every new record in the new file after merging.Wherein, if R In the old record corresponding for RowKey of bar new record, there is the old record that flag bit is 1, then the R article The flag bit of new record is 1, if the flag bit of old record corresponding to the RowKey of R article of new record is complete Portion is 0, then the flag bit of R article of new record is 0.Thus determine every new record in new file Flag bit so that the structure of new file also meets the file structure shown in table 1 (b), it is ensured that data base The uniformity of file structure.
Preferably, in step 202, Piece file mergence device specifically can be in the following way by this P Geju City Piece file mergence is a new file: first determine R article of new record to be determined in new file RowKey, wherein, 1≤R≤Q;Then according to file is by newly to old order, determine successively at this P In individual ancient deed, the flag bit of the old record corresponding to the RowKey of R article of new record;If reading In the S ancient deed, the flag bit of the old record corresponding to the RowKey of R article of new record is 1, Then determine that in new file, the flag bit of R article of new record is 1, and terminate according to file by newly to old suitable Sequence determines the mark of the old record in P ancient deed corresponding to the RowKey of R article of new record successively The step of position, wherein, 1≤S≤P;If in P the ancient deed read, the RowKey of R article of new record The flag bit all 0 of corresponding old record, it is determined that the flag bit of R article of new record in new file It is 0.When after all integers that R takes successively in 1 to Q, it is possible to determine every new note in new file The flag bit of record.By such method so that Piece file mergence device is at the mark determining R article of new record During will position, it is only necessary to read in the old record corresponding to the RowKey of R article of new record, the 1st article Flag bit is 1 old records, it is not necessary to reads whole P file, decreases the file number of reading, Shorten the Piece file mergence time.
Preferably, after P Geju City Piece file mergence is a new file in the present embodiment, it is also possible to delete Except this P ancient deed, to reduce the file number of data base.
For the ease of understanding above-described embodiment, it is described as a example by the application scenarios concrete by below.
The inquiry unit of LSM-Tree data base receives query statement, and this query statement includes to be found Target RowKey is RowKey 20.
Inquiry unit determines in LSM-Tree data base, all target records of RowKey 20 correspondence.Its In, inquiry unit has obtained the original records of RowKey 20 in file File 1, file File 2, File 3, File 4 have obtained 3 more new records of RowKey 20.Inquiry unit is by these 4 records Be ranked up according to the generation time, the initial time of the more new record of File 4 the latest, File 2, File 3 times It, the generation time of the original records of File 1 is the earliest.Wherein, in File 1 RowKey 20 correspondence Flag bit is 1, in File 2, File 3, File 4 RowKey 20 correspondence flag bit be 0.
Inquiry unit is successively read the target record of RowKey 20 correspondence, until the target record read Flag bit be 1 till.Due to the target record of RowKey 20 correspondence in File 2, File 3, File 4 Flag bit be 0, RowKey during therefore inquiry unit is successively read File 4, File 3, File 2, File 1 The target record of 20 correspondences.
Inquiry unit is by the target record of RowKey 20 correspondence in File 4, File 3, File 2, File 1 Merge into a Query Result record, and using this Query Result record as Query Result.Wherein, should The RowKey of bar Query Result record is RowKey 20, and flag bit is 1.
Inquiry unit is by the file File 5 of this Query Result record write into Databasce.
Hereafter, data base generates again the more new record of two records for updating RowKey 20 correspondence, It is saved in respectively in file File 6, File 7.Wherein, the flag bit of these two more new records is 0.
When inquiry unit receives query statement lookup RowKey 20 again, inquiry unit determines All target records of RowKey 20 correspondence.Concrete, file File 1 has obtained RowKey 20 Original records, in file File 2, File 3, File 4, File 6, File 7, obtained RowKey 20 5 more new records, file File 5 has obtained the Query Result record of RowKey 20.Inquiry These 7 records are ranked up by device according to the generation time, sort order is File 7, File 6, File 5, File 4、File 3、File 2、File 1。
Inquiry unit is successively read the target record of RowKey 20 correspondence, until the target record read Flag bit be 1 till.Due to the mark of the target record of RowKey 20 correspondence in File 7, File 6 Position is 0, and in File 5, the flag bit of the target record of RowKey 20 correspondence is 1, and therefore inquiry unit depends on The target record of RowKey 20 correspondence in secondary reading File 7, File 6, File 5.
The target record of RowKey 20 correspondence in File 7, File 6, File 5 is merged into one by inquiry unit The Query Result record that bar is new, wherein, the RowKey of this new Query Result record is RowKey 20, Flag bit is 1.
Inquiry unit is by the file File 8 of this new Query Result record write into Databasce.
The Piece file mergence device of LSM-Tree data base determines to be combined three file File 9, File 10 With File 11, refer to table 2 (a), table 2 (b) and table 2 (c).Wherein, File 9 includes 3 Record, its RowKey is respectively RowKey 1, RowKey 2 and RowKey 3;File 10 includes Article 3, record, its RowKey is respectively RowKey 2, RowKey 3 and RowKey 4;In File 11 Including 3 records, its RowKey is respectively RowKey 3, RowKey 4 and RowKey 5.Wherein File File11 is up-to-date, and File 9 is the oldest.
File 9, File 10 and File 11 are merged into File 12 by Piece file mergence device.Wherein, File 12 RowKey be File 9, the union of the RowKey of File 10 and File 11: RowKey 1, RowKey 2, RowKey 3, RowKey 4 and RowKey5.Wherein, owing to RowKey 1 is File 11 He Not existing in File 10, the flag bit in File 9 is 0, therefore in File 12, flag bit is 0; RowKey 2 does not exists in File 11, and the flag bit in File 10 is 0, flag bit in File 9 Being 1, therefore in File 12, flag bit is 1;RowKey 3 is in File 11, File 10, File 9 Flag bit all 0, therefore in File 12, flag bit is 0;The RowKey 4 mark in File 11 Position is 1, record corresponding for RowKey 4 during therefore Piece file mergence device no longer reads File 10 and File 9, Directly determine that RowKey 4 flag bit in File 12 is 1;The RowKey 5 flag bit in File 11 It is 1, record corresponding for RowKey 5 during therefore Piece file mergence device no longer reads File 10 and File 9, Directly determine that RowKey 5 flag bit in File 12 is 1.The file File 12 obtained after merging please join Read table 2 (d).Wherein, the Value of each bar record in File 12 is the Value value after merging.
Table 2 (a)
Table 2 (b)
Table 2 (c)
Table 2 (d)
The embodiment of the present invention additionally provides relevant inquiry unit, for realizing the querying method shown in Fig. 1. Its basic structure refers to Fig. 3, including:
Command reception module 301, is used for receiving query statement, and query statement includes target to be found RowKey;
Record determines module 302, for determining the N bar target record that target RowKey is corresponding, wherein, This N bar target record includes the initial target record that target RowKey is corresponding, and/or is used for updating initially The renewal target record of target record, and/or the Query Result record that target RowKey is corresponding, every entry Labelling record includes flag bit, and wherein, the flag of initial target record and Query Result record is 1, updates The flag bit of target record is 0;
Record read module 303, for according to by newly to old order, is successively read the target record determined;
If the flag bit of the M article of target record read is 1, then record read module 303 terminates successively Read the operation of the target record determined, wherein 1≤M≤N;
Record merges module 304, for the M bar target record read is merged into a Query Result Record, and using this Query Result record as Query Result.
Result writing module 305, for writing described data base by Query Result record.
In the present embodiment, command reception module 301 receives query statement;Record determines that module 302 determines The N bar target record that target RowKey is corresponding;Record read module 303 according to by newly to old order, It is successively read the target record determined;If inquiry unit reads M article of target record, this target The flag bit of record is 1, then terminate being successively read the operation of the target record determined.Record merges module The M bar target record read is merged into a Query Result record by 304, and by Query Result record As Query Result;Result writing module 305 is by Query Result record write into Databasce.Due to inquiry knot The flag bit of fruit record is 1, so when inquiry unit searches target RowKey again, it is only necessary to according to The production time order of the target record that target RowKey in data base is corresponding, is successively read up-to-date The Query Result record generated, generates the N bar target record of this Query Result record without being read. With prior art, inquiry unit needs all of target record reading target RowKey corresponding to compare, The querying method that the present embodiment provides can reduce the quantity of the file of reading, has saved query time sum According to the resource in storehouse, improve search efficiency.
Preferably, as another embodiment of the present invention, record merge module 304 specifically for:
According to the M bar target record read, generate Query Result record, and Query Result record is made For Query Result, wherein the RowKey of Query Result record is target RowKey, Query Result record Flag bit is 1.
Preferably, as another embodiment of the present invention, every target record also includes timestamp, should Timestamp is for representing the generation time of described target record.Record read module 303 is specifically for root According to the timestamp of described N bar target record, according to by newly to old order, it is successively read the target determined Record.
Preferably, as another embodiment of the present invention, every record can include version number, version Number for representing the new and old of this version recorded.Record read module 303 can be according to this N bar target The version number of record, according to by being newly successively read the target record determined to old order.Query Result Record can also include version number, and this version number is for representing the new and old of this Query Result record.Can manage Solving, the version number of this Query Result record should be newly in the version number of this N bar target record.
The embodiment of the present invention additionally provides relevant Piece file mergence device, for realizing the file shown in Fig. 2 Merging method.Its basic structure refers to Fig. 4, including:
File determines module 401, for determining P ancient deed to be combined, wherein, each described old literary composition Part includes that one or more old record, every old record include flag bit and for identifying described old record RowKey, wherein, the value of described flag bit includes 0 or 1, and wherein, P is the integer not less than 2;
File combination module 402, being used for described P Geju City Piece file mergence is a new file, wherein, institute State new file and include that Q bar new record, every new record include flag bit and for identifying described new record RowKey, the RowKey's that Q RowKey is described P ancient deed of described Q bar new record Union;Wherein, if in old record corresponding to the RowKey of R article of new record, there is flag bit is 1 Old record, the flag bit of the most described R article of new record is 1, if the RowKey of R article of new record The flag bit all 0 of corresponding old record, the flag bit of the most described R article of new record is 0, wherein, Q >=1,1≤R≤Q.
The present embodiment provides a kind of Piece file mergence device based on the file structure shown in table 1 (b), it is possible to When Piece file mergence, determine the flag bit of every new record in the new file after merging.Wherein, if R In the old record corresponding for RowKey of bar new record, there is the old record that flag bit is 1, then the R article The flag bit of new record is 1, if the flag bit of old record corresponding to the RowKey of R article of new record is complete Portion is 0, then the flag bit of R article of new record is 0.Thus determine every new record in new file Flag bit so that the structure of new file also meets the file structure shown in table 1 (b), it is ensured that data base The uniformity of file structure.
Preferably, as another embodiment of the present invention, file combination module 402 specifically can pass through This P Geju City Piece file mergence is a new file by following manner: first determine R to be determined in new file The RowKey of bar new record, wherein, 1≤R≤Q;Then according to file is by newly to old order, successively Determine in this P ancient deed, the flag bit of the old record corresponding to the RowKey of R article of new record; If in the S the ancient deed read, the mark of the old record corresponding to the RowKey of R article of new record Position is 1, it is determined that in new file, the flag bit of R article of new record is 1, and terminate according to file by newly to Old order determines the old record in P ancient deed corresponding to the RowKey of R article of new record successively The step of flag bit, wherein, 1≤S≤P;If in P the ancient deed read, R article of new record The flag bit all 0 of the old record corresponding to RowKey, it is determined that the R article new record in new file Flag bit be 0.When after all integers that R takes successively in 1 to Q, it is possible to determine in new file The flag bit of every new record.By such method so that file combination module 402 is determining R During the flag bit of bar new record, it is only necessary to read the old note corresponding to the RowKey of R article of new record In record, the 1st article of flag bit is 1 old record, it is not necessary to reads whole P file, decreases reading The file number taken, shortens the Piece file mergence time.
Preferably, as another embodiment of the present invention, Piece file mergence device can also include that file is deleted Except module 403, for after P Geju City Piece file mergence is a new file, delete this P ancient deed. It should be understood that file removing module 403 is optional module.
For the ease of understanding above-described embodiment, it is described as a example by the application scenarios concrete by below.
The command reception module 301 of the inquiry unit of LSM-Tree data base receives query statement, this inquiry Instruction includes that target RowKey to be found is RowKey 20.
Record determines that module 302 determines in LSM-Tree data base, all targets of RowKey 20 correspondence Record.Wherein, record determines that module 302 has obtained the initial note of RowKey 20 in file File 1 Record, has obtained 3 more new records of RowKey 20 in file File 2, File 3, File 4.Record Determine that these 4 records are ranked up by module 302 according to the generation time, the more new record of File 4 initial Time, File 2, File 3 took second place the latest, and the generation time of the original records of File 1 is the earliest.Wherein, File In 1 RowKey 20 correspondence flag bit be 1, in File 2, File 3, File 4, RowKey 20 is right Answer flag bit be 0.
Record read module 303 is successively read the target record of RowKey 20 correspondence, until read Till the flag bit of target record is 1.Due to RowKey 20 correspondence in File 2, File 3, File 4 The flag bit of target record is 0, therefore record read module 303 be successively read File 4, File 3, File 2, The target record of RowKey 20 correspondence in File 1.
Record merges module 304 by RowKey 20 correspondence in File 4, File 3, File 2, File 1 Target record merges into a Query Result record, and using this Query Result record as Query Result. Wherein, the RowKey of this Query Result record is RowKey 20, and flag bit is 1.
Result writing module 305 is by the file File 5 of this Query Result record write into Databasce.
Hereafter, data base generates again the more new record of two records for updating RowKey 20 correspondence, It is saved in respectively in file File 6, File 7.Wherein, the flag bit of these two more new records is 0.
When command reception module 301 receives query statement lookup RowKey 20 again, record determines Module 302 determines all target records of RowKey 20 correspondence.Concrete, in file File 1 Arrive the original records of RowKey 20, in file File 2, File 3, File 4, File 6, File 7 Obtain 5 more new records of RowKey 20, file File 5 has obtained looking into of RowKey 20 Ask result record.Record determines that these 7 records are ranked up by module 302 according to the generation time, sequence Order is File 7, File 6, File 5, File 4, File 3, File 2, File 1.
Record read module 303 is successively read the target record of RowKey 20 correspondence, until read Till the flag bit of target record is 1.Due to the target note of RowKey 20 correspondence in File 7, File 6 The flag bit of record is 0, and in File 5, the flag bit of the target record of RowKey 20 correspondence is 1, therefore remembers Record read module 303 is successively read the target record of RowKey 20 correspondence in File 7, File 6, File 5.
Record merges module 304 by the target record of RowKey 20 correspondence in File 7, File 6, File 5 Merging into a new Query Result record, wherein, the RowKey of this new Query Result record is RowKey 20, flag bit is 1.
Result writing module 305 is by the file File 8 of this new Query Result record write into Databasce.
The file of the Piece file mergence device of LSM-Tree data base determines that module 401 determines to be combined three File File 9, File 10 and File 11, refer to table 2 (a), table 2 (b) and table 2 (c).Wherein, File 9 includes 3 records, and its RowKey is respectively RowKey 1, RowKey 2 and RowKey 3;File 10 includes 3 records, and its RowKey is respectively RowKey 2, RowKey 3 and RowKey 4;File 11 includes 3 records, and its RowKey is respectively RowKey 3, RowKey 4 and RowKey 5.Wherein file File11 is up-to-date, and File 9 is the oldest.
File 9, File 10 and File 11 are merged into File 12 by file combination module 402.Wherein, File The RowKey of 12 is File 9, the union of the RowKey of File 10 and File 11: RowKey 1, RowKey 2, RowKey 3, RowKey 4 and RowKey5.Wherein, owing to RowKey 1 is at File Not existing in 11 and File 10, the flag bit in File 9 is 0, therefore in File 12, flag bit is 0;RowKey 2 does not exists in File 11, and the flag bit in File 10 is 0, gets the bid at File 9 Will position is 1, and therefore in File 12, flag bit is 1;RowKey 3 is at File 11, File 10, File 9 In flag bit all 0, therefore in File 12, flag bit is 0;RowKey 4 is in File 11 Flag bit is 1, and therefore no longer to read RowKey 4 in File 10 and File 9 right for file combination module 402 The record answered, directly determines that RowKey 4 flag bit in File 12 is 1;RowKey 5 is at File 11 In flag bit be 1, RowKey during therefore file combination module 402 no longer reads File 10 and File 9 The record of 5 correspondences, directly determines that RowKey 5 flag bit in File 12 is 1.The literary composition obtained after merging Part File 12 refers to table 2 (d).Wherein, after the Value of each bar record in File 12 is merging Value value.
From the angle of blocking functional entity, the inquiry unit the embodiment of the present invention is retouched above State, from the angle of hardware handles, the inquiry unit the embodiment of the present invention is described below, refers to Fig. 5, another embodiment of inquiry unit 500 in the embodiment of the present invention includes:
Input equipment 501, output device 502, processor 503 and memorizer 504 (wherein inquiry unit The quantity of the processor 503 in 500 can be one or more, in Fig. 5 as a example by a processor 503). In some embodiments of the invention, input equipment 501, output device 502, processor 503 and storage Device 504 can be connected, wherein, in Fig. 5 as a example by being connected by bus by bus or alternate manner.
Wherein, by calling the operational order of memorizer 504 storage, processor 503 is used for performing as follows Step:
Receiving query statement, described query statement includes target RowKey to be found;
Determine the N bar target record that described target RowKey is corresponding, wherein, described N bar target record Including the initial target record that described target RowKey is corresponding, and/or it is used for updating described initial target note The renewal target record of record, and/or the Query Result record that described target RowKey is corresponding, described in every Target record includes flag bit, and wherein, the flag of initial target record and Query Result record is 1, more The flag bit of fresh target record is 0;
According to by newly to old order, it is successively read the target record determined;
If the flag bit of the M article of target record read is 1, then it is successively read, described in termination, the mesh determined The operation of labelling record, wherein 1≤M≤N;
The M bar target record read is merged into a Query Result record, and by described Query Result Record is as Query Result.
Described Query Result record is write described data base.
In some embodiments of the present invention, processor 503 also executes the following steps:
According to the M bar target record read, generating Query Result record, wherein said Query Result is remembered The RowKey of record is described target RowKey, and the flag bit of described Query Result record is 1.
Target record described in some embodiments of the present invention also includes timestamp and/or version number, time described Between stamp for representing generation time of described target record, described version number is used for representing described target record New and old, processor 503 also executes the following steps:
Timestamp according to described N bar target record and/or version number, by described N bar target record according to The generation time is by being newly ranked up to old order.
From the angle of blocking functional entity, the Piece file mergence device the embodiment of the present invention is carried out above Describe, from the angle of hardware handles, the Piece file mergence device the embodiment of the present invention be described below, Please referring still to Fig. 5, another embodiment of Piece file mergence device 500 in the embodiment of the present invention includes:
Input equipment 501, output device 502, processor 503 and memorizer 504 (wherein Piece file mergence The quantity of the processor 503 in device 500 can be one or more, with a processor 503 in Fig. 5 As a example by).In some embodiments of the invention, input equipment 501, output device 502, processor 503 Can be connected, wherein, to be connected as by bus in Fig. 5 by bus or alternate manner with memorizer 504 Example.
Wherein, by calling the operational order of memorizer 504 storage, processor 503 is used for performing as follows Step:
Determining P ancient deed to be combined, wherein, each described ancient deed includes one or more old note Record, every old record includes flag bit and for identifying the RowKey of described old record, wherein, described mark The value of will position includes 0 or 1, and wherein, P is the integer not less than 2;
Being a new file by described P Geju City Piece file mergence, wherein, described new file includes that Q bar is newly remembered Record, every new record includes flag bit and for identifying the RowKey of described new record, and described Q bar is new The union of the RowKey that Q RowKey is described P ancient deed of record;Wherein, if the R article In the old record corresponding for RowKey of new record, there is the old record that flag bit is 1, the most described R The flag bit of bar new record is 1, if the flag bit of old record corresponding to the RowKey of R article of new record All 0, the flag bit of the most described R article of new record is 0, wherein, Q >=1,1≤R≤Q.
In some embodiments of the present invention, processor 503 also executes the following steps:
Determine the RowKey of R article of new record to be determined in described new file, wherein, 1≤R≤Q;
According to by newly determining successively in described P ancient deed to old order, described the R article new record The flag bit of the old record corresponding to RowKey;
If in the S the ancient deed read, the old note corresponding to the RowKey of described R article of new record The flag bit of record is 1, it is determined that in described new file, the flag bit of R article of new record is 1, and terminates institute State according to by newly determining successively in described P ancient deed to old order, described R article of new record The step of the flag bit of the old record corresponding to RowKey, wherein, 1≤S≤P;
If in described P the ancient deed read, old corresponding to the RowKey of described R article of new record The flag bit of record is 0, it is determined that in described new file, the flag bit of R article of new record is 0.
In some embodiments of the present invention, processor 503 also executes the following steps:
After P Geju City Piece file mergence is a new file, delete described P ancient deed.
Those skilled in the art is it can be understood that arrive, and for convenience and simplicity of description, above-mentioned retouches The specific works process of the system stated, device and unit, is referred to the correspondence in preceding method embodiment Process, does not repeats them here.
In several embodiments provided herein, it should be understood that disclosed system, device and Method, can realize by another way.Such as, device embodiment described above is only shown Meaning property, such as, the division of described unit, be only a kind of logic function and divide, actual can when realizing There to be other dividing mode, the most multiple unit or assembly can in conjunction with or be desirably integrated into another System, or some features can ignore, or do not perform.Another point, shown or discussed each other Coupling direct-coupling or communication connection can be the INDIRECT COUPLING by some interfaces, device or unit Or communication connection, can be electrical, machinery or other form.
The described unit illustrated as separating component can be or may not be physically separate, makees The parts shown for unit can be or may not be physical location, i.e. may be located at a place, Or can also be distributed on multiple NE.Can select according to the actual needs part therein or The whole unit of person realizes the purpose of the present embodiment scheme.
It addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, Can also be that unit is individually physically present, it is also possible to two or more unit are integrated in a list In unit.Above-mentioned integrated unit both can realize to use the form of hardware, it would however also be possible to employ software function list The form of unit realizes.
If described integrated unit realizes and as independent production marketing using the form of SFU software functional unit Or when using, can be stored in a computer read/write memory medium.Based on such understanding, this The part that the most in other words prior art contributed of technical scheme of invention or this technical scheme Completely or partially can embody with the form of software product, this computer software product is stored in one In storage medium, including some instructions with so that computer equipment (can be personal computer, Server, or the network equipment etc.) perform completely or partially walking of method described in each embodiment of the present invention Suddenly.And aforesaid storage medium includes: USB flash disk, portable hard drive, read only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD Etc. the various media that can store program code.
The above, above example only in order to technical scheme to be described, is not intended to limit; Although being described in detail the present invention with reference to previous embodiment, those of ordinary skill in the art should Work as understanding: the technical scheme described in foregoing embodiments still can be modified by it, or to it Middle part technical characteristic carries out equivalent;And these amendments or replacement, do not make appropriate technical solution Essence depart from various embodiments of the present invention technical scheme spirit and scope.

Claims (12)

1. a querying method, it is adaptable to log-structured merging tree LSM-Tree data base, its feature It is, including:
Receiving query statement, described query statement includes target major key RowKey to be found;
Determine the N bar target record that described target RowKey is corresponding, wherein, described N bar target record Including the initial target record that described target RowKey is corresponding, and/or it is used for updating described initial target note The renewal target record of record, and/or the Query Result record that described target RowKey is corresponding, described in every Target record includes flag bit, and wherein, the flag of initial target record and Query Result record is 1, more The flag bit of fresh target record is 0;
According to by newly to old order, it is successively read the target record determined;
If the flag bit of the M article of target record read is 1, then it is successively read, described in termination, the mesh determined The operation of labelling record, wherein 1≤M≤N;
The M bar target record read is merged into a Query Result record, and by described Query Result Record is as Query Result;
Described Query Result record is write described data base.
Querying method the most according to claim 1, it is characterised in that the described M bar that will read Target record is merged into a Query Result record and is included:
According to the M bar target record read, generating Query Result record, wherein said Query Result is remembered The RowKey of record is described target RowKey, and the flag bit of described Query Result record is 1.
Querying method the most according to claim 1 and 2, it is characterised in that described target record is also Including timestamp and/or version number, described timestamp is for representing the generation time of described target record, institute State version number for representing the new and old of described target record;
Described according to by newly to old order, it is successively read the target record determined and includes: according to described N The timestamp of bar target record and/or version number, according to by newly to old order, be successively read the mesh determined Labelling is recorded.
4. a Piece file mergence method, it is adaptable to log-structured merging tree LSM-Tree data base, its It is characterised by, including:
Determining P ancient deed to be combined, wherein, each described ancient deed includes one or more old note Record, every old record includes flag bit and for identifying the major key RowKey of described old record, wherein, institute The value stating flag bit includes 0 or 1, and wherein, P is the integer not less than 2;
Being a new file by described P Geju City Piece file mergence, wherein, described new file includes that Q bar is newly remembered Record, every new record includes flag bit and for identifying the RowKey of described new record, and described Q bar is new The union of the RowKey that Q RowKey is described P ancient deed of record;Wherein, if the R article In the old record corresponding for RowKey of new record, there is the old record that flag bit is 1, the most described R The flag bit of bar new record is 1, if the flag bit of old record corresponding to the RowKey of R article of new record All 0, the flag bit of the most described R article of new record is 0, wherein, Q >=1,1≤R≤Q.
Piece file mergence method the most according to claim 4, it is characterised in that described by described P Ancient deed is merged into a new file and is included:
Determine the RowKey of R article of new record to be determined in described new file, wherein, 1≤R≤Q;
According to by newly determining successively in described P ancient deed to old order, described the R article new record The flag bit of the old record corresponding to RowKey;
If in the S the ancient deed read, the old note corresponding to the RowKey of described R article of new record The flag bit of record is 1, it is determined that in described new file, the flag bit of R article of new record is 1, and terminates institute State according to by newly determining successively in described P ancient deed to old order, described R article of new record The step of the flag bit of the old record corresponding to RowKey, wherein, 1≤S≤P;
If in described P the ancient deed read, old corresponding to the RowKey of described R article of new record The flag bit of record is 0, it is determined that in described new file, the flag bit of R article of new record is 0.
6. according to the Piece file mergence method described in claim 4 or 5, it is characterised in that described method is also Including:
After P Geju City Piece file mergence is a new file, delete described P ancient deed.
7. an inquiry unit, it is adaptable to log-structured merging tree LSM-Tree data base, its feature It is, including:
Command reception module, is used for receiving query statement, and described query statement includes target to be found Major key RowKey;
Record determines module, for determining the N bar target record that described target RowKey is corresponding, wherein, Described N bar target record includes the initial target record that described target RowKey is corresponding, and/or for more The renewal target record of new described initial target record, and/or the inquiry knot that described target RowKey is corresponding Really record, every described target record includes flag bit, wherein, initial target record and Query Result note The flag of record is 1, and the flag bit updating target record is 0;
Record read module, for according to by newly to old order, is successively read the target record determined;
If the flag bit of the M article of target record read is 1, the most described record read module terminates described It is successively read the operation of the target record determined, wherein 1≤M≤N;
Record merges module, for the M bar target record read is merged into a Query Result record, And using described Query Result record as Query Result;
Result writing module, for writing described data base by described Query Result record.
Inquiry unit the most according to claim 7, it is characterised in that described record merges module tool Body is used for:
According to the M bar target record read, generate Query Result record, and described Query Result is remembered Record is as Query Result, and the RowKey of wherein said Query Result record is described target RowKey, institute The flag bit stating Query Result record is 1.
9. according to the inquiry unit described in claim 7 or 8, it is characterised in that described target record is also Including timestamp and/or version number, described timestamp is for representing the generation time of described target record, institute State version number for representing the new and old of described target record;
Described record read module specifically for: according to timestamp and/or the version of described N bar target record Number, according to by newly to old order, it is successively read the target record determined.
10. a Piece file mergence device, it is adaptable to log-structured merging tree LSM-Tree data base, its It is characterised by, including:
File determines module, for determining P ancient deed to be combined, wherein, each described ancient deed Including one or more old record, every old record includes flag bit and for identifying the master of described old record Key RowKey, wherein, the value of described flag bit includes 0 or 1, and wherein, P is whole not less than 2 Number;
File combination module, for being a new file by described P Geju City Piece file mergence, wherein, described New file includes that Q bar new record, every new record include flag bit and for identifying described new record RowKey, the RowKey's that Q RowKey is described P ancient deed of described Q bar new record Union;Wherein, if in old record corresponding to the RowKey of R article of new record, there is flag bit is 1 Old record, the flag bit of the most described R article of new record is 1, if the RowKey of R article of new record The flag bit all 0 of corresponding old record, the flag bit of the most described R article of new record is 0, wherein, Q >=1,1≤R≤Q.
11. Piece file mergence devices according to claim 10, it is characterised in that described Piece file mergence Module specifically for:
Determine the RowKey of R article of new record to be determined in described new file, wherein, 1≤R≤Q;
According to by newly determining successively in described P ancient deed to old order, described the R article new record The flag bit of the old record corresponding to RowKey;
If in the S the ancient deed read, the old note corresponding to the RowKey of described R article of new record The flag bit of record is 1, it is determined that in described new file, the flag bit of R article of new record is 1, and terminates institute State according to by newly determining successively in described P ancient deed to old order, described R article of new record The step of the flag bit of the old record corresponding to RowKey, wherein, 1≤S≤P;
If in described P the ancient deed read, old corresponding to the RowKey of described R article of new record The flag bit of record is 0, it is determined that in described new file, the flag bit of R article of new record is 0.
12. according to the Piece file mergence device described in claim 10 or 11, it is characterised in that described dress Put and also include:
File removing module, for after being a new file by P Geju City Piece file mergence, deletes described P Individual ancient deed.
CN201510148521.6A 2015-03-31 2015-03-31 A kind of querying method, file mergences method and relevant apparatus Active CN106156070B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510148521.6A CN106156070B (en) 2015-03-31 2015-03-31 A kind of querying method, file mergences method and relevant apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510148521.6A CN106156070B (en) 2015-03-31 2015-03-31 A kind of querying method, file mergences method and relevant apparatus

Publications (2)

Publication Number Publication Date
CN106156070A true CN106156070A (en) 2016-11-23
CN106156070B CN106156070B (en) 2019-07-12

Family

ID=57337848

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510148521.6A Active CN106156070B (en) 2015-03-31 2015-03-31 A kind of querying method, file mergences method and relevant apparatus

Country Status (1)

Country Link
CN (1) CN106156070B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874285A (en) * 2015-12-10 2017-06-20 中国移动通信集团公司 A kind of photo files processing method and terminal device
CN107016548A (en) * 2016-12-09 2017-08-04 阿里巴巴集团控股有限公司 Client, information processing method and reading/writing method and device
CN107247729A (en) * 2017-05-03 2017-10-13 中国银联股份有限公司 A kind of document handling method and device
CN108628542A (en) * 2017-03-22 2018-10-09 华为技术有限公司 A kind of Piece file mergence method and controller
CN108769172A (en) * 2018-05-21 2018-11-06 杭州有赞科技有限公司 A kind of method of data synchronization and system
CN110716900A (en) * 2019-10-10 2020-01-21 支付宝(杭州)信息技术有限公司 Data query method and system
CN111104403A (en) * 2019-11-30 2020-05-05 北京浪潮数据技术有限公司 LSM tree data processing method, system, equipment and computer medium
WO2021197493A1 (en) * 2020-04-04 2021-10-07 厦门网宿有限公司 File management method and apparatus based on lsm-tree storage engine
CN113495871A (en) * 2020-04-04 2021-10-12 厦门网宿有限公司 File management method and device based on LSM-Tree storage engine

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593185A (en) * 2008-05-29 2009-12-02 国际商业机器公司 Utilize and carry out the method and system that data are recovered synchronously
CN101751473A (en) * 2009-12-31 2010-06-23 中兴通讯股份有限公司 The searching of a kind of amendment record item, renewal and method for synchronous and data sync equipment
CN102110121A (en) * 2009-12-24 2011-06-29 阿里巴巴集团控股有限公司 Method and system for processing data
CN102789475A (en) * 2012-05-08 2012-11-21 华为技术有限公司 Data synchronization method and device for result set cache at server end of database
CN103353891A (en) * 2013-07-05 2013-10-16 北京人大金仓信息技术股份有限公司 Database management system and data processing method thereof
CN104424219A (en) * 2013-08-23 2015-03-18 华为技术有限公司 Method and equipment of managing data documents
CN104834700A (en) * 2015-04-27 2015-08-12 南京邮电大学 Method for capturing movement data increment based on track change

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593185A (en) * 2008-05-29 2009-12-02 国际商业机器公司 Utilize and carry out the method and system that data are recovered synchronously
CN102110121A (en) * 2009-12-24 2011-06-29 阿里巴巴集团控股有限公司 Method and system for processing data
CN101751473A (en) * 2009-12-31 2010-06-23 中兴通讯股份有限公司 The searching of a kind of amendment record item, renewal and method for synchronous and data sync equipment
CN102789475A (en) * 2012-05-08 2012-11-21 华为技术有限公司 Data synchronization method and device for result set cache at server end of database
CN103353891A (en) * 2013-07-05 2013-10-16 北京人大金仓信息技术股份有限公司 Database management system and data processing method thereof
CN104424219A (en) * 2013-08-23 2015-03-18 华为技术有限公司 Method and equipment of managing data documents
CN104834700A (en) * 2015-04-27 2015-08-12 南京邮电大学 Method for capturing movement data increment based on track change

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874285B (en) * 2015-12-10 2020-06-30 中国移动通信集团公司 Photo file processing method and terminal equipment
CN106874285A (en) * 2015-12-10 2017-06-20 中国移动通信集团公司 A kind of photo files processing method and terminal device
CN107016548A (en) * 2016-12-09 2017-08-04 阿里巴巴集团控股有限公司 Client, information processing method and reading/writing method and device
CN108628542B (en) * 2017-03-22 2021-08-03 华为技术有限公司 File merging method and controller
CN108628542A (en) * 2017-03-22 2018-10-09 华为技术有限公司 A kind of Piece file mergence method and controller
US11403021B2 (en) 2017-03-22 2022-08-02 Huawei Technologies Co., Ltd. File merging method and controller
CN107247729B (en) * 2017-05-03 2021-04-27 中国银联股份有限公司 File processing method and device
CN107247729A (en) * 2017-05-03 2017-10-13 中国银联股份有限公司 A kind of document handling method and device
CN108769172A (en) * 2018-05-21 2018-11-06 杭州有赞科技有限公司 A kind of method of data synchronization and system
CN110716900A (en) * 2019-10-10 2020-01-21 支付宝(杭州)信息技术有限公司 Data query method and system
CN111104403A (en) * 2019-11-30 2020-05-05 北京浪潮数据技术有限公司 LSM tree data processing method, system, equipment and computer medium
CN111104403B (en) * 2019-11-30 2022-06-07 北京浪潮数据技术有限公司 LSM tree data processing method, system, equipment and computer medium
WO2021197493A1 (en) * 2020-04-04 2021-10-07 厦门网宿有限公司 File management method and apparatus based on lsm-tree storage engine
CN113495871A (en) * 2020-04-04 2021-10-12 厦门网宿有限公司 File management method and device based on LSM-Tree storage engine
CN113495871B (en) * 2020-04-04 2023-06-23 厦门网宿有限公司 File management method and device based on LSM-Tree storage engine

Also Published As

Publication number Publication date
CN106156070B (en) 2019-07-12

Similar Documents

Publication Publication Date Title
CN106156070A (en) A kind of querying method, Piece file mergence method and relevant apparatus
CN109034809B (en) Block chain generation method and device, block chain node and storage medium
CN102402605B (en) Mixed distribution model for search engine indexing
CN101031907B (en) Index processing
CN104794123A (en) Method and device for establishing NoSQL database index for semi-structured data
CN101329676B (en) Data paralleling abstracting method and apparatus and database system
CN103703467A (en) Method and apparatus for storing data
JP2010503117A (en) Dynamic fragment mapping
CN107016047A (en) Document query, document storing method and device
CN111008521B (en) Method, device and computer storage medium for generating wide table
CN105677683A (en) Batch data query method and device
CN102360389B (en) Method for implementing data set specific management policies with respect to data
CN105550225A (en) Index construction method and query method and apparatus
CN104021123A (en) Method and system for data transfer
CN104346458A (en) Data storage method and device
CN104834650A (en) Method and system for generating effective query tasks
CN108021333A (en) The system of random read-write data, device and method
CN105373376A (en) Method and apparatus for configuring a software application
CN104021219A (en) Method and device for generating data template
CN102932416B (en) A kind of intermediate data storage method of information flow task, processing method and device
CN106648839A (en) Method and device for processing data
CN102193988A (en) Method and system for retrieving node data in graphic database
CN105446982A (en) Data storage system management method and device
CN115150413B (en) Block chain data storage method and device, electronic equipment and storage medium
CN110362540A (en) A kind of storage of data, visitor's number acquisition methods and device

Legal Events

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