CN112559927A - Webpage loading method and device - Google Patents

Webpage loading method and device Download PDF

Info

Publication number
CN112559927A
CN112559927A CN202011538525.2A CN202011538525A CN112559927A CN 112559927 A CN112559927 A CN 112559927A CN 202011538525 A CN202011538525 A CN 202011538525A CN 112559927 A CN112559927 A CN 112559927A
Authority
CN
China
Prior art keywords
webpage
resource package
webpage resource
package
local
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.)
Granted
Application number
CN202011538525.2A
Other languages
Chinese (zh)
Other versions
CN112559927B (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 CN202011538525.2A priority Critical patent/CN112559927B/en
Publication of CN112559927A publication Critical patent/CN112559927A/en
Application granted granted Critical
Publication of CN112559927B publication Critical patent/CN112559927B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

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

Abstract

The application provides a webpage loading method and a webpage loading device, wherein the webpage loading method comprises the following steps: receiving a webpage resource package downloading notification, and sending a webpage resource package downloading request to a server under the condition of accessing a network; after receiving the response message fed back by the server, comparing the local webpage resource package with the webpage resource package of the server side, and downloading and decompressing the webpage resource package needing to be updated; intercepting a webpage access request when the webpage access request is detected, searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage access request, and matching a webpage resource file corresponding to the webpage access request from the searched webpage resource package; and returning the corresponding webpage resource file after the matching is successful, and rendering and displaying a webpage according to the webpage resource file.

Description

Webpage loading method and device
Technical Field
The application relates to the technical field of internet, in particular to a webpage loading method. The application also relates to a webpage loading device, a computing device and a computer readable storage medium.
Background
With the rapid development of internet technology, various applications are in a wide range, a situation that a web page is loaded by using a browser often occurs in the applications, and how to load resources to the page more quickly in order to improve user experience is one of the hot topics of research in the field.
In the prior art, three page loading modes are commonly used, namely, picture resources are loaded according to needs, so that the display speed of the multi-picture webpage content is greatly increased, but the multi-picture webpage content cannot be displayed under the condition of no network access; secondly, content distribution network nodes (CDN nodes) are added, so that resources can be obtained from a closer node server and can be used only after payment is needed; and thirdly, a browser cache mechanism can realize webpage loading under the condition of no network, but the cache space is small, and resources can be cleaned. Therefore, a method for loading web pages which is faster, does not pay fees and can be realized without a network is needed.
Disclosure of Invention
In view of this, the present application provides a method for loading a web page. The application also relates to a webpage loading device, a computing device and a computer readable storage medium, which are used for solving the technical defects in the prior art.
According to a first aspect of an embodiment of the present application, a method for loading a web page is provided, which includes:
receiving a webpage resource package downloading notification, and sending a webpage resource package downloading request to a server under the condition of accessing a network;
after receiving the response message fed back by the server, comparing the local webpage resource package with the webpage resource package of the server side, and downloading and decompressing the webpage resource package needing to be updated;
intercepting a webpage access request when the webpage access request is detected, searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage access request, and matching a webpage resource file corresponding to the webpage access request from the searched webpage resource package;
and returning the corresponding webpage resource file after the matching is successful, and rendering and displaying a webpage according to the webpage resource file.
Optionally, after receiving the response message fed back by the server, comparing the local webpage resource package with the webpage resource package of the server, and downloading and decompressing the webpage resource package to be updated, the method includes:
and after receiving the response message fed back by the server, comparing the version number of the local webpage resource package with the version number of the webpage resource package at the server side, and downloading and decompressing the corresponding webpage resource package when the version numbers are inconsistent.
Optionally, after comparing the version number of the local webpage resource package with the version number of the webpage resource package at the server, the method further includes:
and deleting the local webpage resource package which is inconsistent with the version number of the webpage resource package at the server side.
Optionally, the downloading and decompressing the webpage resource package that needs to be updated includes:
dividing the webpage resource package into a first webpage resource package, a second webpage resource package and a third webpage resource package according to the weight of the webpage resource package;
after accessing the network, downloading and decompressing the first webpage resource packet;
when the network speed is higher than a first threshold value, downloading and decompressing a second webpage resource packet;
when the terminal is in an idle state and the network speed is higher than a second threshold value, downloading and decompressing a third webpage resource packet;
wherein the second threshold is higher than the first threshold.
Optionally, after the matching of the web resource file corresponding to the web access request from the found web resource package, the method further includes:
and releasing the webpage access request after the matching fails.
Optionally, when a web access request is detected, intercepting the web access request, searching a corresponding web resource package from a local web resource package according to an identifier of the web access request, and matching a web resource file corresponding to the web access request from the searched web resource package; after matching is successful, returning the corresponding webpage resource file, rendering and displaying a webpage according to the webpage resource file, and comprising the following steps:
intercepting a webpage HTML request when the webpage HTML request is detected, searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage HTML request, and matching an HTML file corresponding to the webpage HTML request from the searched webpage resource package;
after matching is successful, returning the corresponding HTML file, rendering a webpage, and if matching is failed, releasing the webpage HTML request;
intercepting the webpage resource request when detecting that the webpage resource request exists, searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage resource request, and matching a resource file corresponding to the webpage resource request from the searched webpage resource package;
and returning the corresponding resource file after the matching is successful, rendering and displaying the webpage, and releasing the webpage resource request if the matching is failed.
Optionally, the web page resource package includes an HTML file, a resource file, and a configuration file, where the configuration file includes a mapping relationship between a public network address and a local address of the web page resource package, and the identifier of the web page access request includes the public network address in the web page access request;
searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage access request comprises the following steps:
determining a local address corresponding to the public network address according to the mapping relation between the public network address and the local address of the webpage resource packet contained in the configuration file;
and searching a corresponding webpage resource packet from the local webpage resource packet according to the local address.
Optionally, the mapping relationship between the public network address and the local address includes one-to-one matching, many-to-one wildcard matching, and many-to-many wildcard matching.
According to a second aspect of the embodiments of the present application, there is provided a web page loading apparatus, including:
the sending module is configured to receive a webpage resource package downloading notification and send a webpage resource package downloading request to the server under the condition of accessing the network;
the downloading module is configured to compare the local webpage resource package with the webpage resource package of the server side after receiving the response message fed back by the server, and download and decompress the webpage resource package needing to be updated;
the intercepting module is configured to intercept a webpage access request when the webpage access request is detected, search a corresponding webpage resource package from a local webpage resource package according to an identifier of the webpage access request, and match a webpage resource file corresponding to the webpage access request from the searched webpage resource package;
and the display module is configured to return the corresponding webpage resource file after the matching is successful, and render and display the webpage according to the webpage resource file.
According to a third aspect of embodiments of the present application, there is provided a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the web page loading method when executing the instructions.
According to a fourth aspect of embodiments of the present application, there is provided a computer-readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the web page loading method.
The webpage loading method receives a webpage resource package downloading notification, and sends a webpage resource package downloading request to a server under the condition of accessing a network; after receiving the response message fed back by the server, comparing the local webpage resource package with the webpage resource package of the server side, and downloading and decompressing the webpage resource package needing to be updated; intercepting a webpage access request when the webpage access request is detected, searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage access request, and matching a webpage resource file corresponding to the webpage access request from the searched webpage resource package; and returning the corresponding webpage resource file after the matching is successful, and rendering and displaying a webpage according to the webpage resource file. The webpage resource package is downloaded to the terminal in advance to be stored, the downloaded webpage resource package is directly used for rendering webpage contents when the terminal opens the webpage, the network access is not needed, the time-consuming process of acquiring data from the internet when the webpage is opened is omitted, and the acceleration effect is achieved.
Drawings
Fig. 1 is a flowchart of a method for loading a web page according to an embodiment of the present application;
FIG. 2 is a flow chart of a many-to-many wildcard matching provided by an embodiment of the present application;
fig. 3 is a flowchart illustrating a web page loading method applied to video software according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a web page loading apparatus according to an embodiment of the present application;
fig. 5 is a block diagram of a computing device according to an embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The terminology used in the one or more embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the present application. As used in one or more embodiments of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present application refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments of the present application to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first aspect may be termed a second aspect, and, similarly, a second aspect may be termed a first aspect, without departing from the scope of one or more embodiments of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
First, the noun terms to which one or more embodiments of the present application relate are explained.
HTML: i.e., hypertext markup language, is an identifying language. The document format on the network can be unified through the labels, so that the scattered Internet resources are connected into a logic whole.
And (3) offline acceleration: the terminal can present the internet content without accessing the internet, thereby avoiding the data transmission time and achieving the acceleration effect.
Sandbox path: each application has its own sandbox path, the application sandbox is a file system directory, which is isolated from the file systems of other applications, and the application does not allow access to the sandbox path of other applications.
Next, a brief description is given of the basic concept of the page loading method provided in the present application.
The page loading method in the prior art mainly comprises three methods, namely loading picture resources as required and adding a CDN node and a browser cache mechanism. When the picture resources are loaded on the terminal webpage as required to display the picture, the corresponding thumbnail is downloaded to display the picture instead of the original picture according to the screen resolution, so that the flow is saved, the display speed of the multi-picture webpage content is greatly increased, and the multi-picture webpage content needs to be accessed to a network. The CDN nodes are added to cache network resources on the CDN nodes, when terminal web pages download resources, the resources are downloaded from the nearest CDN nodes, a remote resource server does not need to be accessed, but the CDN nodes are added to pay and need to be accessed to a network. The browser caching mechanism automatically caches the resources applying the standard for use in next loading because most browsers support the Cache-Control and Last-Modified standards in the HTTP header, but the resources can take effect only after the first loading, and the caching space is limited and can be cleaned.
In order to improve the speed of webpage loading without accessing a network, the application provides a webpage loading method, which receives a video webpage resource package downloading notification and sends a video webpage resource package downloading request to a server under the condition of accessing the network; after receiving the response message fed back by the server, comparing the local video webpage resource package with the video webpage resource package of the server side, and downloading and decompressing the video webpage resource package needing to be updated; when a video webpage access request is detected, intercepting the video webpage access request, searching a corresponding video webpage resource package from a local video webpage resource package according to the identification of the video webpage access request, and matching a video webpage resource file corresponding to the video webpage access request from the searched video webpage resource package; and returning the corresponding video webpage resource file after the matching is successful, and rendering and displaying the webpage according to the video webpage resource file. The video webpage resource package is pre-downloaded to the mobile phone for storage, the downloaded video webpage resource package is directly used for rendering the page content when the mobile phone opens the webpage, the network access is not needed, the time-consuming process of acquiring data from the internet when the video webpage is opened is omitted, and the acceleration effect is achieved.
The present application provides a web page loading method, and the present application relates to a web page loading apparatus, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments one by one.
Fig. 1 shows a flowchart of a method for loading a web page according to an embodiment of the present application, which specifically includes the following steps:
step 102: and receiving a webpage resource package downloading notification, and sending a webpage resource package downloading request to the server under the condition of accessing the network.
Specifically, the webpage resource package downloading notification refers to a downloading notification automatically generated when a user opens a terminal application program; the access network refers to network connection which is used for connecting a terminal with WIFI (wireless fidelity), accessing mobile data and the like and can transmit data with a server; the web resource package download request is a request transmitted by the terminal to request the server for a web resource package that can be downloaded.
In practical application, a terminal display displays a graph of an application program, a user can operate the application program through clicking, pressing and the like, and after the application program is operated, a webpage resource package downloading notification is immediately generated, namely the terminal receives the webpage resource package downloading notification. In the case of accessing a network, that is, in the case of enabling communication between a terminal and a server, the terminal sends a web resource package download request to the server, that is, requests a web resource package which can be downloaded to the server.
For example, when a user opens a video playing application on the terminal by clicking an icon of the video playing application, the terminal receives a notification of downloading a web resource package for the video playing application. And detecting that the terminal is accessed to the network and can communicate with the server, and requesting a downloadable webpage resource data packet from the server by the terminal.
According to the application, the terminal can automatically receive the webpage resource package download information when the application program runs, and requests the server for the downloadable webpage resource package, so that the webpage loading speed can be increased when a follow-up user browses the webpage, and the user experience is improved.
And 104, after receiving the response message fed back by the server, comparing the local webpage resource package with the webpage resource package of the server, and downloading and decompressing the webpage resource package needing to be updated.
Specifically, the response message fed back by the server refers to that the server feeds back to the terminal to allow the terminal to download the webpage resource package. After receiving the feedback response message, the terminal needs to compare the local webpage resource package with the webpage resource package of the server side, and after comparison, downloads the webpage resource package with the version number different between the local webpage resource package and the server side. In order to increase the speed of transmitting or downloading the webpage resource package, the downloaded webpage resource package is a compressed package, and after the downloading is completed, the decompression operation needs to be performed on the webpage resource package.
In practical application, after receiving the response message fed back by the server, the specific implementation process of comparing the local webpage resource package with the webpage resource package of the server side and downloading and decompressing the webpage resource package needing to be updated may be as follows:
and after receiving the response message fed back by the server, comparing the version number of the local webpage resource package with the version number of the webpage resource package at the server side, and downloading and decompressing the corresponding webpage resource package when the version numbers are inconsistent.
It should be noted that each web resource package has a corresponding version number, and when comparing the local web resource package with the web resource package at the server side, the comparison of the whole web resource package is not required, and only the version number of the web resource package needs to be compared. Therefore, the webpage resource package needing to be updated can be quickly determined, and the complex process of comparing the local webpage resource package with the webpage resource package of the server side by the terminal is also omitted to a certain extent.
In practical application, a terminal installs an application program, and when the application program is operated for the first time, after a response message fed back by a server is received, because the terminal does not have a web resource package corresponding to the application program, the web resource package allowed to be downloaded by the server needs to be downloaded and decompressed, and the version number of the web resource package is recorded. When the application program is operated again, after the response message fed back by the server is received, the terminal only needs to compare the version number of the local webpage resource package with the version number of the webpage resource package at the server end because the terminal has the webpage resource package corresponding to the application program, and for the webpage resource packages with inconsistent version numbers, the version numbers need to be downloaded and decompressed, and the version numbers are updated at the same time.
In addition, after comparing the version number of the local web resource package with the version number of the web resource package at the server side, the terminal needs to delete the local web resource package which is inconsistent with the version number of the web resource package at the server side.
In practical application, because the storage space of the terminal is limited, after the version number of the local webpage resource package is compared with the version number of the webpage resource package at the server side, the old version webpage resource package with the version number inconsistent with the version number of the webpage resource package at the server side needs to be deleted, so that the phenomenon that the old version webpage resource package occupies too much storage space can be avoided. In addition, if there is no version number of the web resource package at the server side corresponding to the version number of the local web resource package, the web resource package is considered to be offline, and the local web resource package also needs to be deleted. And the terminal deletes the web page resource packages with old versions and offline, so that the storage space of the terminal is saved.
It should be noted that, the web resource package has an attribute of a download priority weight, and the terminal performs scheduled downloading according to the weight by combining the current network state, the disk remaining space, and the remote server pressure, and the specific implementation process may be:
dividing the webpage resource package into a first webpage resource package, a second webpage resource package and a third webpage resource package according to the weight of the webpage resource package;
after accessing the network, downloading and decompressing the first webpage resource packet;
when the network speed is higher than a first threshold value, downloading and decompressing a second webpage resource packet;
when the terminal is in an idle state and the network speed is higher than a second threshold value, downloading and decompressing a third webpage resource packet;
wherein the second threshold is higher than the first threshold.
Specifically, the first webpage resource package refers to a webpage resource package in which the core page function cannot normally operate or the online major problem cannot be timely repaired due to the fact that the terminal lacks the webpage resource package, and the first webpage resource package is immediately downloaded when the application program is started and the network is accessed. For the second webpage resource package, the terminal downloads the second webpage resource package when the network is available after the application program is started, the network speed is higher than a first threshold value, and the pressure of the server is lower than the threshold value. For the third webpage resource packet, since the normal operation of the application program is not affected, the terminal downloads the application program when the application program is in an idle state, the network speed is higher than the second threshold value, or the network state is WiFi, and the server pressure is low. For the webpage resource packages with different weights, different priority levels can be selected for downloading, the downloading is more flexible, and the downloading pressure of the terminal is reduced while the operation of an application program is not influenced.
According to the webpage resource package updating method and device, the webpage resource package needing to be updated can be determined by comparing the local webpage resource package with the webpage resource package of the server side, the webpage resource package needing to be updated is downloaded and decompressed, the webpage resource package is pre-downloaded, when a user accesses a webpage conveniently, the terminal can quickly present the webpage according to the local webpage resource package, and user experience is improved.
And 106, intercepting the webpage access request when detecting that the webpage access request exists, searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage access request, and matching a webpage resource file corresponding to the webpage access request from the searched webpage resource package.
Specifically, the web page access request refers to a request issued when a terminal application opens a web page using a browser. On the basis that the terminal finishes pre-downloading the webpage resource package, namely on the basis that the local webpage resource package is compared with the webpage resource package of the server side, and the webpage resource package needing to be updated is downloaded and decompressed, further, when a user opens an application program on the terminal and accesses a webpage by using a browser, a webpage access request is sent to the server, the webpage access request is intercepted by the terminal, meanwhile, the terminal processes the webpage access request, an identifier in the webpage access request is resolved, the webpage resource package corresponding to the webpage is found from the locally downloaded webpage resource package according to the identifier, and then the corresponding webpage resource file is matched from the found webpage resource package according to the webpage access request.
In practical application, a phenomenon that matching is unsuccessful may exist when a web resource file corresponding to the web access request is matched from a found web resource package, that is, a web resource file corresponding to the web access request cannot be matched in a local web resource package, and at this time, the terminal releases the web access request after matching is failed, that is, the web access request is sent to the server, so that the browser normally initiates the web access request, and thus, a web access fault caused by the loss of the local web resource package is avoided.
Further, the webpage resource package comprises an HTML file, a resource file and a configuration file, wherein the configuration file comprises a mapping relation between a public network address and a local address of the webpage resource package, and the identifier of the webpage access request comprises the public network address in the webpage access request;
searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage access request comprises the following steps:
determining a local address corresponding to the public network address according to the mapping relation between the public network address and the local address of the webpage resource packet contained in the configuration file;
and searching a corresponding webpage resource packet from the local webpage resource packet according to the local address.
In practical application, the configuration file may be a json configuration file, and when a public network address of a web page is input, a local address of a resource may be output through a mapping relationship between the public network address and the local address of a web page resource packet in the configuration file, that is, a local address corresponding to the public network address is determined, and then the corresponding web page resource packet may be directly searched in the local web page resource packet according to the local address. In addition, the sandbox path and the resource package version path of the terminal application are supplemented when the local address is output. The application program opens a webpage address by using a browser, namely after a public network address of a resource is input, the browser sends a page access request, the terminal intercepts the page access request, namely prevents the page access request from entering the public network, a local address corresponding to the public network address is determined according to the mapping relation between the public network address of the page access request and a configuration file, and a corresponding webpage resource package is directly found in a downloaded webpage resource package according to the local address. If the matching fails, after the page access request is released, the terminal searches a corresponding server on the public network according to the public network address, downloads a webpage resource package corresponding to the webpage and returns.
It should be noted that the mapping relationship between the public network address and the local address includes one-to-one matching, many-to-one wildcard matching, and many-to-many wildcard matching.
The one-to-one matching is that only a specific public network address can be converted into a specific local address, such as "key: html, configuration values: html ", also as" key: https:// remote-image-host/black/banner.webp, configuration values: bundle _ name/image/banner. And when the public network address hits the one-to-one matching, converting the public network address into a local address according to the one-to-one matching.
The many-to-one wildcard match is a method which can convert a plurality of public network addresses into a specific type of local address, such as' key: https:// remote-css-host/, configuration values: bundle _ name/css/v1/style. css ", where" "is a wildcard. And when the public network address hits the many-to-one matching, converting the public network address into a local address according to the many-to-one matching.
The many-to-many wildcard matching can convert a plurality of public network addresses into a plurality of different local addresses, such as' key: https:// remote-js-host/, configuration values: bundle _ name/js/, where "" is a wildcard. And when the public network address hits the many-to-many wildcard matching, converting the public network address into a local address according to the many-to-many wildcard matching.
Specifically, referring to fig. 3, the process of many-to-many wildcard matching is described in detail:
determining the public network address 202 as ' https:// remote-js-host/blackberry/activity/main.js ', selecting a corresponding mapping relation according to the public network address, and hitting a configuration 204 ' key: https:// remote-js-host/, configuration values: bundle _ name/js/, it can be seen that the mapping relationship is a many-to-many wildcard match. The public network address 202 is then split into a non-wildcard portion 206 "https:// remote-js-host/" and a wildcard portion 208 "blackberry/activity/main. For the non-wildcard part 206 "https:// remote-js-host/", the key value 210 is replaced by a configuration value to obtain "bundle _ name/js/", then the webpage resource package version directory hierarchy 212 is supplemented to obtain "bundle _ name/v 2/js/", and the sandbox directory hierarchy 214 of the supplementary application becomes "app _ bundle/bundle _ name/v 2/js/", and is combined with the wildcard/activity/main.js "of the wildcard part 208 to form a local path 216" app _ bundle/bundle _ name/v 2/js/blackberry/activity/main.js ", and finally" file:// bundle _ name/v 2/js/activity/main.js ", namely, a local address 218 is formed.
According to the method and the device, the webpage access request can be intercepted, the corresponding webpage resource package can be searched according to the identification of the webpage access request, and the webpage resource package corresponding to the webpage access request is matched from the webpage resource package, so that the corresponding file related to the accessed page can be conveniently and quickly found, the speed of webpage presentation is favorably improved, and the user experience is improved.
And 108, returning the corresponding webpage resource file after matching is successful, and rendering and displaying a webpage according to the webpage resource file.
Specifically, after the matched webpage resource file is returned, the terminal renders a webpage according to the returned webpage resource file, and finally forms a webpage which the user wants to access and displays the webpage to the user.
It should be noted that, when an application program is opened and a page is accessed in a user, a browser initiates a page access request and the page access request is divided into two categories, that is, when the page access request is detected, the page access request is intercepted, a corresponding page resource package is searched from a local page resource package according to an identifier of the page access request, and a page resource file corresponding to the page access request is matched from the searched page resource package; after matching is successful, returning the corresponding webpage resource file, and rendering and displaying the webpage according to the webpage resource file can be realized in the following specific steps:
intercepting a webpage HTML request when the webpage HTML request is detected, searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage HTML request, and matching an HTML file corresponding to the webpage HTML request from the searched webpage resource package;
after matching is successful, returning the corresponding HTML file, rendering a webpage, and if matching is failed, releasing the webpage HTML request;
intercepting the webpage resource request when detecting that the webpage resource request exists, searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage resource request, and matching a resource file corresponding to the webpage resource request from the searched webpage resource package;
and returning the corresponding resource file after the matching is successful, rendering and displaying the webpage, and releasing the webpage resource request if the matching is failed.
Specifically, the web page HTML request refers to a request sent when a terminal application opens a web page address by using a browser; the webpage resource request refers to a request sent when a browser in a terminal application program starts to render a webpage; the HTML file refers to a file in which each part of a web page to be displayed is marked by a mark symbol; the resource files refer to files corresponding to resources such as js, css and pictures.
In practical application, when a terminal application program uses a browser to open a webpage address, a webpage HTML request is firstly initiated, the terminal intercepts the webpage HTML request when detecting the webpage HTML request, finds a corresponding webpage resource package according to an identifier in the webpage HTML request, and then matches an HTML file corresponding to the webpage HTML request in the found webpage resource package. Specifically, for a terminal of an Android system, a WebResourceResponseSouldIntertereRequest (WebView, WebResourceRequest request) function in WebViewClient is used for matching, if matching is successful, an HTML file in a webpage resource package is returned, and the terminal renders a webpage according to the returned HTML file; if the matching fails, nil is returned, and meanwhile, the terminal releases the webpage HTML request and initiates a normal network request. For the terminal of the iOS system, matching a webpage html file in a resource package before loading a webpage, and then calling a loadHTMLString in WKWebView, wherein the baseURL is used for returning the corresponding webpage html file; if the matching fails, the WKWebView directly executes the loadRequest, namely the method normally initiates a network request, namely the terminal releases a webpage HTML request and initiates a normal network request.
Further, after the terminal renders the webpage according to the returned HTML file, it is clear how the webpage displays the content therein, including: how the characters are processed, how the pictures are arranged, how the pictures are displayed and the like, a series of webpage resource requests are initiated at the moment, the terminal intercepts the webpage resource requests when detecting the webpage resource requests, finds out the corresponding webpage resource packages according to the identification in the webpage resource requests, and then matches the resource files corresponding to the webpage resource requests in the found webpage resource packages. For example, if the web page resource request is a web page picture request, the corresponding web page picture file is matched in the web page resource packet according to the web page picture request.
Specifically, for the terminal of the Android system, the process of intercepting and matching the web page resource request and the process of intercepting and matching the web page HTML request are similar, and are not described herein again. For the terminal of the iOS system, intercepting the webpage resource request by using methods such as WKURLSchemeHandler and the like, matching and returning the resource files in the webpage resource packet, and if the resource files cannot be matched, normally initiating the network request.
It should be noted that one or more web page resource requests may be used. If a plurality of webpage resource requests exist, the method for intercepting the webpage resource requests and matching the webpage resource files is carried out one by one. And displaying the webpage after all webpage resource requests are completed, namely all webpage resources are rendered.
According to the method and the device, the webpage content can be rendered through the locally downloaded webpage resource file, the network does not need to be accessed, and the offline acceleration of the webpage is realized.
The webpage loading method receives a webpage resource package downloading notification, and sends a webpage resource package downloading request to a server under the condition of accessing a network; after receiving the response message fed back by the server, comparing the local webpage resource package with the webpage resource package of the server side, and downloading and decompressing the webpage resource package needing to be updated; intercepting a webpage access request when the webpage access request is detected, searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage access request, and matching a webpage resource file corresponding to the webpage access request from the searched webpage resource package; and returning the corresponding webpage resource file after the matching is successful, and rendering and displaying a webpage according to the webpage resource file. The webpage resource package is downloaded to the terminal in advance to be stored, the downloaded webpage resource package is directly used for rendering webpage contents when the terminal opens the webpage, the network access is not needed, the time-consuming process of acquiring data from the internet when the webpage is opened is omitted, and the acceleration effect is achieved.
The following will further describe the web page loading method by taking an application of the web page loading method provided by the present application in video software as an example, with reference to fig. 3. Fig. 3 shows a processing flow chart of a web page loading method applied to video software according to an embodiment of the present application, which specifically includes the following steps:
step 302: downloading/updating the webpage resource package.
When a user starts the video software, receiving a video webpage resource package downloading notification, and sending a video webpage resource package downloading request to a server under the condition of accessing a network.
Specifically, the video webpage resource package downloading notification refers to a downloading notification automatically generated when a user opens video software in a mobile phone; the access network refers to states of a mobile phone such as WIFI connection, mobile data access and the like; the video webpage resource package downloading request refers to a request sent by a mobile phone requesting a server for a video webpage resource package which can be downloaded. The video webpage resource package comprises an HTML file, a css/js/picture resource file and a configuration file, wherein the configuration file comprises a mapping relation between a public network address and a local address of the video webpage resource package.
In practical application, the mobile phone page displays the graph of the video software, a user can open the video software by clicking the graph, and the mobile phone receives the download notice of the video webpage resource package. And in the case of accessing the network, requesting a downloadable video webpage resource package from the server by the mobile phone.
According to the method and the device, the downloading of the video webpage resource package can be automatically received when the video software runs, and the downloadable video webpage resource package is requested from the server, so that the page loading speed can be increased when a follow-up user watches videos, and the user experience is improved.
And after receiving the response message fed back by the server, comparing the local video webpage resource package with the video webpage resource package of the server side, and downloading and decompressing the video webpage resource package needing to be updated.
Specifically, after receiving the feedback response message, the local video webpage resource package needs to be compared with the video webpage resource package at the server side, and after comparison, the video webpage resource package with the version number different between the local video webpage resource package and the server side is downloaded. In order to increase the rate of transmitting or downloading the video webpage resource package, the downloaded video webpage resource package is a compressed package, and after the downloading is completed, the decompression operation needs to be performed on the video webpage resource package.
Further, after receiving the response message fed back by the server, comparing the version number of the local video webpage resource package with the version number of the video webpage resource package at the server side, and downloading and decompressing the corresponding video webpage resource package when the version numbers are not consistent.
It should be noted that each video webpage resource package has a corresponding version number, and when comparing the local video webpage resource package with the video webpage resource package at the server side, the comparison of the whole video webpage resource package is not required, and only the version number of the video webpage resource package needs to be compared. Therefore, the video webpage resource package needing to be updated can be quickly determined, and the complex process of comparing the local video webpage resource package with the video webpage resource package of the server side by the mobile phone is omitted to a certain extent.
In addition, after comparing the version number of the local video webpage resource package with the version number of the video webpage resource package at the server side, the terminal needs to delete the local webpage resource package which is inconsistent with the version number of the video webpage resource package at the server side.
In practical application, because the storage space in the mobile phone is limited, after the version number of the local video webpage resource package is compared with the version number of the video webpage resource package at the server side, the video webpage resource package of the old version with the version number inconsistent with that of the video webpage resource package at the server side needs to be deleted, so that the video webpage resource package of the old version can be prevented from occupying too much storage space. In addition, if there is no version number of the video web page resource package of the server side corresponding to the version number of the local video web page resource package, it is considered that the video web page resource package is offline, and the local video web page resource package also needs to be deleted. And deleting the video webpage resource package with the old version and the offline version, so that the internal storage space of the mobile phone is saved.
It should be noted that the video webpage resource package has an attribute of a download priority weight, and scheduled downloading is performed according to the weight by combining the current network state, the disk remaining space, and the remote server pressure, and the specific implementation process may be:
dividing the webpage resource package into a first video webpage resource package, a second video webpage resource package and a third video webpage resource package according to the weight of the video webpage resource package;
after accessing the network, downloading and decompressing a first video webpage resource packet;
when the network speed is higher than a first threshold value, downloading and decompressing a second video webpage resource packet;
when the terminal is in an idle state and the network speed is higher than a second threshold value, downloading and decompressing a third video webpage resource packet;
wherein the second threshold is higher than the first threshold.
Specifically, the first video webpage resource package refers to a video webpage resource package which is lack of the video webpage resource package and can cause that the core page function of the video software cannot normally operate or the online major problem cannot be timely repaired, and the first video resource package can be immediately downloaded when the application program is started and the network is accessed. For the second video webpage resource package, the second video webpage resource package is downloaded when the network is available after the application program is started, the network speed is higher than a first threshold value, and the server pressure is lower than a threshold value. For the third video webpage resource packet, since the normal operation of the application program is not affected, the third video webpage resource packet is downloaded when the application program is in an idle state, the network speed is higher than the second threshold value, or the network state is WiFi, and the server pressure is low. For video webpage resource packages with different weights, different priority levels can be selected for downloading, the downloading is more flexible, and the downloading pressure is reduced while the running of video software is not influenced.
According to the method and the device, the video webpage resource package needing to be updated can be determined by comparing the local video webpage resource package with the video webpage resource package of the server side, the video webpage resource package needing to be updated is downloaded and decompressed, the video webpage resource package is pre-downloaded, when a user conveniently views a video page, the webpage can be quickly presented according to the local video webpage resource package, and user experience is improved.
Step 304: and opening the browser.
The user can open a page of a certain video which the user wants to browse through the video software, namely, open a browser.
Step 306: HTML is requested.
Specifically, when a user opens video software on a mobile phone and accesses a video page, an HTML request of the video page is sent to a server, and at the moment, the HTML request of the video page is intercepted.
Step 308: matching the HTML file.
And finding a corresponding video webpage resource package from the locally downloaded video webpage resource package according to the identification of the intercepted video webpage HTML request, and matching a corresponding HTML file from the found video webpage resource package according to the video webpage HTML request. If the matching fails, go to step 310; if the matching is successful, the corresponding HTML file is returned, and step 312 is executed.
Step 310: the far-end HTML is requested.
And after the matching fails, the terminal releases the video webpage HTML request, the browser normally initiates the video webpage HTML request, requests a corresponding HTML file from the remote server and returns the corresponding HTML file.
Step 312: and rendering the HTML.
And after the corresponding HTML file is obtained, rendering the page of the video webpage according to the HTML file.
Step 314: requesting css/js/picture resources.
When rendering HTML is completed, the browser sends out a video webpage resource request, namely a css/js/picture resource request. And simultaneously intercepting the css/js/picture resource request by the terminal.
Step 316: and matching the cs/js/picture resource files.
And searching a corresponding video webpage resource package from a local video webpage resource package according to the intercepted identification of the css/js/picture resource request, and matching a css/js/picture resource file corresponding to the video webpage resource request from the searched video webpage resource package. Matching successfully, returning the corresponding css/js/picture resource file, and executing step 320; if the match fails, step 318 is performed.
Step 318: requesting remote css/js/picture resources.
And rendering and displaying the page, and releasing the video webpage resource request if the matching fails.
And after the matching fails, the terminal releases the cs/js/picture resource request, the browser normally initiates the cs/js/picture resource request, requests a corresponding cs/js/picture resource file from a remote server and returns the corresponding cs/js/picture resource file.
Step 320: and rendering cs/js/picture.
And after the corresponding css/js/picture resource file is obtained, rendering the page of the video webpage according to the css/js/picture resource file.
Step 322: the next resource request.
Judging whether a next resource request exists, if so, executing step 314; if not, step 324 is performed.
Step 324: the web page is presented.
And presenting the rendered video webpage to the client.
The webpage loading method provided by the application downloads/updates the webpage resource package; opening a browser; requesting HTML; matching HTML files; requesting far-end HTML; rendering HTML; requesting css/js/picture resources; matching css/js/picture resource files; requesting a remote cs/js/picture resource; rendering css/js/picture; a next resource request; the web page is presented. The video webpage resource package is pre-downloaded to the mobile phone for storage, the downloaded video webpage resource package is directly used for rendering the page content when the mobile phone opens the webpage, the network access is not needed, the time-consuming process of acquiring data from the internet when the video webpage is opened is omitted, and the acceleration effect is achieved.
Corresponding to the above method embodiment, the present application further provides an embodiment of a web page loading device, and fig. 4 shows a schematic structural diagram of a web page loading device provided in an embodiment of the present application. As shown in fig. 4, the apparatus includes:
a sending module 402, configured to receive a notification of downloading the web resource package, and send a request for downloading the web resource package to the server in case of accessing the network;
the downloading module 404 is configured to compare the local webpage resource package with the webpage resource package of the server side after receiving the response message fed back by the server, and download and decompress the webpage resource package required to be updated;
the intercepting module 406 is configured to intercept the web page access request when the web page access request is detected, search a corresponding web page resource package from a local web page resource package according to an identifier of the web page access request, and match a web page resource file corresponding to the web page access request from the searched web page resource package;
and the display module 408 is configured to return the corresponding web resource file after the matching is successful, and render and display a web page according to the web resource file.
The downloading module 404 is further configured to compare the version number of the local web resource package with the version number of the web resource package at the server side after receiving the response message fed back by the server, and download and decompress the corresponding web resource package when the version numbers are not consistent.
The device, still include:
and the deleting module is configured to delete the local webpage resource package which is inconsistent with the version number of the webpage resource package at the server side.
The downloading module 404 is further configured to divide the web resource package into a first web resource package, a second web resource package, and a third web resource package according to the weight of the web resource package, download and decompress the first web resource package after accessing the network, download and decompress the second web resource package when the network speed is higher than a first threshold, and download and decompress the third web resource package when the terminal is in an idle state and the network speed is higher than a second threshold, where the second threshold is higher than the first threshold.
The device, still include:
and the releasing module is configured to release the webpage access request after the matching fails.
The intercepting module 406 is further configured to intercept the web page HTML request when the web page HTML request is detected, search a corresponding web page resource package from a local web page resource package according to the identifier of the web page HTML request, and match an HTML file corresponding to the web page HTML request from the searched web page resource package.
The display module 408 is further configured to return the corresponding HTML file after the matching is successful, and render a web page.
The releasing module is also configured to release the webpage HTML request if the matching fails;
the intercepting module 406 is further configured to intercept the web resource request when detecting that there is a web resource request, search a corresponding web resource package from a local web resource package according to an identifier of the web resource request, and match a resource file corresponding to the web resource request from the searched web resource package.
The display module 408 is further configured to return the corresponding resource file after the matching is successful, render a webpage, and display the webpage.
The releasing module is further configured to release the web page resource request if the matching fails.
The intercepting module 406 is further configured to configure the web resource package to include an HTML file, a resource file, and a configuration file, where the configuration file includes a mapping relationship between a public network address and a local address of the web resource package, the identifier of the web access request includes the public network address in the web access request, a local address corresponding to the public network address is determined according to the mapping relationship between the public network address and the local address of the web resource package included in the configuration file, and the corresponding web resource package is searched from the local web resource package according to the local address.
The intercepting module 406 is further configured to configure the mapping relationship between the public network address and the local address to include one-to-one matching, many-to-one wildcard matching, and many-to-many wildcard matching.
The webpage loading device comprises a sending module, a receiving module and a processing module, wherein the sending module is configured to receive a webpage resource package downloading notification and send a webpage resource package downloading request to a server under the condition of accessing a network; the downloading module is configured to compare the local webpage resource package with the webpage resource package of the server side after receiving the response message fed back by the server, and download and decompress the webpage resource package needing to be updated; the intercepting module is configured to intercept a webpage access request when the webpage access request is detected, search a corresponding webpage resource package from a local webpage resource package according to an identifier of the webpage access request, and match a webpage resource file corresponding to the webpage access request from the searched webpage resource package; and the display module is configured to return the corresponding webpage resource file after the matching is successful, and render and display the webpage according to the webpage resource file. The webpage resource package is downloaded to the terminal in advance to be stored, the downloaded webpage resource package is directly used for rendering webpage contents when the terminal opens the webpage, the network access is not needed, the time-consuming process of acquiring data from the internet when the webpage is opened is omitted, and the acceleration effect is achieved.
The foregoing is a schematic scheme of a web page loading apparatus according to this embodiment. It should be noted that the technical solution of the web page loading apparatus and the technical solution of the web page loading method belong to the same concept, and details that are not described in detail in the technical solution of the web page loading apparatus can be referred to the description of the technical solution of the web page loading method.
FIG. 5 illustrates a block diagram of a computing device 500 provided in accordance with one embodiment of the present description. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. Processor 520 is coupled to memory 510 via bus 530, and database 550 is used to store data.
Computing device 500 also includes access device 540, access device 540 enabling computing device 500 to communicate via one or more networks 560. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. The access device 540 may include one or more of any type of network interface, e.g., a Network Interface Card (NIC), wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 500, as well as other components not shown in FIG. 5, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 5 is for purposes of example only and is not limiting as to the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 500 may also be a mobile or stationary server.
Wherein, the processor 520 implements the steps of the web page loading method when executing the instructions.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above-mentioned web page loading method belong to the same concept, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the above-mentioned web page loading method.
An embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions, and when the instructions are executed by a processor, the steps of the foregoing webpage loading method are implemented.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the above-mentioned web page loading method belong to the same concept, and details that are not described in detail in the technical solution of the storage medium can be referred to the description of the technical solution of the above-mentioned web page loading method.
The foregoing description of specific embodiments of the present application has been presented. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and its practical applications, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.

Claims (11)

1. A webpage loading method is characterized by comprising the following steps:
receiving a webpage resource package downloading notification, and sending a webpage resource package downloading request to a server under the condition of accessing a network;
after receiving the response message fed back by the server, comparing the local webpage resource package with the webpage resource package of the server side, and downloading and decompressing the webpage resource package needing to be updated;
intercepting a webpage access request when the webpage access request is detected, searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage access request, and matching a webpage resource file corresponding to the webpage access request from the searched webpage resource package;
and returning the corresponding webpage resource file after the matching is successful, and rendering and displaying a webpage according to the webpage resource file.
2. The method of claim 1, wherein after receiving the response message fed back by the server, comparing the local webpage resource package with the server-side webpage resource package, and downloading and decompressing the webpage resource package needing to be updated, comprises:
and after receiving the response message fed back by the server, comparing the version number of the local webpage resource package with the version number of the webpage resource package at the server side, and downloading and decompressing the corresponding webpage resource package when the version numbers are inconsistent.
3. The method of claim 2, wherein after comparing the version number of the local webpage resource package with the version number of the server-side webpage resource package, further comprising:
and deleting the local webpage resource package which is inconsistent with the version number of the webpage resource package at the server side.
4. The method of claim 1 or 2, wherein downloading and decompressing the webpage resource package requiring updating comprises:
dividing the webpage resource package into a first webpage resource package, a second webpage resource package and a third webpage resource package according to the weight of the webpage resource package;
after accessing the network, downloading and decompressing the first webpage resource packet;
when the network speed is higher than a first threshold value, downloading and decompressing a second webpage resource packet;
when the terminal is in an idle state and the network speed is higher than a second threshold value, downloading and decompressing a third webpage resource packet;
wherein the second threshold is higher than the first threshold.
5. The method as claimed in claim 1, wherein after matching the web resource file corresponding to the web access request from the found web resource package, further comprising:
and releasing the webpage access request after the matching fails.
6. The method according to claim 1 or 5, wherein when a web access request is detected, the web access request is intercepted, a corresponding web resource package is searched from a local web resource package according to an identifier of the web access request, and a web resource file corresponding to the web access request is matched from the searched web resource package; after matching is successful, returning the corresponding webpage resource file, rendering and displaying a webpage according to the webpage resource file, and comprising the following steps:
intercepting a webpage HTML request when the webpage HTML request is detected, searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage HTML request, and matching an HTML file corresponding to the webpage HTML request from the searched webpage resource package;
after matching is successful, returning the corresponding HTML file, rendering a webpage, and if matching is failed, releasing the webpage HTML request;
intercepting the webpage resource request when detecting that the webpage resource request exists, searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage resource request, and matching a resource file corresponding to the webpage resource request from the searched webpage resource package;
and returning the corresponding resource file after the matching is successful, rendering and displaying the webpage, and releasing the webpage resource request if the matching is failed.
7. The method of claim 1, wherein the web page resource package comprises an HTML file, a resource file, and a configuration file, wherein the configuration file contains a mapping relationship between a public network address and a local address of the web page resource package, and the identification of the web page access request comprises the public network address in the web page access request;
searching a corresponding webpage resource package from a local webpage resource package according to the identification of the webpage access request comprises the following steps:
determining a local address corresponding to the public network address according to the mapping relation between the public network address and the local address of the webpage resource packet contained in the configuration file;
and searching a corresponding webpage resource packet from the local webpage resource packet according to the local address.
8. The method of claim 7, wherein the mapping of public network addresses to local addresses comprises one-to-one matching, many-to-one wildcard matching, many-to-many wildcard matching.
9. A web page loading apparatus, comprising:
the sending module is configured to receive a webpage resource package downloading notification and send a webpage resource package downloading request to the server under the condition of accessing the network;
the downloading module is configured to compare the local webpage resource package with the webpage resource package of the server side after receiving the response message fed back by the server, and download and decompress the webpage resource package needing to be updated;
the intercepting module is configured to intercept a webpage access request when the webpage access request is detected, search a corresponding webpage resource package from a local webpage resource package according to an identifier of the webpage access request, and match a webpage resource file corresponding to the webpage access request from the searched webpage resource package;
and the display module is configured to return the corresponding webpage resource file after the matching is successful, and render and display the webpage according to the webpage resource file.
10. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 1-8 when executing the instructions.
11. A computer-readable storage medium storing computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1 to 8.
CN202011538525.2A 2020-12-23 2020-12-23 Webpage loading method and device Active CN112559927B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011538525.2A CN112559927B (en) 2020-12-23 2020-12-23 Webpage loading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011538525.2A CN112559927B (en) 2020-12-23 2020-12-23 Webpage loading method and device

Publications (2)

Publication Number Publication Date
CN112559927A true CN112559927A (en) 2021-03-26
CN112559927B CN112559927B (en) 2023-01-03

Family

ID=75031530

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011538525.2A Active CN112559927B (en) 2020-12-23 2020-12-23 Webpage loading method and device

Country Status (1)

Country Link
CN (1) CN112559927B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988284A (en) * 2021-05-13 2021-06-18 太平金融科技服务(上海)有限公司 Application program starting method and device, computer equipment and storage medium
CN113268261A (en) * 2021-07-16 2021-08-17 北京乐学帮网络技术有限公司 Page content display method and device and electronic equipment
CN113312572A (en) * 2021-05-17 2021-08-27 深圳市中科明望通信软件有限公司 Resource processing method and device, storage medium and electronic equipment
CN113626741A (en) * 2021-07-02 2021-11-09 杭州隆埠科技有限公司 Method and equipment for loading webpage of mobile client
CN113656107A (en) * 2021-08-23 2021-11-16 天津中新智冠信息技术有限公司 Mobile application loading method and device and electronic equipment
CN114064146A (en) * 2021-11-16 2022-02-18 珠海金山数字网络科技有限公司 Resource loading method and device
CN114760282A (en) * 2022-04-29 2022-07-15 深圳依时货拉拉科技有限公司 Network request method, device, equipment and storage medium based on IOS system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104965848A (en) * 2015-02-12 2015-10-07 腾讯科技(深圳)有限公司 Front-end resource loading method and apparatus
CN106709046A (en) * 2016-12-30 2017-05-24 深圳天珑无线科技有限公司 Webpage display method and device
CN108228818A (en) * 2017-12-29 2018-06-29 网易(杭州)网络有限公司 Web page resources loading method and device, electronic equipment and storage medium
CN108549673A (en) * 2018-03-29 2018-09-18 优视科技有限公司 Pre-add support method, client, server and the network system of web page resources
CN108932332A (en) * 2018-07-05 2018-12-04 麒麟合盛网络技术股份有限公司 The loading method and device of static resource
CN109710870A (en) * 2018-12-27 2019-05-03 北京微播视界科技有限公司 Loading method, device, electronic equipment and the readable storage medium storing program for executing of the H5 page
CN112073405A (en) * 2020-09-03 2020-12-11 中国平安财产保险股份有限公司 Webpage data loading method and device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104965848A (en) * 2015-02-12 2015-10-07 腾讯科技(深圳)有限公司 Front-end resource loading method and apparatus
CN106709046A (en) * 2016-12-30 2017-05-24 深圳天珑无线科技有限公司 Webpage display method and device
CN108228818A (en) * 2017-12-29 2018-06-29 网易(杭州)网络有限公司 Web page resources loading method and device, electronic equipment and storage medium
CN108549673A (en) * 2018-03-29 2018-09-18 优视科技有限公司 Pre-add support method, client, server and the network system of web page resources
CN108932332A (en) * 2018-07-05 2018-12-04 麒麟合盛网络技术股份有限公司 The loading method and device of static resource
CN109710870A (en) * 2018-12-27 2019-05-03 北京微播视界科技有限公司 Loading method, device, electronic equipment and the readable storage medium storing program for executing of the H5 page
CN112073405A (en) * 2020-09-03 2020-12-11 中国平安财产保险股份有限公司 Webpage data loading method and device, computer equipment and storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988284A (en) * 2021-05-13 2021-06-18 太平金融科技服务(上海)有限公司 Application program starting method and device, computer equipment and storage medium
CN113312572A (en) * 2021-05-17 2021-08-27 深圳市中科明望通信软件有限公司 Resource processing method and device, storage medium and electronic equipment
CN113626741A (en) * 2021-07-02 2021-11-09 杭州隆埠科技有限公司 Method and equipment for loading webpage of mobile client
CN113268261A (en) * 2021-07-16 2021-08-17 北京乐学帮网络技术有限公司 Page content display method and device and electronic equipment
CN113656107A (en) * 2021-08-23 2021-11-16 天津中新智冠信息技术有限公司 Mobile application loading method and device and electronic equipment
CN114064146A (en) * 2021-11-16 2022-02-18 珠海金山数字网络科技有限公司 Resource loading method and device
CN114064146B (en) * 2021-11-16 2024-04-09 珠海金山数字网络科技有限公司 Resource loading method and device
CN114760282A (en) * 2022-04-29 2022-07-15 深圳依时货拉拉科技有限公司 Network request method, device, equipment and storage medium based on IOS system

Also Published As

Publication number Publication date
CN112559927B (en) 2023-01-03

Similar Documents

Publication Publication Date Title
CN112559927B (en) Webpage loading method and device
WO2020199751A1 (en) Method and apparatus for loading page picture, and electronic device
RU2689439C2 (en) Improved performance of web access
US11436066B2 (en) System for offline object based storage and mocking of rest responses
CN105095280A (en) Caching method and apparatus for browser
CN111756847B (en) Method and device for supporting https protocol by website
US9727643B2 (en) Managing loading of web pages
US20070288591A1 (en) Method, system, and program product for caching application data in a browser cache
CA3151766A1 (en) Systems and methods for in-application dynamic content loading
CN112926002A (en) Service request processing method and device
CN111339461A (en) Page access method of application program and related product
CN110928547A (en) Public file extraction method, device, terminal and storage medium
CN115858972A (en) Page display method and device of application program, storage medium and computer equipment
CN116127219A (en) Method and device for displaying pages in applet and computer equipment
CN114528510A (en) Webpage data processing method and device, electronic equipment and medium
US11379653B2 (en) Rendering method for on-demand loading of PDF file on network
CN114186148A (en) Page loading method and device, electronic equipment and storage medium
CN113626741A (en) Method and equipment for loading webpage of mobile client
CN117411847B (en) Mail out-link picture transfer method, system and medium
CN113449215B (en) Picture loading method and device
CN116112573B (en) Terminal interface conversion method, device, equipment, storage medium and program product
CN117978418A (en) Page rendering method, device and storage medium
CN116708588A (en) File compression downloading method, device, equipment, medium and program product
JP2014229119A (en) Web browsing history analysis system and its web browsing state reproduction method
Singh et al. Optimizing the Performance of Mobile Web Application

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