CN103345521B - A kind of method and apparatus processing key assignments in Hash table database - Google Patents
A kind of method and apparatus processing key assignments in Hash table database Download PDFInfo
- Publication number
- CN103345521B CN103345521B CN201310300815.7A CN201310300815A CN103345521B CN 103345521 B CN103345521 B CN 103345521B CN 201310300815 A CN201310300815 A CN 201310300815A CN 103345521 B CN103345521 B CN 103345521B
- Authority
- CN
- China
- Prior art keywords
- value
- key
- array
- attribute field
- concordance list
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 77
- 238000012545 processing Methods 0.000 title claims abstract description 13
- 238000003780 insertion Methods 0.000 claims abstract description 41
- 230000037431 insertion Effects 0.000 claims abstract description 41
- 238000012217 deletion Methods 0.000 claims description 54
- 230000037430 deletion Effects 0.000 claims description 54
- 230000015572 biosynthetic process Effects 0.000 claims 2
- 238000005516 engineering process Methods 0.000 description 88
- 230000009471 action Effects 0.000 description 23
- 238000010586 diagram Methods 0.000 description 14
- 241001269238 Data Species 0.000 description 5
- 230000008901 benefit Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 3
- 235000010627 Phaseolus vulgaris Nutrition 0.000 description 2
- 244000046052 Phaseolus vulgaris Species 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000002955 isolation Methods 0.000 description 2
- 230000035800 maturation Effects 0.000 description 2
- 239000002253 acid Substances 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012966 insertion method Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000002688 persistence Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of method and apparatus processing key assignments in Hash table database.The method inserting key assignments in Hash table database comprises the steps: to receive the insertion key assignments request to the collective data table of Hash table database; Judge whether to exist in set identification concordance list by inserting being inserted into the first key and being inserted into the second key that the first value forms in key assignments request, if existed, then carry out following step: that in set identification concordance list, inserts that the request of described insertion key assignments comprises is inserted into the second value; Insert in the 3rd value array in aggregate attribute concordance list by the request of described insertion key assignments comprise be inserted into the second value and be inserted into that attribute field data form be inserted into the 3rd value; That inserts in the 4th value array in collective data table that the request of described insertion key assignments comprises is inserted into the 4th value.By the present invention, under Internet scene can be realized, gather the high concurrency of data manipulation and low retardance.
Description
Technical field
The present invention relates to field of computer technology, be specifically related to database technical field, particularly relate to a kind of method and apparatus processing key assignments in Hash table database.
Background technology
Current, key-value pair (Key-Value) storage system becomes the focus of database technical field research and development and application.As the important supplement of traditional Relational DataBase, key-value pair (Key-Value) storage system no longer supports the sophisticated functions of SQL (StructuredQueryLanguage) statement of traditional Relational DataBase, and abandon ACID (namely, four characteristics that affairs in data base management system (DBMS) have: atomicity (Atomicity), consistance (Consistency), isolation (Isolation), persistence (Durability)) complete support, therefore, key-value pair storage system has evaded design complicated greatly, data throughput capabilities apparently higher than traditional relational can be provided, there is good horizontal extension ability, be applicable to operating on general cheap PC server hardware, store to have obtained in the data of Internet firm and use widely.
Fig. 1 is basic organizational structure's schematic diagram of key-value pair (Key-Value) memory module.As seen from Figure 1, key (Key) and value (Value) are one to one, corresponding relation is safeguarded by Hash table, the step obtaining unique respective value (Value) according to key (Key) is: 1) get cryptographic hash to key (Key), obtain the exclusive node in Hash table; 2) exclusive node in Hash table have recorded the storage information of respective value (Value), according to this information acquisition value (Value).
For the storage data continued to increase, key-value pair (Key-Value) storage system has good horizontal extension ability.Fig. 2 is the distributed storage architecture schematic diagram after expanding the key-value pair memory module in Fig. 1.In fig. 2, the treatment scheme for a storage resource request is: 1) interface route module 202 is according to the Key in the storage resource request received from storage resource request side 201, according to routing rule, storage resource request is forwarded to corresponding key-value pair memory module 203; 2) key-value pair memory module 203 processes storage resource request.Wherein, routing rule can use the maturation method such as integer delivery and consistance Hash, but is not limited to use these maturation methods.
In the internet, applications scene that data store, also there is the use to collective data.Collective data refers to comprise in set a series of to be had same characteristic and is worth unduplicated data.Each set and each collective data in gathering, all can use a unique identification to represent.Fig. 3 is the relation schematic diagram of set and collective data, wherein, use key1 as set identification, use key2 as the collective data mark of the collective data 301 in set, collective data 301 also comprises multiple attribute field 3011 further, and different collective datas has different collective data mark key2.In internet, applications scene, the application scenarios of typical collective data such as:
1) QQ friend relation chain, now set identification key1 is the QQ number of certain user, and collective data mark key2 is the QQ number of the QQ good friend of this user;
2) bean vermicelli in microblogging application and concern people, now set identification key1 is the microblogging account number of certain user, and collective data mark key2 is the bean vermicelli of this user or the microblogging account number of concern people;
3) employee information in enterprise instant communication, now set identification key1 is enterprise's account number, and collective data mark key2 is employee's account number of this enterprise subordinate.
In internet, applications scene, there are two typical feature to the use of collective data:
1) as shown in Figure 3, the collective data 301 of collective data mark representated by key2, normally comprise the column data of multiple attribute field 3011, such as in the application scenarios of QQ friend relation chain, except to record certain user QQ number under the QQ number of all QQ good friends, also need some essential informations recording each QQ good friend, as the pet name, sex, location etc.;
2) when the collective data under gathering is the column data of multiple attribute field, need to retrieve according to certain particular community field in some occasion, same for the application scenarios of QQ friend relation chain, usual needs are according to certain particular community field such as " location ", and quick-searching meets the QQ friend information of corresponding conditions.
Magnanimity based on internet is applied (the social activity application of such as above-mentioned QQ, microblogging and so on), constantly expedites the emergence of out the collective data of magnanimity, can bring again the read-write amount of magnanimity simultaneously.How storing these collective datas according to the feature of collective data self in internet, applications scene, and how to provide high concurrent read-write service, is the field of data storage problems faced based on internet.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method and apparatus processing key assignments in Hash table database of improvement, solves the technical matters that above background technology part is mentioned.
On the one hand, embodiments provide a kind of method inserting key assignments in Hash table database, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value;
Described method comprises the steps:
Receive the insertion key assignments request to the described collective data table of described Hash table database, wherein, the request of described insertion key assignments comprises: be inserted into the first key, be inserted into the first value, be inserted into the second value, be inserted into attribute field title, be inserted into attribute field data, be inserted into the 4th value;
Judge whether to exist in described set identification concordance list and be inserted into the first key and described the second key being inserted into the first value and forming by described, if there is no, then show in described set described in be inserted into corresponding to the first key described first value array in insert described in be inserted into the first value and insert in described set identification concordance list and be inserted into the first key and described the second key being inserted into the first value and forming by described; And if exist, then directly carry out following step;
In described set identification concordance list with by described be inserted into the first key and described be inserted in the second value array corresponding to the second key that the first value forms insert described in be inserted into the second value;
In described aggregate attribute concordance list with by described be inserted into the first key, described in be inserted into the first value and described be inserted in the 3rd value array corresponding to triple bond that attribute field title forms insert by described be inserted into the second value and described be inserted into that attribute field data form be inserted into the 3rd value;
In described collective data table with by described be inserted into the first key, described in be inserted into the first value and described be inserted in the 4th value array corresponding to quadruple linkage that the second value forms insert described in be inserted into the 4th value.
On the one hand, embodiments provide a kind of method upgrading key assignments in Hash table database, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value;
Described method comprises the steps:
Receive the renewal key assignments request to the described collective data table of described Hash table database, wherein, the request of described renewal key assignments comprises: the primitive attribute field data under the first key to be updated, the first value to be updated, the second value to be updated, attribute field title to be updated, described attribute field title to be updated, the attribute field data to be updated under described attribute field title to be updated, the 4th value to be updated;
In the 3rd value array that the triple bond formed with by described first key to be updated, described first value to be updated and described attribute field title to be updated in described aggregate attribute concordance list is corresponding, first delete the 3rd value be made up of described second value to be updated and described primitive attribute field data, then insert the 3rd value be made up of described second value to be updated and described attribute field data to be updated;
In the 4th value array that the quadruple linkage formed with by described first key to be updated, described first value to be updated and described second value to be updated in described collective data table is corresponding, described 4th value to be updated is utilized to replace corresponding former 4th value.
On the one hand, embodiments provide a kind of method of deleting key assignments in Hash table database, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value;
Described method comprises the steps:
Receive the deletion key assignments request to the described collective data table of described Hash table database, wherein, the request of described deletion key assignments comprises: the first key to be deleted, the first value to be deleted, the second value to be deleted, attribute field title to be deleted, attribute field data to be deleted;
In described collective data table, the 4th value array that the quadruple linkage that deletion is formed with by described first key to be deleted, described first value to be deleted and described second value to be deleted is corresponding;
In the 3rd value array that the triple bond formed with by described first key to be deleted, described first value to be deleted and described attribute field title to be deleted in described aggregate attribute concordance list is corresponding, delete the 3rd value be made up of described second value to be deleted and described attribute field data to be deleted;
In the second value array that the second key formed with by described first key to be deleted and described first value to be deleted in described set identification concordance list is corresponding, delete described second value to be deleted.
On the one hand, embodiments provide a kind of method reading key assignments in Hash table database, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value;
Described method comprises the steps:
Receive the reading key assignments request to the described collective data table of described Hash table database, wherein, the request of described reading key assignments comprises: the first key to be read, the first value to be read, the second value to be read;
In described collective data table, the 4th value array that the quadruple linkage that reading is formed with by described first key to be read, described first value to be read and described second value to be read is corresponding.
On the one hand, embodiments provide a kind of method reading key assignments in Hash table database, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value;
Described method comprises the steps:
Receive the reading key assignments request to the described collective data table of described Hash table database, wherein, the request of described reading key assignments comprises: the first key to be read, the first value to be read, attribute field title to be read, attribute field data to be read;
In the 3rd value array that the triple bond formed with by described first key to be read, described first value to be read and described attribute field title to be read in described aggregate attribute concordance list is corresponding, inquiry obtains to be checked three value corresponding with described attribute field data to be read, and obtains the second value as the second value to be read from described 3rd value to be checked;
The 4th value array that the quadruple linkage that reading is formed with by described first key to be read, described first value to be read and described second value to be read in described collective data table is corresponding.
On the one hand, embodiments provide a kind of method reading key assignments in Hash table database, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value;
Described method comprises the steps:
Receive the reading key assignments request to the described collective data table of described Hash table database, wherein, the request of described reading key assignments comprises: the first key to be read and the first value to be read;
In described set identification concordance list, inquire about the second value array corresponding to the second key of obtaining forming with by described first key to be read and described first value to be read as the second value array to be read;
For each second value to be read in described second value array to be read, in described collective data table, the 4th value array that the quadruple linkage that reading is formed with by described first key to be read, described first value to be read and described second value to be read is corresponding.
On the one hand, embodiments provide a kind of device inserting key assignments in Hash table database, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value;
Described device comprises:
Receiver module, for receiving the insertion key assignments request of the described collective data table to described Hash table database, wherein, the request of described insertion key assignments comprises: be inserted into the first key, be inserted into the first value, be inserted into the second value, be inserted into attribute field title, be inserted into attribute field data, be inserted into the 4th value;
Judge module, the first key and described the second key being inserted into the first value and forming is inserted into by described for judging whether to exist in described set identification concordance list, if there is no, then show in described set described in be inserted into corresponding to the first key described first value array in insert described in be inserted into the first value and insert in described set identification concordance list and be inserted into the first key and described the second key being inserted into the first value and forming by described; And if exist, then directly call following module;
Set identification concordance list insert module, in described set identification concordance list with by described be inserted into the first key and described be inserted in the second value array corresponding to the second key that the first value forms insert described in be inserted into the second value;
Aggregate attribute concordance list insert module, in described aggregate attribute concordance list with by described be inserted into the first key, described in be inserted into the first value and described be inserted in the 3rd value array corresponding to triple bond that attribute field title forms insert by described be inserted into the second value and described be inserted into that attribute field data form be inserted into the 3rd value;
Collective data table insert module, in described collective data table with by described be inserted into the first key, described in be inserted into the first value and described be inserted in the 4th value array corresponding to quadruple linkage that the second value forms insert described in be inserted into the 4th value.
On the one hand, embodiments provide a kind of device upgrading key assignments in Hash table database, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value;
Described device comprises:
Receiver module, for receiving the renewal key assignments request of the described collective data table to described Hash table database, wherein, the request of described renewal key assignments comprises: the primitive attribute field data under the first key to be updated, the first value to be updated, the second value to be updated, attribute field title to be updated, described attribute field title to be updated, the attribute field data to be updated under described attribute field title to be updated, the 4th value to be updated;
Aggregate attribute concordance list processing module, for in the 3rd value array that the triple bond formed with by described first key to be updated, described first value to be updated and described attribute field title to be updated in described aggregate attribute concordance list is corresponding, first delete the 3rd value be made up of described second value to be updated and described primitive attribute field data, then insert the 3rd value be made up of described second value to be updated and described attribute field data to be updated;
Collective data table handing module, for in the 4th value array that the quadruple linkage formed with by described first key to be updated, described first value to be updated and described second value to be updated in described collective data table is corresponding, described 4th value to be updated is utilized to replace corresponding former 4th value.
On the one hand, embodiments provide a kind of device deleting key assignments in Hash table database, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value;
Described device comprises:
Receiver module, for receiving the deletion key assignments request of the described collective data table to described Hash table database, wherein, the request of described deletion key assignments comprises: the first key to be deleted, the first value to be deleted, the second value to be deleted, attribute field title to be deleted, attribute field data to be deleted;
Collective data list deletion module, in described collective data table, the 4th value array that the quadruple linkage that deletion is formed with by described first key to be deleted, described first value to be deleted and described second value to be deleted is corresponding;
Aggregate attribute concordance list removing module, for in the 3rd value array that the triple bond formed with by described first key to be deleted, described first value to be deleted and described attribute field title to be deleted in described aggregate attribute concordance list is corresponding, delete the 3rd value be made up of described second value to be deleted and described attribute field data to be deleted;
Set identification concordance list removing module, in the second value array that the second key formed with by described first key to be deleted and described first value to be deleted in described set identification concordance list is corresponding, deletes described second value to be deleted.
On the one hand, embodiments provide a kind of device reading key assignments in Hash table database, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value;
Described device comprises:
Receiver module, for receiving the reading key assignments request of the described collective data table to described Hash table database, wherein, the request of described reading key assignments comprises: the first key to be read, the first value to be read, the second value to be read;
Read module, in described collective data table, the 4th value array that the quadruple linkage that reading is formed with by described first key to be read, described first value to be read and described second value to be read is corresponding.
On the one hand, embodiments provide a kind of device reading key assignments in Hash table database, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value;
Described device comprises:
Receiver module, for receiving the reading key assignments request of the described collective data table to described Hash table database, wherein, the request of described reading key assignments comprises: the first key to be read, the first value to be read, attribute field title to be read, attribute field data to be read;
Second value acquisition module, for in the 3rd value array that the triple bond formed with by described first key to be read, described first value to be read and described attribute field title to be read in described aggregate attribute concordance list is corresponding, inquiry obtains to be checked three value corresponding with described attribute field data to be read, and obtains the second value as the second value to be read from described 3rd value to be checked;
Read module, in described collective data table, the 4th value array that the quadruple linkage that reading is formed with by described first key to be read, described first value to be read and described second value to be read is corresponding.
On the one hand, embodiments provide a kind of device reading key assignments in Hash table database, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value;
Described device comprises:
Receiver module, for receiving the reading key assignments request of the described collective data table to described Hash table database, wherein, the request of described reading key assignments comprises: the first key to be read and the first value to be read;
Enquiry module, in described set identification concordance list, inquires about the second value array corresponding to the second key of obtaining forming with by described first key to be read and described first value to be read as the second value array to be read;
Read module, for being worth each second value to be read in array for described to be read second, in described collective data table, the 4th value array that the quadruple linkage that reading is formed with by described first key to be read, described first value to be read and described second value to be read is corresponding.
The method and apparatus processing key assignments in Hash table database that the present invention proposes has following features: in each Hash table of Hash table database, store collective data by the feature according to collective data self, and provide for the structure of each Hash table of described Hash table database method collective data inserted, upgrades, delete, read, gather the high concurrency of data manipulation and low retardance under achieving Internet scene.
Accompanying drawing explanation
By reading the detailed description done non-limiting example done with reference to the following drawings, other features, objects and advantages of the present invention will become more obvious:
Fig. 1 is basic organizational structure's schematic diagram of key-value pair (Key-Value) memory module;
Fig. 2 is the distributed storage architecture schematic diagram after expanding the key-value pair memory module in Fig. 1;
Fig. 3 is the relation schematic diagram of set and collective data;
Fig. 4 a is the schematic diagram of the set table according to the embodiment of the present invention;
Fig. 4 b is the schematic diagram of the set identification concordance list according to the embodiment of the present invention;
Fig. 4 c is the schematic diagram of the aggregate attribute concordance list according to the embodiment of the present invention;
Fig. 4 d is the schematic diagram of the collective data table according to the embodiment of the present invention;
Fig. 5 is the realization flow inserting the method for key assignments in Hash table database according to a first embodiment of the present invention;
Fig. 6 is the realization flow upgrading the method for key assignments in Hash table database according to a second embodiment of the present invention;
Fig. 7 is the realization flow deleting the method for key assignments in Hash table database according to a third embodiment of the present invention;
Fig. 8 is the realization flow reading the method for key assignments in Hash table database according to a fourth embodiment of the present invention;
Fig. 9 is the realization flow reading the method for key assignments in Hash table database according to a fifth embodiment of the present invention;
Figure 10 is the realization flow reading the method for key assignments in Hash table database according to a sixth embodiment of the present invention;
Figure 11 is the structural representation inserting the device of key assignments in Hash table database according to a seventh embodiment of the present invention;
Figure 12 is the structural representation upgrading the device of key assignments in Hash table database according to a eighth embodiment of the present invention;
Figure 13 is the structural representation deleting the device of key assignments in Hash table database according to a ninth embodiment of the present invention;
Figure 14 is the structural representation reading the device of key assignments in Hash table database according to a tenth embodiment of the present invention;
Figure 15 is the structural representation reading the device of key assignments in Hash table database according to a 11th embodiment of the present invention;
Figure 16 is the structural representation reading the device of key assignments in Hash table database according to a 12th embodiment of the present invention.
Embodiment
Below in conjunction with drawings and Examples, the present invention is described in further detail.Be understandable that, specific embodiment described herein is only for explaining the present invention, but not limitation of the invention.It also should be noted that, for convenience of description, illustrate only part related to the present invention in accompanying drawing but not full content.
Below description is of the present invention before each embodiment, first the structure of the Hash table database that each embodiment following of the present invention all relates to is described.Described Hash table database below in each embodiment at least comprises following Hash table: set table (below exemplary called after " set " table in each embodiment), set identification concordance list (below exemplary called after " key " table in each embodiment), aggregate attribute concordance list (below exemplary called after " attribute " table in each embodiment), collective data table (below exemplary called after " data " table in each embodiment), and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and described first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, described 3rd value is made up of the attribute field data under described second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by described 4th value.
For following set table " set ", set identification concordance list " key ", aggregate attribute concordance list " attribute ", collective data table " data ", the incidence relation of each table in Hash table database mentioned above is exemplarily illustrated.
Show the schematic diagram of the set table " set " according to the embodiment of the present invention in fig .4.
With reference to figure 4a, all set identifications (corresponding to the first value array) comprised under set table " set " stores certain collection class (corresponding to the first key).Such as, if set table " set " stores the specific collection class that name is called " No. QQ ", then all set identifications of described set table " set " respective stored can be by multiple No. QQ array formed; Or if set table " set " stores the specific collection class that name is called " department employee social security numbers ", then all set identifications of described set table " set " respective stored can be the array be made up of multiple employee's social security numbers.
As shown in fig. 4 a, in set table " set ", use the title " set_name " of collection class as the first key, the array formed under this collection class " set_name ", by all set identifications " key1 " (the first value) is as the first value array.Described first key and described first value array form the key-value pair that set table " set " stores.
Show the schematic diagram of the set identification concordance list " key " according to the embodiment of the present invention in fig. 4b.
With reference to figure 4b, all collective datas mark (corresponding to the second value array) that set identification concordance list " key " comprises under storing certain set (corresponding to the second key).Such as, if all collective datas marks of set identification concordance list " key " for comprising under the specific collection of store name for " main No. QQ ", then described all collective data marks can be served as reasons the array of all good friends No. QQ composition of " main No. QQ ".
As shown in Figure 4 b, in set identification concordance list " key ", the title " set_name " of use collection class and set identification " key1 " are jointly as the second key, and the array that all collective datas mark " key2 " form is as the second value array.Described second key and described second value array form the key-value pair that set identification concordance list " key " stores.
The schematic diagram of the aggregate attribute concordance list " attribute " according to the embodiment of the present invention has been shown in Fig. 4 c.
With reference to figure 4c, aggregate attribute concordance list " attribute " stores the index information of particular community field.In the aggregate attribute concordance list " attribute " shown in Fig. 4 c, use the title " set_name " of collection class, set identification " key1 " and specific attribute field title " attribute_name " common as triple bond, collective data mark " key2 " and described attribute field title " attribute_name " under attribute field data (that is, name is called the value of the attribute field of " attribute_name ") as the 3rd value.Described triple bond and the 3rd value array form the key-value pair that aggregate attribute concordance list " attribute " stores.
Show the schematic diagram of the collective data table " data " according to the embodiment of the present invention in figure 4d.
With reference to figure 4d, collective data table " data " stores concrete gathering data content.In the collective data table " data " shown in Fig. 4 d, use the title " set_name " of collection class, set identification " key1 " and collective data mark " key2 " common as quadruple linkage, concrete gathering data content is as the 4th value, data record representated by described 4th value comprises at least one attribute field, and an attribute field name can be selected from each attribute field title of at least one attribute field described to be referred to as attribute field title " attribute_name " in aggregate attribute concordance list " attribute ".Described quadruple linkage and the 4th value array form the key-value pair that collective data table " data " stores.
In conjunction with the structure of above-mentioned Hash table database, set forth each specific embodiment hereinafter.
Figure 5 illustrates the first embodiment of the present invention.
Fig. 5 is the realization flow 500 inserting the method for key assignments in Hash table database according to a first embodiment of the present invention, and details are as follows for this realization flow 500:
In step 501, the insertion key assignments request of the collective data table to Hash table database is received.
In a first embodiment, the insertion key assignments request statement that the server of trustship above-mentioned Hash table database can directly provide from local reading database slip-stick artist in advance or document, or insertion key assignments request statement or the document of other position (such as client location) remotely can be read by cable network or wireless network.Wherein, the request of described insertion key assignments comprises: be inserted into the first key, namely gathers the title will carrying out the specific collection classification of update of table " set ", supposes that it is " set_name_insert " at this; Be inserted into the first value, namely gather the specific collection mark will carrying out update of table " set ", suppose that it is " key1_insert " at this; Be inserted into the second value, i.e. the specific collection Data Identification that will carry out update of set identification concordance list " key ", suppose that it is " key2_insert " at this; Be inserted into attribute field title, namely at this, the specific attribute field title will carrying out update of aggregate attribute concordance list " attribute ", supposes that it is " attribute_name_insert "; Be inserted into attribute field data, the name namely will carrying out update is called the value of the attribute field of " attribute_name_insert ", supposes that it is " attribute_value_insert " at this; Be inserted into the 4th value, namely will be inserted into the data record in collective data table " data ".
In the present embodiment, above-mentioned wireless network includes but not limited to based on 3G technology, based on WiFi technology, based on Bluetooth technology, based on WiMAX technology, based on ZigBee technology, based on UWB (ultrawideband) technology or based on the wireless network of other future by the wireless technology of exploitation.
In step 502, judge whether to exist in above-mentioned set identification concordance list and be inserted into the first key and above-mentioned the second key being inserted into the first value and forming by above-mentioned, if there is no then pre-service is carried out to above-mentioned set table and above-mentioned set identification concordance list.
In a first embodiment, whether the server of trustship above-mentioned Hash table database, after receiving the request of above-mentioned insertion key assignments, first by above-mentioned to existing in above-mentioned set identification concordance list " key " be inserted into the first key and be above-mentionedly inserted into the second key that the first value forms and judge.That is, described server will judge in set identification concordance list " key ", whether there is the second key (in the present embodiment, give tacit consent to exist in the set table " set " described in be inserted into the first key " set_name_insert ") be made up of " set_name_insert " and " key1_insert ":
If there is no, then represent in set table " set ", there is not set identification " key1_insert ", thus, above-mentioned server will carry out following pre-service: first, be inserted into described in above-mentioned set table " set " in the described first value array corresponding to the first key " set_name_insert " insert described in be inserted into the first value " key1_insert "; Secondly, in above-mentioned set identification concordance list " key ", insertion is inserted into the first key " set_name_insert " and described the second key being inserted into the first value " key1_insert " and forming by described.
If existed, then represent to there is set identification " key1_insert " in set table " set ", above-mentioned realization flow directly jumps to following step 503.
In step 503, update is carried out to above-mentioned set identification concordance list.
In a first embodiment, above-mentionedly the first key " set_name_insert " is inserted into and above-mentioned the first value " key1_insert " that is inserted into constitutes the second key in above-mentioned set identification concordance list " key ".In this step, the server of trustship above-mentioned Hash table database in above-mentioned set identification concordance list " key ", insert in corresponding with described second key the second value array described in be inserted into the second value " key2_insert ".
In step 504, update is carried out to above-mentioned aggregate attribute concordance list.
In a first embodiment, be above-mentionedly inserted into the first key " set_name_insert ", be above-mentionedly inserted into the first value " key1_insert " and the above-mentioned attribute field title " attribute_name_insert " that is inserted into constitutes triple bond in above-mentioned aggregate attribute concordance list " attribute ".In this step, the server of trustship above-mentioned Hash table database in above-mentioned aggregate attribute concordance list " attribute ", insert in corresponding with described triple bond the 3rd value array by above-mentioned be inserted into the second value " key2_insert " and above-mentioned be inserted into that attribute field data " attribute_value_insert " (namely name is called the value being inserted into attribute field of " attribute_name_insert ") form be inserted into the 3rd value.
In step 505, update is carried out to above-mentioned collective data table.
In a first embodiment, be above-mentionedly inserted into the first key " set_name_insert ", be above-mentionedly inserted into the first value " key1_insert " and above-mentioned the second value " key2_insert " that is inserted into constitutes quadruple linkage in above-mentioned collective data table " data ".In this step, the server of trustship above-mentioned Hash table database in described collective data table " data ", insert in corresponding with described quadruple linkage the 4th value array described in be inserted into the 4th value.
For following the set table " set " including key-value pair, set identification concordance list " key ", aggregate attribute concordance list " attribute ", collective data table " data ", exemplary illustration is carried out to the realization flow 500 of the method for insertion key assignments mentioned above.
Set table " set "
In above set table " set ", first key " QQ class " of set table " set " represents the immediate communication tool of this type of QQ, corresponding first value (set identification) such as " 0001 " represents main No. QQ that will be used for logging in this table, and, these first values " 0001 ", " 0002 " and " 0003 " constitute the first value array jointly, and described first value array is as the value corresponding with key " QQ class "; First key " msn class " of set table " set " represents the immediate communication tool of this type of msn, corresponding first value such as " miketencent.com " represents main No. msn that will be used for logging in, and, these first values " miketencent.com ", " billtencent.com " and " cattencent.com " constitute the first value array jointly, and described first value array is as the value corresponding with key " msn class ".
Set identification concordance list " key "
In above set identification concordance list " key ", second key of set identification concordance list " key " is made up of the first key of above-mentioned set table " set " and the first value, such as, the second key " QQ class+0001 " is made up of the first key " QQ class " and first value " 0001 " corresponding with described first key " QQ class " gathering table " set ".In this table, main No. QQ " 0001 " is represented (namely with described second key " QQ class+0001 " corresponding second value (collective data identifies) " 40011 ", the first value comprised in second key) good friend No. QQ, and, these second values " 40011 ", " 00012 " and " 00013 " constitute the second value array jointly, and described second value array is as the value corresponding with key " QQ class+0001 ".Here it may be noted that "+" number occurred in each form of the present invention only represents a kind of connection, combination or incidence relation, be not appreciated that mathematical operation symbol "+" number.
Aggregate attribute concordance list " attribute "
Key | Value |
QQ class+0001+ the age | (40011,26),(00012,21),(00013,37) |
QQ class+0001+ sex | (40011, man), (00012, female), (00013, man) |
QQ class+0002+ the age | (12345,16),(45698,31),(54785,27) |
In above aggregate attribute concordance list " attribute ", the triple bond of aggregate attribute concordance list " attribute " is made up of the first key of above-mentioned set table " set ", first value corresponding with described first key and attribute field title, such as, triple bond " QQ class+0001+ age " is made up of first key " QQ class " of set table " set ", first value " 0001 " corresponding with described first key " QQ class " and attribute field title " age ".Be worth " (40011; 26) " with described triple bond " QQ class+0001+ age " the corresponding 3rd and in this table, represent main No. QQ " 0001 " (namely, the first value comprised in triple bond) age of the good friend representated by good friend No. QQ " 40011 " (that is, second value corresponding with above-mentioned second key " QQ class+0001 ") be 26 years old.Further, these the 3rd values " (40011,26) ", " (00012,21) " and " (00013,37) " constitute the 3rd value array jointly, and described 3rd value array is as the value corresponding with key " QQ class+0001+ age ".
Collective data table " data "
Key | Value |
QQ class+0001+40011 | (40011, Zhang San, man, 26) |
QQ class+0001+00012 | (00012, Li Si, female, 21) |
QQ class+0002+12345 | (12345, king five, female, 16) |
In above collective data table " data ", the quadruple linkage of collective data table " data " is by the first key of above-mentioned set table " set ", second value of first value corresponding with described first key and above-mentioned set identification concordance list " key " (described second value with form the second key by described first key and described first value corresponding) is formed, such as, quadruple linkage " QQ class+0001+40011 " is by first key " QQ class " of set table " set ", second value " 40011 " (described second value " 40011 " is corresponding with the second key " QQ class+0001 " be made up of described first key " QQ class " and described first value " 0001 ") of first value " 0001 " corresponding with described first key " QQ class " and set identification concordance list " key " is formed.Corresponding with described quadruple linkage " QQ class+0001+40011 " the 4th is worth " (40011; Zhang San; man; 26) " represents main No. QQ " 0001 " (namely in this table, the first value comprised in quadruple linkage) the data of the good friend representated by good friend No. QQ " 40011 " (that is, second value corresponding with described second key " QQ class+0001 ") be recorded as " (40011, Zhang San; man, 26) ".Wherein, described data record comprise No. QQ, the pet name, sex, age four attribute fields, thus, the attribute field data " 40011 " in the data record of the good friend representated by good friend No. QQ " 40011 ", " Zhang San ", " man ", " 26 " are corresponding with attribute field " No. QQ ", " pet name ", " sex ", " age " respectively.In the present embodiment, the 4th value array of collective data table " data " only includes the 4th value, such as " (40011, Zhang San, man, 26) ", but in other embodiments, described 4th value array can also comprise multiple 4th value.Here it is emphasized that, the attribute field title included by triple bond of above-mentioned aggregate attribute concordance list " attribute " is one of each attribute field title of the data record representated by the 4th value of collective data table " data ", such as, the attribute field title " age " included by triple bond " QQ class+0001+ age " of above-mentioned aggregate attribute concordance list " attribute " is exactly that the data record representated by the 4th value of collective data table " data " is as " (40011, Zhang San, man, 26) one in four attribute field titles ", i.e. " age ".
If the server of trustship above-mentioned Hash table database receives the insertion key assignments request of such collective data table " data " to described Hash table database, the request of described insertion key assignments comprises: be inserted into the first key " QQ class ", be inserted into the first value " 0004 ", be inserted into the second value " 70088 ", be inserted into attribute field title " age ", be inserted into attribute field data " 50 ", be inserted into the 4th value " (70088; king five; man, 50) "; Then for above-mentioned the set table " set ", set identification concordance list " key ", aggregate attribute concordance list " attribute ", the collective data table " data " that have included key-value pair, the realization flow 500 of the method for insertion key assignments mentioned above can be following 5 steps:
Step S1, receives the request of above-mentioned insertion key assignments.
Whether step S2, judge to exist in above-mentioned set identification concordance list " key " and be inserted into the first key " QQ class " and above-mentioned the second key being inserted into the first value " 0004 " and forming by above-mentioned, i.e. " QQ class+0004 ".Due in above-mentioned set identification concordance list " key ", there is not the second key " QQ class+0004 ", so there is not set identification (namely the first value) " 0004 " in this expression in set table " set ", thus, step S2 will comprise following sub-step further: S21, be inserted into described in above-mentioned set table " set " in the first value array corresponding to the first key " QQ class " insert described in be inserted into the first value " 0004 "; S22, insert in above-mentioned set identification concordance list " key " and be inserted into the first key " QQ class " and described the second key " QQ class+0004 " being inserted into the first value " 0004 " and forming by described, at this moment, the second value array that described second key " QQ class+0004 " is corresponding is empty.
Step S3, carries out update to above-mentioned set identification concordance list " key ".In this step, the second value " 70088 " is inserted into described in inserting in the second in described set identification concordance list " key ", corresponding with described second key " QQ class+0004 " value array.
Step S4, carries out update to above-mentioned aggregate attribute concordance list " attribute ".Above-mentionedly be inserted into the first key " QQ class ", be above-mentionedly inserted into the first value " 0004 " and the above-mentioned attribute field title " age " that is inserted into constitutes triple bond " QQ class+0004+ age " in described aggregate attribute concordance list " attribute ".In this step, insert triple bond " QQ class+0004+ age " in the described aggregate attribute concordance list " attribute " and insert corresponding with described triple bond " QQ class+0004+ age ", by described be inserted into the second value " 70088 " and above-mentioned be inserted into that attribute field data " 50 " (namely name is called the value being inserted into attribute field at " age ") form be inserted into the 3rd value " (70088,50) ".
Step S5, carries out update to above-mentioned collective data table " data ".Above-mentionedly be inserted into the first key " QQ class ", be above-mentionedly inserted into the first value " 0004 " and above-mentioned the second value " 70088 " that is inserted into constitutes quadruple linkage " QQ class+0004+70088 " in above-mentioned collective data table " data ".In this step, insert quadruple linkage " QQ class+0004+70088 " in the described collective data table " data " and insert and corresponding with described quadruple linkage " QQ class+0004+70088 " be inserted into the 4th value " (70088, king five, male, 50) ".
So far, complete the key assignments of the above-mentioned collective data table " data " of Hash table database is inserted.
In a preferred implementation of the present embodiment, the first value array in above-mentioned set table " set " has carried out the subordinate ordered array of sorting operation according to sort algorithm (such as, by numerical values recited sort algorithm or alphabet sequence sort algorithm) to all first values in described first value array.Such as, above-mentioned the first value array corresponding to the first key " QQ class " having included the set table " set " of key-value pair includes the first value " 0001 ", " 0002 " and " 0003 ", then can carry out ascending sort or descending sort according to sort algorithm (such as by numerical values recited sort algorithm) to these first values " 0001 ", " 0002 " and " 0003 ".As the preferred mode of one, all first values in the first value array have passed through sorting operation, the step being inserted into the first value of inserting in the first value array being inserted into corresponding to the first key of described set table " set " in described step 502 comprises: the sort algorithm (such as pressing numerical values recited sort algorithm) that foundation was applied described first value array, show to be inserted into described in " set " in the described first value array corresponding to the first key to insert in order in described set and be inserted into the first value, wherein, described orderly insertion is inserted into the first value and refers to: be inserted into after the first value is inserted into described first value array described, the order of each the first value in the first new value array obtained still meets the sequence requirement based on described sort algorithm.The benefit that all first values in described first value array carry out sorting operation is, when described first value array is subordinate ordered array, can by means of the fast finding algorithm of binary chop and so on, fast finding is carried out to specific first value in described first value array, in addition, can also improve described first value array is carried out insertion, amendment, deletion action efficiency.
In a preferred implementation of the present embodiment, the second value array in above-mentioned set identification concordance list " key " has carried out the subordinate ordered array of sorting operation according to sort algorithm (such as, by numerical values recited sort algorithm or alphabet sequence sort algorithm) to all second values in described second value array.Such as, above-mentioned the second value array corresponding to the second key " QQ class+0001 " having included the set identification concordance list " key " of key-value pair includes the second value " 40011 ", " 00012 " and " 00013 ", then can carry out ascending sort or descending sort according to sort algorithm (such as by numerical values recited sort algorithm) to these second values " 40011 ", " 00012 " and " 00013 ".As the preferred mode of one, all second values in the second value array have passed through sorting operation, in described step 503 in the set identification concordance list " key ", insert the step being inserted into the second value in the second value array corresponding with the second key to comprise: according to the sort algorithm (such as pressing numerical values recited sort algorithm) applied described second value array, in described set identification concordance list " key ", with by be inserted into the first key and be inserted in the second value array corresponding to the second key that the first value forms orderly insert described in be inserted into the second value, wherein, described orderly insertion is inserted into the second value and refers to: be inserted into after the second value is inserted into described second value array described, the order of each the second value in the second new value array obtained still meets the sequence requirement based on described sort algorithm.The benefit that all second values in described second value array carry out sorting operation is, when described second value array is subordinate ordered array, can by means of the fast finding algorithm of binary chop and so on, fast finding is carried out to specific second value in described second value array, in addition, can also improve described second value array is carried out insertion, amendment, deletion action efficiency.
In a preferred implementation of the present embodiment, above-mentioned Hash table database is distributed data base, and the server of Hash table database described in trustship comprises two or multiple stage database server being linked together by network (such as by wide area network, Metropolitan Area Network (MAN) or LAN (Local Area Network)).
The method of the first embodiment of the present invention key assignments insertion method by combining on a kind of basis of new Hash table database structure this Hash table database, achieves the high concurrency of data write operation under Internet scene and low retardance.
Figure 6 illustrates the second embodiment of the present invention.
Fig. 6 is the realization flow 600 upgrading the method for key assignments in Hash table database according to a second embodiment of the present invention, and details are as follows for this realization flow 600:
In step 601, the renewal key assignments request of the collective data table to Hash table database is received.
In a second embodiment, the renewal key assignments request statement that the server of trustship above-mentioned Hash table database can directly provide from local reading database slip-stick artist in advance or document, or renewal key assignments request statement or the document of other position (such as client location) remotely can be read by cable network or wireless network.Wherein, the request of described renewal key assignments comprises: the first key to be updated, namely gathers the title will carrying out the specific collection classification of renewal rewards theory of table " set ", supposes that it is " set_name_update " at this; First value to be updated, namely gathers the specific collection mark will carrying out renewal rewards theory of table " set ", supposes that it is " key1_update " at this; Second value to be updated, i.e. at this, the specific collection Data Identification that will carry out renewal rewards theory of set identification concordance list " key ", supposes that it is " key2_update "; Attribute field title to be updated, namely at this, the specific attribute field title will carrying out renewal rewards theory of aggregate attribute concordance list " attribute ", supposes that it is " attribute_name_update "; Primitive attribute field data under described attribute field title to be updated, the name namely will carrying out renewal rewards theory is called the original value of the attribute field of " attribute_name_update ", supposes that it is " attribute_valueOrigin_update " at this; Attribute field data to be updated under described attribute field title to be updated, the name namely will carrying out renewal rewards theory is called the value to be updated of the attribute field of " attribute_name_update ", supposes that it is " attribute_valueNew_update " at this; 4th value to be updated, namely will be inserted into the data record in collective data table " data ".
In the present embodiment, above-mentioned wireless network includes but not limited to based on 3G technology, based on WiFi technology, based on Bluetooth technology, based on WiMAX technology, based on ZigBee technology, based on UWB (ultrawideband) technology or based on the wireless network of other future by the wireless technology of exploitation.
In step 602, renewal rewards theory is carried out to aggregate attribute concordance list.
In a second embodiment, above-mentioned first key " set_name_update " to be updated, above-mentioned first value " key1_update " to be updated and above-mentioned attribute field title " attribute_name_update " to be updated constitute the triple bond in above-mentioned aggregate attribute concordance list " attribute ".In this step, the server of trustship above-mentioned Hash table database will carry out following operation: in the 3rd 1) in described aggregate attribute concordance list " attribute ", corresponding with described triple bond value array, delete the 3rd value be made up of above-mentioned second value " key2_update " to be updated and above-mentioned primitive attribute field data " attribute_valueOrigin_update "; 2) in described 3rd value array, the 3rd value be made up of described second value " key2_update " to be updated and described attribute field data " attribute_valueNew_update " to be updated is inserted.
In step 603, renewal rewards theory is carried out to collective data table.
In a second embodiment, above-mentioned first key " set_name_update " to be updated, above-mentioned first value " key1_update " to be updated and above-mentioned second value " key2_update " to be updated constitute the quadruple linkage in above-mentioned collective data table " data ".In this step, the server of trustship above-mentioned Hash table database in described collective data table " data ", the corresponding with described quadruple linkage the 4th be worth in array, utilize above-mentioned 4th value to be updated to replace the 4th original accordingly value.
So far, complete the key assignments of the above-mentioned collective data table " data " of Hash table database is upgraded.
In a preferred implementation of the present embodiment, the first value array in above-mentioned set table " set " has carried out the subordinate ordered array of sorting operation according to sort algorithm (such as, by numerical values recited sort algorithm or alphabet sequence sort algorithm) to all first values in described first value array.
In a preferred implementation of the present embodiment, the second value array in above-mentioned set identification concordance list " key " has carried out the subordinate ordered array of sorting operation according to sort algorithm (such as, by numerical values recited sort algorithm or alphabet sequence sort algorithm) to all second values in described second value array.
In a preferred implementation of the present embodiment, above-mentioned Hash table database is distributed data base, and the server of Hash table database described in trustship comprises two or multiple stage database server being linked together by network (such as by wide area network, Metropolitan Area Network (MAN) or LAN (Local Area Network)).
The method of the second embodiment of the present invention key assignments update method by combining on a kind of basis of new Hash table database structure this Hash table database, achieves the high concurrency of Data Update operation under Internet scene and low retardance.
Figure 7 illustrates the third embodiment of the present invention.
Fig. 7 is the realization flow 700 deleting the method for key assignments in Hash table database according to a third embodiment of the present invention, and details are as follows for this realization flow 700:
In step 701, receive the deletion key assignments request of the collective data table to Hash table database.
In the third embodiment, the deletion key assignments request statement that the server of trustship above-mentioned Hash table database can directly provide from local reading database slip-stick artist in advance or document, or deletion key assignments request statement or the document of other position (such as client location) remotely can be read by cable network or wireless network.Wherein, the request of described deletion key assignments comprises: the first key to be deleted, namely gathers the title will carrying out the specific collection classification of deletion action of table " set ", supposes that it is " set_name_delete " at this; First value to be deleted, namely gathers the specific collection mark will carrying out deletion action of table " set ", supposes that it is " key1_delete " at this; Second value to be deleted, i.e. at this, the specific collection Data Identification that will carry out deletion action of set identification concordance list " key ", supposes that it is " key2_delete "; Attribute field title to be deleted, namely at this, the specific attribute field title will carrying out deletion action of aggregate attribute concordance list " attribute ", supposes that it is " attribute_name_delete "; Attribute field data to be deleted, the name namely will carrying out deletion action is called the value of the attribute field of " attribute_name_delete ", supposes that it is " attribute_value_delete " at this.
In the present embodiment, above-mentioned wireless network includes but not limited to based on 3G technology, based on WiFi technology, based on Bluetooth technology, based on WiMAX technology, based on ZigBee technology, based on UWB (ultrawideband) technology or based on the wireless network of other future by the wireless technology of exploitation.
In a step 702, deletion action is carried out to collective data table.
In the third embodiment, above-mentioned first key " set_name_delete " to be deleted, above-mentioned first value " key1_delete " to be deleted and above-mentioned second value " key2_delete " to be deleted constitute the quadruple linkage in above-mentioned collective data table " data ".In this step, the server of trustship above-mentioned Hash table database, in described collective data table " data ", is deleted the corresponding with described quadruple linkage the 4th and is worth array.
In step 703, deletion action is carried out to aggregate attribute concordance list.
In the third embodiment, above-mentioned first key " set_name_delete " to be deleted, above-mentioned first value " key1_delete " to be deleted and above-mentioned attribute field title " attribute_name_delete " to be deleted constitute the triple bond in above-mentioned aggregate attribute concordance list " attribute ", and above-mentioned second value " key2_delete " to be deleted and above-mentioned attribute field data " attribute_value_delete " to be deleted constitute the 3rd value in described aggregate attribute concordance list " attribute ".In this step, the server of trustship above-mentioned Hash table database in described aggregate attribute concordance list " attribute ", the corresponding with described triple bond the 3rd be worth in array, delete described 3rd value.
In step 704, deletion action is carried out to set identification concordance list.
In the third embodiment, above-mentioned first key " set_name_delete " to be deleted and above-mentioned first value " key1_delete " to be deleted constitute the second key in above-mentioned set identification concordance list " key ".In this step, the server of trustship above-mentioned Hash table database in described set identification concordance list " key ", corresponding with described second key second to be worth in array, delete above-mentioned second value " key2_delete " to be deleted.
So far, complete the key assignments of the above-mentioned collective data table " data " of Hash table database is deleted.
In a preferred implementation of the present embodiment, after above-mentioned steps 704, also comprise the steps 705 and 706 (not shown) further.
In step 705, judge whether the array length of the second value array that the second key of forming with by above-mentioned first key to be deleted and above-mentioned first value to be deleted in above-mentioned set identification concordance list is corresponding is zero.
In this step, after the server of the above-mentioned Hash table database of trustship carries out deletion action to set identification concordance list " key " in step 704, judge whether the array length of the second value array that the second key of forming with by above-mentioned first key " set_name_delete " to be deleted and above-mentioned first value " key1_delete " to be deleted in described set identification concordance list " key " is corresponding is zero.When described array length is zero, this realization flow 700 jumps to step 706 further.
In step 706, deletion action is carried out to set table and set identification concordance list.
In this step, the server of trustship above-mentioned Hash table database will carry out following operation: in the first 1) in above-mentioned set table " set ", corresponding with above-mentioned first key " set_name_delete " to be deleted value array, delete above-mentioned first value " key1_delete " to be deleted; 2) delete such key-value pair in the above-mentioned set identification concordance list " key ", this key-value pair comprises the second key (key as this key-value pair) and the second value array (value as this key-value pair) corresponding with described second key that described first key " set_name_delete " to be deleted and described first value " key1_delete " to be deleted form.
In a preferred implementation of the present embodiment, the first value array in above-mentioned set table " set " has carried out the subordinate ordered array of sorting operation according to sort algorithm (such as, by numerical values recited sort algorithm or alphabet sequence sort algorithm) to all first values in described first value array.
In a preferred implementation of the present embodiment, the second value array in above-mentioned set identification concordance list " key " has carried out the subordinate ordered array of sorting operation according to sort algorithm (such as, by numerical values recited sort algorithm or alphabet sequence sort algorithm) to all second values in described second value array.
In a preferred implementation of the present embodiment, above-mentioned Hash table database is distributed data base, and the server of Hash table database described in trustship comprises two or multiple stage database server being linked together by network (such as by wide area network, Metropolitan Area Network (MAN) or LAN (Local Area Network)).
The method of the third embodiment of the present invention key assignments delet method by combining on a kind of basis of new Hash table database structure this Hash table database, achieves the high concurrency of data deletion action under Internet scene and low retardance.
Figure 8 illustrates the fourth embodiment of the present invention.
Fig. 8 is the realization flow 800 reading the method for key assignments in Hash table database according to a fourth embodiment of the present invention, and details are as follows for this realization flow 800:
In step 801, the reading key assignments request of the above-mentioned collective data table to above-mentioned Hash table database is received.
In the fourth embodiment, the reading key assignments request statement that the server of trustship above-mentioned Hash table database can directly provide from local reading database slip-stick artist in advance or document, or reading key assignments request statement or the document of other position (such as client location) remotely can be read by cable network or wireless network.Wherein, the request of described reading key assignments comprises: the first key to be read, namely gathers the title will carrying out the specific collection classification of read operation of table " set ", supposes that it is " set_name_read " at this; First value to be read, namely gathers the specific collection mark will carrying out read operation of table " set ", supposes that it is " key1_read " at this; Second value to be read, i.e. at this, the specific collection Data Identification that will carry out read operation of set identification concordance list " key ", supposes that it is " key2_read ".
In the present embodiment, above-mentioned wireless network includes but not limited to based on 3G technology, based on WiFi technology, based on Bluetooth technology, based on WiMAX technology, based on ZigBee technology, based on UWB (ultrawideband) technology or based on the wireless network of other future by the wireless technology of exploitation.
In step 802, read operation is carried out to collective data table.
In the fourth embodiment, above-mentioned first key " set_name_read " to be read, above-mentioned first value " key1_read " to be read and above-mentioned second value " key2_read " to be read constitute the quadruple linkage in above-mentioned collective data table " data ".In this step, the server of trustship above-mentioned Hash table database reads and obtains the four value array corresponding with described quadruple linkage in described collective data table " data ".
The method of the fourth embodiment of the present invention gives a kind of method read the key assignments of this Hash table database on basis of new Hash table database structure, thus achieves the high concurrency of data read operation under Internet scene and low retardance.
Figure 9 illustrates the fifth embodiment of the present invention.
Fig. 9 is the realization flow 900 reading the method for key assignments in Hash table database according to a fifth embodiment of the present invention, and details are as follows for this realization flow 900:
In step 901, the reading key assignments request of the above-mentioned collective data table to above-mentioned Hash table database is received.
In the 5th embodiment, the reading key assignments request statement that the server of trustship above-mentioned Hash table database can directly provide from local reading database slip-stick artist in advance or document, or reading key assignments request statement or the document of other position (such as client location) remotely can be read by cable network or wireless network.Wherein, the request of described reading key assignments comprises: the first key to be read, namely gathers the title will carrying out the specific collection classification of read operation of table " set ", supposes that it is " set_name_read " at this; First value to be read, namely gathers the specific collection mark will carrying out read operation of table " set ", supposes that it is " key1_read " at this; Attribute field title to be read, namely at this, the specific attribute field title will carrying out read operation of aggregate attribute concordance list " attribute ", supposes that it is " attribute_name_read "; Attribute field data to be read, the name namely will carrying out read operation is called the value of the attribute field of " attribute_name_read ", supposes that it is " attribute_value_read " at this.
In the present embodiment, above-mentioned wireless network includes but not limited to based on 3G technology, based on WiFi technology, based on Bluetooth technology, based on WiMAX technology, based on ZigBee technology, based on UWB (ultrawideband) technology or based on the wireless network of other future by the wireless technology of exploitation.
In step 902, from above-mentioned aggregate attribute concordance list, obtain the second value to be read.
In the 5th embodiment, above-mentioned first key " set_name_read " to be read, above-mentioned first value " key1_read " to be read and above-mentioned attribute field title " attribute_name_read " to be read constitute the triple bond in above-mentioned aggregate attribute concordance list " attribute ".In this step, the server of trustship above-mentioned Hash table database will proceed as follows: in the 3rd 1) in described aggregate attribute concordance list " attribute ", corresponding with described triple bond value array, and inquiry obtains to be checked three value corresponding with above-mentioned attribute field data " attribute_value_read " to be read; 2) because the 3rd value in aggregate attribute concordance list " attribute " is made up of the attribute field data under the second value and attribute field title, so its second value comprised can be obtained as the second value to be read according to described 3rd value to be checked.
In step 903, read operation is carried out to collective data table.
In the 5th embodiment, the second value to be read obtained in above-mentioned first key " set_name_read " to be read, above-mentioned first value " key1_read " to be read and step 902 constitutes the quadruple linkage in above-mentioned collective data table " data ".In this step, the server of trustship above-mentioned Hash table database reads and obtains the four value array corresponding with described quadruple linkage in described collective data table " data ".
The method of the fifth embodiment of the present invention gives a kind of method read the key assignments of this Hash table database on basis of new Hash table database structure, thus achieves the high concurrency of data read operation under Internet scene and low retardance.
Figure 10 illustrates the sixth embodiment of the present invention.
Figure 10 is the realization flow 1000 reading the method for key assignments in Hash table database according to a sixth embodiment of the present invention, and details are as follows for this realization flow 1000:
In step 1001, receive the reading key assignments request of the above-mentioned collective data table to above-mentioned Hash table database.
In the sixth embodiment, the reading key assignments request statement that the server of trustship above-mentioned Hash table database can directly provide from local reading database slip-stick artist in advance or document, or reading key assignments request statement or the document of other position (such as client location) remotely can be read by cable network or wireless network.Wherein, the request of described reading key assignments comprises: the first key to be read, namely gathers the title will carrying out the specific collection classification of read operation of table " set ", supposes that it is " set_name_read " at this; First value to be read, namely gathers the specific collection mark will carrying out read operation of table " set ", supposes that it is " key1_read " at this.
In the present embodiment, above-mentioned wireless network includes but not limited to based on 3G technology, based on WiFi technology, based on Bluetooth technology, based on WiMAX technology, based on ZigBee technology, based on UWB (ultrawideband) technology or based on the wireless network of other future by the wireless technology of exploitation.
In step 1002, query manipulation is carried out to set identification concordance list.
In the sixth embodiment, above-mentioned first key " set_name_read " to be read and above-mentioned first value " key1_read " to be read constitute the second key in above-mentioned set identification concordance list " key ".In this step, the server of trustship above-mentioned Hash table database is in described set identification concordance list " key ", and inquiry obtains the second value array corresponding with described second key as the second value array to be read.
In step 1003, read operation is carried out to collective data table.
In the sixth embodiment, any one single second value to be read of inquiring about in above-mentioned first key " set_name_read " to be read, above-mentioned first value " key1_read " to be read and step 1002 in the second value array to be read obtained can form the quadruple linkage in above-mentioned collective data table " data ", wherein, the number of the quadruple linkage formed equals the number of the second value to be read in the second value array to be read.In this step, the server of trustship above-mentioned Hash table database reads and obtains each four value array corresponding with each quadruple linkage in described collective data table " data ".
The method of the sixth embodiment of the present invention gives a kind of method read the key assignments of this Hash table database on basis of new Hash table database structure, thus achieves the high concurrency of data read operation under Internet scene and low retardance.
Figure 11 shows the seventh embodiment of the present invention.
Figure 11 is the structural representation inserting the device of key assignments in Hash table database according to a seventh embodiment of the present invention.As shown in figure 11, the device 1100 inserting key assignments in Hash table database described in the present embodiment comprises: receiver module 1101, judge module 1102, set identification concordance list insert module 1103, aggregate attribute concordance list insert module 1104 and collective data table insert module 1105.
In the present embodiment, the insertion key assignments request statement that the receiver module 1101 of said apparatus 1100 can directly provide from local reading database slip-stick artist in advance or document, or insertion key assignments request statement or the document of other position (such as client location) remotely can be read by cable network or wireless network.Wherein, the insertion key assignments request of the collective data table of above-mentioned Hash table database is comprised: be inserted into the first key, namely gather the title will carrying out the specific collection classification of update of table " set ", suppose that it is " set_name_insert " at this; Be inserted into the first value, namely gather the specific collection mark will carrying out update of table " set ", suppose that it is " key1_insert " at this; Be inserted into the second value, i.e. the specific collection Data Identification that will carry out update of set identification concordance list " key ", suppose that it is " key2_insert " at this; Be inserted into attribute field title, namely at this, the specific attribute field title will carrying out update of aggregate attribute concordance list " attribute ", supposes that it is " attribute_name_insert "; Be inserted into attribute field data, the name namely will carrying out update is called the value of the attribute field of " attribute_name_insert ", supposes that it is " attribute_value_insert " at this; Be inserted into the 4th value, namely will be inserted into the data record in collective data table " data ".
In the present embodiment, above-mentioned wireless network includes but not limited to based on 3G technology, based on WiFi technology, based on Bluetooth technology, based on WiMAX technology, based on ZigBee technology, based on UWB (ultrawideband) technology or based on the wireless network of other future by the wireless technology of exploitation.
Afterwards, the judge module 1102 of said apparatus 1100 judge whether to exist in set identification concordance list " key " comprise in the above-mentioned insertion key assignments request received by receiver module 1101 be inserted into the first key and be inserted into the second key that the first value forms.That is, described judge module 1102 will judge in set identification concordance list " key ", whether there is the second key (in the present embodiment, give tacit consent to exist in the set table " set " described in be inserted into the first key " set_name_insert ") be made up of " set_name_insert " and " key1_insert ":
If there is no, then represent in set table " set ", there is not set identification " key1_insert ", thus, above-mentioned judge module 1102 will carry out following operation: first, be inserted into described in above-mentioned set table " set " in the described first value array corresponding to the first key " set_name_insert " insert described in be inserted into the first value " key1_insert "; Secondly, in above-mentioned set identification concordance list " key ", insertion is inserted into the first key " set_name_insert " and described the second key being inserted into the first value " key1_insert " and forming by described.
If existed, then represent to there is set identification " key1_insert " in set table " set ", then directly jump to following set identification concordance list insert module 1103 from above-mentioned judge module 1102.
In the present embodiment, the set identification concordance list insert module 1103 of said apparatus 1100 is for carrying out update to above-mentioned set identification concordance list " key ".What comprise in the request of above-mentioned insertion key assignments is above-mentionedly inserted into the first key " set_name_insert " and above-mentioned the first value " key1_insert " that is inserted into constitutes the second key in described set identification concordance list " key ".Described set identification concordance list insert module 1103 in described set identification concordance list " key ", insert in corresponding with described second key the second value array and be above-mentionedly inserted into the second value " key2_insert ".
In the present embodiment, the aggregate attribute concordance list insert module 1104 of said apparatus 1100 is for carrying out update to above-mentioned aggregate attribute concordance list " attribute ".What comprise in the request of above-mentioned insertion key assignments is above-mentionedly inserted into the first key " set_name_insert ", is above-mentionedly inserted into the first value " key1_insert " and the above-mentioned attribute field title " attribute_name_insert " that is inserted into constitutes triple bond in above-mentioned aggregate attribute concordance list " attribute ".Described aggregate attribute concordance list insert module 1104 in described aggregate attribute concordance list " attribute ", insert in corresponding with described triple bond the 3rd value array by above-mentioned be inserted into the second value " key2_insert " and above-mentioned be inserted into that attribute field data " attribute_value_insert " (namely name is called the value being inserted into attribute field of " attribute_name_insert ") form be inserted into the 3rd value.
In the present embodiment, the collective data table insert module 1105 of said apparatus 1100 is for carrying out update to above-mentioned collective data table " data ".What comprise in the request of above-mentioned insertion key assignments is above-mentionedly inserted into the first key " set_name_insert ", is above-mentionedly inserted into the first value " key1_insert " and above-mentioned the second value " key2_insert " that is inserted into constitutes quadruple linkage in above-mentioned collective data table " data ".Described collective data table insert module 1105 in described collective data table " data ", insert in corresponding with described quadruple linkage the 4th value array described in be inserted into the 4th value.
So far, complete the key assignments of the above-mentioned collective data table " data " of Hash table database is inserted.
In a preferred implementation of the present embodiment, the first value array in above-mentioned set table " set " has carried out the subordinate ordered array of sorting operation according to sort algorithm (such as, by numerical values recited sort algorithm or alphabet sequence sort algorithm) to all first values in described first value array.As the preferred mode of one, all first values in the first value array have passed through sorting operation, above-mentioned judge module 1102 comprises further: according to the sort algorithm applied described first value array, show to be inserted into described in " set " in the described first value array corresponding to the first key to insert in order in described set and be inserted into the first value, wherein, described orderly insertion is inserted into the first value and refers to: be inserted into after the first value is inserted into described first value array described, the order of each the first value in the first new value array obtained still meets the sequence requirement based on described sort algorithm.The benefit that all first values in described first value array carry out sorting operation is, when described first value array is subordinate ordered array, can by means of the fast finding algorithm of binary chop and so on, fast finding is carried out to specific first value in described first value array, in addition, can also improve described first value array is carried out insertion, amendment, deletion action efficiency.
In a preferred implementation of the present embodiment, the second value array in above-mentioned set identification concordance list " key " has carried out the subordinate ordered array of sorting operation according to sort algorithm (such as, by numerical values recited sort algorithm or alphabet sequence sort algorithm) to all second values in described second value array.As the preferred mode of one, all second values in the second value array have passed through sorting operation, above-mentioned set identification concordance list insert module 1103 comprises: according to the sort algorithm applied described second value array, in described set identification concordance list " key ", with by be inserted into the first key and be inserted in the second value array corresponding to the second key that the first value forms orderly insert described in be inserted into the second value, wherein, described orderly insertion is inserted into the second value and refers to: be inserted into after the second value is inserted into described second value array described, the order of each the second value in the second new value array obtained still meets the sequence requirement based on described sort algorithm.The benefit that all second values in described second value array carry out sorting operation is, when described second value array is subordinate ordered array, can by means of the fast finding algorithm of binary chop and so on, fast finding is carried out to specific second value in described second value array, in addition, can also improve described second value array is carried out insertion, amendment, deletion action efficiency.
In a preferred implementation of the present embodiment, above-mentioned Hash table database is distributed data base, and the server of Hash table database described in trustship comprises two or multiple stage database server being linked together by network (such as by wide area network, Metropolitan Area Network (MAN) or LAN (Local Area Network)).
The device of the seventh embodiment of the present invention, by realizing inserting the key assignments of this Hash table database for a kind of new Hash table database structure, meets the high concurrency of data write operation under Internet scene and low retardance.
Figure 12 shows the eighth embodiment of the present invention.
Figure 12 is the structural representation upgrading the device of key assignments in Hash table database according to a eighth embodiment of the present invention.As shown in figure 12, the device 1200 upgrading key assignments in Hash table database described in the present embodiment comprises: receiver module 1201, aggregate attribute concordance list processing module 1202 and collective data table handing module 1203.
In the present embodiment, the renewal key assignments request statement that the receiver module 1201 of said apparatus 1200 can directly provide from local reading database slip-stick artist in advance or document, or renewal key assignments request statement or the document of other position (such as client location) remotely can be read by cable network or wireless network.Wherein, the renewal key assignments request of the collective data table of above-mentioned Hash table database is comprised: the first key to be updated, namely gather the title will carrying out the specific collection classification of renewal rewards theory of table " set ", suppose that it is " set_name_update " at this; First value to be updated, namely gathers the specific collection mark will carrying out renewal rewards theory of table " set ", supposes that it is " key1_update " at this; Second value to be updated, i.e. at this, the specific collection Data Identification that will carry out renewal rewards theory of set identification concordance list " key ", supposes that it is " key2_update "; Attribute field title to be updated, namely at this, the specific attribute field title will carrying out renewal rewards theory of aggregate attribute concordance list " attribute ", supposes that it is " attribute_name_update "; Primitive attribute field data under described attribute field title to be updated, the name namely will carrying out renewal rewards theory is called the original value of the attribute field of " attribute_name_update ", supposes that it is " attribute_valueOrigin_update " at this; Attribute field data to be updated under described attribute field title to be updated, the name namely will carrying out renewal rewards theory is called the value to be updated of the attribute field of " attribute_name_update ", supposes that it is " attribute_valueNew_update " at this; 4th value to be updated, namely will be inserted into the data record in collective data table " data ".
In the present embodiment, above-mentioned wireless network includes but not limited to based on 3G technology, based on WiFi technology, based on Bluetooth technology, based on WiMAX technology, based on ZigBee technology, based on UWB (ultrawideband) technology or based on the wireless network of other future by the wireless technology of exploitation.
In the present embodiment, after receiver module 1201 receives the request of renewal key assignments, the aggregate attribute concordance list processing module 1202 of said apparatus 1200 is handled as follows above-mentioned aggregate attribute concordance list " attribute ".Due to the first key " set_name_update " above-mentioned to be updated comprised in the request of described renewal key assignments, above-mentioned first value " key1_update " to be updated and above-mentioned attribute field title " attribute_name_update " to be updated constitute the triple bond in described aggregate attribute concordance list " attribute ", at this, described aggregate attribute concordance list processing module 1202 is incited somebody to action: 1) in described aggregate attribute concordance list " attribute ", corresponding with described triple bond the 3rd is worth in array, delete the 3rd value be made up of above-mentioned second value " key2_update " to be updated and above-mentioned primitive attribute field data " attribute_valueOrigin_update ", 2) in described 3rd value array, the 3rd value be made up of described second value " key2_update " to be updated and described attribute field data " attribute_valueNew_update " to be updated is inserted.
In the present embodiment, the collective data table handing module 1203 of said apparatus 1200 is for processing above-mentioned collective data table " data ".The first key " set_name_update " above-mentioned to be updated comprised in the request of above-mentioned renewal key assignments, above-mentioned first value " key1_update " to be updated and above-mentioned second value " key2_update " to be updated constitute the quadruple linkage in described collective data table " data ".Described collective data table handing module 1203 in described collective data table " data ", the corresponding with described quadruple linkage the 4th be worth in array, utilize above-mentioned 4th value to be updated to replace the 4th original accordingly value.
In a preferred implementation of the present embodiment, the first value array in above-mentioned set table " set " has carried out the subordinate ordered array of sorting operation according to sort algorithm (such as, by numerical values recited sort algorithm or alphabet sequence sort algorithm) to all first values in described first value array.
In a preferred implementation of the present embodiment, the second value array in above-mentioned set identification concordance list " key " has carried out the subordinate ordered array of sorting operation according to sort algorithm (such as, by numerical values recited sort algorithm or alphabet sequence sort algorithm) to all second values in described second value array.
In a preferred implementation of the present embodiment, above-mentioned Hash table database is distributed data base, and the server of Hash table database described in trustship comprises two or multiple stage database server being linked together by network (such as by wide area network, Metropolitan Area Network (MAN) or LAN (Local Area Network)).
The device of the eighth embodiment of the present invention, by realizing upgrading the key assignments of this Hash table database for a kind of new Hash table database structure, meets high concurrency and low retardance that Data Update under Internet scene operates.
Figure 13 shows the ninth embodiment of the present invention.
Figure 13 is the structural representation deleting the device of key assignments in Hash table database according to a ninth embodiment of the present invention.As shown in figure 13, the device 1300 deleting key assignments in Hash table database described in the present embodiment comprises: receiver module 1301, collective data list deletion module 1302, aggregate attribute concordance list removing module 1303 and set identification concordance list removing module 1304.
In the present embodiment, the deletion key assignments request statement that the receiver module 1301 of said apparatus 1300 can directly provide from local reading database slip-stick artist in advance or document, or deletion key assignments request statement or the document of other position (such as client location) remotely can be read by cable network or wireless network.Wherein, the request of described deletion key assignments comprises: the first key to be deleted, namely gathers the title will carrying out the specific collection classification of deletion action of table " set ", supposes that it is " set_name_delete " at this; First value to be deleted, namely gathers the specific collection mark will carrying out deletion action of table " set ", supposes that it is " key1_delete " at this; Second value to be deleted, i.e. at this, the specific collection Data Identification that will carry out deletion action of set identification concordance list " key ", supposes that it is " key2_delete "; Attribute field title to be deleted, namely at this, the specific attribute field title will carrying out deletion action of aggregate attribute concordance list " attribute ", supposes that it is " attribute_name_delete "; Attribute field data to be deleted, the name namely will carrying out deletion action is called the value of the attribute field of " attribute_name_delete ", supposes that it is " attribute_value_delete " at this.
In the present embodiment, above-mentioned wireless network includes but not limited to based on 3G technology, based on WiFi technology, based on Bluetooth technology, based on WiMAX technology, based on ZigBee technology, based on UWB (ultrawideband) technology or based on the wireless network of other future by the wireless technology of exploitation.
In the present embodiment, the first key " set_name_delete " above-mentioned to be deleted comprised in the above-mentioned deletion key assignments request that receiver module 1301 receives, above-mentioned first value " key1_delete " to be deleted and above-mentioned second value " key2_delete " to be deleted constitute the quadruple linkage in above-mentioned collective data table " data ".In this step, the collective data list deletion module 1302 of said apparatus 1300, in described collective data table " data ", is deleted the corresponding with described quadruple linkage the 4th and is worth array.
In the present embodiment, the first key " set_name_delete " above-mentioned to be deleted comprised in the above-mentioned deletion key assignments request that receiver module 1301 receives, above-mentioned first value " key1_delete " to be deleted and above-mentioned attribute field title " attribute_name_delete " to be deleted constitute the triple bond in above-mentioned aggregate attribute concordance list " attribute ", above-mentioned second value " key2_delete " to be deleted and above-mentioned attribute field data " attribute_value_delete " to be deleted constitute the 3rd value in described aggregate attribute concordance list " attribute ".The aggregate attribute concordance list removing module 1303 of said apparatus 1300 in described aggregate attribute concordance list " attribute ", the corresponding with described triple bond the 3rd be worth in array, delete described 3rd value.
In the present embodiment, the first key " set_name_delete " above-mentioned to be deleted comprised in the above-mentioned deletion key assignments request that receiver module 1301 receives and above-mentioned first value " key1_delete " to be deleted constitute the second key in above-mentioned set identification concordance list " key ".The set identification concordance list removing module 1304 of said apparatus 1300 in described set identification concordance list " key ", corresponding with described second key second to be worth in array, delete above-mentioned second value " key2_delete " to be deleted.
In a preferred implementation of the present embodiment, said apparatus 1300 also comprises judge module 1305 further and deletes submodule 1306 (not shown).Described judge module 1305, for after carrying out deletion action above-mentioned set identification concordance list removing module 1304 pairs of set identification concordance lists " key ", judges whether the array length of the second value array that the second key of forming with by above-mentioned first key " set_name_delete " to be deleted and above-mentioned first value " key1_delete " to be deleted in described set identification concordance list " key " is corresponding is zero.When described array length is zero, described device 1300 calls described deletion submodule 1306 further.Described deletion submodule 1306 is for carrying out following operation: in the first 1) in above-mentioned set table " set ", corresponding with above-mentioned first key " set_name_delete " to be deleted value array, deletes above-mentioned first value " key1_delete " to be deleted; 2) delete such key-value pair in the above-mentioned set identification concordance list " key ", this key-value pair comprises the second key (key as this key-value pair) and the second value array (value as this key-value pair) corresponding with described second key that described first key " set_name_delete " to be deleted and described first value " key1_delete " to be deleted form.
In a preferred implementation of the present embodiment, the first value array in above-mentioned set table " set " has carried out the subordinate ordered array of sorting operation according to sort algorithm (such as, by numerical values recited sort algorithm or alphabet sequence sort algorithm) to all first values in described first value array.
In a preferred implementation of the present embodiment, the second value array in above-mentioned set identification concordance list " key " has carried out the subordinate ordered array of sorting operation according to sort algorithm (such as, by numerical values recited sort algorithm or alphabet sequence sort algorithm) to all second values in described second value array.
In a preferred implementation of the present embodiment, above-mentioned Hash table database is distributed data base, and the server of Hash table database described in trustship comprises two or multiple stage database server being linked together by network (such as by wide area network, Metropolitan Area Network (MAN) or LAN (Local Area Network)).
The device of the ninth embodiment of the present invention, by realizing deleting the key assignments of this Hash table database for a kind of new Hash table database structure, meets the high concurrency of data deletion action under Internet scene and low retardance.
Figure 14 shows the tenth embodiment of the present invention.
Figure 14 is the structural representation reading the device of key assignments in Hash table database according to a tenth embodiment of the present invention.As shown in figure 14, the device 1400 reading key assignments in Hash table database described in the present embodiment comprises: receiver module 1401 and read module 1402.
In the present embodiment, the reading key assignments request statement that the receiver module 1401 of said apparatus 1400 can directly provide from local reading database slip-stick artist in advance or document, or reading key assignments request statement or the document of other position (such as client location) remotely can be read by cable network or wireless network.Wherein, the request of described reading key assignments comprises: the first key to be read, namely gathers the title will carrying out the specific collection classification of read operation of table " set ", supposes that it is " set_name_read " at this; First value to be read, namely gathers the specific collection mark will carrying out read operation of table " set ", supposes that it is " key1_read " at this; Second value to be read, i.e. at this, the specific collection Data Identification that will carry out read operation of set identification concordance list " key ", supposes that it is " key2_read ".
In the present embodiment, above-mentioned wireless network includes but not limited to based on 3G technology, based on WiFi technology, based on Bluetooth technology, based on WiMAX technology, based on ZigBee technology, based on UWB (ultrawideband) technology or based on the wireless network of other future by the wireless technology of exploitation.
In the tenth embodiment, the first key " set_name_read " above-mentioned to be read comprised in the above-mentioned reading key assignments request that the receiver module 1401 of said apparatus 1400 receives, above-mentioned first value " key1_read " to be read and above-mentioned second value " key2_read " to be read constitute the quadruple linkage in above-mentioned collective data table " data ".The read module 1402 of said apparatus 1400 reads subsequently and obtains the four value array corresponding with described quadruple linkage in described collective data table " data ".
The device of the tenth embodiment of the present invention, by realizing reading the key assignments of this Hash table database for a kind of new Hash table database structure, meets the high concurrency of data read operation under Internet scene and low retardance.
Figure 15 shows the 11st embodiment of the present invention.
Figure 15 is the structural representation reading the device of key assignments in Hash table database according to a 11th embodiment of the present invention.As shown in figure 15, the device 1500 reading key assignments in Hash table database described in the present embodiment comprises: receiver module 1501, the second value acquisition module 1502 and read module 1503.
In the 11 embodiment, the reading key assignments request statement that the receiver module 1501 of said apparatus 1500 can directly provide from local reading database slip-stick artist in advance or document, or reading key assignments request statement or the document of other position (such as client location) remotely can be read by cable network or wireless network.Wherein, the request of described reading key assignments comprises: the first key to be read, namely gathers the title will carrying out the specific collection classification of read operation of table " set ", supposes that it is " set_name_read " at this; First value to be read, namely gathers the specific collection mark will carrying out read operation of table " set ", supposes that it is " key1_read " at this; Attribute field title to be read, namely at this, the specific attribute field title will carrying out read operation of aggregate attribute concordance list " attribute ", supposes that it is " attribute_name_read "; Attribute field data to be read, the name namely will carrying out read operation is called the value of the attribute field of " attribute_name_read ", supposes that it is " attribute_value_read " at this.
In the present embodiment, above-mentioned wireless network includes but not limited to based on 3G technology, based on WiFi technology, based on Bluetooth technology, based on WiMAX technology, based on ZigBee technology, based on UWB (ultrawideband) technology or based on the wireless network of other future by the wireless technology of exploitation.
In the present embodiment, the first key " set_name_read " above-mentioned to be read comprised in the above-mentioned reading key assignments request that the receiver module 1501 of said apparatus 1500 receives, above-mentioned first value " key1_read " to be read and above-mentioned attribute field title " attribute_name_read " to be read constitute the triple bond in above-mentioned aggregate attribute concordance list " attribute ".Second value acquisition module 1502 of said apparatus 1500 will proceed as follows: in the 3rd 1) in described aggregate attribute concordance list " attribute ", corresponding with described triple bond value array, and inquiry obtains to be checked three value corresponding with above-mentioned attribute field data " attribute_value_read " to be read; 2) because the 3rd value in aggregate attribute concordance list " attribute " is made up of the attribute field data under the second value and attribute field title, so its second value comprised can be obtained as the second value to be read according to described 3rd value to be checked.
In the present embodiment, the second value to be read that above-mentioned first key " set_name_read " to be read, above-mentioned first value " key1_read " to be read and above-mentioned second value acquisition module 1502 obtain constitutes the quadruple linkage in above-mentioned collective data table " data ".The read module 1503 of said apparatus 1500 reads and obtains the four value array corresponding with described quadruple linkage in described collective data table " data ".
The device of the 11st embodiment of the present invention, by realizing reading the key assignments of this Hash table database for a kind of new Hash table database structure, meets the high concurrency of data read operation under Internet scene and low retardance.
Figure 16 shows the 12nd embodiment of the present invention.
Figure 16 is the structural representation reading the device of key assignments in Hash table database according to a 12th embodiment of the present invention.As shown in figure 16, the device 1600 reading key assignments in Hash table database described in the present embodiment comprises: receiver module 1601, enquiry module 1602 and read module 1603.
In the 12 embodiment, the reading key assignments request statement that the receiver module 1601 of said apparatus 1600 can directly provide from local reading database slip-stick artist in advance or document, or reading key assignments request statement or the document of other position (such as client location) remotely can be read by cable network or wireless network.Wherein, the request of described reading key assignments comprises: the first key to be read, namely gathers the title will carrying out the specific collection classification of read operation of table " set ", supposes that it is " set_name_read " at this; First value to be read, namely gathers the specific collection mark will carrying out read operation of table " set ", supposes that it is " key1_read " at this.
In the present embodiment, above-mentioned wireless network includes but not limited to based on 3G technology, based on WiFi technology, based on Bluetooth technology, based on WiMAX technology, based on ZigBee technology, based on UWB (ultrawideband) technology or based on the wireless network of other future by the wireless technology of exploitation.
In the present embodiment, the first key " set_name_read " above-mentioned to be read comprised in the above-mentioned reading key assignments request that the receiver module 1601 of said apparatus 1600 receives and above-mentioned first value " key1_read " to be read constitute the second key in above-mentioned set identification concordance list " key ".The enquiry module 1602 of said apparatus 1600 is in described set identification concordance list " key ", and inquiry obtains the second value array corresponding with described second key as the second value array to be read.
In the present embodiment, above-mentioned first key " set_name_read " to be read, above-mentioned first value " key1_read " to be read and above-mentioned enquiry module 1602 any one single second value to be read of inquiring about in the second value array to be read obtained can form the quadruple linkage in above-mentioned collective data table " data ", wherein, the number of the quadruple linkage formed equals the number of the second value to be read in the second value array to be read.The read module 1603 of said apparatus 1600 reads and obtains each four value array corresponding with each quadruple linkage in described collective data table " data ".
The device of the 12nd embodiment of the present invention, by realizing reading the key assignments of this Hash table database for a kind of new Hash table database structure, meets the high concurrency of data read operation under Internet scene and low retardance.
Device described in the present invention or client refer to desk-top computer, laptop computer, palm PC, personal digital assistant (PDA), hand-held electronic treating apparatus, smart mobile phone in conjunction with PDA and cell-phone function, guider, maybe can show data message (the data record of such as database) and any other electronic installation of automatic data processing information.Said apparatus or client can be configured to the server being connected to managed database by wired or wireless network further.
Technical solutions according to the invention can store collective data by the feature according to collective data self in each Hash table of Hash table database, and provide for the structure of each Hash table of described Hash table database method collective data inserted, upgrades, delete, read, thus under achieving Internet scene, gather the high concurrency of data manipulation and low retardance.In addition, based on the method for the described insertion of collective data, renewal, deletion, reading, the good extensibility of the storage to collective data can also be realized, such as, by reading the collective data stored in Hash table database, inserting, the operation of deletion etc., described collective data can be realized expediently from a Hash table database to the migration of another Hash table database.
Note, above are only preferred embodiment of the present invention and institute's application technology principle.Skilled person in the art will appreciate that and the invention is not restricted to specific embodiment described here, various obvious change can be carried out for a person skilled in the art, readjust and substitute and can not protection scope of the present invention be departed from.Therefore, although be described in further detail invention has been by above embodiment, the present invention is not limited only to above embodiment, when not departing from the present invention's design, can also comprise other Equivalent embodiments more, and scope of the present invention is determined by appended right.
Claims (42)
1. one kind is inserted the method for key assignments in Hash table database, it is characterized in that, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and the first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, the 3rd value is made up of the attribute field data under the second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by the 4th value;
Described method comprises the steps:
Receive the insertion key assignments request to the described collective data table of described Hash table database, wherein, the request of described insertion key assignments comprises: be inserted into the first key, be inserted into the first value, be inserted into the second value, be inserted into attribute field title, be inserted into attribute field data, be inserted into the 4th value;
Judge whether to exist in described set identification concordance list and be inserted into the first key and described the second key being inserted into the first value and forming by described, if there is no, then show in described set described in be inserted into corresponding to the first key described first value array in insert described in be inserted into the first value and insert in described set identification concordance list and be inserted into the first key and described the second key being inserted into the first value and forming by described; And if exist, then directly carry out following step;
In described set identification concordance list with by described be inserted into the first key and described be inserted in the second value array corresponding to the second key that the first value forms insert described in be inserted into the second value;
In described aggregate attribute concordance list with by described be inserted into the first key, described in be inserted into the first value and described be inserted in the 3rd value array corresponding to triple bond that attribute field title forms insert by described be inserted into the second value and described be inserted into that attribute field data form be inserted into the 3rd value;
In described collective data table with by described be inserted into the first key, described in be inserted into the first value and described be inserted in the 4th value array corresponding to quadruple linkage that the second value forms insert described in be inserted into the 4th value.
2. the method inserting key assignments in Hash table database according to claim 1, is characterized in that, described first value array has carried out the subordinate ordered array of sorting operation according to sort algorithm to all first values in described first value array.
3. the method inserting key assignments in Hash table database according to claim 2, it is characterized in that, described show in described set described in be inserted into corresponding to the first key described first value array in insert described in be inserted into the first value step comprise: according to the described sort algorithm to described first value array application, be inserted into described in showing in described set in the described first value array corresponding to the first key and be inserted into the first value described in orderly insertion.
4. the method inserting key assignments in Hash table database according to claim 1, is characterized in that, described second value array has carried out the subordinate ordered array of sorting operation according to sort algorithm to all second values in described second value array.
5. the method inserting key assignments in Hash table database according to claim 4, it is characterized in that, described in described set identification concordance list with by described be inserted into the first key and described be inserted in the second value array corresponding to the second key that the first value forms insert described in be inserted into the second value step comprise: according to the described sort algorithm applied described second value array, in described set identification concordance list with by described be inserted into the first key and described be inserted in the second value array corresponding to the second key that the first value forms insert in order described in be inserted into the second value.
6. the method inserting key assignments in Hash table database according to claim 2 or 4, it is characterized in that, described sort algorithm comprises: by numerical values recited sort algorithm or alphabet sequence sort algorithm.
7. the method inserting key assignments in Hash table database according to claim 1, is characterized in that, described Hash table database is distributed data base.
8. one kind upgrades the method for key assignments in Hash table database, it is characterized in that, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and the first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, the 3rd value is made up of the attribute field data under the second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by the 4th value;
Described method comprises the steps:
Receive the renewal key assignments request to the described collective data table of described Hash table database, wherein, the request of described renewal key assignments comprises: the primitive attribute field data under the first key to be updated, the first value to be updated, the second value to be updated, attribute field title to be updated, described attribute field title to be updated, the attribute field data to be updated under described attribute field title to be updated, the 4th value to be updated;
In the 3rd value array that the triple bond formed with by described first key to be updated, described first value to be updated and described attribute field title to be updated in described aggregate attribute concordance list is corresponding, first delete the 3rd value be made up of described second value to be updated and described primitive attribute field data, then insert the 3rd value be made up of described second value to be updated and described attribute field data to be updated;
In the 4th value array that the quadruple linkage formed with by described first key to be updated, described first value to be updated and described second value to be updated in described collective data table is corresponding, described 4th value to be updated is utilized to replace corresponding former 4th value.
9. the method upgrading key assignments in Hash table database according to claim 8, is characterized in that, described first value array has carried out the subordinate ordered array of sorting operation according to sort algorithm to all first values in described first value array.
10. the method upgrading key assignments in Hash table database according to claim 8, is characterized in that, described second value array has carried out the subordinate ordered array of sorting operation according to sort algorithm to all second values in described second value array.
11. methods upgrading key assignments in Hash table database according to claim 9 or 10, it is characterized in that, described sort algorithm comprises: by numerical values recited sort algorithm or alphabet sequence sort algorithm.
12. methods upgrading key assignments in Hash table database according to claim 8, is characterized in that, described Hash table database is distributed data base.
13. 1 kinds of methods of deleting key assignments in Hash table database, it is characterized in that, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and the first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, the 3rd value is made up of the attribute field data under the second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by the 4th value;
Described method comprises the steps:
Receive the deletion key assignments request to the described collective data table of described Hash table database, wherein, the request of described deletion key assignments comprises: the first key to be deleted, the first value to be deleted, the second value to be deleted, attribute field title to be deleted, attribute field data to be deleted;
In described collective data table, the 4th value array that the quadruple linkage that deletion is formed with by described first key to be deleted, described first value to be deleted and described second value to be deleted is corresponding;
In the 3rd value array that the triple bond formed with by described first key to be deleted, described first value to be deleted and described attribute field title to be deleted in described aggregate attribute concordance list is corresponding, delete the 3rd value be made up of described second value to be deleted and described attribute field data to be deleted;
In the second value array that the second key formed with by described first key to be deleted and described first value to be deleted in described set identification concordance list is corresponding, delete described second value to be deleted.
14. methods of deleting key assignments in Hash table database according to claim 13, it is characterized in that, further comprising the steps of after deleting the step of described second value to be deleted in the second value array that the second key formed with by described first key to be deleted and described first value to be deleted in described set identification concordance list is corresponding: whether the array length judging the second value array corresponding with the second key be made up of described first key to be deleted and described first value to be deleted in described set identification concordance list is zero, if be zero, then in described set table corresponding with described first key to be deleted first is worth in array, delete described first value to be deleted, and in described set identification concordance list, delete the key-value pair comprising described first key to be deleted and described second key of the first value formation to be deleted and the second value array corresponding to this second key.
15. methods of deleting key assignments in Hash table database according to claim 13, is characterized in that, described first value array has carried out the subordinate ordered array of sorting operation according to sort algorithm to all first values in described first value array.
16. methods of deleting key assignments in Hash table database according to claim 13, is characterized in that, described second value array has carried out the subordinate ordered array of sorting operation according to sort algorithm to all second values in described second value array.
17. methods of deleting key assignments in Hash table database according to claim 15 or 16, it is characterized in that, described sort algorithm comprises: by numerical values recited sort algorithm or alphabet sequence sort algorithm.
18. methods of deleting key assignments in Hash table database according to claim 13, is characterized in that, described Hash table database is distributed data base.
19. 1 kinds of methods reading key assignments in Hash table database, it is characterized in that, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and the first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, the 3rd value is made up of the attribute field data under the second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by the 4th value;
Described method comprises the steps:
Receive the reading key assignments request to the described collective data table of described Hash table database, wherein, the request of described reading key assignments comprises: the first key to be read, the first value to be read, the second value to be read;
In described collective data table, the 4th value array that the quadruple linkage that reading is formed with by described first key to be read, described first value to be read and described second value to be read is corresponding.
20. 1 kinds of methods reading key assignments in Hash table database, it is characterized in that, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and the first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, the 3rd value is made up of the attribute field data under the second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by the 4th value;
Described method comprises the steps:
Receive the reading key assignments request to the described collective data table of described Hash table database, wherein, the request of described reading key assignments comprises: the first key to be read, the first value to be read, attribute field title to be read, attribute field data to be read;
In the 3rd value array that the triple bond formed with by described first key to be read, described first value to be read and described attribute field title to be read in described aggregate attribute concordance list is corresponding, inquiry obtains to be checked three value corresponding with described attribute field data to be read, and obtains the second value as the second value to be read from described 3rd value to be checked;
In described collective data table, the 4th value array that the quadruple linkage that reading is formed with by described first key to be read, described first value to be read and described second value to be read is corresponding.
21. 1 kinds of methods reading key assignments in Hash table database, it is characterized in that, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and the first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, the 3rd value is made up of the attribute field data under the second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by the 4th value;
Described method comprises the steps:
Receive the reading key assignments request to the described collective data table of described Hash table database, wherein, the request of described reading key assignments comprises: the first key to be read and the first value to be read;
In described set identification concordance list, inquire about the second value array corresponding to the second key of obtaining forming with by described first key to be read and described first value to be read as the second value array to be read;
For each second value to be read in described second value array to be read, in described collective data table, the 4th value array that the quadruple linkage that reading is formed with by described first key to be read, described first value to be read and described second value to be read is corresponding.
22. 1 kinds of devices inserting key assignments in Hash table database, it is characterized in that, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and the first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, the 3rd value is made up of the attribute field data under the second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by the 4th value;
Described device comprises:
Receiver module, for receiving the insertion key assignments request of the described collective data table to described Hash table database, wherein, the request of described insertion key assignments comprises: be inserted into the first key, be inserted into the first value, be inserted into the second value, be inserted into attribute field title, be inserted into attribute field data, be inserted into the 4th value;
Judge module, the first key and described the second key being inserted into the first value and forming is inserted into by described for judging whether to exist in described set identification concordance list, if there is no, then show in described set described in be inserted into corresponding to the first key described first value array in insert described in be inserted into the first value and insert in described set identification concordance list and be inserted into the first key and described the second key being inserted into the first value and forming by described; And if exist, then directly call following module;
Set identification concordance list insert module, in described set identification concordance list with by described be inserted into the first key and described be inserted in the second value array corresponding to the second key that the first value forms insert described in be inserted into the second value;
Aggregate attribute concordance list insert module, in described aggregate attribute concordance list with by described be inserted into the first key, described in be inserted into the first value and described be inserted in the 3rd value array corresponding to triple bond that attribute field title forms insert by described be inserted into the second value and described be inserted into that attribute field data form be inserted into the 3rd value;
Collective data table insert module, in described collective data table with by described be inserted into the first key, described in be inserted into the first value and described be inserted in the 4th value array corresponding to quadruple linkage that the second value forms insert described in be inserted into the 4th value.
23. devices inserting key assignments in Hash table database according to claim 22, is characterized in that, described first value array has carried out the subordinate ordered array of sorting operation according to sort algorithm to all first values in described first value array.
24. devices inserting key assignments in Hash table database according to claim 23, it is characterized in that, described judge module comprises further: according to the described sort algorithm to described first value array application, is inserted in the described first value array corresponding to the first key described in inserting in order is inserted into the first value in described set described in showing.
25. devices inserting key assignments in Hash table database according to claim 22, is characterized in that, described second value array has carried out the subordinate ordered array of sorting operation according to sort algorithm to all second values in described second value array.
26. devices inserting key assignments in Hash table database according to claim 25, it is characterized in that, described set identification concordance list insert module comprises: according to the described sort algorithm to described second value array application, in described set identification concordance list with by described be inserted into the first key and described be inserted in the second value array corresponding to the second key that the first value forms orderly insert described in be inserted into the second value.
27. devices inserting key assignments in Hash table database according to claim 23 or 25, it is characterized in that, described sort algorithm comprises: by numerical values recited sort algorithm or alphabet sequence sort algorithm.
28. devices inserting key assignments in Hash table database according to claim 22, is characterized in that, described Hash table database is distributed data base.
29. 1 kinds of devices upgrading key assignments in Hash table database, it is characterized in that, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and the first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, the 3rd value is made up of the attribute field data under the second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by the 4th value;
Described device comprises:
Receiver module, for receiving the renewal key assignments request of the described collective data table to described Hash table database, wherein, the request of described renewal key assignments comprises: the primitive attribute field data under the first key to be updated, the first value to be updated, the second value to be updated, attribute field title to be updated, described attribute field title to be updated, the attribute field data to be updated under described attribute field title to be updated, the 4th value to be updated;
Aggregate attribute concordance list processing module, for in the 3rd value array that the triple bond formed with by described first key to be updated, described first value to be updated and described attribute field title to be updated in described aggregate attribute concordance list is corresponding, first delete the 3rd value be made up of described second value to be updated and described primitive attribute field data, then insert the 3rd value be made up of described second value to be updated and described attribute field data to be updated;
Collective data table handing module, for in the 4th value array that the quadruple linkage formed with by described first key to be updated, described first value to be updated and described second value to be updated in described collective data table is corresponding, described 4th value to be updated is utilized to replace corresponding former 4th value.
30. devices upgrading key assignments in Hash table database according to claim 29, is characterized in that, described first value array has carried out the subordinate ordered array of sorting operation according to sort algorithm to all first values in described first value array.
31. devices upgrading key assignments in Hash table database according to claim 29, is characterized in that, described second value array has carried out the subordinate ordered array of sorting operation according to sort algorithm to all second values in described second value array.
32. devices upgrading key assignments in Hash table database according to claim 30 or 31, it is characterized in that, described sort algorithm comprises: by numerical values recited sort algorithm or alphabet sequence sort algorithm.
33. devices upgrading key assignments in Hash table database according to claim 29, is characterized in that, described Hash table database is distributed data base.
34. 1 kinds of devices deleting key assignments in Hash table database, it is characterized in that, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and the first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, the 3rd value is made up of the attribute field data under the second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by the 4th value;
Described device comprises:
Receiver module, for receiving the deletion key assignments request of the described collective data table to described Hash table database, wherein, the request of described deletion key assignments comprises: the first key to be deleted, the first value to be deleted, the second value to be deleted, attribute field title to be deleted, attribute field data to be deleted;
Collective data list deletion module, in described collective data table, the 4th value array that the quadruple linkage that deletion is formed with by described first key to be deleted, described first value to be deleted and described second value to be deleted is corresponding;
Aggregate attribute concordance list removing module, for in the 3rd value array that the triple bond formed with by described first key to be deleted, described first value to be deleted and described attribute field title to be deleted in described aggregate attribute concordance list is corresponding, delete the 3rd value be made up of described second value to be deleted and described attribute field data to be deleted;
Set identification concordance list removing module, in the second value array that the second key formed with by described first key to be deleted and described first value to be deleted in described set identification concordance list is corresponding, deletes described second value to be deleted.
35. devices deleting key assignments in Hash table database according to claim 34, it is characterized in that, described device also comprises: judge module, for judging whether the array length of the second value array that the second key of forming with by described first key to be deleted and described first value to be deleted in described set identification concordance list is corresponding is zero, if be zero, then call deletion submodule, described deletion submodule is used for: in the first value array corresponding with described first key to be deleted in described set table, delete described first value to be deleted; And in described set identification concordance list, delete the key-value pair comprising described first key to be deleted and described second key of the first value formation to be deleted and the second value array corresponding to this second key.
36. devices deleting key assignments in Hash table database according to claim 34, is characterized in that, described first value array has carried out the subordinate ordered array of sorting operation according to sort algorithm to all first values in described first value array.
37. devices deleting key assignments in Hash table database according to claim 34, is characterized in that, described second value array has carried out the subordinate ordered array of sorting operation according to sort algorithm to all second values in described second value array.
38. devices deleting key assignments in Hash table database according to claim 36 or 37, it is characterized in that, described sort algorithm comprises: by numerical values recited sort algorithm or alphabet sequence sort algorithm.
39. devices deleting key assignments in Hash table database according to claim 34, is characterized in that, described Hash table database is distributed data base.
40. 1 kinds of devices reading key assignments in Hash table database, it is characterized in that, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and the first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, the 3rd value is made up of the attribute field data under the second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by the 4th value;
Described device comprises:
Receiver module, for receiving the reading key assignments request of the described collective data table to described Hash table database, wherein, the request of described reading key assignments comprises: the first key to be read, the first value to be read, the second value to be read;
Read module, in described collective data table, the 4th value array that the quadruple linkage that reading is formed with by described first key to be read, described first value to be read and described second value to be read is corresponding.
41. 1 kinds of devices reading key assignments in Hash table database, it is characterized in that, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and the first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, the 3rd value is made up of the attribute field data under the second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by the 4th value;
Described device comprises:
Receiver module, for receiving the reading key assignments request of the described collective data table to described Hash table database, wherein, the request of described reading key assignments comprises: the first key to be read, the first value to be read, attribute field title to be read, attribute field data to be read;
Second value acquisition module, for in the 3rd value array that the triple bond formed with by described first key to be read, described first value to be read and described attribute field title to be read in described aggregate attribute concordance list is corresponding, inquiry obtains to be checked three value corresponding with described attribute field data to be read, and obtains the second value as the second value to be read from described 3rd value to be checked;
Read module, in described collective data table, the 4th value array that the quadruple linkage that reading is formed with by described first key to be read, described first value to be read and described second value to be read is corresponding.
42. 1 kinds of devices reading key assignments in Hash table database, it is characterized in that, described Hash table database comprises following Hash table: set table, set identification concordance list, aggregate attribute concordance list, collective data table, and wherein said set table is for storing the key-value pair be made up of the first key, the first value array; Described set identification concordance list is for storing the key-value pair be made up of the second key, the second value array, and described second key is made up of described first key and the first value; Described aggregate attribute concordance list is for storing the key-value pair be made up of triple bond, the 3rd value array, and described triple bond is made up of described first key, described first value and attribute field title, the 3rd value is made up of the attribute field data under the second value and described attribute field title; Described collective data table is for storing the key-value pair be made up of quadruple linkage, the 4th value array, and described quadruple linkage is made up of described first key, described first value and described second value, wherein said attribute field title is one of each attribute field title of data record representated by the 4th value;
Described device comprises:
Receiver module, for receiving the reading key assignments request of the described collective data table to described Hash table database, wherein, the request of described reading key assignments comprises: the first key to be read and the first value to be read;
Enquiry module, in described set identification concordance list, inquires about the second value array corresponding to the second key of obtaining forming with by described first key to be read and described first value to be read as the second value array to be read;
Read module, for being worth each second value to be read in array for described to be read second, in described collective data table, the 4th value array that the quadruple linkage that reading is formed with by described first key to be read, described first value to be read and described second value to be read is corresponding.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310300815.7A CN103345521B (en) | 2013-07-17 | 2013-07-17 | A kind of method and apparatus processing key assignments in Hash table database |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310300815.7A CN103345521B (en) | 2013-07-17 | 2013-07-17 | A kind of method and apparatus processing key assignments in Hash table database |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103345521A CN103345521A (en) | 2013-10-09 |
CN103345521B true CN103345521B (en) | 2016-04-13 |
Family
ID=49280316
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310300815.7A Active CN103345521B (en) | 2013-07-17 | 2013-07-17 | A kind of method and apparatus processing key assignments in Hash table database |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103345521B (en) |
Families Citing this family (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104216708B (en) * | 2014-08-20 | 2018-08-10 | 北京奇艺世纪科技有限公司 | A kind of method and apparatus of data monitoring |
CN104486777B (en) * | 2014-12-01 | 2017-12-29 | 中国联合网络通信集团有限公司 | A method and device for realizing data processing |
CN104936210B (en) * | 2015-04-20 | 2018-04-10 | 中国联合网络通信集团有限公司 | A kind of method and device for determining number state |
CN106899443B (en) * | 2015-12-18 | 2020-06-26 | 北京神州泰岳软件股份有限公司 | Netflow flow data acquisition method and equipment |
CN106503040B (en) * | 2016-09-20 | 2019-08-02 | 福建天晴数码有限公司 | It is applicable in the KV database and its creation method of SQL query method |
CN108255859A (en) * | 2016-12-29 | 2018-07-06 | 航天信息股份有限公司 | A kind of method and system for being used to establish index for mass digital certificate |
CN107247749B (en) * | 2017-05-25 | 2020-08-25 | 创新先进技术有限公司 | Database state determination method, consistency verification method and device |
CN108573035A (en) * | 2018-04-02 | 2018-09-25 | 郑州云海信息技术有限公司 | A data storage method |
CN109902092B (en) * | 2019-02-22 | 2020-05-05 | 广州荔支网络技术有限公司 | Operation method and device of data storage system and mobile terminal |
CN110245134B (en) * | 2019-04-26 | 2021-07-06 | 石化盈科信息技术有限责任公司 | Increment synchronization method applied to search service |
CN111694676B (en) * | 2020-04-30 | 2024-03-05 | 北京奇艺世纪科技有限公司 | Processing method and device for key value observation mode |
CN111859445B (en) | 2020-06-14 | 2022-08-02 | 苏州浪潮智能科技有限公司 | Data security implementation method and system based on K-DB database |
CN112597195B (en) * | 2020-12-16 | 2024-08-13 | 中国建设银行股份有限公司 | Cache data refreshing method and distributed system |
CN113535258B (en) * | 2021-06-25 | 2022-09-27 | 杭州加速科技有限公司 | Pattern file loading method and system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6721749B1 (en) * | 2000-07-06 | 2004-04-13 | Microsoft Corporation | Populating a data warehouse using a pipeline approach |
CN101331496A (en) * | 2005-12-15 | 2008-12-24 | 国际商业机器公司 | System and method for associating security information with information objects in a data processing system |
CN102662946A (en) * | 2012-02-20 | 2012-09-12 | 北京地拓科技发展有限公司 | Method and system for automatically monitoring record changes in database |
-
2013
- 2013-07-17 CN CN201310300815.7A patent/CN103345521B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6721749B1 (en) * | 2000-07-06 | 2004-04-13 | Microsoft Corporation | Populating a data warehouse using a pipeline approach |
CN101331496A (en) * | 2005-12-15 | 2008-12-24 | 国际商业机器公司 | System and method for associating security information with information objects in a data processing system |
CN102662946A (en) * | 2012-02-20 | 2012-09-12 | 北京地拓科技发展有限公司 | Method and system for automatically monitoring record changes in database |
Also Published As
Publication number | Publication date |
---|---|
CN103345521A (en) | 2013-10-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103345521B (en) | A kind of method and apparatus processing key assignments in Hash table database | |
US9047330B2 (en) | Index compression in databases | |
CN111459985B (en) | Identification information processing method and device | |
CN101009516B (en) | A method, system and device for data synchronization | |
CN101640613B (en) | Method and device for network resource relating management | |
US8924373B2 (en) | Query plans with parameter markers in place of object identifiers | |
US20150100546A1 (en) | Selective Synchronization in a Hierarchical Folder Structure | |
CN109726305A (en) | A method for storing and retrieving complex relational data based on graph structure | |
CN106227800A (en) | The storage method of the big data of a kind of highlights correlations and management system | |
CN101599079A (en) | A Management Method for Centralized Storage of Backup Data | |
CN109902130A (en) | A kind of date storage method, data query method and apparatus, storage medium | |
CN102722566B (en) | Method for inquiring potential friends in social network | |
US11868328B2 (en) | Multi-record index structure for key-value stores | |
CN102819586A (en) | Uniform Resource Locator (URL) classifying method and equipment based on cache | |
CN102521364B (en) | Method for inquiring shortest path between two points on map | |
CN103795811A (en) | Information storage and data statistical management method based on meta data storage | |
CN105224532A (en) | Data processing method and device | |
CN110109874A (en) | A kind of non-stop layer distributed document retrieval method based on block chain | |
CN110851663B (en) | Method and device for managing metadata | |
CN106202254A (en) | A kind of querying method and data query system | |
CN104346347A (en) | Data storage method, device, server and system | |
CN104915388B (en) | It is a kind of that method is recommended based on spectral clustering and the book labels of mass-rent technology | |
CN112800143A (en) | Structure of data object and method for dynamically managing data object | |
CN103077214B (en) | File memory method and device | |
CN103136294A (en) | File operating method 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 | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20180911 Address after: 100190 Beijing Haidian District Zhichun Road 49 No. 3 West 309 Patentee after: Tencent cloud computing (Beijing) limited liability company Address before: 518044 East 403 room, Sai Ge science and Technology Park, Futian District Zhenxing Road, Shenzhen, Guangdong, China, 2 Patentee before: Tencent Technology (Shenzhen) Co., Ltd. |
|
TR01 | Transfer of patent right |