Webpage loading method and device, electronic equipment and storage medium
By identifying the loading method of web pages and performing corresponding target operations, the problem of web page loading failure caused by network instability is solved, and the web pages are automatically reloaded, improving user experience and reducing the burden on the server.
Patent Information
- Application Number
- CN202411884554.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-15
AI Technical Summary
In the case of unstable network, the client's web page fails to load, and the existing technology requires users to manually refresh the web page, resulting in poor user experience and waste of server resources.
Provides a web page loading method, by identifying the current loading method of the target page, performing matching target operations in response to failure of web page resource loading. Specifically, when loading within the terminal, the target client monitors and re-requests the failed resources; when loading outside the terminal, the web page reload condition is detected and other client refresh operations are triggered.
It realizes automatic reloading of web pages when the network is unstable, improves user experience, reduces the need for users to manually refresh, and reduces the pressure of invalid requests on the server.
Smart Images

Figure CN119829858A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of Internet technology, and specifically to a webpage loading method, device, electronic device, and storage medium. Background Art
[0002] Currently, the successful loading of web pages on the client depends on a stable network connection. In the case of an unstable network, such as a weak network or a sudden network disconnection, web page loading failure is likely to occur. In related technologies, after a web page fails to load, the user is usually required to manually refresh the web page. Summary of the Invention
[0003] The present disclosure provides a webpage loading method, device, electronic device and storage medium.
[0004] In a first aspect, the present disclosure provides a webpage loading method, the method comprising:
[0005] In response to a loading operation of a target webpage, loading webpage resources on the target webpage; wherein the target webpage is a webpage of a target client;
[0006] Identifying a current loading mode of the target webpage; wherein the loading mode includes in-client loading, which is used to indicate loading within the target client, or out-client loading, which is used to indicate loading on other clients;
[0007] For the target web page, a target operation that matches the current loading mode and is used to respond to a failure in loading the web page resource is executed.
[0008] Optionally, executing a target operation matching the current loading mode and used to respond to a failure in loading a webpage resource on the target webpage includes:
[0009] In the case where the current loading mode is off-end loading, detecting whether the target webpage meets a webpage reloading condition, and if so, triggering the other client to perform a refresh operation on the target webpage to reload the target webpage;
[0010] The webpage reloading condition is a condition related to a failure in loading the webpage resource of the target webpage.
[0011] Optionally, executing a target operation matching the current loading mode and used to respond to a failure in loading a webpage resource on the target webpage includes:
[0012] When the current loading mode is in-client loading, detecting whether a target resource obtained and transmitted by the target client is received; wherein the method for obtaining the target resource includes: the target client, in response to the target webpage being in the in-client loading mode, monitoring whether each webpage resource of the target webpage satisfies a resource reloading condition, and when monitoring that each webpage resource satisfies the resource reloading condition, requesting the webpage resource that satisfies the resource reloading condition to obtain the target resource;
[0013] Upon receipt, the target resource is loaded and displayed in the target webpage.
[0014] Optionally, detecting whether the target webpage satisfies a webpage reloading condition includes:
[0015] Determining a resource loading failure rate of the target webpage; wherein the resource loading failure rate is a ratio of webpage resources that failed to load to the webpage resources required to load the target webpage;
[0016] Based on the resource loading failure rate, it is determined whether the target webpage meets a webpage reloading condition.
[0017] Optionally, judging whether the target webpage satisfies a webpage reloading condition based on the resource loading failure rate includes:
[0018] Determining whether the resource loading failure rate is greater than a predetermined failure rate threshold, if so, determining that a webpage reloading condition is met; otherwise, determining that the webpage reloading condition is not met;
[0019] or,
[0020] Determine whether the resource loading failure rate is greater than a predetermined failure rate threshold, and whether the most recently executed loading of the target web page is the first loading performed in response to the loading operation. If both are yes, it is determined that the web page reloading condition is met; otherwise, it is determined that the web page reloading condition is not met.
[0021] Optionally, determining the resource loading failure rate of the target webpage includes:
[0022] calling a predetermined monitoring interface of the other client to obtain the resource request status of each webpage resource of the target webpage counted by the other client; the resource request status is a status indicating whether the request is successful;
[0023] Based on the determined resource request status, a resource loading failure rate of the target webpage is determined.
[0024] Optionally, the target client monitors whether each webpage resource of the target webpage satisfies a resource reloading condition, including:
[0025] Determining the resource request status of each webpage resource of the target webpage respectively; wherein the resource request status is a status used to indicate whether the request is successful;
[0026] Based on the resource request status of each webpage resource, it is determined whether each webpage resource meets the resource reloading condition.
[0027] Optionally, loading webpage resources on the target webpage includes:
[0028] Sending each resource sub-request to the server corresponding to the target client to request a webpage resource; wherein different resource sub-requests are used to request different webpage resources of the target webpage;
[0029] Load the web page resources requested based on each resource sub-request;
[0030] The step of respectively determining the resource request status of each webpage resource of the target webpage includes:
[0031] The request results corresponding to each resource sub-request are intercepted to analyze the resource request status of each webpage resource of the target webpage.
[0032] Optionally, the determining whether each webpage resource meets the resource reloading condition based on the resource request status of each webpage resource includes:
[0033] For each webpage resource, if the resource request status of the webpage resource indicates that the request has failed, then the webpage resource is determined to meet the resource reload condition;
[0034] or,
[0035] For each webpage resource, if the resource request status of the webpage resource indicates a request failure and the most recently executed loading of the target webpage is the first loading performed in response to the loading operation, then the webpage resource is determined to meet the resource reloading condition.
[0036] In a second aspect, the present disclosure provides a webpage loading device, the device comprising:
[0037] A loading module, configured to load webpage resources into a target webpage in response to a loading operation of the target webpage; wherein the target webpage is a webpage of a target client;
[0038] an identification module, configured to identify a current loading mode of the target webpage; wherein the loading mode includes an internal loading mode, which is used to indicate loading within the target client, or an external loading mode, which is used to indicate loading on another client;
[0039] The execution module is used to execute a target operation that matches the current loading mode and is used to respond to a failure in loading the webpage resource, with respect to the target webpage.
[0040] Optionally, the execution module includes:
[0041] A first detection submodule is configured to detect whether the target webpage satisfies a webpage reloading condition when the current loading mode is off-end loading, and if so, trigger the other client to perform a refresh operation on the target webpage to reload the target webpage;
[0042] The webpage reloading condition is a condition related to a failure in loading the webpage resource of the target webpage.
[0043] Optionally, the execution module further includes:
[0044] a second detection submodule, configured to detect, when the current loading mode is in-client loading, whether a target resource obtained and transmitted by the target client is received; wherein the target resource obtaining mode includes: the target client monitoring, in response to the target webpage being in-client loading mode, whether each webpage resource of the target webpage satisfies a resource reloading condition, and, when monitoring that each webpage resource satisfies the resource reloading condition, requesting the webpage resource that satisfies the resource reloading condition to obtain the target resource;
[0045] The loading submodule is used to load the target resource and display it in the target webpage when the target resource is received.
[0046] Optionally, the first detection submodule includes:
[0047] A determination unit, configured to determine a resource loading failure rate of the target webpage; wherein the resource loading failure rate is a ratio of webpage resources that failed to load to the webpage resources required to load the target webpage;
[0048] A judging unit is configured to judge whether the target web page meets a web page reloading condition based on the resource loading failure rate.
[0049] Optionally, the judging unit is specifically configured to:
[0050] Determining whether the resource loading failure rate is greater than a predetermined failure rate threshold, if so, determining that a webpage reloading condition is met; otherwise, determining that the webpage reloading condition is not met;
[0051] or,
[0052] Determine whether the resource loading failure rate is greater than a predetermined failure rate threshold, and whether the most recently executed loading of the target web page is the first loading performed in response to the loading operation. If both are yes, it is determined that the web page reloading condition is met; otherwise, it is determined that the web page reloading condition is not met.
[0053] Optionally, the determining unit is specifically configured to:
[0054] calling a predetermined monitoring interface of the other client to obtain the resource request status of each webpage resource of the target webpage counted by the other client; the resource request status is a status indicating whether the request is successful;
[0055] Based on the determined resource request status, a resource loading failure rate of the target webpage is determined.
[0056] Optionally, the target client monitors whether each webpage resource of the target webpage satisfies a resource reloading condition, including:
[0057] Determining the resource request status of each webpage resource of the target webpage respectively; wherein the resource request status is a status used to indicate whether the request is successful;
[0058] Based on the resource request status of each webpage resource, it is determined whether each webpage resource meets the resource reloading condition.
[0059] Optionally, the loading module is specifically used to:
[0060] Sending each resource sub-request to the server corresponding to the target client to request a webpage resource; wherein different resource sub-requests are used to request different webpage resources of the target webpage;
[0061] Load the web page resources requested based on each resource sub-request;
[0062] The step of respectively determining the resource request status of each webpage resource of the target webpage includes:
[0063] The request results corresponding to each resource sub-request are intercepted to analyze the resource request status of each webpage resource of the target webpage.
[0064] Optionally, the determining whether each webpage resource meets the resource reloading condition based on the resource request status of each webpage resource includes:
[0065] For each webpage resource, if the resource request status of the webpage resource indicates that the request has failed, then the webpage resource is determined to meet the resource reload condition;
[0066] or,
[0067] For each webpage resource, if the resource request status of the webpage resource indicates a request failure and the most recently executed loading of the target webpage is the first loading performed in response to the loading operation, then the webpage resource is determined to meet the resource reloading condition.
[0068] In a third aspect, the present disclosure provides an electronic device, comprising:
[0069] at least one processor; and
[0070] a memory communicatively connected to the at least one processor; wherein,
[0071] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the webpage loading method.
[0072] In a fourth aspect, the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the web page loading method.
[0073] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which implements the web page loading method when executed by a processor.
[0074] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0076] Figure 1 is a flow chart of a web page loading method provided by the present disclosure;
[0077] Figure 2 is a flowchart of performing a target operation provided by the present disclosure;
[0078] Figure 3 is another flowchart of performing a target operation provided by the present disclosure;
[0079] Figure 4 is another flow chart of a web page loading method provided by the present disclosure;
[0080] Figure 5 is a structural diagram of a webpage loading device provided according to the present disclosure;
[0081] Figure 6 3 is a block diagram of an electronic device for implementing the webpage loading method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0082] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize 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.
[0083] Currently, the successful loading of web pages on the client side depends on a stable network connection. In unstable network conditions, such as a weak network or a sudden network disconnection (for example, when the client's electronic device is in an area with poor signal or in an area with network congestion, etc.), web page loading failure is likely to occur.
[0084] In the related art, after a web page fails to load, the user is usually required to manually refresh the web page in order to resend a request to the server corresponding to the client in order to reload the web page. Manually refreshing the web page by the user not only increases the user's operating burden, but also, considering that some web resources of the web page have been successfully loaded and only some web resources have failed to load, if the problem of web resource loading failure is dealt with by rigidly refreshing the web page, it will undoubtedly increase the request pressure on the server. It can be seen that the related art lacks an automated resource loading, failure detection and reloading mechanism, resulting in a poor user experience when the network is unstable, and multiple requests to reload the web page result in serious waste of server resources.
[0085] Based on this, the present disclosure provides a webpage loading method, device, electronic device and storage medium to automatically reload webpages, thereby improving user experience.
[0086] The following first introduces a web page loading method provided by the present disclosure.
[0087] Among them, a web page loading method involved in the present disclosure can apply a target web page, which is a web page provided by a target client to implement corresponding functions, such as information browsing function, information configuration function, etc. It can be understood that the target web page can be loaded on the target client to which the target web page belongs; and the target web page can also be loaded on other clients other than the target client, that is, the target web page is opened through other clients, for example: for a short video client, other browser-type clients or other clients with browser functions to open the web page of the video client, etc.; the present disclosure does not limit the specific types of other clients that the target web page can be loaded on, and the implementation method of how other clients load the target web page is not limited by the present disclosure because it is not the invention point of the present disclosure. In specific applications, the target client or other clients run on a terminal device, which can be a mobile phone or a computer, etc. The present disclosure does not limit the specific form of the terminal device.
[0088] In addition, the web page loading method provided by the present disclosure can be applied to any scenario where a web page fails to load and needs to be reloaded, and the present disclosure does not limit this.
[0089] In addition, it should be noted that the target web page mentioned in the present disclosure can be an H5 web page, wherein the H5 web page is a web page developed based on HTML5 (fifth-generation hypertext markup language), but of course it is not limited to this. Any web page that fails to load and needs to be reloaded belongs to the target web page provided by the present disclosure.
[0090] A webpage loading method provided by an embodiment of the present disclosure may include the following steps:
[0091] In response to a loading operation of a target webpage, loading webpage resources on the target webpage; wherein the target webpage is a webpage of a target client;
[0092] Identifying a current loading mode of the target webpage; wherein the loading mode includes in-client loading, which is used to indicate loading within the target client, or out-client loading, which is used to indicate loading on other clients;
[0093] For the target web page, a target operation that matches the current loading mode and is used to respond to a failure in loading the web page resource is executed.
[0094] In this solution, the target action for a webpage resource loading failure varies depending on the target webpage's current loading mode. Specifically, after the target webpage loads its resources, it can first identify the target webpage's current loading mode, i.e., whether the target webpage is currently being loaded internally within the target client or externally on another client. Then, the target webpage is automatically reloaded by executing a target action that matches the current loading mode and is used to respond to a webpage loading failure. This eliminates the need for the user to manually refresh the target webpage, and allows for automatic reloading of the target webpage, thereby improving the user experience.
[0095] The following is an exemplary introduction to a web page loading method provided by the present disclosure in conjunction with the accompanying drawings.
[0096] like Figure 1 As shown, the present disclosure provides a web page loading method, which may include the following steps:
[0097] S101: In response to a loading operation of a target webpage, loading webpage resources into the target webpage;
[0098] Wherein, the target webpage is the webpage of the target client;
[0099] When loading a target web page, a loading operation of the target web page is first issued. For example, a user may click a link or an open button of the target web page, and the target web page may load web page resources of the target web page.
[0100] It should be emphasized that the target web page is the web page of the target client. It can be understood that the target web page is a web page of any function provided by the target client. The target web page can be considered as a web page developed by the target client. For example: if the target client is shopping client A, then the target web page is the web page belonging to shopping client A, for example: a shopping web page or advertising web page belonging to client A, etc.
[0101] In addition, the web page resources of the target web page may include various resources that can be displayed on the web page, such as: images, text, links and videos, etc., as well as information such as the layout and style of the target web page itself; when loading web page resources for the target web page, the target web page usually requests the various web page resources of the target web page from the server, for example: for each web page resource, a resource sub-request is sent to the server to request the web page resource; that is, each web page resource of the target web page can be requested by sending each resource sub-request to the server, and different resource sub-requests are used to request different web page resources, which is not limited in this disclosure.
[0102] S102: Identify the current loading mode of the target web page;
[0103] The loading mode includes in-terminal loading, which is used to represent loading in the target client, or out-terminal loading, which is used to represent loading on other clients;
[0104] When loading web resources for a target web page, the web resources may fail to load. In the present disclosure, different reloading target operations are set for different current loading modes of the target web page. Therefore, the current loading mode of the target web page can be identified first.
[0105] It should be noted that in-terminal loading means that the target webpage is currently loaded in the target client; external-terminal loading means that the target webpage is currently loaded in other clients outside the target client; when the target webpage is currently loaded in-terminal loading, the target client can determine whether the webpage resources of the target webpage have failed to load, and reload the webpage resources when loading fails; when the target webpage is currently loaded in external-terminal loading, the target webpage can determine whether the webpage resources of the target webpage have failed to load, and refresh the target webpage when loading fails. The methods by which the target client and the target webpage determine whether the webpage resources of the target webpage have failed to load, and reload the webpage resources or refresh the target webpage when loading fails, will be described in detail in subsequent embodiments and will not be elaborated on here.
[0106] Any implementation capable of identifying the current loading mode of the target webpage may be applied to the present disclosure. For example, the target webpage may interact with the client currently being loaded on via an API (Application Programming Interface), for example, requesting the client's identifier to analyze whether the client currently being loaded on is the target client. If it is not the target client, the current loading mode is identified as off-client loading; if it is the target client, the current loading mode is identified as on-client loading.
[0107] In addition, the target webpage can also use the UA (User Agent) of the client currently being loaded to identify whether the client currently being loaded is the target client. For example, by identifying whether the UA of the client currently being loaded is the UA of the target client, the target webpage can determine whether the target webpage is currently being loaded in-client or out-client mode. The UA of any client is a string that can identify the client, the operating system on which the client runs, and the type of electronic device on which the client runs. The target webpage can obtain the UA of the client currently being loaded from the target client's server to identify whether the client currently being loaded is the target client.
[0108] S103: executing, for the target web page, a target operation that matches the current loading mode and is used to respond to a failure in loading the web page resource.
[0109] Due to different loading methods, the client on which the target web page is loaded can provide different interactive services for the target web page, that is, the operation permissions / interaction permissions for the target web page are different; therefore, in the present disclosure, if the web page resources of the target web page fail to load, different target operations are set for different loading methods of the target web page to automatically reload the target web page.
[0110] After identifying the current loading mode of the target webpage, a target operation that matches the current loading mode and is used to respond to a failure to load the webpage resources can be executed. For example, if the current loading mode is internal loading, the target operation can be to reload the webpage resources of the target webpage on the target client; if the current loading mode is external loading, the target operation can be to refresh the target webpage.
[0111] In the technical solution disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of web resources and loading methods involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0112] In this solution, the target action for a webpage resource loading failure varies depending on the target webpage's current loading mode. Specifically, after the target webpage loads its resources, it can first identify the target webpage's current loading mode, i.e., whether the target webpage is currently being loaded internally within the target client or externally on another client. Then, the target webpage is automatically reloaded by executing a target action that matches the current loading mode and is used to respond to a webpage loading failure. This eliminates the need for the user to manually refresh the target webpage, and allows for automatic reloading of the target webpage, thereby improving the user experience.
[0113] Alternatively, in another embodiment of the present disclosure, Figure 2 As shown, the target operation that matches the current loading mode and is used to respond to the failure of loading the webpage resource is executed for the target webpage, including:
[0114] S201: When the current loading mode is in-client loading, detecting whether a target resource obtained and transmitted by the target client is received;
[0115] The target resource acquisition method includes: the target client monitors whether each webpage resource of the target webpage satisfies a resource reloading condition in response to the target webpage being loaded in-client mode, and when the target webpage resource satisfies the resource reloading condition, requests the webpage resource that satisfies the resource reloading condition to obtain the target resource;
[0116] S202: Upon receipt, the target resource is loaded and displayed in the target webpage.
[0117] In the present disclosure, since the target web page is a web page provided by the target client itself, the target client has a higher control authority over the target web page; then, the target client can monitor the loading status of the web page resources of the target web page when the target web page is loaded in the terminal, and thus analyze whether to reload the web page resources of the target web page based on the monitoring status. Specifically, the target resource is obtained by the target client monitoring whether the various resources of the target web page meet the resource reloading conditions when the target web page is loaded in the terminal, and re-requesting the web page resources that meet the resource reloading conditions when monitoring that they are met; that is, the target resource is the resource obtained by re-requesting the resource that failed to load, and when the target client monitors that the various web page resources of the target web page meet the resource reloading conditions, re-requests the resource that failed to load, and obtains the target resource. The target client then transfers the target resource to the target web page, and the target web page loads and displays the target resource to obtain a reloaded target web page.
[0118] In the present disclosure, when the current loading method is in-end loading, the target client can monitor whether the various web page resources of the target web page meet the resource reloading conditions, and when satisfied, only re-request the resources that failed to load, and pass the requested target resources to the target web page for loading and display; it can be seen that the present disclosure can automatically reload the target web page, and in the case of in-end loading, the request amount is greatly reduced compared to the method of re-requesting each web page resource of the target web page.
[0119] Exemplarily, in one implementation, the target client monitors whether each webpage resource of the target webpage satisfies a resource reloading condition, including:
[0120] Determining the resource request status of each webpage resource of the target webpage respectively; wherein the resource request status is a status used to indicate whether the request is successful;
[0121] Based on the resource request status of each webpage resource, it is determined whether each webpage resource meets the resource reloading condition.
[0122] When monitoring whether the web resources of the target web page meet the resource reloading conditions, the target client can determine the resource request status of each web resource of the target web page respectively, that is, determine whether the request for each web resource is successful; then, based on the request status of each web resource, determine whether each web resource meets the resource reloading conditions.
[0123] Illustratively, for any web page resource, if the resource request status of the web page resource indicates that the request has failed, it can be determined that the web page resource meets the resource reloading condition.
[0124] In the present disclosure, for the case of in-client loading, the target client can determine the resource request status of each webpage resource of the target webpage, thereby accurately determining whether each webpage resource meets the resource reloading condition.
[0125] Specifically, loading web page resources on the target web page includes:
[0126] Sending each resource sub-request to the server corresponding to the target client to request a webpage resource; wherein different resource sub-requests are used to request different webpage resources of the target webpage;
[0127] Load the web page resources requested based on each resource sub-request;
[0128] The step of respectively determining the resource request status of each webpage resource of the target webpage includes:
[0129] The request results corresponding to each resource sub-request are intercepted to analyze the resource request status of each webpage resource of the target webpage.
[0130] Each web page resource may include various resources that can be displayed on a web page, such as images, text, links, and videos, and of course, the layout and style of the web page itself, etc.; for the in-client loading method, when the target client loads web page resources for the target web page, it may send each resource sub-request to the server corresponding to the target client to make a web page resource request, that is, to request each web page resource of the target web page; the target client returns the web page resources requested by each resource sub-request to the target web page, and the target web page loads the requested web page resources.
[0131] Among them, different resource sub-requests are used to request different web page resources of the target web page, for example: the first resource sub-request is used to request an image of the target web page, the second resource sub-request is used to request another image of the target web page, the third resource sub-request is used to request a text of the target web page, and the fourth resource sub-request is used to request a video of the target web page. The first resource sub-request, the second resource sub-request, the third resource sub-request and the fourth resource sub-request all belong to individual resource sub-requests.
[0132] When the target client determines the resource request status of each web resource of the target web page, the target client can intercept the request results corresponding to each resource sub-request, that is, the target client first obtains the request results corresponding to each resource sub-request, and temporarily does not return the request results to the target web page. It can first analyze the resource request status of each web resource of the target web page, and then return the web resource whose resource request status represents a successful request to the target web page; and judge that the web resource whose resource request status represents a failed request is a web resource that meets the resource reloading condition, and re-request the web resource to be passed to the target web page for loading and display.
[0133] Exemplarily, the request result corresponding to each intercepted resource sub-request may include corresponding request content, such as text, image, video or link, etc. If the request result corresponding to the resource sub-request contains the corresponding request content, then the resource request status of the web page resource requested by the resource sub-request is analyzed to be a successful request, otherwise, the request is failed.
[0134] In the present disclosure, web page resources of a target web page can be requested through various resource sub-requests to load the web page resources; and through the request results corresponding to each resource sub-request, the resource request status of each web page resource of the target web page can be accurately analyzed, so that the target client can re-request the web page resources that meet the resource reloading conditions, thereby reducing the number of requests.
[0135] Optionally, the determining whether each webpage resource meets the resource reloading condition based on the resource request status of each webpage resource includes:
[0136] For each webpage resource, if the resource request status of the webpage resource indicates that the request has failed, then the webpage resource is determined to meet the resource reload condition;
[0137] or,
[0138] For each webpage resource, if the resource request status of the webpage resource indicates a request failure and the most recently executed loading of the target webpage is the first loading performed in response to the loading operation, then the webpage resource is determined to meet the resource reloading condition.
[0139] When determining whether a web page resource meets the resource reloading condition, for each web page resource, if the resource request status representation request of the web page resource fails, then the web page resource is determined to meet the resource reloading condition, that is, the web page resource needs to be reloaded; or, if the resource request status representation request of the web page resource fails, and the most recently executed loading of the target web page is the first loading performed in response to the loading operation, that is, the most recently loaded target web page is the first loading, then the web page resource is determined to meet the resource reloading condition.
[0140] Of course, for each webpage resource, if the resource request status of the webpage resource indicates a request failure, and the most recently executed target webpage load is a load performed in response to a load operation within a specified number of times, then the webpage resource is determined to meet the resource reload condition. That is, the target webpage can be reloaded a specified number of times, which can be 1, to avoid the target webpage from crashing due to continuous loading.
[0141] In the present disclosure, if the resource request status representation request fails, it can be directly determined that the web page resource meets the reloading condition so that the web page resource can be successfully loaded; or, if the resource request representation request fails and the target web page is loaded for the first time, it is determined that the web page resource meets the resource reloading condition; that is, when determining whether each web page resource meets the resource reloading condition, not only the resource request status is considered, but also the overall loading times of the target web page are considered to avoid the target web page from being loaded multiple times continuously, thereby causing the target web page to crash.
[0142] Alternatively, in another embodiment of the present disclosure, Figure 3 As shown, the target operation that matches the current loading mode and is used to respond to the failure of loading the webpage resource is executed for the target webpage, including:
[0143] S301: When the current loading mode is external loading, detecting whether the target web page meets a web page reloading condition;
[0144] S302: If the conditions are met, trigger the other client to perform a refresh operation on the target webpage to reload the target webpage;
[0145] The webpage reloading condition is a condition related to a failure in loading the webpage resource of the target webpage.
[0146] In the case where the current loading method is off-client loading, the target webpage can detect whether the target webpage itself meets the webpage loading conditions. If so, it can trigger other clients to perform a refresh operation on the target webpage. For example, a webpage refresh request is sent to other clients, and the other clients can re-request various webpage resources of the target webpage from the server corresponding to the target client to reload the target webpage.
[0147] It should be noted that the web page reloading condition is a condition related to the failure to load the web page resources of the target web page. That is, satisfying the web page reloading condition indicates that the target web page has failed to load. In the case of off-end loading, all web page resources of the target web page need to be reloaded.
[0148] In the present disclosure, when the current loading method is off-end loading, the target webpage can detect whether the target webpage meets the webpage reloading condition, and when it meets the condition, trigger the refresh operation of the target webpage to automatically reload the target webpage.
[0149] Exemplarily, in one implementation, detecting whether the target webpage satisfies a webpage reloading condition includes:
[0150] Determining a resource loading failure rate of the target webpage; wherein the resource loading failure rate is a ratio of webpage resources that failed to load to the webpage resources required to load the target webpage;
[0151] Based on the resource loading failure rate, it is determined whether the target webpage meets a webpage reloading condition.
[0152] When detecting whether a target web page meets the web page reloading conditions, the target web page needs to determine the resource loading failure rate of the target web page as a whole to judge whether the target web page meets the web page reloading conditions; among which, the resource loading failure rate is the ratio of each web page resource that fails to load to the total web page resources that need to be loaded by the target web page.
[0153] For example, if the resource loading failure rate is greater than a predetermined failure rate threshold, it can be directly determined that the target webpage meets the webpage reloading condition.
[0154] In the present disclosure, for the case of off-end loading, the target webpage can determine the overall resource loading failure rate of the target webpage, so as to judge whether the target webpage fails to load as a whole, that is, accurately determine whether the target webpage meets the webpage reloading conditions as a whole.
[0155] Specifically, judging whether the target webpage meets the webpage reloading condition based on the resource loading failure rate includes:
[0156] Determining whether the resource loading failure rate is greater than a predetermined failure rate threshold, if so, determining that a webpage reloading condition is met; otherwise, determining that the webpage reloading condition is not met;
[0157] or,
[0158] Determine whether the resource loading failure rate is greater than a predetermined failure rate threshold, and whether the most recently executed loading of the target web page is the first loading performed in response to the loading operation. If both are yes, it is determined that the web page reloading condition is met; otherwise, it is determined that the web page reloading condition is not met.
[0159] When determining whether the target web page meets the web page reloading condition, it can be determined whether the resource loading failure rate is greater than a predetermined failure rate threshold. If so, it is considered that the target web page loading has failed, and it can be directly determined that the web page reloading condition is met. Otherwise, it is determined that the web page reloading condition is not met. Alternatively, it can be determined whether the resource loading failure rate is greater than a predetermined failure rate threshold, and whether the loading of the target web page executed most recently is the first loading in response to the loading operation, that is, it can also be determined whether the loading of the target web page most recently is the first loading. If both are yes, that is, the target web page failed to load for the first time, then it is determined that the web page reloading condition is met. Otherwise, the target web page is loaded successfully, or, considering that multiple loadings may cause the target web page to crash, it can be determined that the web page reloading condition is not met.
[0160] In the present disclosure, if the resource loading failure rate is greater than a predetermined failure rate threshold, it can be directly determined that the target web page meets the web page reloading condition so that the target web page can be successfully loaded; or, it is determined whether the resource loading failure rate is greater than a predetermined failure rate threshold, and whether the target web page is loaded for the first time, before determining whether the web page reloading condition is met; that is, the present disclosure can also consider the overall number of loads of the target web page to avoid the target web page from crashing due to continuous multiple loadings.
[0161] Specifically, determining the resource loading failure rate of the target webpage includes:
[0162] calling a predetermined monitoring interface of the other client to obtain the resource request status of each webpage resource of the target webpage counted by the other client; the resource request status is a status indicating whether the request is successful;
[0163] Based on the determined resource request status, a resource loading failure rate of the target webpage is determined.
[0164] In the present disclosure, the target web page can call the predetermined monitoring interface of other clients to obtain the resource request status of each web page resource of the target web page counted by other clients; the target web page can determine the resource loading failure rate of the target web page based on the determined resource request status, for example: based on the determined resource request status, determine the number of web page resources that failed to load, and determine the resource loading failure rate of the target web page based on the number of web page resources that the target web page needs to load.
[0165] It should be noted that the predetermined monitoring interface of other clients can be understood as the performance monitoring interface of the other clients, for example: PerformanceObserver API (a JavaScript API for monitoring web page performance indicators), which is not limited in this disclosure.
[0166] In the present disclosure, the target webpage can call the predetermined monitoring interface of other clients to obtain the resource request status of each webpage resource. Through the resource request status of each webpage resource, the overall resource loading failure rate of the target webpage can be accurately analyzed.
[0167] A webpage loading method provided by the present disclosure is introduced below in conjunction with another embodiment.
[0168] This disclosure aims to address the issue of web page resource loading failures (such as images, text, videos, and scripts) in weak or unexpected network conditions, thereby improving web page usability and user experience. This disclosure is particularly applicable to scenarios with unstable network environments, such as when a mobile device (the electronic device that loads the target web page) is used in an area with poor signal strength, or when network congestion occurs during large-scale events.
[0169] The present disclosure intercepts the webpage resource request result and the loading status of the external JavaScript script (the script of the reloading process executed by the target webpage, when the target webpage is loaded externally, the script is executed, when the target webpage is loaded internally, the target client re-acquires the failed loaded resources to reload the target webpage) by loading the webpage internally. When the target webpage fails to load the resources for the first time in the end or fails to load the resources for the first time outside the end, the reloading process is automatically triggered. Figure 4 As shown, the present disclosure provides a web page loading method, which may include the following steps:
[0170] S401: web page initialization; that is, in response to a target web page loading operation, loading web page resources into the target web page;
[0171] S402: The monitoring interface monitors the request status of each webpage resource; that is, the target webpage is loaded outside the terminal, and the monitoring interface of other clients is called to obtain the resource request status of each webpage resource of the target webpage counted by other clients, so as to calculate the resource loading failure rate of the webpage resources of the target webpage;
[0172] S403: intercepting the request results corresponding to each resource sub-request; that is, the target webpage is loaded in the terminal, and the target client intercepts the request results corresponding to each resource sub-request of the target webpage to monitor the loading status of each webpage resource;
[0173] S404: Whether the resource loading failure rate is greater than the predetermined failure rate threshold; that is, after obtaining the resource loading failure rate, determine whether the resource loading failure rate is greater than the predetermined failure rate threshold, so as to subsequently decide whether to trigger reloading; if yes, execute step S406; if no, execute step S410.
[0174] S405: Whether the web page resource request failed; that is, for each web page resource, after intercepting the request result of the web page resource, determine whether the request status of the web page resource is request failure. If yes, execute step S407 to determine whether the target web page is loaded for the first time; if not, execute step S410.
[0175] S406: Is it the first loading? That is, for the target web page, the resource loading failure rate of the target web page is greater than the predetermined failure rate threshold, that is, the target web page fails to load. Continue to determine whether the target web page is loaded for the first time. If yes, execute step S408; if not, execute step S411.
[0176] S407: Is it the first loading? That is, for each webpage resource, if the webpage resource request fails, continue to determine whether the target webpage is loaded for the first time. If yes, execute step S409; if not, execute step S411.
[0177] S408: Web page refresh; that is, if the target web page resource loading failure rate is greater than a predetermined failure rate threshold, and the target web page is loaded for the first time, the target web page needs to be refreshed. At this time, the target web page sends a web page refresh request to other clients, and other clients re-request the various web page resources of the target web page from the server of the target client, that is, return to step S401 to reinitialize the web page.
[0178] S409: Re-request web resources; that is, if the web resource request fails and the target web page is loaded for the first time, the target client automatically re-requests the web resource that failed to load and returns it to the target web page for loading and display. Of course, it is also possible to return to step S405 to continue to determine whether the web resource request failed.
[0179] S410: The webpage is loaded successfully; that is, when the target webpage is loaded in the terminal, the webpage resource request does not fail, or when the target webpage is loaded outside the terminal, the resource loading failure rate is not greater than the predetermined failure rate threshold, then the webpage is loaded successfully and the target webpage is displayed normally.
[0180] S411: Web page loading failed; that is, no matter the target web page is loaded inside or outside the terminal, the target web page fails to load, and it is not the first time loading. At this time, it is not possible to continuously re-request web page resources from the server, and the web page fails to load; the cause of the web page loading failure can be further investigated.
[0181] Among them, step S406 and step S407 can be understood as monitoring the number of times the target web page is loaded, and when the number of times of loading is less than or equal to the failure number threshold 1, reloading is triggered.
[0182] When using the web page loading method disclosed in the present invention, users do not need to perform any additional operations. In the background, the system will automatically monitor the loading status of web page resources, and automatically reload web page resources when necessary to improve user experience. After adopting the present invention, the web page can automatically reload failed resources when the network is unstable (the failed resources are automatically reloaded when loading within the terminal, and the entire web page needs to be refreshed when loading outside the terminal), reducing the need for users to manually refresh, improving user experience, and reducing invalid requests on the server. Related technologies may continuously request web page resources from the server to reload the web page after a web page fails to load, but this will increase the burden on the server and be inefficient. The present invention provides a more efficient and user-friendly solution through intelligent judgment and automatic reloading. It can be seen that the present invention can automatically load web pages and reduce the number of requests received by the server.
[0183] Based on the above method embodiment, the present disclosure also provides a web page loading device, such as Figure 5 As shown, the device includes:
[0184] The loading module 510 is configured to load web page resources into the target web page in response to a loading operation of the target web page; wherein the target web page is a web page of a target client;
[0185] Identification module 520, for identifying the current loading mode of the target webpage; wherein the loading mode includes in-client loading, which is used to indicate loading in the target client, or out-client loading, which is used to indicate loading on other clients;
[0186] The execution module 530 is configured to execute, for the target web page, a target operation that matches the current loading mode and is used to respond to a failure in loading the web page resource.
[0187] In this solution, the target action for web resource loading failures varies depending on the target web page's current loading mode. Specifically, after the target web page loads web resources, it can first identify the target web page's current loading mode, i.e., whether the target web page is currently being loaded internally within the target client or externally on another client. Then, a target action matching the current loading mode and designed to respond to web page loading failures is executed for the target web page, thereby automatically reloading the target web page. This means that the present disclosure eliminates the need for the user to manually refresh the target web page and can automatically reload the target web page.
[0188] Optionally, the execution module includes:
[0189] A first detection submodule is configured to detect whether the target webpage satisfies a webpage reloading condition when the current loading mode is off-end loading, and if so, trigger the other client to perform a refresh operation on the target webpage to reload the target webpage;
[0190] The webpage reloading condition is a condition related to a failure in loading the webpage resource of the target webpage.
[0191] Optionally, the execution module further includes:
[0192] a second detection submodule, configured to detect, when the current loading mode is in-client loading, whether a target resource obtained and transmitted by the target client is received; wherein the target resource obtaining mode includes: the target client monitoring, in response to the target webpage being in-client loading mode, whether each webpage resource of the target webpage satisfies a resource reloading condition, and, when monitoring that each webpage resource satisfies the resource reloading condition, requesting the webpage resource that satisfies the resource reloading condition to obtain the target resource;
[0193] The loading submodule is used to load the target resource and display it in the target webpage when the target resource is received.
[0194] Optionally, the first detection submodule includes:
[0195] A determination unit, configured to determine a resource loading failure rate of the target webpage; wherein the resource loading failure rate is a ratio of webpage resources that failed to load to the webpage resources required to load the target webpage;
[0196] A judging unit is configured to judge whether the target web page meets a web page reloading condition based on the resource loading failure rate.
[0197] Optionally, the judging unit is specifically configured to:
[0198] Determining whether the resource loading failure rate is greater than a predetermined failure rate threshold, if so, determining that a webpage reloading condition is met; otherwise, determining that the webpage reloading condition is not met;
[0199] or,
[0200] Determine whether the resource loading failure rate is greater than a predetermined failure rate threshold, and whether the most recently executed loading of the target web page is the first loading performed in response to the loading operation. If both are yes, it is determined that the web page reloading condition is met; otherwise, it is determined that the web page reloading condition is not met.
[0201] Optionally, the determining unit is specifically configured to:
[0202] calling a predetermined monitoring interface of the other client to obtain the resource request status of each webpage resource of the target webpage counted by the other client; the resource request status is a status indicating whether the request is successful;
[0203] Based on the determined resource request status, a resource loading failure rate of the target webpage is determined.
[0204] Optionally, the target client monitors whether each webpage resource of the target webpage satisfies a resource reloading condition, including:
[0205] Determining the resource request status of each webpage resource of the target webpage respectively; wherein the resource request status is a status used to indicate whether the request is successful;
[0206] Based on the resource request status of each webpage resource, it is determined whether each webpage resource meets the resource reloading condition.
[0207] Optionally, the loading module is specifically used to:
[0208] Sending each resource sub-request to the server corresponding to the target client to request a webpage resource; wherein different resource sub-requests are used to request different webpage resources of the target webpage;
[0209] Load the web page resources requested based on each resource sub-request;
[0210] The step of respectively determining the resource request status of each webpage resource of the target webpage includes:
[0211] The request results corresponding to each resource sub-request are intercepted to analyze the resource request status of each webpage resource of the target webpage.
[0212] Optionally, the determining whether each webpage resource meets the resource reloading condition based on the resource request status of each webpage resource includes:
[0213] For each webpage resource, if the resource request status of the webpage resource indicates that the request has failed, then the webpage resource is determined to meet the resource reload condition;
[0214] or,
[0215] For each webpage resource, if the resource request status of the webpage resource indicates a request failure and the most recently executed loading of the target webpage is the first loading performed in response to the loading operation, then the webpage resource is determined to meet the resource reloading condition.
[0216] 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.
[0217] The present disclosure provides an electronic device, comprising:
[0218] at least one processor; and
[0219] a memory communicatively connected to the at least one processor; wherein,
[0220] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the webpage loading method.
[0221] The present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the webpage loading method.
[0222] The present disclosure provides a computer program product, including a computer program, which implements the webpage loading method when executed by a processor.
[0223] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments 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 assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0224] like Figure 6 As shown, 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. RAM 603 may also store various programs and data required for the operation of device 600. Computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to bus 604.
[0225] Various components in device 600 are connected to I / O interface 605, including an input unit 606, such as a keyboard, mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, optical disk, etc.; and a communication unit 609, such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0226] Computing unit 601 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Computing unit 601 performs the various methods and processes described above, such as the webpage loading method. For example, in some embodiments, the webpage loading method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by computing unit 601, one or more steps of the webpage loading method described above can be performed. Alternatively, in other embodiments, computing unit 601 can be configured to perform the webpage loading method by any other suitable means (e.g., via firmware).
[0227] Various embodiments of the systems and techniques described above 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), system-on-a-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes 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.
[0228] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0229] 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, apparatus, or device. 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, 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), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0230] 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).
[0231] The systems and techniques described herein can 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., as an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments 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 can 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.
[0232] A computer system may include a client and a server. The client and server are typically remote from each other and typically interact via a communication network. The client-server relationship arises through computer programs running on the respective computers and establishing a client-server relationship. The server may be a cloud server, a distributed system server, or a server integrated with a blockchain.
[0233] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.
[0234] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A webpage loading method, the method comprising: In response to a loading operation of a target webpage, loading webpage resources on the target webpage; wherein the target webpage is a webpage of a target client; Identifying a current loading mode of the target webpage; wherein the loading mode includes in-client loading for representing loading in the target client, or out-client loading for representing loading on other clients; For the target web page, a target operation matching the current loading mode and used to respond to a failure in loading the web page resource is executed.
2. The method according to claim 1, wherein: The target operation that matches the current loading mode and is used to respond to a failure in loading a webpage resource is performed on the target webpage, including: In the case where the current loading mode is external loading, detecting whether the target webpage satisfies a webpage reloading condition, and if so, triggering the other client to perform a refresh operation on the target webpage to reload the target webpage; The webpage reloading condition is a condition related to a failure in loading the webpage resource of the target webpage.
3. The method according to claim 1, wherein: The target operation that matches the current loading mode and is used to respond to a failure in loading a webpage resource is performed on the target webpage, including: In the case where the current loading mode is in-end loading, detecting whether a target resource obtained and transmitted by the target client is received; wherein the method for obtaining the target resource includes: the target client monitors whether each web page resource of the target web page satisfies a resource reloading condition in response to the target web page being in-end loading mode, and when monitoring that the condition is satisfied, requests the web page resource satisfying the resource reloading condition to obtain the target resource; Upon receipt, the target resource is loaded and displayed in the target webpage.
4. The method according to claim 2, wherein: The detecting whether the target webpage satisfies the webpage reloading condition includes: Determine the resource loading failure rate of the target webpage; wherein the resource loading failure rate is the ratio of each webpage resource that fails to load to the webpage resources required to load the target webpage; Based on the resource loading failure rate, it is determined whether the target webpage satisfies a webpage reloading condition.
5. The method according to claim 4, wherein: The determining, based on the resource loading failure rate, whether the target webpage satisfies a webpage reloading condition includes: Determine whether the resource loading failure rate is greater than a predetermined failure rate threshold, if so, determine that the webpage reloading condition is met, otherwise, determine that the webpage reloading condition is not met; or, Determine whether the resource loading failure rate is greater than a predetermined failure rate threshold, and whether the most recently executed loading of the target web page is the first loading performed in response to the loading operation. If both are yes, it is determined that the web page reloading condition is met; otherwise, it is determined that the web page reloading condition is not met.
6. The method according to claim 4, wherein: Determining the resource loading failure rate of the target webpage includes: Calling a predetermined monitoring interface of the other client to obtain the resource request status of each webpage resource of the target webpage counted by the other client; the resource request status is a status indicating whether the request is successful; Based on the determined resource request status, a resource loading failure rate of the target webpage is determined.
7. The method according to claim 3, wherein: The target client monitors whether each webpage resource of the target webpage satisfies a resource reloading condition, including: Determine the resource request status of each webpage resource of the target webpage respectively; wherein the resource request status is a status used to indicate whether the request is successful; Based on the resource request status of each webpage resource, it is determined whether each webpage resource meets the resource reloading condition.
8. The method according to claim 7, wherein: The loading of web page resources on the target web page includes: Sending each resource sub-request to the server corresponding to the target client to make a webpage resource request; wherein different resource sub-requests are used to request different webpage resources of the target webpage; Load the web page resources requested based on each resource sub-request; The step of respectively determining the resource request status of each webpage resource of the target webpage includes: The request results corresponding to each resource sub-request are intercepted to analyze the resource request status of each webpage resource of the target webpage.
9. The method according to claim 7, wherein: The determining whether each webpage resource satisfies the resource reloading condition based on the resource request status of each webpage resource includes: For each webpage resource, if the resource request status of the webpage resource indicates that the request has failed, then it is determined that the webpage resource meets the resource reloading condition; or, For each web page resource, if the resource request status of the web page resource indicates a request failure and the most recently executed loading of the target web page is the first loading performed in response to the loading operation, then it is determined that the web page resource meets the resource reloading condition.
10. A webpage loading device, the device comprising: A loading module, configured to load web page resources into the target web page in response to a loading operation of the target web page; wherein the target web page is a web page of a target client; an identification module, used to identify the current loading mode of the target webpage; wherein the loading mode includes in-client loading, which is used to represent loading in the target client, or out-client loading, which is used to represent loading on other clients; The execution module is used to execute, for the target web page, a target operation that matches the current loading mode and is used to respond to a failure in loading the web page resource.
11. The device according to claim 10, wherein: The execution module comprises: A first detection submodule is used to detect whether the target webpage satisfies a webpage reloading condition when the current loading mode is external loading, and if so, trigger the other client to perform a refresh operation on the target webpage to reload the target webpage; The webpage reloading condition is a condition related to a failure in loading the webpage resource of the target webpage.
12. The device according to claim 10, wherein: The execution module further includes: A second detection submodule is used to detect whether a target resource obtained and transmitted by the target client is received when the current loading mode is in-end loading; wherein the method of obtaining the target resource includes: the target client monitors whether each web page resource of the target web page satisfies a resource reloading condition in response to the target web page being in-end loading mode, and when monitoring that the condition is satisfied, requests the web page resource that satisfies the resource reloading condition to obtain the target resource; The loading submodule is used to load and display the target resource in the target webpage when the target resource is received.
13. The device according to claim 11, wherein: The first detection submodule includes: A determination unit, configured to determine a resource loading failure rate of the target web page; wherein the resource loading failure rate is a ratio of web page resources that failed to load to web page resources that need to be loaded by the target web page; A judging unit is used to judge whether the target web page meets a web page reloading condition based on the resource loading failure rate.
14. The device according to claim 13, wherein: The judging unit is specifically used for: Determine whether the resource loading failure rate is greater than a predetermined failure rate threshold, if so, determine that the webpage reloading condition is met, otherwise, determine that the webpage reloading condition is not met; or, Determine whether the resource loading failure rate is greater than a predetermined failure rate threshold, and whether the most recently executed loading of the target web page is the first loading performed in response to the loading operation. If both are yes, it is determined that the web page reloading condition is met; otherwise, it is determined that the web page reloading condition is not met.
15. The device according to claim 13, wherein: The determining unit is specifically configured to: Calling a predetermined monitoring interface of the other client to obtain the resource request status of each webpage resource of the target webpage counted by the other client; the resource request status is a status indicating whether the request is successful; Based on the determined resource request status, a resource loading failure rate of the target webpage is determined.
16. The device according to claim 12, wherein: The target client monitors whether each webpage resource of the target webpage satisfies a resource reloading condition, including: Determine the resource request status of each webpage resource of the target webpage respectively; wherein the resource request status is a status used to indicate whether the request is successful; Based on the resource request status of each webpage resource, it is determined whether each webpage resource meets the resource reloading condition.
17. The device according to claim 16, wherein: The loading module is specifically used for: Sending each resource sub-request to the server corresponding to the target client to make a webpage resource request; wherein different resource sub-requests are used to request different webpage resources of the target webpage; Load the web page resources requested based on each resource sub-request; The step of respectively determining the resource request status of each webpage resource of the target webpage includes: The request results corresponding to each resource sub-request are intercepted to analyze the resource request status of each webpage resource of the target webpage.
18. The device according to claim 16, wherein: The determining whether each webpage resource satisfies the resource reloading condition based on the resource request status of each webpage resource includes: For each webpage resource, if the resource request status of the webpage resource indicates that the request has failed, then it is determined that the webpage resource meets the resource reloading condition; or, For each web page resource, if the resource request status of the web page resource indicates a request failure and the most recently executed loading of the target web page is the first loading performed in response to the loading operation, then it is determined that the web page resource meets the resource reloading condition.
19. 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 9.
20. 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-9.
21. 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 9.