Page request processing method, terminal, server and readable storage medium
By deploying edge programs in an edge computing environment to pre-request images on web pages, the problem of difficulty in pre-requesting dynamic URL images on web pages is solved, thus improving page loading speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UCWEB
- Filing Date
- 2023-03-13
- Publication Date
- 2026-07-03
AI Technical Summary
Existing technology makes it difficult to pre-request page images with dynamic URLs early on, resulting in slow page loading speeds.
By deploying edge programs in an edge computing environment, edge devices can be used to pre-request page images. User terminals obtain the addresses of page images and upload them to the target server for storage, thus realizing the pre-request of page images.
It improves the response speed of webpage loading, allowing user terminals to obtain and cache page images in advance when requesting the target page, reducing subsequent loading time.
Smart Images

Figure CN116522023B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a page request processing method, a user terminal, a server, and a computer-readable storage medium. Background Technology
[0002] EdgeRoutine (ER) is a JavaScript (scripting language for web pages) code execution environment that runs on Alibaba Cloud's global edge nodes. It supports ES6 syntax and standard Web Service Worker APIs. Users can deploy their self-developed JavaScript code to global edge nodes for execution, processing client requests locally. There are many methods for using edge routines to optimize the performance of individual pages, such as data prefetching, using main document and script files, and offline CSS (Cascading Style Sheets) resources.
[0003] Existing technologies for offline and pre-request image processing typically rely on offline packages or pre-request configurations on the user terminal. Furthermore, the images available for offline or pre-request processing have relatively fixed URLs. However, for web page images with dynamic URLs, it's difficult for user terminals to perform offline processing and early pre-requesting. Therefore, it's necessary to provide a technical solution for pre-requesting web page images as early as possible. Summary of the Invention
[0004] One objective of this disclosure is to provide a technical solution that enables pre-requesting of page images.
[0005] According to a first aspect of this disclosure, a page request processing method is provided, implemented by a user terminal, the page request processing method comprising:
[0006] Based on the user's input of the target page, obtain the image address of the page image of the target page;
[0007] The corresponding page image is obtained based on the image address, and the image address is uploaded to the target server for storage of image information corresponding to the target page; wherein, the image information represents the image address associated with the target page;
[0008] The target page is rendered and displayed based on the obtained page images.
[0009] Optionally, before obtaining the image address of the page image of the target page, the method further includes:
[0010] Obtain image identification information corresponding to the target page provided by the target server; wherein, before storing the image information, the target server stores historical image information corresponding to the target page, and the image identification information is determined based on the historical image information;
[0011] Based on the image identification information, a corresponding image pre-request is sent to the target server; wherein, the image pre-request is performed in parallel with at least one other file request corresponding to the target page;
[0012] Receive the page image returned by the target server according to the image pre-request, and save the received page image locally;
[0013] The step of obtaining the corresponding page image based on the image address includes:
[0014] Retrieve the page image corresponding to the image address locally.
[0015] Optionally, the image identification information is an image address index configured according to the interface provided by the target server, wherein the interface maps the image address index to the image address of the page image, and the mapping relationship corresponding to the interface is determined according to the historical image information.
[0016] Optionally, the image pre-request and the corresponding page request for the target file are performed in parallel, wherein the page request is used to request the main document of the target page.
[0017] Optionally, before obtaining the image address of the page image of the target page, the method further includes:
[0018] Based on the user's input to load the target page, a page request for the target page is sent to the target server;
[0019] Receive the main document of the target page returned by the target server in response to the page request;
[0020] The step of obtaining the image identification information corresponding to the target page provided by the target server includes:
[0021] Extract the image identification information corresponding to the target page from the main document; wherein the image identification information is injected by the target server into the main document returned according to the page request, and the image identification information injected into the main document is determined based on the historical image information.
[0022] Optionally, the image pre-request is performed in parallel with at least one of the script file request and style file request corresponding to the target page, wherein the script file request is a request for obtaining the script file imported by the main document, and the style file request is a request for obtaining the style file imported by the main document.
[0023] Optionally, the target server is a content delivery network node.
[0024] According to a second aspect of this disclosure, a page request processing method is also provided, the method comprising:
[0025] Receive the image address of the target page uploaded by the user terminal; wherein the image address of the target page is obtained by the user terminal based on the user's input of loading the target page;
[0026] Based on the received image address, update the image information corresponding to the target page; wherein, the image information represents the image address associated with the target page, and the image information is used to respond to the image pre-request corresponding to the target page.
[0027] Optionally, before receiving the image address of the target page uploaded by the user terminal, the method further includes:
[0028] The system receives a pre-request for an image corresponding to the target page sent by the user terminal; wherein the pre-request carries image identification information corresponding to the target page, the image identification information is determined based on historical image information corresponding to the target page, and the pre-request is performed in parallel with at least one other file request from the user terminal corresponding to the target page;
[0029] Based on the image pre-request, a page image corresponding to the image identification information is obtained, and the page image is returned to the user terminal for storage; wherein, the page image stored on the user terminal is used by the user terminal to retrieve the corresponding page image from the local machine based on the obtained image address of the target page.
[0030] Optionally, before receiving the image pre-request corresponding to the target page sent by the user terminal, the method includes:
[0031] An interface for configuring image address indexes is provided; wherein, the interface maps the image address indexes to the image addresses of the page images, the mapping relationship corresponding to the interface is determined based on historical image information corresponding to the target page, and the image identification information is the image address index configured by the user terminal according to the interface.
[0032] Optionally, before receiving the image address of the target page uploaded by the user terminal, the method further includes:
[0033] Receive a page request for a corresponding target page sent by the user terminal; wherein the page request is triggered based on the user's input to load the target page;
[0034] Based on the page request, obtain the main document of the target page and the corresponding historical image information of the target page;
[0035] Based on the historical image information, determine the image address of the page image of the target page;
[0036] The image address is injected into the main document, and the main document with the injected image address is returned to the user terminal; wherein, the image identification information is the image address of the page image extracted from the main document.
[0037] According to a third aspect of this disclosure, a user terminal is also provided, the terminal device including at least one processor and at least one memory, the memory for storing a computer program, and the processor for executing the page request processing method according to the first aspect of this disclosure under the control of the computer program.
[0038] According to a fourth aspect of this disclosure, a server is also provided, the server including at least one processor and at least one memory, the memory for storing a computer program, and the processor for executing the page request processing method according to a second aspect of this disclosure under the control of the computer program.
[0039] According to a fifth aspect of this disclosure, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the page request processing method according to a first or second aspect of this disclosure.
[0040] In the page request processing method provided in this embodiment, when the client receives input from the user to load the target page, it obtains the image address of the page image of the target page. After obtaining the image address, the client retrieves the corresponding page image based on the image address for rendering and displaying the target page on the client. Simultaneously, it uploads the image address to the target server for storing image information corresponding to the target page. This image information represents the image address associated with the target page, and is used by the target server to process image pre-requests issued by the client for subsequent input to load the target page. In this way, when the user terminal requests the target page, it can pre-request image data from the page as early as possible, improving the response speed of the user terminal to page loading.
[0041] The features and advantages of the embodiments of this specification will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0042] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments of this specification and, together with their description, serve to explain the principles of these embodiments.
[0043] Figure 1 A schematic diagram of the composition structure of a service system to which the page request processing method according to embodiments of the present disclosure can be applied is shown;
[0044] Figure 2 A flowchart illustrating a page request processing method implemented by a user terminal according to some embodiments is shown;
[0045] Figure 3 A flowchart illustrating a page request processing method implemented by a target server according to some embodiments is shown;
[0046] Figure 4 A flowchart illustrating a page request processing method implemented by a user terminal according to some other embodiments is shown;
[0047] Figure 5 A flowchart illustrating a page request processing method implemented by a user terminal according to yet another embodiment is shown;
[0048] Figure 6 This diagram illustrates the interactive flow of page request processing according to some embodiments;
[0049] Figure 7 A schematic diagram of the interaction flow for page request processing according to some other embodiments is shown;
[0050] Figure 8 A schematic diagram of the hardware structure of a user terminal according to one embodiment is shown;
[0051] Figure 9 A schematic diagram of the hardware structure of a server according to one embodiment is shown. Detailed Implementation
[0052] Various exemplary embodiments of this specification will now be described in detail with reference to the accompanying drawings.
[0053] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the embodiments of this specification or their application or use.
[0054] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0055] It should be noted that all actions involving the acquisition of signals, information, or data in this disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the location is situated, and with the authorization granted by the owner of the relevant equipment.
[0056] This disclosure relates to a page request processing method performed on edge devices on CDN (Content Delivery Network) nodes of a FaaS (Function as a Service) origin server. The edge devices can cache the web page content of the FaaS function service and respond to user service requests based on the cached content. FaaS-based services can be any service provided to users through their terminals; for example, it could be opening a shopping website's webpage or a browser-based search service. However, for webpage images with dynamic URLs, it is difficult for user terminals to pre-request them early.
[0057] In order to pre-request images with dynamic addresses on web pages as early as possible, the inventors have proposed a technical solution in this disclosure for image pre-request processing based on edge computing, so as to pre-request images on web pages as early as possible.
[0058] Figure 1 This is a schematic diagram of the composition structure of a service system to which the page request processing method according to embodiments of the present disclosure can be applied.
[0059] like Figure 1 As shown, the service system 100 of this embodiment includes a user terminal 110, a Content Delivery Network (CDN) node 120, a FaaS origin server 130, and a backend server 130. The edge device 121 for implementing the page request processing method of this embodiment is deployed on the CDN node 120. Since the CDN node 120 has the characteristic of global deployment, once the program for implementing the page request processing method is uploaded to the edge device 121 of the CDN node 120, it can be deployed globally and executed globally.
[0060] In service system 100, user terminal 110 has multiple browser clients installed and running. These browsers may include browsers configured with a container or browsers not configured with a container. The container configured for the browser can be a web container.
[0061] FaaS origin server 130 is used to call and execute FaaS functions that implement service functions in response to service requests from users and return corresponding web page content. CDN node 120 can also be understood as an edge server, characterized by global deployment. Therefore, edge devices 121 deployed on CDN node 120 can provide services based on the user's location, thereby improving service performance.
[0062] Edge device 121 is a device used to run an edge routine (ER) that implements the page request processing method of the present disclosure, and can be considered as a gateway device.
[0063] Backend server 130 is a platform for staff to perform system maintenance. It may include staff terminal devices and a server for service management, which may be a server containing a database.
[0064] User terminal 110 can communicate with CDN node 120, FaaS origin server 130, and backend server 130. CDN node 120 can also communicate with FaaS origin server 130. User terminal 110 can send service requests to edge device 121 of CDN node 120, and edge device 121 responds based on web page content cached on CDN node 120. CDN node 120 can access FaaS origin server to retrieve web page content for caching and updating. Staff can configure the backend server 130 for edge device 121 to pull.
[0065] User terminal 110 can be a mobile phone, computer, wearable device, or other terminal device, etc., and is not limited here.
[0066] like Figure 1 As shown, the user terminal 110 may include a processor 1101, a memory 1102, an interface device 1103, a communication device 1103, an output device 1105, an input device 1106, etc.
[0067] The processor 1101 executes computer programs, which can be written using instruction sets of architectures such as x86, Arm, RISC, MIPS, and SSE. The memory 1102 includes, for example, ROM (Read-Only Memory), RAM (Random Access Memory), and non-volatile memory such as a hard disk. The interface device 1103 includes, for example, a USB interface and a headphone jack. The communication device 1103 is capable of wired or wireless communication. The communication device 1105 may include at least one short-range communication module, such as any module for short-range wireless communication based on short-range wireless communication protocols such as Hilink, WiFi (IEEE 802.11), Mesh, Bluetooth, ZigBee, Thread, Z-Wave, NFC, UWB, and LiFi. The communication device 1103 may also include a long-range communication module, such as any module for WLAN, GPRS, or 2G / 3G / 5G long-range communication. The output device 1105 may include, for example, an LCD screen, a touch screen, and a speaker. The input device 1106 may include, for example, a touch screen, a keyboard, and a microphone.
[0068] It should be understood that, despite Figure 1 Only one user terminal 110 and one CDN node 120 are shown, but this does not mean that the number of each is limited. The service system can contain multiple user terminals 110 and multiple CDN nodes 120.
[0069] Next Figure 1 Taking the service system shown as an example, the page request processing method implemented by user terminal 110 is explained.
[0070] <Method Example 1>
[0071] Figure 2 A schematic diagram illustrating the interaction flow of page request processing implemented by user terminal 110 according to an embodiment of this disclosure is shown. Figure 2 As shown, the page request processing method in this embodiment may include the following steps S201 to S203:
[0072] Step S201: Based on the user's input of the target page, obtain the image address of the page image of the target page.
[0073] In this embodiment, the user terminal receives the user's input of loading the target page, and obtains the image address of the page image of the target page based on the input, so as to further obtain the corresponding page image based on the image address, thereby completing the rendering and display of the target page.
[0074] In this embodiment, the user can input the request to load the target page through a browser installed on the user terminal 110. The target page can be a web page that the user requests to access. For example, the user's input can be the URL (Uniform Resource Locator) of the target page entered in the browser's address bar, or it can be the webpage link address corresponding to the target page clicked in the browser; there is no limitation here. After the user inputs the corresponding information for loading the target page, the user terminal 110 can receive the user's input for loading the target page.
[0075] In this embodiment, the user terminal 110 obtains the page file of the target page based on the user's input regarding the loading of the target page, and renders the target page according to the page file. For example, CSR (Client Side Render) can be used to render the target webpage. Here, the browser running on the user terminal 110 needs to obtain the page file corresponding to the target page for rendering and displaying the target page. This page file may include the main document, script file, style file, page images, etc. of the target page. The main document of the target page can be an HTML file corresponding to the target page. The script file can be a JS (Javascript) file. The style file can be a CSS (Cascading Style Sheets) file, etc.
[0076] In some embodiments, after receiving input to load a target page, the user terminal can send a page request corresponding to the target page to the target server. The target server returns the main document of the target page based on the page request and obtains the image address of the page image of the target page based on the main document.
[0077] In some embodiments, the target server may be a content delivery network node. The target server may be a CDN node 120, or an edge device 121 deployed on the CDN node 120 to execute edge programs; there is no limitation thereto. The target server may include a cache for storing static resources, and may also include a KV database, wherein a KV (Key-value) database is a database that stores data in key-value pairs.
[0078] In some embodiments, the image address of the page image is located in the script file (JS file) referenced by the main document (HTML document). In these embodiments, obtaining the image address of the page image of the target page based on the main document may include the following steps: receiving the main document of the target page returned by the target server according to the document request; and executing the script file (JS file) referenced by the main document to obtain the image address of the page image of the target page.
[0079] After sending a document request to the target server, user terminal 110 can receive the main document file corresponding to the target page returned by the target server. It's important to note that the main document of the target page can include script files, style files, etc., corresponding to the target page. Simply put, the returned main document can include the names of the script files and style files corresponding to the target page. Based on this, the user terminal also needs to retrieve the script files and style files corresponding to the target page from the target server using the names and other identifiers, for subsequent use by user terminal 110 in rendering the target page. When executing the script file (JS file), the page data required for page rendering, including image address data, can be obtained through the JSON (JavaScript Object Notation) data imported in the request.
[0080] After receiving a page request for a target page from user terminal 110, the target server can retrieve the main document of the target page from its cache if the main document of the target page is stored there. If the main document of the target page is not stored in the target server's cache, the target server can request the main document from a different cache. Figure 1 The FaaS origin server 130 requests the main document and returns the main document returned by FaaS to the user terminal 110.
[0081] In some embodiments, the main document returned by the target server may include file identifiers such as the name of the script file and the name of the style file corresponding to the target page. After obtaining the main document corresponding to the target page returned by the target server, the user terminal 110 can request the return of the script file, style file, etc., corresponding to the target page from the target server based on these file identifiers. That is, the user terminal 110 can send a request to the target server to obtain the script file corresponding to the main document and receive the script file corresponding to the target page returned by the target server for page rendering.
[0082] Similarly, when the main document includes a style file, the user terminal 110 can send a request to the target server to obtain the style file corresponding to the main document, and receive the style file corresponding to the target page returned by the target server for page rendering.
[0083] After obtaining the script file corresponding to the target page, the user terminal 110 can execute the script file included in the main document, send a request to the backend server 140 to obtain the page data corresponding to the target page, and receive the page data corresponding to the target page returned by the backend server 140. The page data corresponding to the target page may include the image addresses of the page images on the target page. If the target page includes multiple page images, the image addresses of each page image can be obtained separately in this step.
[0084] Step S202: Obtain the corresponding page image based on the image address, and upload the image address to the target server for storage of image information corresponding to the target page; wherein, the image information represents the image address associated with the target page.
[0085] In this embodiment, after obtaining the image address of the page image, if the user terminal 110 does not have the pre-requested image locally, it can request the corresponding page image from the corresponding backend server based on the image address; if the pre-requested image is available locally, it can directly load the corresponding page image from the local machine to complete the rendering and display, thereby improving the page loading response speed.
[0086] In this embodiment, the user terminal 110 can upload the image information of the page image corresponding to the target page to the KV database in the target server for storage, forming the image information of the corresponding target image. The image information represents the image address associated with the target page. The image information can be represented in any form, such as representing the association between the identifier of the target page and the image address, or adding the identifier of the page image to the image address, etc. The identifier of the target page can be at least a part of the web page address, or it can be the page name or page ID, etc., which is not limited here.
[0087] The target server stores and updates the image information of the target page, which can be used by the user terminal or other user terminals to pre-request images when they receive input to load the target page, thereby improving the response speed of subsequent page loading.
[0088] Step S203: Render and display the target page based on the obtained page image.
[0089] In this embodiment, the user terminal renders and displays the target page based on the obtained page file, which includes page images. Besides page images, the page file may also include the main document, script files, style files, etc., and is not limited here.
[0090] As can be seen from steps S201 to S203 above, in the page request processing method provided in this embodiment, after the first user terminal obtains the image address of the target page based on the user's first input for loading the target page, it uploads the image address to the target server for storage of image information corresponding to the target page, so as to process any subsequent image pre-requests corresponding to the target page sent by any user terminal. That is to say, after this, when the second user terminal (which can be the first user terminal or other user terminals) processes the second input for loading the target page, it can send an image pre-request to the target server before obtaining the image address of the target page based on the second input, and save the page image returned by the target server based on the stored image information locally. In this way, when the second user terminal obtains the image address of the page image and obtains the corresponding page image based on the image address, it can obtain the required page image from locally without obtaining it from the backend server, thereby improving the page loading response speed and enhancing the user experience. The method of this embodiment can be applied to the pre-request of dynamic images, and of course, it can also be used for the pre-request of static images, without limitation.
[0091] <Example 1>
[0092] Figure 4 This is a flowchart based on some embodiments. Figure 6 A schematic diagram illustrating the interaction flow of page request processing implemented by user terminal 110 according to some embodiments is shown. For example... Figure 4 and Figure 6 As shown, the page request processing method in this embodiment may include the following steps S401 to S409:
[0093] Step S401: Receive the user's input for loading the target page.
[0094] After the user provides the corresponding input regarding the loading of the target page, the user terminal 110 can receive the user's input regarding loading the target page.
[0095] In step S402, in response to the input, a page request for the corresponding target page is sent to the target server.
[0096] Step S403: Obtain image identification information for the corresponding target page provided by the target server; wherein, before storing the image information, the target server stores historical image information corresponding to the target page, and the image identification information is determined based on the historical image information.
[0097] In this embodiment, the user terminal 110 can determine the image identification information of the target page according to the interface provided by the target server.
[0098] In this embodiment, prior to step S403, the target server's KV database already stores historical image information corresponding to the target page. This historical image information refers to the image information that has been processed based on prior page requests and stored in the target server before step S408. This prior page request processing can be based on the user terminal's request or on requests from other user terminals, and is not limited here.
[0099] This image information represents the address of an image associated with the target page, and the image identification information is determined based on this historical image information.
[0100] In some embodiments, the image identification information is an image address index configured according to the interface provided by the target server, wherein the interface maps the image address index to the image address of the page image, and the mapping relationship corresponding to the interface is determined based on historical image information.
[0101] In these embodiments, the image identification information obtained by the user terminal 110 can be an image address index configured according to the interface provided by the target server. In these embodiments, the target server and the user terminal can configure the image address index corresponding to the target page according to rules agreed upon by both parties. Based on this, the user terminal can determine the image address index as the image identification information according to the webpage address of the target page and the index configuration rules.
[0102] For example, the page address includes the following information:
[0103] https: / / page.sm.cn / er_prefetch_img?pagename=xxx&uniid=yyy.
[0104] Based on this, the image address index configured according to the interface provided by the target server can be:
[0105] https: / / page.sm.cn / er_prefetch_img?pagename=xxx&uniid=yyy∈
[0106] dex = [1,2,3...N].
[0107] In this URL, https: / / page.sm.cn / er_prefetch_img is the URL (Uniform Resource Locator) address, which needs to be separated by "?". `pagename` and `uniid` are parameter names, and `xxx` and `yyy` are the parameter values corresponding to `pagename` and `uniid`, respectively. Parameter names and values are connected by an equals sign "=". "∈" is the "belongs to" symbol, and `dex = [0,1,2,3...N]` represents the index of image 1 to image N among the multiple page images corresponding to the target page.
[0108] In this embodiment, the user terminal 110 can use the pre-request capability of the container to configure the image address index of the page image in the target page according to the interface provided by the target server, so as to send an image pre-request for the page image of the target page to the target server through the image address index.
[0109] In these embodiments, the interface provided by the target server can map the image address index corresponding to the page image to the image address in the target server's cache. For example, after receiving the image address index sent by the user terminal, the target server determines the page identification information and image identification information based on the image address index, and then searches for the image address of the target page from historical image information based on the page identification information and image identification information, and retrieves the corresponding page image based on the found image address and returns it to the user terminal.
[0110] Step S404: Based on the image identification information, send the corresponding image pre-request to the target server; wherein, the image pre-request is performed in parallel with at least one other file request for the corresponding target page.
[0111] It should be understood that parallel execution in this embodiment refers to overlapping in time, not time synchronization, let alone simultaneous execution.
[0112] In this embodiment, the user terminal 110 can send a corresponding image pre-request to the target server based on the image identification information provided by the target server. The image pre-request may include the image identification information of a page image.
[0113] It is important to note that the image pre-request here can be made in parallel with at least one other page file request corresponding to the target page.
[0114] In one example, image pre-requests can be performed in parallel with page requests for the target page to obtain page images as early as possible and store them locally, thereby effectively speeding up page loading.
[0115] In another example, image pre-requests can also be made to the target server in parallel with requests for script files or style files corresponding to the target page.
[0116] In this embodiment, the user terminal 110 can perform image pre-requests for page images on the target page in parallel with the page request for the target page. That is, the user terminal 110 configured with a container can simultaneously send an image pre-request to the target server to retrieve multiple page images while sending a page request to the target server to retrieve the main document of the target page. In this embodiment, as described above, the image pre-request is based on the fact that the target server's key-value database has already stored the image information of the target page before receiving the image pre-request, enabling it to respond to the image pre-request.
[0117] Step S405: Receive the main document of the target page returned by the target server based on the page request.
[0118] Step S406: Receive the page image returned by the target server according to the image pre-request, and save the received page image locally.
[0119] User terminal 110 can receive page images returned by the target server based on the image identification information in the image pre-request, and save the received page images in the local cache of user terminal 110.
[0120] Step S407: Execute the script file imported by the main document to obtain the image address of the page image of the target page.
[0121] In this embodiment, the user terminal 110 can send a request to the target server to obtain the script file corresponding to the main document, and receive the script file corresponding to the target page returned by the target server. After obtaining the script file corresponding to the target page, the user terminal 110 can execute the script file introduced by the main document, and send a request to the backend server 140 to obtain the page data corresponding to the target page, and receive the page data corresponding to the target page returned by the backend server 140. The page data corresponding to the target page includes the image address of the page image of the target page.
[0122] Step S408: Obtain the corresponding page image based on the image address, and upload the image address to the target server for storage of image information corresponding to the target page; wherein, the image information represents the image address associated with the target page.
[0123] In this embodiment, since the page image returned by the target server based on the image pre-request has been saved locally in step S406, when the user terminal executes step S408, for the image already saved locally, it can obtain the image identifier based on the image address obtained in step S407, and directly retrieve the corresponding page image from the local storage for loading and display, without needing to request it from the backend server again, thereby improving loading speed. Correspondingly, retrieving the corresponding page image based on the image address in step S408 may include: retrieving the page image corresponding to the image address locally.
[0124] For images not saved locally, the corresponding page image can be requested from the corresponding backend server based on the image address obtained in step S407, which will not be elaborated here.
[0125] On the other hand, user terminal 110 can upload the image address corresponding to the target page to the KV database in the target server to update the image information of the target page, so as to pre-request images for subsequent page loading.
[0126] In another embodiment, if the target server's cache does not store image information corresponding to the target page, the user terminal 110 can retrieve the page image corresponding to the image address from the database of the backend server 140. However, if the image information stored in the target server's cache only involves image addresses of some page images, the user terminal 110 can pre-request a portion of the page images. In this case, a portion of the page images can be pre-requested locally, and the remaining portion can be retrieved from the database of the backend server 140 based on the image addresses.
[0127] Step S409: Render and display the target page based on the obtained page file; wherein, the page file includes the main document, script file, and page images, etc.
[0128] <Example 2>
[0129] Figure 5 A schematic diagram of a page request processing flow according to some other embodiments is shown. Figure 7 A schematic diagram illustrating the interaction flow of page request processing implemented by user terminal 110 according to some other embodiments is shown. For example... Figure 5 and Figure 7 As shown, the page request processing method of this embodiment may include the following steps S501 to S509:
[0130] Step S501: Receive the user's input for loading the target page.
[0131] In the embodiments of this application, the user can complete the input to load the target page through the browser installed on the user terminal 110.
[0132] In step S502, in response to the input, a page request for the corresponding target page is sent to the target server.
[0133] In an embodiment of this application, user terminal 110, in response to user input regarding loading the target page, begins rendering the target page. User terminal 110 may first send a page request to the target server to retrieve the main document of the target page.
[0134] Step S503: Receive the main document of the target page returned by the target server according to the page request.
[0135] After sending a page request to the target server, user terminal 110 can receive the main document file corresponding to the target page returned by the target server.
[0136] Step S504: Obtain image identification information for the corresponding target page provided by the target server; wherein, before storing the image information, the target server stores historical image information corresponding to the target page, and the image identification information is determined based on the historical image information.
[0137] Prior to step S504, the target server's KV database already stores historical image information corresponding to the target page. This historical image information refers to image information that was processed based on prior page requests and stored on the target server before step S508. This prior page request processing can be based on the user terminal's request or on requests from other user terminals; no limitation is made here. In this embodiment, the image identifier information can be the image address of the page image. The image identifier information is injected by the target server into the main document returned based on the page request. The image identifier information injected into the main document is determined based on the historical image information.
[0138] Correspondingly, after the user terminal receives the main document of the target page returned by the target server according to the page request in step S503, it can extract image identification information from the main document in step S504, for example, extracting the image address of the page image. That is to say, obtaining the image identification information of the corresponding target page provided by the target server in step S504 can include: extracting the image identification information of the corresponding target page from the main document.
[0139] Step S505: Based on the image identification information, send the corresponding image pre-request to the target server; wherein, the image pre-request is performed in parallel with at least one other file request for the corresponding target page.
[0140] In this embodiment, after the user terminal 110 extracts the image identification information of the page image of the target page from the main document, it can send an image pre-request for the page image of the target page to the target server. The image pre-request may include the image identification information of the page image of the target page.
[0141] Image pre-requests can be made concurrently with at least one other page file request corresponding to the target page. For example, an image pre-request can be made concurrently with at least one of the script file request and style file request for the corresponding target page, where the script file request is for retrieving the script file and the style file request is for retrieving the style file included in the main document.
[0142] In this embodiment, the user terminal 110 can request the page image of the target page in parallel with at least one of the script file request and style file request for the target page, so as to save the page image locally before executing step S508, so that the user terminal can retrieve the page image from the local machine when executing step S508. The user terminal 110 can send a script file request or a style file request to the target server to obtain the script file or style file introduced by the main document of the target page stored in the cache of the target server.
[0143] Step S506: Receive the page image returned by the target server according to the image pre-request, and save the received page image locally.
[0144] User terminal 110 can receive multiple page images returned by the target server based on the image identification information in the image pre-request, and save the received page images in the local cache of user terminal 110.
[0145] Step S507: Execute the script file imported by the main document to obtain the image address of the page image of the target page.
[0146] Step S508: Obtain the corresponding page image based on the image address, and upload the image address to the target server for storage of image information corresponding to the target page; wherein, the image information represents the image address associated with the target page.
[0147] In this embodiment, since the page image returned by the target server based on the image pre-request has been saved locally in step S506, when the user terminal executes step S508, for the image already saved locally, it can obtain the image identifier based on the image address obtained in step S507, and directly retrieve the corresponding page image from the local storage for loading and display, without needing to request it from the backend server again, thereby improving loading speed. Correspondingly, retrieving the corresponding page image based on the image address in step S508 may include: retrieving the page image corresponding to the image address from the locally saved page images.
[0148] For images not saved locally, the corresponding page image can be requested from the corresponding backend server based on the image address obtained in step S507.
[0149] On the other hand, user terminal 110 can upload the image address corresponding to the target page to the KV database in the target server to update the image information of the target page, so as to pre-request images for subsequent page loading.
[0150] Step S509: Render and display the target page based on the obtained page file.
[0151] This page file includes the main document, script files, style files, page images, etc.
[0152] In the embodiments of this application, after the user terminal 110 obtains the page file corresponding to the target page, it can render and display the target page according to the obtained page file corresponding to the target page.
[0153] <Method Example 2>
[0154] Figure 3 This diagram illustrates a flow chart of page request processing performed by a target server according to some embodiments. The implementing entity in this embodiment is the target server corresponding to user terminal 110 in Embodiment 1 above. For example... Figure 3 As shown, the page request processing method implemented by the target server in this embodiment may include the following steps S301 to S302.
[0155] Step S301: Receive the image address of the target page uploaded by user terminal 110.
[0156] The image address of the target page is obtained by the user terminal 110 based on the user's input when loading the target page. The user terminal uses the image address obtained from the user's input to retrieve the corresponding page image, thereby completing the rendering and display of the target page.
[0157] In the embodiment where the image address is located in a script file referenced by the main document, the user terminal 110 can obtain the image address of the target page by executing the script file. For example, the user terminal 110 can obtain the image address of the target image from the backend server by executing the script file and upload the image address to the KV database of the target server to form the image information of the target image. This information is then used by the target server to obtain the image address of the target page from the cache of the target server when the target server receives a pre-request for the image of the target page from the user terminal 110 or other user terminals, and then return the page image corresponding to the image address.
[0158] Step S302: Update the image information corresponding to the target page based on the received image address; wherein the image information represents the image address associated with the target page; wherein the image information is used to respond to the image pre-request of the corresponding target page.
[0159] Image pre-request is a request sent by the user terminal to retrieve images from a target page before obtaining the image URLs for those images.
[0160] In some embodiments, before receiving the image address of the target page uploaded by the user terminal 110 in step S301, the target server may further include the following steps: receiving a page request sent by the user terminal 110 corresponding to the target page; wherein the page request is triggered based on the user's input to load the target page; and returning the main document of the target page to the user terminal 110 according to the page request.
[0161] In these embodiments, the user terminal can obtain the image address of the page image of the target page based on the main document returned by the target server, and upload it to the target server in step S310.
[0162] In these embodiments, the target server can read the main document corresponding to the target page from its cache based on a page request sent by the user terminal 110. Specifically, if the target server already has the main document corresponding to the target page in its cache, it can return the cached main document to the user terminal 110; otherwise, it can request the main document corresponding to the target page from the target server's FaaS origin server 130.
[0163] After obtaining the main document corresponding to the target page from the Faas origin server 130, the target server can store the main document in its cache and return the main document of the target page to the user terminal 110.
[0164] The main document of the target page returned by the target server to user terminal 110 may include the name of the script file corresponding to the target page. Therefore, user terminal 110 can obtain the name of the script file corresponding to the target page based on the main document of the target page, and send a request for the script file corresponding to the target page to the target server based on that name. Image pre-request can refer to a request by user terminal 110 to obtain images before executing the script file.
[0165] In the embodiments of this application, the target server can receive image information of a target page uploaded by a user terminal and store it in a key-value (KV) database, thereby updating the image information stored in the KV database. When the target server has stored the image information of the target page, it can respond to a pre-request for an image of the target page sent by the user terminal 110, and based on the image address determined by the image information, retrieve the corresponding page image and return it to the user terminal 110.
[0166] In some embodiments, before receiving the image address of the target page uploaded by the user terminal in step S302 above, the method may further include the following steps: receiving an image pre-request corresponding to the target page sent by the user terminal; obtaining a page image with corresponding image identification information according to the image pre-request, and returning the page image to the user terminal for saving.
[0167] In these embodiments, the image pre-request carries image identification information corresponding to the target page. The image identification information is determined based on historical image information corresponding to the target page. The image pre-request is performed in parallel with at least one other file request corresponding to the target page of the user terminal.
[0168] In some examples, before receiving a pre-request for an image corresponding to the target page from a user terminal, the method may further include: providing an interface for configuring an image address index. This interface maps the image address index to the image address of the page image, and the mapping relationship corresponding to the interface is determined based on historical image information corresponding to the target page. This image identification information is the image address index configured by the user terminal according to the interface.
[0169] In other examples, the image identification information can be image identification information extracted from the main document, such as the image address of a page image. In these examples, the target server returning the main document of the target page to the user terminal based on the page request may include: obtaining the main document of the target page based on the page request; obtaining historical image information corresponding to the target page based on the page request; determining the image identification information of the target page based on the historical image information, such as determining the image address of a page image; and injecting the image identification information into the main document and returning the main document with the injected image identification information to the user terminal.
[0170] This disclosure also provides a user terminal, such as... Figure 8 As shown, the user terminal 800 includes at least one processor 801 and at least one memory 802. The memory is used to store computer programs, and the processor is used to execute any of the page request processing methods implemented by the user terminal 110 in this embodiment of the present disclosure under the control of the computer programs.
[0171] Furthermore, this disclosure also provides a server 900, such as... Figure 9 As shown, the server includes at least one processor 901 and at least one memory 902, the memory for storing a computer program, and the processor for executing, under the control of the computer program, any of the page request processing methods implemented by the target server according to the embodiments of this disclosure.
[0172] Furthermore, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements a page request processing method according to any embodiment of this disclosure. This computer program is also known as an edge program running on edge device 121.
[0173] The various embodiments in this specification are described in a progressive manner. For the same or similar parts between the various embodiments, please refer to each other. Each embodiment focuses on describing the differences from other embodiments. For related parts, please refer to the description of the method embodiment.
[0174] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0175] Embodiments of this specification may be devices, methods, and / or computer program products. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the embodiments of this specification.
[0176] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0177] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0178] Computer program instructions used to perform the operations of the embodiments described herein may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of the embodiments described herein.
[0179] Various aspects of embodiments of this specification are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of this specification. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0180] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0181] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0182] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this specification. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be well known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.
[0183] Various embodiments of this specification have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A page request processing method, characterized in that, include: Obtain image identification information for the corresponding target page provided by the target server; wherein, before storing the image information, the target server stores historical image information corresponding to the target page, and the image identification information is determined based on the historical image information; Based on the image identification information, a corresponding image pre-request is sent to the target server; wherein, the image pre-request is performed in parallel with at least one other file request corresponding to the target page; Receive the page image returned by the target server according to the image pre-request, and save the received page image locally; Based on the user's input of the target page, obtain the image address of the page image of the target page; The system retrieves the page image corresponding to the image address locally and uploads the image address to the target server for storage of image information corresponding to the target page; wherein, the image information represents the image address associated with the target page; The target page is rendered and displayed based on the obtained page images.
2. The method according to claim 1, characterized in that, The image identification information is an image address index configured according to the interface provided by the target server, wherein the interface maps the image address index to the image address of the page image, and the mapping relationship corresponding to the interface is determined according to the historical image information.
3. The method according to claim 2, characterized in that, The image pre-request and the corresponding page request for the target page are performed in parallel, wherein the page request is used to request the main document of the target page.
4. The method according to claim 1, characterized in that, Before obtaining the image address of the page image of the target page, the method further includes: Based on the user's input to load the target page, a page request for the target page is sent to the target server; Receive the main document of the target page returned by the target server in response to the page request; The step of obtaining the image identification information corresponding to the target page provided by the target server includes: Extract the image identification information corresponding to the target page from the main document; wherein the image identification information is injected by the target server into the main document returned according to the page request, and the image identification information injected into the main document is determined based on the historical image information.
5. The method according to claim 4, characterized in that, The image pre-request is performed in parallel with at least one of the script file request and style file request corresponding to the target page, wherein the script file request is a request for obtaining the script file imported by the main document, and the style file request is a request for obtaining the style file imported by the main document.
6. The method according to any one of claims 1 to 4, characterized in that, The target server is a content delivery network node.
7. A page request processing method, characterized in that, include: The system receives a pre-request for an image corresponding to a target page sent by a user terminal; wherein the pre-request carries image identification information corresponding to the target page, the image identification information is determined based on historical image information corresponding to the target page, and the pre-request is performed in parallel with at least one other file request from the user terminal corresponding to the target page; According to the image pre-request, the page image corresponding to the image identification information is obtained, and the page image is returned to the user terminal for storage; wherein, the page image stored on the user terminal is used by the user terminal to obtain the corresponding page image from the local machine according to the obtained image address of the target page; Receive the image address of the target page uploaded by the user terminal; wherein the image address of the target page is obtained by the user terminal based on the user's input of loading the target page; Based on the received image address, update the image information corresponding to the target page; wherein, the image information represents the image address associated with the target page, and the image information is used to respond to the image pre-request corresponding to the target page.
8. The method according to claim 7, characterized in that, Before receiving the image pre-request corresponding to the target page sent by the user terminal, the method includes: An interface for configuring image address indexes is provided; wherein, the interface maps the image address indexes to the image addresses of the page images, the mapping relationship corresponding to the interface is determined based on historical image information corresponding to the target page, and the image identification information is the image address index configured by the user terminal according to the interface.
9. The method according to claim 7, characterized in that, Before receiving the image address of the target page uploaded by the user terminal, the method further includes: Receive a page request for a corresponding target page sent by the user terminal; wherein the page request is triggered based on the user's input to load the target page; Based on the page request, obtain the main document of the target page and the corresponding historical image information of the target page; Based on the historical image information, determine the image address of the page image of the target page; The image address is injected into the main document, and the main document with the injected image address is returned to the user terminal; wherein, the image identification information is the image address of the page image extracted from the main document.
10. A user terminal, characterized in that, It includes at least one processor and at least one memory, the memory being used to store a computer program, and the processor being used, under the control of the computer program, to execute the page request processing method according to any one of claims 1 to 6.
11. A server, characterized in that, It includes at least one processor and at least one memory, the memory being used to store a computer program, and the processor being used, under the control of the computer program, to execute the page request processing method according to any one of claims 7 to 9.
12. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the page request processing method as described in any one of claims 1 to 9.