CN101706827A - Method for caching file of embedded browser - Google Patents
Method for caching file of embedded browser Download PDFInfo
- Publication number
- CN101706827A CN101706827A CN200910306284A CN200910306284A CN101706827A CN 101706827 A CN101706827 A CN 101706827A CN 200910306284 A CN200910306284 A CN 200910306284A CN 200910306284 A CN200910306284 A CN 200910306284A CN 101706827 A CN101706827 A CN 101706827A
- Authority
- CN
- China
- Prior art keywords
- node
- nearest
- url
- file management
- life cycle
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention relates to the field of embedded technology, in particular to a method for caching a file of an embedded browser. The invention discloses a method for caching the file of the embedded browser; and cached files are selectively eliminated, and the response efficiency of the embedded browser is improved as much as possible in a finite storage space. The technical scheme adopts the following key points: a space with a fixed size is pre-allocated for caching all the acquired files locally; when the quantity of the cached files is less tan the cache space, the cached files are not released immediately; and when the cache space is almost full, files which are not used for the longest time are released firstly, and then files which are used most impossibly in the future according to estimation under a certain statistical rule are released. The method has the advantages that: the cached files are effectively eliminated selectively, the response efficiency of the browser is improved, and the method is suitable for the embedded browser.
Description
Technical field
The present invention relates to field of embedded technology, relate to a kind of method for caching file of embedded browser specifically.
Background technology
Along with the development of Internet technology, increasing content is transmitted by the internet and is visited.This application model based on Web (a kind of content platform based on http hypertext transfer protocol) and Browser (browser) more and more comes across in the various application and developments, is become B/S (Browser/Server---browser/server) application model usually.
The content of internet all is that the mode with file leaves on the Web server, is sent to browser client by http protocol, after browser handles, on the present terminal of contents table.When client browser got access to file from Web server, file can not directly be showed in terminal output usually, must do certain processing.Therefore, browser at first must carry out buffer memory with some files in this locality, be processed into the data that can directly show after, will show and show these data again.
The Web page is made up of the file of a plurality of separation.Many files as picture, script file, are often shared by a plurality of pages.Refresh in the process of the page at browser,, also can increase workflow, cause browser client to wait for the cycle lengthening of the page, thereby increased the execution cost, and reduced execution usefulness if these files of frequent request not only can cause network congestion.
In built-in field, resource is very limited, therefore can not a large amount of file of disposable buffer memory, a kind of superseded mechanism must be arranged, and make application in carrying out usefulness and taking up room, to obtain a balance.
Summary of the invention
Technical matters to be solved by this invention is: propose a kind of method for caching file of embedded browser, cache file is carried out selective elimination, under finite storage space, improve the response efficiency of built-in browser as far as possible.
The present invention solves the problems of the technologies described above the technical scheme that is adopted: a kind of method for caching file of embedded browser may further comprise the steps:
A. set up the cache file management formation;
B. be the spatial cache of a fixed size of cache file management queue assignment, the nearest life cycle of all pages of initialization is 0;
C. the url that waits for browser triggers;
D. when url trigger to arrive, judge whether current url triggers is root document url, if, execution in step e then, if not, execution in step f then;
E. the nearest life cycle with nodes all in the current cache file management formation adds 1, changes step f;
When f. judge triggering url, whether there has been url in the current cache file management formation, if, execution in step g then, if not, execution in step h then;
G. the node with this url correspondence takes out from the cache file management formation, and empties its nearest life cycle, and its nearest access times are added 1, inserts the cache file management formation again in order, jumps to step c;
H. send the url request, change step I;
I. the web file to getting access to is newly set up a node, log file data, url and file size, and with the nearest life cycle of this node and recently access times all put 0;
J. calculate the size of spatial cache residual capacity, and compare, if residual capacity is then changeed step k more than or equal to the present node file size, if residual capacity is then changeed step m less than the present node file size with the size of present node file;
K. node is put into the cache file management formation, jumped to step c;
M. by the part of nodes in the formation of certain rule release cache file management, jump to step j.
In the described step g, the node of this url correspondence is inserted cache file management formation: g1. in the following order from the cache file management queue heads, the nearest life cycle size of first node in the node of this url correspondence and the cache file management formation relatively, if the former greatly the next node of getting in the formation compare, if the latter is greatly then execution in step g2; G2. the size of the nearest access times of the nearest access times of the node of this url correspondence and the node in the formation relatively is if the former the little next node of then getting in the formation compares, if the former is execution in step g3 greatly then; G3. insert the node of this url correspondence in current location.
Among the described step k, node is put into the cache file management formation according to nearest life cycle size sequence, for identical nearest life cycle size, put into the cache file management formation according to the size of nearest access times.
Among the described step m, discharge the part of nodes in the cache file management formation according to the following rules: the node that preferentially discharges nearest life cycle maximum, if the node of a plurality of nearest life cycle maximums is arranged, the then preferential maximum and nearest minimum node of access times of nearest life cycle that discharges.
Among the described step m, discharge the part of nodes in the cache file management formation according to the following rules: preferentially discharge the minimum node of nearest access times, if the minimum node of a plurality of nearest access times is arranged, the then preferential node that discharges the minimum and nearest life cycle maximum of nearest access times.
The invention has the beneficial effects as follows: cache file is carried out selective elimination effectively, improve the response efficiency of browser.
Description of drawings
Fig. 1 asks method flow diagram of the present invention.
Embodiment
The invention will be further described below in conjunction with accompanying drawing.
Main guiding theory of the present invention is: allocate the space of a fixed size in advance, all files that obtained are carried out local cache, when cache file amount during less than spatial cache, do not discharge buffer memory immediately; By the time spatial cache is when taking, at first discharge the file that those maximum durations are not used, discharging those again estimates according to certain statistical rules, the file that the possibility that will be used future is minimum, so cache file is carried out optionally eliminating, improve the response efficiency of built-in browser with regard to realizing.
As shown in Figure 1, the method for caching file of embedded browser among the present invention, take following measure to realize: a. sets up the cache file management formation; B. be the spatial cache of a fixed size of cache file management queue assignment, the nearest life cycle of all pages of initialization is 0, the life cycle here refers to the refreshing frequency interval of the page, life cycle is 1 when refreshing for the first time, life cycle is 2 when refreshing for the second time .... so analogize; C. the url (URL(uniform resource locator)) that waits for browser triggers; D. when url trigger to arrive, judge whether current url triggers is root document (page acquiescence document) url, if, execution in step e then, if not, execution in step f then; Here judge whether to be root document url, be the nearest life cycle of nodes all in the current cache file management formation to be added 1 for the frequency .e. that quotes that the refreshing frequency according to full page calculates certain url resource, represent that these nodes are refreshed now for the second time, change step f; When f. judge triggering url, whether there has been url in the current cache file management formation, if, execution in step g then, if not, execution in step h then; G. the node with this url correspondence takes out from the cache file management formation, and empty its nearest life cycle, its nearest access times are added 1, again insert cache file management formation: g1. in order from the cache file management queue heads, the nearest life cycle size of first node in the node of this url correspondence and the cache file management formation relatively, if the former greatly the next node of getting in the formation compare, if the latter is greatly then execution in step g2; G2. the size of the nearest access times of the nearest access times of the node of this url correspondence and the node in the formation relatively is if the former the little next node of then getting in the formation compares, if the former is execution in step g3 greatly then; G3. insert the node of this url correspondence in current location; Jump to step c; H. send the url request, change step I; I. the web file to getting access to is newly set up a node, log file data, url and file size, and with the nearest life cycle of this node and recently access times all put 0; J. calculate the size of spatial cache residual capacity, and compare, if residual capacity is then changeed step k more than or equal to the present node file size, if residual capacity is then changeed step m less than the present node file size with the size of present node file; K. node is put into the cache file management formation according to nearest life cycle size sequence, for identical nearest life cycle size, put into the cache file management formation according to the size of nearest access times, jump to step c; M. discharge the part of nodes in the cache file management formation according to the following rules: the node that preferentially discharges nearest life cycle maximum, if the node of a plurality of nearest life cycle maximums is arranged, otherwise the then preferential maximum and nearest minimum node of access times of nearest life cycle that discharges. equally also can, the preferential minimum node of nearest access times that discharges, if the minimum node of a plurality of nearest access times is arranged, the then preferential node that discharges the minimum and nearest life cycle maximum of nearest access times.
Claims (5)
1. method for caching file of embedded browser is characterized in that: may further comprise the steps:
A. set up the cache file management formation;
B. be the spatial cache of a fixed size of cache file management queue assignment, the nearest life cycle of all pages of initialization is 0;
C. the url that waits for browser triggers;
D. when url trigger to arrive, judge whether current url triggers is root document url, if, execution in step e then, if not, execution in step f then;
E. the nearest life cycle with nodes all in the current cache file management formation adds 1, changes step f;
When f. judge triggering url, whether there has been url in the current cache file management formation, if, execution in step g then, if not, execution in step h then;
G. the node with this url correspondence takes out from the cache file management formation, and nearest life cycle is put 0, and its nearest access times are added 1, inserts the cache file management formation again in order, jumps to step c;
H. send the url request, change step I;
I. the web file to getting access to is newly set up a node, log file data, url and file size, and with the nearest life cycle of this node and recently access times all put 0;
J. calculate the size of spatial cache residual capacity, and compare, if residual capacity is then changeed step k more than or equal to the present node file size, if residual capacity is then changeed step m less than the present node file size with the size of present node file;
K. node is put into the cache file management formation, jumped to step c;
M. by the part of nodes in the formation of certain rule release cache file management, jump to step j.
2. a kind of method for caching file of embedded browser as claimed in claim 1, it is characterized in that: in the described step g, the node of this url correspondence is inserted cache file management formation: g1. in the following order from the cache file management queue heads, the nearest life cycle size of first node in the node of this url correspondence and the cache file management formation relatively, if the former greatly the next node of getting in the formation compare, if the latter is greatly then execution in step g2; G2. the size of the nearest access times of the nearest access times of the node of this url correspondence and the node in the formation relatively is if the former the little next node of then getting in the formation compares, if the former is execution in step g3 greatly then; G3. insert the node of this url correspondence in current location.
3. a kind of method for caching file of embedded browser as claimed in claim 1 or 2, it is characterized in that: among the described step k, node is put into the cache file management formation according to nearest life cycle size sequence, for identical nearest life cycle size, put into the cache file management formation according to the size of nearest access times.
4. a kind of method for caching file of embedded browser as claimed in claim 1 or 2, it is characterized in that: among the described step m, discharge the part of nodes in the cache file management formation according to the following rules: the node that preferentially discharges nearest life cycle maximum, if the node of a plurality of nearest life cycle maximums is arranged, the then preferential maximum and nearest minimum node of access times of nearest life cycle that discharges.
5. a kind of method for caching file of embedded browser as claimed in claim 1 or 2, it is characterized in that: among the described step m, discharge the part of nodes in the cache file management formation according to the following rules: preferentially discharge the minimum node of nearest access times, if the minimum node of a plurality of nearest access times is arranged, the then preferential node that discharges the minimum and nearest life cycle maximum of nearest access times.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009103062846A CN101706827B (en) | 2009-08-28 | 2009-08-28 | Method for caching file of embedded browser |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009103062846A CN101706827B (en) | 2009-08-28 | 2009-08-28 | Method for caching file of embedded browser |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101706827A true CN101706827A (en) | 2010-05-12 |
CN101706827B CN101706827B (en) | 2011-09-21 |
Family
ID=42377052
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009103062846A Active CN101706827B (en) | 2009-08-28 | 2009-08-28 | Method for caching file of embedded browser |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101706827B (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102420725A (en) * | 2011-12-27 | 2012-04-18 | 华为技术有限公司 | Method for detecting IP network bandwidth and apparatus thereof |
CN102611725A (en) * | 2011-01-25 | 2012-07-25 | 腾讯科技(深圳)有限公司 | Method and device for storing nodes |
CN102880616A (en) * | 2011-07-15 | 2013-01-16 | 腾讯科技(深圳)有限公司 | Browser page loading method and device |
WO2013113150A1 (en) * | 2012-01-31 | 2013-08-08 | 华为技术有限公司 | Cache optimization method, cache and cache optimization system |
CN103294718A (en) * | 2012-02-29 | 2013-09-11 | 腾讯科技(深圳)有限公司 | Method and device for web page cache management |
CN103793426A (en) * | 2012-11-01 | 2014-05-14 | 腾讯科技(深圳)有限公司 | Method and device for keeping web page access records |
CN104636364A (en) * | 2013-11-08 | 2015-05-20 | 腾讯科技(深圳)有限公司 | Method and device for freeing memory of browser |
TWI506523B (en) * | 2010-12-10 | 2015-11-01 | Chiun Mai Comm Systems Inc | System and method for accessing icons |
CN105302497A (en) * | 2015-11-24 | 2016-02-03 | 浪潮(北京)电子信息产业有限公司 | Cache management method and cache management system |
CN106649313A (en) * | 2015-10-29 | 2017-05-10 | 阿里巴巴集团控股有限公司 | Method and equipment for processing cache data |
CN108173974A (en) * | 2018-03-01 | 2018-06-15 | 南京邮电大学 | A kind of HC Model inner buffer data based on distributed caching Memcached eliminate method |
CN111290347A (en) * | 2018-12-10 | 2020-06-16 | 北京京东尚科信息技术有限公司 | Monitoring method and system |
CN113074656A (en) * | 2019-12-18 | 2021-07-06 | 财团法人工业技术研究院 | Workpiece hole measuring method |
-
2009
- 2009-08-28 CN CN2009103062846A patent/CN101706827B/en active Active
Cited By (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI506523B (en) * | 2010-12-10 | 2015-11-01 | Chiun Mai Comm Systems Inc | System and method for accessing icons |
US8788539B2 (en) | 2011-01-25 | 2014-07-22 | Tencent Technology (Shenzhen) Company Limited | Method and apparatus for storing node |
CN102611725A (en) * | 2011-01-25 | 2012-07-25 | 腾讯科技(深圳)有限公司 | Method and device for storing nodes |
WO2012100613A1 (en) * | 2011-01-25 | 2012-08-02 | 腾讯科技(深圳)有限公司 | Method and device for storing node |
CN102611725B (en) * | 2011-01-25 | 2016-08-03 | 腾讯科技(深圳)有限公司 | A kind of method and device of memory node |
CN102880616A (en) * | 2011-07-15 | 2013-01-16 | 腾讯科技(深圳)有限公司 | Browser page loading method and device |
CN102880616B (en) * | 2011-07-15 | 2016-02-17 | 腾讯科技(深圳)有限公司 | browser page loading method and device |
CN102420725A (en) * | 2011-12-27 | 2012-04-18 | 华为技术有限公司 | Method for detecting IP network bandwidth and apparatus thereof |
CN102420725B (en) * | 2011-12-27 | 2014-05-21 | 华为技术有限公司 | Method for detecting IP network bandwidth and apparatus thereof |
CN103416027A (en) * | 2012-01-31 | 2013-11-27 | 华为技术有限公司 | Cache optimization method, cache and cache optimization system |
WO2013113150A1 (en) * | 2012-01-31 | 2013-08-08 | 华为技术有限公司 | Cache optimization method, cache and cache optimization system |
CN103294718A (en) * | 2012-02-29 | 2013-09-11 | 腾讯科技(深圳)有限公司 | Method and device for web page cache management |
CN103793426A (en) * | 2012-11-01 | 2014-05-14 | 腾讯科技(深圳)有限公司 | Method and device for keeping web page access records |
US11403365B2 (en) | 2012-11-01 | 2022-08-02 | Tencent Technology (Shenzhen) Company Limited | Method and apparatus for storing webpage access records |
CN104636364A (en) * | 2013-11-08 | 2015-05-20 | 腾讯科技(深圳)有限公司 | Method and device for freeing memory of browser |
CN104636364B (en) * | 2013-11-08 | 2019-04-16 | 腾讯科技(深圳)有限公司 | The memory release method and device of browser |
CN106649313B (en) * | 2015-10-29 | 2020-11-27 | 阿里巴巴集团控股有限公司 | Method and apparatus for processing cache data |
CN106649313A (en) * | 2015-10-29 | 2017-05-10 | 阿里巴巴集团控股有限公司 | Method and equipment for processing cache data |
CN105302497A (en) * | 2015-11-24 | 2016-02-03 | 浪潮(北京)电子信息产业有限公司 | Cache management method and cache management system |
CN108173974B (en) * | 2018-03-01 | 2021-02-12 | 南京邮电大学 | HCModel internal cache data elimination method based on distributed cache Memcached |
CN108173974A (en) * | 2018-03-01 | 2018-06-15 | 南京邮电大学 | A kind of HC Model inner buffer data based on distributed caching Memcached eliminate method |
CN111290347A (en) * | 2018-12-10 | 2020-06-16 | 北京京东尚科信息技术有限公司 | Monitoring method and system |
CN113074656A (en) * | 2019-12-18 | 2021-07-06 | 财团法人工业技术研究院 | Workpiece hole measuring method |
CN113074656B (en) * | 2019-12-18 | 2023-03-07 | 财团法人工业技术研究院 | Workpiece hole measuring method |
Also Published As
Publication number | Publication date |
---|---|
CN101706827B (en) | 2011-09-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101706827B (en) | Method for caching file of embedded browser | |
US10182127B2 (en) | Application-driven CDN pre-caching | |
CN102880616B (en) | browser page loading method and device | |
US20120192080A1 (en) | Tailoring content based on available bandwidth | |
CN104486350B (en) | A kind of Web content accelerated method based on user behavior | |
US9154572B2 (en) | Changing I/O types for processing data requests | |
JP6262939B2 (en) | Cache system using network switch and cache service providing method | |
CN103312733B (en) | Information processing method and device | |
US10771358B2 (en) | Data acquisition device, data acquisition method and storage medium | |
CN105550338A (en) | HTML5 application cache based mobile Web cache optimization method | |
CN104217019A (en) | Content inquiry method and device based on multiple stages of cache modules | |
WO2023050712A1 (en) | Task scheduling method for deep learning service, and related apparatus | |
CN103905439A (en) | Webpage browsing accelerating method based on home gateway | |
CN105450579A (en) | Network resource preloading method, client, and middleware server | |
JP2020102838A5 (en) | ||
CN108519987A (en) | A kind of data persistence method and apparatus | |
CN106681990A (en) | Method for reading caching data under mobile cloud storage environment | |
CN108769253B (en) | Adaptive pre-fetching control method for optimizing access performance of distributed system | |
CN103945013A (en) | Data transmission interface device and data transmission method | |
US20140143573A1 (en) | Communication device and method | |
WO2012114889A1 (en) | Application construction and arrangement system, application construction and arrangement method, and program | |
CN101770511B (en) | Browse system for accelerating backspace operation of mobile communication equipment terminal and application method thereof | |
CN109995824B (en) | Task scheduling method and device in peer-to-peer network | |
CN105988941A (en) | Cached data processing method and device | |
EP3274844B1 (en) | Hierarchical cost based caching for online media |
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 | ||
C41 | Transfer of patent application or patent right or utility model | ||
TR01 | Transfer of patent right |
Effective date of registration: 20160414 Address after: 621000 Mianyang province high tech Zone, East Hing Road, No. 35 cotton Patentee after: Sichuan Changhong Electrical Appliance Co., Ltd. Address before: 1009, room 8, building 610041, high tech incubator Park, South Tianfu Road, Tianfu Road, Chengdu hi tech Zone, Sichuan Patentee before: Panovasic Co., Ltd. |