CN105574196A - Database management method and device - Google Patents

Database management method and device Download PDF

Info

Publication number
CN105574196A
CN105574196A CN201510997650.2A CN201510997650A CN105574196A CN 105574196 A CN105574196 A CN 105574196A CN 201510997650 A CN201510997650 A CN 201510997650A CN 105574196 A CN105574196 A CN 105574196A
Authority
CN
China
Prior art keywords
key
version information
deleted
data
data field
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510997650.2A
Other languages
Chinese (zh)
Other versions
CN105574196B (en
Inventor
赵安安
陈宗志
宋昭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201510997650.2A priority Critical patent/CN105574196B/en
Publication of CN105574196A publication Critical patent/CN105574196A/en
Application granted granted Critical
Publication of CN105574196B publication Critical patent/CN105574196B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/235Update request formulation

Abstract

The invention provides a database management method and device. The method comprises the steps of querying a key in a data region, wherein the key has at least one member; judging whether a to-be-deleted member exists in at least one member or not; and if yes, deleting the to-be-deleted member according to a judgment result. Through the database management scheme provided by the invention, the response time of short key deletion success can be shortened and the load of a server can be reduced.

Description

A kind of data base management method and device
Technical field
The present invention relates to database technical field, particularly relate to a kind of data base management method and device.
Background technology
Redis is key-value (i.e. key assignments) storage system.It supports that the value type stored is relatively more, comprises string (character string), list (chained list), set (set), zset (sortedset--ordered set) and hash (Hash type).These data types are all supported to increase key, delete key, get the operations such as common factor union to key.The value type no matter which kind of stores, when storing, a key all can comprise multiple member.At present based on the diversity that the database of redis supports storage data type based on its institute, be widely used.
Existing database management schemes, after receiving the deletion action to a certain key, needs the instant accessing database of server background management thread, deletes each member of this key successively from database, and each accessing database only can delete a member.So, if the number of members that key to be deleted comprises is very many, then management thread needs repeatedly accessing database can complete the deletion action treating delete key.Moreover, the action need of whole delete key operates in server background, causes the load of server to increase.
Visible, existing database management schemes, when delete key operates, not only needs to wait as long for and can obtain deleting successful response results, also needs the load immediately increasing server in server background execute key deletion action.
Summary of the invention
In view of existing database management schemes needs the problem immediately increasing server load in server background execute key deletion action when delete key, propose the present invention to provide a kind of data base management method and the device that overcome the problems referred to above.
According to one aspect of the present invention, provide a kind of data base management method, comprising: the key in data query district, described key has at least one member; Judge whether there is member to be deleted at least one member described; If so, then described member to be deleted is deleted according to judged result.
Preferably, described key has corresponding key version information, described member has corresponding member's version information, and whether there is member to be deleted at least one member described in described judgement and specifically comprise: judge member's version information corresponding to described member whether with the current key matches version information of described key, described current key version information is key version information up-to-date in the key version information that described key is corresponding; If not, then determine that described member is member to be deleted.
Preferably, judge that the current key matches version information whether member's version information corresponding to described member be corresponding with described key specifically comprises: obtain all key version informations that described key is corresponding; Up-to-date key version information is selected using as described current key version information by comparing; More described member's version information and described current key version information; If both comparative result displays are consistent, then coupling both judging.
Preferably, described key version information is stored in the metamessage of the key corresponding with it.
Preferably, when a data field and another data field merge, the data field after being combined performs the step of the key in described data query district.
Preferably, when receiving the data scrubbing request to described data field, perform the step of the key in described data query district.
Preferably, described method also comprises: receive key described at least one, and the described key received is kept in described data field, wherein said key has the first corresponding key version information, described member has first corresponding member's version information, and for key described in each, described first key version information and described first member's matches version information.
Preferably, described method also comprises: if receive the pre-deletion instruction to a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, wherein said second key version information does not mate with described first member's version information.
Preferably, described method also comprises: if receive the pre-deletion instruction to a certain member of a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, and by this key, described first member's version information of other members except this member is updated to second newer member's version information, wherein said second key version information does not mate with described first member's version information and described second key version information and described second member's matches version information.
Preferably, described method also comprises: indicate the renewal of a certain key if receive, then the first corresponding for this key key version information is updated to the second newer key version information, and described first member's version information corresponding for the member of this key is updated to second newer member's version information, wherein said second key version information and described second member's matches version information.
Preferably, the described instruction of the renewal to a certain key comprises: the instruction upgraded the value of the existing member of this key, and/or the instruction this key being increased to newcomer.
According to another aspect of the present invention, provide a kind of data bank management device, comprising: enquiry module, for the key in data query district, described key has at least one member; Judge module, for judging whether there is member to be deleted at least one member described; Execution module, if for the judged result of described judge module for being time, then delete described member to be deleted according to judged result.
Preferably, described key has corresponding key version information, described member has corresponding member's version information, and described judge module comprises: version information judge module, for judge member's version information corresponding to described member whether with the current key matches version information of described key, described current key version information is key version information up-to-date in the key version information that described key is corresponding; Member's determination module to be deleted, if when being no for the judged result of described version information judge module, then determine that described member is member to be deleted.
Preferably, described version information judge module comprises: version information obtains submodule, for obtaining all key version informations corresponding to described key; Latest version information determination submodule, for selecting up-to-date key version information using as described current key version information by comparing; Comparison sub-module, for more described member's version information and described current key version information; Determine submodule, if consistent for both comparative result displays, then coupling both judging.
Preferably, described key version information is stored in the metamessage of the key corresponding with it.
Preferably, when a data field and another data field merge, call described enquiry module be combined after data field perform the operation of the key in described data query district.
Preferably, when receiving the data scrubbing request to described data field, call the operation that described enquiry module performs the key in described data query district.
Preferably, described device also comprises: key information receiver module, for receiving key described at least one, and the described key received is kept in described data field, wherein said key has the first corresponding key version information, described member has first corresponding member's version information, and for key described in each, described first key version information and described first member's matches version information.
Preferably, described device also comprises: key deletes instruction receiver module in advance, if for receiving the pre-deletion instruction to a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, wherein said second key version information does not mate with described first member's version information.
Preferably, described device also comprises: member deletes instruction receiver module in advance, if for receiving the pre-deletion instruction to a certain member of a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, and by this key, described first member's version information of other members except this member is updated to second newer member's version information, wherein said second key version information does not mate with described first member's version information and described second key version information and described second member's matches version information.
Preferably, described device also comprises: key upgrades instruction receiver module, if indicate the renewal of a certain key for receiving, then the first corresponding for this key key version information is updated to the second newer key version information, and described first member's version information corresponding for the member of this key is updated to second newer member's version information, wherein said second key version information and described second member's matches version information.
Preferably, the described instruction of the renewal to a certain key comprises: the instruction upgraded the value of the existing member of this key, and/or the instruction this key being increased to newcomer.
The database management schemes that the embodiment of the present invention provides, when receiving in database the operation of certain key stored, only can upgrade at the version information of server front end to this key, key owing to storing in database after upgrading the version information of key is the key do not upgraded, so then cannot obtain data when again accessing this key, break-in realizes the deletion to key; Compared to the existing needs scheme of member in delete key from database one by one, the embodiment of the present invention can shorten key and delete the successful response time.
And the embodiment of the present invention is when carrying out deletion action to the member of the key in database particularly, by the key in data query district, judge member's version information corresponding to member whether with the current key matches version information of key, if do not mate, then determine that this member is member to be deleted, by member deletion to be deleted.Visible, carry out performing when data field merges at database bottom during the deletion action of the member of key in database, the load of server can't be taken.
In summary, the database management schemes that the embodiment of the present invention provides, can either shorten and delete the successful response time, also can not bring extra load for server.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of instructions, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 shows a kind of according to an embodiment of the invention steps flow chart schematic diagram of data base management method;
Fig. 2 shows a kind of according to an embodiment of the invention steps flow chart schematic diagram of data base management method;
Fig. 3 shows a kind of according to an embodiment of the invention structural representation of data bank management device; And
Fig. 4 shows a kind of according to an embodiment of the invention structural representation of data bank management device.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
Embodiment one
With reference to Fig. 1, show the flow chart of steps of a kind of data base management method of the embodiment of the present invention one.
The data base management method of the embodiment of the present invention comprises the following steps:
Step 101: the key in data query district.
Wherein, each key in data field has at least one member.Key can a corresponding member, can corresponding multiple member.
Comprise multiple data field in database, when carrying out data to data field and merging, then need to inquire about each key in data field to be combined.When carrying out data scrubbing to data field, also need to inquire about the key in the data field of pending data scrubbing.Inquiry for key in data field performs when database bottom merges.
Preferably, for the key in data field arranges key version information, each member comprised for key arranges member's version information.
Step 102: judge whether there is member to be deleted at least one member, if so, then performs step 103, if not, then performs setting operation.
Because each key in data field has one or more member, therefore, need whether there is member to be deleted in the member judging that current key is corresponding in step 102.
It should be noted that, when judging whether there is member to be deleted at least one member, can judge whether each member that current key is corresponding is member to be deleted one by one.Directly can judge whether current key is key to be deleted, if so, then determine that whole members that current key is corresponding are member to be deleted.All right
Wherein, setting operation can be set as judging whether there is member to be deleted in the next key in data field.
Step 103: if there is member to be deleted, then delete member to be deleted according to judged result.
After determining the member to be deleted that the current key in data field is corresponding, member to be deleted can be deleted according to judged result.
Repeated execution of steps 101 to step 103 can realize the deletion of inquiry to each key of data field and member to be deleted, to realize the management to the key in data field when database bottom merges.
By the data base management method that the embodiment of the present invention provides, when receiving in database the operation of certain key stored, only can upgrade at the version information of server front end to this key, key owing to storing in database after upgrading the version information of key is the key do not upgraded, so then cannot obtain data when again accessing this key, break-in realizes the deletion to key.Compared to the existing needs scheme of member in delete key from database one by one, can shorten and delete the successful response time.And when particularly deletion action being carried out to the member of the key in database, by the key in data query district, judge member's version information corresponding to member whether with the current key matches version information of key, if do not mate, then determine that this member is member to be deleted, by member deletion to be deleted.Visible, carry out performing when data field merges at database bottom during the deletion action of the member of key in database, the load of server can't be taken.In summary, the database management schemes that the embodiment of the present invention provides, can either shorten and delete the successful response time, also can not bring extra load for server.
Embodiment two
With reference to Fig. 2, show the flow chart of steps of a kind of data base management method of the embodiment of the present invention two.
The data base management method of the embodiment of the present invention specifically comprises the following steps:
Step 201: receive at least one key, and the key received is preserved within a data area.
Wherein key has the first corresponding key version information, and each member in key has first corresponding member's version information, and for each key, the first key version information and first member's matches version information.That is, the matches version information of member that comprises of key and key.
Preferably, key version information is stored in the metamessage of the key corresponding with it.A key comprises metamessage and at least one member, increases key version information without the need to increasing the field of information to add key version information, without the need to modifying to the structure of key in the metamessage of key.
In database embody rule process, if when receiving the pre-deletion instruction to certain key stored in data field, the pre-deletion instruction to certain member in key or indicate the renewal of a certain key, then upgrade at member's version information that server front end is corresponding to key version information corresponding to corresponding key, member, be updated to newer version information.So that when carrying out data field merging and data field upgrades, the key version information stored according to server front end and member's version information manage the key in data field.Concrete update mode is as follows:
If receive the pre-deletion instruction to a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, wherein the second key version information does not mate with first member's version information.
Such as: the first key version information that the key A stored in data field is corresponding is 0, first member's version information of each member that key A comprises also is 0, after receiving the pre-deletion instruction to key A, then in server front end, key version information 0 corresponding for key A is updated to 1, member's version information corresponding to the member comprised for key A does not then upgrade, and namely member's version information is still 0.
If receive the pre-deletion instruction to a certain member of a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, and by this key, first member's version information of other members except this member is updated to second newer member's version information, wherein the second key version information does not mate with first member's version information and the second key version information and second member's matches version information.
Such as: the first key version information that the key A stored in data field is corresponding is 0, key A comprises each member and is respectively 1,2,3 and 4, first member's version information corresponding to four members is 0, after receiving the pre-deletion instruction to the member 1 in key A, then in server front end, key version information 0 corresponding for key A is updated to 1, member's version information that member's version information of member 1 correspondence comprised for key A does not then carry out renewal and member 1 correspondence is still 0, and member's version information of member 2,3 and 4 correspondence is then updated to second member's version information 1.That is, the version of member 2,3 and 4 and key A has all carried out upgrading and belonging to same version; Member 1 is then no longer mated with the version of key A, and the version of key A is compared with the version high one-level of member 1.
If receive, the renewal of a certain key is indicated, then the first corresponding for this key key version information is updated to the second newer key version information, and first corresponding for the member of this key member's version information is updated to second newer member's version information, wherein the second key version information and second member's matches version information.Wherein, the renewal instruction of a certain key is comprised: the instruction that the value of the existing member of this key is upgraded, and/or the instruction this key being increased to newcomer.
Such as: the first key version information that the key A stored in data field is corresponding is 0, and key A comprises each member and is respectively 1,2,3 and 4, first member's version information that four members are corresponding is 0.After receiving the renewal instruction increasing member 5 in A, in server front end, the key version information subtracting A corresponding is updated to 1 by 0, member's version information corresponding to five members comprised by key A all upgrades, and is updated to 1.That is, after receiving the renewal instruction to key, the version of the member version of key and key comprised all upgrades, and key and member belong to same version.
In the embodiment of the present invention, in database operational process when deleting in advance the key in database, upgrading or delete in advance the member that key comprises, server background thread can't be taken and immediately carry out corresponding operating to by the key selected within a data area, and only can upgrade at the version information of server front end to key and/or member, key after renewal or the version of member different from the version of the corresponding key that data field stores, therefore cannot get corresponding data when key is again requested, namely be equivalent to break-in key is deleted.And for the deletion of the key in data field and/or member, be just can trigger under some specific opportunity, and carry out when database bottom merges, therefore can not increase the extra load of server.
It should be noted that, step 201 is that it is optional step how to the step of write key in data field.In specific implementation process, if stored each key in data field, without the need to performing this step.
Step 202: the key in data query district.
It should be noted that, perform the operation of the key in data query district form suitable arbitrarily can be arranged in specific implementation process under, in the embodiment of the present invention, concrete restriction is not done to this.Such as: be arranged to when a data field and another data field merge, the data field after being combined performs the operation of the key in data query district.Such as: when receiving the data scrubbing request to data field, the operation of the key in data query district is performed.Again such as: when the data volume stored when certain data field exceeds setting value, carry out data field merging, the data field after being combined performs the operation of the key in data query district.
In specific implementation process, the data field inquired about needs to carry out merging or the data field of data scrubbing.May store multiple key in data field, each key has at least one member.So, during key in data query district, then need to be that granularity carries out inquiry judging with member, to judge each member to be deleted in each key and to be deleted.
Be treated to example be described to comprise a member to the key of in data field below.In specific implementation process, need to perform this treatment scheme, with the management of database to each member that each key of data field comprises successively.
Step 203: judge member's version information corresponding to described member whether with the current key matches version information of described key, if so, then perform setting operation, if not, then perform step 204.
Current key version information is key version information up-to-date in the key version information that described key is corresponding.Wherein, member's version information corresponding to member is identical with the current key version information of key, or two version informations all indicate same version, then determine the two coupling; Otherwise, then determine that the two does not mate.
Such as: in data field, the key version information of key A is 0, member's version information of the member 1 that key A comprises also is 0, and the current key version information of key A is 1.So, because member's version information of member 1 does not mate with the current key version information of key A, therefore, determine that member 1 is member to be deleted.
Wherein, setting operation can set the key returned in execution data query district and select next member, and judges to select whether this member is member to be deleted.
A kind of preferred concrete mode of current key matches version information judging that whether member's version information corresponding to member be corresponding with key is as follows:
S1: obtain all key version informations that key is corresponding.
In server front end after receiving the deletion to key, upgrading instruction, the key version information of key all can upgrade.Therefore, if data field merge or Data Update before this key deleted or upgrade repeatedly, at this key of server front end then to there being multiple key version information.Therefore, need to obtain all key version informations corresponding to key.
S2: select up-to-date key version information using as current key version information by comparing.
Such as: key version information arabic numeral are represented.The most initial key version information represents with 0, and often pair of key version information once upgrades, and adds 1 by numeral.If have updated three times to key version information, so, all key version informations that this key is corresponding are: 0,1,2 and 3.Correspondingly, the up-to-date key version information of key is then 3.
S3: more described member's version information and described current key version information, if both comparative result displays are consistent, then coupling both judging.
Each member of each key is all to there being member's version information within a data area.The member version information corresponding by member and members the current key version information of key compare, whether the version can determining this member is latest edition, if so, then without the need to processing it, if not latest edition, then need it to delete from data field.
Step 204: when whether member's version information that member is corresponding does not mate with the current key version information of key, then determine that described member is member to be deleted.
Member's version information does not mate with the current key version information of key, then illustrate that member is different from the version of key, therefore, and this member deletion that need will store in data field.
Step 205: delete member to be deleted according to judged result.
Having determined this member by step 204 is member to be deleted, now then needs this member to delete from data field.
So far, the management process for the member stored in data field completes, and repeats above-mentioned flow process and deletes each member stored in data field or retain, and gets final product the management of database.
By the data base management method that the embodiment of the present invention provides, when receiving in database the operation of certain key stored, only can upgrade at the version information of server front end to this key, key owing to storing in database after upgrading the version information of key is the key do not upgraded, so then cannot obtain data when again accessing this key, break-in realizes the deletion to key.Compared to the existing needs scheme of member in delete key from database one by one, can shorten and delete the successful response time.And when particularly deletion action being carried out to the member of the key in database, by the key in data query district, judge member's version information corresponding to member whether with the current key matches version information of key, if do not mate, then determine that this member is member to be deleted, by member deletion to be deleted.Visible, carry out performing when data field merges at database bottom during the deletion action of the member of key in database, the load of server can't be taken.In summary, the data bank management device that the embodiment of the present invention provides, can either shorten and delete the successful response time, also can not increase extra load for server.
Embodiment three
With reference to Fig. 3, show the structured flowchart of a kind of data bank management device of the embodiment of the present invention three.
The data bank management device of the embodiment of the present invention comprises: enquiry module 301, and for the key in data query district, described key has at least one member; Judge module 302, for judging whether there is member to be deleted at least one member described; Execution module 303, if for the judged result of described judge module for being time, then delete described member to be deleted according to judged result.
By the data bank management device that the embodiment of the present invention provides, when receiving in database the operation of certain key stored, only can upgrade at the version information of server front end to this key, key owing to storing in database after upgrading the version information of key is the key do not upgraded, so then cannot obtain data when again accessing this key, break-in realizes the deletion to key.Compared to the existing needs scheme of member in delete key from database one by one, can shorten and delete the successful response time.And when particularly deletion action being carried out to the member of the key in database, by the key in data query district, judge member's version information corresponding to member whether with the current key matches version information of key, if do not mate, then determine that this member is member to be deleted, by member deletion to be deleted.Visible, carry out performing when data field merges at database bottom during the deletion action of the member of key in database, the load of server can't be taken.In summary, the data bank management device that the embodiment of the present invention provides, can either shorten and delete the successful response time, also can not bring extra load for server.
Embodiment four
With reference to Fig. 4, show the structured flowchart of a kind of data bank management device of the embodiment of the present invention four.
The embodiment of the present invention is the further optimization to the data bank management device in embodiment three, and the data bank management device after optimization comprises: enquiry module 401, and for the key in data query district, described key has at least one member; Judge module 402, for judging whether there is member to be deleted at least one member described; Execution module 403, if for the judged result of described judge module for being time, then delete described member to be deleted according to judged result.
Preferably, described key has corresponding key version information, described member has corresponding member's version information, and described judge module 402 comprises: version information judge module 4021, for judge member's version information corresponding to described member whether with the current key matches version information of described key, described current key version information is key version information up-to-date in the key version information that described key is corresponding; Member's determination module 4022 to be deleted, if when being no for the judged result of described version information judge module, then determine that described member is member to be deleted.
Preferably, described version information judge module 4021 comprises: version information obtains submodule 40211, for obtaining all key version informations corresponding to described key; Latest version information determination submodule 40212, for selecting up-to-date key version information using as described current key version information by comparing; Comparison sub-module 40213, for more described member's version information and described current key version information; Determine submodule 40214, if consistent for both comparative result displays, then coupling both judging.
Preferably, described key version information is stored in the metamessage of the key corresponding with it.
Preferably, when a data field and another data field merge, call described enquiry module 401 be combined after data field perform the operation of the key in described data query district.
Preferably, when receiving the data scrubbing request to described data field, call the operation that described enquiry module 401 performs the key in described data query district.
Preferably, described device also comprises: key information receiver module 404, for receiving key described at least one, and the described key received is kept in described data field, wherein said key has the first corresponding key version information, described member has first corresponding member's version information, and for key described in each, described first key version information and described first member's matches version information.
Preferably, described device also comprises: key deletes instruction receiver module 405 in advance, if for receiving the pre-deletion instruction to a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, wherein said second key version information does not mate with described first member's version information.
Preferably, described device also comprises: member deletes instruction receiver module 406 in advance, if for receiving the pre-deletion instruction to a certain member of a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, and by this key, described first member's version information of other members except this member is updated to second newer member's version information, wherein said second key version information does not mate with described first member's version information and described second key version information and described second member's matches version information.
Preferably, described device also comprises: key upgrades instruction receiver module 407, if indicate the renewal of a certain key for receiving, then the first corresponding for this key key version information is updated to the second newer key version information, and described first member's version information corresponding for the member of this key is updated to second newer member's version information, wherein said second key version information and described second member's matches version information.
Preferably, the described instruction of the renewal to a certain key comprises: the instruction upgraded the value of the existing member of this key, and/or the instruction this key being increased to newcomer.
The data bank management device of the present embodiment is used for realizing corresponding data base management method in previous embodiment one, embodiment two, and has the beneficial effect of corresponding embodiment of the method, does not repeat them here.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar part mutually see.For system embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment in this database management schemes provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure required by system that there is the present invention program is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In instructions provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as the following claims reflect, all features of inventive aspect disclosed single embodiment before being to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in detail in the claims, the one of any of embodiment required for protection can use with arbitrary array mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the some or all parts in the database management schemes of the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
The invention discloses A1, a kind of data base management method, comprising:
Key in data query district, described key has at least one member;
Judge whether there is member to be deleted at least one member described;
If so, then described member to be deleted is deleted according to judged result.
A2, method according to A1, wherein, described key has corresponding key version information, and described member has corresponding member's version information, and whether there is member to be deleted at least one member described in described judgement and specifically comprise:
Judge member's version information corresponding to described member whether with the current key matches version information of described key, described current key version information is key version information up-to-date in the key version information that described key is corresponding;
If not, then determine that described member is member to be deleted.
A3, method according to A2, wherein, judge that the current key matches version information whether member's version information corresponding to described member be corresponding with described key specifically comprises:
Obtain all key version informations that described key is corresponding;
Up-to-date key version information is selected using as described current key version information by comparing;
More described member's version information and described current key version information;
If both comparative result displays are consistent, then coupling both judging.
A4, method according to any one of A1-A3, wherein, described key version information is stored in the metamessage of the key corresponding with it.
A5, method according to any one of A1-A4, wherein, when a data field and another data field merge, the data field after being combined performs the step of the key in described data query district.
A6, method according to any one of A1-A4, wherein, when receiving the data scrubbing request to described data field, perform the step of the key in described data query district.
A7, method according to any one of A1-A6, wherein, described method also comprises:
Receive key described at least one, and the described key received is kept in described data field, wherein said key has the first corresponding key version information, described member has first corresponding member's version information, and for key described in each, described first key version information and described first member's matches version information.
A8, method according to A7, wherein, described method also comprises:
If receive the pre-deletion instruction to a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, wherein said second key version information does not mate with described first member's version information.
A9, method according to A7, wherein, described method also comprises:
If receive the pre-deletion instruction to a certain member of a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, and by this key, described first member's version information of other members except this member is updated to second newer member's version information, wherein said second key version information does not mate with described first member's version information and described second key version information and described second member's matches version information.
A10, method according to A7, wherein, described method also comprises:
If receive, the renewal of a certain key is indicated, then the first corresponding for this key key version information is updated to the second newer key version information, and described first member's version information corresponding for the member of this key is updated to second newer member's version information, wherein said second key version information and described second member's matches version information.
A11, method according to A7, wherein, the described instruction of the renewal to a certain key comprises: the instruction upgraded the value of the existing member of this key, and/or the instruction this key being increased to newcomer.
The invention also discloses B12, a kind of data bank management device, comprising:
Enquiry module, for the key in data query district, described key has at least one member;
Judge module, for judging whether there is member to be deleted at least one member described;
Execution module, if for the judged result of described judge module for being time, then delete described member to be deleted according to judged result.
B13, device according to B12, wherein, described key has corresponding key version information, and described member has corresponding member's version information, and described judge module comprises:
Version information judge module, for judge member's version information corresponding to described member whether with the current key matches version information of described key, described current key version information is key version information up-to-date in the key version information that described key is corresponding;
Member's determination module to be deleted, if when being no for the judged result of described version information judge module, then determine that described member is member to be deleted.
B14, device according to B13, wherein, described version information judge module comprises:
Version information obtains submodule, for obtaining all key version informations corresponding to described key;
Latest version information determination submodule, for selecting up-to-date key version information using as described current key version information by comparing;
Comparison sub-module, for more described member's version information and described current key version information;
Determine submodule, if consistent for both comparative result displays, then coupling both judging.
B15, device according to any one of B12-B14, wherein, described key version information is stored in the metamessage of the key corresponding with it.
B16, device according to any one of B12-B15, wherein, when a data field and another data field merge, call described enquiry module be combined after data field perform the operation of the key in described data query district.
B17, device according to any one of B12-B15, wherein, when receiving the data scrubbing request to described data field, call the operation that described enquiry module performs the key in described data query district.
B18, device according to any one of B12-B17, wherein, described device also comprises:
Key information receiver module, for receiving key described at least one, and the described key received is kept in described data field, wherein said key has the first corresponding key version information, described member has first corresponding member's version information, and for key described in each, described first key version information and described first member's matches version information.
B19, device according to B18, wherein, described device also comprises:
Key deletes instruction receiver module in advance, if for receiving the pre-deletion instruction to a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, wherein said second key version information does not mate with described first member's version information.
B20, device according to B18, wherein, described device also comprises:
Member deletes instruction receiver module in advance, if for receiving the pre-deletion instruction to a certain member of a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, and by this key, described first member's version information of other members except this member is updated to second newer member's version information, wherein said second key version information does not mate with described first member's version information and described second key version information and described second member's matches version information.
B21, device according to B18, wherein, described device also comprises:
Key upgrades instruction receiver module, if indicate the renewal of a certain key for receiving, then the first corresponding for this key key version information is updated to the second newer key version information, and described first member's version information corresponding for the member of this key is updated to second newer member's version information, wherein said second key version information and described second member's matches version information.
B22, device according to B18, wherein, the described instruction of the renewal to a certain key comprises: the instruction upgraded the value of the existing member of this key, and/or the instruction this key being increased to newcomer.

Claims (10)

1. a data base management method, comprising:
Key in data query district, described key has at least one member;
Judge whether there is member to be deleted at least one member described;
If so, then described member to be deleted is deleted according to judged result.
2. method according to claim 1, is characterized in that, described key has corresponding key version information, and described member has corresponding member's version information, and whether there is member to be deleted at least one member described in described judgement and specifically comprise:
Judge member's version information corresponding to described member whether with the current key matches version information of described key, described current key version information is key version information up-to-date in the key version information that described key is corresponding;
If not, then determine that described member is member to be deleted.
3. method according to claim 2, is characterized in that, judges that the current key matches version information whether member's version information corresponding to described member be corresponding with described key specifically comprises:
Obtain all key version informations that described key is corresponding;
Up-to-date key version information is selected using as described current key version information by comparing;
More described member's version information and described current key version information;
If both comparative result displays are consistent, then coupling both judging.
4. the method according to any one of claim 1-3, is characterized in that, described key version information is stored in the metamessage of the key corresponding with it.
5. the method according to any one of claim 1-4, is characterized in that, when a data field and another data field merge, the data field after being combined performs the step of the key in described data query district.
6. the method according to any one of claim 1-4, is characterized in that, when receiving the data scrubbing request to described data field, performs the step of the key in described data query district.
7. the method according to any one of claim 1-6, is characterized in that, described method also comprises:
Receive key described at least one, and the described key received is kept in described data field, wherein said key has the first corresponding key version information, described member has first corresponding member's version information, and for key described in each, described first key version information and described first member's matches version information.
8. method according to claim 7, is characterized in that, described method also comprises:
If receive the pre-deletion instruction to a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, wherein said second key version information does not mate with described first member's version information.
9. method according to claim 7, is characterized in that, described method also comprises:
If receive the pre-deletion instruction to a certain member of a certain key, then the first corresponding for this key key version information is updated to the second newer key version information, and by this key, described first member's version information of other members except this member is updated to second newer member's version information, wherein said second key version information does not mate with described first member's version information and described second key version information and described second member's matches version information.
10. a data bank management device, comprising:
Enquiry module, for the key in data query district, described key has at least one member;
Judge module, for judging whether there is member to be deleted at least one member described;
Execution module, if for the judged result of described judge module for being time, then delete described member to be deleted according to judged result.
CN201510997650.2A 2015-12-25 2015-12-25 A kind of data base management method and device Active CN105574196B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510997650.2A CN105574196B (en) 2015-12-25 2015-12-25 A kind of data base management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510997650.2A CN105574196B (en) 2015-12-25 2015-12-25 A kind of data base management method and device

Publications (2)

Publication Number Publication Date
CN105574196A true CN105574196A (en) 2016-05-11
CN105574196B CN105574196B (en) 2019-02-26

Family

ID=55884327

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510997650.2A Active CN105574196B (en) 2015-12-25 2015-12-25 A kind of data base management method and device

Country Status (1)

Country Link
CN (1) CN105574196B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402590A (en) * 2011-10-31 2012-04-04 深圳中兴力维技术有限公司 Managing method and system of key value data
US20140317048A1 (en) * 2013-04-22 2014-10-23 Sap Ag Enhanced transactional cache
CN104572920A (en) * 2014-12-27 2015-04-29 北京奇虎科技有限公司 Data arrangement method and data arrangement device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402590A (en) * 2011-10-31 2012-04-04 深圳中兴力维技术有限公司 Managing method and system of key value data
US20140317048A1 (en) * 2013-04-22 2014-10-23 Sap Ag Enhanced transactional cache
CN104572920A (en) * 2014-12-27 2015-04-29 北京奇虎科技有限公司 Data arrangement method and data arrangement device

Also Published As

Publication number Publication date
CN105574196B (en) 2019-02-26

Similar Documents

Publication Publication Date Title
US7752165B2 (en) Persistent query system for automatic on-demand data subscriptions from mobile devices
US8060544B2 (en) Representation of data transformation processes for parallelization
US8898186B2 (en) Methods and systems for latency-free contacts search
CN104572860A (en) Data processing method and data processing system
CN104991790A (en) Upgrade release method and apparatus of file
CN105303084A (en) Privilege management system and method
US20130080418A1 (en) Deadline-driven parallel execution of queries
CN103714002B (en) Project testing method and device based on configuration system
CN108228799A (en) The storage method and device of object indexing information
CN104504068A (en) Browser-based shopping information query method and browser device
CN105530297A (en) Webpage resource bundle uploading method and device
CN106227769B (en) Date storage method and device
EP2602756A1 (en) Parallel processing of semantically grouped data in data warehouse environments
CN105892997B (en) Code control method and device
US20160350209A1 (en) Selective Bypass of Code Flows in Software Program
CN105550346A (en) Information management method and device
CN103761240A (en) Database access method and database access device
US10747766B2 (en) Context based access path selection
US20160132543A1 (en) Automatically aggregating data in database tables
CN103020196B (en) The system of process database operations request
US20220237178A1 (en) Automatically updating column data type
CN102982179A (en) Webpage searching device and method for browser
CN103678687A (en) Project establishment method and device based on configuration system
CN105574196A (en) Database management method and device
US20170139960A1 (en) Table migration to updated structures without creating an intermediate copy of the table data

Legal Events

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

Effective date of registration: 20220728

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: Room 112, block D, No. 28, Xinjiekou outer street, Xicheng District, Beijing 100088 (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.