The content of the invention
In order to solve above-mentioned at least one problem, the invention provides a kind of page display method, device and corresponding visitor
Family end equipment, it to that can hinder the preloading of the keystone resources of page presentation in itself by realizing that the quick of the page shows.
According to an aspect of the invention, there is provided a kind of page display method, including:Send page load request;Ring
The related load information of the keystone resources of the page should be found, the keystone resources is in sending the page load request
Refer to the resource for the displaying that can hinder the page;In the case where finding the related load information, the related loading is used
Information loads the keystone resources of the page;Receive the page data of the page returned according to the page load request;
And based on the loading result to the keystone resources, parse the page data.
Thus, the load information for blocking the keystone resources correlation of page parsing by prestoring participant, it becomes possible to asking
Attempted immediately according to these relevant informations to the pre-loaded of keystone resources while seeking loading page.So, page is being received
Face data and when starting parsing, those this keystone resourceses that can block parsing are likely to that loaded is (or at least
In loading procedure), thus fundamentally solve page presentation caused by blocking page parsing by keystone resources and slow down problem.
Preferably, finding the related load information of the keystone resources of the page includes:Institute is found in local storage
State related load information;And/or the related load information is found by network.
In this way, it is possible to according to the acquisition modes of actual conditions reasonable selection relevant information, so as to further promote the page
Quick displaying.
Preferably, during the page data is parsed, collect related to the keystone resources for loading the page
Related load information, and store in the local storage and/or on network or update the related load information.
In this way, it is possible to know in time or update related load information, so as to optimize the correct preload to keystone resources,
Thus the quick displaying of the page is further promoted.
Preferably, the URL associated storages of the related load information of the page and the page, and including the key
The URL and type of resource.
In this way, it is possible to the quick identification and loading of keystone resources are realized, to promote the smooth parsing of the page and quick exhibition
Show.
Preferably, the related load information of the keystone resources also priority including the keystone resources, resource hit
At least one of in rate and confidence level.
In this way, it is possible to more accurate judgement is carried out to the property of keystone resources, so that more rightly loading is crucial
Resource, to promote the fast resolving of the page.
Preferably, the keystone resources includes at least one following:CSS information in the page data;And institute
State non-asynchronous outside JavaScript information in page data.
Thus further occluding object clearly of the prior art, to promote the preloading of keystone resources and further speed up
Page presentation.
Preferably, the keystone resources can only include the resource for the first screen content displaying that can hinder the page.
Thus, by the way that keystone resources to be also limited in first screen, the flow of preloading is further optimized, is added so as to improve
Carry efficiency.
According to another invention of the present invention, there is provided a kind of page presentation device, including:Page load request sends single
Member, for sending page load request;Related load information finds unit, in response to sending the page load request,
The related load information of the keystone resources of the page is found, the keystone resources refers to the money that can hinder the displaying of the page
Source;Key message loading unit, in the case where finding the related load information, being added using the related load information
Carry the keystone resources of the page;Page data receiving unit, for receiving according to returning to the page load request
The page data of the page;And page data resolution unit, for based on the loading result to the keystone resources to parse
State page data.
Preferably, the related load information, which finds unit, to find institute in local storage and/or by network
State related load information.
Preferably, the page presentation device can also include:Related load information collector unit, for described in parsing
During page data, the related load information related to the keystone resources for loading the page is collected, and in the local
Stored in memory and/or on network or update the related load information.
According to another invention of the present invention, there is provided a kind of client device, including:Communication module;Memory;Display
Device;And processor, the communication module, the memory and the display are connected to, the processor is used for:Send page
Face load request;In response to sending page load request via the communication module, the phase of the keystone resources of the page is found
Load information is closed, the keystone resources refers to the resource that can hinder the displaying of the page;Finding the related load information
In the case of, the related load information is stored in memory and the pass of the page is loaded using the related load information
Key resource;The page data of the page returned according to the page load request is received via the communication module;And
Based on the loading result to the keystone resources, the page data is parsed to show on the display.
Preferably, the related load information of the keystone resources of the processor searching page can include:Described
The related load information is found in memory;And/or the related loading letter is found by network via the communication unit
Breath.
Preferably, the processor can be additionally operable to:During the page data is parsed, described in collection and loading
The related related load information of the keystone resources of the page, and in network in the memory and/or via the communication module
Upper storage updates the related load information.
Using the present invention page display method, device and client device, can pre-loaded can drag slow page exhibition
The resource shown, fundamentally solve the obstructing problem caused by keystone resources loads, thus accelerate page presentation speed, improve and use
The viewing experience at family.
Embodiment
The preferred embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing
Preferred embodiment, however, it is to be appreciated that may be realized in various forms the disclosure without the embodiment party that should be illustrated here
Formula is limited.On the contrary, these embodiments are provided so that the disclosure is more thorough and complete, and can be by the disclosure
Scope is intactly communicated to those skilled in the art.
With the development of network technology and the popularization of mobile client, people spend time in web page browsing increasingly
It is more.How under existence conditions constraint displayed web page as quickly as possible, the big mesh pursued into major browser supplier
Mark.For present circumstances, most webpages are all write using HTML.HTML parsings can only occur in main thread, and
After JavaScript scripts load from network and parse and be finished, HTML resolving could be recovered.Separately
Outside, although intuitively CSS simply decorates to DOM node, do not loaded but if JavaScript scripts have accessed
With the CSS files being parsed, the webpage layout and layout of mistake can be directly resulted in, therefore, CSS resources can also block HTML texts
The parsing of shelves.
Because blocking largely influences the performance of web displaying, so the browser kernel (example of current popular
Such as, WebKit kernels) said process is optimized.Main thread is still downloaded and parses JavaScript scripts, another line
Cheng Zehui scans the resource of page remainder and preloaded when main thread blocks.This can be to a certain extent
Accelerate page presentation, but JS and CSS still can block page parsing.Different from it can only be preloaded when main thread is blocked
The prior art of his resource, the application, which can preload, can block the resource of page parsing in itself.Therefore can fundamentally solve
Certainly above mentioned problem and realize that the quick of webpage shows.
Before technical scheme is described in detail, first technical term involved in the present invention is illustrated by." key money
Source " refers herein to hinder the resource of page presentation.For existing webpage, " keystone resources " may refer to hinder
The resource of page parsing is filled in, for example, it may be can actually block JS the and CSS resources of main thread parsing.However, it will be apparent that this
Other situations that the principle of invention is also applied for the technology development in future and those skilled in the art can be readily apparent that, therefore this
" keystone resources " in text not merely refers to the resource that can block page parsing, is also refer to that on wider page exhibition can be hindered
Other resources shown.
Fig. 1 is the block diagram of client device 10 according to an embodiment of the invention.The component bag of the client device
Include but be not limited to one or more processors 110, memory 120, display 130 and communication module 140.Processor 110 connects
To memory 120, display 130 and communication module 140.In one embodiment, said modules can also be connected with each other, such as
Pass through bus.The client device 10 can be realized in the form of universal computing device, such as personal computer, flat board calculate
Machine, intelligent mobile phone etc., and can also include being used for the other assemblies for realizing above-mentioned universal computing device function, such as make
Obtain the input unit that user can be inputted by it.It should be appreciated that the structured flowchart described in Fig. 1 is just for the sake of example
Purpose, without limiting the scope of the present invention.In some cases, some set can be increased or decreased as the case may be
It is standby.
Communication module 140 for example can receive and dispatch various information via network and instruction, memory 120 correspondingly store all kinds of
Information, display 130 can then carry out page presentation.Above-mentioned part carries out all kinds of actions, Ke Yishi under the control of processor 110
The page display method of the existing present invention.
Fig. 2 is a kind of flow chart of page display method according to an embodiment of the invention.The page display method
Client device 10 that can be as shown in Figure 1, processor 110 especially therein perform.For example, it can be stored on memory 120
Instruction and information, and the instruction by processor 110 when being performed, it is possible to achieve page display method of the invention.
In step S210, page load request is sent.For example, browser can be by clickthrough or defeated in address field
Enter URL to realize the transmission of page load request.
In step S220, in response to sending the page load request, the correlation for finding the keystone resources of the page adds
Information carrying ceases, and wherein keystone resources refers to the resource that can hinder page presentation, it is preferable that keystone resources can block page solution
The resource of analysis, it is further preferable that being the resource for the page parsing that can block the first screen of complete display.The transmission of page load request can
To trigger the trial to page keystone resources loading immediately.
In step S230, in the case where finding related load information, the page is loaded using the related load information
Keystone resources.
In step S240, the page data returned according to page load request is received.
In step S250, based on the loading result to keystone resources, page data is parsed.When page parsing runs into crucial money
During source, because the loading of keystone resources independently starts already, therefore page solution can be accelerated based on the loading to keystone resources
Analysis.Under normal circumstances, from page load request is sent to page parsing to the period keystone resources, complete enough to closing
The loading of key resource.Completed that is, loading result is keystone resources loading.Therefore when page parsing is to keystone resources,
The keystone resources has been completed to load and has been stored in such as memory cache so that page parsing directly uses.And even for
When worst situation, i.e. page parsing are to keystone resources, not yet complete the complete loading to keystone resources, then still can be direct
Accelerate page parsing using the loading result (for example, having completed the steps such as dns resolution, TCP connections) to the keystone resources
Process.
Fig. 1 is returned to, in order to realize the page display method of the present invention, the processor 110 of client device 10 can be first
Via communication module 140 send page load request, and the page is found in response to sending the page load request
Keystone resources related load information.In the case where finding the related load information, processor 110 can be in memory
The related load information is stored in 120 and keystone resources is loaded using the related load information.Then, processor 110
The page data of the page returned according to the page load request can be received via communication module 140, and is based on
Above-mentioned page data is parsed to the loading of keystone resources progress.Parsing the page finished can show on the display 130.
According to actual conditions, the related load information of keystone resources can be stored in the specific of local storage or network
On position, those of ordinary skill in the art can also be stored in it is conceivable that other correct positions.For example, energy is being locally stored
Local is stored in the case that power is liberal, network is stored in being locally stored in the case that limited in one's ability but network condition is excellent
On, or the flexibly selection storage in the case where condition often changes.Thus, the correlation of the keystone resources of the page is found
Load information, which can be included in local storage (for example, Fig. 1 memory 120), finds the related load information, also may be used
The related load information is found by network including (for example, communication module 140 via Fig. 1), or according to actual feelings
Condition is found in network or locally on both.
Preferably, Fig. 2 page display method can also include step S260.In step S260, the page is being parsed
During data, the related load information related to the keystone resources for loading the page is collected, and be locally stored described
Stored in device and/or on network or update the related load information., can be relevant by what is be collected into when accessing webpage first
The information of keystone resources is acted upon and is used as related load information storage to the ad-hoc location on local or network.And if
Preceding storing the related load information on local or network, then can omit the step or according to certain rule come
Update and optimize the data in preceding storage.Similarly, above-mentioned steps S260 can be performed by the processor 110 in such as Fig. 1, and
The related load information being collected into can also be stored for example in memory 120 in Fig. 1.
The information (that is, related load information in the present invention) related to the keystone resources loading of specific webpage can be with this
The URL associated storages of specific webpage, and URL and type including the keystone resources.In one embodiment, the pass of the page
Key resource can be that non-asynchronous outside JS information is (asynchronous in CSS information or the page data in the page data
JS information will not generally block page parsing).Therefore, related load information may be used also in addition to the URL associated storages with the page
With the URL including above-mentioned CSS and JS information and indicate that the resource is JS or CSS resource type information.
In one embodiment, the related load information of keystone resources can also include the priority of the keystone resources, money
At least one of in source hit rate and confidence level.These information are particularly suitable for use in the page that display content changes often, and by
The historical data that multiple web page access is usually required in the accuracy of resource hit rate and confidence level is used as support, therefore in correlation
In the case that load information includes the above, each page parsing of preferred pair all carries out information, is updated with iteration specific
Such as resource hit rate and/or confidence level of keystone resources.
For example, can decide whether to add in advance according to the priority height of a certain critical data in specific webpage
Carry the critical data.And if the confidence level of certain resource is less than threshold value (for example, the URL of a JS resources or content often become
Change), then illustrate the resource appear in the page possibility it is little, therefore it can not be loaded in advance, to avoid wasting
Flow and bandwidth.
In addition, for the limited client device of flow and bandwidth, the preloading of keystone resources can only be loaded and can hindered
The resource of the first screen content displaying of the page.Thus avoided as far as possible to flow or bandwidth while the smooth display of first screen is ensured
Unnecessary occupancy.For the intelligent terminal of known screen resolution, each element can be predefined according to page composition
Display location, and thus selection only preload can be in the content of the first screen display of the intelligent terminal.
Page display method according to embodiments of the present invention is described above in conjunction with Fig. 1 and Fig. 2 and can realize the party
The client device of method.The inventive principle of the present invention will exemplarily be illustrated according to Fig. 3 and Fig. 4 as follows.
Fig. 3 is the inventive principle schematic diagram of the present invention.As illustrated, client device is in t1Moment is for example, by clicking on chain
Connect to a certain website and send page load request, then soon attempt to be searched and URL associated storages according to the URL of the link
Keystone resources related load information and according to above- mentioned information load keystone resources.In t2Moment, client device receive
Website is according to t1Page load request that moment sends and the page data that returns, and start page parsing at once.In t3Moment,
Page parsing can block the keystone resources of page parsing to this.But because the trial to loading keystone resources is from t1Moment is just
Start, therefore page parsing now can directly use (t3-t1) keystone resources loading achievement in the period.If key money
Source is in the (t3-t1) loaded in the period, then page parsing process directly can carry out the page using the keystone resources
Smooth parsing.And even keystone resources is in t3Moment, page parsing process also can be directly to key still in loading procedure
Resource carries out continuing to load, and thus fundamentally accelerates the parsing to the page.In addition, it is obvious that above-mentioned keystone resources can be with
It is the multiple resources run into during page parsing, therefore for the keystone resources positioned at page diverse location, its t3Can be t2
After moment at different moments, but they are benefited from from t1The loading that moment starts is attempted and can loaded faster
Finish.
Fig. 4 is one section of exemplary code of page data.As shown in figure 4, CSS resources and mark wherein labeled as 1
It can block the parsing of the page for 2 JS resources, therefore they can be regarded as to the keystone resources of the page.Labeled as 3 JS
Resource will not block the parsing of the page, therefore be not keystone resources due to being asynchronous.Page parsing device runs into these key moneys
It behind source, can stop parsing, be completed until keystone resources loads.But if use the method for the present invention, it becomes possible in page parsing
Above-mentioned resource is loaded in advance before to resource 1 and 2, thus lifts page presentation speed.With reference to Fig. 3 sequential, if
, then can be in t using the page display method of the present invention1Moment begins attempt to the loading to resource 1 and 2.And in t3Moment parses
During to resource 1 or 2, it is likely that now resource 1 and 2 has been pre-loaded finishing and has been stored in memory cache.Therefore to the page
Parsing can by directly from caching take out resource 1 and 2 be gone on and unimpeded, thus fundamentally lifting solution
Analyse speed.
Page display method according to embodiments of the present invention can be implemented by corresponding page presentation device.Fig. 5 is according to this
The schematic diagram of the page presentation device 50 of one embodiment of invention.Page presentation device 50 can include page load request and send out
Send unit 510, related load information find unit 520, key message loading unit 530, page data receiving unit 540 and
Page data resolution unit 550.
In one embodiment, page Load request transmitting element 510 for example can send page loading to targeted sites
Request.Related load information, which finds unit 520, to find the key of the page in response to sending the page load request
The related load information of resource.Keystone resources refers to the resource that can hinder the displaying of the page, it is preferable that is that can block the page
The resource of parsing, it is further preferable that being the resource for the page parsing that can block the first screen of complete display.Key message loading unit
530 in the case where finding the related load information, can load the key of the page using the related load information
Resource.Then, page data receiving unit 540 can receive the page of the page returned according to the page load request
Data, and page data resolution unit 550 can then parse the page data based on the loading result to the keystone resources.
Preferably, related load information is found described in unit 520 can find in local storage and/or by network
Related load information.
In one embodiment, page presentation device 50 can also alternatively include related load information collector unit 560,
The latter can collect the related loading related to the keystone resources for loading the page during the page data is parsed
Information, and store in the local storage and/or on network or update the related load information.
Above it is described in detail by reference to accompanying drawing and is set according to page display method, device and the client of the present invention
It is standby.
In addition, the method according to the invention is also implemented as a kind of computer program, the computer program includes being used for
Perform the computer program code instruction of the above steps limited in the above method of the present invention.Or according to the present invention's
Method is also implemented as a kind of computer program product, and the computer program product includes computer-readable medium, in the meter
The computer program for performing the above-mentioned function of being limited in the above method of the invention is stored with calculation machine computer-readable recording medium.Ability
Field technique personnel will also understand is that, various illustrative logical blocks, module, circuit and algorithm with reference to described by disclosure herein
Step may be implemented as the combination of electronic hardware, computer software or both.
Flow chart and block diagram in accompanying drawing show that the possibility of the system and method for multiple embodiments according to the present invention is real
Existing architectural framework, function and operation.At this point, each square frame in flow chart or block diagram can represent module, a journey
A part for sequence section or code, a part for the module, program segment or code is comprising one or more defined for realizing
The executable instruction of logic function.It should also be noted that at some as in the realization replaced, the function of being marked in square frame also may be used
With with different from the order marked in accompanying drawing generation.For example, two continuous square frames can essentially perform substantially in parallel,
They can also be performed in the opposite order sometimes, and this is depending on involved function.It is also noted that block diagram and/or stream
The combination of each square frame and block diagram in journey figure and/or the square frame in flow chart, function or operation as defined in performing can be used
Special hardware based system realize, or can be realized with the combination of specialized hardware and computer instruction.
It is described above various embodiments of the present invention, described above is exemplary, and non-exclusive, and
It is not limited to disclosed each embodiment.In the case of without departing from the scope and spirit of illustrated each embodiment, for this skill
Many modifications and changes will be apparent from for the those of ordinary skill in art field.The selection of term used herein, purport
The principle of each embodiment, practical application or improvement to the technology in market are best being explained, or is making the art
Other those of ordinary skill are understood that each embodiment disclosed herein.