Webpage display method and device, electronic equipment and storage medium

By determining the highest priority caching strategy in the browser and optimizing webpage display using Service Worker, WPK, and kernel preloading strategies, the problem of excessively long browser loading and rendering times was solved, resulting in faster webpage loading speeds and a better user experience.

CN120873309APending Publication Date: 2025-10-31BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

If a browser takes too long to load and render a webpage, the page will load slowly, negatively impacting the user experience.

Method used

A webpage display method is provided, which obtains the target webpage resource by determining the highest priority caching strategy among a variety of preset caching strategies, and displays the webpage based on the strategy, including Service Worker strategy, WPK strategy and kernel preloading strategy, and optimizes the caching and preloading mechanism to accelerate webpage loading.

Benefits of technology

It improves webpage loading speed, enhances user experience, and ensures effective retrieval and display of cached resources across different browser environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120873309A_ABST
    Figure CN120873309A_ABST
Patent Text Reader

Abstract

The invention relates to a webpage display method and device, electronic equipment and a storage medium. The method comprises the steps that when it is detected that a target webpage is accessed, a target caching strategy is determined, and the target caching strategy is the caching strategy with the highest priority in multiple effective preset caching strategies; obtaining target webpage resources of the target webpage based on the target caching strategy; and displaying the target webpage based on the target webpage resource. According to the method, the mode supporting multiple preset caching strategies is provided, it can be guaranteed that webpage resources cached in advance can be obtained to a greater extent, the webpage opening speed is increased, and the use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of display technology, and in particular to a web page display method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the rapid development of mobile internet, browsers have become an important tool for users to quickly obtain information. However, as user demands increase, web pages offer richer functions and contain larger resources, causing browsers to spend excessive time downloading web page resources during rendering. This results in slower page loading speeds and negatively impacts the user experience. Summary of the Invention

[0003] To overcome the problems existing in related technologies, this disclosure provides a webpage display method, apparatus, electronic device, and storage medium.

[0004] According to a first aspect of the present disclosure, a webpage display method is provided, the method comprising:

[0005] When access to a target webpage is detected, a target caching strategy is determined. The target caching strategy is the caching strategy with the highest priority among a variety of effective preset caching strategies.

[0006] Based on the target caching strategy, obtain the target webpage resources of the target webpage;

[0007] Based on the target webpage resource, display the target webpage.

[0008] In some embodiments, when the target caching strategy is a first caching strategy, obtaining the target webpage resource of the target webpage based on the target caching strategy includes:

[0009] Call the preset configuration interface to obtain the first preset field and the second preset field;

[0010] When the first preset field is a first identifier, the target webpage resource is obtained from the server, and the first identifier indicates that the first caching strategy is not used; or...

[0011] When the first preset field is the second identifier, the target web page resource is obtained from the locally cached web page resource based on the second preset field, and the second identifier indicates that the first caching strategy is used.

[0012] In some embodiments, obtaining the target webpage resource from locally cached webpage resources based on the second preset field includes:

[0013] The first cache file is determined based on the second preset field;

[0014] Based on the first cached file, the target network resource is obtained from the locally cached web page resources.

[0015] In some embodiments, determining the first cache file based on the second preset field includes:

[0016] When the second preset field is a third identifier, the cache file that can cache preset static resources is determined to be the first cache file; or,

[0017] When the second preset field is the fourth identifier, the cache file that does not cache the preset static resources is determined as the first cache file.

[0018] In some embodiments, determining the first cache file based on the second preset field includes:

[0019] Upon first access to the target webpage, the first cache file is registered based on the second preset field;

[0020] If the target webpage is not visited for the first time, the registered first cache file is activated based on the second preset field.

[0021] In some embodiments, obtaining the target network resource from the locally cached web page resources based on the first cached file includes:

[0022] Based on the first cached file, obtain the first web page resource from the locally cached web page resources;

[0023] When the version information of the first webpage resource is consistent with the latest version information, the first webpage resource is determined as the target webpage resource;

[0024] When the version information of the first webpage resource is inconsistent with the latest version information, the first webpage resource is deleted, and the second webpage resource of the target webpage is obtained from the server, the second webpage resource is cached, and the second webpage resource is identified as the target webpage resource.

[0025] In some embodiments, the method further includes:

[0026] When a blank screen is detected on the target webpage, the target webpage is refreshed.

[0027] In some embodiments, when the target caching strategy is a second caching strategy, obtaining the target webpage resource of the target webpage based on the target caching strategy includes:

[0028] The target webpage resource is obtained from the second cache file, which includes cached webpage resources and is stored in the domain name directory.

[0029] In some embodiments, when the target caching strategy is a third caching strategy, before obtaining the target webpage resource of the target webpage based on the target caching strategy, the method further includes:

[0030] When the preloading mechanism is enabled, a preloaded webpage set is created, which includes the webpage identifiers corresponding to the webpages for which webpage resources are to be preloaded.

[0031] Preload the web page resources corresponding to the web page identifiers in the preloaded web page set, and cache the web page resources corresponding to the web page identifiers.

[0032] In some embodiments, creating a preloaded collection of web pages includes:

[0033] The preloaded webpage set is created based on the number of times each webpage is used in the current region; and / or,

[0034] The preloaded webpage set is created based on the user's historical browsing behavior.

[0035] In some embodiments, obtaining the target webpage resource of the target webpage based on the target caching strategy includes:

[0036] If preloaded web page resources exist, retrieve the target web page resource from the cached web page resources; or,

[0037] When no preloaded webpage resource exists, but a network cache resource exists, the target webpage resource is obtained from the network cache resource, which includes webpage resources cached during the first access to the webpage; or,

[0038] When there are no preloaded web page resources and no network cache, the target web page resources are obtained from the server.

[0039] In some embodiments, the method further includes:

[0040] Based on the summary information of the target webpage, update indication information of the target webpage is determined. The update indication information is used to indicate whether the cached webpage resources of the target webpage need to be updated.

[0041] When the update instruction information indicates that the cached web page resources of the target web page need to be updated, the latest web page resources of the target web page obtained from the server are cached.

[0042] In some embodiments, the method further includes:

[0043] A prompt message is displayed, which prompts the user to refresh the target webpage.

[0044] In some embodiments, the method further includes:

[0045] Obtain the configuration information corresponding to the preset caching strategy, and the configuration information is used to configure the preset caching strategy.

[0046] According to a second aspect of the present disclosure, a webpage display device is provided, the device comprising:

[0047] The strategy determination module is configured to determine the target caching strategy when the access to the target webpage is detected. The target caching strategy is the caching strategy with the highest priority among a variety of valid preset caching strategies.

[0048] The resource acquisition module is configured to acquire the target webpage resources of the target webpage based on the target caching strategy.

[0049] The webpage display module is configured to display the target webpage based on the target webpage resource.

[0050] In some embodiments, when the target caching strategy is a first caching strategy, the resource acquisition module is configured to:

[0051] Call the preset configuration interface to obtain the first preset field and the second preset field;

[0052] When the first preset field is a first identifier, the target webpage resource is obtained from the server, and the first identifier indicates that the first caching strategy is not used; or...

[0053] When the first preset field is the second identifier, the target web page resource is obtained from the locally cached web page resource based on the second preset field, and the second identifier indicates that the first caching strategy is used.

[0054] In some embodiments, the resource acquisition module is configured to:

[0055] The first cache file is determined based on the second preset field;

[0056] Based on the first cached file, the target network resource is obtained from the locally cached web page resources.

[0057] In some embodiments, the resource acquisition module is configured to:

[0058] When the second preset field is a third identifier, the cache file that can cache preset static resources is determined to be the first cache file; or,

[0059] When the second preset field is the fourth identifier, the cache file that does not cache the preset static resources is determined as the first cache file.

[0060] In some embodiments, the resource acquisition module is configured to:

[0061] Upon first access to the target webpage, the first cache file is registered based on the second preset field;

[0062] If the target webpage is not visited for the first time, the registered first cache file is activated based on the second preset field.

[0063] In some embodiments, the resource acquisition module is configured to:

[0064] Based on the first cached file, obtain the first web page resource from the locally cached web page resources;

[0065] When the version information of the first webpage resource is consistent with the latest version information, the first webpage resource is determined as the target webpage resource;

[0066] When the version information of the first webpage resource is inconsistent with the latest version information, the first webpage resource is deleted, and the second webpage resource of the target webpage is obtained from the server, the second webpage resource is cached, and the second webpage resource is identified as the target webpage resource.

[0067] In some embodiments, the apparatus further includes:

[0068] The webpage refresh module is configured to refresh the target webpage when a blank screen is detected.

[0069] In some embodiments, when the target caching strategy is a second caching strategy, the resource acquisition module is configured to:

[0070] The target webpage resource is obtained from the second cache file, which includes cached webpage resources and is stored in the domain name directory.

[0071] In some embodiments, when the target caching strategy is a third caching strategy, the apparatus further includes:

[0072] The collection creation module is configured to create a preloaded webpage collection when the preloading mechanism is enabled. The preloaded webpage collection includes webpage identifiers corresponding to the webpages for which webpage resources are to be preloaded.

[0073] The preloading module is configured to preload the web page resources corresponding to the web page identifiers in the preloaded web page set, and cache the web page resources corresponding to the web page identifiers.

[0074] In some embodiments, the collection creation module is configured as follows:

[0075] The preloaded webpage set is created based on the number of times each webpage is used in the current region; and / or,

[0076] The preloaded webpage set is created based on the user's historical browsing behavior.

[0077] In some embodiments, the resource acquisition module is configured to:

[0078] If preloaded web page resources exist, retrieve the target web page resource from the cached web page resources; or,

[0079] When no preloaded webpage resource exists, but a network cache resource exists, the target webpage resource is obtained from the network cache resource, which includes webpage resources cached during the first access to the webpage; or,

[0080] When there are no preloaded web page resources and no network cache, the target web page resources are obtained from the server.

[0081] In some embodiments, the apparatus further includes:

[0082] The instruction information determination module is configured to determine update instruction information of the target webpage based on the summary information of the target webpage, wherein the update instruction information is used to indicate whether the cached webpage resources of the target webpage need to be updated;

[0083] The resource update module is configured to cache the latest web page resources of the target web page obtained from the server when the update indication information indicates that the cached web page resources of the target web page need to be updated.

[0084] In some embodiments, the apparatus further includes:

[0085] The prompt message display module is configured to display prompt messages, which are used to prompt the user to refresh the target webpage.

[0086] In some embodiments, the apparatus further includes:

[0087] The configuration information acquisition module is configured to acquire configuration information corresponding to the preset caching strategy, and the configuration information is used to configure the preset caching strategy.

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

[0089] processor;

[0090] Memory used to store processor-executable instructions;

[0091] The processor is configured to perform the method described in the first aspect of the embodiments of this disclosure.

[0092] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method described in the first aspect of the present disclosure.

[0093] The method described above, as disclosed in this invention, has the following beneficial effects:

[0094] The method provided in this disclosure supports multiple preset caching strategies, and different preset caching strategies have different priorities. When accessing a target webpage, the target webpage resources can be obtained according to the highest priority caching strategy among the currently effective multiple preset caching strategies, i.e., the target caching strategy, and then the target webpage can be displayed. This method of supporting multiple preset caching strategies can ensure that pre-cached webpage resources can be obtained to a greater extent, thereby improving webpage opening speed and enhancing user experience.

[0095] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0096] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0097] Figure 1 This is a schematic diagram illustrating an application scenario according to an exemplary embodiment;

[0098] Figure 2 This is a flowchart illustrating a webpage display method according to an exemplary embodiment;

[0099] Figure 3 This is a flowchart illustrating a webpage display method according to an exemplary embodiment;

[0100] Figure 4 This is a flowchart illustrating a webpage display method according to an exemplary embodiment;

[0101] Figure 5 This is a flowchart illustrating a webpage display method according to an exemplary embodiment;

[0102] Figure 6 This is a flowchart illustrating a webpage display method according to an exemplary embodiment;

[0103] Figure 7 This is a schematic diagram illustrating a WPK strategy according to an exemplary embodiment;

[0104] Figure 8 This is a flowchart illustrating a webpage display method according to an exemplary embodiment;

[0105] Figure 9 This is a flowchart illustrating a process for preloading and caching network resources according to an exemplary embodiment;

[0106] Figure 10 This is a schematic diagram illustrating a process of displaying a webpage based on preloaded webpage resources, according to an exemplary embodiment.

[0107] Figure 11 This is a flowchart illustrating a process for checking and updating cached web page resources according to an exemplary embodiment;

[0108] Figure 12 This is a schematic diagram illustrating a kernel preloading strategy according to an exemplary embodiment;

[0109] Figure 13 This is a block diagram illustrating a web page display device according to an exemplary embodiment;

[0110] Figure 14 This is a block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0111] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.

[0112] Before introducing the webpage display method provided in the embodiments of this disclosure, let's first introduce some keywords involved in the embodiments of this disclosure:

[0113] WPK (Web Package Kit) is a software package format developed and built based on Web technology standards, used for distributing Web applications.

[0114] A WPK file consists of one or more web resources, which can be HTML (Hypertext Markup Language), CSS (Cascading Style Sheets), JavaScript (Java), images, videos, etc. WPK files are stored in the root directory of a domain; for example, a WPK file can be named webpackage.wpk and can be accessed via the domain name plus the filename. WPK files can be downloaded over a network and installed and run in a web browser or a terminal container with browser parsing capabilities.

[0115] Service Workers are JavaScript scripts that run in web browsers and handle network requests in the background, thereby improving the performance and reliability of web applications. Service Workers can cache network request responses, allowing web applications to run offline and providing a better user experience when the network is slow. Service Workers have become part of the web standard and are included in the W3C's WebWorkers specification. Many browsers already support Service Workers, which can be used to implement offline applications, push notifications, network performance optimization, and other functions.

[0116] The webpage display method provided in this disclosure can be applied to scenarios where webpages are accessed in a browser, for example, see [link to relevant documentation]. Figure 1 The illustration shows an application scenario where, when a user accesses a webpage in a browser, if the browser has cached webpage resources, it will speed up the presentation of the webpage to the user, thus improving the user experience.

[0117] The method provided in this disclosure is executed by an electronic device, which may be a mobile phone, tablet computer, laptop computer, wearable device, smart home device, vehicle terminal, or other such device.

[0118] Figure 2 This is a flowchart illustrating a webpage display method according to an exemplary embodiment, executed by an electronic device. See also... Figure 2 The method includes the following steps:

[0119] Step S201: When accessing the target webpage is detected, the target caching strategy is determined. The target caching strategy is the caching strategy with the highest priority among a variety of valid preset caching strategies.

[0120] Here, the target webpage is any webpage to be accessed, and accessing the target webpage means accessing the webpage address corresponding to that target webpage. The preset caching strategy is the caching strategy supported by the browser. Different preset caching strategies have different priorities. The target caching strategy is the caching strategy determined from multiple preset caching strategies for this access to the target webpage.

[0121] For various preset caching strategies, some may not work due to different browser configurations. Therefore, when determining the target caching strategy, it is necessary to select from the effective preset caching strategies. In order to better obtain cached web page resources, the caching strategy with the highest priority among the effective preset caching strategies should be selected as the target caching strategy according to its priority.

[0122] Step S203: Based on the target caching strategy, obtain the target webpage resources.

[0123] Once the target caching strategy is determined, the target webpage resources can be obtained using this strategy. These target webpage resources include resources used for rendering and displaying the target webpage, such as HTML, CSS, JavaScript, images, and videos.

[0124] Step S203: Display the target webpage based on the target webpage resources.

[0125] Based on the target webpage resources, the target webpage is rendered and displayed, thereby showing the content of the target webpage to the user.

[0126] The method provided in this disclosure supports multiple preset caching strategies, and different preset caching strategies have different priorities. When accessing a target webpage, the target webpage resources can be obtained according to the highest priority caching strategy among the currently effective multiple preset caching strategies, i.e., the target caching strategy, and then the target webpage can be displayed. This method of supporting multiple preset caching strategies can ensure that pre-cached webpage resources can be obtained to a greater extent, thereby improving webpage opening speed and enhancing user experience.

[0127] In some embodiments, the multiple preset caching strategies include a first caching strategy, a second caching strategy, and a third caching strategy, wherein the first caching strategy has a higher priority than the second caching strategy, and the second caching strategy has a higher priority than the third caching strategy.

[0128] In one example, the first caching strategy is the Service Worker strategy, the second caching strategy is the WPK strategy, and the third caching strategy is the kernel preloading strategy.

[0129] Figure 3This is a flowchart illustrating a webpage display method according to an exemplary embodiment. See also... Figure 3 This includes the following steps:

[0130] Step 1: Access the webpage through your browser.

[0131] Step 2: Determine if the service worker policy is effective. If the service worker policy is effective, proceed to step 3. If the service worker policy is not effective, proceed to step 4.

[0132] Step 3: Accelerate by using the service worker strategy to obtain cached web page resources, and then execute step 9.

[0133] Step 4: Determine if the WPK policy is effective. If the WPK policy is effective, proceed to step 5. If the WPK policy is not effective, proceed to step 6.

[0134] Step 5: Accelerate using WPK strategy, obtain cached web page resources, and then execute step 9.

[0135] Step 6: Determine if the kernel preloading policy is effective. If the kernel preloading policy is effective, proceed to step 7. If the kernel preloading policy is not effective, proceed to step 8.

[0136] Step 7: Accelerate by using kernel preloading strategy to obtain cached web page resources, and then execute step 9.

[0137] Step 8: Make a normal network request to obtain the web page resources from the server.

[0138] Step 9: Display the webpage, that is, show the webpage to the user.

[0139] The webpages mentioned in steps 1-9 are the target webpages.

[0140] The processes for displaying web pages differ depending on the preset caching strategy employed. The following examples illustrate the processes for displaying web pages using the first, second, and third caching strategies:

[0141] The first caching strategy is used for webpage display:

[0142] This disclosure uses the Service Worker strategy as an example to illustrate the embodiments.

[0143] Figure 4 This is a flowchart illustrating a webpage display method according to an exemplary embodiment, executed by an electronic device. See also... Figure 4 The method includes the following steps:

[0144] Step S401: When access to the target webpage is detected, determine the first caching strategy.

[0145] Step S402: Call the preset configuration interface to obtain the first preset field and the second preset field.

[0146] When a user visits the target webpage, the program code for executing the main thread is loaded and then executed. During the execution of the main thread, a preset configuration interface is called, which can be a service worker configuration interface.

[0147] Obtaining the first preset field and the second preset field includes: returning the first preset field and the second preset field through the preset configuration interface. For example, the first preset field is use_sw and the second preset field is cache_html, and both the first preset field and the second preset field are of type boolean.

[0148] Step S403: When the first preset field is the first identifier, obtain the target webpage resource from the server.

[0149] The first identifier indicates that the first caching strategy is not used. For example, the first identifier can be false, 0, or other identifiers. When the first preset field is the first identifier, it means that the first caching strategy is not applied. In this case, the target webpage resource can be obtained directly from the server. For example, a network request is sent to the server to request the webpage resource of the target webpage, and then the target webpage resource returned by the server is received.

[0150] Step S404: When the first preset field is the second identifier, the target web page resource is obtained from the locally cached web page resources based on the second preset field.

[0151] The second identifier differs from the first identifier. The second identifier indicates the use of the first caching strategy; for example, the second identifier can be true, 1, or other identifiers. When the first preset field is the first identifier, it indicates that the first caching strategy is used, and therefore, the target webpage resource can be obtained from the locally cached webpage resources.

[0152] In some embodiments, a first cache file is determined based on a second preset field; based on the first cache file, the target network resource is obtained from locally cached web page resources. The first cache file includes cache files that can cache preset static resources and cache files that cannot cache preset static resources. The preset static resources can be static resources such as HTML and CSS. For example, the first cache file includes a service worker file that caches HTML and a service worker file that cannot cache HTML.

[0153] In some embodiments, determining the first cache file based on a second preset field includes: when the second preset field is a third identifier, determining a cache file that can cache preset static resources as the first cache file; or, when the second preset field is a fourth identifier, determining a cache file that does not cache preset static resources as the first cache file. For example, the third identifier and the fourth identifier are different; for example, the third identifier can be true, 1, or other identifiers, and the fourth identifier can be false, 0, or other identifiers.

[0154] In some embodiments, determining the first cache file based on a second preset field includes: registering the first cache file based on the second preset field when the target webpage is accessed for the first time; and activating the registered first cache file based on the second preset field when the target webpage is accessed for the second time.

[0155] Optionally, when the second preset field is the third identifier and the target webpage is accessed for the first time, a cache file for cacheable preset static resources is registered, and the registered cache file for cacheable preset static resources is determined as the first cache file; when the second preset field is the third identifier and the target webpage is not accessed for the first time, a registered cache file for cacheable preset static resources is activated, and the activated cache file for cacheable preset static resources is determined as the first cache file; when the second preset field is the fourth identifier and the target webpage is accessed for the first time, a cache file for non-cached preset static resources is registered, and the registered cache file for non-cached preset static resources is determined as the first cache file; when the second preset field is the fourth identifier and the target webpage is not accessed for the first time, a registered cache file for non-cached preset static resources is activated, and the activated cache file for non-cached preset static resources is determined as the first cache file.

[0156] In some embodiments, obtaining a target network resource from locally cached web page resources based on a first cache file includes: obtaining a first web page resource from locally cached web page resources based on the first cache file; when the version information of the first web page resource is consistent with the latest version information, identifying the first web page resource as the target web page resource; when the version information of the first web page resource is inconsistent with the latest version information, deleting the first web page resource, obtaining a second web page resource of the target web page from the server, caching the second web page resource, and identifying the second web page resource as the target web page resource. Here, the version information can be a version number. When the version information of the first web page resource is consistent with the latest version information, it indicates that the server has not updated the first web page resource after it was locally cached; when the version information of the first web page resource is inconsistent with the latest version information, it indicates that the server has updated the first web page resource after it was locally cached, therefore, it is necessary to obtain the updated second web page resource.

[0157] In one example, taking HTML as the default static resource, the process of displaying the webpage using the first caching strategy is described in [link to example]. Figure 5 When a user visits a target webpage, the main thread's program code is loaded and executed. Then, the service worker configuration interface is called. The interface returns the fields `use_sw` and `cache_html`. The system then determines if this is the user's first visit to the target webpage. If it is the user's first visit, and `use_sw` is false, service worker caching is not used, existing service worker files are unregistered, existing service worker files are deleted, and the page is displayed normally. If `use_sw` is true, and `cache_html` is true, a service worker file that can cache HTML is registered, and the page is displayed normally. If `cache_html` is false, a service worker file that does not cache HTML is registered, and the page is displayed normally. If the user is not visiting the target webpage for the first time, then when use_sw is false, service worker caching is not used, existing service worker files are unregistered and deleted, and the page is displayed normally. When use_sw is true, if cache_html is true, then service worker files that can cache HTML are activated; if cache_htm is false, then service worker files that do not cache HTML are activated. After activating either the service worker file that can cache HTML or the service worker file that does not cache HTML, it is first checked whether the version number of the local cache is consistent with the latest version number. If they are consistent, the cache is loaded directly and the page is displayed normally. If they are inconsistent, the local cache is deleted, the latest resource is cached, and the page is displayed normally.

[0158] Step S405: Display the target webpage based on the target webpage resources.

[0159] In addition, in some embodiments, when the first caching strategy is adopted, it is possible to detect whether the target webpage is blank. When the blank screen of the target webpage is detected, the target webpage is refreshed, thereby ensuring service availability to a greater extent.

[0160] In some embodiments, for each preset caching strategy, configuration information corresponding to the preset caching strategy is obtained, and the configuration information is used to configure the preset caching strategy. Similarly, the first caching strategy can also be configured using the configuration information corresponding to the first caching strategy. Furthermore, this configuration information can be sent to the current electronic device by a server or other remote device. Therefore, the ability to remotely control whether to use the first caching strategy and whether to remotely control whether to cache preset static resources can be achieved.

[0161] The method provided in this disclosure, when adopting a first caching strategy, can remotely control whether to use the first caching strategy and whether to cache preset static resources. Furthermore, it can support detecting whether the target webpage displays a blank screen. If a blank screen appears, the target webpage can be refreshed, thereby ensuring service availability to a greater extent.

[0162] The second caching strategy is used for webpage display:

[0163] This disclosure uses a WPK strategy as an example to illustrate the embodiments.

[0164] For WPK applications, the following characteristics are present:

[0165] Cross-platform: WPK applications are parsed by a web browser engine and can run on different platforms, including desktops, mobile devices, and IoT (Internet of Things) devices.

[0166] Rapid deployment: A rich front-end ecosystem enables rapid deployment of web applications, reducing deployment time and costs.

[0167] Version control: Package different versions of a web application into different files for easier version control and management.

[0168] Offline application: Package a web application into an offline application, so that users can use the WPK application without an internet connection.

[0169] For WPK files, in one example, the structure of a WPK file is as follows:

[0170]

[0171] The WPK file publishing process is as follows:

[0172] 1. Compile the project source code and package it into a WPK file;

[0173] 2. Download and install the WPK file through a browser. You can directly access the website domain to download it, and you can deploy the WPK file in the root directory of the site.

[0174] 3. Access is initiated based on the original data configuration and entry route. That is, after the download is completed, when the browser is launched, the WPK file is launched based on the original data configuration and entry route.

[0175] In some embodiments, a WPK ecosystem can be built, for example by performing the following operations:

[0176] 1. Generate WPK data package.

[0177] 2. Regularly check and update the top websites in the browser, and proactively pull and build WPK data packages for hosting whitelist management.

[0178] 3. Provide development guidance tutorials for developers, as well as a WPK data package version control and package hosting platform.

[0179] 4. Perform an app store security scan on the published WPK data package.

[0180] Based on the above content regarding WPK strategy, the following approach is adopted. Figure 6 The implementation shown is displayed on a webpage.

[0181] Figure 6 This is a flowchart illustrating a webpage display method according to an exemplary embodiment, executed by an electronic device. See also... Figure 6 The method includes the following steps:

[0182] Step S601: When access to the target webpage is detected, determine the second caching strategy.

[0183] Step S602: Obtain the target webpage resource from the second cache file, which includes cached webpage resources.

[0184] The second cache file is stored in the domain name directory, or in other words, in the site's root directory. For example, the second cache file can be a WPK file.

[0185] Step S603: Display the target webpage based on the target webpage resources.

[0186] In one example, the process of displaying a webpage using the second caching strategy can be found in [link to example]. Figure 7First, the browser downloads or updates the WPK file from the server, saving the downloaded or updated WPK file in pages / assets / manifest.json. Then, a webview provides the ability to load resource webpages in the background, and these resource webpages retrieve content data from the WPK file, loading the retrieved content data into another webview. When the WPK file needs to access network resources, it initiates a network request using the httprequest() method in the encapsulated JavascriptInterface, sending the retrieved network resources to the WPK file. Additionally, JavascriptInterface can also implement file sharing and saving functions.

[0187] In this embodiment, when using the WPK strategy, if a site has a pre-built and placed corresponding WPK file in the domain path according to the WPK standard when a user accesses a webpage in a browser, the browser will preload the WPK at an appropriate time. This significantly accelerates the real-time presentation of pages and data to the user during browsing or subsequent browsing activities, improving the user experience and providing a smoother experience in terms of interactive animations, route switching, and partial transitions. Furthermore, it has certain native capabilities, meaning that with the basic capabilities provided by the browser SDK (Software Development Kit), WPK can easily implement the interactive capabilities that only native applications possess in web applications. Moreover, there are no browser compatibility issues: the web technologies used by WPK only rely on the execution of the UI engine and JS engine, and there are basically no compatibility issues at the language level. When used, it does not intrude on the browser's existing projects, has no technology stack requirements for the projects being processed, and can handle existing browser projects.

[0188] A third-party caching strategy is used for webpage display:

[0189] This disclosure uses the third caching strategy as an example of the kernel preloading strategy for illustration.

[0190] Figure 8 This is a flowchart illustrating a webpage display method according to an exemplary embodiment, executed by an electronic device. See also... Figure 8 The method includes the following steps:

[0191] Step S801: With the preloading mechanism enabled, create a collection of preloaded web pages.

[0192] The preloaded web page set includes web page identifiers corresponding to the web pages for which web page resources are to be preloaded. The web page identifier is used to uniquely identify a web page. For example, the web page identifier can be a website or a web page address.

[0193] In some embodiments, when a webpage is used frequently within a region, it indicates that many users in that region may need to use the webpage. Therefore, a preloaded webpage set is created based on the number of times each webpage is used in the current region. Optionally, when the number of times a webpage is used exceeds a preset threshold, the webpage identifier of that webpage is added to the preloaded webpage set.

[0194] In one example, a CMS (Content Management System) is used to distribute sites (web pages) that match the actual usage scenarios of users in different regions.

[0195] In some embodiments, a preloaded webpage set is created based on the user's historical browsing behavior, which refers to the webpages the user has viewed. That is, if a user has viewed a webpage before, it means that the user is likely to view that webpage again. Therefore, based on the user's historical browsing behavior, the webpages that the user may view are predicted, and the webpage identifiers of the predicted webpages are added to the preloaded webpage set.

[0196] Step S802: Preload the web page resources corresponding to the web page identifiers in the preloaded web page set, and cache the web page resources corresponding to the web page identifiers.

[0197] After determining the set of preloaded web pages, it is necessary to preload the web page resources corresponding to the web page identifiers in the set of preloaded web pages, and cache the web page resources corresponding to the web page identifiers.

[0198] In some embodiments, queue management of preloading tasks is used to avoid excessive CPU (Central Processing Unit) load caused by multiple preloading tasks executing simultaneously, which would affect normal user experience. That is, when multiple web page resources need to be preloaded, they are preloaded sequentially to avoid excessive CPU load caused by simultaneous preloading.

[0199] Optionally, WebContents can be used to retrieve the links of web page resources that need to be preloaded in the background. Then, once the web page DOM (DocumentObjectModel) is loaded, the web page resources can be downloaded to the cache directory via SimpleURLLoader, i.e., web page resources can be cached via SimpleURLLoader.

[0200] Optionally, after caching web page resources, the web page resources can also be saved to the database.

[0201] In one example, the process of preloading web page resources and caching network resources in steps S801-S802 above can be found in [reference needed]. Figure 9 When the browser starts, a preloading process begins. First, it checks if the preloading mechanism is enabled. If not, the preloading process ends. If enabled, a preloading site pool (i.e., a collection of preloaded web pages) is built. Then, it checks if the preloading site pool was built successfully. If not, the preloading process ends. If it is built successfully, the preloaded sites are saved to the database (DB), and the web page resources are cached. Next, it checks if the web page resources are cached successfully. If not, the preloading process ends. If the web page resources are cached successfully, the website cache result (i.e., the cached web page resources) is updated to the database, and the preloading process ends.

[0202] Step S803: When access to the target webpage is detected, a third caching strategy is determined.

[0203] In this embodiment of the disclosure, after determining that the third caching strategy is to be used, it is necessary to first determine whether there are preloaded web page resources. If there are preloaded web page resources, then step S804 is executed. If there are no preloaded web page resources, then it is further determined whether there are network cache resources. If there are network cache resources, then step S805 is executed. If there are no network cache resources, then step S806 is executed.

[0204] Step S804: When preloaded web page resources exist, retrieve the target web page resources from the cached web page resources.

[0205] Step S805: When there are no preloaded web page resources but there are network cache resources, obtain the target web page resources from the network cache resources.

[0206] Among them, network cached resources include web page resources cached when a web page is accessed for the first time.

[0207] Step S806: When there are no preloaded web page resources and no network cache, obtain the target web page resources from the server.

[0208] Step S807: Display the target webpage based on the target webpage resources.

[0209] In one example, the process of displaying the webpage based on preloaded webpage resources in steps S804-S807 above is described in [reference needed]. Figure 10First, the URLLoader class triggers URLRequest to initiate a network request. This request carries policy information configured according to the Policy and Preloader. Then, the web page resource is retrieved sequentially through URLRequestJob and HttpCache. This involves a two-level cache check triggered by CacheTransaction. If a cache hit occurs (meaning a preloaded web page resource exists), the cached resource is returned to HttpCache. The web page resource is then returned sequentially through HttpCache, URLRequestJob, URLRequest, and URLLoader. If a cache miss occurs (meaning no preloaded web page resource exists), a network request is sent to PreloadCache, which then sends a network request to NetworkTransaction. NetworkTransaction then sends a network request to the server and receives the server's response. This response is the returned web page resource, which is then returned sequentially through filter, decoder, HttpCache, URLRequestJob, URLRequest, and URLLoader. While returning the web page resources, the decoder will also save the web page resources to the Preload Cache.

[0210] Step S808: Determine update instruction information for the target webpage based on the summary information of the target webpage.

[0211] The update indication information is used to indicate whether the cached web page resources of the target web page need to be updated. For example, the update information can be the MD5 (Message Digest Algorithm MD5) value of the web page's HTML file.

[0212] Optionally, when the summary information of the target webpage is different from the latest summary information obtained from the server, it is determined that the cached webpage resources of the target webpage need to be updated; when the summary information of the target webpage is the same as the latest summary information obtained from the server, it is determined that the cached webpage resources of the target webpage do not need to be updated.

[0213] In some embodiments, when the webpage identifier of the target webpage is in the preloaded webpage set, update indication information for the target webpage is determined based on the summary information of the target webpage.

[0214] Step S809: When the update instruction information indicates that the cached web page resources of the target web page need to be updated, cache the latest web page resources of the target web page obtained from the server.

[0215] Step S810: Display a prompt message to remind the user to refresh the target webpage.

[0216] After the prompt message is displayed, the user can refresh the target webpage to see the refreshed version.

[0217] In one example, the process of checking and updating the cached webpage resources after the target webpage has been loaded in steps S808-S809 above is described in [reference needed]. Figure 11 After the webpage loads, it determines whether an update check is needed (by checking if the webpage's identifier is in the preloaded webpage set). If no update check is needed (the webpage's identifier is not in the preloaded webpage set), the update check process ends. If an update check is needed (the webpage's identifier is in the preloaded webpage set), it retrieves the cached webpage resources and the latest webpage resources corresponding to that webpage. Then, based on the MD5 value of the HTML file in the latest webpage resources and the cached webpage resources, it determines whether the webpage needs to be updated. If no update is needed, the update check process ends. If an update is needed, the latest webpage resources are saved to the database, and the user is prompted to refresh the webpage. Finally, the update check process ends.

[0218] The method provided in this disclosure allows the browser to preload websites for different regions and cache web page resources based on operational strategies. When a user opens a web page, the locally cached web page resources are used for rendering. Network requests are only initiated for resources that are not found in the local cache. This significantly reduces the number of network requests and shortens the loading time of web page resources when opening a website, achieving the goal of opening web pages almost instantly. Furthermore, the browser kernel's pre-caching strategy can automatically cache and update without manual intervention.

[0219] In one example, see the diagram illustrating the kernel preloading strategy for displaying a webpage. Figure 12 The kernel preloading strategy includes three parts: the preloading process, the web browsing process, and the kernel resource loading process. The following section will combine these with... Figure 12 The following will explain these three parts separately:

[0220] Preloading process:

[0221] When a user launches a browser, the first server sends a kernel preloading strategy to the browser, and then the kernel retrieves web page resources from the second server and caches the retrieved web page resources locally.

[0222] Web browsing process:

[0223] When a user is detected browsing a webpage through a browser, the webpage is loaded via the kernel. During loading, if the webpage resources are cached locally, they are retrieved. If not, the resources are fetched from a second server. The webpage is then rendered based on the retrieved resources and finally displayed. If the retrieved resources are cached locally, after displaying the webpage, the kernel checks for resource updates. If an update is determined, the cached resources are updated, and the user is prompted to update the webpage after the update is complete.

[0224] Kernel resource loading process:

[0225] First, the ResourceDispatcher is triggered via the URLLoader class. Then, the ResourceDispatcher triggers URLResquest to initiate a network request. This network request carries policy information configured according to the Policy and Preloader. Next, the web page resource is retrieved sequentially through URLResquestJob and HttpCache. Specifically, a Memory OR Disk Cache check is triggered via Cache Transaction. If a match is found (i.e., a preloaded web page resource exists), the cached web page resource is returned to HttpCache. Then, the web page resource is returned sequentially through HttpCache, URLResquestJob, URLResquest, and URLLoader. If a match is found (i.e., a preloaded web page resource does not exist), a network request is sent to the Preload Cache. Finally, the Preload Cache... The Cache sends a network request to the NetworkTransaction, which in turn sends a network request to the server through the NetworkTransaction, and receives the response from the server. This response is the returned web page resource, which will be returned through the filter, decoder, HttpCache, URLResquestJob, URLResquest, and URLLoader in sequence.

[0226] Additionally, the ResourceDispatcher triggers the Pipeline, which includes Parser, Style & Layout, Compositing Update, and Paint. Furthermore, web page resources are loaded via Offliner Parser, PreloadList, and Offliner.

[0227] In one example, the rendering time required for the first content and the maximum content as shown in Table 1 below is compared. As can be seen from Table 1, the rendering time based on the Native solution and the rendering time during normal webpage access are both greater than the rendering time required by the solution provided in this embodiment. Therefore, the solution provided in this embodiment improves the rendering speed of webpages compared to the methods in related technologies, that is, it improves the webpage opening speed and improves the user experience.

[0228] Table 1

[0229]

[0230] Figure 13 This is a block diagram illustrating a web page display device according to an exemplary embodiment, configured in an electronic device. See also... Figure 13 The device includes:

[0231] The strategy determination module 1301 is configured to determine the target caching strategy when it detects access to the target webpage. The target caching strategy is the caching strategy with the highest priority among a variety of valid preset caching strategies.

[0232] The resource acquisition module 1302 is configured to acquire the target webpage resources of the target webpage based on the target caching strategy.

[0233] The webpage display module 1303 is configured to display the target webpage based on the target webpage resource.

[0234] In some embodiments, when the target caching strategy is the first caching strategy, the resource acquisition module 1302 is configured to:

[0235] Call the preset configuration interface to obtain the first preset field and the second preset field;

[0236] When the first preset field is the first identifier, the target webpage resource is retrieved from the server; the first identifier indicates that the first caching strategy is not used; or...

[0237] When the first preset field is the second identifier, the target web page resource is obtained from the locally cached web page resource based on the second preset field, and the second identifier indicates the use of the first caching strategy.

[0238] In some embodiments, the resource acquisition module 1302 is configured to:

[0239] The first cache file is determined based on the second preset field;

[0240] Based on the first cached file, the target network resource is obtained from the locally cached web page resources.

[0241] In some embodiments, the resource acquisition module 1302 is configured to:

[0242] When the second preset field is the third identifier, the cache file that can cache preset static resources is determined as the first cache file; or,

[0243] When the second preset field is the fourth identifier, the cache file that does not cache the preset static resources will be determined as the first cache file.

[0244] In some embodiments, the resource acquisition module 1302 is configured to:

[0245] Upon first visit to the target webpage, register the first cache file based on the second preset field;

[0246] If the target webpage is not visited for the first time, the registered first cache file is activated based on the second preset field.

[0247] In some embodiments, the resource acquisition module 1302 is configured to:

[0248] Based on the first cached file, obtain the first webpage resource from the locally cached webpage resources;

[0249] When the version information of the first webpage resource is consistent with the latest version information, the first webpage resource is identified as the target webpage resource.

[0250] When the version information of the first webpage resource is inconsistent with the latest version information, delete the first webpage resource, obtain the second webpage resource of the target webpage from the server, cache the second webpage resource, and identify the second webpage resource as the target webpage resource.

[0251] In some embodiments, the apparatus further includes:

[0252] The webpage refresh module is configured to refresh the target webpage when a blank screen is detected.

[0253] In some embodiments, when the target caching strategy is the second caching strategy, the resource acquisition module 1302 is configured to:

[0254] The target webpage resource is obtained from the second cache file, which includes cached webpage resources and is stored in the domain directory.

[0255] In some embodiments, when the target caching policy is a third caching policy, the apparatus further includes:

[0256] The collection creation module is configured to create a collection of preloaded web pages when the preloading mechanism is enabled. The collection of preloaded web pages includes the web page identifiers corresponding to the web pages for which web page resources are to be preloaded.

[0257] The preloading module is configured to preload the web page resources corresponding to the web page identifiers in the preloaded web page collection, and cache the web page resources corresponding to the web page identifiers.

[0258] In some embodiments, the collection creation module is configured as follows:

[0259] Create a preloaded set of web pages based on the number of times each web page is used in the current region; and / or,

[0260] Create a collection of preloaded web pages based on the user's historical browsing behavior.

[0261] In some embodiments, the resource acquisition module 1302 is configured to:

[0262] If preloaded web page resources exist, retrieve the target web page resources from the cached web page resources; or,

[0263] If no preloaded webpage resource exists, but a network cache resource exists, the target webpage resource is retrieved from the network cache resource, which includes the webpage resource cached during the first visit to the webpage; or,

[0264] When there are no preloaded web page resources and no network cache, the target web page resources are obtained from the server.

[0265] In some embodiments, the apparatus further includes:

[0266] The instruction information determination module is configured to determine the update instruction information of the target webpage based on the summary information of the target webpage. The update instruction information is used to indicate whether the webpage resources of the cached target webpage need to be updated.

[0267] The resource update module is configured to cache the latest web page resources of the target web page obtained from the server when the update instruction information indicates that the web page resources of the cached target web page need to be updated.

[0268] In some embodiments, the apparatus further includes:

[0269] The prompt message display module is configured to display prompt messages that remind the user to refresh the target webpage.

[0270] In some embodiments, the apparatus further includes:

[0271] The configuration information acquisition module is configured to acquire the configuration information corresponding to the preset caching strategy. The configuration information is used to configure the preset caching strategy.

[0272] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0273] This disclosure also provides an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the webpage display method described in the above embodiments.

[0274] Figure 14 This is a block diagram of an electronic device 1400 according to an exemplary embodiment.

[0275] Reference Figure 14 The electronic device 1400 may include one or more of the following components: a processing component 1402, a memory 1404, a power supply component 1406, a multimedia component 1408, an audio component 1410, an input / output (I / O) interface 1412, a sensor component 1414, and a communication component 1416.

[0276] Processing component 1402 typically controls the overall operation of electronic device 1400, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 1402 may include one or more processors 1420 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 1402 may include one or more modules to facilitate interaction between processing component 1402 and other components. For example, processing component 1402 may include a multimedia module to facilitate interaction between multimedia component 1408 and processing component 1402.

[0277] Memory 1404 is configured to store various types of data to support the operation of electronic device 1400. Examples of this data include instructions for any application or method operating on electronic device 1400, contact data, phonebook data, messages, pictures, videos, etc. Memory 1404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0278] Power supply component 1406 provides power to various components of electronic device 1400. Power supply component 1406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 1400.

[0279] Multimedia component 1408 includes a screen that provides an output interface between the electronic device 1400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 1408 includes a front-facing camera and / or a rear-facing camera. When the electronic device 1400 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0280] Audio component 1410 is configured to output and / or input audio signals. For example, audio component 1410 includes a microphone (MIC) configured to receive external audio signals when electronic device 1400 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 1404 or transmitted via communication component 1416. In some embodiments, audio component 1410 also includes a speaker for outputting audio signals.

[0281] I / O interface 1412 provides an interface between processing component 1402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0282] Sensor assembly 1414 includes one or more sensors for providing state assessments of various aspects of electronic device 1400. For example, sensor assembly 1414 may detect the on / off state of electronic device 1400, the relative positioning of components such as the display and keypad of electronic device 1400, changes in position of electronic device 1400 or a component of electronic device 1400, the presence or absence of user contact with electronic device 1400, orientation or acceleration / deceleration of electronic device 1400, and temperature changes of electronic device 1400. Sensor assembly 1414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 1414 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0283] Communication component 1416 is configured to facilitate wired or wireless communication between electronic device 1400 and other devices. Electronic device 1400 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 1416 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 1416 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0284] In an exemplary embodiment, the electronic device 1400 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0285] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1404 including instructions, which can be executed by a processor 1420 of an electronic device 1400 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0286] This disclosure also provides a non-transitory computer-readable storage medium, wherein when the instructions in the storage medium are executed by the processor of an electronic device, the electronic device is able to perform the web page display method described in the above embodiments.

[0287] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.

[0288] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A webpage display method, characterized in that, The method includes: When access to a target webpage is detected, a target caching strategy is determined. The target caching strategy is the caching strategy with the highest priority among a variety of effective preset caching strategies. Based on the target caching strategy, obtain the target webpage resources of the target webpage; Based on the target webpage resource, display the target webpage.

2. The method according to claim 1, characterized in that, When the target caching strategy is the first caching strategy, obtaining the target webpage resource based on the target caching strategy includes: Call the preset configuration interface to obtain the first preset field and the second preset field; When the first preset field is a first identifier, the target webpage resource is obtained from the server, and the first identifier indicates that the first caching strategy is not used; or... When the first preset field is the second identifier, the target web page resource is obtained from the locally cached web page resource based on the second preset field, and the second identifier indicates that the first caching strategy is used.

3. The method according to claim 2, characterized in that, The step of retrieving the target webpage resource from locally cached webpage resources based on the second preset field includes: The first cache file is determined based on the second preset field; Based on the first cached file, the target network resource is obtained from the locally cached web page resources.

4. The method according to claim 3, characterized in that, The step of determining the first cache file based on the second preset field includes: When the second preset field is a third identifier, the cache file that can cache preset static resources is determined to be the first cache file; or, When the second preset field is the fourth identifier, the cache file that does not cache the preset static resources is determined as the first cache file.

5. The method according to claim 3, characterized in that, The step of determining the first cache file based on the second preset field includes: Upon first access to the target webpage, the first cache file is registered based on the second preset field; If the target webpage is not visited for the first time, the registered first cache file is activated based on the second preset field.

6. The method according to claim 3, characterized in that, The step of obtaining the target network resource from the locally cached web page resources based on the first cached file includes: Based on the first cached file, obtain the first web page resource from the locally cached web page resources; When the version information of the first webpage resource is consistent with the latest version information, the first webpage resource is determined as the target webpage resource; When the version information of the first webpage resource is inconsistent with the latest version information, the first webpage resource is deleted, and the second webpage resource of the target webpage is obtained from the server, the second webpage resource is cached, and the second webpage resource is identified as the target webpage resource.

7. The method according to claim 2, characterized in that, The method further includes: When a blank screen is detected on the target webpage, the target webpage is refreshed.

8. The method according to claim 1, characterized in that, When the target caching strategy is the second caching strategy, obtaining the target webpage resource based on the target caching strategy includes: The target webpage resource is obtained from the second cache file, which includes cached webpage resources and is stored in the domain name directory.

9. The method according to claim 1, characterized in that, When the target caching strategy is the third caching strategy, before obtaining the target webpage resource of the target webpage based on the target caching strategy, the method further includes: When the preloading mechanism is enabled, a preloaded webpage set is created, which includes the webpage identifiers corresponding to the webpages for which webpage resources are to be preloaded. Preload the web page resources corresponding to the web page identifiers in the preloaded web page set, and cache the web page resources corresponding to the web page identifiers.

10. The method according to claim 9, characterized in that, The creation of the preloaded webpage collection includes: The preloaded webpage set is created based on the number of times each webpage is used in the current region; and / or, The preloaded webpage set is created based on the user's historical browsing behavior.

11. The method according to claim 9, characterized in that, The step of obtaining the target webpage resource based on the target caching strategy includes: If preloaded web page resources exist, retrieve the target web page resource from the cached web page resources; or, When no preloaded webpage resource exists, but a network cache resource exists, the target webpage resource is obtained from the network cache resource, which includes webpage resources cached during the first access to the webpage; or, When there are no preloaded web page resources and no network cache, the target web page resources are obtained from the server.

12. The method according to claim 11, characterized in that, The method further includes: Based on the summary information of the target webpage, update indication information of the target webpage is determined. The update indication information is used to indicate whether the cached webpage resources of the target webpage need to be updated. When the update instruction information indicates that the cached web page resources of the target web page need to be updated, the latest web page resources of the target web page obtained from the server are cached.

13. The method according to claim 12, characterized in that, The method further includes: A prompt message is displayed, which prompts the user to refresh the target webpage.

14. The method according to claim 1, characterized in that, The method further includes: Obtain the configuration information corresponding to the preset caching strategy, and the configuration information is used to configure the preset caching strategy.

15. A webpage display device, characterized in that, The device includes: The strategy determination module is configured to determine the target caching strategy when the access to the target webpage is detected. The target caching strategy is the caching strategy with the highest priority among a variety of valid preset caching strategies. The resource acquisition module is configured to acquire the target webpage resources of the target webpage based on the target caching strategy. The webpage display module is configured to display the target webpage based on the target webpage resource.

16. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to perform the method as described in any one of claims 1-14.

17. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1-14.