Movatterモバイル変換


[0]ホーム

URL:


CN109325190A - A kind of page management method and related device - Google Patents

A kind of page management method and related device
Download PDF

Info

Publication number
CN109325190A
CN109325190ACN201810956429.6ACN201810956429ACN109325190ACN 109325190 ACN109325190 ACN 109325190ACN 201810956429 ACN201810956429 ACN 201810956429ACN 109325190 ACN109325190 ACN 109325190A
Authority
CN
China
Prior art keywords
page
pages
module
cache queue
cached
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
CN201810956429.6A
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
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 Zhengzhou Yunhai Information Technology Co LtdfiledCriticalZhengzhou Yunhai Information Technology Co Ltd
Priority to CN201810956429.6ApriorityCriticalpatent/CN109325190A/en
Publication of CN109325190ApublicationCriticalpatent/CN109325190A/en
Pendinglegal-statusCriticalCurrent

Links

Landscapes

Abstract

The embodiment of the invention discloses a kind of methods of page management, comprising: receives page switching request;It is requested according to the page switching, obtains the first page and second page to be shown currently shown;Judge that the second page whether there is in buffer queue;If the second page is present in the buffer queue, the first page is hidden;It shows the second page, and the second page is updated to the buffer queue.The embodiment of the invention also discloses a kind of page management devices.Realize when user need when several pages toggle, do not need to regenerate the page, reduce the used time of displayed page, improve operational efficiency.

Description

A kind of method and relevant apparatus of page management
Technical field
The present invention relates to the methods and relevant apparatus of front end development field more particularly to a kind of page management.
Background technique
Front end, that is, website front end part operates in host side, and the net of user's browsing is presented on the browsers such as mobile terminalPage (world wide web, WEB).With the development of internet technology, hypertext markup language (hyper text markupLanguage, HTML), Cascading Style Sheet (cascading style sheet, CSS) and Java script (Javascript,) etc. JS developing instruments are applied in the exploitation of front end.
Under the scene of single page web application (single page web application, SPA), the page node of generationQuilt of the carry in a preassigned root node (rootnode), when the old page is switched to new page, under root nodeThe old page of switching is destroyed, and the new page of generation needs the data on request call backstage, and carry is in the root node.
When user needs to toggle in several pages, new page and carry will be regenerated to root nodeIn, it needs to re-request the data on backstage, causes the used time of displayed page to increase, the reduction of operational efficiency.
Summary of the invention
The embodiment of the invention provides a kind of method of page management and relevant apparatus, realize under SPA scene, whenUser needs when several pages toggle, and the page due to currently showing and the page to be shown are all in caching teamIn column, and carry therefore does not need to regenerate the page in root node, reduces the used time of displayed page, improves fortuneLine efficiency.
In view of this, first aspect present invention provides a kind of method of page management, comprising:
Receive page switching request;
It is requested according to the page switching, obtains the first page and second page to be shown currently shown;
Judge that the second page whether there is in buffer queue;
If the second page is present in the buffer queue, the first page is hidden;
It shows the second page, and the second page is updated to the buffer queue.
It is described to sentence in conjunction with the embodiment of the present invention in a first aspect, in the first possible implementation of the first aspectThe second page of breaking whether there is after buffer queue, the method also includes:
If the second page is not present in the buffer queue, the first page is hidden;
The second page is added to the buffer queue;
Show the second page.
In conjunction with the first possible implementation of the first aspect of the embodiment of the present invention, second in first aspect canIn the implementation of energy, the method also includes:
Page remover is triggered, the page remover is for removing the page cached in the buffer queue;
When reaching preset runing time, judge whether the page quantity cached in presently described buffer queue is greater than mostBig cacheable page quantity;
If the page quantity of caching described in presently described buffer queue is greater than the cacheable page quantity of maximum,The n earliest page of cache-time in the buffer queue is deleted, the n is beyond the cacheable page quantity of maximumQuantity.
In conjunction with second of possible implementation of the first aspect of the embodiment of the present invention, the first party of the embodiment of the present inventionIt is described to judge whether the page quantity cached in presently described buffer queue is greater than most in the third possible implementation in faceAfter big cacheable page quantity, the method also includes:
If the page quantity cached in presently described buffer queue is less than or equal to maximum cacheable page quantity, closeClose the page remover.
In conjunction with the embodiment of the present invention first aspect to first aspect any one of the third possible implementationImplementation, it is described according to the page switching in the 4th kind of possible implementation of the first aspect of the embodiment of the present inventionRequest obtains the first page and second page to be shown currently shown, comprising:
Monitor the first uniform resource position mark URL and the second uniform resource position mark URL;
When the first URL and the 2nd URL change, obtain that the first URL is corresponding currently to be shownFirst page and the corresponding second page to be shown of the 2nd URL.
Second aspect of the present invention provides a kind of device of page management, and the device of the page management includes:
Receiving module, for receiving page switching request;
Module is obtained, for requesting according to the page switching, obtains the first page that currently shows and to be shownSecond page;
Judgment module, for judging that the second page whether there is in buffer queue;
Hidden module hides the first page if being present in the buffer queue for the second page;
Update module is updated to the buffer queue for showing the second page, and by the second page.
In conjunction with the second aspect of the embodiment of the present invention, in the first possible embodiment of second aspect, the pageThe device of management further includes adding module and display module;
The hidden module hides described first if being also used to the second page is not present in the buffer queueThe page;
The adding module, for the second page to be added to the buffer queue;
The display module, for showing the second page.
In conjunction with the first possible embodiment of the second aspect of the embodiment of the present invention, second in second aspect mayEmbodiment in, the page management device further includes trigger module and removing module;
The trigger module, for triggering page remover, the page remover is for removing in the buffer queueThe page of caching;
The judgment module is also used to when reaching preset runing time, judges to cache in presently described buffer queuePage quantity whether be greater than maximum cacheable page quantity;
The removing module, if the page quantity for caching described in presently described buffer queue can greater than the maximumThe page quantity of caching, then delete the n earliest page of cache-time in the buffer queue, and the n is beyond the maximumThe quantity of cacheable page quantity.
In conjunction with second of possible embodiment of the second aspect of the embodiment of the present invention, the third in second aspect mayEmbodiment in, the page management device further includes closedown module;
The closedown module, if the page quantity for caching in presently described buffer queue, which is less than or equal to maximum, to be delayedThe page quantity deposited then closes the page remover.
In conjunction with the embodiment of the present invention second aspect to first aspect any one of the third possible implementationImplementation, page management device described in the 4th kind of possible implementation of the second aspect of the embodiment of the present invention further includeMonitor module;
The monitoring module, for monitoring the first uniform resource position mark URL and the second uniform resource position mark URL;
The acquisition module is also used to obtain described first when the first URL and the 2nd URL changesThe corresponding first page currently shown of URL and the corresponding second page to be shown of the 2nd URL.
The page management device further includes monitoring module;
The monitoring module, for monitoring the first uniform resource position mark URL and the second uniform resource position mark URL;
The acquisition module is also used to obtain described first when the first URL and the 2nd URL changesThe corresponding first page currently shown of URL and the corresponding second page to be shown of the 2nd URL.
As can be seen from the above technical solutions, the embodiment of the present invention has the advantage that
In the embodiment of the present invention, a kind of method of page management is provided, receives page switching request;According to the pageSwitching request obtains the first page and second page to be shown currently shown;Judge that the second page whether there isIn buffer queue;If the second page is present in the buffer queue, the first page is hidden;Show the second pageFace, and the second page is updated to the tail of the queue of the buffer queue.By the above-mentioned means, due to the page that currently shows withThe page to be shown is all in buffer queue, and carry is in root node, when user need several pages back and forthIt when switching, does not need to regenerate the page, reduces the used time of displayed page, improve operational efficiency.
Detailed description of the invention
Fig. 1 is the interface schematic diagram of the application scenarios of the method for page management in the embodiment of the present invention;
Fig. 2 is the flow diagram of the application scenarios of the method for page management in the embodiment of the present invention;
Fig. 3 is one embodiment schematic diagram of the method for page management in the embodiment of the present invention;
Fig. 4 is one embodiment schematic diagram of page management device in the embodiment of the present invention;
Fig. 5 is another embodiment schematic diagram of page management device in the embodiment of the present invention;
Fig. 6 is another embodiment schematic diagram of page management device in the embodiment of the present invention;
Fig. 7 is another embodiment schematic diagram of page management device in the embodiment of the present invention;
Fig. 8 is another embodiment schematic diagram of page management device in the embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, completeSite preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based onEmbodiment in the present invention, those skilled in the art's every other implementation obtained without creative effortsExample, shall fall within the protection scope of the present invention.
Description and claims of this specification and term " first ", " second ", " third ", " in above-mentioned attached drawingThe (if present)s such as four " are to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should manageThe data that solution uses in this way are interchangeable under appropriate circumstances, so that the embodiments described herein can be in addition to illustrating hereinOr the sequence other than the content of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended thatCover it is non-exclusive include, for example, containing the process, method, system, product or equipment of a series of steps or units need not limitIn step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, produceThe other step or units of product or equipment inherently.
The embodiment of the invention provides a kind of method of page management and relevant apparatus, realize under SPA scene, whenUser needs when several pages toggle, and the page due to currently showing and the page to be shown are all in caching teamIn column, and carry therefore does not need to regenerate the page in root node, reduces the used time of displayed page, improves fortuneLine efficiency.
It should be understood that the method and relevant apparatus of page management proposed by the present invention, are applied under SPA scene.
In traditional network application design, network application is made of several different webpages.In order to special in the interior rendering of applicationDetermine webpage, execute following interaction set: the web browser (using HTTP message) at client device is asked from network serverSeek particular webpage;In response, network server (using HTTP) will be used for the code transfer of the page back to web browser, instituteStating code includes such as HTML, JavaScript and CSS;Then web browser loading code and renders the page, thus makeThe page can be checked and interact with the page by obtaining user.When user subsequently wants to the different content checked in application, user willThe hyperlink or input of the different pages being directed toward in application on the page are clicked, and then mentioned above for the execution of the different pagesRequest/response/load/render process.
Single page Web application (SPA) is the network application operated in single webpage.In SPA, in single webpageHold and web browser is sent to by network server, and as above for loading/wash with watercolours described in traditional network applicationContaminate the page.Then, when user wants the different content checked in application, user will click on the hyperlink or defeated on the pageEnter.But instead of in load will be kept same above for the different pages are navigate in a manner of described in traditional network applicationThe page, and its content will be dynamically updated.This dynamic update can be reached in several different modes;It can be involvedSuch as web browser executes backstage HTTP and extracts to obtain new content, (via JavaScript code) updates the document of the pageObject model (DOM) and/or other technologies.The application frame that can be used for creating SPA is AngularJS.AngularJSIt is a kind of JavaScript frame.As exploitation AngularJS in application, developer creates according to the template instruction of AngularJSHtml template;Html template includes being embedded with AngularJS script and other AngularJS code constructions (such as guiding)HTML.At web browser, the library AngularJS JavaScript is loaded, and be interpreted to html template, so that instituteThe page is obtained to seem to operate as defined in a template and as defined in a template.The present invention withAngularJS frame is illustrated, it should be noted that present invention can also apply to have in other frames such as VUE, reactBody implementation is similar, and details are not described herein again.
In order to make it easy to understand, referring to Fig. 1, Fig. 1 is the application scenarios of the method for page management in the embodiment of the present inventionExplanation is unfolded below with reference to Fig. 1 in interface schematic diagram.
In Fig. 1, Main Viewport is homepage, has multiple pages cached to be known as at Main ViewportViewport, Main Viewport are the root node of dynamic page Viewport, and figure has been passed the imperial examinations at the provincial level Viewport-1, Viewport-These three pages of 2 and Viewport-3, being decorated with oblique line in page frame indicates that the page is in display state, does not draw oblique line expressionIn hidden state.The Viewport-3 page is in display in the region L1 of Fig. 1, and Viewport-1 and Viewport-2 are in hiddenHiding state;Viewport-2 is in display state in the L2 of region, and Viewport-1 and Viewport-3 are in hidden state.Fig. 1It indicates, when page switching, the page of display switches to Viewport-2 from Viewport-3, is switched in L1State is set hidden state by Viewport-3, at this time still in cache list, is in cache list in L1Its hiding state is changed to display state and shown, as indicated by l 2 by Viewport-2.
Implementation process of the invention is referring to Fig. 2, Fig. 2 is the application scenarios of the method for page management in the embodiment of the present inventionFlow diagram.
In step S1, hashchange event is monitored, the browser that operation has the SPA to apply is due to being operate inIn AngularJS frame, therefore has the function of monitoring event, monitoring hashchange event, which is worked as, listens to hash (hash) valueWhen changing, mapping relations will be established between the URL (uniform resource locator) and dynamic page viewport of the browser,The mapping ruler includes establishing to contact between URL and corresponding JS file and viewport;
In step S2, viewportchange event is monitored, which monitors viewportchange event, work as URLWhen changing, corresponding JS file changes, and associated viewport is caused to change.It will be changedViewport is named as targetviewport (target viewport), and not changed viewport is named asCurrviewport (current viewport);
In step S3, targetviewport is judged whether in cacheviewports, which judgesTargetviewport, that is, target viewport whether in cacheviewports, that is, page buffer queue, ifTargetviewport then enters step S4 in cacheviewports, if targetviewport does not existS7 is then entered step in cacheviewports;
In step S4, currviewport, after targetviewport is in cacheviewports, the browsing are hiddenDevice can hide current page currviewport, i.e. currviewport uses pattern " display:none ";
In step S5, show that targetviewport, targetviewport delete pattern " display:none ", i.e., it is aobviousShow targetviewport, wherein it should be noted that step S4 can be first carried out or first carry out step S5, not to stepExecution sequence between S4 and step S5 is defined;
In step S6, targetviewport is updated to cacheviewports tail of the queue, display is worked asAfter targetviewport, which is updated to targetviewport at the end of buffer queue cacheviewportsEnd, i.e. tail of the queue;
In step S7, targetviewport is added to cacheviewports tail of the queue, if targetviewport is notIn cacheviewports, which targetviewport is added to the end of buffer queue cacheviewportsEnd, i.e. tail of the queue;
In step S8, currviewport is hidden, which can hide current page currviewport, i.e.,Currviewport uses pattern " display:none ";
In step S9, show that targetviewport, targetviewport delete pattern " display:none ", i.e., it is aobviousShow targetviewport, wherein it should be noted that step S8 can be first carried out or first carry out step S9, not to stepExecution sequence between S8 and step S9 is defined;
In step S10, page remover is triggered, when the browser hides currviewport and displayAfter targetviewport, page remover can be triggered, which is to remove expired cache object in buffer queueRemover, and count down time is set, which is known as being spaced runing time intervalTime, which removesDevice is also known as JS timer, can realize that code is as follows with this section of JS code: " setInterval (code, millisec,lang)";
In step S11, intervalTime is waited, the timing of countdown is started, and this section is waited to be spaced runing timeThe end of intervalTime, general this section of count down time are set as 5 seconds;
In step S12, judge whether cacheviewports number of members is greater than maxcachecount, which existsAfter intervalTime countdown, judge whether the number of members of buffer queue cacheviewports is greater than buffer queueGreatest member's quantity maxcachecount is allowed, if the number of members of buffer queue cacheviewports is greater than caching teamArrange allow greatest member's quantity maxcachecount, then enter step S13, if buffer queue cacheviewports atMember's quantity is less than or equal to buffer queue and allows greatest member's quantity maxcachecount, then enters step S11, again etc.To intervalTime;
In step S13, n viewports is deleted from the queue head of cacheviewports, works as buffer queueWhen the number of members of cacheviewports allows greatest member's quantity maxcachecount greater than buffer queue, the browsingN viewports is deleted in the position that device is least commonly used from the queue head of buffer queue cacheviewports and recently,The current number of members that the number n of deletion is buffer queue cacheviewports subtracts buffer queue and allows greatest memberQuantity maxcachecount executes the intervalTime of step S11 waiting next time after deleting successfully.
The method of page management in the present invention is introduced below, referring to Fig. 3, Fig. 3 is page in the embodiment of the present inventionOne embodiment schematic diagram of the method for facial canal reason, comprising:
101, page switching request is received;
In the present embodiment, browser receives page switching request, and page switching request includes from graphical interaction interface GUIMiddle reception further includes receiving from Command Line Interface, and herein without limitation, the browser that operation has the SPA to apply is due to being operate inIn AngularJS frame, when listening to hash (hash) value and changing, it is known as receiving page switching request, the hashIt is worth changed process and is known as page switching request;
102, it is requested according to page switching, obtains the first page and second page to be shown currently shown;
In the present embodiment, browser is requested according to the page switching received, which monitors viewportchangeEvent, since the page is there are corresponding JS file, when listening to JS file and changing, the JS file of the variation is correspondingThe page be second page to be shown, the corresponding page of not changed JS file is the page first currently shown at this timeThe page, first page and second page are the page of the carry to root node.
103, judge that second page whether there is in buffer queue;
In the present embodiment, browser is judged with the presence or absence of second page in buffer queue, and the method for judgement is included in slowIt deposits and searches whether to exist in queue to associated mark, or whether search in the corresponding file of second page has label to be present inThe mark of buffer queue, herein without limitation.
If 104, second page is present in buffer queue, first page is hidden;
In the present embodiment, if browser judges that there are second pages in current cache queue, hide first page, hideMethod be included in the corresponding JS file of current first page and use pattern " display:none " or in current first pageIt is middle to use pattern " display:none ", herein without limitation.
105, it shows second page, and second page is updated to buffer queue;
In the present embodiment, after concealing first page, not shown second page before display, the method for display includesIt deletes the pattern " display:none " in the corresponding JS file of current second page or deletes pattern in current second pageThen second page is updated to the tail of the queue of buffer queue by " display:none ".
In the embodiment of the present invention, a kind of method of page management is provided, firstly, browser receives page switching request,Then, it is requested according to page switching, obtains the first page and second page to be shown that currently show, again, judge theTwo pages whether there is in buffer queue, if second page is present in buffer queue, hide first page, finally, display theTwo pages, and second page is updated to buffer queue.By the above-mentioned means, the page and page to be shown due to currently showingFace is all in buffer queue, and carry is in root node, when user needs when several pages toggle, is not required toThe page is regenerated, the used time of displayed page is reduced, improves operational efficiency.
Optionally, on the basis of Fig. 3 corresponding embodiment, the method for second of reading data provided in an embodiment of the present inventionEmbodiment in, judge second page whether there is after buffer queue, method further include:
If second page is not present in buffer queue, first page is hidden;
Second page is added to buffer queue;
Show second page.
In the present embodiment, when browser judges that second page is not present with buffer queue, first page is hidden, is hiddenMethod be included in first page using pattern " display:none ";Then second page is added in buffer queue,The mode of addition includes the mark added the mark of second page into buffer queue or add buffer queue in second page,Herein without limitation, finally show that second page, the mode of display include: to delete pattern " display:none ".
Wherein, the step of the step of hiding first page is added to buffer queue, shows second page with by second pageThere is no the limitation in timing, both second page first can be added to buffer queue, shows second page, then hide first pageFace can also first hide first page, then second page is added to buffer queue, show second page, herein without limitation.
In the embodiment of the present invention, when second page is not present in buffer queue, first page is hidden, it can be by secondThe page is added in buffer queue shows second page again, provides one kind when second page is not present with buffer queue, showsThe method for showing second page improves the realization flexibility of scheme.
Optionally, on the basis of above-mentioned Fig. 3 corresponding embodiment, the method for reading data provided in an embodiment of the present inventionThird embodiment in, show second page after, method further include:
Page remover is triggered, page remover is for removing the page cached in buffer queue;
When reaching preset runing time, judging whether the page quantity cached in current cache queue is greater than maximum canThe page quantity of caching;
If the page quantity cached in current cache queue is greater than maximum cacheable page quantity, buffer queue is deletedThe n earliest page of middle cache-time, n are the quantity beyond maximum cacheable page quantity.
In the present embodiment, after showing second page, page remover is triggered, which is to remove caching teamThe remover of expired cache object in column, the page remover are also known as JS timer, can realize code with this section of JS codeIt is as follows: " setInterval (code, millisec, lang) ", and set preset runing time, when reaching preset operationWhen the time, judge whether the page quantity cached in current cache queue is greater than maximum cacheable page quantity, if more than mostThe page quantity being changed to greatly, then the browser is that the position being least commonly used recently is deleted from the queue head of buffer queueThe n caching page, the number n of deletion are that the current number of members of buffer queue subtracts the permissible greatest member's number of buffer queueAmount.
In the embodiment of the present invention, a kind of page remover is proposed, when browser detects the caching page in cache listWhen face number is greater than maximum cacheable page quantity, least often make recently to remove the queue head in cache list i.e.The n caching page is deleted in position, and the number n of deletion, which subtracts buffer queue for the current number of members of buffer queue, to be permittedPerhaps greatest member's quantity.By removing the expired caching page in buffer queue in time, buffer queue is enabled to cache needsThe page of caching, the realizability of the scheme of promotion.
Optionally, on the basis of above-mentioned Fig. 3 corresponding embodiment, the method for reading data provided in an embodiment of the present inventionThe 4th embodiment in, judge whether the page quantity cached in current cache queue is greater than maximum cacheable page quantityLater, method further include:
If the page quantity cached in current cache queue is less than or equal to maximum cacheable page quantity, page is closedFace remover.
In the present embodiment, when browser detects that the caching number of pages in cache list is less than or equal to maximum and can cachePage quantity when, close page remover, wait next time start page remover, or keep page remover startingState, equity are reset to runing time, to wait the operation next time page to remove business.
In the embodiment of the present invention, provide when the caching number of pages that browser detects in cache list is less than or equal toWhen maximum cacheable page quantity, the method how page remover works increases the realization flexibility of scheme.
Optionally, on the basis of any one of corresponding first to fourth embodiment of above-mentioned Fig. 3, the embodiment of the present inventionIt in the 5th alternative embodiment of method of the reading data of offer, is requested according to page switching, obtains the first page currently shownFace and second page to be shown, comprising:
Monitor the first uniform resource position mark URL and the second uniform resource position mark URL;
When the first URL and the 2nd URL change, obtain the corresponding first page currently shown of the first URL andThe corresponding second page to be shown of 2nd URL.
In the present embodiment, the browser that operation has the SPA to apply has due to being operate in AngularJS frameThere is the function of monitoring event when listening to hash (hash) value and changing, will be established between the URL and the page of the browserMapping relations, which includes establishing to contact between URL and corresponding JS file and the page, right when URL changesThe JS file answered changes, and the associated page is caused to change.Therefore it when the first URL and the 2nd URL changes, obtainsTake the corresponding first page currently shown of the first URL and the corresponding second page to be shown of the 2nd URL.
In the embodiment of the present invention, propose it is a kind of distinguish first page and second page method, be by the first URL with2nd URL determines corresponding first page and second page, improves the feasibility of scheme.
Reading data device in the present invention is described in detail below, referring to Fig. 4, Fig. 4 is in the embodiment of the present inventionOne embodiment schematic diagram of page management device, one embodiment of page management device 20 provided in an embodiment of the present inventionIn;
Receiving module 201, for receiving page switching request;
Module 202 is obtained, for requesting according to page switching, obtains the first page currently shown and to be shown theTwo pages;
Judgment module 203, for judging that second page whether there is in buffer queue;
Hidden module 204 hides first page if being present in buffer queue for second page;
Update module 205 is updated to buffer queue for showing second page, and by second page.
In the present embodiment, receiving module 201, for receiving page switching request;Module 202 is obtained, for according to the pageSwitching request obtains the first page and second page to be shown currently shown;Judgment module 203, for judging secondThe page whether there is in buffer queue;Hidden module 204 hides first page if being present in buffer queue for second pageFace;Update module 205 is updated to buffer queue for showing second page, and by second page.
In the embodiment of the present invention, a kind of method of page management is provided, firstly, browser receives page switching request,Then, it is requested according to page switching, obtains the first page and second page to be shown that currently show, again, judge theTwo pages whether there is in buffer queue, if second page is present in buffer queue, hide first page, finally, display theTwo pages, and second page is updated to buffer queue.By the above-mentioned means, the page and page to be shown due to currently showingFace is all in buffer queue, and carry is in root node, when user needs when several pages toggle, is not required toThe page is regenerated, the used time of displayed page is reduced, improves operational efficiency.
Optionally, on the basis of above-mentioned Fig. 4 corresponding embodiment, referring to Fig. 5, the page provided in an embodiment of the present inventionIn second embodiment of managing device 20, the device of page management further includes adding module and display module;
Hidden module 204 hides first page if being also used to second page is not present in buffer queue;
Adding module 206, for second page to be added to buffer queue;
Display module 207, for showing second page.
In the embodiment of the present invention, when second page is not present in buffer queue, first page is hidden, it can be by secondThe page is added in buffer queue shows second page again, provides one kind when second page is not present with buffer queue, showsThe method for showing second page improves the realization flexibility of scheme.
Optionally, on the basis of above-mentioned Fig. 5 corresponding embodiment, Fig. 6 page provided in an embodiment of the present invention is please referred toIn the third embodiment of managing device 20, page management device further includes trigger module and removing module;
Trigger module 208, for triggering page remover, page remover is for removing the page cached in buffer queueFace;
Judgment module 203 is also used to when reaching preset runing time, judges the page cached in current cache queueWhether quantity is greater than maximum cacheable page quantity;
Removing module 209, if the page quantity for caching in current cache queue is greater than maximum cacheable page numberAmount, then delete the n earliest page of cache-time in buffer queue, and n is the quantity beyond maximum cacheable page quantity.
In the embodiment of the present invention, a kind of page remover is proposed, when browser detects the caching page in cache listWhen face number is greater than maximum cacheable page quantity, least often make recently to remove the queue head in cache list i.e.The n caching page is deleted in position, and the number n of deletion, which subtracts buffer queue for the current number of members of buffer queue, to be permittedPerhaps greatest member's quantity.By removing the expired caching page in buffer queue in time, buffer queue is enabled to cache needsThe page of caching, the realizability of the scheme of promotion.
Optionally, on the basis of above-mentioned Fig. 6 corresponding embodiment, Fig. 7 page provided in an embodiment of the present invention is please referred toIn 4th embodiment of managing device 20, page management device further includes closedown module;
Closedown module 210, if the page quantity for caching in current cache queue is cacheable less than or equal to maximumPage quantity then closes page remover.
In the embodiment of the present invention, provide when the caching number of pages that browser detects in cache list is less than or equal toWhen maximum cacheable page quantity, the method how page remover works increases the realization flexibility of scheme.
Optionally, any in first to the 4th embodiment of the corresponding page management device 20 of above-mentioned Fig. 4 to Fig. 7On the basis of, as shown in figure 8, in the 5th embodiment of page management device 20 provided in an embodiment of the present invention, page pipeReason device further includes monitoring module;
Module 211 is monitored, for monitoring the first uniform resource position mark URL and the second uniform resource position mark URL;
Module 202 is obtained, is also used to when the first URL and the 2nd URL changes, it is corresponding current to obtain the first URLThe first page of display and the corresponding second page to be shown of the 2nd URL.
In the embodiment of the present invention, propose it is a kind of distinguish first page and second page method, be by the first URL with2nd URL determines corresponding first page and second page, improves the feasibility of scheme.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided by the present invention, it should be understood that disclosed system, device and method can be withIt realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unitIt divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or componentsIt can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown orThe mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unitIt closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unitThe component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multipleIn network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unitIt is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated listMember both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent productWhen, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantiallyThe all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other wordsIt embodies, which is stored in a storage medium, including some instructions are used so that a computerEquipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the present inventionPortion or part steps.And storage medium above-mentioned include: USB flash disk, mobile hard disk, read-only memory (read-only memory,ROM), random access memory (random access memory, RAM), magnetic or disk etc. are various can store programThe medium of code.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to beforeStating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to precedingTechnical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And theseIt modifies or replaces, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.

Claims (10)

Translated fromChinese
1.一种页面管理的方法,其特征在于,包括:1. a method for page management, characterized in that, comprising:接收页面切换请求;Receive page switching requests;根据所述页面切换请求,获取当前显示的第一页面以及待显示的第二页面;obtaining the currently displayed first page and the second to-be-displayed page according to the page switching request;判断所述第二页面是否存在于缓存队列;judging whether the second page exists in the cache queue;若所述第二页面存在于所述缓存队列,则隐藏所述第一页面;If the second page exists in the cache queue, hiding the first page;显示所述第二页面,并将所述第二页面更新至所述缓存队列。The second page is displayed, and the second page is updated to the cache queue.2.根据权利要求1所述的方法,其特征在于,所述判断所述第二页面是否存在于缓存队列之后,所述方法还包括:2. The method according to claim 1, wherein after determining whether the second page exists in the cache queue, the method further comprises:若所述第二页面不存在于所述缓存队列,则隐藏所述第一页面;If the second page does not exist in the cache queue, hiding the first page;将所述第二页面添加至所述缓存队列;adding the second page to the cache queue;显示所述第二页面。The second page is displayed.3.根据权利要求2所述的方法,其特征在于,所述显示所述第二页面之后,所述方法还包括:3. The method according to claim 2, wherein after the displaying the second page, the method further comprises:触发页面清除器,所述页面清除器用于清除所述缓存队列中缓存的页面;Triggering a page cleaner, the page cleaner is used to remove cached pages in the cache queue;当达到预设的运行时间时,判断当前所述缓存队列中缓存的页面数量是否大于最大可缓存的页面数量;When the preset running time is reached, determine whether the number of pages cached in the current cache queue is greater than the maximum number of pages that can be cached;若当前所述缓存队列中所述缓存的页面数量大于所述最大可缓存的页面数量,则删除所述缓存队列中缓存时间最早的n个页面,所述n为超出所述最大可缓存的页面数量的数量。If the number of cached pages in the current cache queue is greater than the maximum number of pages that can be cached, delete the n pages with the earliest cache time in the cache queue, where n is the page exceeding the maximum cacheable page quantity of quantity.4.根据权利要求3所述的方法,其特征在于,所述判断当前所述缓存队列中缓存的页面数量是否大于最大可缓存的页面数量之后,所述方法还包括:4. The method according to claim 3, wherein after judging whether the number of pages cached in the current cache queue is greater than the maximum number of pages that can be cached, the method further comprises:若当前所述缓存队列中缓存的页面数量小于或等于最大可缓存的页面数量,则关闭所述页面清除器。If the number of pages currently cached in the cache queue is less than or equal to the maximum number of pages that can be cached, the page cleaner is closed.5.根据权利要求1至4中任一项所述的方法,其特征在于,所述根据所述页面切换请求,获取当前显示的第一页面以及待显示的第二页面,包括:5. The method according to any one of claims 1 to 4, wherein the obtaining the currently displayed first page and the to-be-displayed second page according to the page switching request comprises:监听第一统一资源定位符URL以及第二统一资源定位符URL;monitor the first uniform resource locator URL and the second uniform resource locator URL;当所述第一URL与所述第二URL发生变化时,获取所述第一URL对应的当前显示的第一页面以及所述第二URL对应的待显示的第二页面。When the first URL and the second URL change, the currently displayed first page corresponding to the first URL and the to-be-displayed second page corresponding to the second URL are acquired.6.一种页面管理的装置,其特征在于,6. A device for page management, characterized in that,接收模块,用于接收页面切换请求;The receiving module is used to receive the page switching request;获取模块,用于根据所述页面切换请求,获取当前显示的第一页面以及待显示的第二页面;an obtaining module, configured to obtain the currently displayed first page and the second to-be-displayed page according to the page switching request;判断模块,用于判断所述第二页面是否存在于缓存队列;a judging module for judging whether the second page exists in the cache queue;隐藏模块,用于若所述第二页面存在于所述缓存队列,则隐藏所述第一页面;a hiding module, configured to hide the first page if the second page exists in the cache queue;更新模块,用于显示所述第二页面,并将所述第二页面更新至所述缓存队列。An update module, configured to display the second page, and update the second page to the cache queue.7.根据权利要求6所述的页面管理的装置,其特征在于,所述页面管理的装置还包括添加模块以及显示模块;7. The device for page management according to claim 6, wherein the device for page management further comprises an adding module and a display module;所述隐藏模块,还用于若所述第二页面不存在于所述缓存队列,则隐藏所述第一页面;The hiding module is further configured to hide the first page if the second page does not exist in the cache queue;所述添加模块,用于将所述第二页面添加至所述缓存队列;the adding module, configured to add the second page to the cache queue;所述显示模块,用于显示所述第二页面。The display module is used for displaying the second page.8.根据权利要求7所述的页面管理的装置,其特征在于,所述页面管理装置还包括触发模块以及删除模块;8. The device for page management according to claim 7, wherein the device for page management further comprises a trigger module and a deletion module;所述触发模块,用于触发页面清除器,所述页面清除器用于清除所述缓存队列中缓存的页面;The triggering module is used to trigger a page cleaner, and the page cleaner is used to remove the pages cached in the cache queue;所述判断模块,还用于当达到预设的运行时间时,判断当前所述缓存队列中缓存的页面数量是否大于最大可缓存的页面数量;The judging module is further configured to judge whether the number of pages cached in the current cache queue is greater than the maximum number of pages that can be cached when the preset running time is reached;所述删除模块,用于若当前所述缓存队列中所述缓存的页面数量大于所述最大可缓存的页面数量,则删除所述缓存队列中缓存时间最早的n个页面,所述n为超出所述最大可缓存的页面数量的数量。The deletion module is configured to delete the n pages with the earliest cache time in the cache queue if the number of the cached pages in the current cache queue is greater than the maximum number of pages that can be cached, where n is the excess number of pages. The number of the maximum cacheable pages.9.根据权利要求8所述的页面管理的装置,其特征在于,所述页面管理装置还包括关闭模块;9. The device for page management according to claim 8, wherein the device for page management further comprises a closing module;所述关闭模块,用于若当前所述缓存队列中缓存的页面数量小于或等于最大可缓存的页面数量,则关闭所述页面清除器。The closing module is configured to close the page cleaner if the number of pages currently cached in the cache queue is less than or equal to the maximum number of pages that can be cached.10.根据权利要求6至9中任一项所述的页面管理的装置,其特征在于,所述页面管理装置还包括监听模块;10. The device for page management according to any one of claims 6 to 9, wherein the device for page management further comprises a monitoring module;所述监听模块,用于监听第一统一资源定位符URL以及第二统一资源定位符URL;The monitoring module is used to monitor the first uniform resource locator URL and the second uniform resource locator URL;所述获取模块,还用于当所述第一URL与所述第二URL发生变化时,获取所述第一URL对应的当前显示的第一页面以及所述第二URL对应的待显示的第二页面。The obtaining module is further configured to obtain the currently displayed first page corresponding to the first URL and the to-be-displayed first page corresponding to the second URL when the first URL and the second URL change. Two pages.
CN201810956429.6A2018-08-212018-08-21 A kind of page management method and related devicePendingCN109325190A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201810956429.6ACN109325190A (en)2018-08-212018-08-21 A kind of page management method and related device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201810956429.6ACN109325190A (en)2018-08-212018-08-21 A kind of page management method and related device

Publications (1)

Publication NumberPublication Date
CN109325190Atrue CN109325190A (en)2019-02-12

Family

ID=65264509

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201810956429.6APendingCN109325190A (en)2018-08-212018-08-21 A kind of page management method and related device

Country Status (1)

CountryLink
CN (1)CN109325190A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111966938A (en)*2020-09-112020-11-20苏州浪潮智能科技有限公司Configuration method and system for realizing loading speed improvement of front-end page of cloud platform

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101763267A (en)*2010-01-212010-06-30深圳市同洲电子股份有限公司Method for realizing embedded browser, device therefor and digital television receiving terminal
CN103051684A (en)*2012-12-072013-04-17百度在线网络技术(北京)有限公司Method, system and device for converting website into Web App for displaying
CN106886538A (en)*2015-12-162017-06-23阿里巴巴集团控股有限公司The method and device of business object information is provided
CN108255890A (en)*2016-12-292018-07-06腾讯科技(深圳)有限公司The treating method and apparatus of the page

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101763267A (en)*2010-01-212010-06-30深圳市同洲电子股份有限公司Method for realizing embedded browser, device therefor and digital television receiving terminal
CN103051684A (en)*2012-12-072013-04-17百度在线网络技术(北京)有限公司Method, system and device for converting website into Web App for displaying
CN106886538A (en)*2015-12-162017-06-23阿里巴巴集团控股有限公司The method and device of business object information is provided
CN108255890A (en)*2016-12-292018-07-06腾讯科技(深圳)有限公司The treating method and apparatus of the page

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111966938A (en)*2020-09-112020-11-20苏州浪潮智能科技有限公司Configuration method and system for realizing loading speed improvement of front-end page of cloud platform
CN111966938B (en)*2020-09-112022-06-14苏州浪潮智能科技有限公司Configuration method and system for realizing loading speed improvement of front-end page of cloud platform

Similar Documents

PublicationPublication DateTitle
US8612418B2 (en)Mobile web browser for pre-loading web pages
US10783211B2 (en)Page processing method and device thereof
US10015226B2 (en)Methods for making AJAX web applications bookmarkable and crawlable and devices thereof
AU2011101576A4 (en)Method and systems for generating and displaying a preview image of a content area
US9479564B2 (en)Browsing session metric creation
US20140143644A1 (en)Web browser page transition acceleration
US20080301300A1 (en)Predictive asynchronous web pre-fetch
US20170323025A1 (en)Browser acceleration method and browser device having accelerator
CN104423991B (en)Webpage, the method and device that web data is provided are loaded in mobile terminal
WO2014134934A1 (en)Method and system for displaying customized webpage on double webview
JP2017501512A (en) Judging web page processing status
CN102902799A (en)Browser page display method and device based on WebKit
US9454618B1 (en)Intelligent rendering of webpages
US8788927B2 (en)System and method for displaying web page content
CN104050253B (en)A kind of web page display method and browser
CN104731817B (en)A kind of webpage exhibiting method and device
EvertsRules for mobile performance optimization
CN108038150B (en)Webpage opening method and device and terminal equipment
CN109325190A (en) A kind of page management method and related device
CN110489683A (en)The caching method and device storage medium, computer equipment of webpage
CN110830537B (en)Page processing method and device
KR101132220B1 (en)Method, system and computer-readable recording medium for providing web page using cache
CN115935095A (en) Page generation method and device, electronic device, storage medium
LingBased on web application front-end performance optimization
CN113760281A (en)Transition animation realization method and device, terminal equipment and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20190212


[8]ページ先頭

©2009-2025 Movatter.jp