Specific embodiment
The exemplary embodiment of the disclosure is described more fully below with reference to accompanying drawings.Although this public affairs is shown in accompanying drawing
The exemplary embodiment that opens, it being understood, however, that may be realized in various forms the disclosure and the enforcement that should do not illustrated here
Example is limited.Conversely, provide these embodiments to be able to be best understood from the disclosure, and can be by the model of the disclosure
Enclose and complete convey to those skilled in the art.
In order to webpage interim card that waterfall Flow Technique causes is solved the problems, such as, a kind of page layout is embodiments provided
Method, as shown in figure 1, the method includes:
101st, starting browser clocking capability carries out timing, and obtains the first moment of system clock when timing is started
Value.
During user browses webpage by browser under even in everyday situations, some tasks behaviour usually can be executed in webpage
Make.For example buy ticket, air ticket or register account number etc., these tasks generally have ageing, i.e., must be within the time for setting
Completing this operation can just make task come into force.In order to allow users to understand the implementation progress of task in real time, browser itself is usual
All there is clocking capability, the timing of browser independently of the timing of system, be in most cases by being embedded in a browser
Carrying out timing to the task in webpage, timer is usually the JavaScript timer (letter of embedded web page formula to timer
Claim JS timer).In this step, when the clocking capability for starting browser carries out timing, need to obtain the of system clock
One moment value.First moment value is with important function in following step 103.
As this application of Js timer is developed based on browser aspect, the accuracy of its timing can be subject to browser
The impact of performance, and work as the process resources such as tag memory, central processing unit (Central Processing Unit, abbreviation CPU)
Occupancy situation serious when, can also make browser timing uncertainty true.Therefore when startup browser clocking capability carries out timing, clear
Device is look at it is possible that the phenomenon of timing delays, i.e. actual timing time are more than browser timing time.It can thus be appreciated that obtaining real
Border timing time plays an important role, and the first moment value of the system clock of above-mentioned acquisition be exactly obtain the actual timing time must
Want parameter.
102nd, stop timing when timing reaches preset duration, and the second moment of system clock is obtained when timing is stopped
Value.
In the present invention, browser clocking capability can carry out timing according to preset duration, and this preset duration is to judge waterfall
Whether the cloth stream page there is the call parameter of interim card, and preset duration artificially can be arranged, browser clocking capability according to default when
Long timing can obtain the second moment value of system clock, the second moment value of the system clock and system in step 101 after terminating
First moment value of clock is corresponding, and the call parameter for obtaining the actual timing time.
103rd, the difference of the second moment value and the first moment value is calculated, obtains actual timing duration.
During browser clocking capability carries out timing according to preset duration, excessively may take because of internal memory or
The problems such as CPU process resource excessively takes and cause timing error occur, so carrying out timing in browser according to preset duration
This period in, if in the case of all going well, the actual timing duration meeting of browser clocking capability and preset duration
Inconsistent.And system clock is not taken by EMS memory occupation or CPU process resource and affected, therefore can be obtained according to system clock
Obtain the actual timing duration of browser clocking capability.As step 101 is starting acquisition when browser clocking capability carries out timing
To the first moment value of system clock, when step 102 gets system when the timing of browser clocking capability reaches preset duration
Second moment value of clock, thus second moment value and the first moment value are subtracted each other, this time difference is exactly browser timing work(
The actual timing duration of energy.
104th, actual timing duration and preset duration are compared, judges whether the waterfall stream page occurs interim card.
When user browses waterfall drift net page by browser, as browsed content is more and more, at internal memory or CPU
The occupancy of reason resource etc. can be improved, and when the occupancy of internal memory or CPU process resource etc. is more serious, the waterfall stream page can block
, browser clocking capability occurs deviation.As the perception of user is limited, and different user has different perception bodies
Test, therefore cannot be accurately judged to whether the waterfall stream page occurs interim card according to the direct feel of user.And the waterfall stream page
There is positively related relation with the deviation situation of browser clocking capability in interim card situation, waterfall stream page interim card is more serious, browses
The deviation of device clocking capability is bigger.Therefore, in order to accurately and timely judge whether the waterfall stream page occurs interim card, permissible
Actual timing duration and the preset duration that step 103 is obtained is compared, and is judged with the presence or absence of deviation according to comparison result
Whether the waterfall stream page there is interim card.
If the 105 waterfall stream pages occur interim card, waterfall stream page layout switch is the paging page.
If finding there is deviation after comparing actual timing duration and preset duration at step 104, waterfall is can determine
There is interim card in the cloth stream page, in order to ensure that user browses the smooth of webpage, do not affect user's online experience, when determining waterfall stream page
After the interim card of face, the occupancy situation of existing internal memory or CPU process resource cannot meet the distribution form of the waterfall stream page, because
Waterfall stream page layout switch can be the paging page by this.As webpage is after the distribution form for being switched to the paging page, before clear
Image data in the paging page that look at can be cleaned out automatically by browser, discharge memory headroom, after ensureing
The paging page no longer interim card in continuous navigation process.
The method of page layout provided in an embodiment of the present invention, can enter according to preset duration according to browser clocking capability
Row timing, and obtain the first moment value and second moment value of system clock when starting timing and terminating timing respectively, by the
Two moment value obtain actual timing duration with the difference of the first moment value, after actual timing duration and preset duration are compared
Judge whether the waterfall stream page occurs interim card, however, it is determined that the waterfall stream page occur interim card, then by waterfall stream page layout switch be paging
The page.Compared with prior art, whether the present invention can be occurred with the contrast judgement webpage of system clock by browser timing
Interim card, and when webpage occurs interim card, releasing memory by way of changing the paging page, so as to prevent the card of the waterfall stream page
, it is ensured that the fluency of webpage operation.
Further, as refinement and the extension to above-described embodiment, at step 104 by actual timing duration with default
When duration is compared, realized due to browser clocking capability JS timer generally by embedded web page formula, therefore JS timing
The accuracy of device can be affected by webpage operation conditions.And system clock is usually the atomic clock on mainboard or network side
Network clocking, their operation are not affected by webpage operation conditions independently of webpage, and therefore the timing of system clock is all the time all
Be accurate, the actual timing duration of browser clocking capability can be obtained by the timing of system clock.
The data volume browsed with user is more and more, and the occupancy of internal memory or CPU process resource can be more serious, and this all can
Cause webpage interim card, so that the JS timer timing of embedded web page formula postpones than actual timing.For example, in the feelings of webpage interim card
Under condition, the 50ms when browser clocking capability timing, and the actual timing in system clock has had 80ms, so comparing knot
Fruit is usually actual timing duration and is more than preset duration.
In embodiment provided in an embodiment of the present invention, browser clocking capability carries out the master of timing according to preset duration
It is in order to for judging whether webpage occurs interim card to act on, and is therefore determining that starting browser clocking capability carries out timing
On opportunity, in addition to the most basic time status for allowing browser clocking capability be in circulation, also a kind of optional enforcement
Mode, is just starting timing when user starts to browse webpage.When start to browse the situation of webpage in order to obtain user, just need
The Action Events of user are monitored.Under normal circumstances, user can be operated accordingly when webpage is browsed, for example
Directionkeys on roller, the slider bar for sliding up and down page side or pressing keyboard on roll mouse etc..This generic operation energy
Continuation browse a large amount of webpages.Be a lasting process due to monitoring, therefore similar behaviour is being carried out when listening to user
After work, it is possible to which starting browser clocking capability carries out timing.
Further, if the actual timing duration that system clock is obtained is compared with the preset duration of browser timing
Afterwards, it is found that interim card occurs in webpage, then can now change the distribution form of the waterfall stream page.If using directly by waterfall stream page
Face switches to the mode of the paging page, is easy for bringing lofty sensation to user, and the change of page layout form may be used also
Can cause browsing pictures and non-browsing pictures mixed in together, cause user continue to browse from the content before paging, also
Obtain the page again from browsing content to be browsed or start to browse from the page for missing some non-browsing contents.
As shown in Fig. 2 used as a kind of optional embodiment, waterfall stream page layout switch is being paging by the embodiment of the present invention
During the page, two-page separation function key can be provided in the waterfall stream page.The two-page separation function key can be arranged on page bottom, or with
The form of suspension is occurred in the page.After triggering two-page separation function key, the content in the waterfall stream page will be slit into sheets place to user
Reason, shows the content in webpage with the distribution form of the paging page.Meanwhile, in order to avoid browsing content and non-browsing content go out
Now mix, browsing content can be entered as an entirety by the two-page separation function key in the embodiment when paging layout is carried out
Row paging, non-browsing content is carried out paging, and the paging page that last displaying content before paging is located as an entirety
Face is shown as the display page of browser, and the paging page for subsequently being browsed is exactly the paging comprising non-browsing content
The page.
When webpage is in the distribution form of the paging page, based on the cleaning mechanism of browser itself, the paging for having browsed
Data in the page can be released, and alleviate the occupancy of internal memory or CPU process resource.When the running environment of browser can meet again
During the distribution form of the waterfall stream page, can select again to show content with the distribution form of the waterfall stream page.Therefore as one
Optional embodiment is planted, after the waterfall stream page is switched to the paging page, the paging page can also be switched back into again
The waterfall stream page.
In this embodiment, equally can be by with realizing in the way of similar to above-mentioned two-page separation function key.As shown in figure 3,
Waterfall stream function key can be provided in the paging page, and the waterfall stream function key can be arranged at page bottom or the side to suspend
Formula is occurred in the page.The distribution form of the paging page just can be converted to waterfall by triggering the waterfall stream function key by user
The distribution form of stream.Additionally, the waterfall stream function key can be after waterfall stream page layout switch to the paging page scheduled duration
Occur, point out user switch back into the waterfall stream page.Can certainly be when waterfall stream page layout switch is to the paging page with regard to bullet
Go out waterfall stream function key.
Certainly, as another kind of implementation, either waterfall stream page layout switch is to the paging page, or the paging page is cut
The waterfall stream page is changed to, One function key can be shared.The function key can show carrying for " paging " in the waterfall stream page
Show, show the prompting of " waterfall stream " in the paging page.The function key is just ejected in the case of it can carry out page layout switch,
Automatic hidden in the case of page layout switch can not be carried out;Certainly the function key can also be occurred in the page all the time, simply in energy
(suggestion content as function key is green) could be triggered in the case of enough carrying out page layout switch, can not carry out page layout switch
In the case of trigger invalid (as function key suggestion content for redness).
Various embodiments described in above-described embodiment are to complete timing in browser clocking capability according to preset duration
On the basis of implement, but user is during actually webpage is browsed, it is possible that webpage interim card is excessively serious and cause
The timing of browser clocking capability stops, i.e., browser clocking capability just stopped timing before the timing of preset duration is completed.When
When there is the situation that the timing of browser clocking capability stops, as the timing of browser clocking capability does not reach preset duration, no
Method obtains the second moment value of system clock, therefore cannot obtain actual timing duration for judging whether webpage occurs interim card.
Therefore, can also include the step of whether timing of browser clocking capability stops judged in the present embodiment.If by judging
Determine that the timing of browser clocking capability stops, then explanation webpage excessively interim card causes browser clocking capability to stop timing in advance,
Waterfall stream page layout switch can be just now the paging page.
Additionally, the embodiment of the present invention additionally provides a kind of embodiment party for judging whether the timing of browser clocking capability stops
Formula.It is just to stop timing before preset duration due to stopping timing, therefore the embodiment can be by browser clocking capability
Timing duration when stopping timing is compared with preset duration, if being not reaching to preset duration, that is, stops timing during timing
Duration is less than preset duration, it is determined that the timing of browser clocking capability stops, and can execute and by waterfall stream page layout switch is subsequently
The step of paging page.
In the present embodiment, determine whether webpage occurs the efficiency of interim card that the viewing experience of user is directly influenced, and true
Determine webpage whether interim card mainly pass through by the actual timing duration of system clock and browser clocking capability timing default when
The mode compared of length is completed, and therefore the length of preset duration directly influences the determination webpage whether speed of interim card.Example
Such as, if preset duration is 200ms, after browser clocking capability timing 200ms, webpage whether interim card can determine;If default
Shi Changwei 2000ms, then, after browser clocking capability timing 2000ms, just can determine that webpage whether interim card, and in this section of 2000ms
Before longer time timing terminates, webpage be likely to interim card to the normal browsing demand for having a strong impact on user, but due to
The preset duration of 2000ms does not have timing to complete, it is impossible to obtain the second moment value of system clock, cannot get actual timing duration,
Therefore webpage interim card cannot be determined by way of comparing preset duration, it is impossible to by waterfall stream page layout switch to the paging page.
As long preset duration can affect implementation result, therefore it is accustomed to based on universal the browsing of user and comprehensive each
The factor of impact webpage interim card is planted, the present embodiment provides experience range of the preset duration less than 1000ms.Preset duration exists
In the range of this, the interim card of the page can be indicated that, and switches page layout before user feels the obvious interim card of webpage
Form.Explanation is needed exist for, the preset duration of the 1000ms that the present embodiment is provided is an optional scheme, is not
Restriction to preset duration, can also adjust preset duration according to specific circumstances.
In above-mentioned various embodiments, except listening to startup browser when user triggers corresponding Action Events
Clocking capability is carried out outside timing, and the embodiment of the present invention additionally provides another kind of mode for starting timing, i.e., by calling set
Timeout calls set Timeinterval functional interface to carry out timing.
As the set Timeout usage in JS timer is that time is up, carries out one by setting a time
Individual assigned operation calls a specified function.And set Timeinterval rule is to represent that separated in time is held repeatedly
Certain operation of row.In a kind of implementation of the present embodiment, can be started by calling set Timeinterval functional interface
Timing, the such as time that arranges in set Timeinterval sentence are 500ms, and it is to enter according to preset duration to arrange assigned operation
Row timing, then often all can carry out timing according to preset duration through 500ms browser clocking capability.Or set can also be called
Timeout functional interface starts timing, if realizing the function of set Timeinterval with set Timeout, it is necessary to
Oneself is regularly called again in the program that set Timeout is executed.
The embodiment of the present invention can be tied in preset duration timing by judging whether the timing of browser clocking capability stops
The waterfall stream page that will appear from interim card before bundle switches to the paging page in time, it is ensured that the high efficiency of page layout form switching,
The user that reduces of high degree browses the Caton phenomenon occurred during webpage.Meanwhile, the present embodiment is in page layout form
Two-page separation function key and waterfall stream function key are provided when switching over, allow user voluntarily select the waterfall stream page and the paging page it
Between switch over, it is possible to increase the viewing experience of user.
Further, as the realization to said method, the embodiment of the present invention additionally provides a kind of device of page layout,
The device is may be located in terminal, it is also possible to independently of terminal but with data interaction relation between terminal, on realizing
Method shown in the different embodiments of embodiment offer is provided.As shown in figure 4, the device includes:Timing unit 41, acquiring unit
42nd, processing unit 43, comparing unit 44 and switch unit 45, wherein,
Timing unit 41, carries out timing for starting browser clocking capability;
Acquiring unit 42, for obtaining the first moment value of system clock when timing unit 41 starts timing;
The timing unit 41 is additionally operable to stop timing when timing reaches preset duration;
The acquiring unit 42 is additionally operable to obtain the second moment value of system clock when timing unit 41 stops timing;
Processing unit 43, for calculating the second moment value of the acquisition of acquiring unit 42 and the difference of the first moment value, obtains
Actual timing duration;
Comparing unit 44, actual timing duration and the preset duration for obtaining processing unit 43 are compared, and judge
Whether the waterfall stream page there is interim card;
Switch unit 45, for when comparing unit 44 determines that the waterfall stream page occurs interim card, by waterfall stream page layout switch
For the paging page.
Further, when the comparing unit 44 is used for actual timing duration being compared more than preset duration, determine waterfall stream page
There is interim card in face.
Further, the device is further included:
Monitoring unit 46, for the behaviour before the startup browser clocking capability of timing unit 41 carries out timing, to user
Monitored as event, the Action Events include roller event, slider bar event, direction key events.
The timing unit 41 is used for, when monitoring unit 46 listens to operation change, starting browser clocking capability and being counted
When.
Further, the switch unit 45 is used for providing two-page separation function key in the waterfall stream page, when user triggers this point
During page function key, paging process is carried out to the displaying content in the waterfall stream page, and exhibition is shown with the distribution form of the paging page
Show content.
Further, the switch unit 45 is used for switching paging page of the display comprising the last displaying content for showing before paging
Face.
Further, the switch unit 45 is used for after waterfall stream page layout switch is the paging page by switch unit 45,
Paging conversion of page is the waterfall stream page.
Further, the device is further included:
Whether judging unit 47, the timing for judging browser clocking capability stop;
The switch unit 45 is additionally operable to when judging unit 47 determines that the timing of browser clocking capability stops, by waterfall stream page
Face switches to the paging page.
Further, the judging unit 47 is used for, when browser clocking capability stops timing, comparing browser timing work(
Whether timing duration when can stop timing reaching preset duration, if being not reaching to preset duration, it is determined that browser timing work(
Can timing termination.
Further, the timing unit 41 is used for calling set Timeout or calling set Timeinterval function to connect
Mouth carries out timing.
The device of page layout provided in an embodiment of the present invention, can enter according to preset duration according to browser clocking capability
Row timing, and obtain the first moment value and second moment value of system clock when starting timing and terminating timing respectively, by the
Two moment value obtain actual timing duration with the difference of the first moment value, after actual timing duration and preset duration are compared
Judge whether the waterfall stream page occurs interim card, however, it is determined that the waterfall stream page occur interim card, then by waterfall stream page layout switch be paging
The page.Compared with prior art, whether the present invention can be occurred with the contrast judgement webpage of system clock by browser timing
Interim card, and when webpage occurs interim card, releasing memory by way of changing the paging page, so as to prevent the card of the waterfall stream page
, it is ensured that the fluency of webpage operation.
Additionally, device provided in an embodiment of the present invention is by judging whether the timing of browser clocking capability stops, can
The waterfall stream page that will appear from interim card before preset duration timing terminates switches to the paging page in time, it is ensured that page layout shape
The high efficiency of formula switching, the user that reduces of high degree browse the Caton phenomenon occurred during webpage.Meanwhile, the present embodiment
Two-page separation function key and waterfall stream function key are provided when page layout form is switched over, allow user voluntarily to select in waterfall stream page
Switch between face and the paging page, it is possible to increase the viewing experience of user.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion that describes in detail in certain embodiment
Point, may refer to the associated description of other embodiment.
It is understood that said method and the correlated characteristic in device mutually can be referred to.In addition, in above-described embodiment
" first ", " second " etc. be for distinguishing each embodiment, and do not represent the quality of each embodiment.
Those skilled in the art can be understood that, for convenience and simplicity of description, the system of foregoing description,
Device and the specific work process of unit, may be referred to the corresponding process in preceding method embodiment, will not be described here.
Algorithm is not inherently related to any certain computer, virtual system or miscellaneous equipment with display provided herein.
Various general-purpose systems can also be used together based on teaching in this.As described above, construct required by this kind of system
Structure be obvious.Additionally, the present invention is also not for any certain programmed language.It is understood that, it is possible to use various
Programming language realizes the content of invention described herein, and the description that above language-specific is done be in order to disclose this
Bright preferred forms.
In specification mentioned herein, a large amount of details are illustrated.It is to be appreciated, however, that the enforcement of the present invention
Example can be put into practice in the case of not having these details.In some instances, known method, structure are not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure helping understand one or more in each inventive aspect,
Above in the description to the exemplary embodiment of the present invention, each feature of the present invention is grouped together into single enforcement sometimes
In example, figure or descriptions thereof.However, should the method for the disclosure be construed to reflect following intention:I.e. required guarantor
The more features of feature that the application claims ratio of shield is expressly recited in each claim.More precisely, such as following
Claims reflected as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself
All as the separate embodiments of the present invention.
Those skilled in the art are appreciated that can be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more equipment different from the embodiment.Can be the module in embodiment or list
Unit or component are combined into a module or unit or component, and can be divided in addition multiple submodule or subelement or
Sub-component.In addition at least some in such feature and/or process or unit is excluded each other, can adopt any
Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (includes adjoint power
Profit is required, summary and accompanying drawing) disclosed in each feature can identical by offers, be equal to or the alternative features of similar purpose carry out generation
Replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments
In included some features rather than further feature, but the combination of the feature of different embodiments means in the present invention's
Within the scope of and form different embodiments.For example, in the following claims, embodiment required for protection appoint
One of meaning can in any combination mode using.
The all parts embodiment of the present invention can be realized with hardware, or to run on one or more processor
Software module realize, or with combinations thereof realize.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor (DSP) are realizing denomination of invention according to embodiments of the present invention (as determined in website
The device of Hyperlink rank) in some or all parts some or all functions.The present invention be also implemented as
Execute some or all equipment or program of device (for example, computer program and the calculating of method as described herein
Machine program product).Such program for realizing the present invention can be stored on a computer-readable medium, or can have one
Or the form of multiple signals.Such signal can be downloaded from internet website and be obtained, or provide on carrier signal,
Or provided with any other form.
It should be noted that above-described embodiment the present invention will be described rather than limits the invention, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol Wei Yu bracket between should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not
Element listed in the claims or step.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can come real by means of the hardware for including some different elements and by means of properly programmed computer
Existing.If in the unit claim for listing equipment for drying, several in these devices can be by same hardware branch
To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame
Claim.