CN103699595A - Method and device for webpage caching of terminal browser and terminal - Google Patents

Method and device for webpage caching of terminal browser and terminal Download PDF

Info

Publication number
CN103699595A
CN103699595A CN201310676543.0A CN201310676543A CN103699595A CN 103699595 A CN103699595 A CN 103699595A CN 201310676543 A CN201310676543 A CN 201310676543A CN 103699595 A CN103699595 A CN 103699595A
Authority
CN
China
Prior art keywords
webpage
tree
index object
dom tree
render
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310676543.0A
Other languages
Chinese (zh)
Inventor
张少伟
牛磊
左景龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiaomi Inc
Original Assignee
Xiaomi Inc
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 Xiaomi Inc filed Critical Xiaomi Inc
Priority to CN201310676543.0A priority Critical patent/CN103699595A/en
Publication of CN103699595A publication Critical patent/CN103699595A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Abstract

The invention discloses a method for webpage caching of a terminal browser. The method comprises the following steps of loading a webpage, generating a DOM (document object model) tree and a Render tree corresponding to the webpage, and storing the DOM tree and the Render tree in a memory; generating an index object corresponding to the webpage, wherein the index object is used for indicating the storage addresses of the DOM tree and the Render tree corresponding to the webpage; storing the index object into an index list. The embodiment of the invention also discloses a device for the webpage caching of the terminal browser and a terminal. By adopting the method, the speed of the browser executing the webpage returning operation can be accelerated, the operation time is shortened, and the energy and electricity of the terminal can be favorably saved.

Description

A kind of page cache method of terminal browser and device and terminal
Technical field
The present invention relates to communication technical field, particularly a kind of page cache method of terminal browser and device and terminal.
Background technology
Along with the development of mobile terminal and Internet technology, people are increasing to be selected by terminal browsing page.Typical usage by terminal browsing page is: open a webpage, have a lot of links on the page of this webpage, click one of them link, enter this and link the corresponding page, after browsing, return to the initial page, select to click other link.
In realizing process of the present invention, inventor finds at least to exist following problem:
When browser returns to the operation of the initial page in execution, many times also need to reload the page, this page is resolved and typesetting again, the implementation that makes thus to return operation is very slow, extends the running time of terminal, is unfavorable for the energy saving of terminal.
Summary of the invention
The embodiment of the present invention provides a kind of page cache method and device of terminal browser, can accelerate browser and carry out the speed that the page returns to operation, shortens the running time, is conducive to the energy saving of terminal.
Described technical scheme is as follows:
First aspect, provides a kind of webpage caching method of terminal browser, and described method comprises:
Web page loading, generates the dom tree corresponding with described webpage and Render tree, and described dom tree and Render tree are kept in internal memory;
Generate the index object corresponding with described webpage, described index object is for indicating the preservation address of dom tree that described webpage is corresponding and Render tree;
Described index object is kept in index.
Preferably, described described dom tree and Render tree is kept to internal memory in before, described method also comprises:
Determine that buffer memory condition and main document corresponding to described webpage that described web pages conform is default do not exist error message.
Preferably, described default buffer memory condition, comprising:
When the network address of described webpage belongs to the link of Secure Hypertext Transfer Protocol HTTPS, in the main document of described webpage, there is not the element of list FORM type;
And/or,
When the network address of described webpage belongs to the link of HTTPS, in default secure web-page list, comprise described webpage.
Preferably, described default buffer memory condition, comprising:
When the network address of described webpage does not belong to HTTPS link, there is not the monitoring mechanism of unloading unload event in described webpage;
And/or,
When the network address of described webpage does not belong to HTTPS link, there is not the behavior of opening local data base in described webpage;
And/or,
When the network address of described webpage does not belong to HTTPS link, the main document that described webpage is corresponding belongs to WAP Markup Language WML form or comprises the content of WML.
Preferably, described method also comprises:
When the number of the index object of preserving is greater than default higher limit, according to holding time of described index object, delete dom tree and the Render tree of webpage corresponding to the index object that specifies number in described index.
Preferably, described holding time according to described index object is deleted dom tree and the Render tree of webpage corresponding to the index object that specifies number, comprising:
To the index object of preserving in described index according to the holding time by early sorting to evening;
Before coming, deletion specifies number dom tree and the Render tree of the webpage corresponding to index object of position.
Preferably, described method also comprises:
Obtain the use information of current memory headroom, according to the surplus of described memory headroom, revise the higher limit of preserving the dom tree of webpage and the number of Render tree.
Preferably, described method also comprises:
Receive the again request of access of user to described webpage, according to described index object, read dom tree and the Render tree that described webpage is corresponding, play up demonstration.
Preferably, after described reception user is to the request of access again of described webpage, described method also comprises:
Judge and in internal memory, whether preserve the dom tree corresponding with described webpage and Render tree, if preserved, then carry out and according to described index object, read dom tree and the Render that described webpage is corresponding and set and play up the step of demonstration.
Second aspect, provides a kind of webpage buffer storage of terminal browser, and described device comprises:
The first generation unit, for Web page loading, generates the dom tree corresponding with described webpage and Render tree;
The first storage unit, for being kept at internal memory by described dom tree and Render tree;
The second generation unit, for generating the index object corresponding with described webpage, described index object is for indicating the preservation address of dom tree that described webpage is corresponding and Render tree;
The second storage unit, for being kept at index by described index object.
Preferably, described device also comprises:
The first judging unit, for determining that default buffer memory condition and main document corresponding to described webpage of described web pages conform do not exist error message.
Preferably, it is characterized in that, described the first judging unit comprises:
, while belonging to the link of Secure Hypertext Transfer Protocol HTTPS for the network address when described webpage, in the document of described webpage, there is not the element of list FORM type in the first judgment sub-unit;
And/or,
The second judgment sub-unit, while belonging to the link of HTTPS for the network address when described webpage, comprises described webpage in default secure web-page list.
Preferably, described the first judging unit also comprises:
The 3rd judgment sub-unit, while not belonging to HTTPS link for the network address when described webpage, there is not the monitoring mechanism of unloading unload event in described webpage;
And/or,
The 4th judgment sub-unit, while not belonging to HTTPS link for the network address when described webpage, there is not the behavior of opening local data base in described webpage;
And/or,
The 5th judgment sub-unit, while not belonging to HTTPS link for the network address when described webpage, the main document that described webpage is corresponding belongs to WAP Markup Language WML form or comprises the content of WML.
Preferably, described device also comprises:
Delete cells, while being greater than default higher limit for the number of the index object of preserving when described index, deletes dom tree and the Render tree of webpage corresponding to the index object that specifies number according to the holding time of described index object.
Preferably, described delete cells comprises:
Sequence subelement, for index object that described index is preserved according to the holding time by early sorting to evening;
Delete subelement, for deleting dom tree and the Render tree that specifies number webpage corresponding to the index object of position before coming.
Preferably, described device also comprises:
Amending unit, for obtaining the use information of current memory headroom, according to the surplus of described memory headroom, revises the higher limit of preserving the dom tree of webpage and the number of Render tree.
Preferably, described device also comprises:
Reading unit, for receiving the again request of access of user to described webpage, reads according to described index object dom tree and the Render tree that described webpage is corresponding, plays up demonstration.
Preferably, described device also comprises:
The second judging unit, for judging whether internal memory preserves the dom tree corresponding with described webpage and Render tree;
Described reading unit, also for when judgment result is that of described the second judging unit is, then carries out and according to described index object, reads dom tree and the Render that described webpage is corresponding and set and play up the step of demonstration.
The third aspect, provides a kind of terminal, and described terminal comprises the webpage buffer storage of the terminal browser as described in aforementioned any one.
Fourth aspect, a kind of mobile terminal is provided, include storer, and one or more than one program, the above program of one of them or one is stored in storer, and is configured to carry out described one or above routine package containing for carrying out the instruction of following operation by one or above processor:
Web page loading, generates the dom tree corresponding with described webpage and Render tree, and described dom tree and Render tree are kept in internal memory;
Generate the index object corresponding with described webpage, described index object is for indicating the preservation address of dom tree that described webpage is corresponding and Render tree;
Described index object is kept in index.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
Method described in the embodiment of the present invention, when opening webpage, dom tree and Render tree that the webpage of generation is corresponding are kept in internal memory.When needs return to this webpage or reopen this webpage, only need to from index, find the index object corresponding with this webpage, the address indicating according to described index object, directly gets dom tree and Render tree that this webpage is corresponding, and this webpage is carried out to layout.
Thus can so that, when returning to or reopening the webpage of once opening, do not need to reload this webpage and this webpage is re-started and resolved and typesetting, the implementation that makes to return operation is very fast, reduce the required time of terminal executable operations, be conducive to the energy saving of terminal.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing of required use during embodiment is described is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the page cache method process flow diagram of the terminal browser described in the embodiment of the present invention one;
Fig. 2 is the page cache method process flow diagram of the terminal browser described in the embodiment of the present invention two;
Fig. 3 is the webpage buffer storage structural drawing of the terminal browser described in the embodiment of the present invention;
Fig. 4 is the structural representation of the related terminal device of the embodiment of the present invention;
A kind of server architecture schematic diagram that Fig. 5 provides for the embodiment of the present invention.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
The embodiment of the present invention provides a kind of page cache method and device of terminal browser, can accelerate browser and carry out the speed that the page returns to operation, shortens the running time, is conducive to the energy saving of terminal.
For better the method described in the embodiment of the present invention being introduced, first, browser being opened to the process of webpage and simply described.
Webpage is a file, via URL(uniform resource locator) (Uniform Resource Locator, URL are called for short network address), identifies and access.Webpage will be read by browser.When browser receive that terminal sends open the instruction of certain webpage time, browser is to main document corresponding to this webpage of server request, and resolve this main document, generate dom tree corresponding to this network address and Render tree, according to described Render tree, this webpage is carried out to layout(layout).
With reference to Fig. 1, it is the page cache method process flow diagram of the terminal browser described in the embodiment of the present invention one.As shown in Figure 1, described method comprises:
101, Web page loading, generates the dom tree corresponding with described webpage and Render tree, and described dom tree and Render tree are kept in internal memory.
102, the generation index object corresponding with described webpage, described index object is for indicating the preservation address of dom tree that described webpage is corresponding and Render tree.
103, described index object is kept in index.
Method described in the embodiment of the present invention, when opening webpage, dom tree and Render tree that the webpage of generation is corresponding are kept in internal memory.When needs return to this webpage or reopen this webpage, only need to from index, find the index object corresponding with this webpage, the address indicating according to described index object, directly gets dom tree and Render tree that this webpage is corresponding, and this webpage is carried out to layout.
Thus can so that, when returning to or reopening the webpage of once opening, do not need to reload this webpage and this webpage is re-started and resolved and typesetting, the implementation that makes to return operation is very fast, reduce the required time of terminal executable operations, be conducive to the energy saving of terminal.
But, in actual applications, because the memory headroom of terminal is limited, be not therefore that all webpages of once opening are all needed to carry out buffer memory.Concrete, before preserving described dom tree and Render tree, can also judge determine whether this webpage meets default buffer memory condition to the webpage when front opening, while only having this webpage of determining to be buffered, just carry out the step of preserving.
Concrete, referring to the method described in the embodiment of the present invention two.With reference to Fig. 2, it is the page cache method process flow diagram of the terminal browser described in the embodiment of the present invention two.As shown in Figure 2, described method comprises:
201, described terminal browser Web page loading, generates the dom tree corresponding with described webpage and Render tree, according to described dom tree and Render tree, carries out layout(layout).
When user selects to open a webpage, the URL that this webpage of browser access is corresponding, and to main document corresponding to this URL of server request, be the page main document that this webpage is corresponding.
Main document described in browser resolves, generates dom tree and Render tree that described webpage is corresponding, and according to described dom tree and Render tree, this webpage is carried out to layout.
Concrete, in browser, be built-in with render engine, can, according to the page main document obtaining from server, automatically generate dom tree and Render tree that this webpage is corresponding.Wherein, described dom tree is for describing the information of the html page; Render tree, for layout, is specifically responsible for the content how dom tree being comprised and is presented on screen.
And the layout operation that layout is render engine to webpage, after getting dom tree and Render tree, the render engine of browser by layout by page layout in internal memory.After layout, browser just can, by Web page rendering on display screen, represent to user.
Realized thus the overall process to the loading of webpage demonstration.Described in the embodiment of the present invention, in method, when loading the described page, realize the buffer memory to this page.
202, judge that whether described webpage meets default buffer memory condition, if met, enters 203; If do not met, enter 206.
In the embodiment of the present invention, before webpage is carried out to buffer memory, first judge whether this webpage meets default buffer memory condition, if met, then preserve dom tree and the Render that this webpage is corresponding; If do not met, delete dom tree and Render that this webpage is corresponding.
It should be noted that, in actual applications, when opening some webpage, the situation that likely there will be webpage not open.For example, URL input error, server failure, this webpage that this webpage is corresponding are out of date etc., in the page of now opening, can show the information such as " cannot show this page ", " cannot find this page " or " parameter is incorrect ".For this situation, even if this webpage need to be buffered, the melancholy webpage when front opening is wrong, does not therefore need this webpage when front opening to carry out buffer memory, in order to avoid take Installed System Memory, causes the waste of memory headroom.
Concrete, in step 202, when judgment result is that while meeting, can also comprise: judge whether the main document that described webpage is corresponding (main document) exists error message, and if there is no error message, enters 203; If there is error message, enter 206.
In the embodiment of the present invention, can judge by the correlation parameter in main document corresponding to this webpage and determine whether current web page exists the situation of not opening.
Wherein, described main document refers to the pagefile that webpage is corresponding.Generally, main document can be a html(Hyper Text Markup Language, HTML (Hypertext Markup Language)) file, can be also php(Hypertext Preprocessor, hypertext pretreater) file or shtml file etc.Concrete, when opening webpage, can pass through click right, select the mode of " checking webpage source code ", check the main document that this webpage is corresponding.
When there is the situation that webpage is not opened, in main document corresponding to this webpage, can comprise corresponding error message, therefore, can whether exist error message to determine whether to occur the phenomenon that webpage is not opened by judging in the main document that this webpage is corresponding, if there is error message, determine that current web page do not open, need not carry out buffer memory to this webpage, the flow process of method ends; If there is no error message, determines that current web page successfully opens, and continues execution step 2012.
Below to judging in step 202 whether described webpage needs to be buffered to describe in detail.In the embodiment of the present invention, described webpage is judged in two kinds of situation, a kind of situation is that this webpage is to belong to HTTPS(Hypertext Transfer Protocol over Secure Socket Layer, Secure Hypertext Transfer Protocol) link, another kind of situation is the link that this webpage does not belong to HTTPS.
Concrete, describedly judge whether described webpage meets default buffer memory condition and can comprise:
2021, judge whether the network address of described webpage belongs to the link of HTTPS, if belonged to, again judge that whether this HTTPS webpage meets default buffer memory condition, enters 2022 or 2023; If do not belonged to, enter 2024.
In the embodiment of the present invention, can judge whether this webpage belongs to HTTPS and link by inquiring about the main document corresponding to webpage of current loading.Concrete, inquire about the main document corresponding to webpage of current loading, obtain the URL that this webpage is corresponding, judge whether the URL of this webpage usings https as beginning, if so, this webpage belongs to HTTPS link; If not, this webpage does not belong to HTTPS link.
When definite this webpage belongs to HTTPS link, also need this webpage to proceed judgement, to determine whether this webpage can be buffered.In actual applications, concrete determination methods has a variety of, take two kinds of methods below as example describes, and is respectively 2022 and 2023.
2022, judge in the main document of described webpage whether have FORM(list) element of type, if there is no, enter 203; If existed, determine that this webpage can not buffer memory, enter step 206.
Concrete, when user opens certain webpage, in the time of need to signing in to website corresponding to this webpage, the login frame that sometimes there will be this website, need user to fill in user name (or account) and password or be similar to the information of this content, for example, website of bank, private mailbox etc.Conventionally, the webpage control (login frame etc.) of the above-mentioned type is all to adopt the unit of FORM type usually to realize substantially.
For guaranteeing the safety of user's accounts information, for the webpage of the above-mentioned type, do not carry out buffer memory.In case obtained active user's accounts information after buffer memory by the mode of returning by other users, cause active user's personal information to leak.
Owing to mentioning above, the webpage controls such as login frame are all to adopt the element of FORM type to realize substantially, therefore described in the embodiment of the present invention in method, can in the webpage of current loading, whether exist the unit of FORM type usually to determine in this webpage whether there is the controls such as login frame that comprise user account information by judging, thereby determine whether this webpage can be buffered.While there is the element of FORM type in described webpage, determine in this webpage and may there is the information such as login frame, for guaranteeing the security of user profile, this webpage is not carried out to buffer memory; While there is not the element of FORM type in described webpage, determine in this webpage and there is no the information such as login frame, carry out step 203, this webpage is carried out to buffer memory.
Also it should be noted that, can determine whether described webpage exists the element of FORM type by inquiring about the main document that this webpage is corresponding.While there is the element of FORM type in webpage, can from main document corresponding to this webpage, inquire the specifying information of the element of described FORM type.
When definite this webpage belongs to HTTPS link, can also determine whether this webpage needs to be buffered by searching the mode of default secure web-page list.Concrete, see shown in 2023.
2023, search default secure web-page list, judge in described secure web-page list whether comprise described webpage, if comprised, enter 203; If do not comprised, determine that this page can not buffer memory, enter 206.
It should be noted that, in the embodiment of the present invention, can preset secure web-page list and be stored on server.In this secure web-page list, listed the information of HTTPS webpage safety, that be suitable for being buffered, such as the URL of webpage etc.If the information of the webpage that comprises current loading in described secure web-page list, illustrates that this webpage is safe, is suitable for being buffered; Otherwise, this webpage of buffer memory not.
To not belonging to the basis for estimation of the webpage of HTTPS, be introduced below.
Whether the webpage that 2024, judges current loading there is unload(unloading) monitoring mechanism of event, if there is no, enter 2025 or directly enter 203; If existed, determine that this webpage can not buffer memory, enter 206.
It should be noted that, in some webpage, have the monitoring mechanism of unload event, for these webpages, when this webpage is left in navigation, the processing function of meeting Automatically invoked unload event, this function is likely carried out certain operations, causes some parameter of the current demonstration of this webpage to change.Make thus, when returning to this webpage or this webpage and reopened, on webpage, some parameter will change.Therefore, if buffer memory the content of the current demonstration of this webpage,, when returning to this webpage or reopening this webpage, the content of this web displaying will make a mistake, the parameter changing such as needs does not change etc.Based on above-mentioned consideration, to such, exist the webpage of the monitoring mechanism of unload event also to refuse buffer memory.
Concrete, can whether exist the audiomonitor of unload event to judge whether this webpage exists the monitoring mechanism of unload event by inquiring about in the main document that the webpage of current loading is corresponding.If there is the audiomonitor of unload event in main document, determine that this webpage exists the monitoring mechanism of unload event, this webpage is refused to buffer memory; If there is no, can this webpage of buffer memory.
Whether the webpage that 2025, judges current loading there is the behavior of opening local data base, if there is no, enters 2026 or directly enter 203; If existed, determine that this page can not buffer memory, enter 206.
It should be noted that, some webpage need to use local data base when opening.Concrete, when loading the type webpage, can load local data base simultaneously, the content of local data base is presented on the page of this webpage.In order to guarantee the data security of local data base, avoid occurring, because other users illegally get the content of local data base by returning to operation etc., for the type webpage, also refusing buffer memory.
Concrete, can whether exist the content of local data base to judge whether this webpage exists the local data base of opening by inquiring about in the main document that the webpage of current loading is corresponding.If there is the content of local data base in main document, determine that this webpage exists the local data base of opening, this webpage is refused to buffer memory; If there is no, can this webpage of buffer memory.
2026, judge in the main document that the page of current loading is corresponding whether have WML(Wireless Markup Language, WAP Markup Language) content or belong to WML form, if existed, enter 203; If there is no, determine that this page can not buffer memory, enter 206.
It should be noted that, WML is specially for hand-held mobile communications terminal (such as mobile phone etc.) designs a kind of markup language.Adopt WML can reduce internal memory and the computing time that terminal browser takies.
Described in the embodiment of the present invention in method, the webpage that comprises the webpage of WML content and/or belong to WML form is carried out to buffer memory, make thus, for the terminal of supporting WML webpage, also can pass through the form of the webpage of buffer memory WML form, realize the operating speed of increasing terminal, realize the object of energy saving.
To not belonging to the caching standard of the webpage of HTTPS link, introduce above, wherein provided three kinds of determination methods, in actual applications, can be, but not limited to above-mentioned three kinds of determination methods, again repeat no more.It should be noted that, above-mentioned three kinds of determination methods 2024,2025 and 2026 can be carried out separately also and can carry out successively, and when carrying out successively, the front and back of its execution order can arrange arbitrarily, does not need to limit.
Describing in detail above and how to judge whether webpage needs to be buffered, to how realizing the buffer memory of webpage, describing in detail below.
203, corresponding dom tree and the Render tree of described webpage is kept in internal memory.
After definite this webpage need to be buffered, dom tree and Render tree that this webpage is corresponding are kept in the internal memory of described terminal.Make thus, when needs return to or reopen this webpage, can directly from terminal internal memory, obtain dom tree and Render tree that this webpage is corresponding, and carry out layout.Avoided thus webpage to reload the new process of resolving layout of laying equal stress on, increasing terminal is carried out the speed of returning to operation greatly, shortens the execution time of terminal.
204, the generation index object corresponding with described webpage, described index object is for indicating the preservation address of dom tree that described webpage is corresponding and Render tree.
205, described index object is kept in index to process ends.
206, delete dom tree and the Render tree that described webpage is corresponding, process ends.
Described in the embodiment of the present invention, in method, when opening webpage, this webpage is carried out to buffer memory, dom tree and Render tree that this webpage generating is corresponding are kept in internal memory, and generate the index object of preserving address for indicating, and are kept in index.When returning to this webpage and maybe need to reopen this webpage, only need to from described index, find out the index object corresponding with described webpage, and the address extraction indicating according to described index object obtains dom tree that this webpage is corresponding and Render tree, just can be directly according to described dom tree and Render, set and carry out layout.
Make thus, adopt method described in the embodiment of the present invention, when returning to the webpage of opened mistake above or reopening this webpage, do not need to regenerate dom tree and the Render tree that this webpage is corresponding, only need to from internal memory, find according to index object.Therefore, making to return this webpage, maybe to need to reopen the operating speed of this webpage very fast, improved the execution speed of browser, shortened the running time, is conducive to the energy saving of terminal.
It should be noted that, method described in the embodiment of the present invention, can also comprise: receiving the again request of access of user to described webpage, according to described index object, reading dom tree and the Render tree that described webpage is corresponding, playing up demonstration.
Certainly, in actual applications, when receiving user to the request of access again of described webpage, can also first judge and in internal memory, whether preserve the dom tree corresponding with described webpage and Render tree, if preserved, according to described index object, read dom tree and the Render tree that described webpage is corresponding again, and play up demonstration; If no, in a conventional manner, regenerate the dom tree corresponding with described webpage and Render tree.
It should be noted that, because the memory headroom of terminal is limited, if all webpages of opening are all carried out to buffer memory, likely can cause occupied terminal internal memory too much, affect other operations of terminal.Therefore, in the embodiment of the present invention, can also limit the quantity of cache web pages or time, guarantee the occupancy of terminal internal memory, guarantee the normal operation of terminal.
Concrete, described method also comprises: whether the number that judges the index object of preserving in described index is greater than default higher limit, if so, according to holding time of described index object, delete dom tree and the Render tree of webpage corresponding to the index object that specifies number.
It should be noted that, in actual applications, described default higher limit can specifically be set according to actual conditions.Concrete, can according to the size of terminal memory headroom and service condition determine can cache web pages maximum number value, be default higher limit.
Certainly, in actual applications, described higher limit can be a fixed value, once just no longer change after setting.But because the service condition of terminal changes greatly, and described higher limit is generally all set according to the common service condition of terminal.If terminal by extraordinary use, causes terminal EMS memory occupation amount very high, and now still carries out webpage buffer memory according to the higher limit of this setting, likely cause the more terminal that makes of occupied terminal internal memory cannot keep normal work.
Therefore, in method, can also realize the actual service condition according to terminal described in the embodiment of the present invention, set dynamically described higher limit.Concrete, can comprise: obtain the use information of current memory headroom, according to the surplus of described memory headroom, revise described default higher limit, be and revise the higher limit of preserving the dom tree of webpage and the number of Render tree.
Be, the service condition of the current memory headroom of Real-time Obtaining terminal, according to the surplus of current memory headroom, revises default higher limit.If current terminal EMS memory occupation is more, the spatial margin of internal memory is less, can reduce described default higher limit, avoids too much causing terminal low memory because of cache web pages; If current terminal EMS memory occupation is less, the spatial margin of internal memory is larger, can increase described default higher limit, increases the number of cache web pages, meets user's the demand of browsing.Can realize thus, according to the situation that takies in real time of terminal internal memory, the dynamic adjustment to webpage buffer memory number.
When the number of the index object of preserving in described index reaches described preset upper limit value, to having realized the webpage of buffer memory in internal memory, clear up.The principle of its cleaning is generally to delete the longer webpage of cache-time.
Concrete, while described index object being kept in index in 204, can record the holding time of this index object simultaneously.The holding time of this index object is the dom tree of its corresponding webpage and the holding time of Render tree, is also the cache-time of this webpage.
Based on this, when in determining current internal memory, the webpage of buffer memory outnumbers default higher limit, just can be according to the holding time of each index object in described index, determine the index object that the holding time is the longest, and the preservation address of the dom tree of the page indicating according to this index object and Render tree, delete this dom tree and Render tree, realize the cleaning to internal memory.
First it should be noted that, in actual applications, if when the webpage of buffer memory outnumbers default higher limit in each internal memory, only delete webpage corresponding to the longest index object of holding time.Will cause browser to carry out frequently internal memory cleaning work.Therefore, method can also realize described in the embodiment of the present invention, when in internal memory, the webpage of buffer memory outnumbers default higher limit, to the index object of preserving in described index according to the holding time by early sorting to evening; Before coming, deletion specifies number dom tree and the Render tree of the webpage corresponding to index object of position.
Concrete, aforementionedly illustrated, when preserving index object, the holding time that can simultaneously record this index object., in described index, can from morning to night to each index object, sort according to the described holding time, when in internal memory, the webpage of buffer memory outnumbers default higher limit, webpage corresponding to index object that comes front n position deleted.Wherein, n is preset number, and n is greater than 1 integer.
For example, the index object in index is sorted according to the holding time, the index object of preserving the earliest can be made number one, and the index object of preserving the latest rolls into last place.Suppose that described default higher limit is 30, preset number is 15, when the index object of preserving in index reaches 30, deletes holding time front 15 webpages that index object is corresponding early, is the index object that comes first 15.
Certainly, in other embodiments of the invention, also can Preset Time length, when the webpage of buffer memory outnumbers default higher limit in internal memory, delete webpage corresponding to index object that the holding time surpasses described Preset Time length.
For example, suppose that described default higher limit is 30, Preset Time length is one day, when the index object of preserving in index reaches 30, deletes webpage corresponding to index object that the holding time surpasses a day.
Corresponding to the webpage caching method of the terminal browser described in aforementioned each embodiment of the present invention, the embodiment of the present invention also provides a kind of webpage buffer storage of terminal browser.With reference to Fig. 3, it is the webpage buffer storage structural drawing of the terminal browser described in the embodiment of the present invention.
As shown in Figure 3, described device can comprise: the first generation unit 100, the first storage unit 200, the second generation unit 300 and the second storage unit 400.
Described the first generation unit 100, for Web page loading, generates the dom tree corresponding with described webpage and Render tree.
Described the first storage unit 200, for being kept at internal memory by described dom tree and Render tree.
Described the second generation unit 300, for generating the index object corresponding with described webpage, described index object is for indicating the preservation address of dom tree that described webpage is corresponding and Render tree.
Described the second storage unit 400, for being kept at index by described index object.
Described in the embodiment of the present invention, install, when opening webpage, dom tree and Render tree that the webpage of generation is corresponding are kept in internal memory.When needs return to this webpage or reopen this webpage, only need to from index, find the index object corresponding with this webpage, the address indicating according to described index object, directly gets dom tree and Render tree that this webpage is corresponding, and this webpage is carried out to layout.
Thus can so that, when returning to or reopening the webpage of once opening, do not need to reload this webpage and this webpage is re-started and resolved and typesetting, the implementation that makes to return operation is very fast, reduce the required time of terminal executable operations, be conducive to the energy saving of terminal.
But, in actual applications, because the memory headroom of terminal is limited, be not therefore that all webpages of once opening are all needed to carry out buffer memory.Concrete, install described in the embodiment of the present invention, before preserving described dom tree and Render tree, can also judge the webpage when front opening, determine whether this webpage needs to be buffered.
Concrete, described device can also comprise: the first judging unit, and for determining that default buffer memory condition and main document corresponding to described webpage of described web pages conform do not exist error message.
Preferably, described the first judging unit can comprise: the first judgment sub-unit and the/the second judgment sub-unit.
, while belonging to the link of Secure Hypertext Transfer Protocol HTTPS for the network address when described webpage, in the document of described webpage, there is not the element of list FORM type in described the first judgment sub-unit.
And/or,
Described the second judgment sub-unit, while belonging to the link of HTTPS for the network address when described webpage, comprises described webpage in default secure web-page list.
Preferably, described the first judging unit can also comprise:
The 3rd judgment sub-unit, while not belonging to HTTPS link for the network address when described webpage, there is not the monitoring mechanism of unloading unload event in described webpage.
And/or,
The 4th judgment sub-unit, while not belonging to HTTPS link for the network address when described webpage, there is not the behavior of opening local data base in described webpage.
And/or,
The 5th judgment sub-unit, while not belonging to HTTPS link for the network address when described webpage, the main document that described webpage is corresponding belongs to WAP Markup Language WML form or comprises the content of WML.
It should be noted that, because the memory headroom of terminal is limited, if all webpages of opening are all carried out to buffer memory, likely can cause occupied terminal internal memory too much, affect other operations of terminal.Therefore, in the embodiment of the present invention, can also limit the quantity of cache web pages or time, guarantee the occupancy of terminal internal memory, guarantee the normal operation of terminal.
Concrete, described device can also comprise: delete cells, while being greater than default higher limit for the number of the index object of preserving when described index, the dom tree and the Render that according to the holding time of described index object, delete webpage corresponding to the index object that specifies number set.
Preferably, longer index object comprises the described holding time: the holding time surpasses a preset number index object of Preset Time length.
Preferably, described delete cells can comprise:
Sequence subelement, for index object that described index is preserved according to the holding time by early sorting to evening.
Delete subelement, for deleting dom tree and the Render tree that specifies number webpage corresponding to the index object of position before coming.
Described in the embodiment of the present invention, in device, can also realize the actual service condition according to terminal, set dynamically described higher limit.Concrete, described device can also comprise: amending unit, for obtaining the use information of current memory headroom, according to the surplus of described memory headroom, revise the higher limit of preserving the dom tree of webpage and the number of Render tree.
Preferably, install and can also comprise described in the embodiment of the present invention: reading unit, for receiving the again request of access of user to described webpage, according to described index object, read dom tree and the Render tree that described webpage is corresponding, play up demonstration.
Certainly, described device can also comprise:
The second judging unit, for judging whether internal memory preserves the dom tree corresponding with described webpage and Render tree.
Now, described reading unit, also for when judgment result is that of described the second judging unit is, then carries out and according to described index object, reads dom tree and the Render that described webpage is corresponding and set and play up the step of demonstration.
The embodiment of the present invention also provides a kind of terminal, and described terminal comprises the webpage buffer storage of the terminal browser as described in aforementioned each embodiment.
Fig. 4 is the structural representation of the related terminal device of the embodiment of the present invention, and this terminal device can be for the webpage caching method of the terminal browser implementing to provide in above-described embodiment.Specifically:
Terminal device 1500 can comprise RF(Radio Frequency, radio frequency) circuit 110, the storer 120 that includes one or more computer-readable recording mediums, input block 130, display unit 140, sensor 150, voicefrequency circuit 160, WiFi module 170, include the parts such as the above processor 180 of processing core of or and power supply 190.It will be understood by those skilled in the art that the terminal device structure shown in Fig. 4 does not form the restriction to terminal device, can comprise the parts more more or less than diagram, or combine some parts, or different parts are arranged.Wherein:
RF circuit 110 can be used for receiving and sending messages or communication process in, the reception of signal and transmission, especially, after the downlink information of base station is received, transfer to one or an above processor 180 to process; In addition, by relating to up data, send to base station.Conventionally, RF circuit 110 includes but not limited to antenna, at least one amplifier, tuner, one or more oscillator, subscriber identity module (SIM) card, transceiver, coupling mechanism, LNA(Low Noise Amplifier, low noise amplifier), diplexer etc.In addition, RF circuit 110 can also be by radio communication and network and other devices communicatings.This radio communication can be used arbitrary communication standard or agreement, include but not limited to GSM (Global System of Mobile communication, global system for mobile communications), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, Wideband Code Division Multiple Access (WCDMA)), LTE (Long Term Evolution, Long Term Evolution), Email, SMS (Short Messaging Service, Short Message Service) etc.
Storer 120 can be used for storing software program and module, and processor 180 is stored in software program and the module of storer 120 by operation, thereby carries out various function application and data processing.Storer 120 can mainly comprise storage program district and storage data field, wherein, and the application program (such as sound-playing function, image player function etc.) that storage program district can storage operation system, at least one function is required etc.; The data (such as voice data, phone directory etc.) that create according to the use of terminal device 1500 etc. can be stored in storage data field.In addition, storer 120 can comprise high-speed random access memory, can also comprise nonvolatile memory, for example at least one disk memory, flush memory device or other volatile solid-state parts.Correspondingly, storer 120 can also comprise Memory Controller, so that the access of processor 180 and 130 pairs of storeies 120 of input block to be provided.
Input block 130 can be used for receiving numeral or the character information of input, and generation arranges with user and function is controlled relevant keyboard, mouse, control lever, optics or the input of trace ball signal.Particularly, input block 130 can comprise touch-sensitive surperficial 131 and other input equipments 132.Touch-sensitive surperficial 131, also referred to as touch display screen or Trackpad, can collect user or near touch operation (using any applicable object or near the operations of annex on touch-sensitive surperficial 131 or touch-sensitive surperficial 131 such as finger, stylus such as user) thereon, and drive corresponding coupling arrangement according to predefined formula.Optionally, touch-sensitive surperficial 131 can comprise touch detecting apparatus and two parts of touch controller.Wherein, touch detecting apparatus detects user's touch orientation, and detects the signal that touch operation is brought, and sends signal to touch controller; Touch controller receives touch information from touch detecting apparatus, and converts it to contact coordinate, then gives processor 180, and the order that energy receiving processor 180 is sent is also carried out.In addition, can adopt the polytypes such as resistance-type, condenser type, infrared ray and surface acoustic wave to realize touch-sensitive surperficial 131.Except touch-sensitive surperficial 131, input block 130 can also comprise other input equipments 132.Particularly, other input equipments 132 can include but not limited to one or more in physical keyboard, function key (controlling button, switch key etc. such as volume), trace ball, mouse, control lever etc.
Display unit 140 can be used for showing the information inputted by user or the various graphical user interface of the information that offers user and terminal device 1500, and these graphical user interface can consist of figure, text, icon, video and its combination in any.Display unit 140 can comprise display panel 141, optionally, can adopt the forms such as LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) to configure display panel 141.Further, touch-sensitive surperficial 131 can cover display panel 141, when touch-sensitive surperficial 131 detect thereon or near touch operation after, send processor 180 to determine the type of touch event, corresponding vision output is provided according to the type of touch event with preprocessor 180 on display panel 141.Although in Fig. 4, touch-sensitive surperficial 131 with display panel 141 be as two independently parts realize input and input function, in certain embodiments, can by touch-sensitive surperficial 131 and display panel 141 integrated and realize input and output function.
Terminal device 1500 also can comprise at least one sensor 150, such as optical sensor, motion sensor and other sensors.Particularly, optical sensor can comprise ambient light sensor and proximity transducer, and wherein, ambient light sensor can regulate according to the light and shade of ambient light the brightness of display panel 141, proximity transducer can, when terminal device 1500 moves in one's ear, cut out display panel 141 and/or backlight.A kind of as motion sensor; Gravity accelerometer can detect the size of the acceleration that (is generally three axles) in all directions; when static, can detect size and the direction of gravity, can be used for identifying application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as passometer, knock) of mobile phone attitude etc.; As for terminal device 1500 other sensors such as configurable gyroscope, barometer, hygrometer, thermometer, infrared ray sensor also, do not repeat them here.
Voicefrequency circuit 160, loudspeaker 161, microphone 162 can provide the audio interface between user and terminal device 1500.Voicefrequency circuit 160 can be transferred to loudspeaker 161 by the electric signal after the voice data conversion receiving, and is converted to voice signal exports by loudspeaker 161; On the other hand, microphone 162 is converted to electric signal by the voice signal of collection, after being received by voicefrequency circuit 160, be converted to voice data, after again voice data output processor 180 being processed, through RF circuit 110, to send to such as another terminal device, or export voice data to storer 120 to further process.Voicefrequency circuit 160 also may comprise earphone jack, so that communicating by letter of peripheral hardware earphone and terminal device 1500 to be provided.
WiFi belongs to short range wireless transmission technology, terminal device 1500 by WiFi module 170 can help that user sends and receive e-mail, browsing page and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 4 shows WiFi module 170, be understandable that, it does not belong to must forming of terminal device 1500, completely can be as required in not changing the essential scope of invention and omit.
Processor 180 is control centers of terminal device 1500, utilize the various piece of various interface and the whole mobile phone of connection, by moving or carry out software program and/or the module being stored in storer 120, and call the data that are stored in storer 120, carry out various functions and the deal with data of terminal device 1500, thereby mobile phone is carried out to integral monitoring.Optionally, processor 180 can comprise one or more processing cores; Preferably, processor 180 can integrated application processor and modem processor, and wherein, application processor is mainly processed operating system, user interface and application program etc., and modem processor is mainly processed radio communication.Be understandable that, above-mentioned modem processor also can not be integrated in processor 180.
Terminal device 1500 also comprises that the power supply 190(powering to all parts is such as battery), preferably, power supply can be connected with processor 180 logics by power-supply management system, thereby realizes the functions such as management charging, electric discharge and power managed by power-supply management system.Power supply 190 can also comprise the random component such as one or more direct current or AC power, recharging system, power failure detection circuit, power supply changeover device or inverter, power supply status indicator.
Although not shown, terminal device 1500 can also comprise camera, bluetooth module etc., does not repeat them here.Specifically in the present embodiment, the display unit of terminal device is touch-screen display, terminal device also includes storer, and one or more than one program, one of them or an above program are stored in storer, and be configured to be carried out by more than one or one processor, more than this or one routine package contains for carrying out the instruction of following operation:
Web page loading, generates the dom tree corresponding with described webpage and Render tree, and described dom tree and Render tree are kept in internal memory;
Generate the index object corresponding with described webpage, described index object is for indicating the preservation address of dom tree that described webpage is corresponding and Render tree;
Described index object is kept in index.
Preferably, described described dom tree and Render tree is kept to internal memory in before, described method also comprises: determine that buffer memory condition and main document corresponding to described webpage that described web pages conform is default do not exist error message.
Preferably, described default buffer memory condition, comprising:
When the network address of described webpage belongs to the link of Secure Hypertext Transfer Protocol HTTPS, in the main document of described webpage, there is not the element of list FORM type;
And/or,
When the network address of described webpage belongs to the link of HTTPS, in default secure web-page list, comprise described webpage.
Preferably, described default buffer memory condition, comprising:
When the network address of described webpage does not belong to HTTPS link, there is not the monitoring mechanism of unloading unload event in described webpage;
And/or,
When the network address of described webpage does not belong to HTTPS link, there is not the behavior of opening local data base in described webpage;
And/or,
When the network address of described webpage does not belong to HTTPS link, the main document that described webpage is corresponding belongs to WAP Markup Language WML form or comprises the content of WML.
Preferably, described method also comprises:
When the number of the index object of preserving is greater than default higher limit, according to holding time of described index object, delete dom tree and the Render tree of webpage corresponding to the index object that specifies number in described index.
Preferably, described holding time according to described index object is deleted dom tree and the Render tree of webpage corresponding to the index object that specifies number, comprising:
To the index object of preserving in described index according to the holding time by early sorting to evening;
Before coming, deletion specifies number dom tree and the Render tree of the webpage corresponding to index object of position.
Preferably, described method also comprises:
Obtain the use information of current memory headroom, according to the surplus of described memory headroom, revise the higher limit of preserving the dom tree of webpage and the number of Render tree.
Preferably, described method also comprises:
Receive the again request of access of user to described webpage, according to described index object, read dom tree and the Render tree that described webpage is corresponding, play up demonstration.
Preferably, after described reception user is to the request of access again of described webpage, described method also comprises:
Judge and in internal memory, whether preserve the dom tree corresponding with described webpage and Render tree, if preserved, then carry out and according to described index object, read dom tree and the Render that described webpage is corresponding and set and play up the step of demonstration.
The embodiment of the present invention is when opening webpage, and dom tree and Render tree that the webpage of generation is corresponding are kept in internal memory.When needs return to this webpage or reopen this webpage, only need to from index, find the index object corresponding with this webpage, the address indicating according to described index object, directly gets dom tree and Render tree that this webpage is corresponding, and this webpage is carried out to layout.
Thus can so that, when returning to or reopening the webpage of once opening, do not need to reload this webpage and this webpage is re-started and resolved and typesetting, the implementation that makes to return operation is very fast, reduce the required time of terminal executable operations, be conducive to the energy saving of terminal.
Referring to Fig. 5, Fig. 5 is a kind of server architecture schematic diagram that the embodiment of the present invention provides.This server 1600 can because of configuration or performance is different produces larger difference, can comprise one or more central processing units (central processing units, CPU) 1622(for example, one or more processors) and storer 1632, the storage medium 1630(of one or more storage application programs 1642 or data 1644 one or more mass memory units for example).Wherein, storer 1632 and storage medium 1630 can be of short duration storage or storage lastingly.The program that is stored in storage medium 1630 can comprise one or more modules (illustrating not shown), and each module can comprise a series of command operatings in server.Further, central processing unit 1622 can be set to communicate by letter with storage medium 1630, carries out a series of command operatings in storage medium 1630 on server 1600.Server 1600 can also comprise one or more power supplys 1626, one or more wired or wireless network interfaces 1650, one or more IO interface 1658, one or more keyboards 1656, and/or, one or more operating systems 1641, Windows ServerTM for example, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM etc.Above-mentioned Fig. 1 and embodiment illustrated in fig. 2 described in can be based on shown in this Fig. 5 by the performed step of server server architecture.
The embodiment of the present invention also provides a kind of terminal device, terminal device shown in the structure of this terminal device and above-mentioned Fig. 4 in like manner, the shared method of network that this terminal device provides for carrying out above-described embodiment, wherein, more than this or one routine package contains for carrying out the instruction of following operation:
Web page loading, generates the dom tree corresponding with described webpage and Render tree, and described dom tree and Render tree are kept in internal memory;
Generate the index object corresponding with described webpage, described index object is for indicating the preservation address of dom tree that described webpage is corresponding and Render tree;
Described index object is kept in index.
Preferably, described described dom tree and Render tree is kept to internal memory in before, described method also comprises: determine that buffer memory condition and main document corresponding to described webpage that described web pages conform is default do not exist error message.
Preferably, described default buffer memory condition, comprising:
When the network address of described webpage belongs to the link of Secure Hypertext Transfer Protocol HTTPS, in the main document of described webpage, there is not the element of list FORM type;
And/or,
When the network address of described webpage belongs to the link of HTTPS, in default secure web-page list, comprise described webpage.
Preferably, described default buffer memory condition, comprising:
When the network address of described webpage does not belong to HTTPS link, there is not the monitoring mechanism of unloading unload event in described webpage;
And/or,
When the network address of described webpage does not belong to HTTPS link, there is not the behavior of opening local data base in described webpage;
And/or,
When the network address of described webpage does not belong to HTTPS link, the main document that described webpage is corresponding belongs to WAP Markup Language WML form or comprises the content of WML.
Preferably, described method also comprises:
When the number of the index object of preserving is greater than default higher limit, according to holding time of described index object, delete dom tree and the Render tree of webpage corresponding to the index object that specifies number in described index.
Preferably, described holding time according to described index object is deleted dom tree and the Render tree of webpage corresponding to the index object that specifies number, comprising:
To the index object of preserving in described index according to the holding time by early sorting to evening;
Before coming, deletion specifies number dom tree and the Render tree of the webpage corresponding to index object of position.
Preferably, described method also comprises:
Obtain the use information of current memory headroom, according to the surplus of described memory headroom, revise the higher limit of preserving the dom tree of webpage and the number of Render tree.
Preferably, described method also comprises:
Receive the again request of access of user to described webpage, according to described index object, read dom tree and the Render tree that described webpage is corresponding, play up demonstration.
Preferably, after described reception user is to the request of access again of described webpage, described method also comprises:
Judge and in internal memory, whether preserve the dom tree corresponding with described webpage and Render tree, if preserved, then carry out and according to described index object, read dom tree and the Render that described webpage is corresponding and set and play up the step of demonstration.
The embodiment of the present invention is when opening webpage, and dom tree and Render tree that the webpage of generation is corresponding are kept in internal memory.When needs return to this webpage or reopen this webpage, only need to from index, find the index object corresponding with this webpage, the address indicating according to described index object, directly gets dom tree and Render tree that this webpage is corresponding, and this webpage is carried out to layout.
Thus can so that, when returning to or reopening the webpage of once opening, do not need to reload this webpage and this webpage is re-started and resolved and typesetting, the implementation that makes to return operation is very fast, reduce the required time of terminal executable operations, be conducive to the energy saving of terminal.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can come the hardware that instruction is relevant to complete by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (20)

1. a webpage caching method for terminal browser, is characterized in that, described method comprises:
Web page loading, generates the dom tree corresponding with described webpage and Render tree, and described dom tree and Render tree are kept in internal memory;
Generate the index object corresponding with described webpage, described index object is for indicating the preservation address of dom tree that described webpage is corresponding and Render tree;
Described index object is kept in index.
2. method according to claim 1, is characterized in that, described described dom tree and Render tree is kept to internal memory in before, described method also comprises:
Determine that buffer memory condition and main document corresponding to described webpage that described web pages conform is default do not exist error message.
3. method according to claim 2, is characterized in that, described default buffer memory condition, comprising:
When the network address of described webpage belongs to the link of Secure Hypertext Transfer Protocol HTTPS, in the main document of described webpage, there is not the element of list FORM type;
And/or,
When the network address of described webpage belongs to the link of HTTPS, in default secure web-page list, comprise described webpage.
4. method according to claim 2, is characterized in that, described default buffer memory condition, comprising:
When the network address of described webpage does not belong to HTTPS link, there is not the monitoring mechanism of unloading unload event in described webpage;
And/or,
When the network address of described webpage does not belong to HTTPS link, there is not the behavior of opening local data base in described webpage;
And/or,
When the network address of described webpage does not belong to HTTPS link, the main document that described webpage is corresponding belongs to WAP Markup Language WML form or comprises the content of WML.
5. according to the method described in claim 1 to 4 any one, it is characterized in that, described method also comprises:
When the number of the index object of preserving is greater than default higher limit, according to holding time of described index object, delete dom tree and the Render tree of webpage corresponding to the index object that specifies number in described index.
6. method according to claim 5, is characterized in that, described holding time according to described index object is deleted dom tree and the Render tree of webpage corresponding to the index object that specifies number, comprising:
To the index object of preserving in described index according to the holding time by early sorting to evening;
Before coming, deletion specifies number dom tree and the Render tree of the webpage corresponding to index object of position.
7. method according to claim 5, is characterized in that, described method also comprises:
Obtain the use information of current memory headroom, according to the surplus of described memory headroom, revise the higher limit of preserving the dom tree of webpage and the number of Render tree.
8. method according to claim 1, is characterized in that, described method also comprises:
Receive the again request of access of user to described webpage, according to described index object, read dom tree and the Render tree that described webpage is corresponding, play up demonstration.
9. method according to claim 8, is characterized in that, after described reception user is to the request of access again of described webpage, described method also comprises:
Judge and in internal memory, whether preserve the dom tree corresponding with described webpage and Render tree, if preserved, then carry out and according to described index object, read dom tree and the Render that described webpage is corresponding and set and play up the step of demonstration.
10. a webpage buffer storage for terminal browser, is characterized in that, described device comprises:
The first generation unit, for Web page loading, generates the dom tree corresponding with described webpage and Render tree;
The first storage unit, for being kept at internal memory by described dom tree and Render tree;
The second generation unit, for generating the index object corresponding with described webpage, described index object is for indicating the preservation address of dom tree that described webpage is corresponding and Render tree;
The second storage unit, for being kept at index by described index object.
The webpage buffer storage of 11. terminal browsers according to claim 10, described device also comprises:
The first judging unit, for determining that default buffer memory condition and main document corresponding to described webpage of described web pages conform do not exist error message.
The webpage buffer storage of 12. terminal browsers according to claim 11, is characterized in that, described the first judging unit comprises:
, while belonging to the link of Secure Hypertext Transfer Protocol HTTPS for the network address when described webpage, in the document of described webpage, there is not the element of list FORM type in the first judgment sub-unit;
And/or,
The second judgment sub-unit, while belonging to the link of HTTPS for the network address when described webpage, comprises described webpage in default secure web-page list.
The webpage buffer storage of 13. terminal browsers according to claim 12, is characterized in that, described the first judging unit also comprises:
The 3rd judgment sub-unit, while not belonging to HTTPS link for the network address when described webpage, there is not the monitoring mechanism of unloading unload event in described webpage;
And/or,
The 4th judgment sub-unit, while not belonging to HTTPS link for the network address when described webpage, there is not the behavior of opening local data base in described webpage;
And/or,
The 5th judgment sub-unit, while not belonging to HTTPS link for the network address when described webpage, the main document that described webpage is corresponding belongs to WAP Markup Language WML form or comprises the content of WML.
The 14. webpage buffer storages according to claim 10 to the terminal browser described in 13 any one, is characterized in that, described device also comprises:
Delete cells, while being greater than default higher limit for the number of the index object of preserving when described index, deletes dom tree and the Render tree of webpage corresponding to the index object that specifies number according to the holding time of described index object.
The webpage buffer storage of 15. terminal browsers according to claim 14, is characterized in that, described delete cells comprises:
Sequence subelement, for index object that described index is preserved according to the holding time by early sorting to evening;
Delete subelement, for deleting dom tree and the Render tree that specifies number webpage corresponding to the index object of position before coming.
The webpage buffer storage of 16. terminal browsers according to claim 14, is characterized in that, described device also comprises:
Amending unit, for obtaining the use information of current memory headroom, according to the surplus of described memory headroom, revises the higher limit of preserving the dom tree of webpage and the number of Render tree.
The webpage buffer storage of 17. terminal browsers according to claim 10, is characterized in that, described device also comprises:
Reading unit, for receiving the again request of access of user to described webpage, reads according to described index object dom tree and the Render tree that described webpage is corresponding, plays up demonstration.
The webpage buffer storage of 18. terminal browsers according to claim 17, is characterized in that, described device also comprises:
The second judging unit, for judging whether internal memory preserves the dom tree corresponding with described webpage and Render tree;
Described reading unit, also for when judgment result is that of described the second judging unit is, then carries out and according to described index object, reads dom tree and the Render that described webpage is corresponding and set and play up the step of demonstration.
19. 1 kinds of terminals, is characterized in that, described terminal comprises the webpage buffer storage of the terminal browser as described in claim 10 to 18 any one.
20. 1 kinds of mobile terminals, it is characterized in that, include storer, and one or more than one program, the above program of one of them or one is stored in storer, and is configured to carry out described one or above routine package containing for carrying out the instruction of following operation by one or above processor:
Web page loading, generates the dom tree corresponding with described webpage and Render tree, and described dom tree and Render tree are kept in internal memory;
Generate the index object corresponding with described webpage, described index object is for indicating the preservation address of dom tree that described webpage is corresponding and Render tree;
Described index object is kept in index.
CN201310676543.0A 2013-12-11 2013-12-11 Method and device for webpage caching of terminal browser and terminal Pending CN103699595A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310676543.0A CN103699595A (en) 2013-12-11 2013-12-11 Method and device for webpage caching of terminal browser and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310676543.0A CN103699595A (en) 2013-12-11 2013-12-11 Method and device for webpage caching of terminal browser and terminal

Publications (1)

Publication Number Publication Date
CN103699595A true CN103699595A (en) 2014-04-02

Family

ID=50361123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310676543.0A Pending CN103699595A (en) 2013-12-11 2013-12-11 Method and device for webpage caching of terminal browser and terminal

Country Status (1)

Country Link
CN (1) CN103699595A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050253A (en) * 2014-06-12 2014-09-17 北京金山网络科技有限公司 Webpage display method and browser
CN105354088A (en) * 2015-09-29 2016-02-24 广州酷狗计算机科技有限公司 Message deleting method and apparatus
CN105653198A (en) * 2014-11-13 2016-06-08 杭州迪普科技有限公司 Data processing method and device
CN105893446A (en) * 2015-02-18 2016-08-24 奥多比公司 Method for intelligent web reference preloading based on user behavior prediction
CN107040396A (en) * 2016-02-03 2017-08-11 博雅网络游戏开发(深圳)有限公司 configuration information obtaining method and device
WO2018082119A1 (en) * 2016-11-02 2018-05-11 网宿科技股份有限公司 Method and apparatus for recovering page in browser
CN108153588A (en) * 2016-12-06 2018-06-12 阿里巴巴集团控股有限公司 A kind of page navigation method and device, a kind of memory allocation method and device
WO2018129774A1 (en) * 2017-01-16 2018-07-19 网宿科技股份有限公司 Method and device for page processing
CN108810070A (en) * 2018-03-28 2018-11-13 广州视源电子科技股份有限公司 A kind of resource share method, device, smart machine and storage medium
CN108829828A (en) * 2018-06-15 2018-11-16 乐蜜有限公司 A kind of Webpage display process, device, electronic equipment and readable storage medium storing program for executing
CN108965471A (en) * 2018-08-22 2018-12-07 四川长虹电器股份有限公司 Browser memory ameliorative way on a kind of smart television
CN109375918A (en) * 2018-11-23 2019-02-22 天津字节跳动科技有限公司 Interface rendering method, device, electronic equipment and the storage medium of small routine

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120110437A1 (en) * 2010-10-28 2012-05-03 Microsoft Corporation Style and layout caching of web content
CN102841901A (en) * 2011-06-23 2012-12-26 腾讯科技(深圳)有限公司 Web page display method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120110437A1 (en) * 2010-10-28 2012-05-03 Microsoft Corporation Style and layout caching of web content
CN102841901A (en) * 2011-06-23 2012-12-26 腾讯科技(深圳)有限公司 Web page display method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FLYFWATER: "转 WebKit的页面缓存机制I – 基础(WebKit Page Cache I – The Basics)", 《HTTP://BLOG.CSDN.NET/FLYFWATER/ARTICLE/DETAILS/6552358》 *
冷冰: "基于Render树缓存的移动终端网页加速技术的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050253B (en) * 2014-06-12 2018-09-25 北京猎豹网络科技有限公司 A kind of web page display method and browser
CN104050253A (en) * 2014-06-12 2014-09-17 北京金山网络科技有限公司 Webpage display method and browser
CN105653198A (en) * 2014-11-13 2016-06-08 杭州迪普科技有限公司 Data processing method and device
CN105893446A (en) * 2015-02-18 2016-08-24 奥多比公司 Method for intelligent web reference preloading based on user behavior prediction
CN105893446B (en) * 2015-02-18 2020-12-01 奥多比公司 Method for intelligent web reference preloading based on user behavior prediction
CN105354088A (en) * 2015-09-29 2016-02-24 广州酷狗计算机科技有限公司 Message deleting method and apparatus
CN105354088B (en) * 2015-09-29 2018-11-27 广州酷狗计算机科技有限公司 Message delet method and device
CN107040396A (en) * 2016-02-03 2017-08-11 博雅网络游戏开发(深圳)有限公司 configuration information obtaining method and device
US10621260B2 (en) 2016-11-02 2020-04-14 Wangsu Science & Technology Co., Ltd. Method and device for restoring pages of browser
WO2018082119A1 (en) * 2016-11-02 2018-05-11 网宿科技股份有限公司 Method and apparatus for recovering page in browser
CN108153588A (en) * 2016-12-06 2018-06-12 阿里巴巴集团控股有限公司 A kind of page navigation method and device, a kind of memory allocation method and device
WO2018129774A1 (en) * 2017-01-16 2018-07-19 网宿科技股份有限公司 Method and device for page processing
US10783211B2 (en) 2017-01-16 2020-09-22 Wangsu Science & Technology Co., Ltd. Page processing method and device thereof
CN108810070A (en) * 2018-03-28 2018-11-13 广州视源电子科技股份有限公司 A kind of resource share method, device, smart machine and storage medium
CN108810070B (en) * 2018-03-28 2021-06-15 广州视源电子科技股份有限公司 Resource sharing method and device, intelligent equipment and storage medium
CN108829828A (en) * 2018-06-15 2018-11-16 乐蜜有限公司 A kind of Webpage display process, device, electronic equipment and readable storage medium storing program for executing
CN108829828B (en) * 2018-06-15 2022-01-21 卓米私人有限公司 Webpage display method and device, electronic equipment and readable storage medium
CN108965471A (en) * 2018-08-22 2018-12-07 四川长虹电器股份有限公司 Browser memory ameliorative way on a kind of smart television
CN109375918A (en) * 2018-11-23 2019-02-22 天津字节跳动科技有限公司 Interface rendering method, device, electronic equipment and the storage medium of small routine

Similar Documents

Publication Publication Date Title
KR102245025B1 (en) Memory return method and device
CN103699595A (en) Method and device for webpage caching of terminal browser and terminal
CN104850434A (en) Method and apparatus for downloading multimedia resources
CN104978115A (en) Content display method and device
CN104123120B (en) A kind of browser page data filtering method, device and system
CN103279574A (en) Method, device and terminal device for loading explorer pictures
CN103310004A (en) Method, device and equipment for displaying number of unread messages
CN104978176A (en) Application program interface calling method and device
CN103455603A (en) Method and device for caching webpage content and loading webpage and terminal device
CN104301315A (en) Method and device for limiting information access
CN104104711A (en) Reading history processing method and device
CN105022616A (en) Method and device for generating web page
CN103513987A (en) Rendering treatment method, device and terminal device for browser web page
CN104301504A (en) Message viewing method and device and mobile terminal
CN103616983A (en) Picture presentation method, picture presentation device and terminal device
CN103177217B (en) A kind of file scanning method, system and client and server
CN104065693A (en) Method, device and system for accessing network data in webpage applications
CN104954159A (en) Network information statistics method and device
CN104077211A (en) Test method and test system for mobile terminal software
CN104182429A (en) Web page processing method and terminal
CN104123276A (en) Method, device and system for intercepting popup windows in browser
CN105630846A (en) Head portrait updating method and apparatus
CN106528335A (en) Data backup method and device and terminal
CN103607431B (en) Mobile terminal resource processing method, device and equipment
CN104516624A (en) Method and device for inputting account information

Legal Events

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

Application publication date: 20140402

RJ01 Rejection of invention patent application after publication