CN105653635A - Database management method and apparatus - Google Patents

Database management method and apparatus Download PDF

Info

Publication number
CN105653635A
CN105653635A CN201510997680.3A CN201510997680A CN105653635A CN 105653635 A CN105653635 A CN 105653635A CN 201510997680 A CN201510997680 A CN 201510997680A CN 105653635 A CN105653635 A CN 105653635A
Authority
CN
China
Prior art keywords
key
expired
time
list
management
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.)
Pending
Application number
CN201510997680.3A
Other languages
Chinese (zh)
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
Qizhi Software Beijing 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 CN201510997680.3A priority Critical patent/CN105653635A/en
Publication of CN105653635A publication Critical patent/CN105653635A/en
Pending legal-status Critical Current

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a database management method and apparatus. The method comprises the steps of calling a first management thread to inspect and store a key list with outdated keys; if it is inspected that the outdated keys exist in the key list, adding the outdated keys into a deletion queue; and calling a second management thread to delete each outdated key according to an arrangement sequence of the outdated keys in the deletion queue. Through the database management scheme provided by the invention, the response speed of the deletion operation on the outdated keys can be increased.

Description

Data base management method and device
Technical field
The present invention relates to database management technology field, particularly relate to a kind of data base management method withDevice.
Background technology
Redis is a key-value (being key assignments) storage system. It supports the value type phase of storingTo more, comprise string (character string), list (chained list), set (set), zset (sortedset--ordered setClose) and hash (Hash type). These data types are all supported to increase key, delete key, key is got to friendshipThe operations such as collection union. The no matter value type of which kind of storage, in the time of storage, a key all can comprise multipleMember. The diversity of database based on redis based on its type of supporting, is extensively made at presentWith.
Existing database management schemes, the expired key in the database to based on redis be (deletionKey or exceed the key of setting expired time) while managing, if delete a certain expired key, need pipeReason thread accesses database, a member who at every turn deletes this expired key from database, so, ifThe number of members that expired key comprises is very many, needs to spend the plenty of time can complete this expiredThe deletion of key, also wait as long for and can obtain deleting successful response results. And, above-mentionedFlow process completes carrying out the deletion action to the expired key of the next one after the deletion of an expired key,This need to wait as long for the posterior expired key to be deleted that causes sorting can obtain deleting and ringsShould.
Visible, existing database management schemes, low-response while processing the deletion action of expired key.
Summary of the invention
In view of existing database management schemes, process the problem of the deletion action low-response of expired key,The present invention is proposed to a kind of data base management method and device that overcomes the problems referred to above is provided.
According to one aspect of the present invention, a kind of data base management method is provided, comprising: callOne management thread inspection storage has the key list of the key of expired time; If be checked through in described key listThere is expired key, described expired key is added into and is deleted in queue; And call the second management thread byThe putting in order in described deletion queue according to expired key, deletes each expired key successively.
Preferably, described method also comprises: set up described key list, and will have the key of expired timeWrite described key list.
Preferably, described in, call the key row of the key that the first management thread inspection storage has expired timeTable, specifically comprises: call the first management thread inspection storage according to setting-up time interval and have when expiredBetween the key list of key.
Preferably, in described key list, store the mapping relations of key and corresponding expired time.
Preferably, described in call the first management thread and check described key list, specifically comprise: obtain and work asExpired time corresponding to each key in front time and described key list; If a certain expired time and described working asThe front time does not mate, and judges that the key corresponding with described expired time is as expired key.
Preferably, described expired key comprises multiple members, and deletes calling described the second management threadWhen the described expired key, delete successively described many according to putting in order of multiple members of described expired keyIndividual member.
According to another aspect of the present invention, a kind of data bank management device is provided, comprising: firstCalling module, has the key list of the key of expired time for calling the first management thread inspection storage;Add module, if there is expired key for being checked through described key list, described expired key is added intoDelete in queue; And second calling module, for call the second management thread according to expired key in instituteState and delete putting in order in queue, delete successively each expired key.
Preferably, described device also comprises: set up module, and for setting up described key list, and by toolThere is the key of expired time to write described key list.
Preferably, described the first calling module specifically for: call the first pipe according to setting-up time intervalReason thread inspection storage has the key list of the key of expired time.
Preferably, in described key list, store the mapping relations of key and corresponding expired time.
Preferably, described the first calling module comprises: expired time acquisition module, and current for obtainingExpired time corresponding to each key in time and described key list; Time judgment module, if for a certainExpired time is not mated with described current time, judges that the key corresponding with described expired time is as expiredKey.
Preferably, described expired key comprises multiple members, and described the second calling module is callingWhile stating the described expired key of the second management thread deletion, multiple members' of the described expired key of foundation arrangement is suitableOrder is deleted described multiple member successively.
The database management schemes that the embodiment of the present invention provides, by the first management thread on foreground to mistakePhase key manages, and expired key is deleted on backstage from database by the second management threadThe deletion action of the expired key of executed in parallel, can promote the response speed of expired key being carried out to deletion actionDegree. Particularly, check that by the first management thread then expired key adds the expired key being checked through to delete toExcept in queue, now, the first management thread has completed returns to deletion to the deletion action of this expired keySuccessfully response results, the deletion action of the next expired key of continuation response. Compared to existing needsEach member that delete key comprises one by one from database just responds the side of the deletion action of next expired keyCase, not only can shorten when the response success time of the expired key of pre-treatment, can also shorten nextIndividual expired key carries out the response time of deletion action. The second management thread can complete on backstage concreteThe deletion of deleting the expired key in queue, the time that the second management thread Delete Expired key spends is notCan affect the response speed that expired key is deleted.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, of the present invention in order to better understandTechnological means, and can being implemented according to the content of description, and for allow of the present invention above-mentioned andOther objects, features and advantages can become apparent, below especially exemplified by specific embodiment of the invention sideFormula.
Brief description of the drawings
By reading below detailed description of the preferred embodiment, various other advantage and benefit forIt is cheer and bright that those of ordinary skill in the art will become. Accompanying drawing is only for illustrating the order of preferred embodiment, and do not think limitation of the present invention. And in whole accompanying drawing, with identical reference symbolNumber represent identical parts. In the accompanying drawings:
Fig. 1 shows a kind of steps flow chart of data base management method according to an embodiment of the invention and showsIntention;
Fig. 2 shows a kind of steps flow chart of data base management method according to an embodiment of the invention and showsIntention;
Fig. 3 shows a kind of structural representation of data bank management device according to an embodiment of the inventionFigure; And
Fig. 4 shows a kind of structural representation of data bank management device according to an embodiment of the inventionFigure.
Detailed description of the invention
Exemplary embodiment of the present disclosure is described below with reference to accompanying drawings in more detail. Although show in accompanying drawingExemplary embodiment of the present disclosure, but should be appreciated that and can realize the disclosure and not with various formsThe embodiment that should be set forth here limits. On the contrary, providing these embodiment is for can be more thoroughlyUnderstand the disclosure, and can be by the those skilled in the art that conveys to complete the scope of the present disclosure.
Embodiment mono-
With reference to Fig. 1, show the steps flow chart of a kind of data base management method of the embodiment of the present invention oneFigure.
The data base management method of the embodiment of the present invention comprises the following steps:
Step 101: the key list of calling the first management thread inspection storage and have the key of expired time.
The back-end data base that in the embodiment of the present invention, database is server, stores multiple in databaseKey, and each key comprises multiple members. And in these keys, have be provided with expired time, haveExpired time is not set. In the embodiment of the present invention, in the list of server front end preset key, in key listIn the key with expired time is stored. Moreover, in key list, can also store and wait to deleteThe key removing.
Server calls the first management thread check key list, to determine whether to exist expired key. ItsIn, expired key can be expired key of time, can be also chosen key to be deleted.
Step 102: have expired key if be checked through in key list, expired key is added into deletion queueIn.
The first management thread, can be according to the storage order of key in list in the time that to key, list checksThe character of one a pair of each key and corresponding expired time check, to determine expired key. To examineThe expired key of finding adds to be deleted in queue. Wherein the character of key being stored is in order to judgeWhether key is key to be deleted.
Step 103: call the second management thread according to expired key deleting putting in order in queue, comply withThe each expired key of inferior deletion.
The second management thread is carried out the deletion action of the key in database in server background. Particularly,The second management thread can comprise key and the key deleted in queue one by one for single-threaded from databaseEach member deletion; Certainly, the second management thread can also be multithreading, and each thread process is above-mentionedDelete the key in queue, to realize the parallel deletion of deleting the member that the each key in row and key are comprised, fromAnd can be expired the key processing speed of deleting.
Particularly, the concrete mode that the second management thread is deleted a key from database please be joinedSee correlation technique, in the embodiment of the present invention, this is not done concrete restriction.
The data base management method providing by the embodiment of the present invention, by the first management thread on foregroundExpired key is managed, from database, expired key is deleted on backstage by the second management threadRemove the deletion action of the expired key of executed in parallel, can promote the response of expired key being carried out to deletion actionSpeed. Particularly, check that by the first management thread then expired key adds the expired key being checked through toDelete in queue, now, the first management thread has completed returns and deletes the deletion action of this expired keyExcept successful response results, continue the deletion action of the next expired key of response. Compared to existing needEach member that will delete key comprises one by one from database just responds the deletion action of next expired keyScheme, not only can shorten when the response success time of the expired key of pre-treatment, can also shorten underAn expired key carries out the response time of deletion action. The second management thread can complete specifically on backstageDeletion queue in the deletion of expired key, the time that the second management thread Delete Expired key spends is alsoCan not affect the response speed that expired key is deleted.
Embodiment bis-
With reference to Fig. 2, show the steps flow chart of a kind of data base management method of the embodiment of the present invention twoFigure.
The data base management method of the embodiment of the present invention specifically comprises the following steps:
Step 201: set up key list, and will there is the key write key list of expired time.
In key list, store the mapping relations of key and corresponding expired time.
Wherein, expired time can arrange generation by interface is set accordingly by user. Not only asThis can also store key to be deleted in key list. When certain key is set up corresponding expired timeAfter, need by this key with and corresponding expired time write in the key list of foundation.
Step 202: call the first management thread inspection storage according to setting-up time interval and there is expired timeThe key list of key.
In server, be provided with the first management thread and the second management thread, wherein, the first managementThread moves in server front end, is mainly used in the key in key list to check, determines expired keyAnd expired key is added into and is deleted in queue. And the second management thread is moved in server back end, mainFor carrying out alternately with database, according to deletion queue to be deleted by delete list from databaseEach key delete. Thereby, by the first parallel management thread and the second management thread to databaseIn expired key effectively manage.
Wherein, the setting at very first time interval can be carried out according to the actual requirements by those skilled in the artArrange, for example: be arranged to 1 second, 2 seconds or 1 minute etc., the embodiment of the present invention is not made concrete limit to thisSystem.
A kind of key list of preferably calling the first management thread inspection storage and have the key of expired timeConcrete mode is as follows:
First, obtain expired time corresponding to each key in current time and key list.
Because the key in key list is to there being expired time, therefore, directly by query key listDetermine the expired time that each key is corresponding.
Secondly,, if a certain expired time is not mated with current time, judge corresponding with expired timeKey is expired key.
Judging that expired time, can be by judging current time whether in the time that current time is matedWhether exceed expired time and determine whether coupling, current time does not exceed expired time and determines the twoCoupling, current time exceeded expired time determine the two do not mate.
For example: current time is 2015.12.02.18:00, in key list, comprise two keys and be respectively key AWith key B, the expired time that key A is corresponding is 2015.12.02.17:59, the expired time that key B is correspondingFor 2015.12.03.18:00. When key in check key list, can determine the mistake that key A is correspondingTime phase has exceeded current time, and therefore, key A is expired key; The expired time that key B is corresponding is not superGo out current time, therefore, key B is non-expired key.
It should be noted that, it is the expired time that has of storing in key list that expired key is not limited toKey can also be the key to be deleted of storing in key list. For example: when user carries out and deletes certain keyAfter operation, corresponding processing threads can be added into key to be deleted in key list. The first boundary of administrationJourney, in the time that list checks to key, not only can check out the key that the time is expired, can also check outKey to be deleted, is defined as expired key by key to be deleted. For example: in key list not to havingThe key of time phase can be defined as key to be deleted, and so, the first management thread is in check key listKey to be deleted time, by key whether to there being expired time can complete judgement.
Step 203: have expired key if be checked through in key list, expired key is added into deletion queueIn.
Wherein, expired key comprises multiple members, when expired key is added in deletion queue, also canAdd to and delete in queue with the member that each expired key is comprised.
After the first management thread is added expired key to delete in queue to, complete when pre-treatmentThe deletion action of expired key, can return and delete successful response results. Now, can respond nextThe deletion response of individual expired key.
Step 204: call the second management thread according to expired key deleting putting in order in queue, comply withThe each expired key of inferior deletion.
Wherein, the second management thread can be one, can be also multiple. When the second management thread isWhen single-threaded, access and delete row by single thread, the row according to expired key in deletion queueOrder successively definite expired key is deleted the expired key of determining from database. When the second management thread is manyWhen thread, delete queue by multiple thread parallel access, each thread is difference from delete queueDetermine an expired key, then from database, the expired key of determining is deleted.
The second management thread is arranged to the parallel mode of multiple management thread, single compared to only arrangingThe second management thread can promote the speed of delete key from database.
A kind of can be preferably that foundation is expired in the mode of calling the second management thread Delete Expired keyMultiple members are deleted in putting in order of multiple members of key successively.
For example: expired key is A, its member who comprises is respectively 1,2,3 and 4, four member at keySequence after middle the past is followed successively by 1,3,4 and 2. The second management thread deleting from databaseWhen phase key A, first removing members 1, then removing members 3, and then removing members 4, finally deleteMember 2.
The data base management method providing by the embodiment of the present invention, by the first management thread on foregroundExpired key is managed, from database, expired key is deleted on backstage by the second management threadRemove the deletion action of the expired key of executed in parallel, can promote the response of expired key being carried out to deletion actionSpeed. Particularly, check that by the first management thread then expired key adds the expired key being checked through toDelete in queue, now, the first management thread has completed returns and deletes the deletion action of this expired keyExcept successful response results, continue the deletion action of the next expired key of response. Compared to existing needEach member that will delete key comprises one by one from database just responds the deletion action of next expired keyMethod, not only can shorten when the response success time of the expired key of pre-treatment, can also shorten underAn expired key carries out the response time of deletion action. The second management thread can complete specifically on backstageDeletion queue in the deletion of expired key, the time that the second management thread Delete Expired key spends is alsoCan not affect the response speed that expired key is deleted.
Embodiment tri-
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: the first calling module 301, and for callingOne management thread inspection storage has the key list of the key of expired time; Add module 302, if for inspectionFind in described key list and have expired key, described expired key is added into and is deleted in queue; And theTwo calling modules 303, for call the second management thread according to expired key the row in described deletion queueRow order, deletes each expired key successively.
The data bank management device providing by the embodiment of the present invention, by the first management thread on foregroundExpired key is managed, from database, expired key is deleted on backstage by the second management threadRemove the deletion action of the expired key of executed in parallel, can promote the response of expired key being carried out to deletion actionSpeed. Particularly, check that by the first management thread then expired key adds the expired key being checked through toDelete in queue, now, the first management thread has completed returns and deletes the deletion action of this expired keyExcept successful response results, continue the deletion action of the next expired key of response. Compared to existing needEach member that will delete key comprises one by one from database just responds the deletion action of next expired keyMethod, not only can shorten when the response success time of the expired key of pre-treatment, can also shorten underAn expired key carries out the response time of deletion action. The second management thread can complete specifically on backstageDeletion queue in the deletion of expired key, the time that the second management thread Delete Expired key spends is alsoCan not affect the response speed that expired key is deleted.
Embodiment tetra-
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 data bank management device of the embodiment of the present invention is to the data bank management device in embodiment tri-Further optimize, the data bank management device after optimization comprises: the first calling module 401, and for callingThe first management thread inspection storage has the key list of the key of expired time; Add module 402, if forBe checked through in described key list and have expired key, described expired key is added into and is deleted in queue; AndThe second calling module 403, for call the second management thread according to expired key in described deletion queuePut in order, delete successively each expired key.
Preferably, described device also comprises: set up module 404, and for setting up described key list, and willThe key with expired time writes described key list.
Preferably, described the first calling module 401 specifically for: call first according to setting-up time intervalManagement thread inspection storage has the key list of the key of expired time.
Preferably, in described key list, store the mapping relations of key and corresponding expired time.
Preferably, described the first calling module 401 comprises: expired time acquisition module 4011, forObtain expired time corresponding to each key in current time and described key list; Time judgment module4012, if do not mate with described current time for a certain expired time, judge with described when expiredBetween corresponding key be expired key.
Preferably, described expired key comprises multiple members, and described the second calling module 403 is callingWhen described the second management thread is deleted described expired key, multiple members' of the described expired key of foundation arrangementOrder is deleted described multiple member successively.
The data bank management device of the embodiment of the present invention is used for realizing previous embodiment one and embodiment bis-In corresponding data base management method, and there is the beneficial effect of corresponding embodiment of the method, at thisRepeat no more.
Each embodiment in this description all adopts the mode of going forward one by one to describe, and each embodiment emphasis is saidBright is all and the difference of other embodiment that between each embodiment, identical similar part is mutualReferring to. For device embodiment, because it is substantially similar to embodiment of the method, so retouchThat states is fairly simple, and relevant part is referring to the part explanation of embodiment of the method.
The database management schemes providing at this not with any certain computer, virtual system or otherEquipment is intrinsic relevant. Various general-purpose systems also can with based on using together with this teaching. According to upperThe description of face, the desired structure of system that structure has the present invention program is apparent. ThisOutward, the present invention is not also for any certain programmed language. It should be understood that and can utilize various programming languagesSpeech realize content of the present invention described here, and the description of above language-specific being done be forDisclose preferred forms of the present invention.
In the description that provided herein, a large amount of details are described. But, can understand,Embodiments of the invention can be put into practice in the situation that there is no these details. In some instances,Be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, should be appreciated that in order to simplify the disclosure and to help to understand one in each inventive aspectIndividual or multiple, in the above in the description of exemplary embodiment of the present invention, each feature of the present inventionSometimes be grouped together into single embodiment, figure or in its description. But, should be byThe method of the disclosure is construed to the following intention of reflection: the present invention for required protection requires ratio eachThe more feature of feature of clearly recording in claim. Or rather, as claims instituteWhat reflect is such, and inventive aspect is to be less than all features of disclosed single embodiment above. CauseThis, claims of following detailed description of the invention are incorporated to this detailed description of the invention thus clearly, itsIn each claim itself as independent embodiment of the present invention.
Those skilled in the art are appreciated that and can carry out the module in the equipment in embodimentAdaptively change 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, andIn addition can put them into multiple submodules or subelement or sub-component. Except such feature and/orAt least some in process or unit are, outside mutually repelling, can adopt any combination to illustrate thisDisclosed all features and so disclosed in book (comprising claim, summary and the accompanying drawing followed)All processes or the unit of any method or equipment combine. Unless clearly statement in addition, this theoryIn bright book (comprising claim, summary and the accompanying drawing followed), disclosed each feature can be by phase is providedWith, be equal to or the alternative features of similar object replaces.
In addition, although those skilled in the art will appreciate that embodiment more described herein compriseIncluded some feature instead of further feature in other embodiment, but the feature of different embodimentCombination mean within scope of the present invention and form different embodiment. For example,, in powerIn profit claim, the one of any of embodiment required for protection can come with combination arbitrarilyUse.
All parts embodiment of the present invention can realize with hardware, or with at one or more placeThe software module of moving on reason device realizes, or realizes with their combination. Those skilled in the artShould be appreciated that and can use in practice microprocessor or digital signal processor (DSP) to realizeAccording to the some or all parts in the database management schemes of the embodiment of the present invention some or completePortion's function. The present invention can also be embodied as a part for carrying out method as described herein or completeThe equipment of portion or device program (for example, computer program and computer program). Such realityExisting program of the present invention can be stored on computer-readable medium, or can have one or manyThe form of individual signal. Such signal can be downloaded and obtain from internet website, or believes at carrierOn number, provide, or provide with any other form.
It should be noted above-described embodiment the present invention will be described instead of the present invention is limitSystem, and those skilled in the art can design in the case of not departing from the scope of claimsAlternative embodiment. In the claims, any reference symbol between bracket should be configured toLimitations on claims. Word " comprises " not to be got rid of existence and is not listed as element or step in the claimsSuddenly. Being positioned at word " " before element or " one " does not get rid of and has multiple such elements. The present inventionCan be by means of including the hardware of some different elements and coming real by means of the computer of suitably programmingExisting. In the unit claim of having enumerated some devices, several in these devices can be logicalCross same hardware branch and carry out imbody. The use of word first, second and C grade does not representAny order. Can be title by these word explanations.
The invention discloses A1, a kind of data base management method, comprising:
Call the first management thread inspection storage and there is the key list of the key of expired time;
If be checked through in described key list and have expired key, described expired key is added into deletion queueIn; And
Call the second management thread according to expired key putting in order in described deletion queue, delete successivelyExcept each expired key.
A2, according to the method described in A1, wherein, described method also comprises:
Set up described key list, and the key with expired time is write to described key list.
A3, according to the method described in A1 or A2, wherein, described in call the first management thread inspection and depositStorage has the key list of the key of expired time, specifically comprises:
Call the first management thread inspection storage and have the key of the key of expired time according to setting-up time intervalList.
A4, according to the method described in A1, wherein, in described key list, store key with corresponding expiredThe mapping relations of time.
A5, according to the method described in A4, wherein, described in call the first management thread and check described key rowTable, specifically comprises:
Obtain expired time corresponding to each key in current time and described key list;
If a certain expired time is not mated with described current time, judge corresponding with described expired timeKey be expired key.
A6, according to the method described in any one in A1-A2, wherein, described expired key comprises multiple one-tenthMember, and in the time calling the described expired key of described the second management thread deletion, the described expired key of foundationDescribed multiple member is deleted in putting in order of multiple members successively.
The invention also discloses B7, a kind of data bank management device, comprising:
The first calling module, for calling key that the first management thread inspection storage has expired timeKey list;
Add module, if there is expired key for being checked through described key list, described expired key is addedAdd to and delete in queue; And
The second calling module, for call the second management thread according to expired key in described deletion queuePut in order, delete successively each expired key.
B8, according to the device described in B7, wherein, described device also comprises:
Set up module, for setting up described key list, and the key with expired time is write to described keyList.
B9, according to the device described in B7 or B8, wherein, described the first calling module specifically for:
Call the first management thread inspection storage and have the key of the key of expired time according to setting-up time intervalList.
B10, according to the device described in B7, wherein, in described key list, store key and corresponding mistakeThe mapping relations of time phase.
B11, according to the device described in B10, wherein, described the first calling module comprises:
Expired time acquisition module, for obtaining current time and the each key of described key list is correspondingExpired time;
Time judgment module, if do not mate with described current time for a certain expired time, judgesThe key corresponding with described expired time is expired key.
B12, according to the device described in any one in B7-B8, wherein, described expired key comprises multiple one-tenthMember, and described the second calling module deletes when described expired key calling described the second management thread,Putting in order of multiple members according to described expired key deleted described multiple member successively.

Claims (10)

1. a data base management method, comprising:
Call the first management thread inspection storage and there is the key list of the key of expired time;
If be checked through in described key list and have expired key, described expired key is added into deletion queueIn; And
Call the second management thread according to expired key putting in order in described deletion queue, delete successivelyExcept each expired key.
2. method according to claim 1, is characterized in that, described method also comprises:
Set up described key list, and the key with expired time is write to described key list.
3. method according to claim 1 and 2, is characterized in that, described in call the first managementThread inspection storage has the key list of the key of expired time, specifically comprises:
Call the first management thread inspection storage and have the key of the key of expired time according to setting-up time intervalList.
4. method according to claim 1, is characterized in that, in described key list, stores keyMapping relations with corresponding expired time.
5. method according to claim 4, is characterized in that, described in call the first management threadCheck described key list, specifically comprise:
Obtain expired time corresponding to each key in current time and described key list;
If a certain expired time is not mated with described current time, judge corresponding with described expired timeKey be expired key.
6. according to the method described in any one in claim 1-2, it is characterized in that described expired keyComprise multiple members, and in the time calling the described expired key of described the second management thread deletion, according to instituteState the putting in order of multiple members of expired key and delete successively described multiple member.
7. a data bank management device, comprising:
The first calling module, for calling key that the first management thread inspection storage has expired timeKey list;
Add module, if there is expired key for being checked through described key list, described expired key is addedAdd to and delete in queue; And
The second calling module, for call the second management thread according to expired key in described deletion queuePut in order, delete successively each expired key.
8. device according to claim 7, is characterized in that, described device also comprises:
Set up module, for setting up described key list, and the key with expired time is write to described keyList.
9. according to the device described in claim 7 or 8, it is characterized in that described the first calling moduleSpecifically for:
Call the first management thread inspection storage and have the key of the key of expired time according to setting-up time intervalList.
10. device according to claim 7, is characterized in that, in described key list, stores keyMapping relations with corresponding expired time.
CN201510997680.3A 2015-12-25 2015-12-25 Database management method and apparatus Pending CN105653635A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510997680.3A CN105653635A (en) 2015-12-25 2015-12-25 Database management method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510997680.3A CN105653635A (en) 2015-12-25 2015-12-25 Database management method and apparatus

Publications (1)

Publication Number Publication Date
CN105653635A true CN105653635A (en) 2016-06-08

Family

ID=56477774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510997680.3A Pending CN105653635A (en) 2015-12-25 2015-12-25 Database management method and apparatus

Country Status (1)

Country Link
CN (1) CN105653635A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201432A (en) * 2016-07-19 2016-12-07 网易(杭州)网络有限公司 The treating method and apparatus of the information of destination object
CN107247814A (en) * 2017-07-26 2017-10-13 浙江极赢信息技术有限公司 The abstracting method and device of data in a kind of Redis databases
CN107291878A (en) * 2017-06-19 2017-10-24 郑州云海信息技术有限公司 A kind of data-erasure method and device of distributed storage file system
CN107368563A (en) * 2017-06-30 2017-11-21 北京奇虎科技有限公司 The delet method and device of database data, electronic equipment, storage medium
CN109710615A (en) * 2018-12-29 2019-05-03 江苏满运软件科技有限公司 Access management method, system, electronic equipment and the storage medium of database
CN110727389A (en) * 2018-07-16 2020-01-24 网宿科技股份有限公司 File cleaning method and system
CN111400298A (en) * 2020-04-17 2020-07-10 Oppo广东移动通信有限公司 Data processing method and device and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120173491A1 (en) * 2010-01-20 2012-07-05 International Business Machines Corporation Information processor, information processing system, data archiving method, and data deletion method
US20140025899A1 (en) * 2012-06-04 2014-01-23 Google Inc. Efficiently Updating and Deleting Data in a Data Storage System
CN104572819A (en) * 2014-12-02 2015-04-29 深圳市腾讯计算机系统有限公司 Clearing method and system for junk data
CN104731859A (en) * 2015-02-02 2015-06-24 厦门市美亚柏科信息股份有限公司 Data processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120173491A1 (en) * 2010-01-20 2012-07-05 International Business Machines Corporation Information processor, information processing system, data archiving method, and data deletion method
US20140025899A1 (en) * 2012-06-04 2014-01-23 Google Inc. Efficiently Updating and Deleting Data in a Data Storage System
CN104572819A (en) * 2014-12-02 2015-04-29 深圳市腾讯计算机系统有限公司 Clearing method and system for junk data
CN104731859A (en) * 2015-02-02 2015-06-24 厦门市美亚柏科信息股份有限公司 Data processing method and device

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201432A (en) * 2016-07-19 2016-12-07 网易(杭州)网络有限公司 The treating method and apparatus of the information of destination object
CN106201432B (en) * 2016-07-19 2019-08-06 网易(杭州)网络有限公司 The treating method and apparatus of the information of target object
CN107291878A (en) * 2017-06-19 2017-10-24 郑州云海信息技术有限公司 A kind of data-erasure method and device of distributed storage file system
CN107368563A (en) * 2017-06-30 2017-11-21 北京奇虎科技有限公司 The delet method and device of database data, electronic equipment, storage medium
CN107368563B (en) * 2017-06-30 2021-02-23 北京奇虎科技有限公司 Database data deleting method and device, electronic equipment and storage medium
CN107247814A (en) * 2017-07-26 2017-10-13 浙江极赢信息技术有限公司 The abstracting method and device of data in a kind of Redis databases
CN110727389A (en) * 2018-07-16 2020-01-24 网宿科技股份有限公司 File cleaning method and system
CN110727389B (en) * 2018-07-16 2023-10-20 网宿科技股份有限公司 File cleaning method and system
CN109710615A (en) * 2018-12-29 2019-05-03 江苏满运软件科技有限公司 Access management method, system, electronic equipment and the storage medium of database
CN111400298A (en) * 2020-04-17 2020-07-10 Oppo广东移动通信有限公司 Data processing method and device and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN105653635A (en) Database management method and apparatus
CN107247808B (en) Distributed NewSQL database system and picture data query method
CN108874971B (en) Tool and method applied to mass tagged entity data storage
US9449074B1 (en) Determining and extracting changed data from a data source
US8380680B2 (en) Piecemeal list prefetch
US8285677B2 (en) Method and apparatus for propagating tables while preserving cyclic foreign key relationships
CN108009008A (en) Data processing method and system, electronic equipment
US10275481B2 (en) Updating of in-memory synopsis metadata for inserts in database table
CN105608086A (en) Transaction processing method and device of distributed database system
CN104102710A (en) Massive data query method
US10885029B2 (en) Parallel execution of merge operations
CN111309760A (en) Data retrieval method, system, device and storage medium
CN102591855A (en) Data identification method and data identification system
US11386078B2 (en) Distributed trust data storage system
CN109767274B (en) Method and system for carrying out associated storage on massive invoice data
CN104679884A (en) Data analysis method, device and system of database
CN105045789A (en) Game server database buffer memory method and system
CN103559307A (en) Caching method and device for query
CN105677645A (en) Data sheet comparison method and device
CN103500188A (en) Method and system for generating data sheet
CN103559204A (en) Database operation request processing method, unit and system
CN102855297B (en) A kind of method of control data transmission and connector
CN104699811B (en) A kind of no intrusive mood form data change record and the method and device of backtracking
GB2525613A (en) Reduction of processing duplicates of queued requests
CN115795521A (en) Access control method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160608