CN102214172B - Caching method and caching equipment - Google Patents

Caching method and caching equipment Download PDF

Info

Publication number
CN102214172B
CN102214172B CN 201010141766 CN201010141766A CN102214172B CN 102214172 B CN102214172 B CN 102214172B CN 201010141766 CN201010141766 CN 201010141766 CN 201010141766 A CN201010141766 A CN 201010141766A CN 102214172 B CN102214172 B CN 102214172B
Authority
CN
China
Prior art keywords
search results
results pages
search
file system
pages
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
CN 201010141766
Other languages
Chinese (zh)
Other versions
CN102214172A (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.)
Shenzhen Shiji Guangsu Information Technology Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN 201010141766 priority Critical patent/CN102214172B/en
Publication of CN102214172A publication Critical patent/CN102214172A/en
Application granted granted Critical
Publication of CN102214172B publication Critical patent/CN102214172B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a caching method and caching equipment and belongs to the field of Internet communication. The method comprises the following steps of: receiving a retrieval request which carries retrieval strings, and searching a search result page which is stored in a file system according to the retrieval strings; if the corresponding search result page is found, increasing an access frequency of the search result page; and if the corresponding search result page is not found, searching search results which correspond to the retrieval strings by a search engine, assembling the search results into the search result page, and storing in the file system. The equipment comprises a searching module, a gradual-increase module and a storage module. By the invention, the consumption of time and resources can be reduced.

Description

A kind of method and apparatus of high-speed cache
Technical field
The present invention relates to field of Internet communication, particularly a kind of method and apparatus of high-speed cache.
Background technology
Along with developing rapidly of Internet technology, search engine is used widely, and the user pays attention to the search efficiency of search engine very much when using search engine.Present search engine is widely used the Cache(high-speed cache) technology improves search efficiency.
Present Cache technology is specially: the retrieval string of hot topic and its corresponding Search Results are stored in the Cache system; Receive retrieval request from client when Web server, create the CGI(CGI (Common Gateway Interface), Common Gateway Interface) process, the CGI process is transmitted to search engine with this retrieval request, wherein, carries the retrieval string in this retrieval request; Search engine is according to the retrieval string that carries in this retrieval request, and search Cache system if search out corresponding Search Results, returns to the CGI process, and will retrieve the access frequency of going here and there and add 1; Otherwise, from Search Results corresponding to backstage search, and return the process to CGI, will retrieve simultaneously that string and this Search Results be stored in the Cache system and the access frequency that this retrieval goes here and there is set is 1; The CGI process receives the Search Results that returns, and the Search Results that receives is assembled into search results pages, and sends to client.
In realizing process of the present invention, the inventor finds that there is following problem at least in prior art:
Each retrieval request will trigger Web server and create a CGI process, forward this retrieval request to search engine by the CGI process again, Web server need to be destroyed this CGI process after search is completed, and the establishment of CGI process and destruction and CGI process forwarding retrieval request all need elapsed time and resource.
Summary of the invention
In order to reduce the consumption of time and resource, the invention provides the method and apparatus of a kind of Cache.
Described technical scheme is as follows:
A kind of method of high-speed cache, described method comprises:
The retrieval request of retrieval string is carried in reception, according to the search results pages of storing in described retrieval string search file system;
If search out corresponding search results pages, increase the access frequency of described search results pages;
If do not search out corresponding search results pages, search for Search Results corresponding to described retrieval string by search engine, described Search Results is assembled into search results pages and is stored in described file system;
Wherein, describedly described Search Results be assembled into search results pages and be stored in described file system, specifically comprising:
Described Search Results is assembled into search results pages;
Judge that in described file system, whether unappropriated space is more than or equal to the needed space of search results pages of storing described assembly unit;
If so, described search results pages is stored in described file system;
If not, eliminate the search results pages of the nearest least referenced in described file system, until when in described file system, unappropriated space is more than or equal to the search results pages needed space of the described assembly unit of storage, described search results pages is stored in described file system.
A kind of equipment of high-speed cache, described equipment comprises:
Search module be used for to receive the retrieval request of carrying the retrieval string, according to the search results pages of storing in described retrieval string search file system;
Increase progressively module, if be used for searching out corresponding search results pages, increase the access frequency of described search results pages;
Memory module if be used for not searching out corresponding search results pages, is searched for Search Results corresponding to described retrieval string by search engine, described Search Results is assembled into search results pages and is stored in described file system;
Wherein, described memory module specifically comprises:
The first search unit is used for by Search Results corresponding to the described search engine described retrieval string of search, described Search Results being assembled into search results pages;
The first judging unit is used for judging that described file system unappropriated space is whether more than or equal to the needed capacity of search results pages of the described assembly unit of storage;
The first storage unit is used for if described search results pages is stored in described file system;
The second storage unit, be used for if not, eliminate the search results pages of the nearest least referenced in described file system, until when in described file system, unappropriated space is more than or equal to the search results pages needed space of the described assembly unit of storage, described search results pages is stored in described file system.
When receiving the request of carrying the retrieval string, according to this retrieval string direct search file system, if search out corresponding search results pages, increase the access times of this search results pages, otherwise, search for again Search Results corresponding to this retrieval string, Search Results is assembled into search results pages and is stored in file system.So, reduce the number of times that creates the CGI process, reduce the CGI process and forward the number of times of retrieval request and reduce the number of times of destroying the CGI process, thus the consumption of minimizing time and resource.
Description of drawings
Fig. 1 is the process flow diagram of the method for a kind of high-speed cache of providing of the embodiment of the present invention 1;
Fig. 2 is the process flow diagram of the method for a kind of high-speed cache of providing of the embodiment of the present invention 2;
Fig. 3 is the process flow diagram of the equipment of a kind of high-speed cache of providing of the embodiment of the present invention 3.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Embodiment 1
As shown in Figure 1, the embodiment of the present invention provides a kind of method of high-speed cache, comprising:
Step 101: receive retrieval request, carry the retrieval string in this retrieval request;
Step 102: according to the search results pages of storing in this retrieval string search file system, if search out corresponding search results pages, execution in step 103, if do not search out corresponding search results pages, execution in step 104;
Step 103: the access frequency that increases this search results pages;
Step 104: search for Search Results corresponding to this retrieval string by search engine, the Search Results of searching for is assembled into search results pages and is stored in file system.
In embodiments of the present invention, after receiving retrieval request, whether there be the search results pages corresponding to retrieval string of carrying in retrieval request in the direct search file system, if, increase the access frequency of this search results pages, if not, search for Search Results corresponding to this retrieval string, Search Results is assembled into search results pages and is stored in file system.Search results pages due to direct memory scan in file system, carry the retrieval request of retrieval string when reception after, whether there be search results pages corresponding to this retrieval string in the direct search file system, thereby reduced the number of times that creates the CGI process, reduce the CGI process and forwarded the number of times of retrieval request and reduced the number of times of cancelling the CGI process, thereby reduced the consumption of time and resource.
Embodiment 2
As shown in Figure 2, the embodiment of the present invention provides a kind of method of high-speed cache, comprising:
Step 201: receive the retrieval request that client sends, carry the retrieval string in this retrieval request;
Wherein, after the user submits the retrieval string to client, the retrieval string that client is submitted to, then send the retrieval request of carrying this retrieval string.Wherein, client can be browser.
For example, the user opens the homepage of search engine in browser, and the retrieval string that input needs to search in browser is " Keyword ", and then submit this retrieval string to browser, browser receives the retrieval string " Keyword " of submitting to, then sends the retrieval request of carrying retrieval string " Keyword ".
Step 202: according to the retrieval string search file system of carrying in this retrieval request, if search out corresponding search results pages, execution in step 203, if do not search out corresponding search results pages, execution in step 204;
Wherein, be pre-created file system, the search results pages that the retrieval string of hot topic is corresponding is with Html(HyperText Mark-up Language, HTML (Hypertext Markup Language)) form of file is stored in file system, and directly with the filename of retrieval string as its corresponding search results pages.After receiving retrieval request, according to the retrieval string that carries in this retrieval request, whether there is the search results pages of file this retrieval string by name in the direct search file system.
For example, file system as shown in table 1, the search results pages of the popular retrieval string of storage in table 1, and in table 1 with the search results pages of the form memory scan string of Html file, with the filename of retrieval string as search results pages, as the search results pages of the file " www.qq.com " by name of the second row storage of table 1, and " www.qq.com " is the retrieval string.So in this step, directly search for the search results pages that whether has file retrieval string by name " Keyword " from file system as shown in table 1.
Table 1
Search results pages Access frequency
The www.qq.com n1
China Mobile n2
...... ......
Further, file system comprises memory subsystem and disk subsystem, and wherein, the capacity of memory subsystem is greater than the capacity of disk subsystem;
Correspondingly, this step is specially:
At first according to the retrieval string that carries in this retrieval request, the search memory subsystem, if search out corresponding search results pages, execution in step 203, otherwise, again according to the retrieval string that carries in this retrieval request, the search disk subsystem, if search out corresponding search results pages, execution in step 203, otherwise, execution in step 204.
Step 203: increase the access frequency of this search results pages in file system, EO;
Wherein, can be in file system the access frequency of this search results pages be added 1.In addition, after searching out this search results pages, also need this search results pages is returned to client, and when client after this search results pages of returning, this search results pages that receives is shown to the user.
For example, suppose to search out the search results pages of file " Keyword " by name in step 202 from file system as shown in table 1, in this step, the access frequency of the search results pages of " Keyword " in table 1 is added 1.In addition, also the search results pages of " Keyword " to be returned to client.
Wherein, after the retrieval request that receives the client transmission, directly search for corresponding search results pages according to the retrieval string that carries in this retrieval request from file system, if search search results pages corresponding to this retrieval string, directly return to client, thereby can reduce the number of times that creates the CGI process, reduce the number of times that the CGI process forwards retrieval request, also reduce the number of times of cancelling the CGI process, so, the consumption of minimizing time and resource.In addition, owing to directly searching out search results pages, thereby reduced establishment CGI process, the CGI process forwards retrieval request and needed time of CGI process assembly unit search results pages, thereby has improved search efficiency.
Step 204: search for Search Results corresponding to this retrieval string by search engine;
Particularly, create the CGI process, and by the CGI process, the retrieval request that receives is transmitted to search engine; After search engine received this retrieval request, search engine was searched for corresponding Search Results according to the retrieval string that carries in this retrieval request, then the Search Results of search is returned to the CGI process.
Wherein, search engine is that prior art is not described in detail at this according to Search Results corresponding to retrieval string search that carries in this retrieval request.
For example, suppose not search out the search results pages of file " Keyword " by name from file system as shown in table 1 in step 202, in this step, create the CGI process, and be transmitted to search engine by the retrieval request that the CGI process will be carried retrieval string " Keyword ", search engine searches out all corresponding Search Results according to retrieval string " Keyword ", and search engine returns to the CGI process with the Search Results of search again.
Step 205: Search Results is assembled into search results pages by the CGI process;
Wherein, after the complete all search results pages of CGI process assembly unit, also need to return to client the search results pages of assembly unit, and after the search results pages that client returns, show that the search results pages that receives is to the user.
For example, in step 204, search out Search Results corresponding to retrieval string " Keyword ", the CGI process will be retrieved Search Results corresponding to string " Keyword " and be assembled into search results pages in this step.
Step 206: the search results pages of assembly unit is stored in file system, and the filename of this search results pages is set to this retrieval string, and the initial value of the access frequency of this search results pages, EO are set.
Particularly, after assembly unit should the search results pages of retrieval string, be stored in file system by the step of following (1)-(3) search results pages with assembly unit, comprise:
(1): judge that unappropriated space in file system whether more than or equal to the needed space of this search results pages of storage, if so, carries out (3), if not, carry out (2);
(2): eliminate in file system the search results pages of least referenced recently, until when making unappropriated space in file system more than or equal to the needed space of this search results pages of storage;
Wherein, can adopt existing superseded algorithm to eliminate the search results pages of nearest least referenced in file system, superseded algorithm can be LRU(least recently used, uses at most) algorithm etc.
(3): this search results pages is stored in file system, and the filename of this search results pages is set to this retrieval string, the initial value of the access frequency of this search results pages is set simultaneously, EO.
Wherein, the search results pages of carrying out assembly unit due to CGI is a Html file, therefore, can be directly the search results pages of this assembly unit be stored in file system.The initial value of access frequency that in addition, can search results pages is set to 1.
For example, the search results pages of the retrieval string " Keyword " of CGI process creation is a Html file, therefore directly this search results pages is stored in file system as shown in table 1, and the file that this search results pages is set is called " Keyword ", and the access frequency that this search results pages is set is 1, and the result that obtains is as shown in table 2.
Table 2
Search results pages Access frequency
Keyword 1
The www.qq.com n1
China Mobile n2
...... ......
Further, if file system comprises memory subsystem and disk subsystem, correspondingly, when assembly unit is complete should the search results pages of retrieval string after, be stored in file system by the step of following (a)-(e) search results pages with assembly unit, comprising:
(a): judge that unappropriated space in memory subsystem whether more than or equal to the needed space of search results pages of storage assembly unit, if not, carries out (b), if so, carry out (e);
(b): the search results pages of selecting nearest least referenced in memory subsystem, judge the needed space of the search results pages whether unappropriated space in disk subsystem is selected more than or equal to storage, if so, carry out (c), if not, carry out (d);
(c): eliminate in disk subsystem the search results pages of least referenced recently, until during the search results pages needed space that makes that the unappropriated space in disk subsystem selects more than or equal to storage;
(d): the search results pages of selecting is stored in disk subsystem, and the search results pages of selecting is deleted from memory subsystem, and return to execution (a);
(e): the search results pages of assembly unit is stored in memory subsystem, and the access times of the search results pages of assembly unit are set to 1, and the filename of the search results pages of assembly unit is set to this retrieval string, EO.
Wherein, in the present embodiment, all right recording user daily record, the user journal of record comprises user's IP at least, the time of user's request and the retrieval string of request etc., user journal as shown in table 3.
Table 3
User's IP The time of user's request The retrieval string of request
IP1 T1 The www.qq.com
IP2 T2 China Mobile
IP3 T3 Keyword
...... ...... ......
Wherein, the recording user daily record is prior art, no longer is described in detail at the present embodiment.
Further, every one-period, according to user journal, the search results pages of the nearest least referenced in file system is cleaned it out;
Wherein, periodic this operation of execution, the detailed process of each operation is: owing to naming each search results pages with the retrieval string in file system, therefore for one in file system retrieval string, should retrieve the access times of string in the statistics current period in user journal, add up as stated above the access times of each the retrieval string in the Cache system, clean it out by the existing algorithm search results pages that the retrieval string of nearest least referenced is corresponding of eliminating according to access times of each retrieval string.
Wherein, suppose, current time is t, and the cycle is T, in user journal as shown in table 3 counting user t-T to t during this period of time in, the access times of each the retrieval string in counting user demand file system.
Further, when file system comprises memory subsystem and disk subsystem, every one-period, M search results pages of the access frequency maximum in disk subsystem is loaded into memory subsystem, and M search results pages of the access frequency minimum in memory subsystem eliminated in disk subsystem;
Wherein, periodically carry out this operation, the detailed process of each operation is divided into the step of following (1)-(4), comprising:
(1): each search results pages in memory subsystem is sorted by access frequency; Each search results pages in disk subsystem is sorted by access frequency;
(2): select M search results pages of access frequency minimum from memory subsystem, and M the search results pages of selecting is stored in shared drive, M the search results pages that deletion is selected from memory subsystem;
(3): select M search results pages of access frequency maximum from disk subsystem, and M the search results pages of selecting is stored in memory subsystem, M the search results pages that deletion is selected from disk subsystem;
(4): M the search results pages of storing in shared drive is stored in disk subsystem.
Wherein, M is the threshold value that arranges in advance.
Further, every one-period, according to user journal, the access frequency of each the retrieval string in the Cache system of statistics search engine, obtain N retrieval string and the Search Results corresponding to each retrieval string of access frequency maximum from the Cache system of search engine, be assembled into search results pages with obtaining Search Results corresponding to each retrieval string, and each search results pages of assembly unit is stored in file system, the file that the search results pages of each assembly unit is set is called the retrieval string of its correspondence;
Wherein, periodically carry out this operation, the detailed process of each operation is divided into the step of following (1)-(3), comprising:
(1): the access frequency of each retrieval string intrasystem according to user journal statistics Cache in current period;
Particularly, for one in Cache system retrieval string, the access times of this retrieval string of statistics in current period in user journal are with the access frequency of these access times as this retrieval string; Count as stated above the access frequency of each the retrieval string in the Cache system.
(2): each the retrieval string in the Cache system is sorted from big to small by separately access frequency, and choose retrieval string and the Search Results corresponding to each retrieval string of top n access frequency maximum.
Wherein, N is the threshold value that arranges in advance.
(3): for one of them retrieval string and should search results pages corresponding to retrieval string, as a Html file, and the filename of Html file is set to this retrieval and goes here and there with this search results pages, then this search results pages is stored in file system; By above-mentioned identical method, search results pages corresponding to each retrieval string is stored in file system.
particularly, judge that unappropriated space in file system is whether more than or equal to the needed space of this search results pages of storage, if, the filename of this search results pages is set to this retrieval string, and this search results pages is stored in file system, if not, adopt existing superseded algorithm that the search results pages of nearest least referenced is cleaned it out from file system, until the unappropriated space in file system is during more than or equal to the space of needs of this search results pages of storage, the filename of this search results pages is set to this retrieval string again, and this search results pages is stored in file system.
In embodiments of the present invention, when receiving retrieval request, directly search for corresponding search results pages according to the retrieval string that carries in this retrieval request from file system, if search out corresponding search results pages, increase the access frequency of this search results pages and return to this search results pages to client.So, reduced the number of times that creates the CGI process, reduced the CGI process and forwarded the number of times of retrieval request and reduced the number of times of cancelling the CGI process, thereby reduced the consumption of time and resource.
Embodiment 3
As shown in Figure 3, the embodiment of the present invention provides a kind of equipment of high-speed cache, comprising:
Search module 301 be used for to receive the retrieval request of carrying the retrieval string, goes here and there the search results pages of storing in the search file system according to this retrieval;
Increase progressively module 302, if be used for searching out corresponding search results pages, increase the access frequency of this search results pages;
Memory module 303 if be used for not searching out corresponding search results pages, is searched for Search Results corresponding to this retrieval string by search engine, and the Search Results of searching for is assembled into search results pages and is stored in file system.
Wherein, under the first implementation in the present embodiment, memory module 303 specifically comprises:
The first search unit is used for searching for Search Results corresponding to this retrieval string by search engine, and the Search Results of searching for is assembled into search results pages;
The first judging unit is used for judge that file system unappropriated space is whether more than or equal to the needed space of the search results pages of storing assembly unit;
The first storage unit, be used for if, the search results pages of assembly unit is stored in described file system, and file this retrieval by name that the search results pages of assembly unit is set go here and there with and the initial value of access frequency;
The second storage unit, be used for if not, eliminate in file system the search results pages of least referenced recently, until when in file system, unappropriated space is more than or equal to the search results pages needed space of storage assembly unit, the search results pages of assembly unit is stored in file system;
Wherein, under the second implementation in the present embodiment, file system comprises memory subsystem and disk subsystem;
Correspondingly, memory module 303 specifically comprises:
The second search unit is used for searching for Search Results corresponding to this retrieval string by search engine, and the Search Results of searching for is assembled into search results pages;
The second judging unit is used for judge that whether memory subsystem unappropriated space is more than or equal to the needed space of search results pages of storing assembly unit;
The 3rd storage unit is yes if be used for the result of the second judgment unit judges, and the search results pages with assembly unit is stored in memory subsystem;
The 4th storage unit, if it is no being used for the result of the second judgment unit judges, the search results pages of the nearest least referenced in memory subsystem is eliminated in disk subsystem, until when in memory subsystem, unappropriated space is more than or equal to the search results pages of storage assembly unit, the search results pages of assembly unit is stored in memory subsystem;
Wherein, on the basis of the second implementation, the 4th storage unit specifically comprises:
Judgment sub-unit, the result that is used for the second judgment unit judges is no, judges that in disk subsystem, whether unappropriated space is more than or equal to the needed space of the search results pages of the nearest least referenced in the stored memory subsystem;
The first deletion subelement is used for if the search results pages of nearest least referenced is stored in disk subsystem the search results pages of the nearest least referenced in the deletion memory subsystem;
The second deletion subelement, be used for if not, eliminate the search results pages of the nearest least referenced in disk subsystem, the search results pages of nearest least referenced in memory subsystem is stored in disk subsystem, until when in disk subsystem, unappropriated space is more than or equal to the search results pages of the nearest least referenced in the stored memory subsystem, and the search results pages of the nearest least referenced in the deletion memory subsystem;
Further, under above any one implementation, this equipment also comprises:
The exchange module, be used for every one-period, the first threshold search results pages of the access frequency minimum in memory subsystem is eliminated in disk subsystem, the first threshold search results pages of the access frequency maximum in disk subsystem is loaded in memory subsystem;
Further, under above any one implementation, this equipment also comprises:
Module is set, and the filename that is used for the search results pages of described assembly unit is set to described retrieval string, and the initial value of access frequency that the search results pages of described assembly unit is set.
Further, under above any one implementation, this equipment also comprises:
Eliminate module, be used for every one-period, according to user journal, eliminate the search results pages of the nearest least referenced in file system;
Further, under above any one implementation, this equipment also comprises:
Load-on module, be used for each cycle, according to user journal, the access frequency of statistics each retrieval string in described Cache system in current period, obtain Second Threshold retrieval string and its corresponding Search Results of access frequency maximum from described Cache system, the Search Results that obtains is assembled into search results pages, the search results pages of assembly unit is carried in file system, and the filename of the search results pages of the assembly unit retrieval string that is set to obtain.
Wherein, this equipment can be Web server.
In embodiments of the present invention, when receiving the request of carrying the retrieval string, according to this retrieval string direct search file system, if search out corresponding search results pages, increase the access times of this search results pages, otherwise, then search for Search Results corresponding to this retrieval string, Search Results is assembled into search results pages and is stored in file system.So, reduce the number of times that creates the CGI process, reduce the CGI process and forward the number of times of retrieval request and reduce the number of times of destroying the CGI process, thus the consumption of minimizing time and resource.
All or part of content in the technical scheme that above embodiment provides can realize by software programming, and its software program is stored in the storage medium that can read, storage medium for example: the hard disk in computing machine, CD or floppy disk.
The above is only preferred embodiment of the present invention, and is in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, is equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (14)

1. the method for a high-speed cache, is characterized in that, described method comprises:
The retrieval request of retrieval string is carried in reception, according to the search results pages of storing in described retrieval string search file system;
If search out corresponding search results pages, increase the access frequency of described search results pages;
If do not search out corresponding search results pages, search for Search Results corresponding to described retrieval string by search engine, described Search Results is assembled into search results pages and is stored in described file system;
Wherein, describedly described Search Results be assembled into search results pages and be stored in described file system, specifically comprising:
Described Search Results is assembled into search results pages;
Judge that in described file system, whether unappropriated space is more than or equal to the needed space of search results pages of storing described assembly unit;
If so, described search results pages is stored in described file system;
If not, eliminate the search results pages of the nearest least referenced in described file system, until when in described file system, unappropriated space is more than or equal to the search results pages needed space of the described assembly unit of storage, described search results pages is stored in described file system.
2. the method for claim 1, is characterized in that, described file system comprises memory subsystem and disk subsystem;
Correspondingly, describedly described Search Results be assembled into search results pages and be stored in described file system, specifically comprising:
Described Search Results is assembled into search results pages;
Judge that in described memory subsystem, whether unappropriated space is more than or equal to the needed space of search results pages of storing described assembly unit;
If so, described search results pages is stored in described memory subsystem;
If not, the search results pages of the nearest least referenced in described memory subsystem is eliminated in described disk subsystem, until in described memory subsystem unappropriated space more than or equal to the storage described assembly unit search results pages the time, described search results pages is stored in described memory subsystem.
3. method as claimed in claim 2, is characterized in that, described search results pages with the nearest least referenced in described memory subsystem is eliminated in described disk subsystem, specifically comprises:
Judge that in described disk subsystem, whether unappropriated space is more than or equal to the needed space of search results pages of storing the nearest least referenced in described memory subsystem;
If so, the search results pages of described nearest least referenced is stored in described disk subsystem, deletes the search results pages of the nearest least referenced in described memory subsystem;
If not, eliminate the search results pages of the nearest least referenced in described disk subsystem, until when in described disk subsystem, unappropriated space is more than or equal to the search results pages of the nearest least referenced of storage in described memory subsystem, the search results pages of the nearest least referenced in described memory subsystem is stored in described disk subsystem, and deletes the search results pages of the nearest least referenced in described memory subsystem.
4. method as claimed in claim 2 or claim 3, is characterized in that, described method also comprises:
Every one-period, the first threshold search results pages of the access frequency minimum in described memory subsystem is eliminated in described disk subsystem, the first threshold search results pages of the access frequency maximum in described disk subsystem is loaded in described memory subsystem.
5. as the described method of claim 1-3 any one claim, it is characterized in that, described described Search Results is assembled into search results pages and is stored in described file system after, also comprise:
The filename of the search results pages of described assembly unit is set to described retrieval string, and the initial value of access frequency that the search results pages of described assembly unit is set.
6. as the described method of claim 1-3 any one claim, it is characterized in that, described method also comprises:
Every one-period, according to user journal, eliminate the search results pages of the nearest least referenced in described file system.
7. as the described method of claim 1-3 any one claim, it is characterized in that, described method also comprises:
Every one-period, access frequency according to each the retrieval string in the Cache system in described search engine in user journal statistics current period, obtain Second Threshold retrieval string and its corresponding Search Results of access frequency maximum from described Cache system, Search Results corresponding to described retrieval string is assembled into search results pages, described search results pages is carried in described file system, and the filename of described search results pages is set to described retrieval string.
8. the equipment of a high-speed cache, is characterized in that, described equipment comprises:
Search module be used for to receive the retrieval request of carrying the retrieval string, according to the search results pages of storing in described retrieval string search file system;
Increase progressively module, if be used for searching out corresponding search results pages, increase the access frequency of described search results pages;
Memory module if be used for not searching out corresponding search results pages, is searched for Search Results corresponding to described retrieval string by search engine, described Search Results is assembled into search results pages and is stored in described file system;
Wherein, described memory module specifically comprises:
The first search unit is used for by Search Results corresponding to the described search engine described retrieval string of search, described Search Results being assembled into search results pages;
The first judging unit is used for judging that described file system unappropriated space is whether more than or equal to the needed capacity of search results pages of the described assembly unit of storage;
The first storage unit is used for if described search results pages is stored in described file system;
The second storage unit, be used for if not, eliminate the search results pages of the nearest least referenced in described file system, until when in described file system, unappropriated space is more than or equal to the search results pages needed space of the described assembly unit of storage, described search results pages is stored in described file system.
9. equipment as claimed in claim 8, is characterized in that, described file system comprises memory subsystem and disk subsystem;
Correspondingly, described memory module specifically comprises:
The second search unit is used for by Search Results corresponding to the described search engine described retrieval string of search, described Search Results being assembled into search results pages;
The second judging unit is used for judging that whether the unappropriated space of described memory subsystem is more than or equal to the needed space of search results pages of storing described assembly unit;
The 3rd storage unit is yes if be used for the result of described the second judgment unit judges, described search results pages is stored in described memory subsystem;
The 4th storage unit, if it is no being used for the result of described the second judgment unit judges, with in described memory subsystem, the search results pages of least referenced is superseded in described disk subsystem recently, until in described memory subsystem unappropriated space more than or equal to the storage described assembly unit search results pages the time, described search results pages is stored in described memory subsystem.
10. equipment as claimed in claim 9, is characterized in that, described the 4th storage unit specifically comprises:
Judgment sub-unit is no if be used for the result of described the second judgment unit judges, judges that in described disk subsystem, whether unappropriated space is more than or equal to the needed space of search results pages of storing the nearest least referenced in described memory subsystem;
The first deletion subelement, be used for if, the search results pages of described nearest least referenced is stored in described disk subsystem, delete the search results pages of the nearest least referenced in described memory subsystem;
The second deletion subelement, be used for if not, eliminate the search results pages of the nearest least referenced in described disk subsystem, until when in described disk subsystem, unappropriated space is more than or equal to the search results pages of the nearest least referenced of storage in described memory subsystem, the search results pages of the nearest least referenced in described memory subsystem is stored in described disk subsystem, and deletes the search results pages of the nearest least referenced in described memory subsystem;
Storing sub-units is for the memory subsystem of stating that described search results pages is stored in.
11. equipment as described in claim 9 or 10 is characterized in that, described equipment also comprises:
The exchange module, be used for every one-period, the first threshold search results pages of the access frequency minimum in described memory subsystem is eliminated in described disk subsystem, the first threshold search results pages of the access frequency maximum in described disk subsystem is loaded in described memory subsystem.
12. as the described equipment of claim 8-10 any one claim, it is characterized in that, described equipment also comprises:
Module is set, and the filename that is used for the search results pages of described assembly unit is set to described retrieval string, and the initial value of access frequency that the search results pages of described assembly unit is set.
13. as the described equipment of claim 8-10 any one claim, it is characterized in that, described equipment also comprises:
Eliminate module, be used for every one-period, according to user journal, eliminate the search results pages of the nearest least referenced in described file system.
14. as the described equipment of claim 8-10 any one claim, it is characterized in that, described equipment also comprises:
Load-on module, be used for each cycle, according to user journal, the access frequency of each the retrieval string in the Cache system in the statistics current period in described search engine, obtain Second Threshold retrieval string and its corresponding Search Results of access frequency maximum from described Cache system, described Search Results is assembled into search results pages, described search results pages is carried in described file system, and with the file of described search results pages described retrieval string by name.
CN 201010141766 2010-04-06 2010-04-06 Caching method and caching equipment Active CN102214172B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010141766 CN102214172B (en) 2010-04-06 2010-04-06 Caching method and caching equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010141766 CN102214172B (en) 2010-04-06 2010-04-06 Caching method and caching equipment

Publications (2)

Publication Number Publication Date
CN102214172A CN102214172A (en) 2011-10-12
CN102214172B true CN102214172B (en) 2013-05-08

Family

ID=44745487

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010141766 Active CN102214172B (en) 2010-04-06 2010-04-06 Caching method and caching equipment

Country Status (1)

Country Link
CN (1) CN102214172B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609364A (en) * 2012-02-14 2012-07-25 华中科技大学 Cache exchange method
CN102930056B (en) * 2012-11-21 2016-11-23 华为技术有限公司 The search method of cloud storage system and equipment
CN103902610A (en) * 2012-12-28 2014-07-02 北大方正集团有限公司 Searching method and searching device
CN105930405B (en) * 2013-07-12 2019-09-24 北京鑫富天恒科技有限公司 Suitable in url data crawl to the method and device of data buffer storage
WO2016200399A1 (en) * 2015-06-12 2016-12-15 Hewlett Packard Enterprise Development Lp Application identification cache
WO2018040106A1 (en) * 2016-09-05 2018-03-08 深圳前海达闼云端智能科技有限公司 Method and apparatus for outputting search result, and electronic device
CN106484814A (en) * 2016-09-23 2017-03-08 珠海格力电器股份有限公司 Data search method and device
CN107506445A (en) * 2017-08-25 2017-12-22 郑州云海信息技术有限公司 The response method and device of data query in cloud data system
CN111400029A (en) * 2020-02-10 2020-07-10 北京物资学院 Web search service method and device with storage and editing functions

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100456286C (en) * 2005-01-17 2009-01-28 马岩 Universal file search system and method
CN100437590C (en) * 2007-06-08 2008-11-26 北京大学 Method for prefetching object

Also Published As

Publication number Publication date
CN102214172A (en) 2011-10-12

Similar Documents

Publication Publication Date Title
CN102214172B (en) Caching method and caching equipment
CN102542052B (en) Priority hash index
CN102355488B (en) Crawler seed obtaining method and equipment and crawler crawling method and equipment
CN100507920C (en) Search engine retrieving result reordering method based on user behavior information
US20110246457A1 (en) Ranking of search results based on microblog data
US20110087644A1 (en) Enterprise node rank engine
CN101963965B (en) Document indexing method, data query method and server based on search engine
US20090299978A1 (en) Systems and methods for keyword and dynamic url search engine optimization
CN102710795B (en) Hotspot collecting method and device
CN102117321A (en) Automated discovery aggregation and organization of subject area discussions
CN105740472A (en) Distributed real-time full-text search method and system
CN104298790A (en) Browser accelerating method and browser device with accelerator
CN102722499A (en) Search engine and implementation method thereof
CN103092839A (en) Management method and device for recording historical information
Yafay et al. Caching scores for faster query processing with dynamic pruning in search engines
CN103268347A (en) System and method for mobile internet searching system based on messages
CN102541924B (en) A kind of caching method of retrieving information and search engine system
US8712992B2 (en) Method and apparatus for web crawling
CN104281688A (en) Automatic erasing method and automatic erasing device for browser
CN103823805B (en) Community-based correlation note commending system and recommendation method
Jarukasemratana et al. Web caching replacement algorithm based on web usage data
CN104615596A (en) Method for clearing history information and browser
JP5286007B2 (en) Document search device, document search method, and document search program
CN100447788C (en) Information search method and system based on fixed keyword
Shalya et al. An effective content based web page ranking approach

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: SHENZHEN SHIJI LIGHT SPEED INFORMATION TECHNOLOGY

Free format text: FORMER OWNER: TENGXUN SCI-TECH (SHENZHEN) CO., LTD.

Effective date: 20131104

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 518000 SHENZHEN, GUANGDONG PROVINCE TO: 518057 SHENZHEN, GUANGDONG PROVINCE

TR01 Transfer of patent right

Effective date of registration: 20131104

Address after: A Tencent Building in Shenzhen Nanshan District City, Guangdong streets in Guangdong province science and technology 518057 16

Patentee after: Shenzhen Shiji Guangsu Information Technology Co., Ltd.

Address before: 518000 Guangdong city of Shenzhen province Futian District SEG Science Park 2 East Room 403

Patentee before: Tencent Technology (Shenzhen) Co., Ltd.