CN112948011B - Method and device for loading secondary page - Google Patents

Method and device for loading secondary page Download PDF

Info

Publication number
CN112948011B
CN112948011B CN201911176639.4A CN201911176639A CN112948011B CN 112948011 B CN112948011 B CN 112948011B CN 201911176639 A CN201911176639 A CN 201911176639A CN 112948011 B CN112948011 B CN 112948011B
Authority
CN
China
Prior art keywords
page
candidate secondary
rendering
secondary page
terminal
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.)
Active
Application number
CN201911176639.4A
Other languages
Chinese (zh)
Other versions
CN112948011A (en
Inventor
黄春华
樊执政
徐炎骏
余黎明
许全会
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN201911176639.4A priority Critical patent/CN112948011B/en
Publication of CN112948011A publication Critical patent/CN112948011A/en
Application granted granted Critical
Publication of CN112948011B publication Critical patent/CN112948011B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to the technical field of computers, and discloses a method and a device for loading a secondary page, which are used for solving the problems of long rendering preparation time, same page content, slow page record and low page loading hit rate in the prior art. The method comprises the following steps: the terminal acquires a candidate secondary page matched with a first page address from a candidate secondary page set, acquires rendering data corresponding to the candidate secondary page from a first server when determining that the candidate secondary page accords with a rendering rule, and finally renders the candidate secondary page based on the rendering data and loads the rendered candidate secondary page. The terminal acquires a candidate secondary page matched with the first page address, directly acquires corresponding rendering data when further determining that the candidate secondary page is subjected to rendering pretreatment, performs page rendering operation, reduces rendering preparation time, improves page loading speed and page loading hit rate, and generates pages with different contents.

Description

Method and device for loading secondary page
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for loading a second level page.
Background
With the development of science and technology, people use intelligent terminals to acquire corresponding Application services, for example, users use social Application (APP) to communicate with others in real time; for another example, the user searches for literature using a search website.
The intelligent terminal loads and presents the main page (hereinafter simply referred to as the first-level page) firstly, loads and presents the corresponding detail page (hereinafter simply referred to as the second-level page) after the user clicks the main page, and three page loading schemes are provided at present, wherein the three page loading schemes are as follows:
in the first scheme, the server directly outputs page contents. The server generates a document object model (Document Object Model, DOM), encapsulates the DOM into a hypertext markup language (HyperText Markup Language, HTML) file, and issues the HTML file and cascading style sheet (Cascading Style Sheets, CSS) file together to the intelligent terminal. In this way, the intelligent terminal directly analyzes the HTML file to obtain the DOM, generates a corresponding Render tree based on the DOM and the CSS file, and finally renders the obtained content data to a node corresponding to the Render tree, and the intelligent terminal presents the loaded secondary page to the user.
And in the scheme II, the intelligent terminal caches the universal file set. The intelligent terminal can buffer the universal file set sent by the server in the local so that the intelligent terminal can directly acquire the corresponding universal file set from the local when the same secondary page is loaded next time, the time for downloading the universal file set from the server is saved, and the corresponding secondary page is generated based on the universal file set and the acquired content data. A generic file refers to a file that is updated less frequently during page loading, such as an HTML file, a CSS file, and the like.
And thirdly, the intelligent terminal prerenders the secondary page. When the user does not click the primary page, the intelligent terminal renders a plurality of candidate secondary pages in advance, so that the corresponding secondary pages can be directly displayed for the user after the user clicks the primary page.
The above scheme can be adopted, which brings the following problems: firstly, as an HTML file and a CSS file generated by a server are larger and larger, the time spent by an intelligent terminal for downloading the files is also increased, and a page generated by adopting the scheme I can only display the same content and cannot generate personalized content according to the requirements of users; secondly, if the intelligent terminal caches the static resources in a comparison cache mode, before acquiring the corresponding static resources, a query request needs to be sent to the server, and if the corresponding static resources are updated, new static resources issued by the server need to be received, so that query time is increased, and rendering efficiency is reduced; finally, the intelligent terminal renders the candidate secondary pages well in advance, only one candidate secondary page can be presented to the user, a large number of rendering processes are occupied, the secondary page loading is blocked or the intelligent terminal collapses, the user experience is poor, and the page loading hit rate is reduced.
In view of this, there is a need to devise a new method of two-level page loading that overcomes the above-mentioned drawbacks.
Disclosure of Invention
The embodiment of the application provides a method and a device for loading a two-level page, which are used for solving the problems of long rendering preparation time, same page content, slow page loading and low page loading hit rate in the prior art.
The specific technical scheme provided by the embodiment of the application is as follows:
a method of two-level page loading, comprising:
the terminal acquires a first page address, and acquires a candidate secondary page matched with the first page address from a preset candidate secondary page set;
when the terminal determines that the candidate secondary page accords with a preset rendering rule, rendering data corresponding to the candidate secondary page is obtained from a first server;
and the terminal renders the candidate secondary pages based on the rendering data and loads the rendered candidate secondary pages.
Optionally, before the terminal acquires the first page address, the method further includes:
the terminal sends a page address downloading request to a second server and receives a second page address set sent by the second server;
the terminal generates a corresponding candidate secondary page set based on the second page address set, and receives a universal file set corresponding to each candidate secondary page sent by the second server;
and the terminal respectively acquires the running environment files of each candidate secondary page in each general file set, and executes corresponding running environment files in each candidate secondary page.
Optionally, when determining that the candidate secondary page meets a preset rendering rule, the terminal obtains rendering data corresponding to the candidate secondary page from a first server, including:
when the terminal determines that the candidate secondary page has executed to complete the running environment file, generating a third page address representing query rendering data based on the second page address of the candidate secondary page and a preset query data address library;
the terminal generates and sends a rendering data downloading request to the first server based on the third page address;
and the terminal receives rendering data corresponding to the candidate secondary page sent by the first server.
Optionally, the terminal renders the candidate secondary page based on the rendering data, loads the rendered candidate secondary page, and includes:
the terminal analyzes other general files corresponding to the candidate secondary pages;
and the terminal renders each parsed general file and the rendering data into the candidate secondary page in the running environment, and loads the rendered candidate secondary page.
Optionally, the method further comprises:
when the terminal determines that no candidate secondary page matched with the first page address exists, acquiring a universal file set of a secondary page to be loaded, which is sent by the second server, wherein the secondary page to be loaded is a page which is not subjected to rendering pretreatment;
the terminal acquires the running environment files in the universal file set, and analyzes other universal files after the running environment files are executed;
the terminal receives the rendering data of the secondary page to be loaded, which is sent by the first server, renders each parsed general file and the rendering data into a secondary page in an operating environment, and loads the rendered secondary page.
Optionally, the method further comprises:
when the terminal determines that the candidate secondary page does not accord with the rendering rule, acquiring a universal file set of the secondary page to be loaded, which is sent by the second server;
the terminal obtains the running environment files in the universal file set, and analyzes the other universal files after the running environment files are executed;
the terminal receives the rendering data of the secondary page to be loaded, which is sent by the first server, renders each parsed general file and the rendering data into a secondary page in an operating environment, and loads the rendered secondary page.
An apparatus for two-level page loading, comprising:
the matching unit is used for acquiring a first page address and acquiring a candidate secondary page matched with the first page address from a preset candidate secondary page set;
the acquisition unit is used for acquiring rendering data corresponding to the candidate secondary pages from the first server when the candidate secondary pages are determined to accord with a preset rendering rule;
and the loading unit is used for rendering the candidate secondary pages based on the rendering data and loading the rendered candidate secondary pages.
Optionally, before the terminal acquires the first page address, the matching unit is further configured to:
sending a page address downloading request to a second server, and receiving a second page address set sent by the second server;
generating a corresponding candidate secondary page set based on the second page address set, and receiving a universal file set corresponding to each candidate secondary page sent by the second server;
and respectively acquiring the running environment files of the candidate secondary pages in each general file set, and executing corresponding running environment files in the candidate secondary pages.
Optionally, when it is determined that the candidate secondary page meets a preset rendering rule, rendering data corresponding to the candidate secondary page is obtained from a first server, and the obtaining unit is configured to:
when determining that the candidate secondary page has executed to complete the running environment file, generating a third page address representing query rendering data based on the second page address of the candidate secondary page and a preset query data address base;
generating and sending a rendering data downloading request to the first server based on the third page address;
and receiving rendering data corresponding to the candidate secondary page sent by the first server.
Optionally, based on the rendering data, rendering the candidate secondary page, and loading the rendered candidate secondary page, where the loading unit is configured to:
analyzing other general files corresponding to the candidate secondary pages;
and rendering each parsed general file and the rendering data into the candidate secondary pages in the running environment, and loading the rendered candidate secondary pages.
Optionally, the loading unit is further configured to:
when the fact that the candidate secondary pages matched with the first page address do not exist is determined, a universal file set of the secondary pages to be loaded, which are sent by the second server, is obtained, wherein the secondary pages to be loaded are pages which are not subjected to rendering pretreatment;
acquiring the running environment files in the universal file set, and analyzing other universal files after the running environment files are executed;
receiving the rendering data of the secondary page to be loaded, which is sent by the first server, rendering each parsed general file and the rendering data into a secondary page in an operating environment, and loading the rendered secondary page.
Optionally, the loading unit is further configured to:
when the candidate secondary pages are determined to be not in accordance with the rendering rules, acquiring a universal file set of the secondary pages to be loaded, which is sent by the second server;
acquiring the running environment files in the universal file set, and analyzing the other universal files after the running environment files are executed;
receiving the rendering data of the secondary page to be loaded, which is sent by the first server, rendering each parsed general file and the rendering data into a secondary page in an operating environment, and loading the rendered secondary page.
A computing device, comprising:
a memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing the method for loading any two-level page according to the obtained program.
A storage medium comprising computer readable instructions which, when read and executed by a computer, cause the computer to perform the method of any of the above two-level page loads.
The beneficial effects of the application are as follows:
in the embodiment of the application, a terminal acquires a candidate secondary page matched with a first page address from a candidate secondary page set, acquires rendering data corresponding to the candidate secondary page from a first server when determining that the candidate secondary page accords with a rendering rule, and finally renders the candidate secondary page based on the rendering data and loads the rendered candidate secondary page. The terminal firstly acquires the candidate secondary page matched with the first page address, directly acquires rendering data of the candidate secondary page when the candidate secondary page is further determined to accord with a rendering rule, namely, the candidate secondary page is subjected to rendering pretreatment, and renders the candidate secondary page, so that rendering preparation time is shortened, page loading speed and page loading hit rate are improved, and personalized pages can be generated according to user requirements.
Drawings
FIG. 1 is a schematic diagram of a two-level page loading system according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of performing rendering preprocessing on each candidate secondary page by the terminal according to the embodiment of the present application;
FIG. 3 is a schematic flow chart of loading a secondary page according to an embodiment of the present disclosure;
fig. 4 is a schematic flow chart of performing rendering preprocessing for each candidate secondary page in an application scenario according to an embodiment of the present application;
FIG. 5 is a schematic flow chart of loading a rendered candidate secondary page according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a two-level page loading device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a computing device according to an embodiment of the present application.
Detailed Description
Aiming at the problems that rendering preparation time is long, personalized pages cannot be generated, page loading is slow and page loading hit rate is low in the prior art, the embodiment of the application provides a new solution. The scheme is as follows: the terminal acquires a candidate secondary page matched with a first page address from a candidate secondary page set, acquires rendering data corresponding to the candidate secondary page from a first server when determining that the candidate secondary page accords with a rendering rule, and finally renders the candidate secondary page based on the rendering data and loads the rendered candidate secondary page.
The preferred embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Specifically, referring to fig. 1, in an embodiment of the present application, a two-level page loading system is provided, where the system at least includes a terminal, and a first server and a second server that respectively establish communication connection with the terminal. The first server is used for caching the rendering data of all pages, and returning corresponding rendering data to the terminal after receiving a rendering data downloading request sent by the terminal; the second server is used for caching page addresses of all pages corresponding to a plurality of websites or APP and a universal file set corresponding to each page; a generic file refers to a file that is updated less frequently during page loading, such as an HTML file, a CSS file, and the like.
The first page address in the embodiment of the application refers to a page address of a secondary page to be loaded, which is prepared to be presented to a user after the terminal receives a trigger instruction that the user clicks the primary page. The secondary page to be loaded is a page which does not execute rendering pretreatment.
The second page address in the embodiment of the present application refers to an internet protocol (Internet Protocol, IP) address of a server corresponding to the candidate secondary page, and a storage location of a general file set of the candidate secondary page on the corresponding server. The general file refers to a file with a smaller update frequency in the page loading process.
Specifically, referring to fig. 2, in the embodiment of the present application, the detailed process of performing rendering preprocessing on each candidate secondary page by the terminal is as follows:
s201: and the terminal sends a page address downloading request to the second server and receives a second page address set sent by the second server.
After a user logs in a website on the terminal or starts an APP on the terminal, the terminal sends a page address downloading request to a second server and receives a second page address set sent by the second server. The second page address comprises a domain name and a relative path, the domain name represents the IP address of the second server corresponding to the candidate second-level page, and the relative path represents a general file set of the candidate second-level page stored in a directory or file address on the second server.
S202: and the terminal generates a corresponding candidate secondary page set based on the second page address set, and receives the universal file set corresponding to each candidate secondary page sent by the second server.
The terminal performs the following operations for the second page address x:
the terminal initiates a kernel to generate a network view (WebView) _i, wherein WebView_i represents an ith network view; initializing a second page address X in the corresponding WebView_i to generate a candidate secondary page X;
and then, the terminal acquires the universal file set corresponding to the candidate secondary page X from the corresponding directory or file address on the second server based on the domain name and the relative path contained in the second page address X.
S203: and the terminal respectively acquires the running environment files of each candidate secondary page in each general file set, and executes the corresponding running environment files in each candidate secondary page.
The running environment refers to an environment on the terminal, in which the general files can be normally run. If the terminal does not execute or is executing the corresponding running environment file in the candidate secondary page, the terminal cannot normally run the universal file, and further cannot complete subsequent page rendering operation. In this embodiment of the present application, the running environment files include an object-based and event-driven client scripting language (JavaScript, JS) file and a CSS file.
The terminal performs rendering pretreatment on each candidate secondary page in advance, so that the rendering preparation time can be reduced when the secondary page is subsequently loaded, and the loading time of the secondary page is further shortened; meanwhile, the WebView management mechanism provided by the embodiment of the invention has good robustness, can effectively control the use cost of terminal resources and second server resources, and reduces the use risk; and the terminal of the embodiment of the invention can use the existing cache resource scheme to store the candidate secondary page set and the corresponding universal file set locally in advance so as to ensure the stability of acquiring resources and further improve the rendering stability and page loading speed of the secondary page.
Specifically, referring to fig. 3, the detailed process of loading the secondary page in the embodiment of the present invention is as follows:
s301: the terminal acquires a first page address, and acquires a candidate secondary page matched with the first page address from a preset candidate secondary page set.
After receiving a trigger instruction of clicking the primary page by a user, the terminal acquires a first page address of the secondary page to be loaded from a second server. The second page to be loaded is a page not subjected to rendering preprocessing, and the first page address fully describes the address of the second page to be loaded, and in the embodiment of the application, the first page address is a uniform resource locator (Uniform Resource Locator, URL).
The terminal acquires a domain name and a relative path in a first page address, and acquires a candidate secondary page consistent with the domain name and the relative path in the first page address in a candidate secondary page set.
Optionally, when the terminal determines that there is no candidate secondary page matching the first page address, the terminal loads the secondary page by adopting the prior art, and the specific loading process is as follows:
a1, the terminal acquires a universal file set of the secondary page to be loaded, which is sent by the second server.
Firstly, a terminal resolves a domain name in a first page address into an IP address of a second server;
secondly, the terminal sends a file downloading request to a second server through the IP address;
and finally, the terminal receives the universal file set of the secondary page to be loaded returned by the second server.
A2, the terminal acquires the running environment files in the universal file set, and analyzes other universal files after the running environment files are executed.
After the terminal executes the running environment file, firstly analyzing the HTML file to generate a DOM tree; analyzing the CSS file to generate CSSOM; finally, integrating the DOM tree and the CSSOM to form a Render tree.
A3, the terminal receives rendering data of the secondary page to be loaded, which is sent by the first server.
And the terminal sends a rendering data downloading request to the first server through the query character in the first page address and receives the rendering data returned by the first server.
And A4, rendering the parsed general files and rendering data into a secondary page in the running environment by the terminal.
And the terminal determines the positions of the elements in the secondary page to be loaded according to the Render tree, and renders the rendering data in the positions of the corresponding elements.
And A5, loading the rendered secondary page by the terminal.
S302: and when the terminal determines that the candidate secondary page accords with a preset rendering rule, rendering data corresponding to the candidate secondary page is obtained from a first server.
Optionally, the process of obtaining the rendering data by the terminal is as follows:
and B1, when the terminal determines that the candidate secondary page is executed to complete the running environment file, generating a third page address representing query rendering data based on the second page address of the candidate secondary page and a preset query data address library.
And when the terminal determines that the candidate secondary page is executed to complete rendering preprocessing, judging that the candidate secondary page can perform subsequent page rendering operation. Because the second page address of the candidate secondary page only contains the domain name and the relative address, the rendering data type of the candidate secondary page cannot be determined, and rendering data matched with the rendering data type cannot be acquired from the first server.
Therefore, the terminal in the embodiment of the application determines the format of the query character according to the domain name and the relative address; the terminal acquires a third page address conforming to the format from the query data address library, wherein the third page address completely describes the address of the candidate secondary page; and finally, the terminal adopts a mode of modifying the page address of the history record to replace the second page address of the candidate secondary page with the third page address, so that the rendering data of the candidate secondary page can be conveniently obtained by the terminal, and the rendering preprocessing operation of the candidate secondary page is not re-executed due to the operation of replacing the page address. And B2, the terminal generates and sends a rendering data downloading request to the first server based on the third page address.
And the terminal sends a rendering data downloading request to the first server through the query character in the third page address.
And B3, the terminal receives rendering data of the corresponding candidate secondary page sent by the first server.
Optionally, when determining that the candidate secondary page does not conform to the rendering rule, the terminal does not complete any one or more of the following operations: and when the kernel initializes, downloads the universal file set and executes the running environment file, the terminal executes the steps A1 to A5 to load the secondary page.
S303: and the terminal renders the candidate secondary pages based on the rendering data and loads the rendered candidate secondary pages.
Optionally, the process of rendering the candidate secondary page by the terminal is as follows:
and C1, the terminal analyzes other general files corresponding to the candidate secondary pages.
After the terminal executes the running environment file, firstly analyzing the HTML file to generate a DOM tree; analyzing the CSS file to generate CSSOM; finally, integrating the DOM tree and the CSSOM to form a Render tree.
And C2, rendering each parsed general file and rendering data into the candidate secondary page by the terminal in the running environment, and loading the rendered candidate secondary page.
And the terminal determines the positions of the elements in the candidate secondary page according to the Render tree, and renders the rendering data in the positions of the corresponding elements.
The terminal of the embodiment of the invention loads the corresponding secondary page after receiving the trigger instruction of clicking the primary page by the user, thus improving the response rate of page loading requests; in addition, if the corresponding secondary page has already been executed and has been rendered the preprocessing operation, will greatly reduce and render the preparation time, obtain the corresponding rendering data from the first server directly, it is enough to render the secondary page, in this way, have greatly improved the effective rendering rate of the page.
Based on the above embodiment, referring to fig. 4, a specific application scenario is used below to perform rendering preprocessing on each candidate secondary page for further detailed description.
S401, after a user logs in a website on the terminal or starts an APP on the terminal, the terminal sends a page address downloading request to a text content distribution server and receives a page address list sent by the text content distribution server from a Neul-Ark interface.
S402, the terminal acquires the page address x from the page address list.
S403, the terminal performs kernel initialization to generate a corresponding WebView_i, and initializes a second page address X in the WebView_i to generate a corresponding candidate secondary page X.
S404, the terminal receives a plurality of general files such as HTML files, CSS files, JS files and the like of the candidate secondary page X sent by the text content distribution server.
S405, the terminal executes the JS file and the CSS file, and initializes the JS/CSS environment.
The terminal can cache the universal file set sent by the text content distribution server in a ServiceWorker cache (cache) for a period of time, so that when the cache period limit is not exceeded, the terminal does not need to download the universal file set from the text content distribution server each time, but directly obtains the JS file and the CSS file from ServiceWorker cache, and the operation of initializing the JS/CSS environment is executed, so that the downloading time is saved, and the rendering preprocessing speed can be accelerated.
S406, judging whether all the second page addresses are processed, if yes, ending the flow; otherwise, return to step 402.
Based on the above embodiment, referring to fig. 5, a specific application scenario is used to describe in further detail the loading of the rendered candidate secondary pages.
501. After receiving a trigger instruction of clicking the primary page by a user, the terminal transmits the URL of the secondary page to be loaded to the terminal by adopting an openUrl method.
S502, the terminal searches the transferred URL in the page address list sent by the Neul-Ark interface.
S503, the terminal judges whether the transferred URL exists in the page address list, if so, the step 504 is executed; otherwise, step 5012 is performed.
S504, the terminal judges whether a corresponding Ark page example exists in the WebView which is matched with the transmitted URL, if so, the step 505 is executed; otherwise, step 5012 is performed.
S505, the terminal puts the Ark page instance into the mounting pool.
S506, the terminal replaces the page address of the Ark page instance with the current URL through a replayState method.
S507, the terminal directly initiates an Ajax request to the service data server based on the current URL and receives the rendering data of the Ark page instance sent by the service data server.
And S508, the terminal performs full-screen rendering on the Ark page in the WebView based on the rendering data.
S509, when the Ark page is rendered, the WebView calls the HideLoading method, and notifies the terminal Ark that the page is rendered.
S5010, the terminal detects overtime, judges whether a HideLoading notification is received after 2 seconds, if yes, the step 5011 is executed; otherwise, step 5012 is performed.
S5011, loading the rendered Ark page by the terminal.
S5012, using the prior art, assigning a page address of the Ark page, and loading the rendered Ark page.
Based on the same inventive concept, in an embodiment of the present invention, a device for loading a two-level page is provided, as shown in fig. 6, at least including a matching unit 601, an obtaining unit 602, and a loading unit 603, where,
the matching unit 601 is configured to obtain a first page address, and obtain a candidate second page that matches the first page address in a preset candidate second page set;
an obtaining unit 602, configured to obtain rendering data corresponding to the candidate secondary page from a first server when it is determined that the candidate secondary page meets a preset rendering rule;
and a loading unit 603, configured to render the candidate secondary page based on the rendering data, and load the rendered candidate secondary page.
Optionally, before the terminal acquires the first page address, the matching unit 601 is further configured to:
sending a page address downloading request to a second server, and receiving a second page address set sent by the second server;
generating a corresponding candidate secondary page set based on the second page address set, and receiving a universal file set corresponding to each candidate secondary page sent by the second server;
and respectively acquiring the running environment files of the candidate secondary pages in each general file set, and executing corresponding running environment files in the candidate secondary pages.
Optionally, when it is determined that the candidate secondary page meets a preset rendering rule, rendering data corresponding to the candidate secondary page is acquired from a first server, and the acquiring unit 602 is configured to:
when determining that the candidate secondary page has executed to complete the running environment file, generating a third page address representing query rendering data based on the second page address of the candidate secondary page and a preset query data address base;
generating and sending a rendering data downloading request to the first server based on the third page address;
and receiving rendering data corresponding to the candidate secondary page sent by the first server.
Optionally, based on the rendering data, rendering the candidate secondary page, and loading the rendered candidate secondary page, where the loading unit 603 is configured to:
analyzing other general files corresponding to the candidate secondary pages;
and rendering each parsed general file and the rendering data into the candidate secondary pages in the running environment, and loading the rendered candidate secondary pages.
Optionally, the loading unit 603 is further configured to:
when the fact that the candidate secondary pages matched with the first page address do not exist is determined, a universal file set of the secondary pages to be loaded, which are sent by the second server, is obtained, wherein the secondary pages to be loaded are pages which are not subjected to rendering pretreatment;
acquiring the running environment files in the universal file set, and analyzing other universal files after the running environment files are executed;
receiving the rendering data of the secondary page to be loaded, which is sent by the first server, rendering each parsed general file and the rendering data into a secondary page in an operating environment, and loading the rendered secondary page.
Optionally, the loading unit 603 is further configured to:
when the candidate secondary pages are determined to be not in accordance with the rendering rules, acquiring a universal file set of the secondary pages to be loaded, which is sent by the second server;
acquiring the running environment files in the universal file set, and analyzing the other universal files after the running environment files are executed;
receiving the rendering data of the secondary page to be loaded, which is sent by the first server, rendering each parsed general file and the rendering data into a secondary page in an operating environment, and loading the rendered secondary page.
Based on the same inventive concept, in an embodiment of the present invention, a computing device is provided, and referring to fig. 7, at least including a memory 701 and a processor 702, where the memory 701 and the processor 702 complete communication with each other through a communication bus;
a memory 701 for storing program instructions;
the processor 702 is configured to obtain a first page address from a terminal, and obtain a candidate secondary page that matches the first page address from a preset candidate secondary page set;
when the terminal determines that the candidate secondary page accords with a preset rendering rule, rendering data corresponding to the candidate secondary page is obtained from a first server;
and the terminal renders the candidate secondary pages based on the rendering data and loads the rendered candidate secondary pages.
Based on the same inventive concept, in an embodiment of the present invention, there is provided a storage medium including at least:
the terminal acquires a first page address, and acquires a candidate secondary page matched with the first page address from a preset candidate secondary page set;
when the terminal determines that the candidate secondary page accords with a preset rendering rule, rendering data corresponding to the candidate secondary page is obtained from a first server;
and the terminal renders the candidate secondary pages based on the rendering data and loads the rendered candidate secondary pages.
In summary, the terminal obtains the candidate secondary page matched with the first page address in the candidate secondary page set, obtains rendering data corresponding to the candidate secondary page from the first server when determining that the candidate secondary page meets the rendering rule, and finally renders the candidate secondary page based on the rendering data and loads the rendered candidate secondary page.
Obviously, the terminal does not need to acquire the rendering data of each candidate secondary page, and only when the candidate secondary page matched with the first page address is further determined to be executed to finish rendering preprocessing, the terminal directly acquires the rendering data of the corresponding candidate secondary page to perform page rendering operation, so that the data volume downloaded by the terminal is reduced, the downloading pressure of the terminal is reduced, and the storage space of the terminal is saved; the rendering preparation time can be reduced, and the page loading speed and the page loading hit rate can be improved; because the rendering data of each candidate secondary page is different, the terminal can be ensured to generate pages with different contents, and the personalized requirements of users are met.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (8)

1. A method of two-level page loading, comprising:
the terminal sends a page address downloading request to a second server under the condition of receiving user login, and receives a second page address set sent by the second server;
the terminal generates a corresponding candidate secondary page set based on the second page address set, and receives a universal file set corresponding to each candidate secondary page sent by the second server;
the terminal respectively acquires the running environment files of each candidate secondary page in each general file set, and executes corresponding running environment files in each candidate secondary page; rendering pretreatment of each candidate secondary page is realized;
the method comprises the steps that a terminal obtains a first page address of a secondary page to be loaded, and obtains a candidate secondary page matched with the first page address in a preset candidate secondary page set;
when the terminal determines that the candidate secondary page accords with a preset rendering rule, rendering data corresponding to the candidate secondary page is obtained from a first server;
and the terminal renders the candidate secondary pages based on the rendering data and loads the rendered candidate secondary pages.
2. The method of claim 1, wherein the terminal, when determining that the candidate secondary page meets a preset rendering rule, obtains rendering data corresponding to the candidate secondary page from a first server, comprising:
when the terminal determines that the candidate secondary page has executed to complete the running environment file, generating a third page address representing query rendering data based on the second page address of the candidate secondary page and a preset query data address library;
the terminal generates and sends a rendering data downloading request to the first server based on the third page address;
and the terminal receives rendering data corresponding to the candidate secondary page sent by the first server.
3. The method of claim 2, wherein the terminal renders the candidate secondary page based on the rendering data and loads the rendered candidate secondary page, comprising:
the terminal analyzes other general files corresponding to the candidate secondary pages;
and the terminal renders each parsed general file and the rendering data into the candidate secondary page in the running environment, and loads the rendered candidate secondary page.
4. A method as claimed in any one of claims 1 to 3, further comprising:
when the terminal determines that no candidate secondary page matched with the first page address exists, acquiring a universal file set of a secondary page to be loaded, which is sent by the second server, wherein the secondary page to be loaded is a page which is not subjected to rendering pretreatment;
the terminal acquires the running environment files in the universal file set, and analyzes other universal files after the running environment files are executed;
the terminal receives the rendering data of the secondary page to be loaded, which is sent by the first server, renders each parsed general file and the rendering data into a secondary page in an operating environment, and loads the rendered secondary page.
5. A method as claimed in any one of claims 1 to 3, further comprising:
when the terminal determines that the candidate secondary page does not accord with the rendering rule, acquiring a universal file set of the secondary page to be loaded, which is sent by the second server;
the terminal acquires the running environment files in the universal file set, and analyzes other universal files after the running environment files are executed;
the terminal receives the rendering data of the secondary page to be loaded, which is sent by the first server, renders each parsed general file and the rendering data into a secondary page in an operating environment, and loads the rendered secondary page.
6. An apparatus for two-level page loading, comprising:
the matching unit is used for sending a page address downloading request to a second server under the condition that a user login is received, and receiving a second page address set sent by the second server;
generating a corresponding candidate secondary page set based on the second page address set, and receiving a universal file set corresponding to each candidate secondary page sent by the second server;
respectively acquiring operation environment files of each candidate secondary page in each general file set, and executing corresponding operation environment files in each candidate secondary page; rendering pretreatment of each candidate secondary page is realized; acquiring a first page address of a secondary page to be loaded, and acquiring a candidate secondary page matched with the first page address from a preset candidate secondary page set;
the acquisition unit is used for acquiring rendering data corresponding to the candidate secondary pages from the first server when the candidate secondary pages are determined to accord with a preset rendering rule;
and the loading unit is used for rendering the candidate secondary pages based on the rendering data and loading the rendered candidate secondary pages.
7. The apparatus of claim 6, wherein upon determining that the candidate secondary page meets a preset rendering rule, the obtaining unit is configured to obtain rendering data corresponding to the candidate secondary page from a first server:
when determining that the candidate secondary page has executed to complete the running environment file, generating a third page address representing query rendering data based on the second page address of the candidate secondary page and a preset query data address base;
generating and sending a rendering data downloading request to the first server based on the third page address;
and receiving rendering data corresponding to the candidate secondary page sent by the first server.
8. The apparatus of claim 7, wherein the candidate secondary page is rendered based on the rendering data, and the loading unit is to load the rendered candidate secondary page:
analyzing other general files corresponding to the candidate secondary pages;
and rendering each parsed general file and the rendering data into the candidate secondary pages in the running environment, and loading the rendered candidate secondary pages.
CN201911176639.4A 2019-11-26 2019-11-26 Method and device for loading secondary page Active CN112948011B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911176639.4A CN112948011B (en) 2019-11-26 2019-11-26 Method and device for loading secondary page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911176639.4A CN112948011B (en) 2019-11-26 2019-11-26 Method and device for loading secondary page

Publications (2)

Publication Number Publication Date
CN112948011A CN112948011A (en) 2021-06-11
CN112948011B true CN112948011B (en) 2023-08-08

Family

ID=76225197

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911176639.4A Active CN112948011B (en) 2019-11-26 2019-11-26 Method and device for loading secondary page

Country Status (1)

Country Link
CN (1) CN112948011B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017036309A1 (en) * 2015-08-31 2017-03-09 阿里巴巴集团控股有限公司 Page rendering method, device and apparatus
CN107451181A (en) * 2017-06-14 2017-12-08 北京小度信息科技有限公司 Page rendering method and apparatus
CN108287839A (en) * 2017-01-09 2018-07-17 阿里巴巴集团控股有限公司 A kind of page loading method and equipment
CN109165369A (en) * 2018-07-12 2019-01-08 北京猫眼文化传媒有限公司 Webpage display process and device
CN110321510A (en) * 2019-05-09 2019-10-11 苏州乐米信息科技股份有限公司 Page rendering method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017036309A1 (en) * 2015-08-31 2017-03-09 阿里巴巴集团控股有限公司 Page rendering method, device and apparatus
CN108287839A (en) * 2017-01-09 2018-07-17 阿里巴巴集团控股有限公司 A kind of page loading method and equipment
CN107451181A (en) * 2017-06-14 2017-12-08 北京小度信息科技有限公司 Page rendering method and apparatus
CN109165369A (en) * 2018-07-12 2019-01-08 北京猫眼文化传媒有限公司 Webpage display process and device
CN110321510A (en) * 2019-05-09 2019-10-11 苏州乐米信息科技股份有限公司 Page rendering method and system

Also Published As

Publication number Publication date
CN112948011A (en) 2021-06-11

Similar Documents

Publication Publication Date Title
CN110263275B (en) Method and device for accessing webpage, mobile terminal and storage medium
US8527862B2 (en) Methods for making ajax web applications bookmarkable and crawlable and devices thereof
CN105930528B (en) Webpage caching method and server
CN112685671A (en) Page display method, device, equipment and storage medium
CN112637361B (en) Page proxy method, device, electronic equipment and storage medium
CN104980512A (en) Method and equipment for providing target object based on mobile application
CN111294372B (en) Method, device and system for realizing cache in proxy server
CN111224880A (en) Interface data acquisition method and device for single-page application and storage medium
CN102981846A (en) Method for treating password input box element and browser for treating the password input box element
CN112800309A (en) Crawler system based on HTTP proxy and implementation method thereof
CN110515631B (en) Method for generating application installation data packet, server and computer storage medium
CN113536168B (en) Component processing method and device
CN109325192B (en) Advertisement anti-shielding method and device
CN111177600B (en) Built-in webpage loading method and device based on mobile application
CN112948011B (en) Method and device for loading secondary page
CN111680247A (en) Local calling method, device, equipment and storage medium of webpage character string
CN102999580A (en) Code input frame element processing method and browser
US20150154314A1 (en) Method, apparatus and terminal for webpage content browsing
CN110830537B (en) Page processing method and device
CN113934954A (en) Webpage first screen rendering method and device in application program
CN104679786B (en) Form processing method and device
CN113244624A (en) Game translation method and device
US11716405B1 (en) System and method for identifying cache miss in backend application
CN110020076B (en) Method and device for crawling webpage data
CN102902787B (en) A kind of method of browser and acquisition dns resolution data thereof

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
GR01 Patent grant
GR01 Patent grant