Page updating method and device, electronic equipment and computer readable storage medium
By determining the resource status and obtaining page exception information, the problem that users cannot access resources normally during front-end project release is solved, the correct loading and updating of page resources is achieved, and the accuracy and user experience of page updates are improved.
Patent Information
- Application Number
- CN202410210977.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-26
- Publication Date
- 2025-08-26
AI Technical Summary
During the release of front-end project, some users may be in an access state, resulting in the inability to access resources in the newly added project normally, causing an exception to the front-end page.
By responding to page update requests, determining the resource status, obtaining page exception information, determining version update information and routing backtracking information based on the exception information, and rendering the updated target page.
It ensures the correct loading and updating of page resources, improves the accuracy of page updates, avoids performance loss and traffic waste, and improves user experience.
Smart Images

Figure CN120541322A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of computer technology, information processing technology, and network technology, and more specifically, to a page updating method and device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the development of computer technology, the demand for releasing various front-end projects is increasing day by day. Front-end project release refers to the process of deploying the developed front-end code and resources to the production environment so that users can access and use them on the public network.
[0003] In the process of realizing the concept of the present disclosure, the inventors discovered that there are at least the following problems in the relevant technology: during the release of the front-end project, since some users may be in the access state, it is easy for users to be unable to normally access the resources in the newly added project later, thereby causing many anomalies on the front-end page. Summary of the Invention
[0004] In view of this, the present disclosure provides a page updating method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] According to one aspect of the present disclosure, a page update method is provided, comprising: in response to receiving a page update request for an original page, determining a current resource state according to M resource identifiers indicated by the page update request, wherein the current resource state includes a loading state corresponding to each of the M resource identifiers, and M is a positive integer; in a case where the current resource state indicates that resource files corresponding to the N resource identifiers have not been successfully loaded, obtaining page exception information, wherein N is a positive integer; determining version update information and routing backtracking information according to the page exception information; and rendering an updated target page according to the version update information and the routing backtracking information.
[0006] According to an embodiment of the present disclosure, the original page corresponds to a page access path, and the page exception information includes N resource identifiers and exception types corresponding to each of the N resource identifiers.
[0007] According to an embodiment of the present disclosure, the above-mentioned determination of version update information and routing backtracking information based on the above-mentioned page exception information includes: determining updated address information corresponding to each of the above-mentioned N resource identifiers in the data source based on the above-mentioned N resource identifiers; associating the above-mentioned N resource identifiers and the updated address information corresponding to each of the above-mentioned N resource identifiers and storing them as the above-mentioned version update information; and, in response to the above-mentioned page access path characterizing the existence of P upper pages associated with the above-mentioned original page, determining the above-mentioned routing backtracking information based on the upper page identifiers corresponding to each of the above-mentioned P upper pages, wherein P is a positive integer.
[0008] According to an embodiment of the present disclosure, the routing traceback information includes P upper-layer page identifiers having an associated relationship.
[0009] According to an embodiment of the present disclosure, the above method also includes, after determining the version update information and routing backtracking information based on the above page exception information: according to the pth upper-level page identifier, rolling back the above original page to the pth upper-level page, where p∈{1, 2,…, (P-1)}; and, in response to the above (P-1)th upper-level page identifier having a previous upper-level page identifier, according to the above previous upper-level page identifier, rolling back the above (P-1)th upper-level page to the previous upper-level page.
[0010] According to an embodiment of the present disclosure, the above method also includes: in response to the above (P-1)th upper page identifier not having a preceding upper page identifier, generating a version update button according to the above version update information, wherein the above version update button is used to perform version updates on the resource files corresponding to each of the above N resource identifiers that have not been successfully loaded.
[0011] According to an embodiment of the present disclosure, the above-mentioned rendering of the updated target page based on the above-mentioned version update information and the above-mentioned routing backtracing information includes: in response to detecting that the version update button is triggered, performing version updates on the resource files corresponding to each of the above-mentioned N resource identifiers according to the updated address information corresponding to each of the above-mentioned N resource identifiers; and, utilizing a rendering engine, rendering the resources corresponding to each of the above-mentioned M resource identifiers according to the updated resource files corresponding to each of the above-mentioned M resource identifiers to obtain the above-mentioned updated target page.
[0012] According to an embodiment of the present disclosure, the original page has a page identifier.
[0013] According to an embodiment of the present disclosure, the above method also includes, in response to receiving a page update request for the original page, before determining the current resource status according to the M resource identifiers indicated by the above page update request: when the page corresponding to the above page identifier is accessed for the first time, initializing the above page to obtain the above original page; and setting an event listener, wherein the above event listener is used to monitor abnormal resource acquisition in the above original page.
[0014] According to an embodiment of the present disclosure, when the above-mentioned current resource status represents that the resource files corresponding to the above-mentioned N resource identifiers are not successfully loaded, obtaining the page exception information includes: in response to the above-mentioned event listener listening to the failure of resource acquisition corresponding to the above-mentioned resource identifier, determining the exception type; and, based on the above-mentioned resource identifier and the above-mentioned exception type, determining the above-mentioned page exception information.
[0015] According to an embodiment of the present disclosure, the above method also includes, in response to receiving a page update request for the original page, before determining the current resource status according to the M resource identifiers indicated by the above page update request: determining the candidate resource identifier corresponding to each of the P candidate resource information according to the hash value corresponding to each of the P candidate resource information; for each of the P candidate resource information, calling a packaging tool, packaging the above candidate resource information according to the above candidate resource identifier, and obtaining a candidate resource file; and associating the above candidate resource identifier with the above candidate resource file and storing it in a data source.
[0016] According to another aspect of the present disclosure, a page update device is provided, including: a first determination module for, in response to receiving a page update request for an original page, determining a current resource state according to M resource identifiers indicated by the above-mentioned page update request, wherein the above-mentioned current resource state includes a loading state corresponding to each of the above-mentioned M resource identifiers, and M is a positive integer; an acquisition module for acquiring page exception information when the above-mentioned current resource state indicates that the resource files corresponding to the above-mentioned N resource identifiers have not been successfully loaded, wherein N is a positive integer; a second determination module for determining version update information and routing backtracking information according to the above-mentioned page exception information; and a rendering module for rendering the updated target page according to the above-mentioned version update information and the above-mentioned routing backtracking information.
[0017] According to another aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method described in the present disclosure.
[0018] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which executable instructions are stored. When the executable instructions are executed by a processor, the processor implements the method described in the present disclosure.
[0019] According to another aspect of the present disclosure, a computer program product is provided. The computer program product includes computer-executable instructions. When the computer-executable instructions are executed, they are used to implement the method described in the present disclosure.
[0020] According to the embodiments of the present disclosure, since the current resource state is determined based on the M resource identifiers indicated by the page update request, when the current resource state indicates that the resource files corresponding to the N resource identifiers have not been successfully loaded, the page exception information is obtained, and the subsequent version update process can be automatically implemented based on the front-end exception capture, thereby avoiding performance loss and traffic waste. On this basis, the updated target page is rendered by using the version update information and routing backtracking information determined based on the page exception information, which at least partially overcomes the technical problems in the related art that users are subsequently unable to normally access the resources in the newly added project and the many anomalies of the front-end page, and can ensure the correct loading and updating of page resources, improve the accuracy of page updates, and thereby improve the effect of the updated target page. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0022] Figure 1 The system architecture to which the page updating method according to an embodiment of the present disclosure can be applied is schematically shown;
[0023] Figure 2 A flowchart of a page updating method according to an embodiment of the present disclosure is schematically shown;
[0024] Figure 3 An example diagram schematically illustrates a page update process according to an embodiment of the present disclosure;
[0025] Figure 4 The following schematically illustrates an example of a routing backtracking process according to an embodiment of the present disclosure;
[0026] Figure 5 Schematically illustrates an example schematic diagram of a process of rendering an updated target page based on version update information and route backtracking information according to an embodiment of the present disclosure;
[0027] Figure 6 An example schematic diagram of a page update process according to another embodiment of the present disclosure is schematically shown;
[0028] Figure 7 A block diagram schematically shows a page updating device according to an embodiment of the present disclosure; and
[0029] Figure 8 A block diagram of an electronic device suitable for implementing a page updating method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0030] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0031] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise," "include," etc. used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0032] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0033] When expressions such as "at least one of A, B and C, etc." are used, they should generally be interpreted in accordance with the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0034] In the embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of the data involved (for example, including but not limited to user personal information) all comply with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken with respect to user personal information to prevent unauthorized access to user personal information data and to maintain the security of user personal information, network security, and national security.
[0035] In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0036] For example, after collecting resource identifiers, your information can be desensitized using methods including de-identification or anonymization to protect the security of your information.
[0037] In one example, at least one of a front-end interface polling method, a Web Worker mechanism polling method, and a Service Worker offline cache method can be used to resolve many front-end page anomalies.
[0038] The polling method based on the front-end interface can refer to the front-end sending a version check request to the server at regular intervals to complete the verification of the project version. In the case of a version mismatch, a prompt is issued to the user to remind the user to refresh the page. The polling method based on the Web Worker mechanism can refer to placing the logic of the interface into the Worker, and using the independence of the Worker thread to issue prompts to the user to remind the user to refresh the page. The offline caching method based on ServiceWorker can refer to setting up a proxy layer between the front-end and the server, so that the resources of the front-end project or interface requests can be selectively cached, so as to achieve the purpose of not affecting user access even if the server-side resources are updated.
[0039] However, since the front-end interface polling method requires the front-end page to continuously send requests to the server, this will have a certain impact on the page rendering performance. In addition, since the front-end interface polling method and the WebWorker mechanism polling method have a very low probability of hitting the version update, it results in a large amount of traffic waste. Moreover, the polling interval may be inconsistent between different clients and in different network environments, resulting in a unified time polling interval that may not be suitable for all scenarios. In addition, since the Service Worker offline caching method cannot guarantee that the resources accessed by the user are the latest resources, it may cause anomalies in the interaction with the back-end service.
[0040] In summary, the above solutions all simply perform version checks and update notifications, but lack implementation of page update solutions. If the user is currently on an intermediate page, simply refreshing the current page will result in state loss, leading to unpredictable issues. Refreshing the page via redirection will result in redundant page stacks, meaning none of the above solutions can effectively guarantee page updates.
[0041] In order to at least partially solve the technical problems existing in the related art, the present disclosure provides a page update method and device, an electronic device and a computer-readable storage medium, which can be applied to the fields of computer technology, information processing technology and network technology. The page update method includes: in response to receiving a page update request for an original page, determining the current resource state according to M resource identifiers indicated by the page update request, wherein the current resource state includes a loading state corresponding to each of the M resource identifiers, M being a positive integer; when the current resource state indicates that the resource files corresponding to the N resource identifiers are not successfully loaded, obtaining page exception information, wherein N is a positive integer; determining version update information and routing backtracking information according to the page exception information; and rendering the updated target page according to the version update information and routing backtracking information.
[0042] Figure 1 The following schematically illustrates a system architecture in which the page update method according to an embodiment of the present disclosure can be applied. Figure 1 The examples shown are merely examples of system architectures to which the embodiments of the present disclosure may be applied, to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure may not be used in other devices, systems, environments or scenarios.
[0043] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0044] The user may use at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0045] The first terminal device 101 , the second terminal device 102 , and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0046] The server 105 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process received user requests and other data, and feed back processing results (e.g., web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0047] It should be noted that the page update method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the page update device provided in the embodiment of the present disclosure can generally be set in the server 105. The page update method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the page update device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0048] Alternatively, the page update method provided in the embodiment of the present disclosure may also be executed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may also be executed by another terminal device different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Accordingly, the page update apparatus provided in the embodiment of the present disclosure may also be provided in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may be provided in another terminal device different from the first terminal device 101, the second terminal device 102, or the third terminal device 103.
[0049] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0050] It should be noted that the sequence numbers of the operations in the following method are only used to indicate the operation for the purpose of description, and should not be regarded as indicating the order in which the operations should be performed. Unless explicitly stated, the method does not need to be performed in the order shown.
[0051] Figure 2 The flowchart of the page updating method according to the embodiment of the present disclosure is schematically shown.
[0052] like Figure 2 As shown, the page updating method 200 includes operations S210 to S240.
[0053] In operation S210, in response to receiving a page update request for the original page, the current resource state is determined according to the M resource identifiers indicated by the page update request, wherein the current resource state includes a loading state corresponding to each of the M resource identifiers, and M is a positive integer.
[0054] In operation S220 , when the current resource status indicates that resource files corresponding to N resource identifiers are not loaded successfully, page exception information is obtained, where N is a positive integer.
[0055] In operation S230 , version update information and route backtracking information are determined according to the page exception information.
[0056] In operation S240 , an updated target page is rendered according to the version update information and the route backtracking information.
[0057] According to an embodiment of the present disclosure, the code for generating a page update request can be pre-written into a script, and in response to detecting a user's page update operation on the original page, M resource identifiers corresponding to the original page can be obtained. The page update operation may include at least one of the following: a page add (i.e., Add) operation, a page update (i.e., Update) operation, a page delete (i.e., Delete) operation, and a page reload (i.e., Reload) operation. The client can run the script to generate a page update request message based on the M resource identifiers. The client can send the page update request message to the server, so that the server can determine the loading status corresponding to each resource identifier based on the page update request message, and render the original page based on the loading status to obtain an updated target page.
[0058] According to an embodiment of the present disclosure, a resource identifier can be used to uniquely identify a resource file. The type of a resource file may include at least one of the following: a static resource type and a dynamic resource type. The static resource type may include at least one of the following: an HTML (Hyper Text Markup Language) resource, a JS (i.e., JavaScript) resource, a CSS (Cascading Style Sheets) resource, a TXT (i.e., text document) resource, an image resource, and a video resource. The dynamic resource type may include at least one of the following: a Servlet (Servlet Applet, service connector) resource and a JSP (Java Server Pages, Java Server Pages) resource.
[0059] According to an embodiment of the present disclosure, before executing the page update method provided by the present disclosure, the page can be initialized when the page corresponding to the page identifier is accessed for the first time to obtain the original page. The specific method of page initialization processing can be configured according to actual business needs and is not limited here. For example, the page initialization processing method may include at least one of the following: setting metadata, loading style sheets and script files, setting default options and initial values, binding event handlers and page layout and typesetting, etc.
[0060] According to an embodiment of the present disclosure, after receiving a page update request, the loading status of the resource file corresponding to the resource identifier can be determined for each of the M resource identifiers indicated by the page update request. For example, in a case where the loading status indicates that the resource file corresponding to the resource identifier is successfully loaded, the updated address information corresponding to the resource identifier can be determined, and the page exception information can be determined based on the resource identifier and the updated address information. Alternatively, in a case where the loading status indicates that the resource file corresponding to the resource identifier is not successfully loaded, the page exception information can be determined based on the resource identifier and the exception type.
[0061] According to an embodiment of the present disclosure, after obtaining the page exception information, the version update information and the routing backtracking information can be further determined based on the page exception information. The version update information can be used to characterize the updated address information corresponding to each resource identifier. For example, the updated address information corresponding to the resource identifier can be determined based on the resource identifier, and the resource identifier and the updated address information can be associated and stored as version update information. The routing backtracking information can be used to characterize at least one upper-level page identifier associated with the page identifier corresponding to the original page. For example, in the case of determining that the original page has an associated upper-level page, the routing backtracking information can be determined based on the upper-level page identifier.
[0062] According to an embodiment of the present disclosure, after obtaining version update information and routing backtracking information, a rendering engine can be used to render the resources corresponding to each of the M resource identifiers based on the updated resource files corresponding to each of the M resource identifiers, thereby obtaining an updated target page. The specific rendering engine selected can be configured based on actual business needs and is not limited here.
[0063] According to the embodiments of the present disclosure, since the current resource state is determined based on the M resource identifiers indicated by the page update request, when the current resource state indicates that the resource files corresponding to the N resource identifiers have not been successfully loaded, the page exception information is obtained, and the subsequent version update process can be automatically implemented based on the front-end exception capture, thereby avoiding performance loss and traffic waste. On this basis, the updated target page is rendered by using the version update information and routing backtracking information determined based on the page exception information, which at least partially overcomes the technical problems in the related art that users are subsequently unable to normally access the resources in the newly added project and the many anomalies of the front-end page, and can ensure the correct loading and updating of page resources, improve the accuracy of page updates, and thereby improve the effect of the updated target page.
[0064] Reference below Figures 3 to 6 , the page updating method 200 according to an embodiment of the present invention is further described.
[0065] According to an embodiment of the present disclosure, the page updating method 200 may further include the following operations.
[0066] Based on the hash values corresponding to the P candidate resource information, determine the candidate resource identifiers corresponding to the P candidate resource information. For each of the P candidate resource information, invoke a packaging tool to package the candidate resource information based on the candidate resource identifiers to generate candidate resource files. The candidate resource identifiers and candidate resource files are associated and stored in a data source.
[0067] According to an embodiment of the present disclosure, after obtaining candidate resource information, the candidate resource information can be processed based on a hash function to convert the candidate resource information into a fixed-length hash value. For example, the candidate resource information can be converted into a byte stream based on a preset encoding method, and the byte stream can be input into a preset hash function to obtain a fixed-length hash value.
[0068] According to the embodiments of the present disclosure, the preset encoding method and the preset hash function can be configured according to actual business needs and are not limited here. For example, the preset encoding method may include at least one of the following: ASCII encoding, Unicode encoding, UTF-8 encoding, UTF-16 encoding, and GBK encoding. The preset hash function may include at least one of the following: Message Digest Algorithm 5 (MD5), Secure Hash Algorithm (SHA), and Cyclic Redundancy Check (CRC).
[0069] According to the embodiments of the present disclosure, since the static resource names packaged in the front-end project should be somewhat different from those of the online project, after obtaining the hash values corresponding to P candidate resource information, for each candidate resource information, the candidate resource identifier corresponding to the candidate resource information can be determined based on the hash value, thereby realizing the update of the static resource address, thereby ensuring that when the user accesses the static resource during the online process, the exception of failure to obtain the static resource can be triggered.
[0070] According to an embodiment of the present disclosure, after obtaining P candidate resource identifiers, a packaging tool (i.e., Packaging Tool 1) can be called to package the candidate resource information according to the candidate resource identifiers to obtain a candidate resource file. A packaging tool is a software tool that can be used to package files or applications into a single file, which can be easily distributed, installed, and deployed. The packaging tool can be configured according to actual business needs and is not limited here. For example, the packaging tool may include at least one of the following: Webpack, Rollup, Parcel, Browserify, Gulp, Grunt, and Vite.
[0071] According to the embodiments of the present disclosure, since the candidate resource identifier is determined based on the hash value corresponding to each of the P candidate resource information, the candidate resource identifier can be used to uniquely identify different candidate resource information. Since the candidate resource file is obtained by calling a packaging tool and packaging the candidate resource information according to the candidate resource identifier, the management efficiency of the candidate resource information can be improved, and the correctness and availability of the candidate resource file can be guaranteed. On this basis, by associating the candidate resource identifier and the candidate resource file and storing them in a data source, the subsequent use and management of the candidate resource file can be facilitated, which is conducive to improving the efficiency of subsequent page updates.
[0072] According to an embodiment of the present disclosure, the original page has a page identifier.
[0073] According to an embodiment of the present disclosure, the page updating method 200 may further include the following operations.
[0074] When the page corresponding to the page identifier is accessed for the first time, the page is initialized to obtain the original page, and an event listener is set, wherein the event listener is used to monitor resource acquisition exceptions in the original page.
[0075] According to an embodiment of the present disclosure, after obtaining the original page, an event listener (i.e., Unhandled Rejection) can be set for the original page. The event listener can be used to capture and handle specific events, such as monitoring abnormalities in the retrieval of static resources in the original page. The specific configuration of the event listener can be configured according to actual business needs and is not limited here.
[0076] For example, the setting methods of event listeners may include at least one of the following: setting event listeners based on HyperText Markup Language (HTML) attributes, setting event listeners based on Document Object Model (DOM) attributes, setting event listeners based on event handler objects, setting event listeners based on anonymous functions, and setting event listeners based on event delegation.
[0077] According to an embodiment of the present disclosure, by initializing the page to obtain the original page when the page corresponding to the page identifier is first accessed, it is possible to ensure that the page is correctly presented to the user on the first access. After the page initialization is completed, by setting an event listener, corresponding processing can be performed when resource acquisition anomalies occur in the original page, reducing page loading issues caused by resource acquisition anomalies, thereby improving the reliability and stability of the page and further enhancing the user experience.
[0078] According to an embodiment of the present disclosure, operation S220 may include the following operations.
[0079] In response to the event listener detecting a failure to obtain a resource corresponding to the resource identifier, the exception type is determined, and page exception information is determined based on the resource identifier and the exception type.
[0080] According to an embodiment of the present disclosure, when an event listener detects a failure to obtain a resource corresponding to a resource identifier, the exception type can be determined based on the specific failure to obtain the resource. The exception type may include at least one of the following: a network request error, the requested resource does not exist on the server, the requested resource exists but the server refuses to provide access rights, the server encountered an internal error when processing the request and cannot provide the required resource, an abnormal Multipurpose Internet Mail Extensions (MIME), a cross-origin resource sharing error, a Secure Sockets Layer (SSL) / Transport Layer Security (TLS) error, and a resource loading timeout.
[0081] According to an embodiment of the present disclosure, for each failed resource identifier monitored by the event listener, after determining the exception type corresponding to the resource identifier, the resource identifier and the exception type corresponding to the resource identifier can be associated and stored as sub-exception information. After obtaining all failed acquisition sub-exception information, page exception information can be further determined based on the sub-exception information.
[0082] According to the embodiments of the present disclosure, since the exception type is determined in response to the event listener detecting a resource acquisition failure corresponding to a resource identifier, it is possible to promptly respond to the resource acquisition failure corresponding to the resource identifier. On this basis, by determining page exception information based on the resource identifier and the exception type, page loading issues caused by resource acquisition exceptions can be reduced, while helping developers to promptly discover and resolve potential problems, thereby improving the security and stability of the page update process.
[0083] Figure 3 An example diagram of a page update process according to an embodiment of the present disclosure is schematically shown.
[0084] like Figure 3 As shown in FIG300 , when user 301 first accesses page 302 corresponding to the page identifier, page 302 may be initialized to obtain original page 303 . On this basis, an event listener 307 may be set to monitor resource acquisition anomalies in original page 303 .
[0085] If user 301 is not visiting original page 303 for the first time and performs a page jump operation to jump page 304, at least one piece of candidate resource information 305 corresponding to jump page 304 can be determined. Based on the hash value corresponding to each piece of candidate resource information 305, a candidate resource identifier corresponding to each piece of candidate resource information 305 is determined. A packaging tool 306 is called to package the at least one piece of candidate resource information 305 based on the candidate resource identifier to obtain a candidate resource file. Based on this, the candidate resource identifier and the candidate resource file can be associated and stored in a data source.
[0086] In response to the event listener 307 detecting a failure to obtain the resource corresponding to the resource identifier, page exception information 308 can be determined based on the resource identifier and the exception type, and prompt information 309 can be output to the user. In addition, routing backtracking information 311 can be determined based on the page access path 310 of the user 301. A routing backtracking operation is performed based on the routing backtracking information 311. When the routing backtracking operation is completed, a version update button 312 can be generated. In response to the version update button 312 being triggered, an updated target page can be rendered based on the original page 303 and the version update information corresponding to the version update button 312.
[0087] According to an embodiment of the present disclosure, an original page corresponds to a page access path, and the page exception information includes N resource identifiers and exception types corresponding to each of the N resource identifiers.
[0088] According to an embodiment of the present disclosure, operation S230 may include the following operations.
[0089] Based on the N resource identifiers, updated address information corresponding to each of the N resource identifiers is determined in the data source. The N resource identifiers and the updated address information corresponding to each of the N resource identifiers are associated and stored as version update information. In response to the page access path characterizing the existence of P upper-level pages associated with the original page, routing backtracking information is determined based on the upper-level page identifiers corresponding to each of the P upper-level pages, where P is a positive integer.
[0090] According to an embodiment of the present disclosure, when an update of a candidate resource corresponding to a candidate resource identifier is detected, candidate updated address information corresponding to the candidate resource identifier can be determined. Based on this, at least one candidate resource identifier and the candidate updated address information corresponding to each candidate resource identifier can be associated and stored in a data source.
[0091] According to an embodiment of the present disclosure, after receiving a page update request, for each of the M resource identifiers indicated by the page update request, the resource identifier can be matched with at least one candidate resource identifier stored in the data source to determine the target resource identifier corresponding to the resource identifier, and the candidate updated address information corresponding to the target resource identifier is determined as the updated address information corresponding to the resource identifier. On this basis, the N resource identifiers and the updated address information corresponding to each of the N resource identifiers can be associated and stored as version update information.
[0092] According to embodiments of the present disclosure, a page access path can be used to characterize the path a user takes to access the original page. For example, if the original page is page C, and the user needs to first access page A to access page C, then jump to page B via page A, and then jump to page C via page B, then the page access path can include page A->page B->page C.
[0093] According to an embodiment of the present disclosure, when the page access path represents that there is no associated upper-level page for the original page, a version update button can be generated directly based on the version update information. Alternatively, when the page access path represents that there are P upper-level pages associated with the original page, route backtracking information can be generated based on the associated last page identifier. For example, taking the upper-level pages associated with page C including page A and page B as an example, the route backtracking information can be generated as B->A.
[0094] According to the embodiments of the present disclosure, since the version update information is determined based on the resource identifier and the updated address information, and the routing backtracking information is determined based on the page access path and the upper-level page identifier, the version update information and routing backtracking information can serve as the basis for subsequent page updates, which is conducive to improving the efficiency of resource management and page updates, ensuring that users can smoothly access updated resources, and improving the accuracy of page updates.
[0095] According to an embodiment of the present disclosure, the routing traceback information includes P upper-layer page identifiers having an associated relationship: p∈{1, 2, ..., (P-1)}.
[0096] According to an embodiment of the present disclosure, the page updating method 200 may further include the following operations.
[0097] According to the pth upper page identifier, the original page is rolled back to the pth upper page. In response to the (P-1)th upper page identifier having a previous upper page identifier, according to the previous upper page identifier, the (P-1)th upper page is rolled back to the previous upper page.
[0098] According to the embodiments of the present disclosure, the route backtracking function is very necessary in most scenarios. If the user simply refreshes the current page, the page state will be lost, which may cause unpredictable exceptions. If the current page is redirected, the route parameters need to be restored, but the existing page stack cannot be processed. For example, the route backtracking function can be implemented based on the route manager.
[0099] According to an embodiment of the present disclosure, taking the route backtracking information of F->E->D as an example, the original page can be rolled back to the first upper-level page (i.e., page F) according to the first upper-level page identifier (i.e., F). According to the second upper-level page identifier (i.e., E), page F is rolled back to the second upper-level page (i.e., page E). In the case where the second upper-level page identifier (i.e., E) has a previous upper-level page identifier (i.e., D), the second upper-level page can be rolled back to the previous upper-level page (i.e., page D) according to the previous upper-level page identifier (i.e., D), thereby completing the backtracking function of the front-end route and returning the user interface to the page at the time of entry.
[0100] According to the embodiments of the present disclosure, by rolling back the original page to the upper page according to the upper page identifier, and rolling back to the previous upper page in sequence during the rollback process, the rollback operation of multiple levels of pages can be implemented, thereby achieving complete restoration of the user entry state, avoiding the redundancy of the page stack, thereby improving the user experience, and further improving the availability and ease of use of the page update method.
[0101] According to an embodiment of the present disclosure, the page updating method 200 may further include the following operations.
[0102] In response to the (P-1)th upper page identifier not having a preceding upper page identifier, a version update button is generated according to the version update information, wherein the version update button is used to perform version updates on the resource files corresponding to the N resource identifiers that were not successfully loaded.
[0103] According to an embodiment of the present disclosure, taking the routing backtracking information of F->E as an example, the original page can be rolled back to the first upper-level page (i.e., page F) according to the first upper-level page identifier (i.e., F). According to the second upper-level page identifier (i.e., E), page F is rolled back to the second upper-level page (i.e., page E). In the case that the second upper-level page identifier (i.e., E) does not have a preceding upper-level page identifier, a prompt message can be generated to facilitate initiating a version update prompt to the user based on the exception. The prompt message can be configured according to actual business needs and is not limited here. For example, the prompt message can be "The new version is ready, click the version update button to refresh the page."
[0104] According to an embodiment of the present disclosure, a version update button can be generated based on the version update information. In response to detecting that the version update button is triggered, an updated resource file can be loaded based on the updated address information included in the version update information, so as to perform version updates on the resource files corresponding to each of the N resource identifiers that were not successfully loaded.
[0105] According to an embodiment of the present disclosure, when the (P-1)th upper-level page identifier does not have a preceding upper-level page identifier, a version update button is generated according to the version update information, so as to facilitate version update operations on the resource files corresponding to each of the N resource identifiers, so that users can conveniently obtain and update the resource files corresponding to the N resource identifiers, thereby improving the usability and user experience of the page update method.
[0106] Figure 4 An example schematic diagram of a routing backtracking process according to an embodiment of the present disclosure is schematically shown.
[0107] like Figure 4 As shown in FIG400, an original page 401 corresponds to a page access path 402. After obtaining the page access path 402, operation S410 may be performed.
[0108] In operation S410, does the page access path indicate that the original page has P upper-level pages associated therewith? If so, the routing backtracking information 403 can be determined. If not, the process can be terminated.
[0109] After obtaining the routing traceback information 403, the original page 401 may be rolled back to the pth upper page 404 according to the pth upper page identifier 403_1 included in the routing traceback information 403. After obtaining the pth upper page 404, operation S420 may be performed.
[0110] In operation S420, does the (P-1)th upper page identifier have a previous upper page identifier? If so, the previous upper page identifier 405 can be determined, and the (P-1)th upper page can be rolled back to the previous upper page 406 based on the previous upper page identifier 405. If not, a version update button 407 can be generated.
[0111] According to an embodiment of the present disclosure, operation S240 may include the following operations.
[0112] In response to detecting that the version update button is triggered, the resource files corresponding to the N resource identifiers are updated according to the updated address information corresponding to each of the N resource identifiers. The rendering engine renders the resources corresponding to each of the M resource identifiers according to the updated resource files corresponding to each of the M resource identifiers, thereby obtaining an updated target page.
[0113] According to an embodiment of the present disclosure, when it is detected that the version update button is triggered, for each of the N resource identifiers, the updated resource file corresponding to the resource identifier can be downloaded to the local server according to the updated address information corresponding to the resource identifier in the version update information, and the original resource file can be replaced with the updated resource file to facilitate automatic updating of the resource file.
[0114] According to an embodiment of the present disclosure, after the resource files corresponding to each of the N resource identifiers are updated, a rendering engine can be used to render the resource files corresponding to the resource identifier indicated by the page update request in the local server to obtain an updated target page. The rendering engine can present the visual results of the page to the user by parsing the HTML file and CSS file and executing JavaScript code. The specific rendering engine can be configured according to actual business needs and is not limited here. For example, the rendering engine can include at least one of the following: Blink, WebKit, Gecko, and Trident.
[0115] According to an embodiment of the present disclosure, after detecting that the version update button is triggered, the resource files corresponding to each of the N resource identifiers are updated, and the resources corresponding to each of the M resource identifiers are rendered using a rendering engine to obtain an updated target page. This ensures that users can obtain the latest resource files and presents them to users in a visual manner, thereby improving the usability and user experience of the page update method.
[0116] Figure 5 The following schematically illustrates an example process of rendering an updated target page based on version update information and route backtracking information according to an embodiment of the present disclosure.
[0117] like Figure 5 As shown in FIG500, in response to detecting that a version update button 501 is triggered, a version update can be performed on resource files 503 corresponding to each of the N resource identifiers based on updated address information 502 corresponding to each of the N resource identifiers, thereby obtaining updated resource files 504 corresponding to the M resource identifiers. Based on this, a rendering engine 505 can be used to render the resources corresponding to each of the M resource identifiers based on the updated resource files 504 corresponding to each of the M resource identifiers, thereby obtaining an updated target page 506.
[0118] Figure 6 An example schematic diagram of a page update process according to another embodiment of the present disclosure is schematically shown.
[0119] like Figure 6 As shown in 600, user 601 may initiate a page update request 603 via terminal device 602. In response to receiving the page update request 603 for the original page, the current resource state 604 is determined based on the M resource identifiers indicated by the page update request 603. After obtaining the current resource state 604, operation S610 may be performed.
[0120] In operation S610, does the current resource status indicate that the resource files corresponding to the N resource identifiers have not been successfully loaded? If not, then the updated target page 608 can be directly rendered. If so, then page exception information 605 can be obtained. Based on page exception information 605, version update information 606 and routing backtracking information 607 are determined. Based on this, the updated target page 608 is rendered based on version update information 606 and routing backtracking information 607.
[0121] The page update method provided by this disclosure at least partially overcomes the technical issue in related technologies where users cannot access pages normally due to front-end version updates. By passively triggering version updates, it avoids front-end page performance loss and traffic waste. Furthermore, it restores the user's entry state through route backtracking, avoiding unpredictable exceptions and page stack redundancy caused by intermediate page state loss, thereby improving the effectiveness of page updates.
[0122] The above are merely exemplary embodiments, but are not limited thereto. Other page updating methods known in the art may also be included, as long as they can improve the effect of the updated target page.
[0123] Figure 7 The block diagram of the page updating device according to the embodiment of the present disclosure is schematically shown.
[0124] like Figure 7 As shown, the page updating apparatus 700 may include a first determining module 710 , an acquiring module 720 , a second determining module 730 and a rendering module 740 .
[0125] The first determination module 710 is used to determine the current resource state in response to receiving a page update request for the original page according to the M resource identifiers indicated by the page update request, wherein the current resource state includes the loading state corresponding to each of the M resource identifiers, and M is a positive integer.
[0126] The acquisition module 720 is configured to acquire page exception information when the current resource status indicates that resource files corresponding to N resource identifiers are not loaded successfully, where N is a positive integer.
[0127] The second determining module 730 is configured to determine version update information and route backtracking information according to the page exception information.
[0128] The rendering module 740 is used to render the updated target page according to the version update information and the routing backtracking information.
[0129] According to an embodiment of the present disclosure, an original page corresponds to a page access path, and the page exception information includes N resource identifiers and exception types corresponding to each of the N resource identifiers.
[0130] According to an embodiment of the present disclosure, the second determining module 730 may include a first determining unit, an associated storage unit, and a second determining unit.
[0131] The first determining unit is configured to determine, in a data source, updated address information corresponding to each of the N resource identifiers according to the N resource identifiers.
[0132] The association storage unit is used to associate and store N resource identifiers and updated address information corresponding to each of the N resource identifiers as version update information.
[0133] The second determining unit is configured to determine routing backtracking information according to upper page identifiers corresponding to the P upper pages in response to the page access path characterizing that the original page has associated P upper pages, where P is a positive integer.
[0134] According to an embodiment of the present disclosure, the routing traceback information includes P upper-layer page identifiers having an associated relationship: p∈{1, 2, ..., (P-1)}.
[0135] According to an embodiment of the present disclosure, the page updating apparatus 700 may further include a first rollback module and a second rollback module.
[0136] The first rollback module is configured to roll back the original page to the p-th upper-layer page according to the p-th upper-layer page identifier.
[0137] The second rollback module is configured to roll back the (P-1)th upper page to the previous upper page according to the previous upper page identifier in response to the (P-1)th upper page identifier having the previous upper page identifier.
[0138] According to an embodiment of the present disclosure, the page updating apparatus 700 may further include a generating module.
[0139] A generation module is used to generate a version update button according to version update information in response to the (P-1)th upper page identifier not having a preceding upper page identifier, wherein the version update button is used to perform version updates on resource files corresponding to each of the N resource identifiers that were not successfully loaded.
[0140] According to an embodiment of the present disclosure, the rendering module 740 may include a version updating unit and a rendering unit.
[0141] The version update unit is configured to, in response to detecting that the version update button is triggered, perform version update on the resource files corresponding to the N resource identifiers according to the updated address information corresponding to the N resource identifiers.
[0142] The rendering unit is configured to render the resources corresponding to the M resource identifiers respectively using a rendering engine according to the updated resource files corresponding to the M resource identifiers respectively, to obtain an updated target page.
[0143] According to an embodiment of the present disclosure, the original page has a page identifier.
[0144] According to an embodiment of the present disclosure, the page updating apparatus 700 may further include an initialization processing module and a setting module.
[0145] The initialization processing module is used to perform initialization processing on the page when the page corresponding to the page identifier is accessed for the first time to obtain the original page.
[0146] The setting module is used to set an event listener, wherein the event listener is used to monitor abnormal resource acquisition in the original page.
[0147] According to an embodiment of the present disclosure, the acquisition module 720 may include a third determination unit and a fourth determination unit.
[0148] The third determining unit is configured to determine an exception type in response to the event listener detecting a failure in obtaining a resource corresponding to the resource identifier.
[0149] The fourth determining unit is configured to determine page exception information according to the resource identifier and the exception type.
[0150] According to an embodiment of the present disclosure, the page updating apparatus 700 may further include a third determining module, a packaging processing module, and an associated storage module.
[0151] The third determining module is configured to determine the candidate resource identifiers corresponding to the P pieces of candidate resource information respectively according to the hash values corresponding to the P pieces of candidate resource information respectively.
[0152] The packaging processing module is used to call a packaging tool for each candidate resource information in the P candidate resource information, and to package the candidate resource information according to the candidate resource identifier to obtain a candidate resource file.
[0153] The associated storage module is used to associate and store the candidate resource identifier and the candidate resource file in the data source.
[0154] According to the modules, submodules, units, and subunits of the embodiments of the present invention, any multiple or at least part of the functions of any multiple thereof can be implemented in one module. According to the modules, submodules, units, and subunits of the embodiments of the present invention, any one or more thereof can be split into multiple modules for implementation. According to the modules, submodules, units, and subunits of the embodiments of the present invention, any one or more thereof can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware of any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware, and firmware or in an appropriate combination of any of them. Alternatively, according to the modules, submodules, units, and subunits of the embodiments of the present invention, one or more thereof can be at least partially implemented as a computer program module, which can perform the corresponding function when the computer program module is run.
[0155] For example, any multiple of the first determination module 710, the acquisition module 720, the second determination module 730, and the rendering module 740 can be combined into one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the first determination module 710, the acquisition module 720, the second determination module 730, and the rendering module 740 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in an appropriate combination of any of them. Alternatively, at least one of the first determination module 710 , the acquisition module 720 , the second determination module 730 and the rendering module 740 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
[0156] It should be noted that the page update device part in the embodiment of the present disclosure corresponds to the page update method part in the embodiment of the present disclosure. The description of the page update device part is specifically referred to the page update method part, which will not be repeated here.
[0157] Figure 8 A block diagram of an electronic device suitable for implementing a page updating method according to an embodiment of the present disclosure is schematically shown. Figure 8 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0158] like Figure 8As shown, the computer electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 809 into a random access memory (RAM) 803. The processor 801 may, for example, include a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for executing different actions of the method flow according to an embodiment of the present disclosure.
[0159] Various programs and data required for the operation of the electronic device 800 are stored in the RAM 803. The processor 801, ROM 802, and RAM 803 are connected to each other via a bus 804. The processor 801 executes the programs in the ROM 802 and / or RAM 803 to perform various operations of the method flow according to the embodiment of the present disclosure. It should be noted that the programs may also be stored in one or more memories other than the ROM 802 and RAM 803. The processor 801 may also execute the programs stored in one or more memories to perform various operations of the method flow according to the embodiment of the present disclosure.
[0160] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the I / O interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage portion 808 including a hard disk; and a communication portion 809 including a network interface card such as a LAN card or a modem. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed in the drive 810 as needed, so that a computer program read therefrom can be installed into the storage portion 808 as needed.
[0161] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, device, apparatus, module, unit, etc. described above can be implemented by a computer program module.
[0162] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when executed, implements the method according to the embodiments of the present disclosure.
[0163] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0164] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 802 and / or the RAM 803 described above and / or one or more memories other than the ROM 802 and the RAM 803 .
[0165] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, which contains program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the page update method provided by the embodiment of the present disclosure.
[0166] When the computer program is executed by the processor 801, the above functions defined in the system / device of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0167] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0168] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).
[0169] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of the systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the boxes may occur in an order different from that marked in the accompanying drawings. For example, two boxes shown in succession may actually be executed substantially in parallel, or they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, as well as the combination of boxes in the block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or may be implemented using a combination of dedicated hardware and computer instructions. It will be understood by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or coupled in various ways, and all such combinations and / or couplings fall within the scope of the present disclosure.
[0170] The embodiments of the present disclosure are described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be used in combination to advantage. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A page updating method, comprising: In response to receiving a page update request for the original page, determining a current resource state according to M resource identifiers indicated by the page update request, wherein the current resource state includes a loading state corresponding to each of the M resource identifiers, where M is a positive integer; When the current resource status indicates that the resource files corresponding to the N resource identifiers are not loaded successfully, obtaining page exception information, where N is a positive integer; Determining version update information and routing backtracking information based on the page exception information; and An updated target page is rendered according to the version update information and the route backtracking information.
2. The method according to claim 1, wherein The original page corresponds to a page access path, and the page exception information includes N resource identifiers and exception types corresponding to the N resource identifiers; The determining of version update information and routing backtracking information according to the page exception information includes: Determining, in a data source, updated address information corresponding to each of the N resource identifiers according to the N resource identifiers; associating the N resource identifiers and the updated address information corresponding to each of the N resource identifiers and storing them as the version update information; and In response to the page access path characterizing that the original page has P upper pages associated therewith, the routing backtracking information is determined according to upper page identifiers corresponding to the P upper pages, where P is a positive integer.
3. The method according to claim 1, wherein The routing backtracking information includes P upper-layer page identifiers having an associated relationship; The method further includes, after determining the version update information and the routing backtracking information according to the page exception information: According to the p-th upper page identifier, roll back the original page to the p-th upper page, where p∈{1, 2, ..., (P-1)}; and In response to the (P-1)th upper page identifier having a previous upper page identifier, the (P-1)th upper page is rolled back to the previous upper page according to the previous upper page identifier.
4. The method according to claim 3, further comprising: In response to the (P-1)th upper page identifier not having a preceding upper page identifier, a version update button is generated according to the version update information, wherein the version update button is used to perform version updates on the resource files corresponding to each of the N resource identifiers that were not successfully loaded.
5. The method according to claim 4, wherein Rendering the updated target page according to the version update information and the route backtracking information includes: In response to detecting that the version update button is triggered, performing version updates on resource files corresponding to the N resource identifiers according to the updated address information corresponding to the N resource identifiers; and The rendering engine is used to render the resources corresponding to the M resource identifiers according to the updated resource files corresponding to the M resource identifiers, thereby obtaining the updated target page.
6. The method according to any one of claims 1 to 5, wherein The original page has a page identifier; The method further includes, before determining the current resource status according to the M resource identifiers indicated by the page update request in response to receiving the page update request for the original page: When a page corresponding to the page identifier is accessed for the first time, initializing the page to obtain the original page; and An event listener is set, wherein the event listener is used to monitor abnormal resource acquisition in the original page.
7. The method according to claim 6, wherein: When the current resource status indicates that the resource files corresponding to the N resource identifiers are not loaded successfully, obtaining page exception information includes: In response to the event listener detecting a failure to obtain a resource corresponding to the resource identifier, determining an exception type; and The page exception information is determined according to the resource identifier and the exception type.
8. The method according to any one of claims 1 to 5, further comprising, before determining the current resource status in response to receiving a page update request for the original page and according to the M resource identifiers indicated by the page update request: Determine, according to the hash values corresponding to the P pieces of candidate resource information, the candidate resource identifiers corresponding to the P pieces of candidate resource information; For each candidate resource information in the P candidate resource information, Invoking a packaging tool to package the candidate resource information according to the candidate resource identifier to obtain a candidate resource file; as well as The candidate resource identifier and the candidate resource file are associated and stored in a data source.
9. A page updating device, comprising: a first determining module configured to, in response to receiving a page update request for an original page, determine a current resource state according to M resource identifiers indicated by the page update request, wherein the current resource state includes a loading state corresponding to each of the M resource identifiers, where M is a positive integer; an acquisition module, configured to acquire page exception information when the current resource status indicates that resource files corresponding to the N resource identifiers are not loaded successfully, where N is a positive integer; A second determining module is configured to determine version update information and route backtracking information based on the page exception information; and A rendering module is used to render an updated target page according to the version update information and the route backtracking information.
10. An electronic device comprising: one or more processors; a memory for storing one or more instructions, Wherein, when the one or more instructions are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having executable instructions stored thereon, wherein when the executable instructions are executed by a processor, the processor is enabled to implement the method according to any one of claims 1 to 8.
12. A computer program product comprising computer executable instructions, wherein the computer executable instructions are used to implement the method according to any one of claims 1 to 8 when executed.
Citation Information
Patent Citations
Static webpage backup method and device
CN107766509A
Page information updating method, apparatus, computer device, and storage medium
CN109471988A
Page recovery display method and device, computer equipment and storage medium
CN111177616A
Method for recording user access path
CN111737630A
Page rollback method and device, equipment and medium
CN112035114A