CN105574196B - A kind of data base management method and device - Google Patents
A kind of data base management method and device Download PDFInfo
- Publication number
- CN105574196B CN105574196B CN201510997650.2A CN201510997650A CN105574196B CN 105574196 B CN105574196 B CN 105574196B CN 201510997650 A CN201510997650 A CN 201510997650A CN 105574196 B CN105574196 B CN 105574196B
- Authority
- CN
- China
- Prior art keywords
- key
- version information
- data field
- updated
- information
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/219—Managing data history or versioning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/235—Update request formulation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The present invention provides a kind of data base management method and devices, the method comprise the steps that the key in inquiry data field, the key have at least one member;Judge to whether there is member to be deleted at least one described member;If so, deleting the member to be deleted according to judging result.The database management schemes provided through the invention can shorten key and delete the load that the successful response time mitigates server.
Description
Technical field
The present invention relates to database technical fields, more particularly to a kind of data base management method and device.
Background technique
Redis is key-value (i.e. key assignments) storage system.It supports the value type of storage relatively more, packet
Include string (character string), list (chained list), set (set), zset (sorted set-- ordered set) and hash (Hash class
Type).These data types such as all support increasing key, delete key, take intersection union to key at the operation.No matter which kind of storage value
Type, in storage, one key may include multiple members.Its supported storing data is based on currently based on the database of redis
The diversity of type, is widely used.
Existing database management schemes need server background management after receiving the delete operation to a certain key
Thread accesses database immediately, and each member of the key is successively deleted from database, also, access database is only capable of deleting every time
Except a member.So, it if the key to be deleted number of members that includes is very more, manages thread and needs repeatedly access database
The delete operation of delete key can be completed to treat.Moreover, the operation of entire delete key needs to carry out in server background
Operation, causes the load of server to increase.
As it can be seen that existing database management schemes, when deleting key operation, not only needing to fall into a long wait can just access
Successful response results are deleted, also need to increase the load of server in server background execution key delete operation immediately.
Summary of the invention
It is needed in delete key immediately in view of existing database management schemes in server background execution key delete operation
The problem of increasing server load proposes the present invention in order to provide a kind of data base management method and dress for overcoming the above problem
It sets.
According to one aspect of the present invention, a kind of data base management method is provided, comprising: the key in inquiry data field,
The key has at least one member;Judge to whether there is member to be deleted at least one described member;If so, foundation
Judging result deletes the member to be deleted.
Preferably, the key has corresponding key version information, and the member has corresponding member's version information, and
It is specifically included at least one member described in the judgement with the presence or absence of member to be deleted: judging the corresponding member of the member
Version information whether the current key matches version information with the key, the current key version information be the corresponding key version of the key
Newest key version information in this information;If not, it is determined that the member is member to be deleted.
Preferably, judge the corresponding member's version information of the member current key version information whether corresponding with the key
Matching specifically includes: obtaining the corresponding all key version informations of the key;Select newest key version information by comparing to make
For the current key version information;Compare member's version information and the current key version information;If comparison result is shown
The two is consistent, then judges the two matching.
Preferably, the key version information is stored in the metamessage of corresponding key.
Preferably, when a data field merges with another data field, the inquiry number is executed to the data field after merging
The step of according to key in area.
Preferably, when receiving the request of the data scrubbing to the data field, the key in the inquiry data field is executed
The step of.
Preferably, the method also includes: receive at least one described key, and the received key be stored in the number
According in area, wherein the key has corresponding first key version information, the member has corresponding first member version information,
And for key described in each, the first key version information and the first member matches version information.
Preferably, the method also includes: if receive to a certain key pre- deletion instruction, by the key corresponding first
Key version information is updated to the second newer key version information, wherein the second key version information and the first member version
Information mismatches.
Preferably, the method also includes: if receive the pre- deletion to a certain member of a certain key instruction, by the key pair
The the first key version information answered is updated to the second newer key version information, and by the key, other members in addition to the member
The first member version information be updated to second newer member's version information, wherein the second key version information and institute
First member's version information is stated to mismatch and the second key version information and the second member matches version information.
Preferably, the method also includes: if receiving the update instruction to a certain key, by corresponding first key of the key
Version information is updated to the second newer key version information, and more by the corresponding first member version information of the member of the key
It is newly second newer member's version information, wherein the second key version information and the second member matches version information.
Preferably, the update instruction to a certain key includes: the instruction being updated to the value of the existing member of the key,
And/or increase the key instruction of newcomer.
According to another aspect of the invention, a kind of data bank management device is provided, comprising: enquiry module, for looking into
The key in data field is ask, the key has at least one member;Judgment module, for judge at least one described member whether
There are members to be deleted;Execution module, if the judging result for the judgment module is when being, to delete according to judging result
Except the member to be deleted.
Preferably, the key has corresponding key version information, and the member has corresponding member's version information, and
The judgment module includes: version information judgment module, for judge the corresponding member's version information of the member whether with institute
The current key matches version information of key is stated, the current key version information is newest key in the corresponding key version information of the key
Version information;Member's determining module to be deleted, if the judging result for the version information judgment module is no, it is determined that
The member is member to be deleted.
Preferably, the version information judgment module includes: version information acquisition submodule, corresponding for obtaining the key
All key version informations;Latest version information determines submodule, for selecting newest key version information by comparing to make
For the current key version information;Comparative sub-module, for member's version information and the current key version information;
It determines submodule, if consistent for both comparison result displays, judges the two matching.
Preferably, the key version information is stored in the metamessage of corresponding key.
Preferably, when a data field merges with another data field, call the enquiry module to the data after merging
Area executes the operation of the key in the inquiry data field.
Preferably, it when receiving the request of the data scrubbing to the data field, calls described in the enquiry module execution
Inquire the operation of the key in data field.
Preferably, described device further include: key information receiving module for receiving at least one described key, and will receive
The key be stored in the data field, wherein the key have corresponding first key version information, the member have pair
The first member's version information answered, and for key described in each, the first key version information and the first member version
Information matches.
Preferably, described device further include: key deletes instruction receiving module in advance, if deleting for receiving to the pre- of a certain key
Except instruction, then the corresponding first key version information of the key is updated to the second newer key version information, wherein second key
Version information and the first member version information mismatch.
Preferably, described device further include: member deletes instruction receiving module in advance, if a certain to a certain key for receiving
The pre- deletion of member indicates, then the corresponding first key version information of the key is updated to the second newer key version information, and will
The key, other members in addition to the member the first member version information is updated to newer second member's version letter
Breath, wherein the second key version information and the first member version information mismatch and the second key version information and institute
State second member's matches version information.
Preferably, described device further include: key update instruction receiving module, if referring to for receiving to the update of a certain key
Show, then the corresponding first key version information of the key is updated to the second newer key version information, and the member of the key is corresponding
The first member version information be updated to second newer member's version information, wherein the second key version information and institute
State second member's matches version information.
Preferably, the update instruction to a certain key includes: the instruction being updated to the value of the existing member of the key,
And/or increase the key instruction of newcomer.
Database management schemes provided in an embodiment of the present invention are receiving the operation to certain key stored in database
When, it can be only updated in version information of the server front end to the key, due to data after being updated to the version information of key
The key stored in library is the key not updated, and data are then unable to get when so accessing the key again, and the deletion to key is realized in deflecting;
Compared to it is existing needs one by one from database in delete key member scheme, the embodiment of the present invention can shorten key delete at
The response time of function.
And the embodiment of the present invention passes through inquiry data field when specifically carrying out delete operation to the member of the key in database
In key, judge the corresponding member's version information of member whether the current key matches version information with key, if mismatch, it is determined that
The member is member to be deleted, by member deletion to be deleted.As it can be seen that in data when the delete operation of the member of key in database
It is executed when the progress data field merging of bottom storehouse layer, the load of server can't be occupied.
In summary, database management schemes provided in an embodiment of the present invention, can either shorten deletion successfully response when
Between, also extra load will not be brought for server.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field
Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of step flow diagram of data base management method according to an embodiment of the invention;
Fig. 2 shows a kind of step flow diagrams of data base management method according to an embodiment of the invention;
Fig. 3 shows a kind of structural schematic diagram of data bank management device according to an embodiment of the invention;And
Fig. 4 shows a kind of structural schematic diagram of data bank management device according to an embodiment of the invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
Embodiment one
Referring to Fig.1, a kind of step flow chart of data base management method of the embodiment of the present invention one is shown.
The data base management method of the embodiment of the present invention the following steps are included:
Step 101: the key in inquiry data field.
Wherein, each key in data field has at least one member.One key can correspond to a member, can correspond to
Multiple members.
It include that multiple data fields are then needed when carrying out data merging to data field to data to be combined in database
Each key in area is inquired.When carrying out data scrubbing to data field, it is also desirable to in the data field of pending data scrubbing
Key inquired.Inquiry for key in data field is executed when database bottom merges.
It preferably, is the key set key version information in data field, member's version information is arranged in each member for including for key.
Step 102: judge with the presence or absence of member to be deleted at least one member, if so, 103 are thened follow the steps, if
It is no, then execute setting operation.
Since each key in data field has one or more members, it needs to judge current key pair in step 102
It whether there is member to be deleted in the member answered.
It should be noted that can judge one by one when whether there is member to be deleted in judging at least one member
Whether the current corresponding each member of key is member to be deleted.Can directly judge whether current key is key to be deleted, if so,
Then determine that the corresponding whole members of current key are member to be deleted.It can be with
Wherein, setting operation can be set as judging in next key in data field with the presence or absence of member to be deleted.
Step 103: member to be deleted if it exists then deletes member to be deleted according to judging result.
After determining the corresponding member to be deleted of the current key in data field, it can be deleted according to judging result to be deleted
Member.
Repeating step 101 to step 103 can be realized inquiry to each key of data field and member to be deleted
It deletes, to realize the management to the key in data field when database bottom merges.
The data base management method provided through the embodiment of the present invention is receiving the behaviour to certain key stored in database
When making, it can be only updated in version information of the server front end to the key, due to number after being updated to the version information of key
It is the key not updated according to the key stored in library, data is then unable to get when so accessing the key again, key is deleted in deflecting realization
It removes.Compared to it is existing needs one by one from database in delete key member scheme, can shorten deletion successfully response when
Between.And when specifically carrying out delete operation to the member of the key in database, by the key in inquiry data field, judge member couple
The member's version information answered whether the current key matches version information with key, if mismatch, it is determined that the member be it is to be deleted
Member, by member deletion to be deleted.As it can be seen that carrying out data field in database bottom when the delete operation of the member of key in database
It is executed when merging, the load of server can't be occupied.In summary, data base administration side provided in an embodiment of the present invention
Case can either shorten and delete the successful response time, will not also bring extra load for server.
Embodiment two
Referring to Fig. 2, a kind of step flow chart of data base management method of the embodiment of the present invention two is shown.
The data base management method of the embodiment of the present invention specifically includes the following steps:
Step 201: receiving at least one key, and received key is saved within a data area.
Wherein key has corresponding first key version information, and each member in key believes with corresponding first member version
Breath, and for each key, the first key version information and first member's matches version information.That is, key and key include
The matches version information of member.
Preferably, key version information is stored in the metamessage of corresponding key.One key is comprising metamessage and extremely
A few member, increasing key version information is not necessarily to increase the field of information to add key version information, nothing in the metamessage of key
It need to modify to the structure of key.
During database concrete application, if the pre- deletion received to some key stored in data field indicates, is right
The pre- deletion of some member in key indicates or when to the update instruction of a certain key, then corresponding to corresponding key in server front end
Key version information, the corresponding member's version information of member be updated, be updated to newer version information.So as into
When row data field merges and data field updates, key version information and member's version information logarithm according to server front end storage
It is managed according to the key in area.Specific update mode is as follows:
If receiving the pre- deletion instruction to a certain key, the corresponding first key version information of the key is updated to newer
Second key version information, wherein the second key version information and first member's version information mismatch.
Such as: the corresponding first key version information of the key A stored in data field be 0, the first one-tenth of each member that key A includes
Member's version information is also 0, after receiving the instruction of the pre- deletion to key A, is then believed the corresponding key version of key A in server front end
Breath 0 is updated to 1, and the corresponding member's version information of member for including for key A is then without updating, i.e., member's version information according to
It is so 0.
If receiving the instruction of the pre- deletion to a certain member of a certain key, the corresponding first key version information of the key is updated
For the second newer key version information, and the key, other members in addition to the member first member's version information is updated
For second newer member's version information, wherein the second key version information and first member's version information mismatches and the second key version
This information and second member's matches version information.
Such as: the corresponding first key version information of the key A stored in data field is 0, key A include each member be respectively 1,2,
3 and 4, the corresponding first member version information of four members is 0, is indicated when receiving the pre- deletion to the member 1 in key A
Afterwards, then the corresponding key version information 0 of key A is updated to 1 in server front end, and for the corresponding member of member 1 that key A includes
Version information is still then 0 without updating the i.e. corresponding member's version information of member 1, and member 2,3 and 4 corresponding members' versions
This information is then updated to second member's version information 1.That is, the version of member 2,3 and 4 and key A is updated
And belong to same version;And member 1 then no longer matches with the version of key A, the high level-one of version of the version of key A compared with member 1.
If receiving the update instruction to a certain key, the corresponding first key version information of the key is updated to newer
Two key version informations, and the corresponding first member version information of the member of the key is updated to second newer member's version and is believed
Breath, wherein the second key version information and second member's matches version information.It wherein, include: to this to the update instruction of a certain key
The instruction that the value of the existing member of key is updated, and/or increase the key instruction of newcomer.
Such as: the corresponding first key version information of the key A stored in data field is 0, key A include each member be respectively 1,2,
3 and 4, the corresponding first member version information of four members is 0.After receiving the update instruction for increasing member 5 in A,
The corresponding key version information of A will be subtracted in server front end and be updated to 1 by 0, the corresponding member's version of five members for including by key A
Information is updated, and is updated to 1.That is, including by the version of key and key after receiving to the update instruction of key
The version of member is updated, and key and member belong to same version.
In the embodiment of the present invention, in database operational process when the key in database is deleted in advance, update or
When deleted in advance the member that key includes, server background thread can't be occupied immediately within a data area to the key selected
Carry out corresponding operating, and can be only updated in version information of the server front end to key and/or member, updated key or at
The version for the corresponding key that the version of member is stored to data field is different, therefore can not get respective counts when key is requested again
According to that is, key is deleted in deflecting.And the deletion for key and/or member in data field, it is in certain spies
It can just be triggered under fixed opportunity, and be to be carried out when database bottom merges, therefore not will increase the additional negative of server
It carries.
It should be noted that step 201 is how to be optional step the step of write key into data field.Specific
During realization, it is not necessarily to execute the step if being stored with each key in data field.
Step 202: the key in inquiry data field.
Inquiry data are executed under any suitable form it should be noted that can be set into during specific implementation
The operation of key in area is not specifically limited this in the embodiment of the present invention.Such as: it is arranged to when a data field and another number
When merging according to area, the operation of the key in inquiry data field is executed to the data field after merging.Such as: when receiving to data field
When data scrubbing is requested, the operation of the key in inquiry data field is executed.Again for example: being set when the data volume of certain data field storage exceeds
When definite value, data field merging is carried out, the operation of the key in inquiry data field is executed to the data field after merging.
During specific implementation, the data field inquired is to need to merge or the data field of data scrubbing.Number
According to that may be stored with multiple keys in area, each key has at least one member.So, it in the key inquired in data field, then needs
Inquiry judging is carried out by granularity of member, to judge each member to be deleted in each key and be deleted.
Below to include to be illustrated for a member is handled to a key in data field.It was implementing
Cheng Zhong needs each member for successively including to each key of data field to execute the process flow, with the management of database.
Step 203: judge the corresponding member's version information of the member whether the current key version information with the key
Match, if so, setting operation is executed, if it is not, thening follow the steps 204.
Current key version information is newest key version information in the corresponding key version information of the key.Wherein, member couple
The member's version information answered is identical as the current key version information of key or two version informations indicate same version, then really
Both fixed matching;It is on the contrary, it is determined that the two mismatches.
Such as: the key version information of key A is 0 in data field, and the member's version information for the member 1 that key A includes also is 0, and
The current key version information of key A is 1.So, due to member's version information of member 1 and key A current key version information not
Match, accordingly, it is determined that member 1 is member to be deleted.
Wherein, setting operation can set the key for returning and executing in inquiry data field and select next member, and judge to select
Select whether the member is member to be deleted.
It is a kind of preferably to judge the corresponding member's version information of member current key matches version information whether corresponding with key
Concrete mode is as follows:
S1: the corresponding all key version informations of key are obtained.
In server front end after receiving the deletion to key, update instruction, the key version information of key can occur
It updates.Therefore, if the key is deleted or updates repeatedly, in the server front end key before data field merges or data update
Then it is corresponding with multiple key version informations.Therefore, it is necessary to obtain the corresponding all key version informations of key.
S2: newest key version information is selected by comparing using as current key version information.
Such as: key version information is indicated with Arabic numerals.The key version information of most initial is indicated with 0, each pair of
Key version information is once updated, i.e., by number plus 1.If being had updated three times to key version information, then, the corresponding institute of the key
There is key version information are as follows: 0,1,2 and 3.Correspondingly, the newest key version information of key is then 3.
S3: member's version information and the current key version information, if both comparison result displays are consistent,
Both judgements matching.
Each member of each key is corresponding with member's version information within a data area.Pass through the corresponding member's version of member
Information is compared with the current key version information of the key where member, can determine whether the version of the member is latest edition
This, if so, without handling it, if not latest edition, then need to delete it from data field.
Step 204: when whether the corresponding member's version information of member mismatches with the current key version information of key, then really
The fixed member is member to be deleted.
The current key version information of member's version information and key mismatches, then illustrates that member is different from the version of key, therefore,
The member deletion that need to will be stored in data field.
Step 205: deleting member to be deleted according to judging result.
It has been determined that the member is member to be deleted by step 204, is then needed at this time by the member from data field
It deletes.
So far, the management process of the member stored in data field has been completed, has repeated above-mentioned process to data
Each member stored in area deletes or retains, and the management to database can be completed.
The data base management method provided through the embodiment of the present invention is receiving the behaviour to certain key stored in database
When making, it can be only updated in version information of the server front end to the key, due to number after being updated to the version information of key
It is the key not updated according to the key stored in library, data is then unable to get when so accessing the key again, key is deleted in deflecting realization
It removes.Compared to it is existing needs one by one from database in delete key member scheme, can shorten deletion successfully response when
Between.And when specifically carrying out delete operation to the member of the key in database, by the key in inquiry data field, judge member couple
The member's version information answered whether the current key matches version information with key, if mismatch, it is determined that the member be it is to be deleted
Member, by member deletion to be deleted.As it can be seen that carrying out data field in database bottom when the delete operation of the member of key in database
It is executed when merging, the load of server can't be occupied.In summary, data base administration dress provided in an embodiment of the present invention
It sets, can either shorten and delete the successful response time, will not also increase extra load for server.
Embodiment three
Referring to Fig. 3, a kind of structural block diagram of data bank management device of the embodiment of the present invention three is shown.
The data bank management device of the embodiment of the present invention includes: enquiry module 301, for inquiring the key in data field, institute
Key is stated at least one member;Judgment module 302, for judge at least one described member with the presence or absence of it is to be deleted at
Member;Execution module 303, if the judging result for the judgment module is to delete according to judging result described wait delete when being
The member removed.
The data bank management device provided through the embodiment of the present invention is receiving the behaviour to certain key stored in database
When making, it can be only updated in version information of the server front end to the key, due to number after being updated to the version information of key
It is the key not updated according to the key stored in library, data is then unable to get when so accessing the key again, key is deleted in deflecting realization
It removes.Compared to it is existing needs one by one from database in delete key member scheme, can shorten deletion successfully response when
Between.And when specifically carrying out delete operation to the member of the key in database, by the key in inquiry data field, judge member couple
The member's version information answered whether the current key matches version information with key, if mismatch, it is determined that the member be it is to be deleted
Member, by member deletion to be deleted.As it can be seen that carrying out data field in database bottom when the delete operation of the member of key in database
It is executed when merging, the load of server can't be occupied.In summary, data base administration dress provided in an embodiment of the present invention
It sets, can either shorten and delete the successful response time, will not also bring additional load for server.
Example IV
Referring to Fig. 4, a kind of structural block diagram of data bank management device of the embodiment of the present invention four is shown.
The embodiment of the present invention is advanced optimizing to the data bank management device in embodiment three, the database after optimization
Managing device includes: enquiry module 401, and for inquiring the key in data field, the key has at least one member;Judgment module
402, for judging at least one described member with the presence or absence of member to be deleted;Execution module 403, if being used for the judgement
The judging result of module is when being, then to delete the member to be deleted according to judging result.
Preferably, the key has corresponding key version information, and the member has corresponding member's version information, and
The judgment module 402 includes: version information judgment module 4021, for judging that the corresponding member's version information of the member is
The no current key matches version information with the key, the current key version information be in the corresponding key version information of the key most
New key version information;Member's determining module 4022 to be deleted, if the judging result for the version information judgment module is
When no, it is determined that the member is member to be deleted.
Preferably, the version information judgment module 4021 includes: version information acquisition submodule 40211, for obtaining
The corresponding all key version informations of the key;Latest version information determines submodule 40212, newest for selecting by comparing
Key version information is using as the current key version information;Comparative sub-module 40213, for member's version information with
The current key version information;It determines submodule 40214, if consistent for both comparison result displays, judges the two matching.
Preferably, the key version information is stored in the metamessage of corresponding key.
Preferably, the number when a data field merges with another data field, after calling 401 pairs of enquiry module merging
The operation of the key in the inquiry data field is executed according to area.
Preferably, when receiving the request of the data scrubbing to the data field, the enquiry module 401 is called to execute institute
State the operation of the key in inquiry data field.
Preferably, described device further include: key information receiving module 404 for receiving at least one described key, and will connect
The key received is stored in the data field, wherein the key has corresponding first key version information, the member has
Corresponding first member version information, and for key described in each, the first key version information and first member version
This information matches.
Preferably, described device further include: key deletes instruction receiving module 405 in advance, if for receiving to a certain key
It is pre- to delete instruction, then the corresponding first key version information of the key is updated to the second newer key version information, wherein described the
Two key version informations and the first member version information mismatch.
Preferably, described device further include: member deletes instruction receiving module 406 in advance, if for receiving to a certain key
The pre- deletion of a certain member indicates, then the corresponding first key version information of the key is updated to the second newer key version information,
And the key, other members in addition to the member the first member version information is updated to second newer member's version
Information, wherein the second key version information and the first member version information mismatch and the second key version information with
The second member matches version information.
Preferably, described device further include: key update instruction receiving module 407, if for receiving to a certain key more
The corresponding first key version information of the key, then is updated to the second newer key version information by new instruction, and by the member of the key
The corresponding first member version information is updated to second newer member's version information, wherein the second key version information
With the second member matches version information.
Preferably, the update instruction to a certain key includes: the instruction being updated to the value of the existing member of the key,
And/or increase the key instruction of newcomer.
The data bank management device of the present embodiment is for realizing data depositary management corresponding in previous embodiment one, embodiment two
Reason method, and the beneficial effect with corresponding embodiment of the method, details are not described herein.
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are with
The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.For system embodiment
For, since it is basically similar to the method embodiment, so being described relatively simple, referring to the portion of embodiment of the method in place of correlation
It defends oneself bright.
Provided herein database management schemes not with any certain computer, virtual system or the intrinsic phase of other equipment
It closes.Various general-purpose systems can also be used together with teachings based herein.As described above, construction has present invention side
Structure required by the system of case is obvious.In addition, the present invention is also not directed to any particular programming language.It should be bright
It is white, it can use various programming languages and realize summary of the invention described herein, and retouched above to what language-specific was done
State is in order to disclose the best mode of carrying out the invention.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention
Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects,
Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect
Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, such as right
As claim reflects, inventive aspect is all features less than single embodiment disclosed above.Therefore, it then follows tool
Thus claims of body embodiment are expressly incorporated in the specific embodiment, wherein each claim conduct itself
Separate embodiments of the invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment
Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any
Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed
All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power
Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose
It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention
Within the scope of and form different embodiments.For example, in detail in the claims, embodiment claimed it is one of any
Can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors
Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice
Microprocessor or digital signal processor (DSP) are some in database management schemes according to an embodiment of the present invention to realize
Or some or all functions of whole components.The present invention is also implemented as one for executing method as described herein
Partly or completely device or device program (for example, computer program and computer program product).Such realization is originally
The program of invention can store on a computer-readable medium, or may be in the form of one or more signals.In this way
Signal can be downloaded from an internet website to obtain, be perhaps provided on the carrier signal or be provided in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability
Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real
It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch
To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame
Claim.
The invention discloses A1, a kind of data base management method, comprising:
The key in data field is inquired, the key has at least one member;
Judge to whether there is member to be deleted at least one described member;
If so, deleting the member to be deleted according to judging result.
A2, method according to a1, wherein the key has corresponding key version information, and the member, which has, to be corresponded to
Member's version information and the judgement described in specifically included with the presence or absence of member to be deleted at least one member:
Judge the corresponding member's version information of the member whether the current key matches version information with the key, it is described to work as
Preceding key version information is newest key version information in the corresponding key version information of the key;
If not, it is determined that the member is member to be deleted.
A3, the method according to A2, wherein judge the corresponding member's version information of the member whether with the key pair
The current key matches version information answered specifically includes:
Obtain the corresponding all key version informations of the key;
Newest key version information is selected by comparing using as the current key version information;
Compare member's version information and the current key version information;
If both comparison result displays are consistent, the two matching is judged.
A4, the method according to any one of A1-A3, wherein the key version information is stored in corresponding key
Metamessage in.
A5, the method according to any one of A1-A4, wherein right when a data field merges with another data field
Data field after merging executes the step of key in the inquiry data field.
A6, the method according to any one of A1-A4, wherein the data scrubbing of the data field is asked when receiving
When asking, execute it is described inquiry data field in key the step of.
A7, the method according to any one of A1-A6, wherein the method also includes:
At least one described key is received, and the received key is stored in the data field, wherein the key has
Corresponding first key version information, the member have corresponding first member version information, and for key described in each, institute
State the first key version information and the first member matches version information.
A8, the method according to A7, wherein the method also includes:
If receiving the pre- deletion instruction to a certain key, the corresponding first key version information of the key is updated to newer
Second key version information, wherein the second key version information and the first member version information mismatch.
A9, the method according to A7, wherein the method also includes:
If receiving the instruction of the pre- deletion to a certain member of a certain key, the corresponding first key version information of the key is updated
For the second newer key version information, and by the key, other members in addition to the member the first member version information
It is updated to second newer member's version information, wherein the second key version information and the first member version information are not
Match and the second key version information and the second member matches version information.
A10, the method according to A7, wherein the method also includes:
If receiving the update instruction to a certain key, the corresponding first key version information of the key is updated to newer
Two key version informations, and the corresponding first member version information of the member of the key is updated to second newer member's version
Information, wherein the second key version information and the second member matches version information.
A11, the method according to A7, wherein the update instruction to a certain key includes: the existing member to the key
The instruction that is updated of value, and/or increase the key instruction of newcomer.
The invention also discloses B12, a kind of data bank management device, comprising:
Enquiry module, for inquiring the key in data field, the key has at least one member;
Judgment module, for judging at least one described member with the presence or absence of member to be deleted;
Execution module, if the judging result for the judgment module is when being, according to judging result delete it is described to
The member of deletion.
B13, device according to b12, wherein the key have corresponding key version information, the member have pair
The member's version information and the judgment module answered include:
Version information judgment module, for judging whether the corresponding member's version information of the member is current with the key
Key matches version information, the current key version information are newest key version information in the corresponding key version information of the key;
Member's determining module to be deleted, if the judging result for the version information judgment module is no, it is determined that
The member is member to be deleted.
B14, device according to b13, wherein the version information judgment module includes:
Version information acquisition submodule, for obtaining the corresponding all key version informations of the key;
Latest version information determines submodule, for selecting newest key version information by comparing using as described current
Key version information;
Comparative sub-module, for member's version information and the current key version information;
It determines submodule, if consistent for both comparison result displays, judges the two matching.
B15, the device according to any one of B12-B14, wherein the key version information is stored in corresponding
In the metamessage of key.
B16, the device according to any one of B12-B15, wherein when a data field merges with another data field
When, the operation for the key for calling the enquiry module to be executed in the inquiry data field to the data field after merging.
B17, the device according to any one of B12-B15, wherein when receiving the data scrubbing to the data field
When request, the operation for the key for calling the enquiry module to execute in the inquiry data field.
B18, the device according to any one of B12-B17, wherein described device further include:
Key information receiving module is stored in the data for receiving at least one described key, and by the received key
Qu Zhong, wherein the key has corresponding first key version information, the member has corresponding first member version information, and
For key described in each, the first key version information and the first member matches version information.
B19, the device according to B18, wherein described device further include:
Key deletes instruction receiving module in advance, if for receiving the pre- deletion instruction to a certain key, the key is corresponding
First key version information is updated to the second newer key version information, wherein the second key version information and first member
Version information mismatches.
B20, the device according to B18, wherein described device further include:
Member deletes instruction receiving module in advance, if for receiving the instruction of the pre- deletion to a certain member of a certain key, it will
The corresponding first key version information of the key is updated to the second newer key version information, and by the key, its in addition to the member
The first member version information of his member is updated to second newer member's version information, wherein the second key version is believed
Breath and the first member version information mismatch and the second key version information and the second member matches version information.
B21, the device according to B18, wherein described device further include:
Key update instruction receiving module, if for receiving the update instruction to a certain key, by the key corresponding first
Key version information is updated to the second newer key version information, and by the corresponding first member version information of the member of the key
It is updated to second newer member's version information, wherein the second key version information and the second member version information
Match.
B22, the device according to B18, wherein the update instruction to a certain key includes: having into the key
The instruction that the value of member is updated, and/or increase the key instruction of newcomer.
Claims (20)
1. a kind of data base management method, comprising:
The key in data field is inquired, the key has at least one member;
Judge to whether there is member to be deleted at least one described member;
If so, deleting the member to be deleted according to judging result;
The method also includes:
At least one described key is received, and the received key is stored in the data field, is corresponded to wherein the key has
The first key version information, the member has corresponding first member version information, and for key described in each, described the
One key version information and the first member matches version information.
2. the method according to claim 1, wherein the key has corresponding key version information, the member
With specific with the presence or absence of member to be deleted at least one member described in corresponding member's version information and the judgement
Include:
Judge the corresponding member's version information of the member whether the current key matches version information with the key, the current key
Version information is newest key version information in the corresponding key version information of the key;
If not, it is determined that the member is member to be deleted.
3. according to the method described in claim 2, it is characterized in that, judge the corresponding member's version information of the member whether with
The corresponding current key matches version information of the key specifically includes:
Obtain the corresponding all key version informations of the key;
Newest key version information is selected by comparing using as the current key version information;
Compare member's version information and the current key version information;
If both comparison result displays are consistent, the two matching is judged.
4. according to the method described in claim 2, it is characterized in that, the key version information is stored in the member of corresponding key
In information.
5. method according to any of claims 1-4, which is characterized in that when a data field and another data field are closed
And when, to the data field after merging execute it is described inquiry data field in key the step of.
6. method according to any of claims 1-4, which is characterized in that when receiving the data to the data field
Cleaning request when, execute it is described inquiry data field in key the step of.
7. the method according to claim 1, wherein the method also includes:
If receiving the pre- deletion instruction to a certain key, the corresponding first key version information of the key is updated to newer second
Key version information, wherein the second key version information and the first member version information mismatch.
8. the method according to claim 1, wherein the method also includes:
If receive the pre- deletion to a certain member of a certain key instruction, by the corresponding first key version information of the key be updated to compared with
The second new key version information, and the key, other members in addition to the member the first member version information is updated
For second newer member's version information, wherein the second key version information and the first member version information mismatch and
The second key version information and the second member matches version information.
9. the method according to claim 1, wherein the method also includes:
If receiving the update instruction to a certain key, the corresponding first key version information of the key is updated to the second newer key
Version information, and the corresponding first member version information of the member of the key is updated to second newer member's version and is believed
Breath, wherein the second key version information and the second member matches version information.
10. according to the method described in claim 9, it is characterized in that, the update instruction to a certain key includes: to the key
The instruction that the value of existing member is updated, and/or increase the key instruction of newcomer.
11. a kind of data bank management device, comprising:
Enquiry module, for inquiring the key in data field, the key has at least one member;
Judgment module, for judging at least one described member with the presence or absence of member to be deleted;
Execution module, if the judging result for the judgment module is to delete according to judging result described to be deleted when being
Member;
Described device further include:
Key information receiving module is stored in the data field for receiving at least one described key, and by the received key,
Wherein the key have corresponding first key version information, the member have corresponding first member version information, and for
Each described key, the first key version information and the first member matches version information.
12. device according to claim 11, which is characterized in that the key have corresponding key version information, it is described at
Member has corresponding member's version information and the judgment module includes:
Version information judgment module, for judge the corresponding member's version information of the member whether the current key version with the key
This information matches, the current key version information are newest key version information in the corresponding key version information of the key;
Member's determining module to be deleted, if the judging result for the version information judgment module is no, it is determined that described
Member is member to be deleted.
13. device according to claim 12, which is characterized in that the version information judgment module includes:
Version information acquisition submodule, for obtaining the corresponding all key version informations of the key;
Latest version information determines submodule, for selecting newest key version information by comparing using as the current key version
This information;
Comparative sub-module, for member's version information and the current key version information;
It determines submodule, if consistent for both comparison result displays, judges the two matching.
14. device according to claim 12, which is characterized in that the key version information is stored in corresponding key
In metamessage.
15. device described in any one of 1-14 according to claim 1, which is characterized in that when a data field and another data
When area merges, the operation for the key for calling the enquiry module to be executed in the inquiry data field to the data field after merging.
16. device described in any one of 1-14 according to claim 1, which is characterized in that when receiving to the data field
When data scrubbing is requested, the operation for the key for calling the enquiry module to execute in the inquiry data field.
17. device according to claim 11, which is characterized in that described device further include:
Key deletes instruction receiving module in advance, if for receiving the pre- deletion instruction to a certain key, by the key corresponding first
Key version information is updated to the second newer key version information, wherein the second key version information and the first member version
Information mismatches.
18. device according to claim 11, which is characterized in that described device further include:
Member deletes instruction receiving module in advance, if for receiving the instruction of the pre- deletion to a certain member of a certain key, by the key
Corresponding first key version information is updated to the second newer key version information, and by the key, in addition to the member other at
Member the first member version information be updated to second newer member's version information, wherein the second key version information with
The first member version information mismatch and the second key version information and the second member matches version information.
19. device according to claim 11, which is characterized in that described device further include:
Key update instruction receiving module, if for receiving the update instruction to a certain key, by the corresponding first key version of the key
This information update is the second newer key version information, and the corresponding first member version information of the member of the key is updated
For second newer member's version information, wherein the second key version information and the second member matches version information.
20. device according to claim 19, which is characterized in that the update instruction to a certain key includes: to the key
Existing member the instruction that is updated of value, and/or increase the key instruction of newcomer.
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 CN105574196A (en) | 2016-05-11 |
CN105574196B true 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 (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102402590A (en) * | 2011-10-31 | 2012-04-04 | 深圳中兴力维技术有限公司 | Managing method and system of key value data |
CN104572920A (en) * | 2014-12-27 | 2015-04-29 | 北京奇虎科技有限公司 | Data arrangement method and data arrangement device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9632944B2 (en) * | 2013-04-22 | 2017-04-25 | Sap Se | Enhanced transactional cache |
-
2015
- 2015-12-25 CN CN201510997650.2A patent/CN105574196B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102402590A (en) * | 2011-10-31 | 2012-04-04 | 深圳中兴力维技术有限公司 | Managing method and system of key value data |
CN104572920A (en) * | 2014-12-27 | 2015-04-29 | 北京奇虎科技有限公司 | Data arrangement method and data arrangement device |
Also Published As
Publication number | Publication date |
---|---|
CN105574196A (en) | 2016-05-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10521310B2 (en) | Prioritized deployment of database artifacts | |
US10055509B2 (en) | Constructing an in-memory representation of a graph | |
CN105183394B (en) | A kind of data storage handling method and device | |
US8832173B2 (en) | System and method of multithreaded processing across multiple servers | |
US8689231B2 (en) | System and method for ordering tasks with complex interrelationships | |
US7769789B2 (en) | High performant row-level data manipulation using a data layer interface | |
US10146668B1 (en) | Modeling code coverage in software life cycle | |
US20190102427A1 (en) | Online optimizer statistics maintenance during load | |
US9086911B2 (en) | Multiprocessing transaction recovery manager | |
US20120054245A1 (en) | Transactionally consistent database replay in an environment with connection pooling | |
US10275234B2 (en) | Selective bypass of code flows in software program | |
CN109117172A (en) | A kind of method and device of the terminal versions number identification of target terminal | |
CN108228799A (en) | The storage method and device of object indexing information | |
CN106227769B (en) | Date storage method and device | |
US10540255B2 (en) | Staged refinement for static analysis | |
US8682637B2 (en) | System, method and computer program product for comparing results of performing a plurality of operations with results of simulating the plurality of operations | |
US20180260441A1 (en) | Context based access path selection | |
CN105574196B (en) | A kind of data base management method and device | |
US10402185B2 (en) | Precision locking a database server during the upgrade of a system landscape | |
CN113626472B (en) | Method and device for processing order data | |
CN108121514A (en) | Metamessage update method, device, computing device and computer storage media | |
US9928039B2 (en) | Stateful development control | |
CN110597549B (en) | Searching method, device and equipment in code engineering and readable storage medium | |
CN105630889A (en) | Method and device for realizing generic cache | |
CN108733361A (en) | A kind of method and apparatus for realizing concurrent container |
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. |