Page preloading method, device, computer device, and storage medium

The page preloading method addresses slow loading speeds by generating and loading HTML pages within a framework based on user clicks, reducing rendering time and improving user experience.

CN113868561BActive Publication Date: 2025-07-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010615753.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-30
Publication Date
2025-07-15
Estimated Expiration
2040-06-30

AI Technical Summary

Technical Problem

Under the existing web development mode, the web page opening speed is slow, the pure native development mode has high development costs and slow speed, while the experience is not smooth enough under the cross-platform development mode.

Method used

By responding to the click operation, the framework is called to generate the framework from the frame data to be loaded, the data to be displayed is determined, and the HTML page is built within the framework to reduce the front-end rendering time.

Benefits of technology

This speeds up the opening of web pages, allowing users to quickly see the content to be displayed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113868561B_ABST
    Figure CN113868561B_ABST
Patent Text Reader

Abstract

The present application relates to a page preloading method, apparatus, computer device, and storage medium. The method includes: responding to a click operation, calling a frame generated from frame data to be loaded to determine display data corresponding to the click operation; obtaining an HTML page constructed according to the display data and a page display template; loading the HTML page within the frame to generate a web page corresponding to the click operation and display it. By adopting this method, the constructed HTML can be directly loaded within the frame without the front end rendering the display data again. At the same time, an existing frame is called to load the HTML page, which can reduce the waiting time of the content to be loaded, thereby accelerating the opening speed of the web page and enabling the user to quickly view the content to be displayed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technologies, and particularly to a page preloading method, apparatus, computer device, and storage medium. Background Art

[0002] With the development of Internet technologies and the wide application of mobile intelligent terminals in people's work and life, more and more users access web pages by using mobile intelligent terminals. To provide web pages with richer content and better experience for users, web development technologies have emerged.

[0003] Existing web development solutions include pure native development mode and cross-platform development mode. Among them, in the pure native development mode, all pages are implemented natively, and the experience is relatively smooth. The cross-platform development method, that is, the front-end hybrid method, only requires a set of codes for both ends, and the development cost is relatively low.

[0004] However, in the current pure native development mode, since two sets of codes need to be developed separately for both ends, the development speed is slow and the cost is relatively high. In the cross-platform development method, the front-end can only achieve asynchronous loading, the experience is not smooth enough, and there are still many parts that need to be improved in the development process. Therefore, due to many defects still existing in the traditional web development mode, the opening speed of the developed web pages is very slow. Summary of the Invention

[0005] Based on this, in view of the above technical problems, it is necessary to provide a page preloading method, apparatus, computer device, and storage medium that can accelerate the opening speed of web pages.

[0006] A page preloading method, the method includes:

[0007] Respond to a click operation, and call a framework generated from framework data to be loaded;

[0008] Determine the data to be displayed corresponding to the click operation;

[0009] Obtain an HTML page constructed according to the data to be displayed and a page display template;

[0010] Load the HTML page within the framework, generate a web page corresponding to the click operation, and display it.

[0011] A page preloading apparatus, the apparatus includes:

[0012] A framework calling module, configured to respond to a click operation and call a framework generated from framework data to be loaded;

[0013] A data-to-be-displayed determining module, configured to determine the data to be displayed corresponding to the click operation;

[0014] An HTML page acquisition module, configured to acquire an HTML page constructed according to the data to be displayed and a page display template;

[0015] A page loading module, configured to load the HTML page within the frame, generate a web page corresponding to the click operation, and display it.

[0016] A computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the following steps are implemented:

[0017] In response to a click operation, call a frame generated from frame data to be loaded;

[0018] Determine the data to be displayed corresponding to the click operation;

[0019] Acquire an HTML page constructed according to the data to be displayed and a page display template;

[0020] Load the HTML page within the frame, generate a web page corresponding to the click operation, and display it.

[0021] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the following steps are implemented:

[0022] In response to a click operation, call a frame generated from frame data to be loaded;

[0023] Determine the data to be displayed corresponding to the click operation;

[0024] Acquire an HTML page constructed according to the data to be displayed and a page display template;

[0025] Load the HTML page within the frame, generate a web page corresponding to the click operation, and display it.

[0026] For the above page preloading method, device, computer device, and storage medium, by responding to a click operation, calling a frame generated from frame data to be loaded, and determining the data to be displayed corresponding to the click operation. Furthermore, an HTML page constructed according to the data to be displayed and a page display template is acquired, and the HTML page is loaded within the frame, generating a web page corresponding to the click operation and displaying it. Since the constructed HTML can be directly loaded within the frame without the need for the front end to render the data to be displayed again, and at the same time, an existing frame is called for loading the HTML page, the waiting time for the content to be loaded can be reduced, thereby accelerating the opening speed of the web page and enabling the user to quickly see the content to be displayed. Description of the Drawings

[0027] Figure 1 It is an application environment diagram of the page preloading method in an embodiment;

[0028] Figure 2 It is a schematic flowchart of the page preloading method in an embodiment;

[0029] Figure 3 It is a schematic diagram of preloading the content to be displayed of the page loading method in an embodiment;

[0030] Figure 4 It is an overall loading schematic diagram of the page preloading method in an embodiment;

[0031] Figure 5 It is a schematic flowchart of the page preloading method in another embodiment;

[0032] Figure 6 It is a schematic diagram of frame preloading of the page preloading method in an embodiment;

[0033] Figure 7 It is a schematic flowchart of the page preloading method in still another embodiment;

[0034] Figure 8 It is a structural block diagram of the page preloading device in an embodiment;

[0035] Figure 9 It is an internal structure diagram of a computer device in an embodiment. Detailed implementation manners

[0036] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0037] The page preloading method provided by the present application can be applied to an application environment as shown in Figure 1 . Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 responds to the click operation triggered by the user, and calls the frame generated from the frame data to be loaded from the server 104. By determining the data to be displayed corresponding to the click operation, and obtaining the HTML page constructed according to the data to be displayed and the page display template from the local. Then, the HTML page is loaded in the frame, and the web page corresponding to the click operation is generated and displayed on the display interface of the terminal 102. Among them, the terminal 102 can be but is not limited to various personal computers, laptop computers, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0038] In one embodiment, as Figure 2 shown, a page preloading method is provided. Taking the terminal in Figure 1 as an example, the method includes the following steps:

[0039] Step S202: Respond to the click operation and call the frame generated from the frame data to be loaded.

[0040] Specifically, the user can click on a piece of news, short video, small video, advertisement, etc. in the main timeline of the information stream. The terminal detects and responds to the user's click operation, and calls the frame generated according to the frame data to be loaded.

[0041] Among them, the information stream, i.e., the Feed stream, represents an interface used to receive updates from the information source during the simple information subscription process, and is usually used for news and other sequentially arranged websites, such as blogs. Specifically, the information stream combines several message sources actively subscribed by the user to form a content aggregator. It can be understood as a data form that continuously provides content to the user, and the user can actively subscribe to the message sources and receive content from them.

[0042] Furthermore, the display forms of the information stream mainly include timeline and rank. Among them, the timeline is a typical information stream display method, which displays the content to the user in the chronological order of the update of the information stream content. And rank means calculating the weight of the content according to certain factors to determine the order of content display.

[0043] In one embodiment, when it is detected that the user clicks on a piece of news in the main timeline of the information stream, the frame generated from the frame data to be loaded is called. Among them, it is also necessary to determine whether the current click operation on this piece of news is the first operation. If it is not the first operation, the called frame is the frame newly created for the current click operation during the previous click operation, and there is no need to load the corresponding frame data in real time to obtain the frame.

[0044] Step S204: Determine the data to be displayed corresponding to the click operation.

[0045] Specifically, when it is detected that the user clicks on the main timeline of the information stream, it is necessary to obtain the data sent by the main timeline of the information stream and determine it as the data to be displayed corresponding to the click operation.

[0046] Step S206: Obtain the HTML page constructed according to the data to be displayed and the page display template.

[0047] Specifically, the operation steps of constructing an HTML page from the data to be displayed and the page display template are performed locally in native, without the need for the front end to re-render the data to be displayed. Among them, locally in native, that is, the native APP development mode, means that different languages and frameworks need to be used for development on different mobile operating systems such as IOS and Android. This mode is usually composed of two parts: "cloud server data + APP application client", and all UI elements, data content, and logic frameworks in the application are installed on the mobile terminal. Specifically in this embodiment, the operation of constructing an HTML page from the data to be displayed and the page display template is implemented based on the native APP development mode.

[0048] Among them, locally in native, that is, the native APP development mode, means that different languages and frameworks need to be used for development on different mobile operating systems such as IOS and Android. This mode is usually composed of two parts: "cloud server data + APP application client", and all UI elements, data content, and logic frameworks in the application are installed on the mobile terminal. Specifically in this embodiment, the operation of constructing an HTML page from the data to be displayed and the page display template is implemented based on the native APP development mode.

[0049] Furthermore, for the page display template, the styles and page structure are predefined. By loading the page display template and obtaining the page structure of the page display template, the placeholder that can be replaced with data in the page display template can be determined according to the page structure. Furthermore, by replacing the placeholder in the page display panel with the data to be displayed, an HTML structure carrying the data to be displayed can be spliced, and the generated HTML structure can be dynamically added to the page to obtain an HTML page.

[0050] Step S208, load the HTML page within the framework, generate and display a web page corresponding to the click operation.

[0051] Specifically, by calling the web view of the framework, the HTML page is loaded within the framework to obtain a rendered web view, and then the rendered web view is called and loaded to generate and display a web page corresponding to the click operation.

[0052] Among them, the web view, that is, webview, is a control in the android system used to display web pages and is part of the framework for page display. It can realize the display and rendering of web pages and interact with page JavaScript, thereby realizing hybrid development.

[0053] Furthermore, as Figure 3 shown, Figure 3 provides a schematic diagram of preloading the content to be displayed for a page loading method. Refer to Figure 3, the information flow main timeline sends the data to be displayed, and loads the HTML page obtained by integrating the data to be displayed and the page display template in the native development locally within the framework loaded by the front-end, so that the front-end can directly load the corresponding HTML page without re-rendering by the front-end.

[0054] In one embodiment, as Figure 4 , an overall loading schematic diagram of a page preloading method is provided. Referring to Figure 4 , the page preloading method includes a framework preloading part 402 and a data-to-be-displayed preloading part 404. Among them, for the same web page, when the framework preloading part 402 is triggered by the previous click operation, the framework for this click operation is loaded at the same time, while the data-to-be-displayed preloading part 404 obtains the HTML page by splicing the page display template and the data to be displayed, and loads it within the framework.

[0055] Furthermore, the traditional page loading logic is as follows: Since the front-end development framework is an asynchronous process, the front-end will use the webview asynchronously. After the asynchronous processing operation, the front-end will use the webview to render the content to be loaded. There is an asynchronous operation between the framework and the content to be displayed, that is, when the user clicks on the information flow timeline, the framework cannot be immediately called and the content to be displayed cannot be loaded immediately. When generating and displaying the page, secondary rendering needs to be performed on the terminal. For users, there is a long waiting process for the page to open.

[0056] Specifically in this embodiment, the optimized page loading logic is: Before the front-end uses the webview to load the content to be displayed, a pre-rendered webview is prepared in advance, which already includes the HTML page obtained by splicing the page display template and the data to be displayed. When the front-end needs to call the webview, the pre-rendered webview can be directly called, and then the corresponding web page can be directly loaded and displayed.

[0057] In the above page preloading method, by responding to the click operation, the framework generated from the framework data to be loaded is called, and the data to be displayed corresponding to the click operation is determined. Then, the HTML page constructed according to the data to be displayed and the page display template is obtained, and the HTML page is loaded within the framework to generate and display the web page corresponding to the click operation. Since the constructed HTML can be directly loaded within the framework without the front-end re-rendering the data to be displayed, and at the same time, the existing framework is called to load the HTML page, the waiting time for the content to be loaded can be reduced, thus accelerating the opening speed of the web page and enabling users to quickly see the content to be displayed.

[0058] In one embodiment, as Figure 5As shown, another page preloading method is provided, which specifically includes the following steps:

[0059] Step S502, monitor the current click operation and determine whether the current click operation is the first click operation.

[0060] Specifically, before responding to the click operation triggered by the user, monitor the current click operation triggered by the user, obtain the historical click record, and determine whether the current click operation is the first click operation based on the historical click record.

[0061] Furthermore, based on the historical click record, it can be determined that the current click operation is the first click operation or a non-first click operation. For a non-first click operation, it means that there was a previous click operation before the current click operation, and the previous click operation can be the first click operation or also a non-first click operation. And regardless of whether the previous click operation is the first click operation or a non-first click operation, when responding to the previous click operation, a frame for the current click operation has been newly created and can be directly called for use in the current click operation.

[0062] Step S504, when it is determined to be the first click operation, obtain the frame data to be loaded corresponding to the current click operation.

[0063] Specifically, when it is determined to be the first click operation, it means that there are no other click operations before the current click operation, which means that for the current click operation, a frame corresponding to the current click operation needs to be generated in real time, and a frame for the next click operation also needs to be generated.

[0064] Step S506, call the available empty shells in the cache pool, load the frame data to be loaded, and generate a frame corresponding to the current click operation.

[0065] Specifically, as Figure 6 shown, Figure 6 a schematic diagram of frame preloading for a page preloading method is provided. Referring to Figure 6 , before calling the available empty shells in the cache pool, loading the frame data to be loaded, and generating a frame corresponding to the current click operation, determine whether there are available empty shells in the cache pool. When it is determined that there are available empty shells in the cache pool, determine the available empty shell corresponding to the frame data to be loaded, and call the determined available empty shell corresponding to the frame data to be loaded to load the frame data to be loaded and generate a frame corresponding to the current click operation. Among them, an empty shell means a blank frame that does not contain any data. By using the empty shell to load the corresponding frame data, a frame carrying the frame data to be loaded can be generated and corresponding to the click operation.

[0066] Furthermore, referring to Figure 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. Here, the situation that there is no available empty shell in the cache pool can be understood as that there is no any available empty shell in the cache pool, or there is no available empty shell in the cache pool that can be used to load the current frame data to be loaded.

[0067] In this embodiment, by monitoring the current click operation and determining whether the current click operation is the first click operation, when it is determined to be the first click operation, the frame data to be loaded corresponding to the current click operation is obtained, and the available empty shell in the cache pool is called to load the frame data to be loaded, generating a frame corresponding to the current click operation, which can achieve generating a frame corresponding to the first click operation for this use at the first click operation. And when it is determined to be a non-first click operation, the frame generated according to the frame data to be loaded can be directly called, reducing the waiting time for page loading, so that the user can see the content to be displayed faster.

[0068] In one embodiment, after calling the available empty shell in the cache pool to load the frame data to be loaded and generating a frame corresponding to the current click operation, it further includes:

[0069] Pre-newly create an available empty shell for the next click operation;

[0070] According to the available empty shell for the next click operation and the frame data to be loaded, pre-newly create a frame to be called for the next click operation.

[0071] Specifically, when it is detected that the user clicks one of the news in the main timeline of the information stream, regardless of whether an available empty shell is detected, an available empty shell that can be directly provided for the next click operation is pre-created. Since the front-end framework is asynchronous, when optimizing the front end, it is impossible to immediately display the content in the next frame when the user clicks. Therefore, at the last click operation, an available empty shell for the next click operation is established at the same time, and this asynchrony is realized in the process of opening the landing page last time. When responding to the next click operation, the rendered page can be directly used for display.

[0072] Further, after pre-newly creating an available empty shell for the next click operation, a frame to be called for the next click operation can be further pre-newly created according to the available empty shell for the next click operation and the frame data to be loaded. It can be understood that the pre-newly created frame to be called for the next click operation can be directly called and used to load the HTML page constructed according to the data to be displayed and the page display template when the next click operation is detected.

[0073] In this embodiment, after loading the frame data to be loaded by calling the available empty shells in the cache pool and generating a frame corresponding to the current click operation, an available empty shell for the next click operation is newly created in advance, and a 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. It realizes the pre-creation of the frame to be called for the next click operation, so that the newly created frame to be called can be directly called when responding to the next click operation, without real-time loading and generating the frame, reducing the waiting time for the page to open and improving the page opening speed.

[0074] In one embodiment, as Figure 7 , a page preloading method is provided, which specifically includes the following steps:

[0075] 1) Monitor the current click operation and determine whether the current click operation is the first click operation.

[0076] Specifically, before responding to the click operation triggered by the user, monitor the current click operation triggered by the user, obtain the historical click record, and determine whether the current click operation is the first click operation based on the historical click record.

[0077] 2) When it is determined to be the first click operation, obtain the frame data to be loaded corresponding to the current click operation.

[0078] Specifically, when it is determined to be the first click operation, it means that there is no other click operation before the current click operation, which means that for the current click operation, a frame corresponding to the current click operation needs to be generated in real time, and a frame for the next click operation also needs to be generated.

[0079] 3) Determine whether there is an available empty shell in the cache pool.

[0080] 4) When it is determined that there is an available empty shell in the cache pool, determine the available empty shell corresponding to the frame data to be loaded.

[0081] 5) When it is determined that there is no available empty shell in the cache pool, create a new available empty shell corresponding to the frame data to be loaded.

[0082] Specifically, an empty shell means a blank frame that does not contain any data. When it is determined that there is no available empty shell in the cache pool, a new available empty shell corresponding to the frame data to be loaded is created. By using the empty shell to load the corresponding frame data, a frame carrying the frame data to be loaded can be generated, which corresponds to the click operation.

[0083] 6) Call the available empty shell in the cache pool, load the frame data to be loaded, and generate a frame corresponding to the current click operation.

[0084] 7) Pre-create an available shell for the next click operation in advance.

[0085] Specifically, when it is detected that the user clicks on one of the news items in the main timeline of the information stream, regardless of whether an available shell is detected, an available shell that can be directly provided for the next click operation is pre-created in advance.

[0086] 8) According to the available shell for the next click operation and the frame data to be loaded, pre-create a frame to be called for the next click operation.

[0087] Specifically, after pre-creating an available shell for the next click operation, a frame to be called for the next click operation can be further pre-created according to the available shell for the next click operation and the frame data to be loaded. Among them, the pre-created frame to be called for the next click operation can be directly called and used to load the HTML page constructed based on the data to be displayed and the page display template when the next click operation is detected.

[0088] 9) Respond to the click operation and call the frame generated from the frame data to be loaded.

[0089] Specifically, the user can click on a certain news item, short video, small video or advertisement, etc. in the main timeline of the information stream, and the terminal detects and responds to the user's click operation, and calls the frame generated according to the frame data to be loaded.

[0090] 10) When it is determined that the current click operation is not the first click operation, call the frame to be called created during the previous click operation.

[0091] Specifically, when it is determined that the current click operation is not the first click operation, it indicates that during the previous click operation, an available shell for the next click operation has been pre-created in advance, and according to the available shell for the next click operation and the frame data to be loaded, a frame to be called for the next click operation has been pre-created.

[0092] 11) Determine the data to be displayed corresponding to the click operation.

[0093] 12) Obtain the HTML page constructed based on the data to be displayed and the page display template.

[0094] Specifically, the method of constructing the HTML page based on the data to be displayed and the page display template includes: obtaining the page display template, obtaining the page structure of the page display template, and then determining the placeholders to be replaced according to the page structure. By using the data to be displayed to replace the placeholders, an HTML page carrying the data to be displayed can be constructed.

[0095] 13) Load the HTML page according to the web view of the framework to obtain the rendered web view.

[0096] Specifically, the web view serves as a control of the framework and is used to implement the loading and display of the HTML page. After loading the HTML page, the rendered web view can be obtained.

[0097] 14) Invoke and load the rendered web view to generate and display the web page corresponding to the click operation.

[0098] Specifically, the rendered web view can be directly invoked and loaded without secondary rendering to generate the web page corresponding to the click operation.

[0099] In this embodiment, by determining whether the current click operation is the first click operation, when it is determined to be the first click operation, an available empty shell in the cache pool is invoked to load the framework data to be loaded corresponding to the current click operation to obtain the framework corresponding to the current click operation, and at the same time, a framework to be invoked for the next click operation is newly created in advance. When it is determined that the current click operation is not the first click operation, the framework to be invoked newly created by the previous click operation is directly invoked. By loading the HTML page obtained by constructing according to the data to be displayed and the page display template in the web view of the framework, the rendered web view can be obtained, and the rendered web view is invoked and loaded to generate and display the web page corresponding to the click operation. Since the constructed HTML can be directly loaded in the framework without the front end rendering the data to be displayed again, and at the same time, the existing framework can be invoked to load the HTML page, the waiting time for the content to be loaded can be reduced, thereby accelerating the opening speed of the web page and enabling the user to quickly see the content to be displayed.

[0100] It should be understood that although Figure 2 、 Figure 5 and Figure 7 each step in the flowchart is shown sequentially according to the arrow indication, these steps are not necessarily executed in the order indicated by the arrow. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, Figure 2 、 Figure 5 and Figure 7 at least a part of the steps in can include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment but can be executed at different moments, and the execution order of these steps or stages is not necessarily sequential but can be executed alternately or in turn with at least a part of the steps or stages in other steps or other steps.

[0101] In one embodiment, asFigure 8 As shown in Figure 8 , a page preloading device is provided. This device can be a software module, a hardware module, or a combination of both, and becomes part of a computer device. Specifically, the device includes: a framework calling module 802, a data to be displayed determination module 804, an HTML page acquisition module 806, and a page loading module 808, where:

[0102] The framework calling module 802 is used to respond to a click operation and call the framework generated from the framework data to be loaded.

[0103] The data to be displayed determination module 804 is used to determine the data to be displayed corresponding to the click operation.

[0104] The HTML page acquisition module 806 is used to acquire the HTML page constructed according to the data to be displayed and the page display template.

[0105] The page loading module 808 is used to load the HTML page within the framework, generate the web page corresponding to the click operation, and display it.

[0106] In the above page preloading device, by responding to the click operation, the framework generated from the framework data to be loaded is called, and the data to be displayed corresponding to the click operation is determined. Furthermore, the HTML page constructed according to the data to be displayed and the page display template is acquired, and the HTML page is loaded within the framework, generating the web page corresponding to the click operation and displaying it. Since the constructed HTML can be directly loaded within the framework without the front end rendering the data to be displayed again, and at the same time, the existing framework is called to load the HTML page, the waiting time for the content to be loaded can be reduced, thus accelerating the opening speed of the web page and enabling the user to quickly see the content to be displayed.

[0107] In one embodiment, a page preloading device is provided, which further includes:

[0108] The current click operation monitoring module is used to monitor the current click operation and determine whether the current click operation is the first click operation.

[0109] The framework data to be loaded acquisition module is used to acquire the framework data to be loaded corresponding to the current click operation when it is determined to be the first click operation.

[0110] The framework data to be loaded loading module is used to call the available empty shells in the cache pool, load the framework data to be loaded, and generate the framework corresponding to the current click operation.

[0111] In this embodiment, by monitoring the current click operation and determining whether the current click operation is the first click operation, when it is determined to be the first click operation, the frame data to be loaded corresponding to the current click operation is obtained, and the available empty shells in the cache pool are called to load the frame data to be loaded, generating a frame corresponding to the current click operation, which can achieve generating a frame corresponding to the first click operation for this use at the first click operation. When it is determined to be a non-first click operation, the frame generated according to the frame data to be loaded can be directly called, reducing the waiting time for page loading and enabling the user to see the content to be displayed faster.

[0112] In one embodiment, a page preloading device is provided, further comprising:

[0113] An available empty shell pre-creation module, configured to pre-create available empty shells for the next click operation.

[0114] A frame to-be-called pre-creation module, configured to pre-create a frame to be called for the next click operation according to the available empty shells for the next click operation and the frame data to be loaded.

[0115] In this embodiment, after calling the available empty shells in the cache pool, loading the frame data to be loaded, and generating a frame corresponding to the current click operation, available empty shells for the next click operation are pre-created, and a frame to be called for the next click operation is pre-created according to the available empty shells for the next click operation and the frame data to be loaded. It realizes pre-creating the frame to be called for the next click operation, enabling the directly call of the pre-created frame to be called when responding to the next click operation, without the need to load and generate the frame in real time, reducing the waiting time for page opening and improving the page opening speed.

[0116] In one embodiment, a page preloading device is provided, further comprising:

[0117] An available empty shell judgment module, configured to judge whether there are available empty shells in the cache pool.

[0118] An available empty shell determination module, configured to determine the available empty shell corresponding to the frame data to be loaded when it is determined that there are available empty shells in the cache pool.

[0119] An available empty shell creation module, configured to create an available empty shell corresponding to the frame data to be loaded when it is determined that there are no available empty shells in the cache pool.

[0120] In one embodiment, a page preloading device is provided, further comprising an HTML page construction module, configured to:

[0121] Obtain the page structure of the page display template; determine the placeholders to be replaced according to the page structure; use the data to be displayed to replace the placeholders, and construct an HTML page carrying the data to be displayed.

[0122] In one embodiment, the page loading module is further configured to:

[0123] Load the HTML page according to the web view of the framework to obtain the rendered web view;

[0124] Call and load the rendered web view, generate a web page corresponding to the click operation and display it.

[0125] In one embodiment, another page preloading device is provided, specifically including:

[0126] The current click operation monitoring module is used to monitor the current click operation and determine whether the current click operation is the first click operation.

[0127] The frame data to be loaded acquisition module is used to obtain the frame data to be loaded corresponding to the current click operation when it is determined to be the first click operation.

[0128] The available empty shell judgment module is used to judge whether there is an available empty shell in the cache pool.

[0129] The available empty shell determination module is used to determine the available empty shell corresponding to the frame data to be loaded when it is determined that there is an available empty shell in the cache pool.

[0130] The available empty shell new construction module is used to newly construct an available empty shell corresponding to the frame data to be loaded when it is determined that there is no available empty shell in the cache pool.

[0131] The frame data to be loaded loading module is used to call the available empty shell in the cache pool, load the frame data to be loaded, and generate a frame corresponding to the current click operation.

[0132] The available empty shell pre-new construction module is used to pre-newly construct an available empty shell for the next click operation.

[0133] The frame to be called new construction module is used to pre-newly construct the frame to be called for the next click operation according to the available empty shell for the next click operation and the frame data to be loaded.

[0134] The first call module is used to respond to the click operation and call the frame generated by the frame data to be loaded.

[0135] The second call module is used to call the frame to be called newly constructed during the previous click operation when it is determined that the current click operation is not the first click operation.

[0136] A data to be displayed determination module, configured to determine data to be displayed corresponding to a click operation.

[0137] An HTML page acquisition module, configured to acquire an HTML page constructed according to data to be displayed and a page display template.

[0138] A web page view rendering module, configured to load the HTML page according to the web page view of a framework to obtain a rendered web page view.

[0139] A web page display module, configured to call and load the rendered web page view, generate a web page corresponding to the click operation, and display it.

[0140] In this embodiment, by determining whether the current click operation is a first click operation, when it is determined to be a first click operation, an available empty shell in the cache pool is called, the framework data to be loaded corresponding to the current click operation is loaded, and a framework corresponding to the current click operation is obtained. At the same time, a framework to be called for the next click operation is newly created in advance. When it is determined that the current click operation is not a first click operation, the framework to be called newly created by the previous click operation is directly called. By loading the HTML page constructed according to the data to be displayed and the page display template in the web page view of the framework, a rendered web page view can be obtained, the rendered web page view is called and loaded, and a web page corresponding to the click operation is generated and displayed. Since the constructed HTML can be directly loaded in the framework without the front end rendering the data to be displayed again, and at the same time, an existing framework can be called to load the HTML page, the waiting time for the content to be loaded can be reduced, thereby accelerating the opening speed of the web page and enabling the user to quickly see the content to be displayed.

[0141] For the specific limitations on the page preloading device, reference can be made to the limitations on the page preloading method in the foregoing text, which will not be elaborated here. Each module in the foregoing page preloading device can be implemented in whole or in part by software, hardware, and their combination. The foregoing modules can be embedded in the processor in the computer device in hardware form or be independent of it, or be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to the foregoing modules.

[0142] In one embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 9As shown. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be achieved through WIFI, a carrier network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it realizes a page preloading method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad set on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.

[0143] Those skilled in the art can understand that Figure 9 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements. The computer program composed of each program module enables the processor to execute the steps in the page preloading method of each embodiment of this application described in this specification.

[0144] In one embodiment, the page preloading device provided by this application can be implemented in the form of a computer program, and the computer program can run on a computer device as shown in Figure 9 The memory of the computer device can store each program module that composes the page preloading device. For example, Figure 8 the framework call module, the data to be displayed determination module, the HTML page acquisition module, and the page loading module shown in.

[0145] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0146] In response to a click operation, call the framework generated from the framework data to be loaded;

[0147] Determine the data to be displayed corresponding to the click operation;

[0148] Obtain the HTML page constructed according to the data to be displayed and the page display template;

[0149] Load an HTML page within a framework, generate and display a web page corresponding to the click operation.

[0150] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0151] Monitor the current click operation and determine whether the current click operation is the first click operation;

[0152] When it is determined to be the first click operation, obtain the framework data to be loaded corresponding to the current click operation;

[0153] Call an available empty shell in the cache pool to load the framework data to be loaded and generate a framework corresponding to the current click operation.

[0154] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0155] Determine whether there is an available empty shell in the cache pool;

[0156] When it is determined that there is an available empty shell in the cache pool, determine the available empty shell corresponding to the framework data to be loaded;

[0157] When it is determined that there is no available empty shell in the cache pool, create a new available empty shell corresponding to the framework data to be loaded.

[0158] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0159] Load the HTML page according to the web view of the framework to obtain the rendered web view;

[0160] Call and load the rendered web view to generate and display a web page corresponding to the click operation.

[0161] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0162] Pre-create an available empty shell for the next click operation.

[0163] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0164] According to the available empty shell for the next click operation and the framework data to be loaded, pre-create a framework to be called for the next click operation.

[0165] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0166] Obtain the page structure of the page display template;

[0167] Determine the placeholder to be replaced according to the page structure;

[0168] Replace the placeholder with the data to be displayed to construct an HTML page carrying the data to be displayed.

[0169] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which when executed by a processor, implements the following steps:

[0170] In response to a click operation, call the framework generated from the framework data to be loaded;

[0171] Determine the data to be displayed corresponding to the click operation;

[0172] Obtain the HTML page constructed according to the data to be displayed and the page display template;

[0173] Load the HTML page within the framework to generate and display a web page corresponding to the click operation.

[0174] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:

[0175] Monitor the current click operation and determine whether the current click operation is the first click operation;

[0176] When it is determined to be the first click operation, obtain the framework data to be loaded corresponding to the current click operation;

[0177] Call the available empty shell in the cache pool to load the framework data to be loaded and generate a framework corresponding to the current click operation.

[0178] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:

[0179] Determine whether there is an available empty shell in the cache pool;

[0180] When it is determined that there is an available empty shell in the cache pool, determine the available empty shell corresponding to the framework data to be loaded;

[0181] When it is determined that there is no available empty shell in the cache pool, create a new available empty shell corresponding to the framework data to be loaded.

[0182] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:

[0183] Load the HTML page according to the web view of the framework to obtain a rendered web view;

[0184] Call and load the rendered web view to generate and display a web page corresponding to the click operation.

[0185] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0186] Pre - create an available shell for the next click operation.

[0187] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0188] According to the available shell for the next click operation and the frame data to be loaded, pre - create a frame to be called for the next click operation.

[0189] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0190] Obtain the page structure of the page display template;

[0191] Determine the placeholder to be replaced according to the page structure;

[0192] Use the data to be displayed to replace the placeholder, and construct an HTML page carrying the data to be displayed.

[0193] In one embodiment, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer - readable storage medium. The processor of the computer device reads the computer instructions from the computer - readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the above - mentioned method embodiments.

[0194] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above - mentioned embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non - volatile computer - readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above - mentioned methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include at least one of non - volatile and volatile memories. Non - volatile memory can include read - only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0195] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0196] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.

Claims

1. A page preloading method, characterized in that, The method includes: Monitoring the current click operation on the information flow, and determining whether the current click operation is the first click operation; the information flow represents a content aggregator obtained by combining a number of message sources actively subscribed by the user; When it is determined to be the first click operation, obtaining the frame data to be loaded corresponding to the current click operation; Invoking an available empty shell in the cache pool to load the frame data to be loaded, and generating a frame corresponding to the current click operation; the available empty shell represents an available blank frame that does not contain any data; In response to the click operation on the information flow, invoking the frame generated from the frame data to be loaded; Obtaining the data sent by the information flow for the click operation, and determining the data sent by the information flow as the data to be displayed corresponding to the click operation; Obtaining the HTML page constructed according to the data to be displayed and the page display template in the native APP development mode; Invoking the web view of the frame, and loading the HTML page in the front-end loaded frame, generating and displaying the web page corresponding to the click operation.

2. The method according to claim 1, wherein Before invoking the available empty shell in the cache pool to load the frame data to be loaded and generating the frame corresponding to the current click operation, it includes: Determining whether there is an available empty shell in the cache pool; When it is determined that there is an available empty shell in the cache pool, determining the available empty shell corresponding to the frame data to be loaded; When it is determined that there is no available empty shell in the cache pool, creating a new available empty shell corresponding to the frame data to be loaded.

3. The method according to claim 1 or 2, characterized in that, The step of loading the HTML page in the frame, generating and displaying the web page corresponding to the click operation includes: Loading the HTML page according to the web view of the frame to obtain the rendered web view; Invoking and loading the rendered web view, generating and displaying the web page corresponding to the click operation.

4. The method according to claim 1, wherein After invoking the available empty shell in the cache pool to load the frame data to be loaded and generating the frame corresponding to the current click operation, it further includes: Pre-creating an available empty shell for the next click operation.

5. The method according to claim 4, wherein The method further includes: Pre-creating a frame to be invoked for the next click operation according to the available empty shell and the frame data to be loaded for the next click operation.

6. The method according to claim 1 or 2, characterized in that, The way of constructing the HTML page according to the data to be displayed and the page display template includes: Obtaining the page structure of the page display template; Determining the placeholder to be replaced according to the page structure; Using the data to be displayed to replace the placeholder, and constructing the HTML page carrying the data to be displayed.

7. A page preloading device, characterized in that, The device includes: A current click operation monitoring module, configured to monitor the current click operation on the information flow, and determine whether the current click operation is the first click operation; the information flow represents a content aggregator obtained by combining a number of message sources actively subscribed by the user; A frame data to be loaded acquisition module, configured to obtain the frame data to be loaded corresponding to the current click operation when it is determined to be the first click operation; A framework data loading module to be loaded, which is used to call the available empty shells in the cache pool, load the framework data to be loaded, and generate a framework corresponding to the current click operation; the available empty shell represents an available blank framework without any data. A framework calling module, which is used to respond to a click operation on the information stream and call the framework generated from the framework data to be loaded. A data to be displayed determining module, which is used to obtain the data sent by the information stream for the click operation and determine the data sent by the information stream as the data to be displayed corresponding to the click operation. An HTML page obtaining module, which is used to obtain an HTML page constructed according to the data to be displayed and the page display template in the native APP development mode. A page loading module, which is used to call the web view of the framework, load the HTML page in the framework loaded by the front end called, and generate and display a web page corresponding to the click operation.

8. The device according to claim 7, wherein, The device further includes: An available empty shell judging module, which is used to judge whether there is an available empty shell in the cache pool. An available empty shell determining module, which is used to determine the available empty shell corresponding to the framework data to be loaded when it is determined that there is an available empty shell in the cache pool. An available empty shell creating module, which is used to create an available empty shell corresponding to the framework data to be loaded when it is determined that there is no available empty shell in the cache pool.

9. The device according to claim 7 or 8, characterized in that The page loading module is further used for: Loading the HTML page according to the web view of the framework to obtain a rendered web view; calling and loading the rendered web view to generate and display a web page corresponding to the click operation.

10. The device according to claim 7, characterized in that, The device further includes an available empty shell pre-creating module, which is used to pre-create an available empty shell for the next click operation.

11. The device according to claim 10, characterized in that, The device further includes a framework to be called creating module, which is used for: Pre-creating a framework to be called for the next click operation according to the available empty shell for the next click operation and the framework data to be loaded.

12. The device according to claim 7 or 8, characterized in that The device further includes an HTML page building module, which is used for: Obtaining the page structure of the page display template; determining the placeholders to be replaced according to the page structure; using the data to be displayed to replace the placeholders to construct an HTML page carrying the data to be displayed.

13. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

14. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Webpage rendering method and related equipment

    CN108334517A