Embodiment
Exemplary embodiment of the present disclosure is described below with reference to accompanying drawings in more detail.Although shown exemplary embodiment of the present disclosure in the accompanying drawing, yet should be appreciated that and to realize the disclosure and the embodiment that should do not set forth limits here with various forms.On the contrary, it is in order to understand the disclosure more thoroughly that these embodiment are provided, and can with the scope of the present disclosure complete convey to those skilled in the art.
Fig. 2 shows the according to an embodiment of the invention process flow diagram of page loading method.As shown in Figure 2, this page loading method may further comprise the steps:
Step 101, according to accessing page request, to the basic document of the server request complete page.
Take website navigation page as example, when website navigation page was opened in user's request, the browser of client received the website navigation page request of access.According to this website navigation page request of access, the basic document of the user end to server request complete page.
Alternatively, the basic document of the complete page can be the minimum files of the complete page, and it has comprised information the most basic in the page, for example static information, this static information refers to part more stable in the page, such as website links, plate title etc. not often the change information.The basic document of website navigation page refer to consist of the fundamental element of navigation homepage, comprise the information such as structure, link, picture of the page.
Step 102, read the additional data of having stored.
Additional data comprises the out of Memory except the information that basic document comprise in the page, multidate information for example, this multidate information be often change in the page, need to the part of server dynamic interaction, such as information such as weather, joke, the hot words of search, these informational needs often upgrade, and often namely need and server interaction.
Additional data obtains and renewal to server request by local memory device, and local memory device is positioned at the computer system of client.When the user did not ask not open website navigation page, local memory device obtained latest data to server request with just mourning in silence, and stores these up-to-date data.Alternatively, the local memory mechanism that additional data adopts browser to provide is stored in the local memory device, and according to the difference of browser type, the local memory mechanism that adopts also can be different.
Take the IE browser as example, additional data can be stored in user data (Userdata) district of local memory device.The Userdata district is that Microsoft is the storage space that IE opens up in system specially, and it is restricted to 128KB to the size of Single document, altogether can preserve the file of 1024KB under a domain name, and the file number without limits.In restricted site, the size of Single document is restricted to 64KB, altogether can preserve the file of 640KB under a domain name.
Take another kind of browser as example, additional data can adopt the mechanism of Local storage to store.In simple terms, Local storage is exactly a kind of web page that allows can be with the method for storage data in the web-browsing device of the form client of key-value pair, key: be exactly the numbering of the value of storing, and value: the data that will deposit exactly itself.This data are being left the web website, are closing Shipping Options Page, are still being preserved when withdrawing from browser etc.But this data can not be sent to remote web server (except non-manual transmission).In addition, this mechanism is that the web-browsing device is primary to be provided, and does not need the support of third party's plug-in unit.
Step 103, according to basic document and additional data, obtain the complete page and show.
The additional data that will comprise multidate information is loaded on the basic document, obtains the complete page.This paper is called pseudo-static page with this complete page.
For example: pseudo-static page can be understood as, and by the data of read local storage, it is complete that the page is loaded, and makes to look similarly to be a static page.Can with dynamic web page to recently understanding, dynamic web page is exactly user when opening, can be from the server request data, but this process can have certain time-delay according to network condition, the user need to wait for a period of time and just can see data.Such as the weather forecast of hao123, in the slow situation of network speed, can show, loading weather.So, pseudo-static page, what be exactly that user's First view sees is the complete page, we are at the service end more new data of mourning in silence.
Alternatively, obtaining the complete page can realize by the page rendering method, particularly, by obtaining basic document from server, obtains additional data in local memory device, then plays up basic document and additional data in browser.This method can be played up first basic document, plays up additional data again; Also can play up simultaneously basic document and additional data.
The page loading method that offers according to present embodiment, after receiving user's accessing page request, only need the basic document to the server request complete page, obtain the complete page according to these basic document and the additional data stored, all be after receiving user's accessing page request, to compare to server request in the lump with page datas all in the prior art, reduced the quantity of information of asking, improve the webpage loading velocity, avoided the position of some data block in the page to present the problem of the blank or corresponding prompting of different time.This method mainly is to utilize local storage to construct pseudo-static page, improves web displaying speed, shortens the webpage blank time.
Fig. 3 shows the in accordance with another embodiment of the present invention process flow diagram of page loading method.As shown in Figure 3, this page loading method may further comprise the steps:
Step 201, obtain and upgrade additional data to server request by local memory device.
Fig. 4 a and Fig. 4 b show the synoptic diagram of the part of website navigation page in the embodiment of the invention.Shown in Fig. 4 a is the up-to-date information of popular film and television play, and shown in Fig. 4 b is the latest data of weather forecast, and these information all are the multidate informations that can often change.The related data of this multidate information is additional data, and the local memory device of the computer system of present embodiment by client is termly to server request, rather than by the time just goes for during this page of user's request access and ask.
For the type of different additional datas, ageing requirement meeting is different.Therefore, can according to the type of additional data, adopt the default time interval to upgrade additional data by local memory device to server request.
Data of weather forecast shown in Fig. 4 b, its ageing requirement meeting is very high, has the renewal more than 3 times general every day, these class data default update time the interval can be shorter.The data of the popular film and television play shown in Fig. 4 a, its ageing requirement meeting is lower, these class data default update time the interval can be longer.
As a kind of embodiment, upgrade additional data and can call following renewal (update) method:
Step 202, additional data is stored in the local memory device.
For dissimilar browsers, the local memory mechanism that additional data adopts also can be different.
Take the IE browser as example, additional data can be stored in user data (Userdata) district of local memory device.When storage, can call following method:
Take another kind of browser as example, additional data can adopt the mechanism of Local storage to store.When storage, can call following method:
set:function(ns,key,value){
try{localStorage.setItem(ns+key,value);}catch(e){throw?e;}
},//throw
Step 203, according to accessing page request, to the basic document of the server request complete page.
When website navigation page was opened in user's request, the browser of client received the website navigation page request of access.According to this website navigation page request of access, the basic document of the user end to server request complete page.Preferably, the basic document of this complete page can be the minimum files of the complete page, and it has comprised information the most basic in the page, for example static information.
Step 204, read the additional data of having stored.
The process that reads additional data comprises to local memory device request additional data and local memory device passback additional data.
Wherein can call following method to local memory device request additional data:
Local memory device passback additional data can call following method:
Step 205, according to basic document and additional data, obtain the complete page and show.
The additional data that will comprise multidate information is loaded on the basic document, obtains the complete page.This complete page is pseudo-static page.
Before above-mentioned steps 204, can also comprise: judge whether local memory device has stored additional data, if having, then execution in step 204; If no, then need to the relevant data of server request.
In addition, can set the data expired time of each data block in the program, such as joke, the out-of-service time is 3 hours.After 3 hours, the additional data about joke in the local memory device can lose efficacy.When the additional data of local memory device lost efficacy, present embodiment also comprised: the additional data in the deletion local memory device.The deletion additional data can call following deletion (remove) method:
The page loading method that offers according to present embodiment, after receiving user's accessing page request, only need the basic document to the server request complete page, obtain the complete page according to these basic document and the additional data stored, wherein additional data is that local memory device obtains to server request termly.All be after receiving user's accessing page request, to compare to server request in the lump with page datas all in the prior art, reduced the quantity of information of asking, because the data in the page, such as joke with to search for hot word, content recommendation, weather etc. be not real-time update, so do not need at every turn all to these data of server request.Like this, less from the data volume of server request, the page loads faster, has therefore improved the webpage loading velocity.Simultaneously, because being far smaller than from server, obtains the time of reading additional data from local memory device, and the data of each data block can read in the lump in the page, show simultaneously, avoided the data transmission speed that causes because of different network speeds different, the asynchronism(-nization) that the data of each data block that causes show, thus the position of some data block presents the blank of different time or the problem of corresponding prompting in the page that produces, and has improved user's experience.
Fig. 5 shows the according to an embodiment of the invention structural representation of page charger.As shown in Figure 5, this device comprises: request module 50, read module 51 and display module 52.Wherein, request module 50 is used for according to accessing page request, to the basic document of the server request complete page; Read module 51 is used for reading the additional data of having stored; Display module 52 is used for according to basic document and additional data, obtains the complete page and demonstration.
Further, this device can also comprise: local memory device 53, be used for obtaining and upgrading additional data to server request, this additional data comprises multidate information, multidate information be often change in the page, need to the information of server dynamic interaction.
Above-mentioned local memory device 53 can specifically be used for the type according to additional data, adopts the default time interval to upgrade additional data to server request.
Further, local memory device 53 also is used for the local memory mechanism storing additional data that the employing browser provides.Alternatively, local memory device 53 comprises the user data area for storing additional data.Perhaps, the local memory device 53 concrete form storing additional data that are used for key-value pair.
Further, this device can also comprise: removing module 54 was used for when additional data lost efficacy the deletion additional data.
The present invention also provides a kind of page loading system, and this system comprises client and server, and wherein client comprises the described page charger of above-described embodiment.
The page charger and the system that offer according to present embodiment, after receiving user's accessing page request, only need the basic document to the server request complete page, obtain the complete page according to these basic document and the additional data stored, wherein additional data is that local memory device obtains to server request termly.All be after receiving user's accessing page request, to compare to server request in the lump with page datas all in the prior art, reduced the quantity of information of asking, improved the webpage loading velocity, avoid the position of some data block in the page to present the problem of the blank or corresponding prompting of different time, improved user's experience.
Intrinsic not relevant with any certain computer, virtual system or miscellaneous equipment with demonstration at this algorithm that provides.Various general-purpose systems also can be with using based on the teaching at this.According to top description, it is apparent constructing the desired structure of this type systematic.In addition, the present invention is not also for any certain programmed language.Should be understood that and to utilize various programming languages to realize content of the present invention described here, and the top description that language-specific is done is in order to disclose preferred forms of the present invention.
In the instructions that provides herein, a large amount of details have been described.Yet, can understand, embodiments of the invention can be put into practice in the situation of these details not having.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand one or more in each inventive aspect, in the description to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes in the above.Yet the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires the more feature of feature clearly put down in writing than institute in each claim.Or rather, as following claims reflected, inventive aspect was to be less than all features of the disclosed single embodiment in front.Therefore, follow claims of embodiment and incorporate clearly thus this embodiment into, wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and can adaptively change and they are arranged in one or more equipment different from this embodiment the module in the equipment among the embodiment.Can be combined into a module or unit or assembly to the module among the embodiment or unit or assembly, and can be divided into a plurality of submodules or subelement or sub-component to them in addition.In such feature and/or process or unit at least some are mutually repelling, and can adopt any combination to disclosed all features in this instructions (comprising claim, summary and the accompanying drawing followed) and so all processes or the unit of disclosed any method or equipment make up.Unless in addition clearly statement, disclosed each feature can be by providing identical, being equal to or the alternative features of similar purpose replaces in this instructions (comprising claim, summary and the accompanying drawing followed).
In addition, those skilled in the art can understand, although embodiment more described herein comprise some feature rather than further feature included among other embodiment, the combination of the feature of different embodiment means and is within the scope of the present invention and forms different embodiment.For example, in the following claims, the one of any of embodiment required for protection can be used with array mode arbitrarily.
All parts embodiment of the present invention can realize with hardware, perhaps realizes with the software module of moving at one or more processor, and perhaps the combination with them realizes.It will be understood by those of skill in the art that and to use in practice microprocessor or digital signal processor (DSP) to realize according to some or all some or repertoire of parts in the page charger of the embodiment of the invention.The present invention can also be embodied as be used to part or all equipment or the device program (for example, computer program and computer program) of carrying out method as described herein.Such realization program of the present invention can be stored on the computer-readable medium, perhaps can have the form of one or more signal.Such signal can be downloaded from internet website and obtain, and perhaps provides at carrier signal, perhaps provides with any other form.
It should be noted above-described embodiment the present invention will be described rather than limit the invention, and those skilled in the art can design alternative embodiment in the situation of the scope that does not break away from claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and is not listed in element or step in the claim.Being positioned at word " " before the element or " one " does not get rid of and has a plurality of such elements.The present invention can realize by means of the hardware that includes some different elements and by means of the computing machine of suitably programming.In having enumerated the unit claim of some devices, several in these devices can be to come imbody by same hardware branch.The use of word first, second and C grade does not represent any order.Can be title with these word explanations.