Movatterモバイル変換


[0]ホーム

URL:


CN102831181B - Directory refreshing method for cache files - Google Patents

Directory refreshing method for cache files
Download PDF

Info

Publication number
CN102831181B
CN102831181BCN201210270668.9ACN201210270668ACN102831181BCN 102831181 BCN102831181 BCN 102831181BCN 201210270668 ACN201210270668 ACN 201210270668ACN 102831181 BCN102831181 BCN 102831181B
Authority
CN
China
Prior art keywords
cache file
folder
database
refreshing
catalogue
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
Application number
CN201210270668.9A
Other languages
Chinese (zh)
Other versions
CN102831181A (en
Inventor
邱然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Zhi Le Internet of things Technology Co., Ltd.
Original Assignee
BEIJING GLASS PERIOD COMMUNICATION TECHNOLOGY 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 GLASS PERIOD COMMUNICATION TECHNOLOGY Co LtdfiledCriticalBEIJING GLASS PERIOD COMMUNICATION TECHNOLOGY Co Ltd
Priority to CN201210270668.9ApriorityCriticalpatent/CN102831181B/en
Publication of CN102831181ApublicationCriticalpatent/CN102831181A/en
Application grantedgrantedCritical
Publication of CN102831181BpublicationCriticalpatent/CN102831181B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

The invention discloses a directory refreshing method for cache files. The directory refreshing method comprises the steps of sequencing the cache files in a log folder, and merging the sequenced log folder into a database folder; averagely dividing the database folder into N sub-databases, respectively extracting i<th> cache files from the first sub-database to the (N-1)<th> sub-database to be used as cache file samples, and storing all the cache files in an index folder; finding out objective cache files in a directory required to be refreshed in the index folder, and finding out the locations of the objective cache files in the database folder; traversing the database folder from the locations of the objective cache files in the database folder, and deleting the cache files when the cache files conform to one of the objective cache files in the directory required to be refreshed; and finishing when the cache files do not conform to any objective cache files in the directory required to be refreshed. The invention further discloses a caching proxy server.

Description

The catalogue method for refreshing of cache file
Technical field
The present invention relates to network communications technology field, refer to especially a kind of catalogue method for refreshing of cache file.
Background technology
In the time of the mobile reverse proxy business of service, the Websites quantity of user's access can be very huge, and then cause needing URL(uniform resource locator) (URL, the Uniform/Universal Resource Locator) quantity of buffer memory huger, reach tens million of ranks.
And in China, mobile service is very high for the management expectancy of content.Often meeting limited period is deleted the requirement of some websites or certain catalogue.Therefore,, for the server of the mobile reverse proxy of service, need stable, a catalogue refresh function (that is: find all URL(uniform resource locator) that belong to some catalogues, and all delete) fast.
Proxy caching server is in the time preserving the corresponding relation of URL(uniform resource locator) and cache file, conventionally can not preserve according to the bibliographic structure of URL(uniform resource locator) own, but according to the rule of this webpage buffer memory (web cache) software itself, file is saved in different catalogues.
Can cause a consequence but do like this, exactly if carry out that catalogue refreshes will be very difficult.Must travel through the file of all buffer memorys, the catalogue that finds the needs that comprise in its URL(uniform resource locator) to refresh.Conventionally the URL(uniform resource locator) quantity of proxy server caches, all in ten million rank, is done like this performance of server is had very serious implications.
Summary of the invention
In view of this, the object of the invention is to propose a kind of catalogue method for refreshing of cache file, effectively flush buffers file directory.
Catalogue method for refreshing based on above-mentioned purpose a kind of cache file provided by the invention, comprising:
Cache file in log folder is sorted;
The log folder that sequence is completed merges to Database Folder;
Described Database Folder is equally divided into N subdata base, respectively from the 1st subdata base to N-1 database extracts i cache file as cache file sample, by all cache file Sample preservation indexed file underedges;
In indexed file folder, find out the target cache file in the catalogue that need to refresh, and find this present position of target cache file in Database Folder;
From this target cache file present position Database Folder, ergodic data library archive, in the time that cache file suits the requirements one of target cache file in the catalogue refreshing, deletes this cache file;
In the time that cache file does not meet the arbitrary target cache file in the catalogue that need to refresh, finish.
In one embodiment, the catalogue method for refreshing of described cache file also comprises: the instant proxy caching server cache file producing is saved in to this log folder.
In another embodiment, the catalogue method for refreshing of described cache file also comprises: the cache file number higher limit of setting log folder, in the time that the cache file number of log folder rises to this higher limit, the cache file in log folder is sorted.
In another embodiment, cache file number higher limit is less than or equal to 10000.
In another embodiment, the merge algorithm between described sequence completes log folder and described Database Folder adopts MERGING/SORTING ALGORITHM.
In another embodiment, the sort method of described log folder comprises:
Suppose to have 2 cache files, title is respectively A and B, the length of LenA=A, and the length of LenB=B, establishes LenA≤LenB;
Period m is set and is recycled to LenA from 1, contrast one by one successively m the character of A and B, in the time that the ASCII character of n the character of A is less than the ASCII character of n character of B, think that A should come before B; Otherwise, in the time that the ASCII character of n the character of B is less than the ASCII character of n character of A, think that B should come before A;
In the time being recycled to LenA, on each correspondence position of A and B, all characters equate, so, shorter A comes before longer B; If A and B are completely equal, in the time that log folder and Database Folder merge, appoint and get one of them and put into Database Folder.
In another embodiment, the number N value of described subdata base is 128.
In another embodiment, last cache file that i the cache file extracting is this subdata base, makes extracted sample cache file lay respectively at 1/N, the 2/N in whole Database Folder ... (N-1)/N place.
The present invention also provides the proxy caching server of the catalogue method for refreshing that adopts above-mentioned cache file, comprise: for storing the log folder module of the instant cache file that described proxy caching server produces, be used for the Database Folder module of the history buffer file of storing described proxy caching server generation, carry out the index file clamping piece of index for the history buffer file to Database Folder.
As can be seen from above, the proxy caching server of the catalogue method for refreshing of a kind of cache file provided by the invention and employing the method, by setting up log folder and index file folder, can at any time the instant proxy server cache file producing be preserved, and find at short notice by Index Algorithm the target cache file that needs deletion.
Brief description of the drawings
Fig. 1 is the embodiment process flow diagram of the catalogue method for refreshing of a kind of cache file provided by the present invention.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with specific embodiment, and with reference to accompanying drawing, the present invention is described in more detail.
With reference to figure 1, it is the embodiment process flow diagram of the catalogue method for refreshing of a kind of cache file provided by the present invention.
The catalogue method for refreshing of described a kind of cache file comprises the following steps:
Step 1: the cache file in log folder is sorted;
Step 2: the log folder that sequence is completed merges to Database Folder;
Step 3: described Database Folder is equally divided into N subdata base, respectively from the 1st subdata base to N-1 database extracts i cache file as cache file sample, by all cache file Sample preservation indexed file underedges;
Step 4: find out the target cache file in the catalogue that need to refresh in indexed file folder, and find this present position of target cache file in Database Folder;
Step 5: from this target cache file present position Database Folder, ergodic data library archive, in the time that cache file suits the requirements one of target cache file in the catalogue refreshing, deletes this cache file;
Step 6: in the time that cache file does not meet the arbitrary target cache file in the catalogue that need to refresh, finish.
Wherein, also comprise initialization step: in proxy caching server, set up log folder, and the instant proxy caching server cache file producing is saved in to this log folder.
The sort method of described log folder is:
Suppose to have 2 cache files, title is respectively A and B, the length of LenA=A, and the length of LenB=B, might as well establish LenA≤LenB;
Period m is set and is recycled to LenA from 1, contrast one by one successively m the character of A and B, in the time that the ASCII character of n the character of A is less than the ASCII character of n character of B, think that A should come before B; Otherwise, in the time that the ASCII character of n the character of B is less than the ASCII character of n character of A, think that B should come before A;
In the time being recycled to LenA, on each correspondence position of A and B, all characters equate, so, shorter A comes before longer B; If A and B are completely equal, in the time that log folder and Database Folder merge, appoint and get one of them and put into Database Folder.
Can find out according to the above, in proxy caching server, increase a log folder and an index file folder are set, can at any time the instant cache file producing in proxy caching server be preserved, and adopt Index Algorithm to be clipped in the target cache file that just can find required deletion in Database Folder within several milliseconds by index file, simultaneously effectively, stablize, delete rapidly this target cache file.
Preferably, described step 1 also comprises: set the cache file number higher limit of log folder, in the time that the cache file number of log folder rises to this higher limit, the cache file in log folder is sorted.
Preferably, described higher limit is less than or equal to 10000; Because this higher limit is very little, the speed that sorts is very fast.
In addition, because Database Folder is to be accumulated by log folder each time in history, although may there be up to ten million records, it is orderly all the time.And the merge algorithm between the log folder that described sequence completes and described Database Folder adopts MERGING/SORTING ALGORITHM.
Preferably, the number N value of described subdata base is 128, and so, index file folder can be not excessive, can not cause because index number is very few again having looked into after index the overlong time of sequential search in Database Folder.
Especially, last cache file that i the cache file extracting is subdata base, makes extracted sample cache file lay respectively at 1/N, the 2/N in whole Database Folder ... (N-1)/N place; So just, reduced the process that order is searched plain Database Folder.
The invention also discloses a kind of proxy caching server of combination in any of the catalogue method for refreshing that adopts above-mentioned cache file, comprise: for storing the log folder module of the instant cache file that described proxy caching server produces, be used for the Database Folder module of the history buffer file of storing described proxy caching server generation, carry out the index file clamping piece of index for the history buffer file to Database Folder.
Preferably, the method of the foundation of the index file folder in described index file clamping piece is: described Database Folder is equally divided into N subdata base, from the 1st subdata base to N-1 database, i cache file of each extraction is as cache file sample, by all cache file Sample preservation indexed file underedges.
Preferably, the number N value of described subdata base is 128, and so, index file folder can be not excessive, can not cause because index number is very few again having looked into after index the overlong time of sequential search in Database Folder.
Especially, last cache file that i the cache file extracting is subdata base, makes extracted sample cache file lay respectively at 1/N, the 2/N in whole Database Folder ... (N-1)/N place; So just, reduced the process that order is searched plain Database Folder.
Especially, can also set the cache file number higher limit of log folder in described log folder module, in the time that the cache file number of log folder rises to this higher limit, the cache file in log folder be sorted; Preferably, described cache file number higher limit is less than or equal to 10000.
Wherein, preferred, the merge algorithm between the log folder that described sequence completes and described Database Folder adopts MERGING/SORTING ALGORITHM.
Can find out according to the above, in described proxy caching server, increase a log folder and an index file folder are set, can at any time the instant cache file producing in proxy caching server be preserved, and adopt Index Algorithm to be clipped in the target cache file that just can find required deletion in Database Folder within several milliseconds by index file, simultaneously effectively, stablize, delete rapidly this target cache file.
Those of ordinary skill in the field are to be understood that: the foregoing is only specific embodiments of the invention; be not limited to the present invention; within the spirit and principles in the present invention all, any amendment of making, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (8)

CN201210270668.9A2012-07-312012-07-31Directory refreshing method for cache filesActiveCN102831181B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201210270668.9ACN102831181B (en)2012-07-312012-07-31Directory refreshing method for cache files

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201210270668.9ACN102831181B (en)2012-07-312012-07-31Directory refreshing method for cache files

Publications (2)

Publication NumberPublication Date
CN102831181A CN102831181A (en)2012-12-19
CN102831181Btrue CN102831181B (en)2014-10-01

Family

ID=47334318

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201210270668.9AActiveCN102831181B (en)2012-07-312012-07-31Directory refreshing method for cache files

Country Status (1)

CountryLink
CN (1)CN102831181B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103595571B (en)*2013-11-202018-02-02北京国双科技有限公司Preprocess method, the apparatus and system of web log
CN103927338A (en)*2014-03-262014-07-16网神信息技术(北京)股份有限公司Log information storage processing method and log information storage processing device
CN106202112B (en)*2015-05-062019-07-02阿里巴巴集团控股有限公司CACHE DIRECTORY method for refreshing and device
CN110928847B (en)*2019-10-142022-10-04佛山科学技术学院 Method and device for batch sampling of documents

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101122885A (en)*2007-09-112008-02-13腾讯科技(深圳)有限公司Data cache processing method, system and data cache device
CN101154230A (en)*2006-09-302008-04-02中兴通讯股份有限公司Responding method for large data volume specified searching web pages
CN101656985A (en)*2009-08-182010-02-24中兴通讯股份有限公司Method for managing url resource cache and device thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2005011180A (en)*2003-06-202005-01-13Nec CorpUrl retrieval system, server therefor, and url retrieval method
US8180733B2 (en)*2009-03-192012-05-15Novell, Inc.Selective durability in a directory database

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101154230A (en)*2006-09-302008-04-02中兴通讯股份有限公司Responding method for large data volume specified searching web pages
CN101122885A (en)*2007-09-112008-02-13腾讯科技(深圳)有限公司Data cache processing method, system and data cache device
CN101656985A (en)*2009-08-182010-02-24中兴通讯股份有限公司Method for managing url resource cache and device thereof

Also Published As

Publication numberPublication date
CN102831181A (en)2012-12-19

Similar Documents

PublicationPublication DateTitle
CN104536959B (en)A kind of optimization method of Hadoop accessing small high-volume files
EP2898430B1 (en)Mail indexing and searching using hierarchical caches
EP2885731B1 (en)Search infrastructure
US6772141B1 (en)Method and apparatus for organizing and using indexes utilizing a search decision table
CN104679778B (en)A kind of generation method and device of search result
CN102930060B (en)A kind of method of database quick indexing and device
US20040205044A1 (en)Method for storing inverted index, method for on-line updating the same and inverted index mechanism
CN103778202A (en)Enterprise electronic document managing server side and system
CN104239377A (en)Platform-crossing data retrieval method and device
CN103678694A (en)Method and system for establishing reverse index file of video resources
CN102831181B (en)Directory refreshing method for cache files
CN105512143A (en)Method and device for web page classification
CN104794228A (en)Search result providing method and device
CN104346347A (en)Data storage method, device, server and system
ChangtongAn improved HDFS for small file
CN104636368A (en)Data retrieval method and device and server
CN116680276A (en)Data tag storage management method, device, equipment and storage medium
CN105912696A (en)DNS (Domain Name System) index creating method and query method based on logarithm merging
CN103136294B (en)File operating method and device
CN104252537A (en)Index fragmentation method based on mail characteristics
WO2017014744A1 (en)Processing time-varying data using a graph data structure
CN116756137A (en)Method, system and equipment for deleting large-scale data object storage
CN105468599A (en)Metadata hierarchy management method for storage virtualization system
CN103810209B (en)A kind of method and system saving data
CN115344685B (en) A text deduplication method based on multi-model algorithm and related equipment

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant
TR01Transfer of patent right
TR01Transfer of patent right

Effective date of registration:20180718

Address after:510663 Guangdong science and Technology Development Zone, Guangzhou science and Technology Development Zone, No. 3, No. A4, scientific research road, No. 3, No. 458, No.

Patentee after:Guangzhou Zhi Le Internet of things Technology Co., Ltd.

Address before:100070 Beijing Fengtai District headquarters base area 8, 4 floor.

Patentee before:Beijing Glass Period Communication Technology Co., Ltd.


[8]ページ先頭

©2009-2025 Movatter.jp