CN113868561A - Page preloading method and device, computer equipment and storage medium - Google Patents
Page preloading method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN113868561A CN113868561A CN202010615753.9A CN202010615753A CN113868561A CN 113868561 A CN113868561 A CN 113868561A CN 202010615753 A CN202010615753 A CN 202010615753A CN 113868561 A CN113868561 A CN 113868561A
- Authority
- CN
- China
- Prior art keywords
- frame
- click operation
- data
- page
- loaded
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9577—Optimising the visualization of content, e.g. distillation of HTML documents
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application relates to a page preloading method, a page preloading device, computer equipment and a storage medium. The method comprises the following steps: responding to the click operation, calling a frame generated by the frame data to be loaded to determine the data to be displayed corresponding to the click operation; acquiring an HTML page constructed according to data to be displayed and a page display template; and loading the HTML page in the frame, generating a webpage corresponding to the clicking operation and displaying the webpage. By adopting the method, the constructed HTML can be directly loaded in the frame, the data to be displayed does not need to be rendered again at the front end, and the existing frame is called to load the HTML page, so that the waiting time of the content to be loaded can be reduced, the opening speed of the webpage is accelerated, and the user can quickly see the content to be displayed.
Description
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method and an apparatus for preloading pages, a computer device, and a storage medium.
Background
With the development of internet technology and the wide application of mobile intelligent terminals in the work and life of people, more and more users access web pages by using the mobile intelligent terminals. Web page development technology has emerged to provide users with web pages that are richer in content and better in experience.
The existing webpage development scheme comprises a pure native development mode and a cross-platform development mode, wherein all pages are realized by native in the pure native development mode, and experience is smooth. The cross-platform development mode, namely the front terminal mixed mode, only one set of codes is needed at both ends, and the development cost is low.
However, in the current pure native development mode, two sets of codes need to be developed at two ends respectively, so that the development speed is low, the cost is high, asynchronous loading can only be realized at the front end in a cross-platform development mode, the experience feeling is not smooth enough, and more parts needing to be improved still exist in the development process. Therefore, the developed web page is opened very slowly due to many defects of the conventional web page development mode.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, a computer device and a storage medium for preloading a page, which can increase the opening speed of the page.
A method of page preloading, the method comprising:
responding to the click operation, and calling a frame generated by frame data to be loaded;
determining data to be displayed corresponding to the clicking operation;
acquiring an HTML page constructed according to the data to be displayed and a page display template;
and loading the HTML page in the frame, generating a webpage corresponding to the clicking operation and displaying the webpage.
A page preloading device, the device comprising:
the frame calling module is used for responding to the click operation and calling a frame generated by frame data to be loaded;
the data to be displayed determining module is used for determining the data to be displayed corresponding to the clicking operation;
the HTML page acquisition module is used for acquiring an HTML page constructed according to the data to be displayed and the page display template;
and the page loading module is used for loading the HTML page in the frame, generating a webpage corresponding to the clicking operation and displaying the webpage.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
responding to the click operation, and calling a frame generated by frame data to be loaded;
determining data to be displayed corresponding to the clicking operation;
acquiring an HTML page constructed according to the data to be displayed and a page display template;
and loading the HTML page in the frame, generating a webpage corresponding to the clicking operation and displaying the webpage.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
responding to the click operation, and calling a frame generated by frame data to be loaded;
determining data to be displayed corresponding to the clicking operation;
acquiring an HTML page constructed according to the data to be displayed and a page display template;
and loading the HTML page in the frame, generating a webpage corresponding to the clicking operation and displaying the webpage.
According to the page preloading method, the page preloading device, the computer equipment and the storage medium, the frame generated by the frame data to be loaded is called by responding to the click operation, and the data to be displayed corresponding to the click operation is determined. And then obtaining an HTML page constructed according to the data to be displayed and the page display template, loading the HTML page in the frame, generating a webpage corresponding to the click operation and displaying the webpage. The constructed HTML can be directly loaded in the frame, the data to be displayed does not need to be rendered again by the front end, and the existing frame is called to load the HTML page, so that the waiting time of the content to be loaded can be reduced, the opening speed of the webpage is accelerated, and the user can quickly see the content to be displayed.
Drawings
FIG. 1 is a diagram of an application environment for a method of page preloading in one embodiment;
FIG. 2 is a flowchart illustrating a method for preloading pages in an embodiment;
FIG. 3 is a diagram illustrating preloading of content to be displayed in a page loading method according to an embodiment;
FIG. 4 is a diagram illustrating an overall loading of a method for preloading pages in an embodiment;
FIG. 5 is a flowchart illustrating a page preloading method according to another embodiment;
FIG. 6 is a diagram illustrating a frame preload of a method for preloading pages in an embodiment;
FIG. 7 is a flowchart illustrating a page preloading method according to yet another embodiment;
FIG. 8 is a block diagram of a page preloading device in one embodiment;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The page preloading method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 responds to a click operation triggered by a user, calls a frame generated by frame data to be loaded from the server 104, determines data to be displayed corresponding to the click operation, and locally acquires an HTML page constructed according to the data to be displayed and a page display template. And then loading the HTML page in the frame, generating a webpage corresponding to the clicking operation and displaying the webpage on the display interface of the terminal 102. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In an embodiment, as shown in fig. 2, a page preloading method is provided, which is described by taking the application of the method to the terminal in fig. 1 as an example, and includes the following steps:
step S202, responding to the click operation, and calling the frame generated by the frame data to be loaded.
Specifically, a user can click a certain news, short video, small video or advertisement and the like in the main timeline of the information stream, and the terminal calls a frame generated according to frame data to be loaded by detecting and responding to the click operation of the user.
Wherein, the information stream, i.e. Feed stream, represents an interface for receiving the information source update in the simple information subscription process, and is generally used for news and other ordered websites, such as blogs, etc. In particular, the information flow is a combination of several message sources to which a user actively subscribes to form a content aggregator, which may be understood as a data form that continuously provides content to the user, which may be actively subscribed to by the user and provided to the user.
Furthermore, the presentation form of the information stream mainly includes timeline and rank, where timeline is a typical information stream presentation mode, and presents the content to the user according to the time sequence of updating the content of the information stream. And rank represents the weight of the content calculated according to some factors, so as to determine the sequence of content display.
In one embodiment, when a user clicks a certain news in the main timeline of the information stream, the frame generated by the frame data to be loaded is called. And if the current click operation aiming at the news is not the first operation, the called frame is a newly-built frame used for the current click operation in the last click operation, and corresponding frame data does not need to be loaded in real time to obtain the frame.
And step S204, determining the data to be displayed corresponding to the clicking operation.
Specifically, when the click operation of the user on the main time line of the information stream is detected, data sent by the main time line of the information stream needs to be acquired, and the data is determined to be to-be-displayed data corresponding to the click operation.
And step S206, acquiring an HTML page constructed according to the data to be displayed and the page display template.
Specifically, the operation steps of constructing the data to be displayed and the page display template to obtain the HTML page are carried out at a local native without rendering the data to be displayed again at the front end. The local native acquires the page display template, acquires the page structure of the page display template, determines the placeholder to be replaced according to the page structure, and replaces the placeholder with the data to be displayed, so that the HTML page carrying the data to be displayed can be constructed.
The native APP development mode represents that different languages and frames are adopted for developing different mobile phone operating systems such as IOS and Android, the mode is generally composed of two parts of cloud server data and an APP application client, and all UI elements, data contents and logic frames in an application program are installed on a mobile phone terminal. Specifically, in this embodiment, the operation of constructing the HTML page for the data to be displayed and the page display template is implemented based on the native APP development mode.
Furthermore, styles and page structures are predefined for the page display template, and the page structure of the page display template is obtained by loading the page display template, so that placeholders which can be replaced by data in the page display template can be determined according to the page structure. And then the placeholders in the page display panel are replaced by the data to be displayed, the HTML structure carrying the data to be displayed is obtained by splicing, and the generated HTML structure is dynamically added to the page to obtain the HTML page.
And S208, loading the HTML page in the frame, generating and displaying the webpage corresponding to the clicking operation.
Specifically, the webpage view of the frame is called, the HTML page is loaded in the frame, the rendered webpage view is obtained, the rendered webpage view is called and loaded, and the webpage corresponding to the clicking operation is generated and displayed.
The webpage view, namely webview, is a control for displaying a webpage in an android system, belongs to a part of a frame for displaying the webpage, and can realize displaying and rendering the webpage and interact with a webpage JavaScript, thereby realizing mixed development.
Further, as shown in fig. 3, fig. 3 provides a pre-loading schematic diagram of the content to be presented of the page loading method. Referring to fig. 3, the main timeline of the information stream issues data to be displayed, and loads an HTML page obtained by fusing the data to be displayed and a page display template with local native development in a called front-end loaded frame, so that the front end can directly load a corresponding HTML page without rendering again by the front end.
In one embodiment, as shown in fig. 4, an overall loading schematic diagram of a page preloading method is provided, and referring to fig. 4, the page preloading method includes a frame preloading part 402 and a to-be-presented data preloading part 404. For the same webpage, when the frame preloading part 402 is triggered by the last click operation, a frame for the click operation is simultaneously loaded, and the to-be-displayed data preloading part 404 is obtained by splicing a page display template and the to-be-displayed data to obtain an HTML page and loading the HTML page in the frame.
Further, the conventional page load logic is: because the front-end development frame is asynchronous processing, the front-end asynchronously uses webview, the front-end renders the content to be loaded by using webview after asynchronous processing operation, and therefore, the frame and the content to be displayed have asynchronous operation, that is, the frame and the content to be displayed cannot be called and loaded immediately when a user clicks the information stream timeline, a page is generated and displayed by rendering the content at the terminal for the second time, and a long waiting process exists when the page is opened for the user.
Specifically, in this embodiment, the optimized page loading logic is: before the front end loads the content to be displayed by using the webview, the rendered webview is prepared in advance, the HTML page is obtained by splicing the page display template and the data to be displayed, when the front end needs to call the webview, the rendered webview can be directly called, and then the corresponding webpage can be directly loaded and displayed.
In the page preloading method, the frame generated by the frame data to be loaded is called by responding to the click operation, and the data to be displayed corresponding to the click operation is determined. And then obtaining an HTML page constructed according to the data to be displayed and the page display template, loading the HTML page in the frame, generating a webpage corresponding to the click operation and displaying the webpage. The constructed HTML can be directly loaded in the frame, the data to be displayed does not need to be rendered again by the front end, and the existing frame is called to load the HTML page, so that the waiting time of the content to be loaded can be reduced, the opening speed of the webpage is accelerated, and the user can quickly see the content to be displayed.
In an embodiment, as shown in fig. 5, another page preloading method is provided, which specifically includes the following steps:
step S502, the current click operation is monitored, and whether the current click operation is the first click operation or not is judged.
Specifically, before the click operation triggered by the user is responded, the current click operation triggered by the user is monitored, a historical click record is obtained, and whether the current click operation is the first click operation or not is judged based on the historical click record.
Further, based on the historical click record, it may be determined that the current click operation is a first click operation or a non-first click operation, and for the non-first click operation, that is, before the current click operation, there is a last click operation, and the last click operation may be the first click operation or the non-first click operation as well. Regardless of whether the last click operation is the first click operation or the non-first click operation, when the last click operation is responded, a frame for the current click operation is established and can be directly called for the current click operation.
Step S504, when the first click operation is determined, frame data to be loaded corresponding to the current click operation is obtained.
Specifically, when the first click operation is determined, that is, no other click operation is performed before the current click operation, it indicates that a frame corresponding to the current click operation needs to be generated in real time for the current click operation, and a frame for the next click operation needs to be generated.
Step S506, calling available empty shells in the cache pool, loading frame data to be loaded, and generating a frame corresponding to the current click operation.
Specifically, as shown in fig. 6, fig. 6 provides a frame preloading schematic diagram of a page preloading method, and referring to fig. 6, before calling an available empty shell in a cache pool, loading frame data to be loaded, and generating a frame corresponding to a current click operation, it is determined whether an available empty shell exists in the cache pool. And when determining that the available empty shell exists in the cache pool, determining the available empty shell corresponding to the frame data to be loaded, calling the determined available empty shell corresponding to the frame data to be loaded, loading the frame data to be loaded, and generating a frame corresponding to the current click operation. The shell represents a blank frame which does not contain any data, and the frame carrying the frame data to be loaded can be generated by loading corresponding frame data by using the shell and corresponds to the click operation.
Further, referring to fig. 6, when it is determined that there is no available empty shell in the cache pool, an available empty shell corresponding to the frame data to be loaded is newly created. The cache pool is not provided with an available empty shell, which is to be understood as that no available empty shell exists in the cache pool, or an available empty shell which can be used for loading the frame data to be loaded currently does not exist in the cache pool.
In the embodiment, by monitoring the current click operation and judging whether the current click operation is the first click operation, when the first click operation is determined, the frame data to be loaded corresponding to the current click operation is acquired, the available empty shell in the cache pool is called, the frame data to be loaded is loaded, and the frame corresponding to the current click operation is generated, so that the frame corresponding to the first click operation can be generated for the use at the time of the first click operation, and when the non-first click operation is determined, the frame generated according to the frame data to be loaded can be directly called, the waiting time for page loading is reduced, and the user can see the content to be displayed more quickly.
In one embodiment, after calling an available empty shell in the cache pool, loading frame data to be loaded, and generating a frame corresponding to a current click operation, the method further includes:
newly building an available empty shell for next click operation in advance;
and according to the available empty shell for the next click operation and the frame data to be loaded, a frame to be called for the next click operation is newly built in advance.
Specifically, when it is detected that the user clicks one of the news items in the main timeline of the information stream, whether an available empty shell exists or not is detected, the available empty shell which can be directly provided for the next click operation is created in advance. The front-end framework is asynchronous, so that when the front end implements optimization, the content can not be immediately displayed at the next frame clicked by a user, and therefore, when the user clicks the previous time, an available empty shell for the next click operation is simultaneously established, the asynchronous hiding is realized in the process of opening the landing page at the last time, and when the user responds to the next click operation, the rendered page can be directly used for displaying.
Further, after an available shell for the next click operation is newly built in advance, a frame to be called for the next click operation can be newly built in advance according to the available shell for the next click operation and the frame data to be loaded. It can be understood that the frame to be called for the next click operation newly built in advance can be directly called and used for loading the HTML page constructed according to the data to be displayed and the page display template when the next click operation is detected.
In this embodiment, after the available empty shell in the cache pool is called and the frame data to be loaded is loaded, and the frame corresponding to the current click operation is generated, an available empty shell for the next click operation is newly created in advance, and the frame to be called for the next click operation is newly created in advance according to the available empty shell for the next click operation and the frame data to be loaded. The method and the device have the advantages that the frame to be called for the next click operation is newly built in advance, so that the newly built frame to be called can be directly called when the next click operation is responded, the generated frame does not need to be loaded in real time, the waiting time for opening the page is shortened, and the page opening speed is increased.
In an embodiment, as shown in fig. 7, a page preloading method is provided, which specifically includes the following steps:
1) and monitoring the current click operation, and judging whether the current click operation is the first click operation.
Specifically, before the click operation triggered by the user is responded, the current click operation triggered by the user is monitored, a historical click record is obtained, and whether the current click operation is the first click operation or not is judged based on the historical click record.
2) And when the first click operation is determined, acquiring the frame data to be loaded corresponding to the current click operation.
Specifically, when the first click operation is determined, that is, no other click operation is performed before the current click operation, it indicates that a frame corresponding to the current click operation needs to be generated in real time for the current click operation, and a frame for the next click operation needs to be generated.
3) And judging whether available empty shells exist in the cache pool.
4) And when determining that the available empty shell exists in the cache pool, determining the available empty shell corresponding to the frame data to be loaded.
5) And when determining that the available empty shell does not exist in the cache pool, newly building an available empty shell corresponding to the frame data to be loaded.
Specifically, the empty shell represents a blank frame not containing any data, when it is determined that no available empty shell exists in the cache pool, an available empty shell corresponding to the frame data to be loaded is newly created, the frame carrying the frame data to be loaded can be generated by loading the corresponding frame data by using the empty shell, and the frame carrying the frame data to be loaded corresponds to the click operation.
6) And calling available empty shells in the cache pool, loading frame data to be loaded, and generating a frame corresponding to the current click operation.
7) And newly building an available empty shell for the next click operation in advance.
Specifically, when it is detected that the user clicks one of the news items in the main timeline of the information stream, whether an available empty shell exists or not is detected, the available empty shell which can be directly provided for the next click operation is created in advance.
8) And according to the available empty shell for the next click operation and the frame data to be loaded, a frame to be called for the next click operation is newly built in advance.
Specifically, after an available shell for the next click operation is newly created in advance, a frame to be invoked for the next click operation can be further newly created in advance according to the available shell for the next click operation and frame data to be loaded. The frame to be called for the next click operation newly built in advance can be directly called and used for loading the HTML page constructed according to the data to be displayed and the page display template when the next click operation is detected.
9) And responding to the click operation, and calling the frame generated by the frame data to be loaded.
Specifically, a user can click a certain news, short video, small video or advertisement and the like in the main timeline of the information stream, and the terminal calls a frame generated according to frame data to be loaded by detecting and responding to the click operation of the user.
10) And when the current click operation is determined to be the non-first click operation, calling the newly-built frame to be called during the last click operation.
Specifically, when it is determined that the current click operation is a non-first click operation, it indicates that, in the last click operation, an available empty shell for a next click operation has been created in advance, and according to the available empty shell for the next click operation and frame data to be loaded, a frame to be invoked for the next click operation has been created in advance.
11) And determining the data to be displayed corresponding to the clicking operation.
12) And acquiring an HTML page constructed according to the data to be displayed and the page display template.
Specifically, the method for constructing the obtained HTML page according to the data to be displayed and the page display template includes: the HTML page carrying the data to be displayed can be constructed and obtained by obtaining the page display template, obtaining the page structure of the page display template, determining the placeholder to be replaced according to the page structure and replacing the placeholder with the data to be displayed.
13) And loading the HTML page according to the webpage view of the frame to obtain the rendered webpage view.
Specifically, the webpage view is used as a control of the frame and used for realizing loading and displaying of the HTML page, and after the HTML page is loaded, the rendered webpage view can be obtained.
14) And calling and loading the rendered webpage view, generating and displaying a webpage corresponding to the clicking operation.
Specifically, the rendered webpage view can be directly called and loaded, and the webpage corresponding to the click operation can be generated without performing secondary rendering.
In this embodiment, by determining whether the current click operation is a first click operation, when the first click operation is determined, the available empty shell in the cache pool is called, the frame data to be loaded corresponding to the current click operation is loaded, the frame corresponding to the current click operation is obtained, and meanwhile, a new frame to be called for a next click operation is created in advance. And when the current clicking operation is determined to be the non-first clicking operation, directly calling a newly-built frame to be called of the last clicking operation. The method comprises the steps of loading an HTML page on a webpage view of a frame by constructing the HTML page according to data to be displayed and a page display template, obtaining a rendered webpage view, calling and loading the rendered webpage view, generating and displaying the webpage corresponding to a click operation. The constructed HTML can be directly loaded in the frame, the data to be displayed does not need to be rendered again at the front end, and the existing frame can be called to load the HTML page, so that the waiting time of the content to be loaded can be reduced, the opening speed of the webpage is accelerated, and the user can quickly see the content to be displayed.
It should be understood that although the steps in the flowcharts of fig. 2, 5 and 7 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2, 5 and 7 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 8, there is provided a page preloading device, which may be a part of a computer device using a software module or a hardware module, or a combination of the two modules, and specifically includes: a frame calling module 802, a to-be-displayed data determining module 804, an HTML page obtaining module 806, and a page loading module 808, wherein:
and the frame calling module 802 is configured to respond to a click operation and call a frame generated by frame data to be loaded.
And a to-be-displayed data determining module 804, configured to determine to-be-displayed data corresponding to the click operation.
And the HTML page obtaining module 806 is configured to obtain an HTML page constructed according to the data to be displayed and the page display template.
And the page loading module 808 is configured to load an HTML page in the frame, generate a web page corresponding to the click operation, and display the web page.
In the page preloading device, the frame generated by the frame data to be loaded is called by responding to the click operation, and the data to be displayed corresponding to the click operation is determined. And then obtaining an HTML page constructed according to the data to be displayed and the page display template, loading the HTML page in the frame, generating a webpage corresponding to the click operation and displaying the webpage. The constructed HTML can be directly loaded in the frame, the data to be displayed does not need to be rendered again by the front end, and the existing frame is called to load the HTML page, so that the waiting time of the content to be loaded can be reduced, the opening speed of the webpage is accelerated, and the user can quickly see the content to be displayed.
In one embodiment, a page preloading device is provided, which further includes:
and the current click operation monitoring module is used for monitoring the current click operation and judging whether the current click operation is the first click operation.
And the frame data to be loaded acquiring module is used for acquiring the frame data to be loaded corresponding to the current click operation when the first click operation is determined.
And the frame data loading module to be loaded is used for calling the available empty shell in the cache pool, loading the frame data to be loaded and generating a frame corresponding to the current click operation.
In the embodiment, by monitoring the current click operation and judging whether the current click operation is the first click operation, when the first click operation is determined, the frame data to be loaded corresponding to the current click operation is acquired, the available empty shell in the cache pool is called, the frame data to be loaded is loaded, and the frame corresponding to the current click operation is generated, so that the frame corresponding to the first click operation can be generated for the use at the time of the first click operation, and when the non-first click operation is determined, the frame generated according to the frame data to be loaded can be directly called, the waiting time for page loading is reduced, and the user can see the content to be displayed more quickly.
In one embodiment, a page preloading device is provided, which further includes:
and the available empty shell pre-building module is used for pre-building an available empty shell for next click operation.
And the frame new building module to be called is used for building a frame to be called for the next click operation in advance according to the available empty shell for the next click operation and the frame data to be loaded.
In this embodiment, after the available empty shell in the cache pool is called and the frame data to be loaded is loaded, and the frame corresponding to the current click operation is generated, an available empty shell for the next click operation is newly created in advance, and the frame to be called for the next click operation is newly created in advance according to the available empty shell for the next click operation and the frame data to be loaded. The method and the device have the advantages that the frame to be called for the next click operation is newly built in advance, so that the newly built frame to be called can be directly called when the next click operation is responded, the generated frame does not need to be loaded in real time, the waiting time for opening the page is shortened, and the page opening speed is increased.
In one embodiment, a page preloading device is provided, which further includes:
and the available empty shell judging module is used for judging whether available empty shells exist in the cache pool.
And the available empty shell determining module is used for determining an available empty shell corresponding to the frame data to be loaded when determining that the available empty shell exists in the cache pool.
And the available empty shell newly-building module is used for newly building an available empty shell corresponding to the frame data to be loaded when the buffer pool is determined not to have the available empty shell.
In one embodiment, a page preloading device is provided, which further includes an HTML page building module, configured to:
acquiring a page structure of a page display template; determining a placeholder to be replaced according to the page structure; and replacing the placeholder with the data to be displayed, and constructing and obtaining the HTML page carrying the data to be displayed.
In one embodiment, the page loading module is further to:
loading an HTML page according to the webpage view of the frame to obtain a rendered webpage view;
and calling and loading the rendered webpage view, generating and displaying a webpage corresponding to the clicking operation.
In one embodiment, another page preloading device is provided, which specifically includes:
and the current click operation monitoring module is used for monitoring the current click operation and judging whether the current click operation is the first click operation.
And the frame data to be loaded acquiring module is used for acquiring the frame data to be loaded corresponding to the current click operation when the first click operation is determined.
And the available empty shell judging module is used for judging whether available empty shells exist in the cache pool.
And the available empty shell determining module is used for determining an available empty shell corresponding to the frame data to be loaded when determining that the available empty shell exists in the cache pool.
And the available empty shell newly-building module is used for newly building an available empty shell corresponding to the frame data to be loaded when the buffer pool is determined not to have the available empty shell.
And the frame data loading module to be loaded is used for calling the available empty shell in the cache pool, loading the frame data to be loaded and generating a frame corresponding to the current click operation.
And the available empty shell pre-building module is used for pre-building an available empty shell for next click operation.
And the frame new building module to be called is used for building a frame to be called for the next click operation in advance according to the available empty shell for the next click operation and the frame data to be loaded.
And the first calling module is used for responding to the click operation and calling the frame generated by the frame data to be loaded.
And the second calling module is used for calling the newly-built frame to be called during the last click operation when the current click operation is determined to be the non-first click operation.
And the to-be-displayed data determining module is used for determining to-be-displayed data corresponding to the clicking operation.
And the HTML page acquisition module is used for acquiring the HTML page constructed according to the data to be displayed and the page display template.
And the webpage view rendering module is used for loading the HTML page according to the webpage view of the frame to obtain the rendered webpage view.
And the webpage display module is used for calling and loading the rendered webpage view, generating and displaying a webpage corresponding to the clicking operation.
In this embodiment, by determining whether the current click operation is a first click operation, when the first click operation is determined, the available empty shell in the cache pool is called, the frame data to be loaded corresponding to the current click operation is loaded, the frame corresponding to the current click operation is obtained, and meanwhile, a new frame to be called for a next click operation is created in advance. And when the current clicking operation is determined to be the non-first clicking operation, directly calling a newly-built frame to be called of the last clicking operation. The method comprises the steps of loading an HTML page on a webpage view of a frame by constructing the HTML page according to data to be displayed and a page display template, obtaining a rendered webpage view, calling and loading the rendered webpage view, generating and displaying the webpage corresponding to a click operation. The constructed HTML can be directly loaded in the frame, the data to be displayed does not need to be rendered again at the front end, and the existing frame can be called to load the HTML page, so that the waiting time of the content to be loaded can be reduced, the opening speed of the webpage is accelerated, and the user can quickly see the content to be displayed.
For the specific definition of the page preloading device, reference may be made to the above definition of the page preloading method, which is not described herein again. The various modules in the page preloading device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a page preloading method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components. The computer program constituted by the program modules causes the processor to execute the steps of the page preloading method of the embodiments of the present application described in the present specification.
In one embodiment, the page preloading device provided by the application can be implemented in a form of a computer program, and the computer program can be run on a computer device as shown in fig. 9. The memory of the computer device may store various program modules constituting the page preloading device, such as the frame calling module, the to-be-displayed data determining module, the HTML page acquiring module, and the page loading module shown in fig. 8.
In one embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the following steps when executing the computer program:
responding to the click operation, and calling a frame generated by frame data to be loaded;
determining data to be displayed corresponding to the clicking operation;
acquiring an HTML page constructed according to data to be displayed and a page display template;
and loading the HTML page in the frame, generating a webpage corresponding to the clicking operation and displaying the webpage.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
monitoring the current click operation and judging whether the current click operation is the first click operation;
when the first click operation is determined, acquiring frame data to be loaded corresponding to the current click operation;
and calling available empty shells in the cache pool, loading frame data to be loaded, and generating a frame corresponding to the current click operation.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
judging whether available empty shells exist in the cache pool or not;
when determining that available empty shells exist in the cache pool, determining the available empty shells corresponding to the frame data to be loaded;
and when determining that the available empty shell does not exist in the cache pool, newly building an available empty shell corresponding to the frame data to be loaded.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
loading an HTML page according to the webpage view of the frame to obtain a rendered webpage view;
and calling and loading the rendered webpage view, generating and displaying a webpage corresponding to the clicking operation.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and newly building an available empty shell for the next click operation in advance.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and according to the available empty shell for the next click operation and the frame data to be loaded, a frame to be called for the next click operation is newly built in advance.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a page structure of a page display template;
determining a placeholder to be replaced according to the page structure;
and replacing the placeholder with the data to be displayed, and constructing and obtaining the HTML page carrying the data to be displayed.
In one embodiment, a computer-readable storage medium is provided, storing a computer program that, when executed by a processor, performs the steps of:
responding to the click operation, and calling a frame generated by frame data to be loaded;
determining data to be displayed corresponding to the clicking operation;
acquiring an HTML page constructed according to data to be displayed and a page display template;
and loading the HTML page in the frame, generating a webpage corresponding to the clicking operation and displaying the webpage.
In one embodiment, the computer program when executed by the processor further performs the steps of:
monitoring the current click operation and judging whether the current click operation is the first click operation;
when the first click operation is determined, acquiring frame data to be loaded corresponding to the current click operation;
and calling available empty shells in the cache pool, loading frame data to be loaded, and generating a frame corresponding to the current click operation.
In one embodiment, the computer program when executed by the processor further performs the steps of:
judging whether available empty shells exist in the cache pool or not;
when determining that available empty shells exist in the cache pool, determining the available empty shells corresponding to the frame data to be loaded;
and when determining that the available empty shell does not exist in the cache pool, newly building an available empty shell corresponding to the frame data to be loaded.
In one embodiment, the computer program when executed by the processor further performs the steps of:
loading an HTML page according to the webpage view of the frame to obtain a rendered webpage view;
and calling and loading the rendered webpage view, generating and displaying a webpage corresponding to the clicking operation.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and newly building an available empty shell for the next click operation in advance.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and according to the available empty shell for the next click operation and the frame data to be loaded, a frame to be called for the next click operation is newly built in advance.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a page structure of a page display template;
determining a placeholder to be replaced according to the page structure;
and replacing the placeholder with the data to be displayed, and constructing and obtaining the HTML page carrying the data to be displayed.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps in the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A method for preloading pages is characterized by comprising the following steps:
responding to the click operation, and calling a frame generated by frame data to be loaded;
determining data to be displayed corresponding to the clicking operation;
acquiring an HTML page constructed according to the data to be displayed and a page display template;
and loading the HTML page in the frame, generating a webpage corresponding to the clicking operation and displaying the webpage.
2. The method according to claim 1, before the responding to the click operation, invoking a frame generated by frame data to be loaded, further comprising:
monitoring the current click operation and judging whether the current click operation is the first click operation or not;
when the first click operation is determined, acquiring frame data to be loaded corresponding to the current click operation;
and calling available empty shells in a cache pool, loading the frame data to be loaded, and generating a frame corresponding to the current click operation.
3. The method of claim 2, wherein before loading the frame data to be loaded in an available empty shell in the call cache pool and generating a frame corresponding to the current click operation, the method comprises:
judging whether available empty shells exist in the cache pool or not;
when determining that available empty shells exist in the cache pool, determining available empty shells corresponding to the frame data to be loaded;
and when determining that no available empty shell exists in the cache pool, newly building an available empty shell corresponding to the frame data to be loaded.
4. The method according to any one of claims 1 to 3, wherein the loading the HTML page in the frame, generating and displaying a webpage corresponding to the click operation comprises:
loading the HTML page according to the webpage view of the frame to obtain a rendered webpage view;
and calling and loading the rendered webpage view, generating and displaying a webpage corresponding to the clicking operation.
5. The method according to claim 2, wherein after calling an available empty shell in the cache pool, loading the frame data to be loaded, and generating a frame corresponding to the current click operation, further comprising:
and newly building an available empty shell for the next click operation in advance.
6. The method of claim 5, further comprising:
and according to the available empty shell for the next click operation and the frame data to be loaded, a frame to be called for the next click operation is newly built in advance.
7. The method according to any one of claims 1 to 3, wherein the method for constructing the obtained HTML page according to the data to be displayed and the page display template comprises:
acquiring a page structure of the page display template;
determining a placeholder to be replaced according to the page structure;
and replacing the placeholder with the data to be displayed to construct and obtain an HTML page carrying the data to be displayed.
8. A page preloading device, comprising:
the frame calling module is used for responding to the click operation and calling a frame generated by frame data to be loaded;
the data to be displayed determining module is used for determining the data to be displayed corresponding to the clicking operation;
the HTML page acquisition module is used for acquiring an HTML page constructed according to the data to be displayed and the page display template;
and the page loading module is used for loading the HTML page in the frame, generating a webpage corresponding to the clicking operation and displaying the webpage.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010615753.9A CN113868561A (en) | 2020-06-30 | 2020-06-30 | Page preloading method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010615753.9A CN113868561A (en) | 2020-06-30 | 2020-06-30 | Page preloading method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113868561A true CN113868561A (en) | 2021-12-31 |
Family
ID=78981508
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010615753.9A Pending CN113868561A (en) | 2020-06-30 | 2020-06-30 | Page preloading method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113868561A (en) |
-
2020
- 2020-06-30 CN CN202010615753.9A patent/CN113868561A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10877826B2 (en) | Message processing method and apparatus, storage medium, and computer device | |
US20190251143A1 (en) | Web page rendering method and related device | |
US8949739B2 (en) | Creating and maintaining images of browsed documents | |
US10303526B2 (en) | Device specific handling of user interface components | |
US20210216701A1 (en) | Method, apparatus, device and storage medium for determining page theme | |
CN109992715B (en) | Information display method, device, medium and computing equipment | |
US10951486B2 (en) | Terminal device, UI expansion method, and UI expansion program | |
CN115309470B (en) | Method, device, equipment and storage medium for loading widget | |
US20160255174A1 (en) | Data file and rule driven synchronous or asynchronous document generation | |
CN102449604B (en) | Distributed processing method and system in virtual desktop | |
CN111651700A (en) | Message display method and device, electronic equipment and storage medium | |
CN113660504A (en) | Message display method and device, electronic equipment and storage medium | |
CN115470432A (en) | Page rendering method and device, electronic equipment and computer readable medium | |
CN113553123B (en) | Data processing method, device, electronic equipment and storage medium | |
CN108400929B (en) | Data processing method, device, computing equipment and medium | |
US9704178B2 (en) | Customizable sequence of content | |
CN115630241A (en) | Page display method and device, electronic equipment and storage medium | |
CN113868561A (en) | Page preloading method and device, computer equipment and storage medium | |
CN114647411A (en) | Programming interface loading method and device, electronic equipment and storage medium | |
CN113342450A (en) | Page processing method and device, electronic equipment and computer readable medium | |
CN113656041A (en) | Data processing method, device, equipment and storage medium | |
CN112287261A (en) | Resource loading method and electronic equipment | |
CN114510309B (en) | Animation effect setting method, device, equipment and medium | |
US11902223B2 (en) | Intelligent assistant content generation | |
US20240220086A1 (en) | Information interaction method and apparatus, and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |