CN113420249A - Webpage display method and device, electronic equipment and storage medium - Google Patents

Webpage display method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113420249A
CN113420249A CN202110741331.0A CN202110741331A CN113420249A CN 113420249 A CN113420249 A CN 113420249A CN 202110741331 A CN202110741331 A CN 202110741331A CN 113420249 A CN113420249 A CN 113420249A
Authority
CN
China
Prior art keywords
webpage
data
access request
browser
web page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110741331.0A
Other languages
Chinese (zh)
Inventor
刘明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202110741331.0A priority Critical patent/CN113420249A/en
Publication of CN113420249A publication Critical patent/CN113420249A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure discloses a webpage display method and device, electronic equipment and a storage medium, and belongs to the technical field of webpage display. The webpage display method comprises the following steps: initiating a webpage access request to a server; displaying a first webpage based on cache data cached by a browser, wherein the cache data is data in a webpage rendering process based on a last webpage access request, and the webpage access request and the last webpage access request comprise the same webpage address; receiving webpage data fed back by a server in response to a webpage access request under the condition that a first webpage is displayed; and updating the first webpage into a second webpage obtained by rendering the webpage data. By adopting the webpage display method, the webpage display device, the electronic equipment and the storage medium, the problem that the time for displaying blank pages is long in the existing webpage display process is at least solved.

Description

Webpage display method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of web page display technologies, and in particular, to a web page display method and apparatus, an electronic device, and a storage medium.
Background
With the rapid development of internet and wireless communication technology, electronic devices such as mobile phones and tablet computers are becoming more and more popular and become indispensable tools in people's daily life. Electronic devices are generally equipped with a browser, and a user can browse rich and colorful contents by accessing a web page through the browser. In a process of accessing a web page through a browser by a user, generally, an electronic device obtains web page data of the web page from a server, and renders the web page by operating a Document Object Model (DOM) tree according to the web page data. However, it takes a certain time for the server to feed back the web page data, so that the time for the browser of the electronic device to display a blank page is long.
Disclosure of Invention
The embodiment of the disclosure aims to provide a webpage display method, a webpage display device, electronic equipment and a storage medium, so as to solve the problem that the time for displaying a blank page is long in the current webpage display process.
The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a method for displaying a web page, the method including:
initiating a webpage access request to a server;
displaying a first webpage based on cache data cached by a browser, wherein the cache data is data in a webpage rendering process based on a last webpage access request, and the webpage access request and the last webpage access request comprise the same webpage address;
receiving webpage data fed back by the server in response to the webpage access request under the condition that the first webpage is displayed;
and updating the first webpage into a second webpage obtained by rendering the webpage data.
In one embodiment, the cached data comprises at least one of an operation document object, DOM, and interface data.
In one embodiment, the displaying the first webpage based on the cached data cached by the browser includes:
acquiring a DOM of a browser in a webpage rendering process based on the last webpage access request;
inserting the acquired DOM into a page of the browser, and displaying a first webpage;
acquiring interface data of the browser in the webpage rendering process based on the last webpage access request;
and updating the first webpage into a webpage obtained by rendering the acquired interface data.
In one embodiment, after the updating the first webpage to the second webpage rendered by the webpage data, the method further includes:
and updating the cache data based on the webpage data.
In one embodiment, the updating the cache data based on the web page data includes:
updating the cache data and the timestamp of the cache data based on the webpage data;
the method further comprises the following steps:
and under the condition that a data cleaning instruction for the browser is received, if the time difference between the current time point and the timestamp is greater than or equal to the preset time length, deleting the cache data.
In one embodiment, the updating the cache data based on the web page data includes:
and updating the cache data based on the webpage data within a preset time after the first webpage is updated to the second webpage.
In one embodiment, the cached data comprises a DOM;
updating the cache data based on the web page data comprises:
acquiring a DOM tree generated by the webpage data, wherein the DOM tree comprises at least one DOM;
and updating the DOM cached in the browser into the DOM associated with the webpage content in the display area of the browser in the DOM tree.
According to a second aspect of the embodiments of the present disclosure, there is provided a web page display apparatus including:
the request module is configured to initiate a webpage access request to the server;
the first display module is configured to display a first webpage based on cache data cached by a browser, wherein the cache data is data in a webpage rendering process based on a last webpage access request, and the webpage access request and the last webpage access request comprise the same webpage address;
a data receiving module configured to receive webpage data fed back by the server in response to the webpage access request in a case where the first webpage is displayed;
a second display module configured to update the first webpage to a second webpage rendered from the webpage data.
In one embodiment, the cached data comprises at least one of an operation document object, DOM, and interface data.
In one embodiment, the first display module includes:
a DOM obtaining unit configured to obtain a DOM of the browser in a webpage rendering process based on the last webpage access request;
the first webpage display unit is configured to insert the acquired DOM into a page of the browser and display a first webpage;
an interface data acquisition unit configured to acquire interface data of the browser in a webpage rendering process based on the last webpage access request;
and the webpage updating unit is configured to update the first webpage to a webpage rendered by the acquired interface data.
In one embodiment, the apparatus further comprises:
a cache data update module configured to update the cache data based on the web page data.
In one embodiment, the cache data update module is specifically configured to:
updating the cache data and the timestamp of the cache data based on the webpage data;
the device further comprises:
and the data deleting module is configured to delete the cache data if the time difference between the current time point and the timestamp is greater than or equal to a preset time length under the condition that a data cleaning instruction for the browser is received.
In one embodiment, the cache data update module is specifically configured to:
and updating the cache data based on the webpage data within a preset time after the first webpage is updated to the second webpage.
In one embodiment, the cached data comprises a DOM;
the cache data updating module comprises:
a DOM tree generating unit configured to acquire a DOM tree generated from the web page data, wherein the DOM tree includes at least one DOM;
and the DOM updating unit is configured to update the cached DOM in the browser into a DOM associated with the webpage content in the display area of the browser in the DOM tree.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus, which may include:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement a web page display method as shown in any embodiment of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions of the computer-readable storage medium, when executed by a processor of a web page display apparatus or an electronic device, cause the web page display apparatus or the electronic device to implement a web page display method as shown in any one of the embodiments of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising computer programs/instructions which, when executed by a processor, implement the web page display method shown in any one of the embodiments of the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the embodiment of the disclosure, when a browser of an electronic device initiates a webpage access request to a server, the browser displays a first webpage through cache data cached in webpage rendering based on a last webpage access request, and then updates the displayed first webpage to a second webpage obtained by rendering real webpage data when real webpage data fed back by the server in response to the webpage access request are received. Therefore, in the process that the user accesses the webpage through the browser, the webpage can be displayed through the cache data cached in the last webpage access before the server returns the real webpage data, and therefore the time of displaying the blank page by the browser can be shortened.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow diagram illustrating a method of displaying a web page in accordance with an exemplary embodiment;
FIG. 2 is a schematic diagram of a web page shown in accordance with an exemplary embodiment;
fig. 3 is a block diagram illustrating a structure of a web page display apparatus according to an exemplary embodiment;
FIG. 4 is a block diagram illustrating a computing device, according to an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Referring to fig. 1, a flowchart of a method for displaying a web page according to an exemplary embodiment is shown, where the method is applied to an electronic device. As shown in fig. 1, the webpage display method may specifically include the following steps:
step 101, initiating a webpage access request to a server;
102, displaying a first webpage based on cache data cached by a browser, wherein the cache data is data in a webpage rendering process based on a last webpage access request, and the webpage access request and the last webpage access request comprise the same webpage address;
103, receiving webpage data fed back by the server in response to the webpage access request under the condition of displaying the first webpage;
and 104, updating the first webpage into a second webpage obtained by rendering the webpage data.
Based on the above, when a browser of the electronic device initiates a webpage access request to the server, the browser displays the first webpage through cache data cached in webpage rendering based on the last webpage access request, and then updates the displayed first webpage to the second webpage obtained by rendering real webpage data when receiving real webpage data fed back by the server in response to the webpage access request. Therefore, in the process that the user accesses the webpage through the browser, the webpage can be displayed through the cache data cached in the last webpage access before the server returns the real webpage data, and therefore the time of displaying the blank page by the browser can be shortened.
The above steps are described in detail below, specifically as follows:
in step 101, when the user needs to access the web page through the electronic device, the user may input a web page address in an address bar of the browser, and the browser receives the web page address and initiates a web page access request carrying the web page address to a server corresponding to the web page address.
For example, in a case that a user needs to access a video webpage and inputs a webpage address corresponding to the video webpage in a browser, the browser may initiate a webpage access request to a video server corresponding to the video webpage that needs to be accessed.
In step 102, in a case that the browser initiates the web page access request to the server, the electronic device may display the first web page based on the cached data cached by the browser.
In this embodiment of the application, the displaying of the first webpage based on the cache data cached by the browser may be that the browser searches whether the cache data exists in a storage area (e.g., localStorage) of the browser, and if the cache data exists, the browser reads the cache data and displays the first webpage through the read cache data.
Certainly, the above-mentioned browser may not have the condition of the above-mentioned cache data, for example, if the user accesses the certain webpage for the first time through the electronic device, that is, the access request of this time is a webpage access request initiated by accessing the webpage for the first time, or the cache data is deleted or lost, and the like, the electronic device may perform processing according to a conventional webpage display flow, that is, specifically, the above-mentioned method may further include: when the cached data is not cached in the browser, the electronic device may wait for web page data fed back by the server in response to the web page access request, and render the web page based on the received web page data fed back by the server.
In addition, the cache data is data in a process of rendering a webpage based on a last webpage access request, the last webpage access request is a webpage access request initiated before the webpage access request is initiated, that is, the webpage access request and the last webpage access request are webpage access requests initiated twice continuously, and the last webpage access request and the first access request include the same webpage address. Then, the process of the browser to cache the above cache data may be understood as: after the electronic device initiates the previous webpage access request to the server, the electronic device may receive data fed back by the server based on the previous webpage access request, and perform webpage rendering through the received data to display a webpage of a webpage address of the previous webpage access request, and the electronic device may cache data generated in a webpage rendering process in a browser to form the cached data.
It should be noted that the cache data may be any rendering data generated in the webpage rendering process, and the rendering data can implement the display of the webpage. Specifically, the cache data may include at least one of a Document Object (DOM) and interface data, so that the electronic device may display the first webpage more flexibly.
The DOM can be a DOM in a DOM tree generated in the process that the browser carries out webpage rendering based on the last webpage access request; the interface data may include variable data other than the webpage template in the webpage rendering process based on the last webpage access request.
It should be noted that, the first webpage is displayed based on the cache data cached by the browser, or the browser reads the cached DOM and inserts the DOM into the webpage page to generate and display the first webpage when the cache data includes the DOM; alternatively, when the cached data includes interface data, the browser may read the cached interface data, render the interface data to a web page template, and generate and display the first web page.
Or, in a case that the cache data may also include the DOM and the interface data, the step 102 may include:
acquiring a DOM of a browser in a webpage rendering process based on a last webpage access request;
inserting the acquired DOM into a page of the browser, and displaying a first webpage;
acquiring interface data of the browser in a webpage rendering process based on the last webpage access request;
and updating the first webpage into a webpage obtained by rendering the acquired interface data.
Based on this, the browser can insert the cached DOM into the page, generate and display the first webpage, and update the displayed first webpage through the cached interface data under the condition that the first webpage generated by the DOM is displayed, so that the displayed first webpage is closer to the real webpage, and the display quality of the webpage is improved.
When the electronic device displays the first webpage generated by the DOM, the obtaining of the interface data cached by the browser in the webpage rendering process based on the last webpage access request may be that the browser determines whether the interface data is cached in the storage area of the browser, and if the interface data is cached in the storage area, the browser reads the cached interface data and renders the interface data, and updates the first webpage to the rendered webpage.
Of course, in some cases, there may be no interface data in the memory area of the browser during the webpage rendering process based on the last webpage access request, such as the interface data being deleted or lost, and at this time, the browser may render using default interface data (such as null data) to update the first webpage.
In step 103, after the browser initiates the web page access request to the server, the server may respond to the web page access request, acquire real web page data of the web page access request, and send the acquired web page data to the electronic device, where the electronic device may receive the web page data when the browser displays the first web page.
The web page data may be any data used for displaying a web page required by a user by a browser, specifically, the web page data may be js (javascript) script data, and the browser may generate a DOM tree and interface data by the js script data, and render the DOM tree and the interface data to generate a web page.
In step 104, when the browser obtains the webpage data with the real webpage access request, the browser may generate a second webpage through the webpage data, and update the first webpage displayed in the middle to the second webpage.
It should be noted that, since the web page data obtained by initiating the web page request twice may be different, the second web page may be a different web page from the first web page.
Certainly, after the browser acquires the web page data, the browser may acquire the data to be cached, such as at least one of DOM and interface data, through the web page data, and cache the data to be cached, that is, after step 104, the method may further include: and updating the cache data based on the webpage data, so that the display of the middle page can be realized by using the latest updated cache data under the condition of initiating the webpage access request next time, the difference between the first webpage and the second webpage can be reduced, and the display effect of the webpage is improved.
It should be noted that, a user may initiate different web page access requests through a browser of the electronic device to access different web pages, and then, the browser may generate cache data for the web page data of each web page access request to cache.
Here, in order to avoid the excessive cache data stored in the storage area of the browser, the electronic device may prompt the user to periodically clean the cache data in the storage area of the browser; or, the updating the cache data based on the web page data may include:
updating the cache data and the timestamp of the cache data based on the webpage data;
the above method may further comprise:
and under the condition that a data cleaning instruction for the browser is received, if the time difference between the current time point and the timestamp is greater than or equal to the preset time length, deleting the cache data.
Based on the above, the browser can delete the cache data with the cache duration exceeding the preset duration according to the duration between the cache data and the current time point, so that the redundancy of the data in the browser is reduced.
The data cleaning instruction may be an instruction for instructing to clean data of a browser, and may be an instruction triggered by an input of a user when the browser is running, or may be an instruction automatically generated by an electronic device, which is not limited herein.
In the embodiment of the present application, the updating of the cache data based on the web page data may be performed in any time after the browser acquires the web page data; alternatively, the updating the cache data based on the web page data may include: and updating the cache data based on the webpage data within a preset time after the first webpage is updated to the second webpage, so that the cache data can be quickly updated by the browser, the difference between the displayed first webpage and the second webpage caused by updating of the content of the webpage is reduced, and the webpage display quality is ensured.
It should be noted that the preset time period may be set according to actual needs, for example, the preset time period may be set to be shorter to ensure that the user cannot input the webpage updating operation within the time period, and specifically, the preset time period may be set to be 0.5 s.
In addition, the browser updates cache data through the webpage data, and can cache all doms in a dom tree generated through the webpage data and all acquired interface data; or, specifically, the cached data includes DOM;
the updating the cache data based on the web page data may include:
acquiring a DOM tree generated by the webpage data, wherein the DOM tree comprises at least one DOM;
and updating the DOM cached in the browser into the DOM associated with the webpage content in the display area of the browser in the DOM tree.
Based on this, the browser may cache only the DOM associated with the web content located in the display area, so that it may be avoided that, in the case of too much web content, the cached cache data is too large, and the redundancy of the cache data is reduced.
Illustratively, as shown in fig. 2, the web page 20 displayed by the real web page data includes web page content 21 in the display area (i.e. in the screen) and web page content 22 outside the display area, for example, the web page content 22 needs the user to input a pull-down bar 23 pulling the edge of the web page to display, and then the browser may cache the DOM associated with the web page content 21.
Based on the same inventive concept, the disclosure also provides a webpage display device. The detailed description is made with reference to fig. 3.
Fig. 3 is a schematic structural diagram illustrating a web page display apparatus according to an exemplary embodiment.
As shown in fig. 3, the web page display device 300 may specifically include:
a request module 301 configured to initiate a web page access request to a server;
a first display module 302, configured to display a first webpage based on cached data cached by a browser, where the cached data is data in a webpage rendering process based on a last webpage access request, and the webpage access request and the last webpage access request include the same webpage address;
a data receiving module 303 configured to receive web page data fed back by the server in response to the web page access request in a case where the first web page is displayed;
a second display module 304 configured to update the first webpage to a second webpage rendered from the webpage data.
Based on the above, when a browser of the electronic device initiates a webpage access request to the server, the browser displays the first webpage through cache data cached in webpage rendering based on the last webpage access request, and then updates the displayed first webpage to the second webpage obtained by rendering real webpage data when receiving real webpage data fed back by the server in response to the webpage access request. Therefore, in the process that the user accesses the webpage through the browser, the webpage can be displayed through the cache data cached in the last webpage access before the server returns the real webpage data, and therefore the time of displaying the blank page by the browser can be shortened.
In one embodiment, the cached data comprises at least one of an operation document object, DOM, and interface data.
Therefore, the mode of displaying the first webpage by the electronic equipment can be more flexible.
In one embodiment, the first display module 302 includes:
a DOM obtaining unit configured to obtain a DOM of the browser in a webpage rendering process based on the last webpage access request;
the first webpage display unit is configured to insert the acquired DOM into a page of the browser and display a first webpage;
an interface data acquisition unit configured to acquire interface data of the browser in a webpage rendering process based on the last webpage access request;
and the webpage updating unit is configured to update the first webpage to a webpage rendered by the acquired interface data.
Based on this, the browser can insert the cached DOM into the page, generate and display the first webpage, and update the displayed first webpage through the cached interface data under the condition that the first webpage generated by the DOM is displayed, so that the displayed first webpage is closer to the real webpage, and the display quality of the webpage is improved.
In one embodiment, the apparatus 300 further includes:
a cache data update module configured to update the cache data based on the web page data.
Based on the above, the display of the middle page can be realized by using the latest updated cache data under the condition of initiating the webpage access request next time, so that the difference between the first webpage and the second webpage can be reduced, and the display effect of the webpage is improved.
In one embodiment, the cache data update module is specifically configured to:
updating the cache data and the timestamp of the cache data based on the webpage data;
the apparatus 300 further comprises:
and the data deleting module is configured to delete the cache data if the time difference between the current time point and the timestamp is greater than or equal to a preset time length under the condition that a data cleaning instruction for the browser is received.
Based on the above, the browser can delete the cache data with the cache duration exceeding the preset duration according to the duration between the cache data and the current time point, so that the redundancy of the data in the browser is reduced.
In one embodiment, the cache data update module is specifically configured to:
and updating the cache data based on the webpage data within a preset time after the first webpage is updated to the second webpage.
Therefore, the browser can quickly update the cache data, the difference between the displayed first webpage and the displayed second webpage caused by updating of the webpage content is reduced, and the webpage display quality is guaranteed.
In one embodiment, the cached data comprises a DOM;
the cache data updating module comprises:
a DOM tree generating unit configured to acquire a DOM tree generated from the web page data, wherein the DOM tree includes at least one DOM;
and the DOM updating unit is configured to update the cached DOM in the browser into a DOM associated with the webpage content in the display area of the browser in the DOM tree.
Based on this, the browser may cache only the DOM associated with the web content located in the display area, so that it may be avoided that, in the case of too much web content, the cached cache data is too large, and the redundancy of the cache data is reduced.
Based on the same inventive concept, the embodiment of the present disclosure further provides an electronic device, which is specifically described in detail with reference to fig. 4.
FIG. 4 is a block diagram illustrating a computing device, according to an example embodiment.
As shown in fig. 4, the computing device 400 is capable of implementing a block diagram of an exemplary hardware architecture of a computing device according to a web page display method and a web page display apparatus in the embodiments of the present disclosure. The computing device may refer to an electronic device in embodiments of the present disclosure.
The computing device 400 may include a processor 401 and a memory 402 storing computer program instructions.
Specifically, the processor 401 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
Memory 402 may include a mass storage for information or instructions. By way of example, and not limitation, memory 402 may include a Hard Disk Drive (HDD), a floppy disk drive, flash memory, an optical disk, a magneto-optical disk, magnetic tape, or a Universal Serial Bus (USB) drive or a combination of two or more of these. Memory 402 may include removable or non-removable (or fixed) media, where appropriate. Memory 402 may be internal or external to the integrated gateway device, where appropriate. In a particular embodiment, the memory 402 is a non-volatile solid-state memory. In a particular embodiment, the memory 402 includes Read Only Memory (ROM). Where appropriate, the ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
The processor 401, by reading and executing the computer program instructions stored in the memory 402, performs the following steps:
the processor 401 executes a web page access request initiated to the server;
displaying a first webpage based on cache data cached by a browser, wherein the cache data is data in a webpage rendering process based on a last webpage access request, the last webpage access request is the last webpage access request of the webpage access request, and the webpage access request and the last webpage access request comprise the same webpage address;
receiving webpage data fed back by the server in response to the webpage access request under the condition that the first webpage is displayed;
and updating the first webpage into a second webpage obtained by rendering the webpage data.
Based on the above, when a browser of the electronic device initiates a webpage access request to the server, the browser displays the first webpage through cache data cached in webpage rendering based on the last webpage access request, and then updates the displayed first webpage to the second webpage obtained by rendering real webpage data when receiving real webpage data fed back by the server in response to the webpage access request. Therefore, in the process that the user accesses the webpage through the browser, the webpage can be displayed through the cache data cached in the last webpage access before the server returns the real webpage data, and therefore the time of displaying the blank page by the browser can be shortened.
In one embodiment, the cached data comprises at least one of an operation document object, DOM, and interface data.
Therefore, the mode of displaying the first webpage by the electronic equipment can be more flexible.
In one embodiment, the processor 401 specifically executes to acquire a DOM of a browser in a webpage rendering process based on the previous webpage access request;
inserting the acquired DOM into a page of the browser, and displaying a first webpage;
acquiring interface data of the browser in the webpage rendering process based on the last webpage access request;
and updating the first webpage into a webpage obtained by rendering the acquired interface data.
Based on this, the browser can insert the cached DOM into the page, generate and display the first webpage, and update the displayed first webpage through the cached interface data under the condition that the first webpage generated by the DOM is displayed, so that the displayed first webpage is closer to the real webpage, and the display quality of the webpage is improved.
In one embodiment, the processor 401 further performs updating the cache data based on the web page data.
Based on the above, the display of the middle page can be realized by using the latest updated cache data under the condition of initiating the webpage access request next time, so that the difference between the first webpage and the second webpage can be reduced, and the display effect of the webpage is improved.
In one embodiment, the processor 401 executes updating the cache data and the timestamp of the cache data based on the web page data;
and under the condition that a data cleaning instruction for the browser is received, if the time difference between the current time point and the timestamp is greater than or equal to the preset time length, deleting the cache data.
Based on the above, the browser can delete the cache data with the cache duration exceeding the preset duration according to the duration between the cache data and the current time point, so that the redundancy of the data in the browser is reduced.
In one embodiment, the base processor 401 specifically executes updating the cache data based on the web page data within a preset time period after the first web page is updated to the second web page.
Therefore, the browser can quickly update the cache data, the difference between the displayed first webpage and the displayed second webpage caused by updating of the webpage content is reduced, and the webpage display quality is guaranteed.
In one embodiment, the cached data comprises a DOM;
the processor 401 specifically executes and acquires a DOM tree generated by the web page data, wherein the DOM tree includes at least one DOM;
and updating the DOM cached in the browser into the DOM associated with the webpage content in the display area of the browser in the DOM tree.
Based on this, the browser may cache only the DOM associated with the web content located in the display area, so that it may be avoided that, in the case of too much web content, the cached cache data is too large, and the redundancy of the cache data is reduced.
In one example, the computing device 400 may also include a transceiver 403 and a bus 404. As shown in fig. 4, the processor 401, the memory 402 and the transceiver 403 are connected via a bus 404 to complete communication therebetween.
Bus 404 comprises hardware, software, or both. By way of example, and not limitation, a bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hypertransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Control Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus or a combination of two or more of these. Bus 404 may include one or more buses, where appropriate. Although specific buses are described and shown in the embodiments of the application, any suitable buses or interconnects are contemplated by the application.
The embodiment of the disclosure also provides a computer storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are used for implementing the webpage display method described in the embodiment of the disclosure.
In some possible embodiments, various aspects of the methods provided by the present disclosure may also be implemented in the form of a program product including program code for causing a computer device to perform the steps of the methods according to various exemplary embodiments of the present disclosure described above in this specification when the program product is run on the computer device, for example, the computer device may perform the web page display method described in the embodiments of the present disclosure.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus and computer program products according to the present disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 image transmission device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable image transmission device, 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 image transmission 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 image transmission 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 changes and modifications can be made in the present disclosure without departing from the spirit and scope of the disclosure. Thus, if such modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is intended to include such modifications and variations as well.

Claims (10)

1. A method for displaying a web page, comprising:
initiating a webpage access request to a server;
displaying a first webpage based on cache data cached by a browser, wherein the cache data is data in a webpage rendering process based on a last webpage access request, and the webpage access request and the last webpage access request comprise the same webpage address;
receiving webpage data fed back by the server in response to the webpage access request under the condition that the first webpage is displayed;
and updating the first webpage into a second webpage obtained by rendering the webpage data.
2. The method according to claim 1, wherein the cached data comprises at least one of manipulating a document object, DOM, and interface data.
3. The method of claim 2, wherein displaying the first web page based on the cached data of the browser cache comprises:
acquiring a DOM of a browser in a webpage rendering process based on the last webpage access request;
inserting the acquired DOM into a page of the browser, and displaying a first webpage;
acquiring interface data of the browser in the webpage rendering process based on the last webpage access request;
and updating the first webpage into a webpage obtained by rendering the acquired interface data.
4. The method of any of claims 1-3, wherein after updating the first webpage to a second webpage rendered from the webpage data, further comprising:
and updating the cache data based on the webpage data.
5. The method of claim 4, wherein updating the cached data based on the web page data comprises:
updating the cache data and the timestamp of the cache data based on the webpage data;
the method further comprises the following steps:
and under the condition that a data cleaning instruction for the browser is received, if the time difference between the current time point and the timestamp is greater than or equal to the preset time length, deleting the cache data.
6. The method of claim 4, wherein updating the cached data based on the web page data comprises:
and updating the cache data based on the webpage data within a preset time after the first webpage is updated to the second webpage.
7. The method of claim 6, wherein the cached data comprises a DOM;
updating the cache data based on the web page data comprises:
acquiring a DOM tree generated by the webpage data, wherein the DOM tree comprises at least one DOM;
and updating the DOM cached in the browser into the DOM associated with the webpage content in the display area of the browser in the DOM tree.
8. A web page display apparatus, comprising:
the request module is configured to initiate a webpage access request to the server;
the first display module is configured to display a first webpage based on cache data cached by a browser, wherein the cache data is data in a webpage rendering process based on a last webpage access request, and the webpage access request and the last webpage access request comprise the same webpage address;
a data receiving module configured to receive webpage data fed back by the server in response to the webpage access request in a case where the first webpage is displayed;
a second display module configured to update the first webpage to a second webpage rendered from the webpage data.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the web page display method of any one of claims 1 to 7.
10. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of a web page display apparatus or an electronic device, cause the web page display apparatus or the electronic device to implement the web page display method according to any one of claims 1 to 7.
CN202110741331.0A 2021-06-30 2021-06-30 Webpage display method and device, electronic equipment and storage medium Pending CN113420249A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110741331.0A CN113420249A (en) 2021-06-30 2021-06-30 Webpage display method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110741331.0A CN113420249A (en) 2021-06-30 2021-06-30 Webpage display method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113420249A true CN113420249A (en) 2021-09-21

Family

ID=77717610

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110741331.0A Pending CN113420249A (en) 2021-06-30 2021-06-30 Webpage display method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113420249A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113961832A (en) * 2021-10-19 2022-01-21 广州虎牙科技有限公司 Page rendering method, device, equipment, storage medium and program product
CN117171473A (en) * 2023-08-29 2023-12-05 北京奇艺世纪科技有限公司 Web page request method, device, electronic device and storage medium
CN118035581A (en) * 2024-02-20 2024-05-14 浪潮通用软件有限公司 OFD file multi-level cache preview method, device, equipment and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110258532A1 (en) * 2009-03-31 2011-10-20 Luis Ceze Memoizing web-browsing computation with dom-based isomorphism
CN106446174A (en) * 2016-09-28 2017-02-22 江西博瑞彤芸科技有限公司 Method for page loading in application
CN109684575A (en) * 2018-10-30 2019-04-26 平安科技(深圳)有限公司 Processing method and processing device, storage medium, the computer equipment of web data
CN110287432A (en) * 2019-06-28 2019-09-27 北京金山安全软件有限公司 Network information processing method and device and electronic equipment
CN111339455A (en) * 2018-12-18 2020-06-26 阿里巴巴集团控股有限公司 Method and device for browser application loading page first screen
CN111666517A (en) * 2020-05-07 2020-09-15 曙光信息产业股份有限公司 Webpage access method and device and computer equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110258532A1 (en) * 2009-03-31 2011-10-20 Luis Ceze Memoizing web-browsing computation with dom-based isomorphism
CN106446174A (en) * 2016-09-28 2017-02-22 江西博瑞彤芸科技有限公司 Method for page loading in application
CN109684575A (en) * 2018-10-30 2019-04-26 平安科技(深圳)有限公司 Processing method and processing device, storage medium, the computer equipment of web data
CN111339455A (en) * 2018-12-18 2020-06-26 阿里巴巴集团控股有限公司 Method and device for browser application loading page first screen
CN110287432A (en) * 2019-06-28 2019-09-27 北京金山安全软件有限公司 Network information processing method and device and electronic equipment
CN111666517A (en) * 2020-05-07 2020-09-15 曙光信息产业股份有限公司 Webpage access method and device and computer equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113961832A (en) * 2021-10-19 2022-01-21 广州虎牙科技有限公司 Page rendering method, device, equipment, storage medium and program product
CN117171473A (en) * 2023-08-29 2023-12-05 北京奇艺世纪科技有限公司 Web page request method, device, electronic device and storage medium
CN118035581A (en) * 2024-02-20 2024-05-14 浪潮通用软件有限公司 OFD file multi-level cache preview method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN102682093B (en) Web page sectionally-loading method and web page sectionally-loading system for mobile browser
CN113420249A (en) Webpage display method and device, electronic equipment and storage medium
EP2755145A1 (en) Webpage browsing method and device, and storage medium
EP2653987A1 (en) Displaying web pages without downloading static files
CN111143725A (en) Page generating method, device and electronic device
US20190364133A1 (en) Display processing method and apparatus, and electronic terminal therefor
WO2020117656A1 (en) Comment information displaying method, device, electronic device, and computer readable medium
RU2610245C2 (en) Method and device for web page encode identification
JP5635672B1 (en) Image processing apparatus and image processing program
CN105956026A (en) Webpage rendering method and apparatus
CN104750793A (en) Method and device for generating page tables
CN113590974B (en) Recommendation page configuration method and device, electronic equipment and computer readable medium
CN104021158A (en) Method and device for adjusting webpage elements in webpage and mobile terminal
CN107330087A (en) Pagefile generation method and device
CN102023998B (en) Method and device for processing webpage so as to display on handheld equipment
CN104750730B (en) Browser display method and device
CN104035977B (en) Webpage loading method and device
EP3869812A1 (en) Video playing method and apparatus
JP5695966B2 (en) Interest estimation apparatus, method and program
CN114691236B (en) Method, device, equipment and medium for integrating native program and mini program
CN113127772A (en) Method and device for determining webpage access address, electronic equipment and storage medium
US10996845B2 (en) Method, application, browser, and electronic device for providing webpage content
CN107193819B (en) Method and equipment for webpage pre-reading, browser and client equipment
CN109670454B (en) Biological information introduction method, biological information introduction device and terminal equipment
CN112631525A (en) Storage and display method, device, equipment and medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210921