Webpage loading method and device, electronic equipment and storage medium

By obtaining the pre-request address from the local offline package in the application, downloading web page resources, and intercepting the download request when the loading component loads the web page, directly sending the downloaded resources, the problem of long loading time in the application is solved, improving the Loading speed and user experience.

CN119441650APending Publication Date: 2025-02-14BEIJING DUYOU INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411545715.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

When loading web pages in an application, network requests are required for multiple resources, resulting in a long loading time and affecting the user experience.

Method used

By receiving web page loading instructions, start the loading component, and obtain the offline package of the destination web page, including the pre-requested address, from the locally stored offline package. Then, the resource is downloaded based on the pre-request address, and the download request is intercepted when the loading component loads the web page, and the downloaded resource is sent directly to reduce network latency.

Benefits of technology

It improves the loading speed of web pages, reduces the time-consuming loading of web pages in the application, and improves the user's browsing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441650A_ABST
    Figure CN119441650A_ABST
Patent Text Reader

Abstract

The invention provides a webpage loading method and device, electronic equipment and a storage medium, and relates to the technical field of computers, in particular to the technical field of application programs and webpage display. According to the specific implementation scheme, a webpage loading instruction is received, wherein the webpage loading instruction is used for indicating loading of a target webpage; then, a loading component is started to load the target webpage, a target offline package corresponding to the target webpage is obtained from the offline packages stored locally, and the target offline package comprises the pre-request address of the first resource in the target webpage. The first resource is then downloaded based on the pre-requested address. In the process that the loading component loads the target webpage, a downloading request sent by the loading component to the server is intercepted, and if the downloading request is used for requesting to download the first resource, the first resource is sent to the loading component, so that the loading component loads the target webpage based on the first resource. The time consumption for loading the webpage in the application program is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to the field of application programs and web page display technology. Background Art

[0002] Applications (APPs) can be installed in various electronic devices such as mobile phones or tablets to provide users with various services such as message transmission, multimedia information display, and data processing. Applications can not only display native pages, but also web pages, allowing users to browse web content directly in the application without switching to other browsers. Summary of the invention

[0003] The present disclosure provides a webpage loading method, device, electronic device and storage medium.

[0004] In a first aspect of an embodiment of the present disclosure, a webpage loading method is provided, comprising:

[0005] receiving a webpage loading instruction, wherein the webpage loading instruction is used to instruct to load a target webpage;

[0006] Start the loading component to load the target web page;

[0007] Acquire a target offline package corresponding to the target webpage from each offline package stored locally, wherein the target offline package includes: a pre-request address of a first resource in the target webpage;

[0008] Based on the pre-request address, download the first resource;

[0009] During the process of the loading component loading the target webpage, intercepting a download request sent by the loading component to a server;

[0010] If the download request is used to request downloading of the first resource, the first resource is sent to the loading component, so that the loading component loads the target webpage based on the first resource.

[0011] According to a second aspect of the present disclosure, there is provided a webpage loading device, including:

[0012] A receiving module, used for receiving a webpage loading instruction, wherein the webpage loading instruction is used for instructing to load a target webpage;

[0013] A starting module, used for starting a loading component to load the target web page;

[0014] An acquisition module, configured to acquire a target offline package corresponding to the target webpage from each offline package stored locally, wherein the target offline package includes: a pre-request address of a first resource in the target webpage;

[0015] A download module, configured to download the first resource based on the pre-request address;

[0016] An interception module, used for intercepting a download request sent by the loading component to the server during the process of the loading component loading the target web page;

[0017] A sending module is used for sending the first resource to the loading component if the download request is for requesting to download the first resource, so that the loading component loads the target webpage based on the first resource.

[0018] According to a third aspect of the present disclosure, an electronic device is provided, including:

[0019] at least one processor; and

[0020] a memory communicatively connected to the at least one processor; wherein,

[0021] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any method according to the first aspect.

[0022] According to a fourth aspect of the embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of the first aspects.

[0023] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method according to any one of the first aspects is implemented.

[0024] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0026] Figure 1 is a flow chart of a webpage loading method provided by an embodiment of the present disclosure;

[0027] Figure 2 is a flow chart of a method for downloading an offline package provided by an embodiment of the present disclosure;

[0028] Figure 3 is a flow chart of another webpage loading method provided by an embodiment of the present disclosure;

[0029] Figure 4 is an exemplary schematic diagram of a webpage loading process provided by an embodiment of the present disclosure;

[0030] Figure 5 is a structural schematic diagram of a webpage loading device provided by an embodiment of the present disclosure;

[0031] Figure 6 It is a block diagram of an electronic device used to implement the webpage loading method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0033] When an application needs to load a web page, it starts the web view (webview) and loads the web page through the web view. However, when loading a web page, the web view needs to make network requests for multiple resources included in the web page, and wait until all resources are obtained before rendering the web page, which makes it take a long time to display the web page in the application. As a result, users have to wait for a long time to browse the web page in the application, and they may even lose patience and exit before the web page is rendered, which greatly affects the user experience of the application.

[0034] In order to reduce the time consumption of loading web pages in an application, the present disclosure provides a web page loading method, which can be applied to electronic devices, and specifically to applications installed in electronic devices. For example, the electronic device can be a mobile phone, a tablet computer, or a smart watch, etc., which has network communication and data processing capabilities. Figure 1 As shown, the webpage loading method provided by the embodiment of the present disclosure includes the following steps:

[0035] S101: Receive a webpage loading instruction, wherein the webpage loading instruction is used to instruct to load a target webpage.

[0036] When the application detects that the user clicks a web link control in a native page, the application can confirm that the web page loading instruction has been received and determine that the web page corresponding to the web link control is the target web page. Alternatively, when the application detects that the user clicks a web link shared by others in a message dialog box, the application can confirm that the web page loading instruction has been received and determine that the web page corresponding to the web link is the target web page.

[0037] The application program may also receive the webpage loading instruction in other ways, which are not specifically limited in the embodiments of the present disclosure.

[0038] S102: Start the loading component to load the target web page.

[0039] The loading component is webview, which is a component embedded in an application and used to display network (web) content.

[0040] S103: Obtain a target offline package corresponding to a target webpage from each offline package stored locally, wherein the target offline package includes: a pre-request address of a first resource in the target webpage.

[0041] The locally stored offline package may include the address of the corresponding web page, so the application can select the offline package including the address of the target web page from the locally stored offline packages as the target offline package.

[0042] The first resource may be a Hyper Text Markup Language (HTML) file, a Cascading Style Sheets (CSS) file, a programming language (JavaScript) file, an image, or a video, etc., in a web page.

[0043] The address of the first resource is a Uniform Resource Location (URL).

[0044] S104: Download the first resource based on the pre-request address.

[0045] Since the pre-request address can indicate the storage location of the first resource in the network, the application can use the pre-request address to download the first resource through the network.

[0046] S105: When the loading component is loading the target webpage, intercept the download request sent by the loading component to the server.

[0047] The way in which the application intercepts the download request can be determined in advance according to the operating system installed on the electronic device. Taking the operating system installed on the electronic device as a mobile operating system (IOS) as an example, the application can be pre-set to intercept the download request sent by the loading component to the server through the NS Uniform Resource Locator Protocol (NSURLProtocol); wherein NSURLProtocol is an abstract class that can be used to intercept and process network requests.

[0048] S106: If the download request is for requesting to download a first resource, sending the first resource to the loading component, so that the loading component loads a target webpage based on the first resource.

[0049] In the disclosed embodiment, when determining to start loading the target webpage, the application can download the first resource in advance based on the pre-request address of the first resource in the target webpage. When the loading component actually needs to request to obtain the first resource during the process of loading the target webpage, the application can send the first resource downloaded in advance to the loading component. At this time, there is no need to download the first resource through the network, thereby increasing the speed at which the loading component obtains the first resource, thereby increasing the loading speed of the target webpage, that is, reducing the time consumed in loading the webpage in the application.

[0050] The following is a detailed description of the web page loading method provided by the embodiment of the present disclosure:

[0051] In the disclosed embodiment, the offline package of the webpage stored locally by the electronic device may include, in addition to the pre-request address, an IDentifier (ID) of the offline package, the address of the corresponding webpage, the second resource in the webpage, and the address of the second resource. That is, before loading the webpage, the electronic device stores the offline package of the webpage, thereby storing some resources contained in the webpage and the addresses of these resources locally.

[0052] For the convenience of distinction, the disclosed embodiment refers to the resource corresponding to the pre-request address in the offline package as the first resource, the resource included in the offline package as the second resource, and the resource other than the first resource and the second resource as the third resource. The first resource, the second resource, and the third resource can all be resources such as HTML files, CSS files, JavaScript files, images, or videos in the web page, that is, each resource in the web page can be used as the first resource, the second resource, or the third resource, which can be set based on the actual application scenario. For example, the resource with a large amount of data in the web page can be used as the second resource, the resource with high timeliness requirements or frequent updates can be used as the third resource, and the other resources except the second resource and the third resource can be used as the first resource.

[0053] Exemplarily, an offline package includes:

[0054] 1. URL of the webpage: https: / / www.abc.com / bcd / cde / def? aa=xx. Among them, https represents the protocol used to access the webpage, www.abc.com represents the domain name, bcd / cde / def is the path of the webpage, aa is the source parameter, and the parameter value xx of aa represents the source of the webpage loading instruction.

[0055] 2. ID of the offline package: 0001.

[0056] 3. Second resources and request lists of second resources. The request list of second resources includes the path and name of each second resource. For example, the list includes [{path:hij / klm / nop-qrs.123,local:nop-qrs.123}], where hij / klm / nop-qrs.123 represents the path of a second resource and nop-qrs.123 represents the name of the second resource. Combined with the URL of the webpage, the URL of the second resource can be obtained as: https: / / www.abc.com / hij / klm / nop-qrs.123.

[0057] 4. Pre-request address list: The pre-request address list includes the path and name of each first resource, or the pre-request address list includes the URL of each first resource.

[0058] See also Figure 2 , the method of downloading offline package by application includes the following steps:

[0059] S201. Acquire an information list at startup, wherein the information list includes metadata of each offline package stored in an offline package platform.

[0060] Each offline package stored in the offline package platform corresponds to a web page, which is a web page supported by the application program for loading.

[0061] The application is pre-configured with a configuration interface for obtaining the information list, so that the application can call the configuration interface at each startup, each cold start, or the first startup of the day to obtain the information list. Among them, cold start refers to starting the application in a completely closed state. The information list can be stored in an offline package platform or other information management platform, which is not specifically limited in the embodiments of the present disclosure.

[0062] The metadata of the offline package may include: offline package ID, version number, size, release time, publisher and address of the corresponding web page, etc.

[0063] Optionally, the offline package platform may be run in the server of S105 above, or may be run in other servers, which is not specifically limited in the embodiment of the present disclosure.

[0064] S202: Compare the information list with metadata of each offline package stored locally to determine whether there is an offline package to be downloaded in the offline package platform; wherein the offline package to be downloaded includes: an offline package with a web page different from that corresponding to the locally stored offline package, and an offline package with a higher version than the locally stored offline package.

[0065] The application can compare the identifier of each offline package included in the information list with the identifier of the offline package stored locally to see if they are the same. If they are the same, the application can determine that the offline package is stored locally and does not download the offline package at this time.

[0066] If they are different, the application program may determine that the offline package corresponding to the identifier is the offline package to be downloaded.

[0067] Or, if they are different, the application can determine whether the webpage address corresponding to the identifier is stored in the local offline package. If not, the offline package corresponding to the identifier is determined to be the offline package to be downloaded. If so, it is determined whether the version number corresponding to the identifier is higher than the version number of the local offline package. If higher, the offline package corresponding to the identifier is determined to be the offline package to be downloaded. If equal to or lower, it is determined not to download the offline package.

[0068] S203: Download the offline package to be downloaded from the offline package platform.

[0069] The application may send an offline package acquisition request to the offline package platform, wherein the offline package acquisition request includes an identifier of the offline package to be downloaded, and receive the offline package corresponding to the identifier sent by the offline package platform.

[0070] Through the above method, the embodiment of the present disclosure can download offline packages that are not stored locally and offline packages with higher versions in the offline package platform when the application is started, thereby ensuring the comprehensiveness and timeliness of the offline packages stored in the electronic device and improving the accuracy of pages loaded based on the offline packages.

[0071] After downloading the offline package to be downloaded in S203, the application may further perform: performing a security check on the offline package to be downloaded. If the security check passes, the offline package to be downloaded is stored; if the security check fails, the offline package to be downloaded is deleted.

[0072] The application may perform security verification on the offline package to be downloaded by means of cyclic redundancy check (CRC) or message digest algorithm 5 (MD5).

[0073] The application is pre-configured with a storage location for the offline package, so that the application can store the offline package to be downloaded in the storage location after the offline package to be downloaded passes the security check. Taking the operating system of the electronic device as IOS as an example, the storage location of the offline package can be an NS bundle (NSBundle), where NSBundle is used to store the executable file of the application and the resources required for the application to run.

[0074] Through the above method, the disclosed embodiment can perform security verification on the downloaded offline package, thereby reducing the situation where the downloaded offline package is attacked maliciously, resulting in web page loading errors or malicious intrusion of electronic devices, and improving the security of offline package storage and web page loading. In addition, the disclosed embodiment can adopt a more secure security verification method, such as MD5, so that the security verification process is not easy to be cracked.

[0075] Since the application in the disclosed embodiment can download a higher version of an offline package from the offline package platform when it is started, there may be multiple offline packages corresponding to the same web page in the offline packages locally stored in the electronic device.

[0076] Based on this, after storing the offline package to be downloaded, the application may further perform the following steps: determining whether there are redundant offline packages including the same webpage address in the locally stored offline packages.

[0077] If yes, then in the redundant offline packages, in descending order of version numbers, a preset number of offline packages are retained, and other offline packages are deleted, wherein the preset number is a positive integer, for example, the preset number is 1 or 3.

[0078] Taking the preset number of 1 as an example, assume that the offline package 1 and offline package 2 stored locally on the electronic device include the same web page address, and the version number of offline package 1 is 2.0, and the version number of offline package 2 is 3.0. Since 3.0>2.0, offline package 2 is retained and offline package 1 is deleted.

[0079] Through the above method, after the electronic device locally stores a new offline package, the disclosed embodiment can retain the offline package with a higher version and delete the offline package with a lower version for redundant offline packages with the same web page address, thereby ensuring the timeliness of the offline package stored locally on the electronic device and reducing excessive occupation of local storage resources by the offline package.

[0080] Moreover, the disclosed embodiment can store a preset number of offline packages with the same web page address in an electronic device, so that even if part of the offline packages corresponding to a web page are accidentally deleted or overwritten, when loading the web page, the application can still use other offline packages corresponding to the web page, thereby improving the web page loading speed.

[0081] Since offline packages with the same web page address may be stored locally, the method of obtaining the target offline package corresponding to the target web page from each locally stored offline package in S103 can be implemented as follows: obtaining the offline package with the address of the target web page and the highest version number from each locally stored offline package as the target offline package.

[0082] The disclosed embodiment can select the offline package with the highest version number from the locally stored offline packages including the web page address when loading a web page. Since the higher the version number, the more time-effective the information in the offline package, the web page loaded based on the offline package has higher time-effectiveness, so that the web page content displayed to the user is more timely and accurate.

[0083] In some embodiments of the present disclosure, before obtaining the target offline package in S103, the application may also determine whether to adopt a webpage loading solution based on the offline package. The determination method includes: determining whether the source of the webpage loading instruction is a preset source and whether the target offline package is stored locally.

[0084] The URL of the webpage may include a source parameter to indicate the source of the webpage loading instruction. For example, the URL of the webpage is in the form of: https: / / www.abc.com / bcd? aa=xx, where the parameter value of the aa parameter after the "?" in the URL of the webpage is 01, indicating that the webpage loading instruction comes from the user clicking on the hyperlink of the application homepage, the parameter value of the aa parameter is 02, indicating that the webpage loading instruction comes from the automatic jump after the application video playback page is opened; the parameter value of the aa parameter is 03, indicating that the webpage loading instruction comes from the user clicking on the webpage link shared by others in the dialog box.

[0085] Therefore, the application can determine whether the parameter value of the source parameter included in the URL of the target web page is a preset value. If so, it is determined that the source of the web page loading instruction is the preset source; otherwise, it is determined that the source of the web page loading instruction is not the preset source.

[0086] On the other hand, since the locally stored offline package includes the web page address, the application can determine whether the locally stored offline package contains the address of the target web page. If so, it is determined that the target offline package is stored locally, otherwise it is determined that the target offline package is not stored locally.

[0087] If the judgment results are all yes, execute S103.

[0088] If any of the judgment results is no, it is determined that the webpage is not loaded based on the offline package. In the case of loading the webpage not based on the offline package, after the application starts the loading component to load the target webpage, when receiving the download request sent by the loading component to the server, the application can directly send the download request to the server, so that the server sends the resource requested to be downloaded by the download request to the loading component, so that the loading component loads the target webpage based on the received resource.

[0089] Through the above method, the embodiment of the present disclosure can determine to adopt a web page loading solution based on an offline package when the web page loading instruction is a preset source and the target offline package is stored locally, thereby improving the security of web page loading and reducing the possibility of web page loading errors.

[0090] In some embodiments of the present disclosure, after downloading the first resource and before the application sends the first resource to the loading component in S106, the application may further perform: storing the first resource and the pre-request address in a cache in correspondence.

[0091] The application is pre-configured with a storage format of the first resource and the pre-request address. Taking the operating system of the electronic device as IOS as an example, the application can store the first resource and the pre-request address as an NSCachedURLResponse object in an asynchronous Javascript And XML Cache (ajaxCache). The NSCachedURLResponse object can also include other information, such as the size and file type of the first resource.

[0092] Afterwards, when the application intercepts the download request sent by the loading component, it can check from the cache whether there is a resource address included in the download request; if so, obtain the first resource corresponding to the resource address from the cache.

[0093] Taking the operating system of the electronic device as IOS as an example, the application can check whether there is a resource address included in the download request from the NSURLResponse in the cache. If so, the NSURLResponse including the resource address is converted into an NS Uniform Resource Locator Response (NSURLResponse), and the NSURLResponse is sent to the loading component, so that the loading component loads the target web page based on the first resource included in the NSURLResponse.

[0094] The resource address included in the download request is the URL of the resource requested by the download request, and the resource URL is in the form of: https: / / www.abc.com / hij / klm / nop-qrs.123, where hij / klm / nop-qrs.123 represents path. The application can obtain the request path from the resource address included in the download request, and then determine whether the address including the request path exists in the cache. If so, it is determined that the resource address exists in the cache.

[0095] Through the above method, the embodiment of the present disclosure can store the first resource and the pre-request address in the cache, so that when the loading component needs to obtain the first resource, the application can obtain the first resource from the cache and send it to the loading component. Since the cache has the advantage of fast reading and writing speed, obtaining resources from the cache and sending them to the loading component increases the speed of the loading component obtaining resources, thereby increasing the loading speed of the web page and improving the user's web browsing experience.

[0096] To reduce excessive occupation of the cache by resources in the web page, the application can also clean up the cache in the following two ways after sending the first resource to the loading component.

[0097] Method 1: Delete the resource address and the first resource corresponding to the resource address from the cache.

[0098] Method 2: Deleting the first resource and the pre-request address of the first resource whose storage time exceeds the preset effective time from the cache. The preset effective time can be set according to the web page loading speed in the actual scene, for example, the preset effective time is 2 seconds.

[0099] Since the cache may store the first resource and the pre-request address of the first resource in the form of an NSCachedURLResponse object, when the first resource and the pre-request address of the first resource are deleted from the cache, the NSCachedURLResponse object including the first resource may be deleted from the cache.

[0100] Through the above method, the embodiment of the present disclosure can delete the first resource and its address from the cache in time after sending the first resource to the loading component, thereby reducing the excessive occupation of the electronic device cache by web resources and improving the operating efficiency of the electronic device. In addition, since the same resource may be requested multiple times when loading the same web page, for example, when loading the title bar and recommendation bar of the web page, a request may be made to obtain the website icon, the embodiment of the present disclosure can delete the first resource and its address in the cache only when the storage time exceeds the preset effective time, so that the same resource in the cache can be obtained multiple times, thereby improving the web page loading speed.

[0101] In some embodiments of the present disclosure, there may be a situation where the resource requested by the loading component is not the first resource. Since the target offline package stored locally on the electronic device also includes a second resource in the target web page and the address of the second resource, the electronic device can also determine whether to send the second resource to the loading component.

[0102] That is, if the application finds that the resource address included in the download request does not exist in the cache, the application may search the target offline package to find out whether the resource address included in the download request exists.

[0103] If it exists, a second resource corresponding to the resource address is obtained from the target offline package, and the second resource is sent to the loading component, so that the loading component loads the target webpage based on the second resource.

[0104] The application may obtain the request path from the resource address included in the download request, and then determine whether the address of the second resource of the target offline package includes the request path. If so, obtain the second resource corresponding to the address from the target offline package.

[0105] Afterwards, the application can assemble the acquired second resource and the address of the second resource in the form of an interface, that is, assemble the second resource and the address of the second resource into an NSURLResponse, and send the NSURLResponse to the loading component, so that the loading component loads the target web page based on the second resource included in the NSURLResponse.

[0106] Through the above method, the embodiment of the present disclosure can obtain the second resource from the locally stored offline package and send it to the loading component when the loading component needs to obtain the second resource, without downloading the second resource in real time through the network, thereby improving the speed at which the loading component obtains the second resource, thereby improving the loading speed of the web page and improving the user's web browsing experience.

[0107] In some embodiments of the present disclosure, there may be a situation where the resource requested by the loading component is neither the first resource corresponding to the pre-request address nor the second resource included in the offline package. In this case, the resource needs to be acquired through the network.

[0108] That is, if the application finds that the resource address included in the download request does not exist in the target offline package, the application can send a download request to the server, so that the server sends the third resource corresponding to the resource address to the loading component. After that, the application can receive the third resource sent by the loading component, and then store the third resource and the resource address in the cache accordingly, and then obtain the third resource corresponding to the resource address from the cache, and send the third resource to the loading component, so that the loading component loads the target web page based on the third resource.

[0109] Among them, the way the application stores the third resource and the address of the third resource is the same as the way it stores the first resource and the address of the first resource, and the way the application sends the third resource to the loading component is the same as the way it sends the first resource to the loading component. Please refer to the above description and will not repeat it here.

[0110] Through the above method, the embodiment of the present disclosure can download the resource in real time when the resource that the loading component needs to obtain is neither the first resource nor the second resource, thereby ensuring that the loading component can obtain the resources required to load the web page and ensuring the integrity of the content in the loaded web page.

[0111] Since the loading component does not originally have the function of sending resources to the application program upon receiving resources sent by the server, in the embodiment of the present disclosure, before starting the loading component in S102, when determining to adopt a web page loading solution based on an offline package, the application program can plant a preset ajax script in the loading component, so that when the loading component receives the third resource sent by the server through the ajax script during the process of loading the web page, the third resource can be sent to the application program.

[0112] To reduce excessive occupation of the cache by resources in the web page, the application can also clean up the cache in the following two ways after sending the third resource to the loading component.

[0113] Method 1: Delete the resource address and the third resource corresponding to the resource address from the cache.

[0114] Method 2: Deleting from the cache the third resource whose storage duration exceeds the preset effective duration and the address of the third resource.

[0115] Since the cache may store the third resource and the address of the third resource in the form of an NSCachedURLResponse object, when the third resource and the address of the third resource are deleted from the cache, the NSCachedURLResponse object including the third resource may be deleted from the cache.

[0116] Through the above method, the embodiment of the present disclosure can delete the third resource and its address from the cache in time after sending the third resource to the loading component, thereby reducing the excessive occupation of the electronic device cache by web resources and improving the operating efficiency of the electronic device.

[0117] In addition, since the same web page may request the same resource multiple times, the embodiment of the present disclosure can delete the third resource and its address in the cache only when the storage time exceeds the preset effective time, so that the same resource in the cache can be obtained multiple times. That is, after the application sends the third resource to the loading component, if a download request is intercepted, it can check from the cache whether there is a resource address included in the download request. If so, the first resource or the third resource corresponding to the resource address is obtained from the cache and sent to the loading component, thereby improving the speed of web page loading.

[0118] See also Figure 3 , the overall process of the webpage loading method provided by the embodiment of the present disclosure is described below in combination with actual application scenarios:

[0119] S301: The application receives a webpage loading instruction triggered by a user.

[0120] S302, the application determines whether the source of the webpage loading instruction is a preset source, and whether the target offline package corresponding to the target webpage is stored locally. If the judgment results are both yes, execute S303; if any judgment result is no, execute S311.

[0121] S303, the application starts the loading component to load the target web page. The application can send the address of the target web page to the loading component, and install a preset ajax script in the loading component.

[0122] S304: The application downloads the first resource based on the pre-request address included in the target offline package, and stores the first resource and the pre-request address in a cache in correspondence with each other.

[0123] S305: When the loading component is loading the target web page, the application program intercepts the download request sent by the loading component to the server.

[0124] S306: The application searches the cache for the resource address included in the download request. If yes, execute S307; otherwise, execute S308.

[0125] S307: The application obtains a first resource corresponding to the resource address from the cache, and sends the first resource to the loading component, so that the loading component loads the target web page based on the first resource.

[0126] S308: The application searches the target offline package to see whether the resource address included in the download request exists. If yes, execute S309; ​​otherwise, execute S310.

[0127] S309: The application obtains a second resource corresponding to the resource address from the target offline package, and sends the second resource to the loading component, so that the loading component loads the target web page based on the second resource.

[0128] S310. The application sends a download request to the server, so that the server sends the third resource corresponding to the resource address to the loading component, and the application receives the third resource sent by the loading component, stores the third resource and the resource address in the cache in correspondence, obtains the third resource corresponding to the resource address from the cache, and sends the third resource to the loading component, so that the loading component loads the target web page based on the third resource.

[0129] S311, the application starts the loading component to load the target web page, and when receiving the download request sent by the loading component, forwards the download request to the server, so that the server sends the resource corresponding to the resource address included in the download request to the loading component, so that the loading component loads the target web page based on the resource.

[0130] That is, when any judgment result of S302 is no, it is determined not to adopt the webpage loading solution based on the offline package, that is, to adopt the conventional webpage loading solution in the application.

[0131] See also Figure 4 ,The following describes in detail the interaction process among the user, server, application and loading components during the web page loading process.,Among them, the application can also be called the client and the server can also be called the service end.

[0132] S401: An application is started due to a user operation.

[0133] S402: When the application is started, it sends a list acquisition request to the server.

[0134] S403: The server sends a list acquisition response to the application, wherein the list acquisition response includes an information list.

[0135] S404: The application determines whether there is an offline package to be downloaded in the offline package platform.

[0136] S405: When there is an offline package to be downloaded, the application sends an offline package acquisition request to the server.

[0137] S406: The server sends an offline package acquisition response to the application, wherein the offline package acquisition response includes the offline package to be downloaded.

[0138] S407: The application performs a security check on the offline package to be downloaded.

[0139] S408: When the application passes the security check, the application stores the offline package to be downloaded.

[0140] The application can also register the offline package to be downloaded in the offline package controller. The offline package controller is a software module included in the application. After the offline package is registered in the offline package controller, the offline package controller can read the information in the offline package.

[0141] S409: The application receives a webpage loading instruction triggered by the user.

[0142] S410: When the application determines to adopt a webpage loading solution based on an offline package, the application downloads a first resource from a server based on a pre-request address included in a target offline package.

[0143] S411. The application program stores the first resource and the address of the first resource in a corresponding manner in a cache.

[0144] The application may also register the first resource stored in the cache and the address of the first resource in the offline package controller.

[0145] S412: When the loading component is loading the target web page, the application program intercepts the download request sent by the loading component to the server.

[0146] S413: The application checks whether the resource requested by the download request matches the resource stored in the cache.

[0147] The application can determine a hit through the offline package controller when checking that the resource address included in the download request exists in the cache, and determine that the hit resource is the resource corresponding to the resource address.

[0148] S414. When a hit occurs, the application sends the resource hit in the cache to the loading component.

[0149] S415: The application program deletes the hit resource and the address of the resource from the cache.

[0150] S416: When there is no hit, the application program checks whether the resource requested by the download request hits the resource included in the target offline package.

[0151] When the application detects through the offline package controller that the target offline package includes the resource address included in the download request, it determines a hit, and determines that the hit resource is the resource corresponding to the resource address.

[0152] S417: When a resource is hit, the application sends the resource hit in the target offline package to the loading component.

[0153] S418: When there is no hit, the application sends a download request to the server.

[0154] S419. The server sends the resource corresponding to the resource address to the loading component.

[0155] S420: The application receives the resource corresponding to the resource address sent by the loading component.

[0156] S421. The application stores the resource and the resource address in a corresponding manner in the cache, and obtains the resource corresponding to the resource address from the cache.

[0157] The application can also register the resources and resource addresses stored in the cache in the offline package controller.

[0158] S422: The application sends the resource corresponding to the resource address to the loading component.

[0159] S423: The loading component loads the target web page based on the received resources.

[0160] Through the above method, the disclosed embodiment can obtain some resources in the web page by downloading the offline package before loading the web page, and when starting the web page loading, before the loading component requests to download the web page resources, it can download some resources in the web page in advance based on the pre-request address included in the offline package and store them in the cache. When it is necessary to obtain web page resources during the web page loading process, they can be obtained from the cache or offline package without having to obtain them in real time through the network, thereby reducing the impact of network delay on web page loading, improving the speed of web page loading, and shortening the difference in display time between the application displaying the web page and the displaying the native page.

[0161] In the technical solution disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of web page information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0162] Based on the same inventive concept, corresponding to the above method embodiment, the embodiment of the present disclosure also provides a webpage loading device, such as Figure 5 As shown, the device includes: a receiving module 501, a starting module 502, an acquisition module 503, a download module 504, an interception module 505 and a sending module 506;

[0163] A receiving module 501 is used to receive a webpage loading instruction, where the webpage loading instruction is used to instruct to load a target webpage;

[0164] A starting module 502, used to start a loading component to load a target web page;

[0165] The acquisition module 503 is used to acquire a target offline package corresponding to the target webpage from each offline package stored locally, wherein the target offline package includes: a pre-request address of a first resource in the target webpage;

[0166] A download module 504, configured to download a first resource based on a pre-request address;

[0167] The interception module 505 is used to intercept the download request sent by the loading component to the server during the process of the loading component loading the target web page;

[0168] The sending module 506 is configured to send the first resource to the loading component if the download request is for requesting to download the first resource, so that the loading component loads the target webpage based on the first resource.

[0169] In some embodiments of the present disclosure, the device further comprises:

[0170] A judgment module, used to judge whether the source of the webpage loading instruction is a preset source and whether the target offline package is stored locally before obtaining the target offline package corresponding to the target webpage from each offline package stored locally;

[0171] The calling module is used for calling the obtaining module to execute the step of obtaining the target offline package corresponding to the target web page from each offline package stored locally if the judgment results of the judging module are all yes.

[0172] In some embodiments of the present disclosure, the device further comprises:

[0173] A storage module, used for storing the first resource and the pre-request address in a cache in correspondence with each other before sending the first resource to the loading component;

[0174] A search module is used to search the cache for the resource address included in the download request when a download request is intercepted;

[0175] The acquisition module 503 is further configured to acquire the first resource corresponding to the resource address from the cache if the search result of the search module is yes.

[0176] In some embodiments of the present disclosure, the offline package further includes a second resource in the target webpage and an address of the second resource;

[0177] The search module is further used to search whether the resource address included in the download request exists in the cache, and if the search result of the search module is no, search whether the resource address exists in the target offline package;

[0178] The acquisition module 503 is further configured to acquire a second resource corresponding to the resource address from the target offline package if the search result of the search module is existence, and send the second resource to the loading component, so that the loading component loads the target web page based on the second resource.

[0179] In some embodiments of the present disclosure, the device further comprises:

[0180] The sending module 506 is further configured to, after searching the target offline package for the resource address included in the download request, send the download request to the server if the search result of the search module is that the resource address does not exist, so that the server sends the third resource corresponding to the resource address to the loading component;

[0181] The receiving module 501 is further used to receive the third resource sent by the loading component;

[0182] The storage module is further used to store the third resource and the resource address in the cache in correspondence;

[0183] The sending module 506 is further configured to obtain a third resource corresponding to the resource address from the cache, and send the third resource to the loading component, so that the loading component loads the target web page based on the third resource.

[0184] In some embodiments of the present disclosure, the device further includes a deletion module, and the deletion module is used to:

[0185] After sending the first resource to the loading component, deleting the resource address and the first resource corresponding to the resource address from the cache; or,

[0186] A first resource whose storage duration exceeds a preset effective duration and a pre-requested address of the first resource are deleted from the cache.

[0187] In some embodiments of the present disclosure, the device further includes a deletion module, and the deletion module is used to:

[0188] After sending the third resource to the loading component, deleting the resource address and the third resource corresponding to the resource address from the cache; or,

[0189] A third resource whose storage duration exceeds a preset effective duration and the address of the third resource are deleted from the cache.

[0190] In some embodiments of the present disclosure, the device further comprises:

[0191] The acquisition module 503 is also used to acquire an information list at startup, the information list including metadata of each offline package stored in the offline package platform;

[0192] A comparison module is used to compare the information list with the metadata of each offline package stored locally, and determine whether there is an offline package to be downloaded in the offline package platform. The offline package to be downloaded includes: an offline package with a different web page from the offline package stored locally, and an offline package with a higher version than the offline package stored locally;

[0193] The download module 504 is also used to download the offline package to be downloaded from the offline package platform.

[0194] In some embodiments of the present disclosure, the device further comprises:

[0195] A verification module, used for performing security verification on the offline package to be downloaded after the offline package to be downloaded is downloaded from the offline package platform;

[0196] A storage module, used for storing the offline package to be downloaded if the security verification by the verification module passes;

[0197] The deletion module is used to delete the offline package to be downloaded if the security verification by the verification module fails.

[0198] In some embodiments of the present disclosure, the device further comprises:

[0199] A determination module, configured to determine, after storing the offline package to be downloaded, whether there is a redundant offline package including the same webpage address in the locally stored offline package;

[0200] The deletion module is also used to retain a preset number of offline packages in the redundant offline packages in descending order of version numbers and delete other offline packages if the determination result of the determination module is yes.

[0201] In some embodiments of the present disclosure, the acquisition module 503 is specifically used to:

[0202] From each offline package stored locally, an offline package including the address of the target webpage and having the highest version number is obtained as the target offline package.

[0203] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0204] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0205] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0206] Multiple components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0207] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as a web page loading method. For example, in some embodiments, the web page loading method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the web page loading method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the web page loading method in any other appropriate manner (e.g., by means of firmware).

[0208] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0209] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0210] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0211] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0212] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0213] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0214] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0215] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A web page loading method, comprising: receiving a webpage loading instruction, wherein the webpage loading instruction is used to instruct to load a target webpage; Start the loading component to load the target web page; Acquire a target offline package corresponding to the target webpage from each offline package stored locally, wherein the target offline package includes: a pre-request address of a first resource in the target webpage; Based on the pre-request address, download the first resource; During the process of the loading component loading the target webpage, intercepting a download request sent by the loading component to the server; If the download request is used to request downloading of the first resource, the first resource is sent to the loading component, so that the loading component loads the target webpage based on the first resource.

2. The method according to claim 1, before acquiring the target offline package corresponding to the target webpage from each locally stored offline package, further comprises: Determine whether the source of the webpage loading instruction is a preset source, and whether the target offline package is stored locally; If the judgment results are all yes, then the step of acquiring the target offline package corresponding to the target webpage from each offline package stored locally is executed.

3. The method according to claim 1 or 2, before sending the first resource to the loading component, further comprising: Storing the first resource and the pre-request address in a cache in correspondence with each other; When the download request is intercepted, searching the cache for a resource address included in the download request; If so, obtaining the first resource corresponding to the resource address from the cache.

4. The method according to claim 3, wherein: The target offline package also includes a second resource in the target webpage and an address of the second resource. After searching the cache for the resource address included in the download request, the method further includes: If not, searching the target offline package to see whether the resource address exists; If it exists, then obtaining a second resource corresponding to the resource address from the target offline package, and sending the second resource to the loading component, so that the loading component loads the target webpage based on the second resource.

5. The method according to claim 4, after searching the target offline package for the existence of the resource address, further comprises: If not, sending the download request to the server, so that the server sends the third resource corresponding to the resource address to the loading component; Receiving the third resource sent by the loading component; Storing the third resource and the resource address in the cache in correspondence; A third resource corresponding to the resource address is obtained from the cache, and the third resource is sent to the loading component, so that the loading component loads the target webpage based on the third resource.

6. The method according to any one of claims 3 to 5, after sending the first resource to the loading component, further comprising: Deleting the resource address and the first resource corresponding to the resource address from the cache; or, A first resource whose storage duration exceeds a preset effective duration and a pre-requested address of the first resource are deleted from the cache.

7. The method according to claim 5, after sending the third resource to the loading component, further comprising: Deleting the resource address and a third resource corresponding to the resource address from the cache; or, A third resource whose storage duration exceeds a preset effective duration and the address of the third resource are deleted from the cache.

8. The method according to any one of claims 1 to 7, further comprising: Acquire an information list at startup, the information list including metadata of each offline package stored in the offline package platform; Comparing the information list with metadata of each offline package stored locally, determining whether there is an offline package to be downloaded in the offline package platform, wherein the offline package to be downloaded includes: an offline package with a different web page from the offline package stored locally, and an offline package with a higher version than the offline package stored locally; The offline package to be downloaded is downloaded from the offline package platform.

9. The method according to claim 8, after downloading the offline package to be downloaded from the offline package platform, further comprises: Performing a security check on the offline package to be downloaded; If the security check passes, the offline package to be downloaded is stored; If the security check fails, the offline package to be downloaded is deleted.

10. The method according to claim 9, after storing the offline package to be downloaded, further comprises: Determine whether there is a redundant offline package including the same webpage address in the locally stored offline package; If so, among the redundant offline packages, a preset number of offline packages are retained in descending order of version numbers, and other offline packages are deleted.

11. The method according to claim 10, wherein: The step of acquiring the target offline package corresponding to the target webpage from each offline package stored locally includes: From each offline package stored locally, an offline package including the address of the target webpage and having the highest version number is obtained as the target offline package.

12. A webpage loading device, comprising: A receiving module, used for receiving a webpage loading instruction, wherein the webpage loading instruction is used for instructing to load a target webpage; A starting module, used for starting a loading component to load the target web page; An acquisition module, configured to acquire a target offline package corresponding to the target webpage from each offline package stored locally, wherein the target offline package includes: a pre-request address of a first resource in the target webpage; A download module, configured to download the first resource based on the pre-request address; An interception module, used for intercepting a download request sent by the loading component to the server during the process of the loading component loading the target web page; A sending module is used for sending the first resource to the loading component if the download request is for requesting to download the first resource, so that the loading component loads the target webpage based on the first resource.

13. The apparatus according to claim 12, further comprising: A judgment module, used for judging whether the source of the webpage loading instruction is a preset source and whether the target offline package is stored locally before obtaining the target offline package corresponding to the target webpage from each offline package stored locally; The calling module is used for calling the obtaining module to execute the step of obtaining the target offline package corresponding to the target webpage from each offline package stored locally if the judgment results of the judging module are all yes.

14. The device according to claim 12 or 13, further comprising: A storage module, configured to store the first resource and the pre-request address in a cache in correspondence with each other before sending the first resource to the loading component; A search module, used for searching from the cache whether there is a resource address included in the download request when the download request is intercepted; The acquisition module is further configured to acquire the first resource corresponding to the resource address from the cache if the search result of the search module is yes.

15. The device according to claim 14, wherein: The target offline package also includes a second resource in the target webpage and an address of the second resource; The search module is further configured to search the target offline package for the resource address if the resource address included in the download request exists in the cache after the search module searches for the resource address in the cache, if the search result of the search module is no. The acquisition module is further configured to acquire the second resource corresponding to the resource address from the target offline package if the search result of the search module is existence, and send the second resource to the loading component, so that the loading component loads the target web page based on the second resource.

16. The apparatus according to claim 15, further comprising: The sending module is further configured to, after searching the target offline package for whether the resource address included in the download request exists, send the download request to the server if the search result of the search module is that the resource address does not exist, so that the server sends the third resource corresponding to the resource address to the loading component; The receiving module is further used to receive the third resource sent by the loading component; The storage module is further used to store the third resource and the resource address in the cache in correspondence; The sending module is further configured to obtain a third resource corresponding to the resource address from the cache, and send the third resource to the loading component, so that the loading component loads the target webpage based on the third resource.

17. The apparatus according to any one of claims 14 to 16, further comprising a deletion module, wherein the deletion module is configured to: After sending the first resource to the loading component, deleting the resource address and the first resource corresponding to the resource address from the cache; or, A first resource whose storage duration exceeds a preset effective duration and a pre-requested address of the first resource are deleted from the cache.

18. The apparatus according to claim 16, further comprising a deletion module, wherein the deletion module is configured to: After sending the third resource to the loading component, deleting the resource address and the third resource corresponding to the resource address from the cache; or, A third resource whose storage duration exceeds a preset effective duration and the address of the third resource are deleted from the cache.

19. The device according to any one of claims 12 to 18, further comprising: The acquisition module is further used to acquire an information list at startup, wherein the information list includes metadata of each offline package stored in the offline package platform; A comparison module, used to compare the information list with metadata of each offline package stored locally, and determine whether there is an offline package to be downloaded in the offline package platform, wherein the offline package to be downloaded includes: an offline package with a different web page from the offline package stored locally, and an offline package with a higher version than the offline package stored locally; The download module is further used to download the offline package to be downloaded from the offline package platform.

20. The apparatus according to claim 19, further comprising: A verification module, configured to perform a security verification on the offline package to be downloaded after the offline package to be downloaded is downloaded from the offline package platform; A storage module, configured to store the offline package to be downloaded if the security check performed by the verification module passes; The deleting module is used to delete the offline package to be downloaded if the security check performed by the checking module fails.

21. The apparatus according to claim 20, further comprising: A determination module, configured to determine, after storing the offline package to be downloaded, whether there is a redundant offline package including the same webpage address in the locally stored offline package; The deleting module is further configured to retain a preset number of offline packages in the redundant offline packages in descending order of version numbers and delete other offline packages if the determination result of the determining module is yes.

22. The device according to claim 21, wherein The acquisition module is specifically used for: From each offline package stored locally, an offline package including the address of the target webpage and having the highest version number is obtained as the target offline package.

23. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 11.

24. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-11.

25. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 11.

Citation Information

Cited By

  • Resource response method and device, equipment and storage medium

    CN119939638A